From: Robert Schwebel <r.schwebel@pengutronix.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [Patch 1/9] U-boot-V2:ID: Sync mod_devicetable
Date: Wed, 18 Jun 2008 21:02:04 +0200 [thread overview]
Message-ID: <20080618190204.GM1189@pengutronix.de> (raw)
In-Reply-To: <7A436F7769CA33409C6B44B358BFFF0CD3192BBD@dlee02.ent.ti.com>
On Wed, Jun 18, 2008 at 07:33:50AM -0500, Menon, Nishanth wrote:
> include/linux/mod_devicetable.h | 382 ++++++++++++++++++++++++++++++++++++++++
This is u-boot, not linux. Please let's not introduce more of the
copy-and-paste things we have around from the past.
> +/*
> + * Device tables which are exported to userspace via
> + * scripts/mod/file2alias.c. You must keep that file in sync with this
> + * header.
> + */
U-Boot doesn't have userspace.
> +
> +#ifndef LINUX_MOD_DEVICETABLE_H
> +#define LINUX_MOD_DEVICETABLE_H
> +
> +#ifdef __KERNEL__
> +#include <linux/types.h>
> +typedef unsigned long kernel_ulong_t;
> +#endif
No Linux, no __KERNEL__.
> +#define PCI_ANY_ID (~0)
Until now, there is no PCI support in u-boot-v2. It would be great to
have it, but please let's first add PCI support and then stuff that
depends on it :-)
> +struct pci_device_id {
> + __u32 vendor, device; /* Vendor and device ID or PCI_ANY_ID*/
> + __u32 subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
> + __u32 class, class_mask; /* (class,subclass,prog-if) triplet */
> + kernel_ulong_t driver_data; /* Data private to the driver */
> +};
I assume you don't have your controller attached via pci; so before we
have proper PCI support, please don't do this. It might happen that it
turns out that the data model above doesn't fit u-boot's needs in the
end.
Pushing in stuff just because it was there let's people assume that
someone has *thought* about PCI in u-boot-v2. The net one comes and
tries to use it and *bang*. And even worse, if somebody tries to really
add PCI support, he will probably collide with this.
> +#define IEEE1394_MATCH_VENDOR_ID 0x0001
> +#define IEEE1394_MATCH_MODEL_ID 0x0002
> +#define IEEE1394_MATCH_SPECIFIER_ID 0x0004
> +#define IEEE1394_MATCH_VERSION 0x0008
We also don't have 1394.
> + * Device table entry for "new style" table-driven USB drivers.
> + * User mode code can read these tables to choose which modules to load.
> + * Declare the table as a MODULE_DEVICE_TABLE.
Nevertheless, this "new style" model is a good idea and is worth being
considered for the concept of i2c in u-boot-v2.
> +/**
> + * struct usb_device_id - identifies USB devices for probing and hotplugging
> + * @match_flags: Bit mask controlling of the other fields are used to match
If you add header documentation, please use Doygen-style comments.
U-Boot-v2 has a Doygen-generated manual which was layed out carefully,
so please
a) check what the real interfaces of a subsystem are
b) document them
c) integrate them into the main manual, in a way that it is readable and
can be used as an introduction for somebody who wants to start
learning about the concepts.
> +/* Some useful macros to use to create struct usb_device_id */
Argh, we don't have USB in u-boot-v2 yet. Same arguments as above with
PCI.
> +/* s390 CCW devices */
Although u-boot-v2 on S390 would surely be a cool idea, I assume that
doesn't fit here.
> +struct acpi_device_id {
> + __u8 id[ACPI_ID_LEN];
> + kernel_ulong_t driver_data;
> +};
... and there is also no ACPI support available yet.
> +struct pnp_device_id {
> + __u8 id[PNP_ID_LEN];
> + kernel_ulong_t driver_data;
> +};
... and no pnp.
> +struct of_device_id {
> + char name[32];
> + char type[32];
> + char compatible[128];
> +#ifdef __KERNEL__
> + void *data;
> +#else
> + kernel_ulong_t data;
> +#endif
> +};
No of-tree support here. U-Boot has to *provide* an oftree, not to
consume one.
I leave the other subsystems out that are not available yet.
Robert
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hannoversche Str. 2, 31134 Hildesheim, Germany
Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9
next prev parent reply other threads:[~2008-06-18 19:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-18 12:33 [U-Boot-Users] [Patch 1/9] U-boot-V2:ID: Sync mod_devicetable Menon, Nishanth
2008-06-18 19:02 ` Robert Schwebel [this message]
2008-06-19 3:57 ` [U-Boot-Users] [Patch] U-Boot-v2: general replace __KERNEL__ with __UBOOT__ Menon, Nishanth
2008-06-19 12:53 ` Jon Loeliger
2008-06-19 13:05 ` Menon, Nishanth
2008-06-19 15:11 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080618190204.GM1189@pengutronix.de \
--to=r.schwebel@pengutronix.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.