U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [Patch 1/9] U-boot-V2:ID: Sync mod_devicetable
@ 2008-06-18 12:33 Menon, Nishanth
  2008-06-18 19:02 ` Robert Schwebel
  0 siblings, 1 reply; 6+ messages in thread
From: Menon, Nishanth @ 2008-06-18 12:33 UTC (permalink / raw)
  To: u-boot

Syncing up mod_device_tables and filealias.c from 2.6.26 rc5 kernel.
introduce the mod_devicetable and sync the filealias from linux kernel


Signed-off-by: Nishanth Menon <x0nishan@ti.com>

---
 include/linux/mod_devicetable.h |  382 ++++++++++++++++++++++++++++++++++++++++
 scripts/mod/file2alias.c        |  231 ++++++++++++++++++++----
 2 files changed, 573 insertions(+), 40 deletions(-)

Index: u-boot-v2.git/include/linux/mod_devicetable.h
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ u-boot-v2.git/include/linux/mod_devicetable.h       2008-06-17 17:01:06.000000000 -0500
@@ -0,0 +1,382 @@
+/*
+ * Device tables which are exported to userspace via
+ * scripts/mod/file2alias.c.  You must keep that file in sync with this
+ * header.
+ */
+
+#ifndef LINUX_MOD_DEVICETABLE_H
+#define LINUX_MOD_DEVICETABLE_H
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+typedef unsigned long kernel_ulong_t;
+#endif
+
+#define PCI_ANY_ID (~0)
+
+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 */
+};
+
+
+#define IEEE1394_MATCH_VENDOR_ID       0x0001
+#define IEEE1394_MATCH_MODEL_ID                0x0002
+#define IEEE1394_MATCH_SPECIFIER_ID    0x0004
+#define IEEE1394_MATCH_VERSION         0x0008
+
+struct ieee1394_device_id {
+       __u32 match_flags;
+       __u32 vendor_id;
+       __u32 model_id;
+       __u32 specifier_id;
+       __u32 version;
+       kernel_ulong_t driver_data
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
+
+/*
+ * 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.
+ *
+ * A probe() parameter will point to a matching entry from this table.
+ * Use the driver_info field for each match to hold information tied
+ * to that match:  device quirks, etc.
+ *
+ * Terminate the driver's table with an all-zeroes entry.
+ * Use the flag values to control which fields are compared.
+ */
+
+/**
+ * struct usb_device_id - identifies USB devices for probing and hotplugging
+ * @match_flags: Bit mask controlling of the other fields are used to match
+ *     against new devices.  Any field except for driver_info may be used,
+ *     although some only make sense in conjunction with other fields.
+ *     This is usually set by a USB_DEVICE_*() macro, which sets all
+ *     other fields in this structure except for driver_info.
+ * @idVendor: USB vendor ID for a device; numbers are assigned
+ *     by the USB forum to its members.
+ * @idProduct: Vendor-assigned product ID.
+ * @bcdDevice_lo: Low end of range of vendor-assigned product version numbers.
+ *     This is also used to identify individual product versions, for
+ *     a range consisting of a single device.
+ * @bcdDevice_hi: High end of version number range.  The range of product
+ *     versions is inclusive.
+ * @bDeviceClass: Class of device; numbers are assigned
+ *     by the USB forum.  Products may choose to implement classes,
+ *     or be vendor-specific.  Device classes specify behavior of all
+ *     the interfaces on a devices.
+ * @bDeviceSubClass: Subclass of device; associated with bDeviceClass.
+ * @bDeviceProtocol: Protocol of device; associated with bDeviceClass.
+ * @bInterfaceClass: Class of interface; numbers are assigned
+ *     by the USB forum.  Products may choose to implement classes,
+ *     or be vendor-specific.  Interface classes specify behavior only
+ *     of a given interface; other interfaces may support other classes.
+ * @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass.
+ * @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass.
+ * @driver_info: Holds information used by the driver.  Usually it holds
+ *     a pointer to a descriptor understood by the driver, or perhaps
+ *     device flags.
+ *
+ * In most cases, drivers will create a table of device IDs by using
+ * USB_DEVICE(), or similar macros designed for that purpose.
+ * They will then export it to userspace using MODULE_DEVICE_TABLE(),
+ * and provide it to the USB core through their usb_driver structure.
+ *
+ * See the usb_match_id() function for information about how matches are
+ * performed.  Briefly, you will normally use one of several macros to help
+ * construct these entries.  Each entry you provide will either identify
+ * one or more specific products, or will identify a class of products
+ * which have agreed to behave the same.  You should put the more specific
+ * matches towards the beginning of your table, so that driver_info can
+ * record quirks of specific products.
+ */
+struct usb_device_id {
+       /* which fields to match against? */
+       __u16           match_flags;
+
+       /* Used for product specific matches; range is inclusive */
+       __u16           idVendor;
+       __u16           idProduct;
+       __u16           bcdDevice_lo;
+       __u16           bcdDevice_hi;
+
+       /* Used for device class matches */
+       __u8            bDeviceClass;
+       __u8            bDeviceSubClass;
+       __u8            bDeviceProtocol;
+
+       /* Used for interface class matches */
+       __u8            bInterfaceClass;
+       __u8            bInterfaceSubClass;
+       __u8            bInterfaceProtocol;
+
+       /* not matched against */
+       kernel_ulong_t  driver_info;
+};
+
+/* Some useful macros to use to create struct usb_device_id */
+#define USB_DEVICE_ID_MATCH_VENDOR             0x0001
+#define USB_DEVICE_ID_MATCH_PRODUCT            0x0002
+#define USB_DEVICE_ID_MATCH_DEV_LO             0x0004
+#define USB_DEVICE_ID_MATCH_DEV_HI             0x0008
+#define USB_DEVICE_ID_MATCH_DEV_CLASS          0x0010
+#define USB_DEVICE_ID_MATCH_DEV_SUBCLASS       0x0020
+#define USB_DEVICE_ID_MATCH_DEV_PROTOCOL       0x0040
+#define USB_DEVICE_ID_MATCH_INT_CLASS          0x0080
+#define USB_DEVICE_ID_MATCH_INT_SUBCLASS       0x0100
+#define USB_DEVICE_ID_MATCH_INT_PROTOCOL       0x0200
+
+/* s390 CCW devices */
+struct ccw_device_id {
+       __u16   match_flags;    /* which fields to match against */
+
+       __u16   cu_type;        /* control unit type     */
+       __u16   dev_type;       /* device type           */
+       __u8    cu_model;       /* control unit model    */
+       __u8    dev_model;      /* device model          */
+
+       kernel_ulong_t driver_info;
+};
+
+#define CCW_DEVICE_ID_MATCH_CU_TYPE            0x01
+#define CCW_DEVICE_ID_MATCH_CU_MODEL           0x02
+#define CCW_DEVICE_ID_MATCH_DEVICE_TYPE                0x04
+#define CCW_DEVICE_ID_MATCH_DEVICE_MODEL       0x08
+
+/* s390 AP bus devices */
+struct ap_device_id {
+       __u16 match_flags;      /* which fields to match against */
+       __u8 dev_type;          /* device type */
+       __u8 pad1;
+       __u32 pad2;
+       kernel_ulong_t driver_info;
+};
+
+#define AP_DEVICE_ID_MATCH_DEVICE_TYPE         0x01
+
+#define ACPI_ID_LEN    16 /* only 9 bytes needed here, 16 bytes are used */
+                          /* to workaround crosscompile issues */
+
+struct acpi_device_id {
+       __u8 id[ACPI_ID_LEN];
+       kernel_ulong_t driver_data;
+};
+
+#define PNP_ID_LEN     8
+#define PNP_MAX_DEVICES        8
+
+struct pnp_device_id {
+       __u8 id[PNP_ID_LEN];
+       kernel_ulong_t driver_data;
+};
+
+struct pnp_card_device_id {
+       __u8 id[PNP_ID_LEN];
+       kernel_ulong_t driver_data;
+       struct {
+               __u8 id[PNP_ID_LEN];
+       } devs[PNP_MAX_DEVICES];
+};
+
+
+#define SERIO_ANY      0xff
+
+struct serio_device_id {
+       __u8 type;
+       __u8 extra;
+       __u8 id;
+       __u8 proto;
+};
+
+/*
+ * Struct used for matching a device
+ */
+struct of_device_id {
+       char    name[32];
+       char    type[32];
+       char    compatible[128];
+#ifdef __KERNEL__
+       void    *data;
+#else
+       kernel_ulong_t data;
+#endif
+};
+
+/* VIO */
+struct vio_device_id {
+       char type[32];
+       char compat[32];
+};
+
+/* PCMCIA */
+
+struct pcmcia_device_id {
+       __u16           match_flags;
+
+       __u16           manf_id;
+       __u16           card_id;
+
+       __u8            func_id;
+
+       /* for real multi-function devices */
+       __u8            function;
+
+       /* for pseudo multi-function devices */
+       __u8            device_no;
+
+       __u32           prod_id_hash[4]
+               __attribute__((aligned(sizeof(__u32))));
+
+       /* not matched against in kernelspace*/
+#ifdef __KERNEL__
+       const char      *prod_id[4];
+#else
+       kernel_ulong_t  prod_id[4]
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
+#endif
+
+       /* not matched against */
+       kernel_ulong_t  driver_info;
+#ifdef __KERNEL__
+       char            *cisfile;
+#else
+       kernel_ulong_t  cisfile;
+#endif
+};
+
+#define PCMCIA_DEV_ID_MATCH_MANF_ID    0x0001
+#define PCMCIA_DEV_ID_MATCH_CARD_ID    0x0002
+#define PCMCIA_DEV_ID_MATCH_FUNC_ID    0x0004
+#define PCMCIA_DEV_ID_MATCH_FUNCTION   0x0008
+#define PCMCIA_DEV_ID_MATCH_PROD_ID1   0x0010
+#define PCMCIA_DEV_ID_MATCH_PROD_ID2   0x0020
+#define PCMCIA_DEV_ID_MATCH_PROD_ID3   0x0040
+#define PCMCIA_DEV_ID_MATCH_PROD_ID4   0x0080
+#define PCMCIA_DEV_ID_MATCH_DEVICE_NO  0x0100
+#define PCMCIA_DEV_ID_MATCH_FAKE_CIS   0x0200
+#define PCMCIA_DEV_ID_MATCH_ANONYMOUS  0x0400
+
+/* Input */
+#define INPUT_DEVICE_ID_EV_MAX         0x1f
+#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING    0x71
+#define INPUT_DEVICE_ID_KEY_MAX                0x1ff
+#define INPUT_DEVICE_ID_REL_MAX                0x0f
+#define INPUT_DEVICE_ID_ABS_MAX                0x3f
+#define INPUT_DEVICE_ID_MSC_MAX                0x07
+#define INPUT_DEVICE_ID_LED_MAX                0x0f
+#define INPUT_DEVICE_ID_SND_MAX                0x07
+#define INPUT_DEVICE_ID_FF_MAX         0x7f
+#define INPUT_DEVICE_ID_SW_MAX         0x0f
+
+#define INPUT_DEVICE_ID_MATCH_BUS      1
+#define INPUT_DEVICE_ID_MATCH_VENDOR   2
+#define INPUT_DEVICE_ID_MATCH_PRODUCT  4
+#define INPUT_DEVICE_ID_MATCH_VERSION  8
+
+#define INPUT_DEVICE_ID_MATCH_EVBIT    0x0010
+#define INPUT_DEVICE_ID_MATCH_KEYBIT   0x0020
+#define INPUT_DEVICE_ID_MATCH_RELBIT   0x0040
+#define INPUT_DEVICE_ID_MATCH_ABSBIT   0x0080
+#define INPUT_DEVICE_ID_MATCH_MSCIT    0x0100
+#define INPUT_DEVICE_ID_MATCH_LEDBIT   0x0200
+#define INPUT_DEVICE_ID_MATCH_SNDBIT   0x0400
+#define INPUT_DEVICE_ID_MATCH_FFBIT    0x0800
+#define INPUT_DEVICE_ID_MATCH_SWBIT    0x1000
+
+struct input_device_id {
+
+       kernel_ulong_t flags;
+
+       __u16 bustype;
+       __u16 vendor;
+       __u16 product;
+       __u16 version;
+
+       kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
+
+       kernel_ulong_t driver_info;
+};
+
+/* EISA */
+
+#define EISA_SIG_LEN   8
+
+/* The EISA signature, in ASCII form, null terminated */
+struct eisa_device_id {
+       char          sig[EISA_SIG_LEN];
+       kernel_ulong_t driver_data;
+};
+
+#define EISA_DEVICE_MODALIAS_FMT "eisa:s%s"
+
+struct parisc_device_id {
+       __u8    hw_type;        /* 5 bits used */
+       __u8    hversion_rev;   /* 4 bits */
+       __u16   hversion;       /* 12 bits */
+       __u32   sversion;       /* 20 bits */
+};
+
+#define PA_HWTYPE_ANY_ID       0xff
+#define PA_HVERSION_REV_ANY_ID 0xff
+#define PA_HVERSION_ANY_ID     0xffff
+#define PA_SVERSION_ANY_ID     0xffffffff
+
+/* SDIO */
+
+#define SDIO_ANY_ID (~0)
+
+struct sdio_device_id {
+       __u8    class;                  /* Standard interface or SDIO_ANY_ID */
+       __u16   vendor;                 /* Vendor or SDIO_ANY_ID */
+       __u16   device;                 /* Device ID or SDIO_ANY_ID */
+       kernel_ulong_t driver_data      /* Data private to the driver */
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
+/* SSB core, see drivers/ssb/ */
+struct ssb_device_id {
+       __u16   vendor;
+       __u16   coreid;
+       __u8    revision;
+};
+#define SSB_DEVICE(_vendor, _coreid, _revision)  \
+       { .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
+#define SSB_DEVTABLE_END  \
+       { 0, },
+
+#define SSB_ANY_VENDOR         0xFFFF
+#define SSB_ANY_ID             0xFFFF
+#define SSB_ANY_REV            0xFF
+
+struct virtio_device_id {
+       __u32 device;
+       __u32 vendor;
+};
+#define VIRTIO_DEV_ANY_ID      0xffffffff
+
+/* i2c */
+
+#define I2C_NAME_SIZE  20
+#define I2C_MODULE_PREFIX "i2c:"
+
+struct i2c_device_id {
+       char name[I2C_NAME_SIZE];
+       kernel_ulong_t driver_data      /* Data private to the driver */
+                       __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
+
+#endif /* LINUX_MOD_DEVICETABLE_H */
Index: u-boot-v2.git/scripts/mod/file2alias.c
===================================================================
--- u-boot-v2.git.orig/scripts/mod/file2alias.c 2008-06-17 16:52:31.000000000 -0500
+++ u-boot-v2.git/scripts/mod/file2alias.c      2008-06-17 17:01:06.000000000 -0500
@@ -51,21 +51,52 @@
                 sprintf(str + strlen(str), "*");                \
 } while(0)

+/* Always end in a wildcard, for future extension */
+static inline void add_wildcard(char *str)
+{
+       int len = strlen(str);
+
+       if (str[len - 1] != '*')
+               strcat(str + len, "*");
+}
+
+unsigned int cross_build;
 /**
  * Check that sizeof(device_id type) are consistent with size of section
  * in .o file. If in-consistent then userspace and kernel does not agree
  * on actual size which is a bug.
+ * Also verify that the final entry in the table is all zeros.
+ * Ignore both checks if build host differ from target host and size differs.
  **/
-static void device_id_size_check(const char *modname, const char *device_id,
-                                unsigned long size, unsigned long id_size)
+static void device_id_check(const char *modname, const char *device_id,
+                           unsigned long size, unsigned long id_size,
+                           void *symval)
 {
+       int i;
+
        if (size % id_size || size < id_size) {
+               if (cross_build != 0)
+                       return;
                fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
                      "of the size of section __mod_%s_device_table=%lu.\n"
                      "Fix definition of struct %s_device_id "
                      "in mod_devicetable.h\n",
                      modname, device_id, id_size, device_id, size, device_id);
        }
+       /* Verify last one is a terminator */
+       for (i = 0; i < id_size; i++) {
+               if (*(uint8_t *)(symval+size-id_size+i)) {
+                       fprintf(stderr, "%s: struct %s_device_id is %lu bytes."
+                               " The last of %lu is:\n",
+                               modname, device_id, id_size, size / id_size);
+                       for (i = 0; i < id_size; i++)
+                               fprintf(stderr, "0x%02x ",
+                                       *(uint8_t *)(symval+size-id_size+i));
+                       fprintf(stderr, "\n");
+                       fatal("%s: struct %s_device_id is not terminated "
+                               "with a NULL entry!\n", modname, device_id);
+               }
+       }
 }

 /* USB is special because the bcdDevice can be matched against a numeric range */
@@ -111,9 +142,7 @@
            id->match_flags&USB_DEVICE_ID_MATCH_INT_PROTOCOL,
            id->bInterfaceProtocol);

-       /* Always end in a wildcard, for future extension */
-       if (alias[strlen(alias)-1] != '*')
-               strcat(alias, "*");
+       add_wildcard(alias);
        buf_printf(&mod->dev_table_buf,
                   "MODULE_ALIAS(\"%s\");\n", alias);
 }
@@ -137,7 +166,8 @@
         * Some modules (visor) have empty slots as placeholder for
         * run-time specification that results in catch-all alias
         */
-       if (!(id->idVendor | id->bDeviceClass | id->bInterfaceClass))
+       if (!(id->idVendor | id->idProduct | id->bDeviceClass |
+                               id->bInterfaceClass))
                return;

        /* Convert numeric bcdDevice range into fnmatch-able pattern(s) */
@@ -168,7 +198,7 @@
        unsigned int i;
        const unsigned long id_size = sizeof(struct usb_device_id);

-       device_id_size_check(mod->name, "usb", size, id_size);
+       device_id_check(mod->name, "usb", size, id_size, symval);

        /* Leave last one: it's the terminator. */
        size -= id_size;
@@ -197,6 +227,7 @@
        ADD(alias, "ver", id->match_flags & IEEE1394_MATCH_VERSION,
            id->version);

+       add_wildcard(alias);
        return 1;
 }

@@ -239,6 +270,7 @@
        ADD(alias, "bc", baseclass_mask == 0xFF, baseclass);
        ADD(alias, "sc", subclass_mask == 0xFF, subclass);
        ADD(alias, "i", interface_mask == 0xFF, interface);
+       add_wildcard(alias);
        return 1;
 }

@@ -261,6 +293,7 @@
            id->dev_type);
        ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_MODEL,
            id->dev_model);
+       add_wildcard(alias);
        return 1;
 }

@@ -268,7 +301,7 @@
 static int do_ap_entry(const char *filename,
                       struct ap_device_id *id, char *alias)
 {
-       sprintf(alias, "ap:t%02X", id->dev_type);
+       sprintf(alias, "ap:t%02X*", id->dev_type);
        return 1;
 }

@@ -287,6 +320,15 @@
        ADD(alias, "id", id->id != SERIO_ANY, id->id);
        ADD(alias, "ex", id->extra != SERIO_ANY, id->extra);

+       add_wildcard(alias);
+       return 1;
+}
+
+/* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */
+static int do_acpi_entry(const char *filename,
+                       struct acpi_device_id *id, char *alias)
+{
+       sprintf(alias, "acpi*:%s:*", id->id);
        return 1;
 }

@@ -294,23 +336,58 @@
 static int do_pnp_entry(const char *filename,
                        struct pnp_device_id *id, char *alias)
 {
-       sprintf(alias, "pnp:d%s", id->id);
+       sprintf(alias, "pnp:d%s*", id->id);
        return 1;
 }

-/* looks like: "pnp:cCdD..." */
-static int do_pnp_card_entry(const char *filename,
-                       struct pnp_card_device_id *id, char *alias)
+/* looks like: "pnp:dD" for every device of the card */
+static void do_pnp_card_entries(void *symval, unsigned long size,
+                               struct module *mod)
 {
-       int i;
+       const unsigned long id_size = sizeof(struct pnp_card_device_id);
+       const unsigned int count = (size / id_size)-1;
+       const struct pnp_card_device_id *cards = symval;
+       unsigned int i;

-       sprintf(alias, "pnp:c%s", id->id);
-       for (i = 0; i < PNP_MAX_DEVICES; i++) {
-               if (! *id->devs[i].id)
-                       break;
-               sprintf(alias + strlen(alias), "d%s", id->devs[i].id);
+       device_id_check(mod->name, "pnp", size, id_size, symval);
+
+       for (i = 0; i < count; i++) {
+               unsigned int j;
+               const struct pnp_card_device_id *card = &cards[i];
+
+               for (j = 0; j < PNP_MAX_DEVICES; j++) {
+                       const char *id = (char *)card->devs[j].id;
+                       int i2, j2;
+                       int dup = 0;
+
+                       if (!id[0])
+                               break;
+
+                       /* find duplicate, already added value */
+                       for (i2 = 0; i2 < i && !dup; i2++) {
+                               const struct pnp_card_device_id *card2 =
+                                       &cards[i2];
+
+                               for (j2 = 0; j2 < PNP_MAX_DEVICES; j2++) {
+                                       const char *id2 =
+                                               (char *)card2->devs[j2].id;
+
+                                       if (!id2[0])
+                                               break;
+
+                                       if (!strcmp(id, id2)) {
+                                               dup = 1;
+                                               break;
+                                       }
+                               }
+                       }
+
+                       /* add an individual alias for every device entry */
+                       if (!dup)
+                               buf_printf(&mod->dev_table_buf,
+                                          "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
+               }
        }
-       return 1;
 }

 /* Looks like: pcmcia:mNcNfNfnNpfnNvaNvbNvcNvdN. */
@@ -346,6 +423,7 @@
        ADD(alias, "pc", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID3, id->prod_id_hash[2]);
        ADD(alias, "pd", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID4, id->prod_id_hash[3]);

+       add_wildcard(alias);
        return 1;
 }

@@ -369,6 +447,7 @@
         if (isspace (*tmp))
             *tmp = '_';

+    add_wildcard(alias);
     return 1;
 }

@@ -385,13 +464,7 @@
                if (isspace (*tmp))
                        *tmp = '_';

-       return 1;
-}
-
-static int do_i2c_entry(const char *filename, struct i2c_device_id *i2c, char *alias)
-{
-       strcpy(alias, "i2c:");
-       ADD(alias, "id", 1, i2c->id);
+       add_wildcard(alias);
        return 1;
 }

@@ -455,6 +528,8 @@
 {
        if (eisa->sig[0])
                sprintf(alias, EISA_DEVICE_MODALIAS_FMT "*", eisa->sig);
+       else
+               strcat(alias, "*");
        return 1;
 }

@@ -473,6 +548,63 @@
        ADD(alias, "rev", id->hversion_rev != PA_HVERSION_REV_ANY_ID, id->hversion_rev);
        ADD(alias, "sv", id->sversion != PA_SVERSION_ANY_ID, id->sversion);

+       add_wildcard(alias);
+       return 1;
+}
+
+/* Looks like: sdio:cNvNdN. */
+static int do_sdio_entry(const char *filename,
+                       struct sdio_device_id *id, char *alias)
+{
+       id->class = TO_NATIVE(id->class);
+       id->vendor = TO_NATIVE(id->vendor);
+       id->device = TO_NATIVE(id->device);
+
+       strcpy(alias, "sdio:");
+       ADD(alias, "c", id->class != (__u8)SDIO_ANY_ID, id->class);
+       ADD(alias, "v", id->vendor != (__u16)SDIO_ANY_ID, id->vendor);
+       ADD(alias, "d", id->device != (__u16)SDIO_ANY_ID, id->device);
+       add_wildcard(alias);
+       return 1;
+}
+
+/* Looks like: ssb:vNidNrevN. */
+static int do_ssb_entry(const char *filename,
+                       struct ssb_device_id *id, char *alias)
+{
+       id->vendor = TO_NATIVE(id->vendor);
+       id->coreid = TO_NATIVE(id->coreid);
+       id->revision = TO_NATIVE(id->revision);
+
+       strcpy(alias, "ssb:");
+       ADD(alias, "v", id->vendor != SSB_ANY_VENDOR, id->vendor);
+       ADD(alias, "id", id->coreid != SSB_ANY_ID, id->coreid);
+       ADD(alias, "rev", id->revision != SSB_ANY_REV, id->revision);
+       add_wildcard(alias);
+       return 1;
+}
+
+/* Looks like: virtio:dNvN */
+static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
+                          char *alias)
+{
+       id->device = TO_NATIVE(id->device);
+       id->vendor = TO_NATIVE(id->vendor);
+
+       strcpy(alias, "virtio:");
+       ADD(alias, "d", 1, id->device);
+       ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor);
+
+       add_wildcard(alias);
+       return 1;
+}
+
+/* Looks like: i2c:S */
+static int do_i2c_entry(const char *filename, struct i2c_device_id *id,
+                       char *alias)
+{
+       sprintf(alias, I2C_MODULE_PREFIX "%s", id->name);
+
        return 1;
 }

@@ -497,15 +629,12 @@
        char alias[500];
        int (*do_entry)(const char *, void *entry, char *alias) = function;

-       device_id_size_check(mod->name, device_id, size, id_size);
+       device_id_check(mod->name, device_id, size, id_size, symval);
        /* Leave last one: it's the terminator. */
        size -= id_size;

        for (i = 0; i < size; i += id_size) {
                if (do_entry(mod->name, symval+i, alias)) {
-                       /* Always end in a wildcard, for future extension */
-                       if (alias[strlen(alias)-1] != '*')
-                               strcat(alias, "*");
                        buf_printf(&mod->dev_table_buf,
                                   "MODULE_ALIAS(\"%s\");\n", alias);
                }
@@ -519,14 +648,21 @@
                        Elf_Sym *sym, const char *symname)
 {
        void *symval;
+       char *zeros = NULL;

        /* We're looking for a section relative symbol */
        if (!sym->st_shndx || sym->st_shndx >= info->hdr->e_shnum)
                return;

-       symval = (void *)info->hdr
-               + info->sechdrs[sym->st_shndx].sh_offset
-               + sym->st_value;
+       /* Handle all-NULL symbols allocated into .bss */
+       if (info->sechdrs[sym->st_shndx].sh_type & SHT_NOBITS) {
+               zeros = calloc(1, sym->st_size);
+               symval = zeros;
+       } else {
+               symval = (void *)info->hdr
+                       + info->sechdrs[sym->st_shndx].sh_offset
+                       + sym->st_value;
+       }

        if (sym_is(symname, "__mod_pci_device_table"))
                do_table(symval, sym->st_size,
@@ -551,14 +687,16 @@
                do_table(symval, sym->st_size,
                         sizeof(struct serio_device_id), "serio",
                         do_serio_entry, mod);
+       else if (sym_is(symname, "__mod_acpi_device_table"))
+               do_table(symval, sym->st_size,
+                        sizeof(struct acpi_device_id), "acpi",
+                        do_acpi_entry, mod);
        else if (sym_is(symname, "__mod_pnp_device_table"))
                do_table(symval, sym->st_size,
                         sizeof(struct pnp_device_id), "pnp",
                         do_pnp_entry, mod);
        else if (sym_is(symname, "__mod_pnp_card_device_table"))
-               do_table(symval, sym->st_size,
-                        sizeof(struct pnp_card_device_id), "pnp_card",
-                        do_pnp_card_entry, mod);
+               do_pnp_card_entries(symval, sym->st_size, mod);
        else if (sym_is(symname, "__mod_pcmcia_device_table"))
                do_table(symval, sym->st_size,
                         sizeof(struct pcmcia_device_id), "pcmcia",
@@ -571,10 +709,6 @@
                do_table(symval, sym->st_size,
                         sizeof(struct vio_device_id), "vio",
                         do_vio_entry, mod);
-       else if (sym_is(symname, "__mod_i2c_device_table"))
-               do_table(symval, sym->st_size,
-                        sizeof(struct i2c_device_id), "i2c",
-                        do_i2c_entry, mod);
        else if (sym_is(symname, "__mod_input_device_table"))
                do_table(symval, sym->st_size,
                         sizeof(struct input_device_id), "input",
@@ -587,6 +721,23 @@
                do_table(symval, sym->st_size,
                         sizeof(struct parisc_device_id), "parisc",
                         do_parisc_entry, mod);
+       else if (sym_is(symname, "__mod_sdio_device_table"))
+               do_table(symval, sym->st_size,
+                        sizeof(struct sdio_device_id), "sdio",
+                        do_sdio_entry, mod);
+       else if (sym_is(symname, "__mod_ssb_device_table"))
+               do_table(symval, sym->st_size,
+                        sizeof(struct ssb_device_id), "ssb",
+                        do_ssb_entry, mod);
+       else if (sym_is(symname, "__mod_virtio_device_table"))
+               do_table(symval, sym->st_size,
+                        sizeof(struct virtio_device_id), "virtio",
+                        do_virtio_entry, mod);
+       else if (sym_is(symname, "__mod_i2c_device_table"))
+               do_table(symval, sym->st_size,
+                        sizeof(struct i2c_device_id), "i2c",
+                        do_i2c_entry, mod);
+       free(zeros);
 }

 /* Now add out buffered information to the generated C source */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [Patch 1/9] U-boot-V2:ID: Sync mod_devicetable
  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
  2008-06-19  3:57   ` [U-Boot-Users] [Patch] U-Boot-v2: general replace __KERNEL__ with __UBOOT__ Menon, Nishanth
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Schwebel @ 2008-06-18 19:02 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [Patch] U-Boot-v2: general replace __KERNEL__ with __UBOOT__
  2008-06-18 19:02 ` Robert Schwebel
@ 2008-06-19  3:57   ` Menon, Nishanth
  2008-06-19 12:53     ` Jon Loeliger
  0 siblings, 1 reply; 6+ messages in thread
From: Menon, Nishanth @ 2008-06-19  3:57 UTC (permalink / raw)
  To: u-boot

Robert,
> -----Original Message-----
> From: Robert Schwebel [mailto:r.schwebel at pengutronix.de]
> Sent: Wednesday, June 18, 2008 2:02 PM
> To: Menon, Nishanth
> Cc: Sascha Hauer; Laurent Desnogues; Kamat, Nishant; philip.balister at gmail.com; u-boot-
> users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] [Patch 1/9] U-boot-V2:ID: Sync mod_devicetable
>
> > +
> > +#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__.

Here is a patch to cleanup all other occurrences currently in u-boot v2. This is a blind replacement throughout. Do we want to consider replacing include/linux with include/u-boot?

Signed-off-by: Nishanth Menon <x0nishan@ti.com>

---
 Makefile                              |    2 +-
 include/asm-arm/byteorder.h           |    2 +-
 include/asm-arm/elf.h                 |    2 +-
 include/asm-arm/io.h                  |    4 ++--
 include/asm-arm/posix_types.h         |    8 ++++----
 include/asm-arm/proc-armv/ptrace.h    |    4 ++--
 include/asm-arm/processor.h           |    2 +-
 include/asm-arm/ptrace.h              |    2 +-
 include/asm-arm/types.h               |    4 ++--
 include/asm-blackfin/bitops.h         |    2 +-
 include/asm-blackfin/byteorder.h      |    2 +-
 include/asm-blackfin/elf.h            |    2 +-
 include/asm-blackfin/page.h           |    2 +-
 include/asm-blackfin/posix_types.h    |   10 +++++-----
 include/asm-blackfin/ptrace.h         |    2 +-
 include/asm-blackfin/setup.h          |    2 +-
 include/asm-blackfin/types.h          |    2 +-
 include/asm-m68k/byteorder.h          |    2 +-
 include/asm-m68k/elf.h                |    2 +-
 include/asm-m68k/io.h                 |    4 ++--
 include/asm-m68k/posix_types.h        |    8 ++++----
 include/asm-m68k/proc-mcfv4e/ptrace.h |    4 ++--
 include/asm-m68k/ptrace.h             |    2 +-
 include/asm-m68k/setup.h              |    8 ++++----
 include/asm-m68k/types.h              |    4 ++--
 include/asm-ppc/bitops.h              |    8 ++++----
 include/asm-ppc/cache.h               |    2 +-
 include/asm-ppc/elf.h                 |    8 ++++----
 include/asm-ppc/io.h                  |    3 ++-
 include/asm-ppc/posix_types.h         |    4 ++--
 include/asm-ppc/ptrace.h              |    2 +-
 include/asm-ppc/signal.h              |    4 ++--
 include/asm-ppc/types.h               |    4 ++--
 include/asm-sandbox/posix_types.h     |   10 +++++-----
 include/asm-sandbox/types.h           |    4 ++--
 include/cramfs/cramfs_fs.h            |    6 +++---
 include/envfs.h                       |    6 +++---
 include/linux/byteorder/generic.h     |    6 +++---
 include/linux/byteorder/swab.h        |    2 +-
 include/linux/types.h                 |    4 ++--
 40 files changed, 81 insertions(+), 80 deletions(-)

Index: u-boot-v2.git/Makefile
===================================================================
--- u-boot-v2.git.orig/Makefile 2008-06-18 22:34:23.000000000 -0500
+++ u-boot-v2.git/Makefile      2008-06-18 22:34:41.000000000 -0500
@@ -305,7 +305,7 @@
                    $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
                   -include include/linux/autoconf.h

-CPPFLAGS        := -D__KERNEL__ -D__U_BOOT__ $(LINUXINCLUDE) -fno-builtin -ffreestanding
+CPPFLAGS        := -D__U_BOOT__ $(LINUXINCLUDE) -fno-builtin -ffreestanding

 CFLAGS          := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
                    -fno-strict-aliasing -fno-common -Os -pipe
Index: u-boot-v2.git/include/asm-arm/byteorder.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/byteorder.h      2008-06-18 22:32:41.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/byteorder.h   2008-06-18 22:32:43.000000000 -0500
@@ -18,7 +18,7 @@

 #include <asm/types.h>

-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#if !defined(__STRICT_ANSI__) || defined(__U_BOOT__)
 #  define __BYTEORDER_HAS_U64__
 #  define __SWAB_64_THRU_32__
 #endif
Index: u-boot-v2.git/include/asm-arm/elf.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/elf.h    2008-06-18 22:32:53.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/elf.h 2008-06-18 22:32:54.000000000 -0500
@@ -41,7 +41,7 @@
 #endif
 #define ELF_ARCH       EM_ARM

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #ifndef __ASSEMBLY__
 /*
  * This yields a string that ld.so will use to load implementation
Index: u-boot-v2.git/include/asm-arm/io.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/io.h     2008-06-18 22:32:45.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/io.h  2008-06-18 22:32:48.000000000 -0500
@@ -20,7 +20,7 @@
 #ifndef __ASM_ARM_IO_H
 #define __ASM_ARM_IO_H

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #include <linux/types.h>
 #include <asm/byteorder.h>
@@ -297,5 +297,5 @@
 #define isa_check_signature(io,sig,len)        (0)

 #endif /* __mem_isa */
-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */
 #endif /* __ASM_ARM_IO_H */
Index: u-boot-v2.git/include/asm-arm/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/posix_types.h    2008-06-18 22:32:32.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/posix_types.h 2008-06-18 22:32:33.000000000 -0500
@@ -49,14 +49,14 @@
 #endif

 typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
+#if defined(__U_BOOT__) || defined(__USE_ALL)
        int     val[2];
-#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#else /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
        int     __val[2];
-#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#endif /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

 #undef __FD_SET
 #define __FD_SET(fd, fdsetp) \
Index: u-boot-v2.git/include/asm-arm/proc-armv/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/proc-armv/ptrace.h       2008-06-18 22:32:28.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/proc-armv/ptrace.h    2008-06-18 22:32:29.000000000 -0500
@@ -59,7 +59,7 @@
 #define ARM_r0         uregs[0]
 #define ARM_ORIG_r0    uregs[17]

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define user_mode(regs)        \
        (((regs)->ARM_cpsr & 0xf) == 0)
@@ -100,7 +100,7 @@
        return 0;
 }

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif /* __ASSEMBLY__ */

Index: u-boot-v2.git/include/asm-arm/processor.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/processor.h      2008-06-18 22:32:40.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/processor.h   2008-06-18 22:32:41.000000000 -0500
@@ -34,7 +34,7 @@

 typedef unsigned long mm_segment_t;            /* domain register      */

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define EISA_bus 0
 #define MCA_bus 0
Index: u-boot-v2.git/include/asm-arm/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/ptrace.h 2008-06-18 22:32:44.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/ptrace.h      2008-06-18 22:32:45.000000000 -0500
@@ -20,7 +20,7 @@
 #define instruction_pointer(regs) \
        (pc_pointer((regs)->ARM_pc))

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 extern void show_regs(struct pt_regs *);

 #define predicate(x)   (x & 0xf0000000)
Index: u-boot-v2.git/include/asm-arm/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/types.h  2008-06-18 22:32:21.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/types.h       2008-06-18 22:32:24.000000000 -0500
@@ -29,7 +29,7 @@
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define BITS_PER_LONG 32

@@ -54,6 +54,6 @@

 #endif /* __ASSEMBLY__ */

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif
Index: u-boot-v2.git/include/asm-blackfin/bitops.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/bitops.h    2008-06-18 22:33:22.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/bitops.h 2008-06-18 22:33:23.000000000 -0500
@@ -32,7 +32,7 @@
 #include <asm/byteorder.h>
 #include <asm/system.h>

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 /*
  * Function prototypes to keep gcc -Wall happy
  */
Index: u-boot-v2.git/include/asm-blackfin/byteorder.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/byteorder.h 2008-06-18 22:33:21.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/byteorder.h      2008-06-18 22:33:22.000000000 -0500
@@ -30,7 +30,7 @@

 #include <asm/types.h>

-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__U_BOOT__)
 #  define __BYTEORDER_HAS_U64__
 #  define __SWAB_64_THRU_32__
 #endif
Index: u-boot-v2.git/include/asm-blackfin/elf.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/elf.h       2008-06-18 22:33:25.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/elf.h    2008-06-18 22:33:26.000000000 -0500
@@ -120,7 +120,7 @@

 #define ELF_PLATFORM  (NULL)

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
 #endif

Index: u-boot-v2.git/include/asm-blackfin/page.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/page.h      2008-06-18 22:33:18.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/page.h   2008-06-18 22:33:19.000000000 -0500
@@ -31,7 +31,7 @@
 #define PAGE_SIZE                      (4096)
 #define PAGE_MASK                      (~(PAGE_SIZE-1))

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #include <asm/setup.h>

Index: u-boot-v2.git/include/asm-blackfin/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/posix_types.h       2008-06-18 22:33:03.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/posix_types.h    2008-06-18 22:49:15.000000000 -0500
@@ -64,14 +64,14 @@
 #endif

 typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
+#if defined(__U_BOOT__) || defined(__USE_ALL)
        int val[2];
-#else                          /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#else                  /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
        int __val[2];
-#endif                         /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#endif                 /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

 #undef __FD_SET
 #define        __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
@@ -85,6 +85,6 @@
 #undef __FD_ZERO
 #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))

-#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+#endif /* defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */

 #endif
Index: u-boot-v2.git/include/asm-blackfin/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/ptrace.h    2008-06-18 22:33:24.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/ptrace.h 2008-06-18 22:33:24.000000000 -0500
@@ -246,7 +246,7 @@
 #define PTRACE_GETREGS         12
 #define PTRACE_SETREGS         13      /* ptrace signal */

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifndef PS_S
 #define PS_S                   (0x0c00)
Index: u-boot-v2.git/include/asm-blackfin/setup.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/setup.h     2008-06-18 22:33:19.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/setup.h  2008-06-18 22:33:20.000000000 -0500
@@ -35,7 +35,7 @@

 #define MACH_BFIN      1

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifndef __ASSEMBLY__
 extern unsigned long blackfin_machtype;
Index: u-boot-v2.git/include/asm-blackfin/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/types.h     2008-06-18 22:33:02.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/types.h  2008-06-18 22:33:03.000000000 -0500
@@ -59,7 +59,7 @@
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 typedef signed char s8;
 typedef unsigned char u8;
Index: u-boot-v2.git/include/asm-m68k/byteorder.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/byteorder.h     2008-06-18 22:34:16.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/byteorder.h  2008-06-18 22:34:16.000000000 -0500
@@ -34,7 +34,7 @@

 #include <asm/types.h>

-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#if !defined(__STRICT_ANSI__) || defined(__U_BOOT__)
 #  define __BYTEORDER_HAS_U64__
 #  define __SWAB_64_THRU_32__
 #endif
Index: u-boot-v2.git/include/asm-m68k/elf.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/elf.h   2008-06-18 22:34:22.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/elf.h        2008-06-18 22:34:23.000000000 -0500
@@ -139,7 +139,7 @@

 #define ELF_PLATFORM  (NULL)

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
 #endif

Index: u-boot-v2.git/include/asm-m68k/io.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/io.h    2008-06-18 22:34:19.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/io.h 2008-06-18 22:34:20.000000000 -0500
@@ -26,7 +26,7 @@
 #ifndef __ASM_M68K_IO_H
 #define __ASM_M68K_IO_H

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #include <linux/types.h>
 #include <asm/byteorder.h>
@@ -300,5 +300,5 @@
 #define isa_check_signature(io,sig,len)        (0)

 #endif /* __mem_isa */
-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */
 #endif /* __ASM_M68K_IO_H */
Index: u-boot-v2.git/include/asm-m68k/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/posix_types.h   2008-06-18 22:33:54.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/posix_types.h        2008-06-18 22:33:55.000000000 -0500
@@ -57,14 +57,14 @@
 #endif

 typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
+#if defined(__U_BOOT__) || defined(__USE_ALL)
        int     val[2];
-#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#else /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
        int     __val[2];
-#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#endif /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

 #undef __FD_SET
 #define __FD_SET(fd, fdsetp) \
Index: u-boot-v2.git/include/asm-m68k/proc-mcfv4e/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/proc-mcfv4e/ptrace.h    2008-06-18 22:34:03.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/proc-mcfv4e/ptrace.h 2008-06-18 22:34:04.000000000 -0500
@@ -81,7 +81,7 @@
 #define M68K_d0    uregs[ 0]


-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define user_mode(regs)        \
        (((regs)->M68K_sr & SVR_MODE) == 0)
@@ -112,7 +112,7 @@
        return 0;
 }

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif /* __ASSEMBLY__ */

Index: u-boot-v2.git/include/asm-m68k/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/ptrace.h        2008-06-18 22:34:17.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/ptrace.h     2008-06-18 22:34:18.000000000 -0500
@@ -46,7 +46,7 @@
 #define instruction_pointer(regs) ((regs)->M68K_pc)
 #define profile_pc(regs)          instruction_pointer(regs)

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 extern void show_regs(struct pt_regs *);
 #endif

Index: u-boot-v2.git/include/asm-m68k/setup.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/setup.h 2008-06-18 22:34:07.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/setup.h      2008-06-18 22:34:08.000000000 -0500
@@ -45,7 +45,7 @@
     /* ColdFire boards */
 #define MACH_FIRE_ENGINE   12

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifndef __ASSEMBLY__
 extern unsigned long m68k_machtype;
@@ -205,7 +205,7 @@
 #  define MACH_TYPE (m68k_machtype)
 #endif

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */


     /*
@@ -261,7 +261,7 @@
 #define MMU_APOLLO     (1<<MMUB_APOLLO)
 #define MMU_CFV4E      (1<<MMUB_CFV4E)

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifndef __ASSEMBLY__
 extern unsigned long m68k_cputype;
@@ -407,6 +407,6 @@
 #define  CHIP_RESTORE_DIRECTIVE  .chip 68k
 #endif

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif /* _M68K_SETUP_H */
Index: u-boot-v2.git/include/asm-m68k/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/types.h 2008-06-18 22:33:50.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/types.h      2008-06-18 22:33:51.000000000 -0500
@@ -52,7 +52,7 @@
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define BITS_PER_LONG 32

@@ -77,6 +77,6 @@

 #endif /* __ASSEMBLY__ */

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif
Index: u-boot-v2.git/include/asm-ppc/bitops.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/bitops.h 2008-06-18 22:31:52.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/bitops.h      2008-06-18 22:31:53.000000000 -0500
@@ -166,7 +166,7 @@
        return __ilog2(x & -x);
 }

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 /*
  * ffs: find first bit set. This is defined the same way as
@@ -187,7 +187,7 @@
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 /*
  * This implementation of find_{first,next}_zero_bit was stolen from
@@ -235,7 +235,7 @@

 #define _EXT2_HAVE_ASM_BITOPS_

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 /*
  * test_and_{set,clear}_bit guarantee atomicity without
  * disabling interrupts.
@@ -269,7 +269,7 @@
        *ADDR = *ADDR & ~mask;
        return oldbit;
 }
-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 extern __inline__ int ext2_test_bit(int nr, __const__ void * addr)
 {
Index: u-boot-v2.git/include/asm-ppc/cache.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/cache.h  2008-06-18 22:32:03.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/cache.h       2008-06-18 22:32:04.000000000 -0500
@@ -30,7 +30,7 @@
                 __section__(".data.cacheline_aligned")))
 #endif

-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#if defined(__U_BOOT__) && !defined(__ASSEMBLY__)
 extern void flush_dcache_range(unsigned long start, unsigned long stop);
 extern void clean_dcache_range(unsigned long start, unsigned long stop);
 extern void invalidate_dcache_range(unsigned long start, unsigned long stop);
Index: u-boot-v2.git/include/asm-ppc/elf.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/elf.h    2008-06-18 22:32:14.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/elf.h 2008-06-18 22:32:15.000000000 -0500
@@ -153,7 +153,7 @@
 #endif
 #endif

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 /*
  * This is used to ensure we don't load something for the wrong architecture.
  */
@@ -196,7 +196,7 @@

 #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 /* ELF_HWCAP yields a mask that user programs can use to figure out what
    instruction set this cpu supports.  This could be done in userspace,
@@ -215,7 +215,7 @@
 } while (0)
 #endif /* __powerpc64__ */

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifdef __powerpc64__
 # define SET_PERSONALITY(ex, ibcs2)                            \
@@ -244,7 +244,7 @@
 # define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
 #endif /* __powerpc64__ */

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 extern int dcache_bsize;
 extern int icache_bsize;
Index: u-boot-v2.git/include/asm-ppc/io.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/io.h     2008-06-18 22:32:12.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/io.h  2008-06-18 22:49:46.000000000 -0500
@@ -1,6 +1,7 @@
 /* originally from linux source.
  * removed the dependencies on CONFIG_ values
- * removed virt_to_phys stuff (and in fact everything surrounded by #if __KERNEL__)
+ * removed virt_to_phys stuff (and in fact everything surrounded by
+ * #if __U_BOOT__)
  * Modified By Rob Taylor, Flying Pig Systems, 2000
  */

Index: u-boot-v2.git/include/asm-ppc/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/posix_types.h    2008-06-18 22:31:48.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/posix_types.h 2008-06-18 22:31:50.000000000 -0500
@@ -50,7 +50,7 @@

 #else /* __GNUC__ */

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \
     || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
 /* With GNU C, use inline functions instead so args are evaluated only once: */

@@ -104,6 +104,6 @@
        }
 }

-#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+#endif /* defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
 #endif /* __GNUC__ */
 #endif /* _PPC_POSIX_TYPES_H */
Index: u-boot-v2.git/include/asm-ppc/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/ptrace.h 2008-06-18 22:32:04.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/ptrace.h      2008-06-18 22:32:07.000000000 -0500
@@ -90,7 +90,7 @@

 #define PT_NIP 32
 #define PT_MSR 33
-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define PT_ORIG_R3 34
 #endif
 #define PT_CTR 35
Index: u-boot-v2.git/include/asm-ppc/signal.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/signal.h 2008-06-18 22:32:08.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/signal.h      2008-06-18 22:32:09.000000000 -0500
@@ -97,7 +97,7 @@

 #define MINSIGSTKSZ    2048
 #define SIGSTKSZ       8192
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 /*
  * These values of sa_flags are used only by the kernel as part of the
@@ -146,7 +146,7 @@
        size_t ss_size;
 } stack_t;

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #include <asm/sigcontext.h>

 #endif
Index: u-boot-v2.git/include/asm-ppc/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/types.h  2008-06-18 22:31:46.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/types.h       2008-06-18 22:31:47.000000000 -0500
@@ -23,7 +23,7 @@
        __u32 u[4];
 } __attribute((aligned(16))) vector128;

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
@@ -44,7 +44,7 @@
 /* DMA addresses are 32-bits wide */
 typedef u32 dma_addr_t;

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */
 #endif /* __ASSEMBLY__ */

 #endif
Index: u-boot-v2.git/include/asm-sandbox/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-sandbox/posix_types.h        2008-06-18 22:31:29.000000000 -0500
+++ u-boot-v2.git/include/asm-sandbox/posix_types.h     2008-06-18 22:31:33.000000000 -0500
@@ -37,14 +37,14 @@
 #endif

 typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
+#if defined(__U_BOOT__) || defined(__USE_ALL)
        int     val[2];
-#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#else /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
        int     __val[2];
-#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#endif /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

 #undef __FD_SET
 #define __FD_SET(fd,fdsetp) \
@@ -75,6 +75,6 @@
                        "2" ((__kernel_fd_set *) (fdsetp)) : "memory"); \
 } while (0)

-#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+#endif /* defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */

 #endif
Index: u-boot-v2.git/include/asm-sandbox/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-sandbox/types.h      2008-06-18 22:30:03.000000000 -0500
+++ u-boot-v2.git/include/asm-sandbox/types.h   2008-06-18 22:31:15.000000000 -0500
@@ -33,7 +33,7 @@
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 typedef signed char s8;
 typedef unsigned char u8;
@@ -53,6 +53,6 @@

 typedef u32 dma_addr_t;

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif
Index: u-boot-v2.git/include/cramfs/cramfs_fs.h
===================================================================
--- u-boot-v2.git.orig/include/cramfs/cramfs_fs.h       2008-06-18 22:32:54.000000000 -0500
+++ u-boot-v2.git/include/cramfs/cramfs_fs.h    2008-06-18 22:32:57.000000000 -0500
@@ -97,15 +97,15 @@
 #define CRAMFS_SET_OFFSET(x,y) ((x)->offset = (y))
 #define CRAMFS_SET_NAMELEN(x,y) ((x)->namelen = (y))
 #elif defined __BIG_ENDIAN
-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define CRAMFS_16(x)   swab16(x)
 #define CRAMFS_24(x)   ((swab32(x)) >> 8)
 #define CRAMFS_32(x)   swab32(x)
-#else /* not __KERNEL__ */
+#else /* not __U_BOOT__ */
 #define CRAMFS_16(x)   bswap_16(x)
 #define CRAMFS_24(x)   ((bswap_32(x)) >> 8)
 #define CRAMFS_32(x)   bswap_32(x)
-#endif /* not __KERNEL__ */
+#endif /* not __U_BOOT__ */
 #define CRAMFS_GET_NAMELEN(x)  (((u8*)(x))[8] & 0x3f)
 #define CRAMFS_GET_OFFSET(x)   ((CRAMFS_24(((u32*)(x))[2] & 0xffffff) << 2) |\
                                 ((((u32*)(x))[2] & 0xc0000000) >> 30))
Index: u-boot-v2.git/include/envfs.h
===================================================================
--- u-boot-v2.git.orig/include/envfs.h  2008-06-18 22:33:27.000000000 -0500
+++ u-boot-v2.git/include/envfs.h       2008-06-18 22:33:27.000000000 -0500
@@ -47,15 +47,15 @@
 #define ENVFS_SET_NAMELEN(x,y) ((x)->namelen = (y))
 #elif __BYTE_ORDER == __BIG_ENDIAN
 #warning "envfs compiled on big endian host"
-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define ENVFS_16(x)    swab16(x)
 #define ENVFS_24(x)    ((swab32(x)) >> 8)
 #define ENVFS_32(x)    swab32(x)
-#else /* not __KERNEL__ */
+#else /* not __U_BOOT__ */
 #define ENVFS_16(x)    bswap_16(x)
 #define ENVFS_24(x)    ((bswap_32(x)) >> 8)
 #define ENVFS_32(x)    bswap_32(x)
-#endif /* not __KERNEL__ */
+#endif /* not __U_BOOT__ */
 #define ENVFS_GET_NAMELEN(x) ENVFS_32(((x)->namelen))
 #define ENVFS_GET_OFFSET(x)    ENVFS_32(((x)->offset))
 #define ENVFS_SET_NAMELEN(x,y)((x)->offset = ENVFS_32((y)))
Index: u-boot-v2.git/include/linux/byteorder/generic.h
===================================================================
--- u-boot-v2.git.orig/include/linux/byteorder/generic.h        2008-06-18 22:33:44.000000000 -0500
+++ u-boot-v2.git/include/linux/byteorder/generic.h     2008-06-18 22:50:28.000000000 -0500
@@ -79,7 +79,7 @@
  */


-#if defined(__KERNEL__)
+#if defined(__U_BOOT__)
 /*
  * inside the kernel, we can use nicknames;
  * outside of it, we must avoid POSIX namespace pollution...
@@ -146,7 +146,7 @@
  * Do the prototypes. Somebody might want to take the
  * address or some such sick thing..
  */
-#if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
+#if defined(__U_BOOT__) || (defined(__GLIBC__) && __GLIBC__ >= 2)
 extern __u32                   ntohl(__u32);
 extern __u32                   htonl(__u32);
 #else
@@ -164,7 +164,7 @@
 #define ___ntohl(x) __be32_to_cpu(x)
 #define ___ntohs(x) __be16_to_cpu(x)

-#if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
+#if defined(__U_BOOT__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
 #define htonl(x) ___htonl(x)
 #define ntohl(x) ___ntohl(x)
 #else
Index: u-boot-v2.git/include/linux/byteorder/swab.h
===================================================================
--- u-boot-v2.git.orig/include/linux/byteorder/swab.h   2008-06-18 22:33:42.000000000 -0500
+++ u-boot-v2.git/include/linux/byteorder/swab.h        2008-06-18 22:33:43.000000000 -0500
@@ -143,7 +143,7 @@
 }
 #endif /* __BYTEORDER_HAS_U64__ */

-#if defined(__KERNEL__)
+#if defined(__U_BOOT__)
 #define swab16 __swab16
 #define swab32 __swab32
 #define swab64 __swab64
Index: u-boot-v2.git/include/linux/types.h
===================================================================
--- u-boot-v2.git.orig/include/linux/types.h    2008-06-18 22:33:32.000000000 -0500
+++ u-boot-v2.git/include/linux/types.h 2008-06-18 22:33:35.000000000 -0500
@@ -17,7 +17,7 @@
 typedef __kernel_key_t         key_t;
 typedef __kernel_suseconds_t   suseconds_t;

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 typedef __kernel_uid32_t       uid_t;
 typedef __kernel_gid32_t       gid_t;
 typedef __kernel_uid16_t        uid16_t;
@@ -35,7 +35,7 @@
 #else
 typedef __kernel_uid_t         uid_t;
 typedef __kernel_gid_t         gid_t;
-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __kernel_loff_t                loff_t;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [Patch] U-Boot-v2: general replace __KERNEL__ with __UBOOT__
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Jon Loeliger @ 2008-06-19 12:53 UTC (permalink / raw)
  To: u-boot

Menon, Nishanth wrote:
> Robert,
>> -----Original Message-----
>> From: Robert Schwebel [mailto:r.schwebel at pengutronix.de]
>> Sent: Wednesday, June 18, 2008 2:02 PM
>> To: Menon, Nishanth
>> Cc: Sascha Hauer; Laurent Desnogues; Kamat, Nishant; philip.balister at gmail.com; u-boot-
>> users at lists.sourceforge.net
>> Subject: Re: [U-Boot-Users] [Patch 1/9] U-boot-V2:ID: Sync mod_devicetable
>>
>>> +
>>> +#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__.


All the above crap should appear below the following "---" line.

> Here is a patch to cleanup all other occurrences currently in u-boot v2. This is a blind replacement throughout. Do we want to consider replacing include/linux with include/u-boot?

That should be line-length-limited to about 70 characters.
The question should appear below the "---" line too.

And I'd suggest that, if we go this route as a whole, then
then the include directory should be renamed as well.

> Signed-off-by: Nishanth Menon <x0nishan@ti.com>
> 
> ---

Here.

jdl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [Patch] U-Boot-v2: general replace __KERNEL__ with __UBOOT__
  2008-06-19 12:53     ` Jon Loeliger
@ 2008-06-19 13:05       ` Menon, Nishanth
  2008-06-19 15:11         ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Menon, Nishanth @ 2008-06-19 13:05 UTC (permalink / raw)
  To: u-boot

Jon,

> -----Original Message-----
> From: Jon Loeliger [mailto:jdl at freescale.com]
> Sent: Thursday, June 19, 2008 7:54 AM
> To: Menon, Nishanth
> Cc: Robert Schwebel; Laurent Desnogues; Kamat, Nishant; philip.balister at gmail.com; u-boot-
> users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] [Patch] U-Boot-v2: general replace __KERNEL__ with __UBOOT__
>
> All the above crap should appear below the following "---" line.
Message taken -> it I manage to get outlook to behave sane.
http://www.denx.de/wiki/UBoot/Patches
I get patches to not linewrap I loose out on mail contents being over 70!
But yeah I will manually correct them (added to my checklist).

> That should be line-length-limited to about 70 characters.
> The question should appear below the "---" line too.
Not a bad thing to add to the wiki. Newbies like me get guided. Thanks :)

>
> And I'd suggest that, if we go this route as a whole, then
> then the include directory should be renamed as well.
That is just a start. I think we need to go all the way, replace occurances of
kernel with u_boot and KERNEL usage.

Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [Patch] U-Boot-v2: general replace __KERNEL__ with __UBOOT__
  2008-06-19 13:05       ` Menon, Nishanth
@ 2008-06-19 15:11         ` Wolfgang Denk
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2008-06-19 15:11 UTC (permalink / raw)
  To: u-boot

In message <7A436F7769CA33409C6B44B358BFFF0CD3211A1B@dlee02.ent.ti.com> you wrote:
> 
> > That should be line-length-limited to about 70 characters.
> > The question should appear below the "---" line too.
> Not a bad thing to add to the wiki. Newbies like me get guided. Thanks :)

Good. Feel free to add it. It's a wiki.

Best regards,

Wolfgang Denk

-- 
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 time history repeats itself the price goes up.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-06-19 15:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox