[U-Boot-Users] [PATCH 6/14] Add USB console support as default on Adder87x board
Yuli Barcohen
yuli at arabellasw.com
Sun May 28 19:53:58 CEST 2006
>>>>> Bryan O'Donoghue writes:
Bryan> On Sun, 28 May 2006 18:41:14 +0300 Yuli Barcohen
Bryan> <yuli at arabellasw.com> 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.
--
========================================================================
Yuli Barcohen | Phone +972-9-765-1788 | Software Project Leader
yuli at arabellasw.com | Fax +972-9-765-7494 | Arabella Software, Israel
========================================================================
More information about the U-Boot
mailing list