PATCH: fix ALi 32bitisms, fix ALi FIFO, fix ALi IRQ crash

PATCH: fix ALi 32bitisms, fix ALi FIFO, fix ALi IRQ crash

Post by Alan Co » Wed, 19 Feb 2003 20:40:18



also Enable ATI IGP/ALi combo

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/drivers/ide/pci/alim15x3.c linux-2.5.61-ac2/drivers/ide/pci/alim15x3.c
--- linux-2.5.61/drivers/ide/pci/alim15x3.c     2003-02-10 18:38:19.000000000 +0000

 /*
- * linux/drivers/ide/alim15x3.c                Version 0.15    2002/08/19
+ * linux/drivers/ide/pci/alim15x3.c            Version 0.16    2003/01/02
  *
  *  Copyright (C) 1998-2000 Michel Aubry, Maintainer

  *     Don't use LBA48 mode on ALi <= 0xC4
  *     Don't poke 0x79 with a non ALi northbridge
  *     Don't flip undefined bits on newer chipsets (fix Fujitsu laptop hang)
+ *
+ *  Documentation
+ *     Chipset documentation available under NDA only
+ *
  */


 static int ali_get_info (char *buffer, char **addr, off_t offset, int count)
 {
-       u32 bibma;
+       unsigned long bibma;
        u8 reg53h, reg5xh, reg5yh, reg5xh1, reg5yh1, c0, c1, rev, tmp;
        char *q, *p = buffer;

                fifo[3]  = "   ???  ";

        /* first fetch bibma: */
-       pci_read_config_dword(bmide_dev, 0x20, &bibma);
-       bibma = (bibma & 0xfff0) ;
+      
+       bibma = pci_resource_start(bmide_dev, 4);
+
        /*
         * at that point bibma+0x2 et bibma+0xa are byte
         * registers to investigate:
         */
-       c0 = inb((unsigned short)bibma + 0x02);
-       c1 = inb((unsigned short)bibma + 0x0a);
+       c0 = inb(bibma + 0x02);
+       c1 = inb(bibma + 0x0a);

        p += sprintf(p,

        int port = hwif->channel ? 0x5c : 0x58;
        int portFIFO = hwif->channel ? 0x55 : 0x54;
        u8 cd_dma_fifo = 0;
+       int unit = drive->select.b.unit & 1;

        pio = ide_get_best_pio_mode(drive, pio, 5, &d);

         */
        pci_read_config_byte(dev, portFIFO, &cd_dma_fifo);
        if (drive->media==ide_disk) {
-               if (hwif->channel) {
+               if (unit) {
                        pci_write_config_byte(dev, portFIFO, (cd_dma_fifo & 0x0F) | 0x50);
                } else {
                        pci_write_config_byte(dev, portFIFO, (cd_dma_fifo & 0xF0) | 0x05);
                }
        } else {
-               if (hwif->channel) {
+               if (unit) {
                        pci_write_config_byte(dev, portFIFO, cd_dma_fifo & 0x0F);
                } else {

 static void __init init_hwif_ali15x3 (ide_hwif_t *hwif)
 {
        u8 ideic, inmir;
-       u8 irq_routing_table[] = { -1,  9, 3, 10, 4,  5, 7,  6,
+       s8 irq_routing_table[] = { -1,  9, 3, 10, 4,  5, 7,  6,
                                      1, 11, 0, 12, 0, 14, 0, 15 };
-
+       int irq = -1;
+      
        hwif->irq = hwif->channel ? 15 : 14;


                         */
                        pci_read_config_byte(isa_dev, 0x44, &inmir);
                        inmir = inmir & 0x0f;
-                       hwif->irq = irq_routing_table[inmir];
+                       irq = irq_routing_table[inmir];
                } else if (hwif->channel && !(ideic & 0x01)) {
                        /*
                         * get SIRQ2 routing table
                         */
                        pci_read_config_byte(isa_dev, 0x75, &inmir);
                        inmir = inmir & 0x0f;
-                       hwif->irq = irq_routing_table[inmir];
+                       irq = irq_routing_table[inmir];
                }
+               if(irq >= 0)
+                       hwif->irq = irq;
        }


        ide_pci_device_t *d = &ali15x3_chipsets[id->driver_data];

        if(pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_IGP, NULL))
-       {
-               printk(KERN_ERR "Warning: ATI Radeon IGP Northbridge is not supported by Linux\n");
-               return 1;
-       }
+               printk(KERN_ERR "Warning: ATI Radeon IGP Northbridge is not yet fully tested.\n");
+
 #if defined(CONFIG_SPARC64)
        d->init_hwif = init_hwif_common_ali15x3;
 #endif /* CONFIG_SPARC64 */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. IRQ Routing Problem on ALi Chipset Laptop (HP Pavilion N5425)

Hey there.


How new is this system?

If it's new (3-6 months) PCI IRQ information is probably encoded in ACPI
AML methods. OEMs are gradually changing from the old way (PIRQ and MP
tables, APM) to new Grand Unified Way(tm) (ACPI).

For a while now, BIOSes have shipped with both old tables and ACPI tables,
and in a lot of cases, one or the other lies. So, you're almost lucky in a
sense. Unfortunately, it doesn't solve your problem.

For some reason, the people that wrote the spec encoded PCI IRQ
information in AML (ACPI Machine Language), instead of putting them in a
flat table. Which means you need the interpretor up and running and you
need to execute those methods (don't ask, just nod and smile).

The Intel ACPI guys kinda have this working. They are able to extract and
execute the methods. But, they still have yet to make devices request and
use that information. Maybe Andy Grover can comment on this..

BTW, The latest ACPI patch is at: http://sourceforge.net/projects/acpi/.

        -pat

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. DHCP stopped responding

3. Need RS6000 microchannel to AT-bus converter.

4. IRQ/BIOS/PCMCIA hangs HP Pavillion ZE4101 (ATI/ALI chipset)

5. Kermit/num-lock key

6. IRQ Routing Problem on ALi Chipset Laptop (HP Pavilion N5425)

7. how to enable mouse in text-mode ?

8. fix big initramfs (was: [PATCH] gen_init_cpio fixes for 2.5.64)

9. ALI DMA Patches

10. patch for ALi V chipset (M1543/M1531) ?

11. PATCH: 2.5.40 Fix stupid scsi setup bug in 53c406, fix addressing

12. PATCH: remove unused ali-ircc variable