ide: add IDE_HFLAG_SERIALIZE_DMA host flag
[safe/jmp/linux-2.6] / drivers / ide / pci / cmd640.c
index da3565e..25c2f1b 100644 (file)
@@ -1,12 +1,10 @@
 /*
- *  linux/drivers/ide/pci/cmd640.c             Version 1.02  Sep 01, 1996
- *
  *  Copyright (C) 1995-1996  Linus Torvalds & authors (see below)
  */
 
 /*
  *  Original authors:  abramov@cecmow.enet.dec.com (Igor Abramov)
- *                     mlord@pobox.com (Mark Lord)
+ *                     mlord@pobox.com (Mark Lord)
  *
  *  See linux/MAINTAINERS for address of current maintainer.
  *
 
 #define CMD640_PREFETCH_MASKS 1
 
-//#define CMD640_DUMP_REGS
+/*#define CMD640_DUMP_REGS */
 
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/ioport.h>
-#include <linux/blkdev.h>
 #include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <linux/init.h>
 
 #include <asm/io.h>
 
+#define DRV_NAME "cmd640"
+
 /*
  * This flag is set in ide.c by the parameter:  ide0=cmd640_vlb
  */
-int cmd640_vlb = 0;
+int cmd640_vlb;
 
 /*
  * CMD640 specific registers definition.
@@ -191,7 +187,6 @@ static DEFINE_SPINLOCK(cmd640_lock);
  * These are initialized to point at the devices we control
  */
 static ide_hwif_t  *cmd_hwif0, *cmd_hwif1;
-static ide_drive_t *cmd_drives[4];
 
 /*
  * Interface to access cmd640x registers
@@ -213,13 +208,13 @@ static unsigned int cmd640_chip_version;
 
 /* PCI method 1 access */
 
-static void put_cmd640_reg_pci1 (u16 reg, u8 val)
+static void put_cmd640_reg_pci1(u16 reg, u8 val)
 {
        outl_p((reg & 0xfc) | cmd640_key, 0xcf8);
        outb_p(val, (reg & 3) | 0xcfc);
 }
 
-static u8 get_cmd640_reg_pci1 (u16 reg)
+static u8 get_cmd640_reg_pci1(u16 reg)
 {
        outl_p((reg & 0xfc) | cmd640_key, 0xcf8);
        return inb_p((reg & 3) | 0xcfc);
@@ -227,14 +222,14 @@ static u8 get_cmd640_reg_pci1 (u16 reg)
 
 /* PCI method 2 access (from CMD datasheet) */
 
-static void put_cmd640_reg_pci2 (u16 reg, u8 val)
+static void put_cmd640_reg_pci2(u16 reg, u8 val)
 {
        outb_p(0x10, 0xcf8);
        outb_p(val, cmd640_key + reg);
        outb_p(0, 0xcf8);
 }
 
-static u8 get_cmd640_reg_pci2 (u16 reg)
+static u8 get_cmd640_reg_pci2(u16 reg)
 {
        u8 b;
 
@@ -246,13 +241,13 @@ static u8 get_cmd640_reg_pci2 (u16 reg)
 
 /* VLB access */
 
-static void put_cmd640_reg_vlb (u16 reg, u8 val)
+static void put_cmd640_reg_vlb(u16 reg, u8 val)
 {
        outb_p(reg, cmd640_key);
        outb_p(val, cmd640_key + 4);
 }
 
-static u8 get_cmd640_reg_vlb (u16 reg)
+static u8 get_cmd640_reg_vlb(u16 reg)
 {
        outb_p(reg, cmd640_key);
        return inb_p(cmd640_key + 4);
@@ -274,11 +269,11 @@ static void put_cmd640_reg(u16 reg, u8 val)
        unsigned long flags;
 
        spin_lock_irqsave(&cmd640_lock, flags);
-       __put_cmd640_reg(reg,val);
+       __put_cmd640_reg(reg, val);
        spin_unlock_irqrestore(&cmd640_lock, flags);
 }
 
-static int __init match_pci_cmd640_device (void)
+static int __init match_pci_cmd640_device(void)
 {
        const u8 ven_dev[4] = {0x95, 0x10, 0x40, 0x06};
        unsigned int i;
@@ -298,7 +293,7 @@ static int __init match_pci_cmd640_device (void)
 /*
  * Probe for CMD640x -- pci method 1
  */
-static int __init probe_for_cmd640_pci1 (void)
+static int __init probe_for_cmd640_pci1(void)
 {
        __get_cmd640_reg = get_cmd640_reg_pci1;
        __put_cmd640_reg = put_cmd640_reg_pci1;
@@ -314,7 +309,7 @@ static int __init probe_for_cmd640_pci1 (void)
 /*
  * Probe for CMD640x -- pci method 2
  */
-static int __init probe_for_cmd640_pci2 (void)
+static int __init probe_for_cmd640_pci2(void)
 {
        __get_cmd640_reg = get_cmd640_reg_pci2;
        __put_cmd640_reg = put_cmd640_reg_pci2;
@@ -328,7 +323,7 @@ static int __init probe_for_cmd640_pci2 (void)
 /*
  * Probe for CMD640x -- vlb
  */
-static int __init probe_for_cmd640_vlb (void)
+static int __init probe_for_cmd640_vlb(void)
 {
        u8 b;
 
@@ -349,7 +344,7 @@ static int __init probe_for_cmd640_vlb (void)
  *  Returns 1 if an IDE interface/drive exists at 0x170,
  *  Returns 0 otherwise.
  */
-static int __init secondary_port_responding (void)
+static int __init secondary_port_responding(void)
 {
        unsigned long flags;
 
@@ -373,7 +368,7 @@ static int __init secondary_port_responding (void)
 /*
  * Dump out all cmd640 registers.  May be called from ide.c
  */
-static void cmd640_dump_regs (void)
+static void cmd640_dump_regs(void)
 {
        unsigned int reg = cmd640_vlb ? 0x50 : 0x00;
 
@@ -392,9 +387,8 @@ static void cmd640_dump_regs (void)
  * Check whether prefetch is on for a drive,
  * and initialize the unmask flags for safe operation.
  */
-static void __init check_prefetch (unsigned int index)
+static void __init check_prefetch(ide_drive_t *drive, unsigned int index)
 {
-       ide_drive_t *drive = cmd_drives[index];
        u8 b = get_cmd640_reg(prefetch_regs[index]);
 
        if (b & prefetch_masks[index]) {        /* is prefetch off? */
@@ -410,38 +404,13 @@ static void __init check_prefetch (unsigned int index)
        }
 }
 
-/*
- * Figure out which devices we control
- */
-static void __init setup_device_ptrs (void)
-{
-       unsigned int i;
-
-       cmd_hwif0 = &ide_hwifs[0]; /* default, if not found below */
-       cmd_hwif1 = &ide_hwifs[1]; /* default, if not found below */
-       for (i = 0; i < MAX_HWIFS; i++) {
-               ide_hwif_t *hwif = &ide_hwifs[i];
-               if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced) {
-                       if (hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0)
-                               cmd_hwif0 = hwif;
-                       else if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170)
-                               cmd_hwif1 = hwif;
-               }
-       }
-       cmd_drives[0] = &cmd_hwif0->drives[0];
-       cmd_drives[1] = &cmd_hwif0->drives[1];
-       cmd_drives[2] = &cmd_hwif1->drives[0];
-       cmd_drives[3] = &cmd_hwif1->drives[1];
-}
-
 #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
 
 /*
  * Sets prefetch mode for a drive.
  */
-static void set_prefetch_mode (unsigned int index, int mode)
+static void set_prefetch_mode(ide_drive_t *drive, unsigned int index, int mode)
 {
-       ide_drive_t *drive = cmd_drives[index];
        unsigned long flags;
        int reg = prefetch_regs[index];
        u8 b;
@@ -468,7 +437,7 @@ static void set_prefetch_mode (unsigned int index, int mode)
 /*
  * Dump out current drive clocks settings
  */
-static void display_clocks (unsigned int index)
+static void display_clocks(unsigned int index)
 {
        u8 active_count, recovery_count;
 
@@ -487,7 +456,7 @@ static void display_clocks (unsigned int index)
  * Pack active and recovery counts into single byte representation
  * used by controller
  */
-static inline u8 pack_nibbles (u8 upper, u8 lower)
+static inline u8 pack_nibbles(u8 upper, u8 lower)
 {
        return ((upper & 0x0f) << 4) | (lower & 0x0f);
 }
@@ -495,7 +464,7 @@ static inline u8 pack_nibbles (u8 upper, u8 lower)
 /*
  * This routine retrieves the initial drive timings from the chipset.
  */
-static void __init retrieve_drive_counts (unsigned int index)
+static void __init retrieve_drive_counts(unsigned int index)
 {
        u8 b;
 
@@ -504,10 +473,10 @@ static void __init retrieve_drive_counts (unsigned int index)
         */
        b = get_cmd640_reg(arttim_regs[index]) & ~0x3f;
        switch (b) {
-               case 0x00: b = 4; break;
-               case 0x80: b = 3; break;
-               case 0x40: b = 2; break;
-               default:   b = 5; break;
+       case 0x00: b = 4; break;
+       case 0x80: b = 3; break;
+       case 0x40: b = 2; break;
+       default:   b = 5; break;
        }
        setup_counts[index] = b;
 
@@ -524,7 +493,7 @@ static void __init retrieve_drive_counts (unsigned int index)
  * This routine writes the prepared setup/active/recovery counts
  * for a drive into the cmd640 chipset registers to active them.
  */
-static void program_drive_counts (unsigned int index)
+static void program_drive_counts(ide_drive_t *drive, unsigned int index)
 {
        unsigned long flags;
        u8 setup_count    = setup_counts[index];
@@ -538,8 +507,11 @@ static void program_drive_counts (unsigned int index)
         * so we merge the timings, using the slowest value for each timing.
         */
        if (index > 1) {
-               unsigned int mate;
-               if (cmd_drives[mate = index ^ 1]->present) {
+               ide_hwif_t *hwif = drive->hwif;
+               ide_drive_t *peer = &hwif->drives[!drive->select.b.unit];
+               unsigned int mate = index ^ 1;
+
+               if (peer->present) {
                        if (setup_count < setup_counts[mate])
                                setup_count = setup_counts[mate];
                        if (active_count < active_counts[mate])
@@ -553,11 +525,11 @@ static void program_drive_counts (unsigned int index)
         * Convert setup_count to internal chipset representation
         */
        switch (setup_count) {
-               case 4:  setup_count = 0x00; break;
-               case 3:  setup_count = 0x80; break;
-               case 1:
-               case 2:  setup_count = 0x40; break;
-               default: setup_count = 0xc0; /* case 5 */
+       case 4:  setup_count = 0x00; break;
+       case 3:  setup_count = 0x80; break;
+       case 1:
+       case 2:  setup_count = 0x40; break;
+       default: setup_count = 0xc0; /* case 5 */
        }
 
        /*
@@ -578,7 +550,8 @@ static void program_drive_counts (unsigned int index)
 /*
  * Set a specific pio_mode for a drive
  */
-static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle_time)
+static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
+                           u8 pio_mode, unsigned int cycle_time)
 {
        int setup_time, active_time, recovery_time, clock_time;
        u8 setup_count, active_count, recovery_count, recovery_count2, cycle_count;
@@ -590,15 +563,15 @@ static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle
        active_time = ide_pio_timings[pio_mode].active_time;
        recovery_time = cycle_time - (setup_time + active_time);
        clock_time = 1000 / bus_speed;
-       cycle_count = (cycle_time + clock_time - 1) / clock_time;
+       cycle_count = DIV_ROUND_UP(cycle_time, clock_time);
 
-       setup_count = (setup_time + clock_time - 1) / clock_time;
+       setup_count = DIV_ROUND_UP(setup_time, clock_time);
 
-       active_count = (active_time + clock_time - 1) / clock_time;
+       active_count = DIV_ROUND_UP(active_time, clock_time);
        if (active_count < 2)
                active_count = 2; /* minimum allowed by cmd640 */
 
-       recovery_count = (recovery_time + clock_time - 1) / clock_time;
+       recovery_count = DIV_ROUND_UP(recovery_time, clock_time);
        recovery_count2 = cycle_count - (setup_count + active_count);
        if (recovery_count2 > recovery_count)
                recovery_count = recovery_count2;
@@ -627,7 +600,7 @@ static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle
         *      1) this is the wrong place to do it (proper is do_special() in ide.c)
         *      2) in practice this is rarely, if ever, necessary
         */
-       program_drive_counts (index);
+       program_drive_counts(drive, index);
 }
 
 static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio)
@@ -635,32 +608,26 @@ static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio)
        unsigned int index = 0, cycle_time;
        u8 b;
 
-       while (drive != cmd_drives[index]) {
-               if (++index > 3) {
-                       printk(KERN_ERR "%s: bad news in %s\n",
-                                       drive->name, __FUNCTION__);
-                       return;
-               }
-       }
        switch (pio) {
-               case 6: /* set fast-devsel off */
-               case 7: /* set fast-devsel on */
-                       b = get_cmd640_reg(CNTRL) & ~0x27;
-                       if (pio & 1)
-                               b |= 0x27;
-                       put_cmd640_reg(CNTRL, b);
-                       printk("%s: %sabled cmd640 fast host timing (devsel)\n", drive->name, (pio & 1) ? "en" : "dis");
-                       return;
-
-               case 8: /* set prefetch off */
-               case 9: /* set prefetch on */
-                       set_prefetch_mode(index, pio & 1);
-                       printk("%s: %sabled cmd640 prefetch\n", drive->name, (pio & 1) ? "en" : "dis");
-                       return;
+       case 6: /* set fast-devsel off */
+       case 7: /* set fast-devsel on */
+               b = get_cmd640_reg(CNTRL) & ~0x27;
+               if (pio & 1)
+                       b |= 0x27;
+               put_cmd640_reg(CNTRL, b);
+               printk("%s: %sabled cmd640 fast host timing (devsel)\n",
+                       drive->name, (pio & 1) ? "en" : "dis");
+               return;
+       case 8: /* set prefetch off */
+       case 9: /* set prefetch on */
+               set_prefetch_mode(drive, index, pio & 1);
+               printk("%s: %sabled cmd640 prefetch\n",
+                       drive->name, (pio & 1) ? "en" : "dis");
+               return;
        }
 
        cycle_time = ide_pio_cycle_time(drive, pio);
-       cmd640_set_mode(index, pio, cycle_time);
+       cmd640_set_mode(drive, index, pio, cycle_time);
 
        printk("%s: selected cmd640 PIO mode%d (%dns)",
                drive->name, pio, cycle_time);
@@ -668,6 +635,9 @@ static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio)
        display_clocks(index);
 }
 
+static const struct ide_port_ops cmd640_port_ops = {
+       .set_pio_mode           = cmd640_set_pio_mode,
+};
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
 
 static int pci_conf1(void)
@@ -705,6 +675,37 @@ static int pci_conf2(void)
        return 0;
 }
 
+static const struct ide_port_info cmd640_port_info __initdata = {
+       .chipset                = ide_cmd640,
+       .host_flags             = IDE_HFLAG_SERIALIZE |
+                                 IDE_HFLAG_NO_DMA |
+                                 IDE_HFLAG_NO_AUTOTUNE |
+                                 IDE_HFLAG_ABUSE_PREFETCH |
+                                 IDE_HFLAG_ABUSE_FAST_DEVSEL,
+#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
+       .port_ops               = &cmd640_port_ops,
+       .pio_mask               = ATA_PIO5,
+#endif
+};
+
+static int cmd640x_init_one(unsigned long base, unsigned long ctl)
+{
+       if (!request_region(base, 8, DRV_NAME)) {
+               printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
+                               DRV_NAME, base, base + 7);
+               return -EBUSY;
+       }
+
+       if (!request_region(ctl, 1, DRV_NAME)) {
+               printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n",
+                               DRV_NAME, ctl);
+               release_region(base, 8);
+               return -EBUSY;
+       }
+
+       return 0;
+}
+
 /*
  * Probe for a cmd640 chipset, and initialize it if found.
  */
@@ -713,11 +714,12 @@ static int __init cmd640x_init(void)
 #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
        int second_port_toggled = 0;
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
-       int second_port_cmd640 = 0;
+       int second_port_cmd640 = 0, rc;
        const char *bus_type, *port2;
        unsigned int index;
        u8 b, cfr;
        u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+       hw_regs_t hw[2];
 
        if (cmd640_vlb && probe_for_cmd640_vlb()) {
                bus_type = "VLB";
@@ -752,25 +754,41 @@ static int __init cmd640x_init(void)
        cfr = get_cmd640_reg(CFR);
        cmd640_chip_version = cfr & CFR_DEVREV;
        if (cmd640_chip_version == 0) {
-               printk ("ide: bad cmd640 revision: %d\n", cmd640_chip_version);
+               printk("ide: bad cmd640 revision: %d\n", cmd640_chip_version);
                return 0;
        }
 
+       rc = cmd640x_init_one(0x1f0, 0x3f6);
+       if (rc)
+               return rc;
+
+       rc = cmd640x_init_one(0x170, 0x376);
+       if (rc) {
+               release_region(0x3f6, 1);
+               release_region(0x1f0, 8);
+               return rc;
+       }
+
+       memset(&hw, 0, sizeof(hw));
+
+       ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
+       hw[0].irq = 14;
+
+       ide_std_init_ports(&hw[1], 0x170, 0x376);
+       hw[1].irq = 15;
+
+       printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
+                        "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
+
+       cmd_hwif0 = ide_find_port();
+
        /*
         * Initialize data for primary port
         */
-       setup_device_ptrs ();
-       printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n",
-              cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr);
-       cmd_hwif0->chipset = ide_cmd640;
-#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
-       cmd_hwif0->host_flags = IDE_HFLAG_ABUSE_PREFETCH |
-                               IDE_HFLAG_ABUSE_FAST_DEVSEL;
-       cmd_hwif0->pio_mask = ATA_PIO5;
-       cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode;
-#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
-
-       idx[0] = cmd_hwif0->index;
+       if (cmd_hwif0) {
+               ide_init_port_hw(cmd_hwif0, &hw[0]);
+               idx[0] = cmd_hwif0->index;
+       }
 
        /*
         * Ensure compatibility by always using the slowest timings
@@ -782,10 +800,13 @@ static int __init cmd640x_init(void)
        put_cmd640_reg(CMDTIM, 0);
        put_cmd640_reg(BRST, 0x40);
 
+       cmd_hwif1 = ide_find_port();
+
        /*
         * Try to enable the secondary interface, if not already enabled
         */
-       if (cmd_hwif1->noprobe) {
+       if (cmd_hwif1 &&
+           cmd_hwif1->drives[0].noprobe && cmd_hwif1->drives[1].noprobe) {
                port2 = "not probed";
        } else {
                b = get_cmd640_reg(CNTRL);
@@ -816,42 +837,42 @@ static int __init cmd640x_init(void)
        /*
         * Initialize data for secondary cmd640 port, if enabled
         */
-       if (second_port_cmd640) {
-               cmd_hwif0->serialized = 1;
-               cmd_hwif1->serialized = 1;
-               cmd_hwif1->chipset = ide_cmd640;
-               cmd_hwif0->mate = cmd_hwif1;
-               cmd_hwif1->mate = cmd_hwif0;
-               cmd_hwif1->channel = 1;
-#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
-               cmd_hwif1->host_flags = IDE_HFLAG_ABUSE_PREFETCH |
-                                       IDE_HFLAG_ABUSE_FAST_DEVSEL;
-               cmd_hwif1->pio_mask = ATA_PIO5;
-               cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode;
-#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
-
+       if (second_port_cmd640 && cmd_hwif1) {
+               ide_init_port_hw(cmd_hwif1, &hw[1]);
                idx[1] = cmd_hwif1->index;
        }
-       printk(KERN_INFO "%s: %sserialized, secondary interface %s\n", cmd_hwif1->name,
-               cmd_hwif0->serialized ? "" : "not ", port2);
+       printk(KERN_INFO "cmd640: %sserialized, secondary interface %s\n",
+                        second_port_cmd640 ? "" : "not ", port2);
 
        /*
         * Establish initial timings/prefetch for all drives.
         * Do not unnecessarily disturb any prior BIOS setup of these.
         */
        for (index = 0; index < (2 + (second_port_cmd640 << 1)); index++) {
-               ide_drive_t *drive = cmd_drives[index];
+               ide_drive_t *drive;
+
+               if (index > 1) {
+                       if (cmd_hwif1 == NULL)
+                               continue;
+                       drive = &cmd_hwif1->drives[index & 1];
+               } else  {
+                       if (cmd_hwif0 == NULL)
+                               continue;
+                       drive = &cmd_hwif0->drives[index & 1];
+               }
+
 #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
                if (drive->autotune || ((index > 1) && second_port_toggled)) {
-                       /*
-                        * Reset timing to the slowest speed and turn off prefetch.
-                        * This way, the drive identify code has a better chance.
+                       /*
+                        * Reset timing to the slowest speed and turn off
+                        * prefetch.  This way, the drive identify code has
+                        * a better chance.
                         */
                        setup_counts    [index] = 4;    /* max possible */
                        active_counts   [index] = 16;   /* max possible */
                        recovery_counts [index] = 16;   /* max possible */
-                       program_drive_counts (index);
-                       set_prefetch_mode (index, 0);
+                       program_drive_counts(drive, index);
+                       set_prefetch_mode(drive, index, 0);
                        printk("cmd640: drive%d timings/prefetch cleared\n", index);
                } else {
                        /*
@@ -859,7 +880,7 @@ static int __init cmd640x_init(void)
                         * This preserves any prior BIOS setup.
                         */
                        retrieve_drive_counts (index);
-                       check_prefetch (index);
+                       check_prefetch(drive, index);
                        printk("cmd640: drive%d timings/prefetch(%s) preserved",
                                index, drive->no_io_32bit ? "off" : "on");
                        display_clocks(index);
@@ -868,7 +889,7 @@ static int __init cmd640x_init(void)
                /*
                 * Set the drive unmask flags to match the prefetch setting
                 */
-               check_prefetch (index);
+               check_prefetch(drive, index);
                printk("cmd640: drive%d timings/prefetch(%s) preserved\n",
                        index, drive->no_io_32bit ? "off" : "on");
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
@@ -878,7 +899,7 @@ static int __init cmd640x_init(void)
        cmd640_dump_regs();
 #endif
 
-       ide_device_add(idx);
+       ide_device_add(idx, &cmd640_port_info);
 
        return 1;
 }
@@ -887,3 +908,5 @@ module_param_named(probe_vlb, cmd640_vlb, bool, 0);
 MODULE_PARM_DESC(probe_vlb, "probe for VLB version of CMD640 chipset");
 
 module_init(cmd640x_init);
+
+MODULE_LICENSE("GPL");