Skip to contentSkip to conversation

hwconfig and some its users

PATCH Superseded Anton Vorontsov 4 participants 30 messages Jun 9, 2009 – Jul 21, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover hwconfig and some its users

Quoted 22 lines · Wolfgang Denk

Dear Anton,

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

This patch implements simple hwconfig infrastructure: an interface for software knobs to control a hardware.

Thanks a lot.

Quoted 8 lines

3. We support hwconfig options with arguments. For example,

set hwconfig dr_usb,dr_usb_mode:peripheral,dr_usb_phy_type:ulpi

There are three hwconfig options selected:
1. dr_usb - enable Dual-Role USB controller;
2. dr_usb_mode:peripheral - USB in Function mode;
3. dr_usb_phy_type:ulpi - USB should work with ULPI PHYs.

That gives a lot of typing, which in turn results in lots of typing errors, which in this case are probably nasty to debug.

Suggestion: instead of

Quoted 7 lines

set hwconfig dr_usb,dr_usb_mode:peripheral,dr_usb_phy_type:ulpi

use:

set hwconfig dr_usb:mode=peripheral,phy_type=ulpi

What do you think?

Sorry for the delay. Done.
New patches on the way.

Thanks,

Signature · 3 lines
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2
#1 lore raw

PATCH v3 1/8 Add simple hwconfig infrastructure

This patch implements simple hwconfig infrastructure: an interface for software knobs to control a hardware.

This is very simple implementation, i.e. it is implemented via `hwconfig' environment variable. Later we could write some "hwconfig <enable|disable|list>" commands, ncurses interface for Award BIOS-like interface, and frame-buffer interface for AMI GUI[1] BIOS-like interface with mouse support[2].

Current implementation details/limitations:

1. Doesn't support options dependencies and mutual exclusion. We can implement this by integrating apt-get[3] into the u-boot. But I didn't bother yet.

2. Since we don't implement hwconfig command, i.e. we're working with the environement directly, there is no way to tell that toggling a particular option will need a reboot to take an effect. So, for now it's advised to always reboot the target after modifying hwconfig variable.

3. We support hwconfig options with arguments. For example,

set hwconfig dr_usb:mode=peripheral,phy_type=ulpi

That means:
- dr_usb - enable Dual-Role USB controller;
- dr_usb:mode=peripheral - USB in Function mode;
- dr_usb:phy_type=ulpi - USB should work with ULPI PHYs;

The purpose of this simple implementation is to define some internal API and then we can continue improving user experience by adding more mature interface, like hwconfig command with bells and whistles. Or not adding, if we feel that current interface fits its needs.

[1] http://en.wikipedia.org/wiki/American_Megatrends
[2] Regarding ncurses and GUI with mouse support -- I'm just kidding.
[3] The comment regarding apt-get is also a joke, meaning that dependency tracking could be non-trivial. For example, for enabling HW feature X we may need to disable Y, and turn Z into reduced mode (like RMII-only interface for ethernet, no MII).

It's quite trivial to implement simple cases though.

---
 common/Makefile    |    1 +
 common/hwconfig.c  |  210 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/hwconfig.h |   69 +++++++++++++++++
 3 files changed, 280 insertions(+), 0 deletions(-)
 create mode 100644 common/hwconfig.c
 create mode 100644 include/hwconfig.h
common/Makefile +1 -0
index b9f4ca7..41d6b3d 100644
@@ -150,6 +150,7 @@ COBJS-$(CONFIG_VFD) += cmd_vfd.o
 # others
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 COBJS-$(CONFIG_CMD_DOC) += docecc.o
+COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
 COBJS-y += flash.o
 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
common/hwconfig.c new file +210 -0

210 lines not on this page · raw message

include/hwconfig.h new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
1.6.3.1
#2 lore raw

PATCH v3 1/8 Add simple hwconfig infrastructure

Dear Anton Vorontsov,

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

This patch implements simple hwconfig infrastructure: an interface for software knobs to control a hardware.

This is very simple implementation, i.e. it is implemented via `hwconfig' environment variable. Later we could write some "hwconfig <enable|disable|list>" commands, ncurses interface for Award BIOS-like interface, and frame-buffer interface for AMI GUI[1] BIOS-like interface with mouse support[2].

Current implementation details/limitations:

1. Doesn't support options dependencies and mutual exclusion. We can implement this by integrating apt-get[3] into the u-boot. But I didn't bother yet.

2. Since we don't implement hwconfig command, i.e. we're working with the environement directly, there is no way to tell that toggling a particular option will need a reboot to take an effect. So, for now it's advised to always reboot the target after modifying hwconfig variable.

3. We support hwconfig options with arguments. For example,

set hwconfig dr_usb:mode=peripheral,phy_type=ulpi

That means:
- dr_usb - enable Dual-Role USB controller;
- dr_usb:mode=peripheral - USB in Function mode;
- dr_usb:phy_type=ulpi - USB should work with ULPI PHYs;

The purpose of this simple implementation is to define some internal API and then we can continue improving user experience by adding more mature interface, like hwconfig command with bells and whistles. Or not adding, if we feel that current interface fits its needs.

[1] http://en.wikipedia.org/wiki/American_Megatrends
[2] Regarding ncurses and GUI with mouse support -- I'm just kidding.
[3] The comment regarding apt-get is also a joke, meaning that dependency tracking could be non-trivial. For example, for enabling HW feature X we may need to disable Y, and turn Z into reduced mode (like RMII-only interface for ethernet, no MII).

It's quite trivial to implement simple cases though.

Quoted 8 lines
---
 common/Makefile    |    1 +
 common/hwconfig.c  |  210 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/hwconfig.h |   69 +++++++++++++++++
 3 files changed, 280 insertions(+), 0 deletions(-)
 create mode 100644 common/hwconfig.c
 create mode 100644 include/hwconfig.h

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 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
The games have always  strengthened  us.  Death  becomes  a  familiar
pattern. We don't fear it as you do.
	-- Proconsul Marcus Claudius, "Bread and Circuses",
	   stardate 4041.2
#3 lore raw

PATCH v3 2/8 fsl_esdhc: Add device tree fixups

In reply to Anton Vorontsov

This patch implements fdt_fixup_esdhc() function that is used to fixup the device tree.

The function adds status = "disabled" propery if esdhc pins muxed away, otherwise it fixups clock-frequency for esdhc nodes.

---
 drivers/mmc/fsl_esdhc.c |   19 +++++++++++++++++++
 include/fsl_esdhc.h     |    8 ++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
drivers/mmc/fsl_esdhc.c +19 -0
index 0ba45cd..34af32b 100644
@@ -28,11 +28,13 @@
 #include <config.h>
 #include <common.h>
 #include <command.h>
+#include <hwconfig.h>
 #include <mmc.h>
 #include <part.h>
 #include <malloc.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
+#include <fdt_support.h>
 #include <asm/io.h>
 
 
@@ -346,3 +348,20 @@ int fsl_esdhc_mmc_init(bd_t *bis)
 {
 	return esdhc_initialize(bis);
 }
+
+void fdt_fixup_esdhc(void *blob, bd_t *bd)
+{
+	const char *compat = "fsl,esdhc";
+	const char *status = "okay";
+
+	if (!hwconfig("esdhc")) {
+		status = "disabled";
+		goto out;
+	}
+
+	do_fixup_by_compat_u32(blob, compat, "clock-frequency",
+			       gd->sdhc_clk, 1);
+out:
+	do_fixup_by_compat(blob, compat, "status", status,
+			   strlen(status) + 1, 1);
+}
include/fsl_esdhc.h +8 -0
index 0a5c5d6..89b8304 100644
@@ -26,6 +26,8 @@
 #ifndef  __FSL_ESDHC_H__
 #define	__FSL_ESDHC_H__
 
+#include <asm/errno.h>
+
 /* FSL eSDHC-specific constants */
 #define SYSCTL			0x0002e02c
 #define SYSCTL_INITA		0x08000000
@@ -140,6 +142,12 @@
 #define ESDHC_HOSTCAPBLT_DMAS	0x00400000
 #define ESDHC_HOSTCAPBLT_HSS	0x00200000
 
+#ifdef CONFIG_FSL_ESDHC
 int fsl_esdhc_mmc_init(bd_t *bis);
+void fdt_fixup_esdhc(void *blob, bd_t *bd);
+#else
+static inline int fsl_esdhc_mmc_init(bd_t *bis) { return -ENOSYS; }
+static inline void fdt_fixup_esdhc(void *blob, bd_t *bd) {}
+#endif /* CONFIG_FSL_ESDHC */
 
 #endif  /* __FSL_ESDHC_H__ */
Signature · 1 line
1.6.3.1
#4 lore raw

PATCH v3 2/8 fsl_esdhc: Add device tree fixups

Dear Anton Vorontsov,

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

This patch implements fdt_fixup_esdhc() function that is used to fixup the device tree.

The function adds status = "disabled" propery if esdhc pins muxed away, otherwise it fixups clock-frequency for esdhc nodes.

---
 drivers/mmc/fsl_esdhc.c |   19 +++++++++++++++++++
 include/fsl_esdhc.h     |    8 ++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 8 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
When dreams become more important than reality, you give  up  travel,
building,  creating;  you even forget how to repair the machines left
behind by your ancestors. You just  sit  living  and  reliving  other
lives left behind in the thought records.
	-- Vina, "The Menagerie" ("The Cage"), stardate unknown
#5 lore raw

PATCH v3 3/8 mpc83xx: MPC837XERDB: Add support for FSL eSDHC

In reply to Anton Vorontsov

This patch adds support for eSDHC on MPC837XERDB boards. The WP switch doesn't seem to work on RDB boards though, the WP pin is always asserted (can see the pin state when it's in GPIO mode).

FSL DR USB and FSL eSDHC are mutually exclusive because of pins multiplexing, so user should specify 'esdhc' or 'dr_usb' options in the hwconfig environment variable to choose between the devices.

p.s.
Now we're very close to a monitor len limit (196 bytes left using gcc-4.2.0), so also increase the monitor len by one sector (64 KB).

---
 board/freescale/mpc837xerdb/mpc837xerdb.c |   18 ++++++++++++++++++
 include/configs/MPC837XERDB.h             |   18 +++++++++++++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
board/freescale/mpc837xerdb/mpc837xerdb.c +18 -0
index 318a3dc..2229657 100644
@@ -13,12 +13,14 @@
  */
 
 #include <common.h>
+#include <hwconfig.h>
 #include <i2c.h>
 #include <asm/io.h>
 #include <asm/fsl_serdes.h>
 #include <fdt_support.h>
 #include <spd_sdram.h>
 #include <vsc7385.h>
+#include <fsl_esdhc.h>
 
 #if defined(CONFIG_SYS_DRAM_TEST)
 int
@@ -166,6 +168,21 @@ int board_early_init_f(void)
 	return 0;
 }
 
+#ifdef CONFIG_FSL_ESDHC
+int board_mmc_init(bd_t *bd)
+{
+	struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR;
+
+	if (!hwconfig("esdhc"))
+		return 0;
+
+	clrsetbits_be32(&im->sysconf.sicrl, SICRL_USB_B, SICRL_USB_B_SD);
+	clrsetbits_be32(&im->sysconf.sicrh, SICRH_SPI, SICRH_SPI_SD);
+
+	return fsl_esdhc_mmc_init(bd);
+}
+#endif
+
 /*
  * Miscellaneous late-boot configurations
  *
@@ -195,5 +212,6 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 	ft_cpu_setup(blob, bd);
 	fdt_fixup_dr_usb(blob, bd);
+	fdt_fixup_esdhc(blob, bd);
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
include/configs/MPC837XERDB.h +17 -1
index 8d0c93b..d335d76 100644
@@ -34,6 +34,7 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_MISC_INIT_R
+#define CONFIG_HWCONFIG
 
 /*
  * On-board devices
@@ -228,7 +229,7 @@
 #undef	CONFIG_SYS_RAMBOOT
 #endif
 
-#define CONFIG_SYS_MONITOR_LEN		(256 * 1024) /* Reserve 256 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN		(320 * 1024) /* Reserve 320 kB for Mon */
 #define CONFIG_SYS_MALLOC_LEN		(512 * 1024) /* Reserved for malloc */
 
 /*
@@ -342,6 +343,9 @@
 #define CONFIG_OF_BOARD_SETUP	1
 #define CONFIG_OF_STDOUT_VIA_ALIAS 1
 
+#define CONFIG_SYS_64BIT_STRTOUL		1
+#define CONFIG_SYS_64BIT_VSPRINTF		1
+
 /* I2C */
 #define CONFIG_HARD_I2C		/* I2C with hardware support */
 #undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
@@ -510,6 +514,18 @@
 
 #undef CONFIG_WATCHDOG		/* watchdog disabled */
 
+#define CONFIG_MMC     1
+
+#ifdef CONFIG_MMC
+#define CONFIG_FSL_ESDHC
+#define CONFIG_SYS_FSL_ESDHC_ADDR	CONFIG_SYS_MPC83xx_ESDHC_ADDR
+#define CONFIG_CMD_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_DOS_PARTITION
+#endif
+
 /*
  * Miscellaneous configurable options
  */
Signature · 1 line
1.6.3.1
#6 lore raw

PATCH v3 3/8 mpc83xx: MPC837XERDB: Add support for FSL eSDHC

Dear Anton Vorontsov,

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

This patch adds support for eSDHC on MPC837XERDB boards. The WP switch doesn't seem to work on RDB boards though, the WP pin is always asserted (can see the pin state when it's in GPIO mode).

FSL DR USB and FSL eSDHC are mutually exclusive because of pins multiplexing, so user should specify 'esdhc' or 'dr_usb' options in the hwconfig environment variable to choose between the devices.

p.s.
Now we're very close to a monitor len limit (196 bytes left using gcc-4.2.0), so also increase the monitor len by one sector (64 KB).

Quoted 5 lines
---
 board/freescale/mpc837xerdb/mpc837xerdb.c |   18 ++++++++++++++++++
 include/configs/MPC837XERDB.h             |   18 +++++++++++++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)

Applied, thanks.

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
"I didn't know it was impossible when I did it."
#7 lore raw

PATCH v3 4/8 mpc83xx: MPC837XEMDS: Fixup eSDHC nodes in device tree

In reply to Anton Vorontsov

fdt_fixup_esdhc() will either disable or enable eSDHC nodes, and also will fixup clock-frequency property.

Plus, since DR USB and eSDHC are mutually exclusive, we should only configure the eSDHC if asked through hwconfig.

---
 board/freescale/mpc837xemds/mpc837xemds.c |   37 ++++++++++++++++++----------
 include/configs/MPC837XEMDS.h             |    1 +
 2 files changed, 25 insertions(+), 13 deletions(-)
board/freescale/mpc837xemds/mpc837xemds.c +24 -13
index 062d762..5d3cea1 100644
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <hwconfig.h>
 #include <i2c.h>
 #include <asm/io.h>
 #include <asm/fsl_serdes.h>
@@ -18,12 +19,12 @@
 #include <tsec.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <fsl_esdhc.h>
 #include "pci.h"
 #include "../common/pq-mds-pib.h"
 
 int board_early_init_f(void)
 {
-	struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR;
 	u8 *bcsr = (u8 *)CONFIG_SYS_BCSR;
 
 	/* Enable flash write */
@@ -31,18 +32,6 @@ int board_early_init_f(void)
 	/* Clear all of the interrupt of BCSR */
 	bcsr[0xe] = 0xff;
 
-#ifdef CONFIG_MMC
-	/* Set SPI_SD, SER_SD, and IRQ4_WP so that SD signals go through */
-	bcsr[0xc] |= 0x4c;
-
-	/* Set proper bits in SICR to allow SD signals through */
-	clrsetbits_be32(&im->sysconf.sicrl, SICRL_USB_B, SICRL_USB_B_SD);
-
-	clrsetbits_be32(&im->sysconf.sicrh, (SICRH_GPIO2_E | SICRH_SPI),
-			(SICRH_GPIO2_E_SD | SICRH_SPI_SD));
-
-#endif
-
 #ifdef CONFIG_FSL_SERDES
 	immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 	u32 spridr = in_be32(&immr->sysconf.spridr);
@@ -72,6 +61,27 @@ int board_early_init_f(void)
 	return 0;
 }
 
+#ifdef CONFIG_FSL_ESDHC
+int board_mmc_init(bd_t *bd)
+{
+	struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR;
+	u8 *bcsr = (u8 *)CONFIG_SYS_BCSR;
+
+	if (!hwconfig("esdhc"))
+		return 0;
+
+	/* Set SPI_SD, SER_SD, and IRQ4_WP so that SD signals go through */
+	bcsr[0xc] |= 0x4c;
+
+	/* Set proper bits in SICR to allow SD signals through */
+	clrsetbits_be32(&im->sysconf.sicrl, SICRL_USB_B, SICRL_USB_B_SD);
+	clrsetbits_be32(&im->sysconf.sicrh, SICRH_GPIO2_E | SICRH_SPI,
+			SICRH_GPIO2_E_SD | SICRH_SPI_SD);
+
+	return fsl_esdhc_mmc_init(bd);
+}
+#endif
+
 #if defined(CONFIG_TSEC1) || defined(CONFIG_TSEC2)
 int board_eth_init(bd_t *bd)
 {
@@ -322,6 +332,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 	ft_cpu_setup(blob, bd);
 	ft_tsec_fixup(blob, bd);
 	fdt_fixup_dr_usb(blob, bd);
+	fdt_fixup_esdhc(blob, bd);
 #ifdef CONFIG_PCI
 	ft_pci_setup(blob, bd);
 	if (board_pci_host_broken())
include/configs/MPC837XEMDS.h +1 -0
index a62d805..9413b29 100644
@@ -111,6 +111,7 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F /* call board_pre_init */
 #define CONFIG_BOARD_EARLY_INIT_R
+#define CONFIG_HWCONFIG
 
 /*
  * IMMR new address
Signature · 1 line
1.6.3.1
#8 lore raw

PATCH v3 4/8 mpc83xx: MPC837XEMDS: Fixup eSDHC nodes in device tree

Dear Anton Vorontsov,

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

fdt_fixup_esdhc() will either disable or enable eSDHC nodes, and also will fixup clock-frequency property.

Plus, since DR USB and eSDHC are mutually exclusive, we should only configure the eSDHC if asked through hwconfig.

---
 board/freescale/mpc837xemds/mpc837xemds.c |   37 ++++++++++++++++++----------
 include/configs/MPC837XEMDS.h             |    1 +
 2 files changed, 25 insertions(+), 13 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 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
In the bathtub of history the truth is harder to hold than the  soap,
and much more difficult to find ...     - Terry Pratchett, _Sourcery_
#9 lore raw

PATCH v3 5/8 fdt_support, usb: Move fdt_fixup_dr_usb routine to drivers/usb/otg

In reply to Anton Vorontsov

In subsequent patches we'll use FSL-specific functions in fdt_fixup_dr_usb(), so let's move the routine to a more appropriate place.

So far fsl_dr_usb.c isn't actually an USB driver, but eventually it will turn into one, let's hope. ;-)

Also rename CONFIG_HAS_FSL_DR_USB to CONFIG_USB_FSL_DR to be consistent with other USB drivers.

---
 Makefile                                  |    1 +
 board/freescale/mpc8315erdb/mpc8315erdb.c |    1 +
 board/freescale/mpc837xemds/mpc837xemds.c |    1 +
 board/freescale/mpc837xerdb/mpc837xerdb.c |    1 +
 common/fdt_support.c                      |   41 ----------------------
 drivers/usb/otg/Makefile                  |   46 +++++++++++++++++++++++++
 drivers/usb/otg/fsl_dr_usb.c              |   52 +++++++++++++++++++++++++++++
 include/configs/MPC8315ERDB.h             |    2 +-
 include/configs/MPC837XEMDS.h             |    2 +-
 include/configs/MPC837XERDB.h             |    2 +-
 include/fdt_support.h                     |    6 ---
 include/fsl_dr_usb.h                      |   21 +++++++++++
 12 files changed, 126 insertions(+), 50 deletions(-)
 create mode 100644 drivers/usb/otg/Makefile
 create mode 100644 drivers/usb/otg/fsl_dr_usb.c
 create mode 100644 include/fsl_dr_usb.h
Makefile +1 -0
index 24e6410..95a7615 100644
@@ -265,6 +265,7 @@ LIBS += drivers/serial/libserial.a
 LIBS += drivers/twserial/libtws.a
 LIBS += drivers/usb/gadget/libusb_gadget.a
 LIBS += drivers/usb/host/libusb_host.a
+LIBS += drivers/usb/otg/libusb_otg.a
 LIBS += drivers/usb/musb/libusb_musb.a
 LIBS += drivers/video/libvideo.a
 LIBS += drivers/watchdog/libwatchdog.a
board/freescale/mpc8315erdb/mpc8315erdb.c +1 -0
index f80b0ba..9d6896d 100644
@@ -30,6 +30,7 @@
 #include <pci.h>
 #include <mpc83xx.h>
 #include <netdev.h>
+#include <fsl_dr_usb.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
board/freescale/mpc837xemds/mpc837xemds.c +1 -0
index 5d3cea1..76b5430 100644
@@ -20,6 +20,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <fsl_esdhc.h>
+#include <fsl_dr_usb.h>
 #include "pci.h"
 #include "../common/pq-mds-pib.h"
 
board/freescale/mpc837xerdb/mpc837xerdb.c +1 -0
index 2229657..e8fa6b6 100644
@@ -21,6 +21,7 @@
 #include <spd_sdram.h>
 #include <vsc7385.h>
 #include <fsl_esdhc.h>
+#include <fsl_dr_usb.h>
 
 #if defined(CONFIG_SYS_DRAM_TEST)
 int
common/fdt_support.c +0 -41

47 lines not on this page · raw message

drivers/usb/otg/Makefile new file +46 -0

46 lines not on this page · raw message

drivers/usb/otg/fsl_dr_usb.c new file +52 -0

52 lines not on this page · raw message

include/configs/MPC8315ERDB.h +1 -1
index 9fa91f4..e3dcf96 100644
@@ -344,7 +344,7 @@
 #define CONFIG_NET_MULTI	1
 #endif
 
-#define CONFIG_HAS_FSL_DR_USB
+#define CONFIG_USB_FSL_DR	1
 
 /*
  * TSEC
include/configs/MPC837XEMDS.h +1 -1
index 9413b29..631468f 100644
@@ -385,7 +385,7 @@ extern int board_pci_host_broken(void);
 #define CONFIG_83XX_GENERIC_PCIE	1
 #define CONFIG_PQ_MDS_PIB	1 /* PQ MDS Platform IO Board */
 
-#define CONFIG_HAS_FSL_DR_USB	1 /* fixup device tree for the DR USB */
+#define CONFIG_USB_FSL_DR	1 /* fixup device tree for the DR USB */
 
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP		/* do pci plug-and-play */
include/configs/MPC837XERDB.h +1 -1
index d335d76..4f15be5 100644
@@ -654,7 +654,7 @@
 #define CONFIG_ETH1ADDR		00:04:9f:ef:04:02
 #endif
 
-#define CONFIG_HAS_FSL_DR_USB
+#define CONFIG_USB_FSL_DR	1
 
 #define CONFIG_IPADDR		10.0.0.2
 #define CONFIG_SERVERIP		10.0.0.1
include/fdt_support.h +0 -6
index 6062df9..7ee29ef 100644
@@ -53,12 +53,6 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
 			 const void *val, int len, int create);
 void fdt_fixup_qe_firmware(void *fdt);
 
-#ifdef CONFIG_HAS_FSL_DR_USB
-void fdt_fixup_dr_usb(void *blob, bd_t *bd);
-#else
-static inline void fdt_fixup_dr_usb(void *blob, bd_t *bd) {}
-#endif /* CONFIG_HAS_FSL_DR_USB */
-
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC83XX)
 void fdt_fixup_crypto_node(void *blob, int sec_rev);
 #else
include/fsl_dr_usb.h new file +21 -0
new file mode 100644
index 0000000..c14d9ba
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2008-2009 MontaVista Software, Inc.
+ *
+ * Author: Anton Vorontsov <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __DR_USB_H
+#define __DR_USB_H
+
+#ifdef CONFIG_USB_FSL_DR
+void fdt_fixup_dr_usb(void *blob, bd_t *bd);
+#else
+static inline void fdt_fixup_dr_usb(void *blob, bd_t *bd) {}
+#endif
+
+#endif /* __DR_USB_H */
Signature · 1 line
1.6.3.1
#10 lore raw

PATCH v3 5/8 fdt_support, usb: Move fdt_fixup_dr_usb routine to drivers/usb/otg

Dear Anton Vorontsov,

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

In subsequent patches we'll use FSL-specific functions in fdt_fixup_dr_usb(), so let's move the routine to a more appropriate place.

So far fsl_dr_usb.c isn't actually an USB driver, but eventually it will turn into one, let's hope. ;-)

Also rename CONFIG_HAS_FSL_DR_USB to CONFIG_USB_FSL_DR to be consistent with other USB drivers.

---
 Makefile                                  |    1 +
 board/freescale/mpc8315erdb/mpc8315erdb.c |    1 +
 board/freescale/mpc837xemds/mpc837xemds.c |    1 +
 board/freescale/mpc837xerdb/mpc837xerdb.c |    1 +
 common/fdt_support.c                      |   41 ----------------------
 drivers/usb/otg/Makefile                  |   46 +++++++++++++++++++++++++
 drivers/usb/otg/fsl_dr_usb.c              |   52 +++++++++++++++++++++++++++++
 include/configs/MPC8315ERDB.h             |    2 +-
Quoted 8 lines
 include/configs/MPC837XEMDS.h             |    2 +-
 include/configs/MPC837XERDB.h             |    2 +-
 include/fdt_support.h                     |    6 ---
 include/fsl_dr_usb.h                      |   21 +++++++++++
 12 files changed, 126 insertions(+), 50 deletions(-)
 create mode 100644 drivers/usb/otg/Makefile
 create mode 100644 drivers/usb/otg/fsl_dr_usb.c
 create mode 100644 include/fsl_dr_usb.h

Sorry, this patch doesn't apply:

Applying: fdt_support, usb: Move fdt_fixup_dr_usb routine to drivers/usb/otg
error: patch failed: common/fdt_support.c:454
error: common/fdt_support.c: patch does not apply
error: patch failed: include/configs/MPC8315ERDB.h:344
error: include/configs/MPC8315ERDB.h: patch does not apply
error: patch failed: include/fdt_support.h:53
error: include/fdt_support.h: patch does not apply
fatal: sha1 information is lacking or useless (board/freescale/mpc837xemds/mpc837xemds.c). Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0005.

Please rebase and resubmit.

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
If it has syntax, it isn't user friendly.
#11 lore raw

PATCH v3 5/8 fdt_support, usb: Move fdt_fixup_dr_usb routine to drivers/usb/otg

In reply to Anton Vorontsov

Dear Anton Vorontsov,

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

In subsequent patches we'll use FSL-specific functions in fdt_fixup_dr_usb(), so let's move the routine to a more appropriate place.

So far fsl_dr_usb.c isn't actually an USB driver, but eventually it will turn into one, let's hope. ;-)

Also rename CONFIG_HAS_FSL_DR_USB to CONFIG_USB_FSL_DR to be consistent with other USB drivers.

---
 Makefile                                  |    1 +
 board/freescale/mpc8315erdb/mpc8315erdb.c |    1 +
 board/freescale/mpc837xemds/mpc837xemds.c |    1 +
 board/freescale/mpc837xerdb/mpc837xerdb.c |    1 +
 common/fdt_support.c                      |   41 ----------------------
 drivers/usb/otg/Makefile                  |   46 +++++++++++++++++++++++++
 drivers/usb/otg/fsl_dr_usb.c              |   52 +++++++++++++++++++++++++++++
 include/configs/MPC8315ERDB.h             |    2 +-
Quoted 8 lines
 include/configs/MPC837XEMDS.h             |    2 +-
 include/configs/MPC837XERDB.h             |    2 +-
 include/fdt_support.h                     |    6 ---
 include/fsl_dr_usb.h                      |   21 +++++++++++
 12 files changed, 126 insertions(+), 50 deletions(-)
 create mode 100644 drivers/usb/otg/Makefile
 create mode 100644 drivers/usb/otg/fsl_dr_usb.c
 create mode 100644 include/fsl_dr_usb.h

Sorry, doesn't apply:

Applying: fsl_dr_usb: Fixup disabled USB controllers nodes in device tree
error: drivers/usb/otg/fsl_dr_usb.c: does not exist in index
fatal: sha1 information is lacking or useless (drivers/usb/otg/fsl_dr_usb.c).
Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge.
Patch failed at 0006.

Please rebase and resubmit.

Best regards,

Wolfgang Denk

Signature · 5 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
"The two most common things in the universe are hydrogen  and  stupi-
dity."
#12 lore raw

PATCH v3 6/8 fsl_dr_usb: Fixup disabled USB controllers nodes in device tree

In reply to Anton Vorontsov

We should add status = "disabled" property when USB controller can't be used (for example when USB pins muxed away to another device).

Also convert whole fdt_fixup_dr_usb() to use more compact routines from fdt_support.h.

---
 cpu/mpc83xx/cpu.c            |    4 +++
 drivers/usb/otg/fsl_dr_usb.c |   60 ++++++++++++++++++++++++-----------------
 2 files changed, 39 insertions(+), 25 deletions(-)
cpu/mpc83xx/cpu.c +4 -0
index 876f5c7..034958c 100644
@@ -404,6 +404,10 @@ int cpu_mmc_init(bd_t *bis)
 #endif
 }
 
+#ifdef CONFIG_HWCONFIG
+const char *cpu_hwconfig = "dr_usb";
+#endif
+
 #ifdef CONFIG_BOOTCOUNT_LIMIT
 
 #if !defined(CONFIG_MPC8360)
drivers/usb/otg/fsl_dr_usb.c +35 -25

78 lines not on this page · raw message

Signature · 1 line
1.6.3.1
#13 lore raw

PATCH v3 6/8 fsl_dr_usb: Fixup disabled USB controllers nodes in device tree

Dear Anton Vorontsov,

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

We should add status = "disabled" property when USB controller can't be used (for example when USB pins muxed away to another device).

Also convert whole fdt_fixup_dr_usb() to use more compact routines from fdt_support.h.

---
 cpu/mpc83xx/cpu.c            |    4 +++
 drivers/usb/otg/fsl_dr_usb.c |   60 ++++++++++++++++++++++++-----------------
 2 files changed, 39 insertions(+), 25 deletions(-)

[Oops, please ignore previous reply to wrong patch submission.]

Does not apply:

Applying: fsl_dr_usb: Fixup disabled USB controllers nodes in device tree
error: drivers/usb/otg/fsl_dr_usb.c: does not exist in index
fatal: sha1 information is lacking or useless (drivers/usb/otg/fsl_dr_usb.c).
Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge.
Patch failed at 0006.

Please rebase and resubmit.

Best regards,

Wolfgang Denk

Signature · 6 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
Punishment becomes ineffective after a certain point. Men become  in-
sensitive.
	-- Eneg, "Patterns of Force", stardate 2534.7
#14 lore raw

PATCH v3 7/8 mpc83xx: MPC8315ERDB: Use hwconfig for board type selection

In reply to Anton Vorontsov

This patch simply converts the board to the hwconfig infrastructure.

---
 board/freescale/mpc8315erdb/mpc8315erdb.c |   14 +++++---------
 include/configs/MPC8315ERDB.h             |    1 +
 2 files changed, 6 insertions(+), 9 deletions(-)
board/freescale/mpc8315erdb/mpc8315erdb.c +5 -9
index 9d6896d..d9cff86 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <hwconfig.h>
 #include <i2c.h>
 #include <libfdt.h>
 #include <fdt_support.h>
@@ -177,20 +178,15 @@ void pci_init_board(void)
 #if defined(CONFIG_OF_BOARD_SETUP)
 void fdt_tsec1_fixup(void *fdt, bd_t *bd)
 {
-	char *mpc8315erdb = getenv("mpc8315erdb");
 	const char disabled[] = "disabled";
 	const char *path;
 	int ret;
 
-	if (!mpc8315erdb)
+	if (hwconfig_arg_cmp("board_type", "tsec1")) {
 		return;
-
-	if (!strcmp(mpc8315erdb, "tsec1")) {
-		return;
-	} else if (strcmp(mpc8315erdb, "ulpi")) {
-		printf("WARNING: wrong `mpc8315erdb' environment "
-		       "variable specified: `%s'. Should be `ulpi' "
-		       "or `tsec1'.\n", mpc8315erdb);
+	} else if (!hwconfig_arg_cmp("board_type", "ulpi")) {
+		printf("NOTICE: No or unknown board_type hwconfig specified.\n"
+		       "        Assuming board with TSEC1.\n");
 		return;
 	}
 
include/configs/MPC8315ERDB.h +1 -0
index e3dcf96..6ed3a9f 100644
@@ -72,6 +72,7 @@
 #define CONFIG_SYS_SICRL		0x00000000 /* 3.3V, no delay */
 
 #define CONFIG_BOARD_EARLY_INIT_F /* call board_pre_init */
+#define CONFIG_HWCONFIG
 
 /*
  * IMMR new address
Signature · 1 line
1.6.3.1
#15 lore raw

PATCH v3 7/8 mpc83xx: MPC8315ERDB: Use hwconfig for board type selection

Dear Anton Vorontsov,

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

This patch simply converts the board to the hwconfig infrastructure.

---
 board/freescale/mpc8315erdb/mpc8315erdb.c |   14 +++++---------
 include/configs/MPC8315ERDB.h             |    1 +
 2 files changed, 6 insertions(+), 9 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 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
"Data is a lot like humans: It is  born.  Matures.  Gets  married  to
other  data, divorced. Gets old. One thing that it doesn't do is die.
It has to be killed."                                 - Arthur Miller
#16 lore raw

PATCH v3 8/8 mpc83xx: MPC837xEMDS: Use hwconfig instead of pci_external_arbiter variable

In reply to Anton Vorontsov

Since we have simple hwconfig interface now, we don't need pci_external_arbiter variable any longer.

---
 board/freescale/mpc837xemds/mpc837xemds.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
board/freescale/mpc837xemds/mpc837xemds.c +1 -2
index 76b5430..4041416 100644
@@ -293,10 +293,9 @@ int board_pci_host_broken(void)
 {
 	struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR;
 	const u32 rcw_mask = HRCWH_PCI1_ARBITER_ENABLE | HRCWH_PCI_HOST;
-	const char *pci_ea = getenv("pci_external_arbiter");
 
 	/* It's always OK in case of external arbiter. */
-	if (pci_ea && !strcmp(pci_ea, "yes"))
+	if (hwconfig_subarg_cmp("pci", "arbiter", "external"))
 		return 0;
 
 	if ((in_be32(&im->reset.rcwh) & rcw_mask) != rcw_mask)
Signature · 1 line
1.6.3.1
#17 lore raw

PATCH v3 8/8 mpc83xx: MPC837xEMDS: Use hwconfig instead of pci_external_arbiter variable

Dear Anton Vorontsov,

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

Since we have simple hwconfig interface now, we don't need pci_external_arbiter variable any longer.

---
 board/freescale/mpc837xemds/mpc837xemds.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 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
If there are self-made purgatories, then we all have to live in them.
	-- Spock, "This Side of Paradise", stardate 3417.7
#18 lore raw

v3 cover hwconfig and some its users

In reply to Anton Vorontsov
Quoted 25 lines · On Wed, 10 Jun 2009 00:23:28 +0400 Anton Vorontsov <[email protected]>…
Quoted 24 lines · Wolfgang Denk

Dear Anton,

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

This patch implements simple hwconfig infrastructure: an interface for software knobs to control a hardware.

Thanks a lot.

Quoted 8 lines

3. We support hwconfig options with arguments. For example,

set hwconfig dr_usb,dr_usb_mode:peripheral,dr_usb_phy_type:ulpi

There are three hwconfig options selected:
1. dr_usb - enable Dual-Role USB controller;
2. dr_usb_mode:peripheral - USB in Function mode;
3. dr_usb_phy_type:ulpi - USB should work with ULPI PHYs.

That gives a lot of typing, which in turn results in lots of typing errors, which in this case are probably nasty to debug.

Suggestion: instead of

set hwconfig dr_usb,dr_usb_mode:peripheral,dr_usb_phy_type:ulpi

Quoted 8 lines
Quoted 5 lines

use:

set hwconfig dr_usb:mode=peripheral,phy_type=ulpi

What do you think?

Sorry for the delay. Done.
New patches on the way.

I had made a similar comment to the original hwconfig posting that appears to have been missed:

http://lists.denx.de/pipermail/u-boot/2009-April/051845.html

the existing syntax is flawed, e.g., what is the separator character going to be when you want to configure something more than dr_usb using the syntax used in this patchseries? And can we adopt a syntax that's more familiar (or recognizable) to our users from the outset?

Kim

#19 lore raw

v3 cover hwconfig and some its users

On Thu, Jun 11, 2009 at 09:09:56AM -0500, Kim Phillips wrote:
[...]

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

Suggestion: instead of

set hwconfig dr_usb,dr_usb_mode:peripheral,dr_usb_phy_type:ulpi

use:

set hwconfig dr_usb:mode=peripheral,phy_type=ulpi

What do you think?

Quoted 7 lines
Quoted 2 lines

Sorry for the delay. Done.
New patches on the way.

I had made a similar comment to the original hwconfig posting that appears to have been missed:

http://lists.denx.de/pipermail/u-boot/2009-April/051845.html

I didn't miss it. ;-)

Quoted 3 lines

the existing syntax is flawed, e.g., what is the separator character going to be when you want to configure something more than dr_usb using the syntax used in this patchseries?

The separator between options is ';', between sub-options is ','.

So that would be 'dr_usb:mode=host,phy_type=ulpi; esdhc".

Which translates to

dr_usb {
	mode = host;
	phy_type = ulpi;
};

esdhc;

Quoted 2 lines

And can we adopt a syntax that's
more familiar (or recognizable) to our users from the outset?

Sure, I'm open to suggestions. Originally you proposed this scheme:

set hwconfig "usb=dr; dr_usb_mode=peripheral; dr_usb_phy_type=ulpi"

But Wolfgang proposed options and sub-options to save some typing (notice the repetitive dr_usb), so there should be two assignment symbols and two symbols for separation.

Thanks,

Signature · 3 lines
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2
#20 lore raw

v3 cover hwconfig and some its users

Quoted 15 lines · On Thu, 11 Jun 2009 18:39:43 +0400 Anton Vorontsov <[email protected]>…

On Thu, Jun 11, 2009 at 09:09:56AM -0500, Kim Phillips wrote:
[...]

Quoted 13 lines
Quoted 12 lines
Quoted 9 lines

Suggestion: instead of

set hwconfig dr_usb,dr_usb_mode:peripheral,dr_usb_phy_type:ulpi

use:

set hwconfig dr_usb:mode=peripheral,phy_type=ulpi

What do you think?

Sorry for the delay. Done.
New patches on the way.

Quoted 6 lines
Quoted 4 lines

I had made a similar comment to the original hwconfig posting that appears to have been missed:

http://lists.denx.de/pipermail/u-boot/2009-April/051845.html

I didn't miss it. ;-)

this repost didn't make that instantly clear enough to me ;-)

Quoted 19 lines
Quoted 3 lines

the existing syntax is flawed, e.g., what is the separator character going to be when you want to configure something more than dr_usb using the syntax used in this patchseries?

The separator between options is ';', between sub-options is ','.

So that would be 'dr_usb:mode=host,phy_type=ulpi; esdhc".

Which translates to

dr_usb {
	mode = host;
	phy_type = ulpi;
};

esdhc;

Quoted 2 lines

And can we adopt a syntax that's
more familiar (or recognizable) to our users from the outset?

Quoted 7 lines

Sure, I'm open to suggestions. Originally you proposed this scheme:

set hwconfig "usb=dr; dr_usb_mode=peripheral; dr_usb_phy_type=ulpi"

But Wolfgang proposed options and sub-options to save some typing (notice the repetitive dr_usb), so there should be two assignment symbols and two symbols for separation.

if you don't want to type, things like this are possible but they have to depend on the order given:

dr_usb.mode = host; .phy_type = ulpi; esdhc;

however when automating/scripting concatenation of them, it's useful to not have to depend on their order:

dr_usb.mode = host; esdhc; dr_usb.phy_type = ulpi;

...so as you can see I've come up with the dot ('.') in order to eliminate the less familiar (and therefore more misleading) colon (':').

What do you think?

Kim

p.s., your representation above is the best, but now it's starting to look like the frontend to a C compiler:

"dr_usb { mode = host; phy_type = ulpi; }; esdhc;"

#21 lore raw

v3 cover hwconfig and some its users

Dear Kim Phillips,

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

The separator between options is ';', between sub-options is ','.

So that would be 'dr_usb:mode=host,phy_type=ulpi; esdhc".

...and that's still what I like most of the differnet formats discussed so far.

Quoted 2 lines

if you don't want to type, things like this are possible but they have to depend on the order given:

It's not only about not typing, it's also about being able to read it easily.

Quoted 6 lines

dr_usb.mode = host; .phy_type = ulpi; esdhc;

however when automating/scripting concatenation of them, it's useful to not have to depend on their order:

dr_usb.mode = host; esdhc; dr_usb.phy_type = ulpi;

I see no reason that we need to support such a format. In C, you also cannot mix initializations of fields from different structures :-)

Quoted 1 line

What do you think?

'dr_usb:mode=host,phy_type=ulpi; esdhc" still looks reasonable to me.

Best regards,

Wolfgang Denk

Signature · 5 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
The only time the world beats a path to your door is when you are  in
the bathroom.
#22 lore raw

v3 cover hwconfig and some its users

Quoted 12 lines · On Thu, 11 Jun 2009 18:03:51 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Kim Phillips,

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

The separator between options is ';', between sub-options is ','.

So that would be 'dr_usb:mode=host,phy_type=ulpi; esdhc".

...and that's still what I like most of the differnet formats discussed so far.

Quoted 5 lines
Quoted 2 lines

if you don't want to type, things like this are possible but they have to depend on the order given:

It's not only about not typing, it's also about being able to read it easily.

right, which it currently isn't, due to conflicting precedence levels for the different operator characters chosen.

btw, there should be no severe loss of readability here:

Quoted 1 line
Quoted 1 line

dr_usb.mode = host; .phy_type = ulpi; esdhc;

...

Quoted 7 lines
Quoted 4 lines

however when automating/scripting concatenation of them, it's useful to not have to depend on their order:

dr_usb.mode = host; esdhc; dr_usb.phy_type = ulpi;

I see no reason that we need to support such a format. In C, you also cannot mix initializations of fields from different structures :-)

I view these as regular assignments, not initializations :)

Quoted 3 lines
Quoted 1 line

What do you think?

'dr_usb:mode=host,phy_type=ulpi; esdhc" still looks reasonable to me.

the ':', which, in C, would be as though we're specifying a bit-field, and, in English, has higher precedence than ';' which makes it confusing because ';' is used elsewhere with higher precedence than the ':'. I'd almost prefer a space instead, making:

"dr_usb mode=host, phy_type=ulpi; esdhc"

but the dot operator '.' is the best candidate since it accurately represents /member/ access.

just my 2c.

Kim

#23 lore raw

v3 cover hwconfig and some its users

In reply to Kim Phillips

On Thu, Jun 11, 2009 at 10:55:33AM -0500, Kim Phillips wrote:
[...]

Quoted 8 lines

if you don't want to type, things like this are possible but they have to depend on the order given:

dr_usb.mode = host; .phy_type = ulpi; esdhc;

however when automating/scripting concatenation of them, it's useful to not have to depend on their order:

Quoted 7 lines

dr_usb.mode = host; esdhc; dr_usb.phy_type = ulpi;

...so as you can see I've come up with the dot ('.') in order to eliminate the less familiar (and therefore more misleading) colon (':').

What do you think?

"dr_usb.mode = host; .phy_type = ulpi; esdhc;" <- that isn't obvious that .phy_type is a continuation of dr_usb. :-/

It's kind of more special format then the original...

Quoted 6 lines

Kim

p.s., your representation above is the best, but now it's starting to look like the frontend to a C compiler:

"dr_usb { mode = host; phy_type = ulpi; }; esdhc;"

I like it too:
http://lists.denx.de/pipermail/u-boot/2009-May/051875.html

Wolfgang replied that we should keep things simple, and if we want something complicated we should use device-tree:
http://lists.denx.de/pipermail/u-boot/2009-May/051886.html

Since hwconfig is designed to be *simple* hw configuration interface, I tend to agree with Wolfgang.

Technically we don't need hwconfig, it is only needed to make configuration easier for reference boards that have quite a lot of hw options. Hwconfig can be substituted by

# mw 0x... 0x... # manually modify some bcsrs
# mw 0x... 0x... # manually modify pinmux
# fdt addr ... # now manually fixup the device tree
# fdt set ... ...
# fdt mknode ... ...

In a final product you barely need the hwconfig stuff, because product boards only define things they use (and that's why we must keep things working without CONFIG_HWCONFIG).

Thanks,

Signature · 3 lines
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2
#24 lore raw

v3 cover hwconfig and some its users

Quoted 4 lines · On Thu, 11 Jun 2009 21:01:23 +0400 Anton Vorontsov <[email protected]>…

"dr_usb.mode = host; .phy_type = ulpi; esdhc;" <- that isn't obvious that .phy_type is a continuation of dr_usb. :-/

It's kind of more special format then the original...

special, eh? ;)

Quoted 3 lines

Wolfgang replied that we should keep things simple, and if we want something complicated we should use device-tree:
http://lists.denx.de/pipermail/u-boot/2009-May/051886.html

so until u-boot engulfs the dtc, for the mpc83xx parts:

..in case Wolfgang Denk wants to pick up the entire series and put it in his next branch (appropriate enough).

Kim

#25 lore raw

v3 cover hwconfig and some its users

Quoted 14 lines · Kim Phillips
Quoted 4 lines · On Thu, 11 Jun 2009 21:01:23 +0400 Anton Vorontsov <[email protected]>…

"dr_usb.mode = host; .phy_type = ulpi; esdhc;" <- that isn't obvious that .phy_type is a continuation of dr_usb. :-/

It's kind of more special format then the original...

special, eh? ;)

Quoted 3 lines

Wolfgang replied that we should keep things simple, and if we want something complicated we should use device-tree:
http://lists.denx.de/pipermail/u-boot/2009-May/051886.html

Quoted 6 lines

so until u-boot engulfs the dtc, for the mpc83xx parts:

..in case Wolfgang Denk wants to pick up the entire series and put it in his next branch (appropriate enough).

Hi Kim, Wolfgang,

Any news on this?

Thanks,

Signature · 3 lines
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2
#26 lore raw

v3 cover hwconfig and some its users

Quoted 6 lines · On Tue, 7 Jul 2009 16:19:20 +0400 Anton Vorontsov <[email protected]>…
Quoted 6 lines
Quoted 3 lines

Wolfgang replied that we should keep things simple, and if we want something complicated we should use device-tree:
http://lists.denx.de/pipermail/u-boot/2009-May/051886.html

so until u-boot engulfs the dtc, for the mpc83xx parts:

Quoted 8 lines
Quoted 4 lines

..in case Wolfgang Denk wants to pick up the entire series and put it in his next branch (appropriate enough).

Hi Kim, Wolfgang,

Any news on this?

Wolfgang, if you have no objection, please apply directly.

Thanks,

Kim

#27 lore raw

v3 cover hwconfig and some its users

Dear Kim Phillips,

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

Any news on this?

Wolfgang, if you have no objection, please apply directly.

Done.

Best regards,

Wolfgang Denk

Signature · 6 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
Genius doesn't work on an assembly line basis.  You can't simply say,
"Today I will be brilliant."
	-- Kirk, "The Ultimate Computer", stardate 4731.3
#28 lore raw

v3 cover hwconfig and some its users

Quoted 9 lines · Wolfgang Denk

Dear Kim Phillips,

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

Any news on this?

Wolfgang, if you have no objection, please apply directly.

Done.

Thanks a lot, Wolfgang!

Signature · 3 lines
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2
#29 lore raw

v3 cover hwconfig and some its users

Quoted 6 lines · Anton Vorontsov
Quoted 5 lines · Wolfgang Denk

Dear Kim Phillips,

In message <[email protected]> you

Quoted 1 line · wrote:
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Any news on this?

Wolfgang, if you have no objection, please apply directly.

Done.

Thanks a lot, Wolfgang!

Anton,

Do we need some version of these patches for MPC8536 DS & eSDHC support?

- k