Add USB console support as default on Adder87x board
PATCH 6/14 Add USB console support as default on Adder87x board
modified: include/configs/Adder.h
Adds some CONFIG/CFG variables to support a USB console by default on the Adder87x
---
include/configs/Adder.h | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-)
ff9d3244e19740db4de3a807785893e54d1888b4
include/configs/Adder.h +17 -0
@@ -5,6 +5,9 @@* Support for Analogue&Micro Adder boards family. * Tested on AdderII and Adder87x. * +* Add USB console as default option. +* Bryan O'Donoghue <[email protected]> +* * See file CREDITS for list of people who contributed to this * project. *
@@ -38,6 +41,20 @@#define CONFIG_ETHER_ON_FEC1 #define CONFIG_ETHER_ON_FEC2 +#if 1 +#define CONFIG_USB_DEVICE /* Include UDC driver */ +#define CONFIG_USB_TTY /* Bind the TTY driver to UDC */ +#define CONFIG_USBD_MANUFACTURER "CodeHermit.ie" +#define CONFIG_USBD_PRODUCT_NAME "Das U-Boot" +/* Never use the next two defines in any production system */ +#define CONFIG_USBD_VENDORID 0xFFFF/* Some mythical vendor */ +#define CONFIG_USBD_PRODUCTID 0xFFFF/* Some mythical device */ + +#define CFG_USB_EXTC_CLK 0x02/* Oscillator on EXTC_CLK 2 */ +#define CFG_USB_BRG_CLK 0x04/* or use Baud rate generator 0x04 */ +#define CFG_CONSOLE_IS_IN_ENV +#endif +#if defined(CONFIG_ETHER_ON_FEC1 ) || defined(CONFIG_ETHER_ON_FEC2 )#define CFG_DISCOVER_PHY #define FEC_ENET
PATCH 6/14 Add USB console support as default on Adder87x board
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Bryan O'Donoghue writes:
Bryan> Adds some CONFIG/CFG variables to support a USB console by Bryan> default on the Adder87x
...
Bryan> +#if 1
Bryan> +#define CONFIG_USB_DEVICE /* Include UDC driver */ Bryan> +#define CONFIG_USB_TTY /* Bind the TTY driver to UDC */ Bryan> +#define CONFIG_USBD_MANUFACTURER "CodeHermit.ie" Bryan> +#define CONFIG_USBD_PRODUCT_NAME "Das U-Boot"
The values above are not Adder-specific. Do they need to be copied to configuration files of every board which uses USB console? I think that default values (manufacturer, name, IDs mentioned below) should be defined in a common driver-specific file.
Bryan> +/* Never use the next two defines in any production system */
So why do you use them as default configuration for any Adder board? The default configuration should allow for building working U-Boot image from unchanged source. With such defaults, the sources always must be changed before build. I'd suggest adding another configuration target to the main Makefile for building Adder U-Boot with USB console.
Bryan> +#define CONFIG_USBD_VENDORID 0xFFFF /* Some mythical vendor */
Bryan> +#define CONFIG_USBD_PRODUCTID 0xFFFF /* Some mythical device */
Bryan> +
Bryan> +#define CFG_USB_EXTC_CLK 0x02 /* Oscillator on EXTC_CLK> 2 */
Bryan> +#define CFG_USB_BRG_CLK 0x04 /* or use Baud rate generator 0x04 */
Bryan> +#define CFG_CONSOLE_IS_IN_ENV
Bryan> +#endif
Bryan> +Signature · 4 lines
======================================================================== Yuli Barcohen | Phone +972-9-765-1788 | Software Project Leader yuli at arabellasw.com | Fax +972-9-765-7494 | Arabella Software, Israel ========================================================================
PATCH 6/14 Add USB console support as default on Adder87x board
Quoted 7 lines · On Sun, 28 May 2006 18:41:14 +0300 Yuli Barcohen <[email protected]> wrote:
Bryan> +#define
CONFIG_USB_DEVICE/* Include UDC driver */ Bryan> +#defineCONFIG_USB_TTY/* Bind the TTY driver to UDC */ Bryan> +#defineCONFIG_USBD_MANUFACTURER"CodeHermit.ie" Bryan> +#defineCONFIG_USBD_PRODUCT_NAME"Das U-Boot"The values above are not Adder-specific. Do they need to be copied to configuration files of every board which uses USB console?
Yes they do. CONFIG_USB_DEVICE controls usbdcore_mpc8xx and CONFIG_USB_TTY binds usbtty to usbdcore_mpc8xx, the idea being that somebody might want to support a different sort of high level USB device instead of a console, perhaps, cdc_ethernet or rndis. In such a case CONFIG_USB_DEVICE would be defined but, something like CONFIG_USB_ETHERNET or CONFIG_USB_RNDIS might be defined, instead of CONFIG_USB_TTY.
CONFIG_USBD_MANUFACTURER would be something like "CodeHermit", "Arabella Software" or "Acme" and then CONFIG_USBD_PRODUCT_NAME would be a product name "Acme Product X", so this would usually be very product specific and vendor specific. Since all board-specific configurations are kept in the BoardName.h file, my thought was that this was the appropiate place to define these values.
Quoted 3 lines
I think
that default values (manufacturer, name, IDs mentioned below) should be defined in a common driver-specific file.
If we had use of a Vendor id and two product ids, then would could have a default set of values here, as Linux does.
However in the absence of a generous company giving
U-Boot a VendorID for use with 'n' product id's it wouldn't really be possible for the above values be a default as such.
However I can see some logic to the argument that someone like Arabella might want to have a usbd_vendor.h file, so that multiple vendors could be supported by a board port.
Quoted 3 lines
Bryan> +/* Never use the next two defines in any production system */
So why do you use them as default configuration for any Adder board?
Indeed. Really one should have a Vendor ID, from the USB Implementors Forum, 0xFFFF and 0xFFFF are unassigned and are defined as place holders, which is why the patch to README states that these values need to be defined on a per-vendor basis.
For example were my day-job company to use U-Boot with a USB console in a product, we'd define Vendor to 0x1865 and Product to 0xANumber.
Quoted 3 lines
With such defaults, the sources always must be
changed before build. I'd suggest adding another configuration target to the mainMakefilefor building Adder U-Boot with USB console.
OK. How about if we say that
1) An AdderUSBCons defconfig will be made and
2) A usbd_vendor.h file shall be created, where the _Vendor_ specific defines to the USB console will be defined, thus decoupling the board port from being tied to any specific CONFIG_USBD_MANUFACTURER and so on ?
If this is acceptable to you and everybody else, I'll do that straight away.
Best Regards,
Bryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20060528/cdf05f3d/attachment.pgp
PATCH 6/14 Add USB console support as default on Adder87x board
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Bryan O'Donoghue writes:
Bryan> On Sun, 28 May 2006 18:41:14 +0300 Yuli Barcohen Bryan> <[email protected]> wrote:
Bryan> +#define CONFIG_USB_DEVICE /* Include UDC driver */ Bryan> +#define CONFIG_USB_TTY /* Bind the TTY driver to UDC */ Bryan> +#define CONFIG_USBD_MANUFACTURER "CodeHermit.ie" Bryan> +#define CONFIG_USBD_PRODUCT_NAME "Das U-Boot"
Yuli> The values above are not Adder-specific. Do they need to be Yuli> copied to configuration files of every board which uses USB Yuli> console?
Bryan> Yes they do. CONFIG_USB_DEVICE controls usbdcore_mpc8xx and Bryan> CONFIG_USB_TTY binds usbtty to usbdcore_mpc8xx, the idea Bryan> being that somebody might want to support a different sort of Bryan> high level USB device instead of a console, perhaps, Bryan> cdc_ethernet or rndis. In such a case CONFIG_USB_DEVICE would Bryan> be defined but, something like CONFIG_USB_ETHERNET or Bryan> CONFIG_USB_RNDIS might be defined, instead of CONFIG_USB_TTY.
Bryan> CONFIG_USBD_MANUFACTURER would be something like Bryan> "CodeHermit", "Arabella Software" or "Acme" and then Bryan> CONFIG_USBD_PRODUCT_NAME would be a product name "Acme Bryan> Product X", so this would usually be very product specific Bryan> and vendor specific. Since all board-specific configurations Bryan> are kept in the BoardName.h file, my thought was that this Bryan> was the appropiate place to define these values.
I'm afraid in most cases they just will be cloned from board to board so I thought it's better to have them in a separate USB-specific file. The defaults always can be overwritten by board-specific values from BoardName.h.
Yuli> I think that default values (manufacturer, name, IDs mentioned Yuli> below) should be defined in a common driver-specific file.
Bryan> If we had use of a Vendor id and two product ids, then would Bryan> could have a default set of values here, as Linux does. Bryan> However in the absence of a generous company giving U-Boot a Bryan> VendorID for use with 'n' product id's it wouldn't really be Bryan> possible for the above values be a default as such.
Not sure I understood why can't we use default IDs from the Linux USB gadget driver generously donated by NetChip? I suspect that in most cases in which U-Boot USB console is used, Linux USB serial device will be used too so it would make sense to have the same IDs.
Bryan> However I can see some logic to the argument that someone Bryan> like Arabella might want to have a usbd_vendor.h file, so Bryan> that multiple vendors could be supported by a board port.
Bryan> +/* Never use the next two defines in any production system Bryan> */
Yuli> So why do you use them as default configuration for any Adder Yuli> board?
Bryan> Indeed. Really one should have a Vendor ID, from the USB Bryan> Implementors Forum, 0xFFFF and 0xFFFF are unassigned and are Bryan> defined as place holders, which is why the patch to README Bryan> states that these values need to be defined on a per-vendor Bryan> basis. For example were my day-job company to use U-Boot with Bryan> a USB console in a product, we'd define Vendor to 0x1865 and Bryan> Product to 0xANumber.
Yuli> With such defaults, the sources always must be changed before Yuli> build. I'd suggest adding another configuration target to the Yuli> main Makefile for building Adder U-Boot with USB console.
Bryan> OK. How about if we say that
Bryan> 1) An AdderUSBCons defconfig will be made and Bryan> 2) A usbd_vendor.h file shall be created, where the _Vendor_
Bryan> specific defines to the USB console will be defined, thus
Bryan> decoupling the board port from being tied to any specific
Bryan> CONFIG_USBD_MANUFACTURER and so on ?
Sounds OK to me.
Bryan> If this is acceptable to you and everybody else, I'll do that Bryan> straight away.
Signature · 4 lines
======================================================================== Yuli Barcohen | Phone +972-9-765-1788 | Software Project Leader yuli at arabellasw.com | Fax +972-9-765-7494 | Arabella Software, Israel ========================================================================
PATCH 6/14 Add USB console support as default on Adder87x board
Quoted 4 lines · On Sun, 28 May 2006 20:53:58 +0300 Yuli Barcohen <[email protected]> wrote:
I'm afraid in most cases they just will be cloned from board to board so I thought it's better to have them in a separate USB-specific file. The defaults always can be overwritten by board-specific values from
BoardName.h.
Actually I agree with you here. That makes a lot of sense to me.
Quoted 4 lines
Not sure I understood why can't we use default IDs from the Linux USB gadget driver generously donated by NetChip? I suspect that in most cases in which U-Boot USB console is used, Linux USB serial device will be used too so it would make sense to have the same IDs.
Perhaps we can. I've sent an email to linux-usb-devel asking this specific question. If the answer is yes, then we can use the Linux Vendor/Product ID's if not then I suggest 0xFFFF as a fallback position with a entry in the README in big red letters, stating that the Vendor/Product ID stuff *must* be changed.
Quoted 7 lines
Bryan> 1) An AdderUSBCons defconfig will be made and Bryan> 2) A
usbd_vendor.hfile shall be created, where the _Vendor_
Bryan> specific defines to the USB console will be defined, thus
Bryan> decoupling the board port from being tied to any specific
Bryan>CONFIG_USBD_MANUFACTURERand so on ?Sounds OK to me.
Right-o then Yuli. I'll get straight onto that.
Best Regards,
Bryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20060528/a6a67129/attachment.pgp