Merge branch 'linus' into sched/urgent

+3293 -1562
+1 -1
Documentation/cpusets.txt
··· 542 2 : search cores in a package. 543 3 : search cpus in a node [= system wide on non-NUMA system] 544 ( 4 : search nodes in a chunk of node [on NUMA system] ) 545 - ( 5~ : search system wide [on NUMA system]) 546 547 This file is per-cpuset and affect the sched domain where the cpuset 548 belongs to. Therefore if the flag 'sched_load_balance' of a cpuset
··· 542 2 : search cores in a package. 543 3 : search cpus in a node [= system wide on non-NUMA system] 544 ( 4 : search nodes in a chunk of node [on NUMA system] ) 545 + ( 5 : search system wide [on NUMA system] ) 546 547 This file is per-cpuset and affect the sched domain where the cpuset 548 belongs to. Therefore if the flag 'sched_load_balance' of a cpuset
+13 -20
Documentation/hwmon/sysfs-interface
··· 2 ------------------------------------------------ 3 4 The libsensors library offers an interface to the raw sensors data 5 - through the sysfs interface. See libsensors documentation and source for 6 - further information. As of writing this document, libsensors 7 - (from lm_sensors 2.8.3) is heavily chip-dependent. Adding or updating 8 - support for any given chip requires modifying the library's code. 9 - This is because libsensors was written for the procfs interface 10 - older kernel modules were using, which wasn't standardized enough. 11 - Recent versions of libsensors (from lm_sensors 2.8.2 and later) have 12 - support for the sysfs interface, though. 13 - 14 - The new sysfs interface was designed to be as chip-independent as 15 - possible. 16 17 Note that motherboards vary widely in the connections to sensor chips. 18 There is no standard that ensures, for example, that the second ··· 30 will have to implement conversion, labeling and hiding of inputs. For 31 this reason, it is still not recommended to bypass the library. 32 33 - If you are developing a userspace application please send us feedback on 34 - this standard. 35 - 36 - Note that this standard isn't completely established yet, so it is subject 37 - to changes. If you are writing a new hardware monitoring driver those 38 - features can't seem to fit in this interface, please contact us with your 39 - extension proposal. Keep in mind that backward compatibility must be 40 - preserved. 41 - 42 Each chip gets its own directory in the sysfs /sys/devices tree. To 43 find all sensor chips, it is easier to follow the device symlinks from 44 /sys/class/hwmon/hwmon*. 45 46 All sysfs values are fixed point numbers. 47
··· 2 ------------------------------------------------ 3 4 The libsensors library offers an interface to the raw sensors data 5 + through the sysfs interface. Since lm-sensors 3.0.0, libsensors is 6 + completely chip-independent. It assumes that all the kernel drivers 7 + implement the standard sysfs interface described in this document. 8 + This makes adding or updating support for any given chip very easy, as 9 + libsensors, and applications using it, do not need to be modified. 10 + This is a major improvement compared to lm-sensors 2. 11 12 Note that motherboards vary widely in the connections to sensor chips. 13 There is no standard that ensures, for example, that the second ··· 35 will have to implement conversion, labeling and hiding of inputs. For 36 this reason, it is still not recommended to bypass the library. 37 38 Each chip gets its own directory in the sysfs /sys/devices tree. To 39 find all sensor chips, it is easier to follow the device symlinks from 40 /sys/class/hwmon/hwmon*. 41 + 42 + Up to lm-sensors 3.0.0, libsensors looks for hardware monitoring attributes 43 + in the "physical" device directory. Since lm-sensors 3.0.1, attributes found 44 + in the hwmon "class" device directory are also supported. Complex drivers 45 + (e.g. drivers for multifunction chips) may want to use this possibility to 46 + avoid namespace pollution. The only drawback will be that older versions of 47 + libsensors won't support the driver in question. 48 49 All sysfs values are fixed point numbers. 50
+3 -3
MAINTAINERS
··· 4431 S: Maintained 4432 4433 W83791D HARDWARE MONITORING DRIVER 4434 - P: Charles Spirakis 4435 - M: bezaur@gmail.com 4436 L: lm-sensors@lm-sensors.org 4437 - S: Odd Fixes 4438 4439 W83793 HARDWARE MONITORING DRIVER 4440 P: Rudolf Marek
··· 4431 S: Maintained 4432 4433 W83791D HARDWARE MONITORING DRIVER 4434 + P: Marc Hulsman 4435 + M: m.hulsman@tudelft.nl 4436 L: lm-sensors@lm-sensors.org 4437 + S: Maintained 4438 4439 W83793 HARDWARE MONITORING DRIVER 4440 P: Rudolf Marek
+1 -1
Makefile
··· 1 VERSION = 2 2 PATCHLEVEL = 6 3 SUBLEVEL = 26 4 - EXTRAVERSION = -rc6 5 NAME = Rotary Wombat 6 7 # *DOCUMENTATION*
··· 1 VERSION = 2 2 PATCHLEVEL = 6 3 SUBLEVEL = 26 4 + EXTRAVERSION = -rc7 5 NAME = Rotary Wombat 6 7 # *DOCUMENTATION*
+1
arch/alpha/Makefile
··· 13 LDFLAGS_vmlinux := -static -N #-relax 14 CHECKFLAGS += -D__alpha__ -m64 15 cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data 16 17 cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4 18 cpuflags-$(CONFIG_ALPHA_EV5) := -mcpu=ev5
··· 13 LDFLAGS_vmlinux := -static -N #-relax 14 CHECKFLAGS += -D__alpha__ -m64 15 cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data 16 + cflags-y += $(call cc-option, -fno-jump-tables) 17 18 cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4 19 cpuflags-$(CONFIG_ALPHA_EV5) := -mcpu=ev5
+2
arch/alpha/kernel/core_t2.c
··· 74 # define DBG(args) 75 #endif 76 77 static volatile unsigned int t2_mcheck_any_expected; 78 static volatile unsigned int t2_mcheck_last_taken; 79
··· 74 # define DBG(args) 75 #endif 76 77 + DEFINE_SPINLOCK(t2_hae_lock); 78 + 79 static volatile unsigned int t2_mcheck_any_expected; 80 static volatile unsigned int t2_mcheck_last_taken; 81
+17
arch/alpha/kernel/pci.c
··· 71 static void __init 72 quirk_cypress(struct pci_dev *dev) 73 { 74 /* The Cypress bridge responds on the PCI bus in the address range 75 0xffff0000-0xffffffff (conventional x86 BIOS ROM). There is no 76 way to turn this off. The bridge also supports several extended
··· 71 static void __init 72 quirk_cypress(struct pci_dev *dev) 73 { 74 + /* The Notorious Cy82C693 chip. */ 75 + 76 + /* The generic legacy mode IDE fixup in drivers/pci/probe.c 77 + doesn't work correctly with the Cypress IDE controller as 78 + it has non-standard register layout. Fix that. */ 79 + if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE) { 80 + dev->resource[2].start = dev->resource[3].start = 0; 81 + dev->resource[2].end = dev->resource[3].end = 0; 82 + dev->resource[2].flags = dev->resource[3].flags = 0; 83 + if (PCI_FUNC(dev->devfn) == 2) { 84 + dev->resource[0].start = 0x170; 85 + dev->resource[0].end = 0x177; 86 + dev->resource[1].start = 0x376; 87 + dev->resource[1].end = 0x376; 88 + } 89 + } 90 + 91 /* The Cypress bridge responds on the PCI bus in the address range 92 0xffff0000-0xffffffff (conventional x86 BIOS ROM). There is no 93 way to turn this off. The bridge also supports several extended
+2 -1
arch/alpha/kernel/traps.c
··· 447 448 449 /* Macro for exception fixup code to access integer registers. */ 450 - #define una_reg(r) (regs->regs[(r) >= 16 && (r) <= 18 ? (r)+19 : (r)]) 451 452 453 asmlinkage void ··· 456 { 457 long error, tmp1, tmp2, tmp3, tmp4; 458 unsigned long pc = regs->pc - 4; 459 const struct exception_table_entry *fixup; 460 461 unaligned[0].count++;
··· 447 448 449 /* Macro for exception fixup code to access integer registers. */ 450 + #define una_reg(r) (_regs[(r) >= 16 && (r) <= 18 ? (r)+19 : (r)]) 451 452 453 asmlinkage void ··· 456 { 457 long error, tmp1, tmp2, tmp3, tmp4; 458 unsigned long pc = regs->pc - 4; 459 + unsigned long *_regs = regs->regs; 460 const struct exception_table_entry *fixup; 461 462 unaligned[0].count++;
+2
arch/ia64/sn/kernel/sn2/sn2_smp.c
··· 512 int cpu; 513 char optstr[64]; 514 515 if (copy_from_user(optstr, user, count)) 516 return -EFAULT; 517 optstr[count - 1] = '\0';
··· 512 int cpu; 513 char optstr[64]; 514 515 + if (count > sizeof(optstr)) 516 + return -EINVAL; 517 if (copy_from_user(optstr, user, count)) 518 return -EFAULT; 519 optstr[count - 1] = '\0';
+1 -1
arch/powerpc/kernel/vdso.c
··· 142 printk("kpg: %p (c:%d,f:%08lx)", __va(page_to_pfn(pg) << PAGE_SHIFT), 143 page_count(pg), 144 pg->flags); 145 - if (upg/* && pg != upg*/) { 146 printk(" upg: %p (c:%d,f:%08lx)", __va(page_to_pfn(upg) 147 << PAGE_SHIFT), 148 page_count(upg),
··· 142 printk("kpg: %p (c:%d,f:%08lx)", __va(page_to_pfn(pg) << PAGE_SHIFT), 143 page_count(pg), 144 pg->flags); 145 + if (upg && !IS_ERR(upg) /* && pg != upg*/) { 146 printk(" upg: %p (c:%d,f:%08lx)", __va(page_to_pfn(upg) 147 << PAGE_SHIFT), 148 page_count(upg),
+4 -1
arch/x86/kernel/geode_32.c
··· 166 static int has_vsa2 = -1; 167 168 if (has_vsa2 == -1) { 169 /* 170 * The VSA has virtual registers that we can query for a 171 * signature. ··· 175 outw(VSA_VR_UNLOCK, VSA_VRC_INDEX); 176 outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX); 177 178 - has_vsa2 = (inw(VSA_VRC_DATA) == VSA_SIG); 179 } 180 181 return has_vsa2;
··· 166 static int has_vsa2 = -1; 167 168 if (has_vsa2 == -1) { 169 + u16 val; 170 + 171 /* 172 * The VSA has virtual registers that we can query for a 173 * signature. ··· 173 outw(VSA_VR_UNLOCK, VSA_VRC_INDEX); 174 outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX); 175 176 + val = inw(VSA_VRC_DATA); 177 + has_vsa2 = (val == AMD_VSA_SIG || val == GSW_VSA_SIG); 178 } 179 180 return has_vsa2;
+1
arch/x86/kernel/process_32.c
··· 333 /* 334 * Forget coprocessor state.. 335 */ 336 clear_fpu(tsk); 337 clear_used_math(); 338 }
··· 333 /* 334 * Forget coprocessor state.. 335 */ 336 + tsk->fpu_counter = 0; 337 clear_fpu(tsk); 338 clear_used_math(); 339 }
+1
arch/x86/kernel/process_64.c
··· 294 /* 295 * Forget coprocessor state.. 296 */ 297 clear_fpu(tsk); 298 clear_used_math(); 299 }
··· 294 /* 295 * Forget coprocessor state.. 296 */ 297 + tsk->fpu_counter = 0; 298 clear_fpu(tsk); 299 clear_used_math(); 300 }
+8 -2
arch/x86/kernel/setup_32.c
··· 532 (unsigned long)(crash_size >> 20), 533 (unsigned long)(crash_base >> 20), 534 (unsigned long)(total_mem >> 20)); 535 crashk_res.start = crash_base; 536 crashk_res.end = crash_base + crash_size - 1; 537 - reserve_bootmem(crash_base, crash_size, 538 - BOOTMEM_DEFAULT); 539 } else 540 printk(KERN_INFO "crashkernel reservation failed - " 541 "you have to specify a base address\n");
··· 532 (unsigned long)(crash_size >> 20), 533 (unsigned long)(crash_base >> 20), 534 (unsigned long)(total_mem >> 20)); 535 + 536 + if (reserve_bootmem(crash_base, crash_size, 537 + BOOTMEM_EXCLUSIVE) < 0) { 538 + printk(KERN_INFO "crashkernel reservation " 539 + "failed - memory is in use\n"); 540 + return; 541 + } 542 + 543 crashk_res.start = crash_base; 544 crashk_res.end = crash_base + crash_size - 1; 545 } else 546 printk(KERN_INFO "crashkernel reservation failed - " 547 "you have to specify a base address\n");
+8 -10
arch/x86/kernel/tsc_32.c
··· 14 15 #include "mach_timer.h" 16 17 - static int tsc_disabled; 18 19 /* 20 * On some systems the TSC frequency does not ··· 405 { 406 int cpu; 407 408 - if (!cpu_has_tsc || tsc_disabled) { 409 - /* Disable the TSC in case of !cpu_has_tsc */ 410 - tsc_disabled = 1; 411 return; 412 - } 413 414 cpu_khz = calculate_cpu_khz(); 415 tsc_khz = cpu_khz; 416 417 if (!cpu_khz) { 418 mark_tsc_unstable("could not calculate TSC khz"); 419 - /* 420 - * We need to disable the TSC completely in this case 421 - * to prevent sched_clock() from using it. 422 - */ 423 - tsc_disabled = 1; 424 return; 425 } 426 427 printk("Detected %lu.%03lu MHz processor.\n", 428 (unsigned long)cpu_khz / 1000,
··· 14 15 #include "mach_timer.h" 16 17 + /* native_sched_clock() is called before tsc_init(), so 18 + we must start with the TSC soft disabled to prevent 19 + erroneous rdtsc usage on !cpu_has_tsc processors */ 20 + static int tsc_disabled = -1; 21 22 /* 23 * On some systems the TSC frequency does not ··· 402 { 403 int cpu; 404 405 + if (!cpu_has_tsc || tsc_disabled > 0) 406 return; 407 408 cpu_khz = calculate_cpu_khz(); 409 tsc_khz = cpu_khz; 410 411 if (!cpu_khz) { 412 mark_tsc_unstable("could not calculate TSC khz"); 413 return; 414 } 415 + 416 + /* now allow native_sched_clock() to use rdtsc */ 417 + tsc_disabled = 0; 418 419 printk("Detected %lu.%03lu MHz processor.\n", 420 (unsigned long)cpu_khz / 1000,
+3 -5
drivers/acpi/ac.c
··· 233 234 device = ac->device; 235 switch (event) { 236 case ACPI_AC_NOTIFY_STATUS: 237 case ACPI_NOTIFY_BUS_CHECK: 238 case ACPI_NOTIFY_DEVICE_CHECK: ··· 247 #ifdef CONFIG_ACPI_SYSFS_POWER 248 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); 249 #endif 250 - break; 251 - default: 252 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 253 - "Unsupported event [0x%x]\n", event)); 254 - break; 255 } 256 257 return;
··· 233 234 device = ac->device; 235 switch (event) { 236 + default: 237 + ACPI_DEBUG_PRINT((ACPI_DB_INFO, 238 + "Unsupported event [0x%x]\n", event)); 239 case ACPI_AC_NOTIFY_STATUS: 240 case ACPI_NOTIFY_BUS_CHECK: 241 case ACPI_NOTIFY_DEVICE_CHECK: ··· 244 #ifdef CONFIG_ACPI_SYSFS_POWER 245 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); 246 #endif 247 } 248 249 return;
+2 -1
drivers/acpi/video.c
··· 1713 1714 status = acpi_video_bus_get_one_device(dev, video); 1715 if (ACPI_FAILURE(status)) { 1716 - ACPI_EXCEPTION((AE_INFO, status, "Cant attach device")); 1717 continue; 1718 } 1719 }
··· 1713 1714 status = acpi_video_bus_get_one_device(dev, video); 1715 if (ACPI_FAILURE(status)) { 1716 + ACPI_DEBUG_PRINT((ACPI_DB_WARN, 1717 + "Cant attach device")); 1718 continue; 1719 } 1720 }
+9 -1
drivers/ata/Kconfig
··· 651 Support for the Winbond W83759A controller on Vesa Local Bus 652 systems. 653 654 config PATA_PLATFORM 655 tristate "Generic platform device PATA support" 656 - depends on EMBEDDED || ARCH_RPC || PPC 657 help 658 This option enables support for generic directly connected ATA 659 devices commonly found on embedded systems.
··· 651 Support for the Winbond W83759A controller on Vesa Local Bus 652 systems. 653 654 + config HAVE_PATA_PLATFORM 655 + bool 656 + help 657 + This is an internal configuration node for any machine that 658 + uses pata-platform driver to enable the relevant driver in the 659 + configuration structure without having to submit endless patches 660 + to update the PATA_PLATFORM entry. 661 + 662 config PATA_PLATFORM 663 tristate "Generic platform device PATA support" 664 + depends on EMBEDDED || ARCH_RPC || PPC || HAVE_PATA_PLATFORM 665 help 666 This option enables support for generic directly connected ATA 667 devices commonly found on embedded systems.
+20 -3
drivers/ata/ahci.c
··· 90 board_ahci_mv = 4, 91 board_ahci_sb700 = 5, 92 board_ahci_mcp65 = 6, 93 94 /* global controller registers */ 95 HOST_CAP = 0x00, /* host capabilities */ ··· 402 .udma_mask = ATA_UDMA6, 403 .port_ops = &ahci_ops, 404 }, 405 }; 406 407 static const struct pci_device_id ahci_pci_tbl[] = { ··· 534 { PCI_VDEVICE(NVIDIA, 0x0bc7), board_ahci }, /* MCP7B */ 535 536 /* SiS */ 537 - { PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */ 538 - { PCI_VDEVICE(SI, 0x1185), board_ahci }, /* SiS 966 */ 539 - { PCI_VDEVICE(SI, 0x0186), board_ahci }, /* SiS 968 */ 540 541 /* Marvell */ 542 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ ··· 660 dev_printk(KERN_INFO, &pdev->dev, 661 "controller can't do PMP, turning off CAP_PMP\n"); 662 cap &= ~HOST_CAP_PMP; 663 } 664 665 /*
··· 90 board_ahci_mv = 4, 91 board_ahci_sb700 = 5, 92 board_ahci_mcp65 = 6, 93 + board_ahci_nopmp = 7, 94 95 /* global controller registers */ 96 HOST_CAP = 0x00, /* host capabilities */ ··· 401 .udma_mask = ATA_UDMA6, 402 .port_ops = &ahci_ops, 403 }, 404 + /* board_ahci_nopmp */ 405 + { 406 + AHCI_HFLAGS (AHCI_HFLAG_NO_PMP), 407 + .flags = AHCI_FLAG_COMMON, 408 + .pio_mask = 0x1f, /* pio0-4 */ 409 + .udma_mask = ATA_UDMA6, 410 + .port_ops = &ahci_ops, 411 + }, 412 }; 413 414 static const struct pci_device_id ahci_pci_tbl[] = { ··· 525 { PCI_VDEVICE(NVIDIA, 0x0bc7), board_ahci }, /* MCP7B */ 526 527 /* SiS */ 528 + { PCI_VDEVICE(SI, 0x1184), board_ahci_nopmp }, /* SiS 966 */ 529 + { PCI_VDEVICE(SI, 0x1185), board_ahci_nopmp }, /* SiS 968 */ 530 + { PCI_VDEVICE(SI, 0x0186), board_ahci_nopmp }, /* SiS 968 */ 531 532 /* Marvell */ 533 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ ··· 651 dev_printk(KERN_INFO, &pdev->dev, 652 "controller can't do PMP, turning off CAP_PMP\n"); 653 cap &= ~HOST_CAP_PMP; 654 + } 655 + 656 + if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361 && 657 + port_map != 1) { 658 + dev_printk(KERN_INFO, &pdev->dev, 659 + "JMB361 has only one port, port_map 0x%x -> 0x%x\n", 660 + port_map, 1); 661 + port_map = 1; 662 } 663 664 /*
+7
drivers/ata/ata_piix.c
··· 1043 }, 1044 }, 1045 { 1046 .ident = "TECRA M5", 1047 .matches = { 1048 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
··· 1043 }, 1044 }, 1045 { 1046 + .ident = "TECRA M4", 1047 + .matches = { 1048 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 1049 + DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M4"), 1050 + }, 1051 + }, 1052 + { 1053 .ident = "TECRA M5", 1054 .matches = { 1055 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+2 -2
drivers/ata/libata-core.c
··· 4297 } 4298 4299 /** 4300 - * ata_check_atapi_dma - Check whether ATAPI DMA can be supported 4301 * @qc: Metadata associated with taskfile to check 4302 * 4303 * Allow low-level driver to filter ATA PACKET commands, returning ··· 4310 * RETURNS: 0 when ATAPI DMA can be used 4311 * nonzero otherwise 4312 */ 4313 - int ata_check_atapi_dma(struct ata_queued_cmd *qc) 4314 { 4315 struct ata_port *ap = qc->ap; 4316
··· 4297 } 4298 4299 /** 4300 + * atapi_check_dma - Check whether ATAPI DMA can be supported 4301 * @qc: Metadata associated with taskfile to check 4302 * 4303 * Allow low-level driver to filter ATA PACKET commands, returning ··· 4310 * RETURNS: 0 when ATAPI DMA can be used 4311 * nonzero otherwise 4312 */ 4313 + int atapi_check_dma(struct ata_queued_cmd *qc) 4314 { 4315 struct ata_port *ap = qc->ap; 4316
+7 -9
drivers/ata/libata-scsi.c
··· 2343 { 2344 struct scsi_cmnd *scmd = qc->scsicmd; 2345 struct ata_device *dev = qc->dev; 2346 - int using_pio = (dev->flags & ATA_DFLAG_PIO); 2347 int nodata = (scmd->sc_data_direction == DMA_NONE); 2348 unsigned int nbytes; 2349 2350 memset(qc->cdb, 0, dev->cdb_len); ··· 2362 ata_qc_set_pc_nbytes(qc); 2363 2364 /* check whether ATAPI DMA is safe */ 2365 - if (!using_pio && ata_check_atapi_dma(qc)) 2366 using_pio = 1; 2367 2368 /* Some controller variants snoop this value for Packet ··· 2402 qc->tf.lbam = (nbytes & 0xFF); 2403 qc->tf.lbah = (nbytes >> 8); 2404 2405 - if (using_pio || nodata) { 2406 - /* no data, or PIO data xfer */ 2407 - if (nodata) 2408 - qc->tf.protocol = ATAPI_PROT_NODATA; 2409 - else 2410 - qc->tf.protocol = ATAPI_PROT_PIO; 2411 - } else { 2412 /* DMA data xfer */ 2413 qc->tf.protocol = ATAPI_PROT_DMA; 2414 qc->tf.feature |= ATAPI_PKT_DMA;
··· 2343 { 2344 struct scsi_cmnd *scmd = qc->scsicmd; 2345 struct ata_device *dev = qc->dev; 2346 int nodata = (scmd->sc_data_direction == DMA_NONE); 2347 + int using_pio = !nodata && (dev->flags & ATA_DFLAG_PIO); 2348 unsigned int nbytes; 2349 2350 memset(qc->cdb, 0, dev->cdb_len); ··· 2362 ata_qc_set_pc_nbytes(qc); 2363 2364 /* check whether ATAPI DMA is safe */ 2365 + if (!nodata && !using_pio && atapi_check_dma(qc)) 2366 using_pio = 1; 2367 2368 /* Some controller variants snoop this value for Packet ··· 2402 qc->tf.lbam = (nbytes & 0xFF); 2403 qc->tf.lbah = (nbytes >> 8); 2404 2405 + if (nodata) 2406 + qc->tf.protocol = ATAPI_PROT_NODATA; 2407 + else if (using_pio) 2408 + qc->tf.protocol = ATAPI_PROT_PIO; 2409 + else { 2410 /* DMA data xfer */ 2411 qc->tf.protocol = ATAPI_PROT_DMA; 2412 qc->tf.feature |= ATAPI_PKT_DMA;
+1 -1
drivers/ata/libata.h
··· 106 extern void ata_qc_free(struct ata_queued_cmd *qc); 107 extern void ata_qc_issue(struct ata_queued_cmd *qc); 108 extern void __ata_qc_complete(struct ata_queued_cmd *qc); 109 - extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); 110 extern void swap_buf_le16(u16 *buf, unsigned int buf_words); 111 extern void ata_dev_init(struct ata_device *dev); 112 extern void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp);
··· 106 extern void ata_qc_free(struct ata_queued_cmd *qc); 107 extern void ata_qc_issue(struct ata_queued_cmd *qc); 108 extern void __ata_qc_complete(struct ata_queued_cmd *qc); 109 + extern int atapi_check_dma(struct ata_queued_cmd *qc); 110 extern void swap_buf_le16(u16 *buf, unsigned int buf_words); 111 extern void ata_dev_init(struct ata_device *dev); 112 extern void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp);
+2
drivers/ata/pata_pcmcia.c
··· 414 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), 415 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDEII", 0x547e66dc, 0xb3662674), 416 PCMCIA_DEVICE_PROD_ID12("LOOKMEET", "CBIDE2 ", 0xe37be2b5, 0x8671043b), 417 PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF500", 0x7ed2ad87, 0x7a13045c), 418 PCMCIA_DEVICE_PROD_ID2("NinjaATA-", 0xebe0bd79), 419 PCMCIA_DEVICE_PROD_ID12("PCMCIA", "CD-ROM", 0x281f1c5d, 0x66536591), ··· 425 PCMCIA_DEVICE_PROD_ID12("SMI VENDOR", "SMI PRODUCT", 0x30896c92, 0x703cc5f6), 426 PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), 427 PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), 428 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), 429 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), 430 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
··· 414 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), 415 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDEII", 0x547e66dc, 0xb3662674), 416 PCMCIA_DEVICE_PROD_ID12("LOOKMEET", "CBIDE2 ", 0xe37be2b5, 0x8671043b), 417 + PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF300", 0x7ed2ad87, 0x7e9e78ee), 418 PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF500", 0x7ed2ad87, 0x7a13045c), 419 PCMCIA_DEVICE_PROD_ID2("NinjaATA-", 0xebe0bd79), 420 PCMCIA_DEVICE_PROD_ID12("PCMCIA", "CD-ROM", 0x281f1c5d, 0x66536591), ··· 424 PCMCIA_DEVICE_PROD_ID12("SMI VENDOR", "SMI PRODUCT", 0x30896c92, 0x703cc5f6), 425 PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), 426 PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), 427 + PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF45", 0x709b1bf1, 0xf68b6f32), 428 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), 429 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), 430 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
+21
drivers/ata/sata_mv.c
··· 1322 goto out_port_free_dma_mem; 1323 memset(pp->crpb, 0, MV_CRPB_Q_SZ); 1324 1325 /* 1326 * For GEN_I, there's no NCQ, so we only allocate a single sg_tbl. 1327 * For later hardware, we need one unique sg_tbl per NCQ tag. ··· 1595 1596 if ((qc->tf.protocol != ATA_PROT_DMA) && 1597 (qc->tf.protocol != ATA_PROT_NCQ)) { 1598 /* 1599 * We're about to send a non-EDMA capable command to the 1600 * port. Turn off EDMA so there won't be problems accessing
··· 1322 goto out_port_free_dma_mem; 1323 memset(pp->crpb, 0, MV_CRPB_Q_SZ); 1324 1325 + /* 6041/6081 Rev. "C0" (and newer) are okay with async notify */ 1326 + if (hpriv->hp_flags & MV_HP_ERRATA_60X1C0) 1327 + ap->flags |= ATA_FLAG_AN; 1328 /* 1329 * For GEN_I, there's no NCQ, so we only allocate a single sg_tbl. 1330 * For later hardware, we need one unique sg_tbl per NCQ tag. ··· 1592 1593 if ((qc->tf.protocol != ATA_PROT_DMA) && 1594 (qc->tf.protocol != ATA_PROT_NCQ)) { 1595 + static int limit_warnings = 10; 1596 + /* 1597 + * Errata SATA#16, SATA#24: warn if multiple DRQs expected. 1598 + * 1599 + * Someday, we might implement special polling workarounds 1600 + * for these, but it all seems rather unnecessary since we 1601 + * normally use only DMA for commands which transfer more 1602 + * than a single block of data. 1603 + * 1604 + * Much of the time, this could just work regardless. 1605 + * So for now, just log the incident, and allow the attempt. 1606 + */ 1607 + if (limit_warnings && (qc->nbytes / qc->sect_size) > 1) { 1608 + --limit_warnings; 1609 + ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME 1610 + ": attempting PIO w/multiple DRQ: " 1611 + "this may fail due to h/w errata\n"); 1612 + } 1613 /* 1614 * We're about to send a non-EDMA capable command to the 1615 * port. Turn off EDMA so there won't be problems accessing
+1 -1
drivers/char/agp/intel-agp.c
··· 948 intel_private.ifp_resource.flags = IORESOURCE_MEM; 949 950 /* Setup chipset flush for 915 */ 951 - if (IS_I965 || IS_G33) { 952 intel_i965_g33_setup_chipset_flush(); 953 } else { 954 intel_i915_setup_chipset_flush();
··· 948 intel_private.ifp_resource.flags = IORESOURCE_MEM; 949 950 /* Setup chipset flush for 915 */ 951 + if (IS_I965 || IS_G33 || IS_G4X) { 952 intel_i965_g33_setup_chipset_flush(); 953 } else { 954 intel_i915_setup_chipset_flush();
+3 -5
drivers/char/drm/ati_pcigart.c
··· 76 for (i = 0; i < pages; i++) { 77 if (!entry->busaddr[i]) 78 break; 79 - pci_unmap_single(dev->pdev, entry->busaddr[i], 80 PAGE_SIZE, PCI_DMA_TODEVICE); 81 } 82 ··· 137 138 for (i = 0; i < pages; i++) { 139 /* we need to support large memory configurations */ 140 - entry->busaddr[i] = pci_map_single(dev->pdev, 141 - page_address(entry-> 142 - pagelist[i]), 143 - PAGE_SIZE, PCI_DMA_TODEVICE); 144 if (entry->busaddr[i] == 0) { 145 DRM_ERROR("unable to map PCIGART pages!\n"); 146 drm_ati_pcigart_cleanup(dev, gart_info);
··· 76 for (i = 0; i < pages; i++) { 77 if (!entry->busaddr[i]) 78 break; 79 + pci_unmap_page(dev->pdev, entry->busaddr[i], 80 PAGE_SIZE, PCI_DMA_TODEVICE); 81 } 82 ··· 137 138 for (i = 0; i < pages; i++) { 139 /* we need to support large memory configurations */ 140 + entry->busaddr[i] = pci_map_page(dev->pdev, entry->pagelist[i], 141 + 0, PAGE_SIZE, PCI_DMA_TODEVICE); 142 if (entry->busaddr[i] == 0) { 143 DRM_ERROR("unable to map PCIGART pages!\n"); 144 drm_ati_pcigart_cleanup(dev, gart_info);
+1 -1
drivers/char/drm/drm.h
··· 628 #define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) 629 #define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) 630 631 - #define DRM_IOCTL_SG_ALLOC DRM_IOW( 0x38, struct drm_scatter_gather) 632 #define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) 633 634 #define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
··· 628 #define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) 629 #define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) 630 631 + #define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) 632 #define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) 633 634 #define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
+4 -3
drivers/char/drm/drm_drv.c
··· 470 if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END) && 471 (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) 472 ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; 473 - else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) 474 ioctl = &drm_ioctls[nr]; 475 - else 476 goto err_i1; 477 478 func = ioctl->func; 479 /* is there a local override? */ 480 if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl) 481 func = dev->driver->dma_ioctl; 482 - 483 484 if (!func) { 485 DRM_DEBUG("no function\n");
··· 470 if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END) && 471 (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) 472 ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; 473 + else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { 474 ioctl = &drm_ioctls[nr]; 475 + cmd = ioctl->cmd; 476 + } else 477 goto err_i1; 478 479 + /* Do not trust userspace, use our own definition */ 480 func = ioctl->func; 481 /* is there a local override? */ 482 if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl) 483 func = dev->driver->dma_ioctl; 484 485 if (!func) { 486 DRM_DEBUG("no function\n");
+9 -8
drivers/char/drm/drm_pciids.h
··· 103 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 104 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \ 105 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ 106 - {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 107 - {0x1002, 0x5955, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 108 - {0x1002, 0x5974, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 109 - {0x1002, 0x5975, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 110 {0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 111 {0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 112 {0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 113 {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 114 {0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 115 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \ 116 - {0x1002, 0x5a41, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 117 - {0x1002, 0x5a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 118 - {0x1002, 0x5a61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 119 - {0x1002, 0x5a62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 120 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 121 {0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 122 {0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ ··· 409 {0x8086, 0x2a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 410 {0x8086, 0x2a12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 411 {0x8086, 0x2a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 412 {0, 0, 0}
··· 103 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 104 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \ 105 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ 106 + {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 107 + {0x1002, 0x5955, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 108 + {0x1002, 0x5974, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 109 + {0x1002, 0x5975, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 110 {0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 111 {0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 112 {0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 113 {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 114 {0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 115 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \ 116 + {0x1002, 0x5a61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 117 + {0x1002, 0x5a62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 118 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 119 {0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 120 {0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ ··· 411 {0x8086, 0x2a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 412 {0x8086, 0x2a12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 413 {0x8086, 0x2a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 414 + {0x8086, 0x2e02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 415 + {0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 416 + {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 417 {0, 0, 0}
+9 -2
drivers/char/drm/i915_drv.h
··· 1112 (dev)->pci_device == 0x29A2 || \ 1113 (dev)->pci_device == 0x2A02 || \ 1114 (dev)->pci_device == 0x2A12 || \ 1115 - (dev)->pci_device == 0x2A42) 1116 1117 #define IS_I965GM(dev) ((dev)->pci_device == 0x2A02) 1118 1119 #define IS_IGD_GM(dev) ((dev)->pci_device == 0x2A42) 1120 1121 #define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \ 1122 (dev)->pci_device == 0x29B2 || \ ··· 1135 #define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \ 1136 IS_I945GM(dev) || IS_I965GM(dev) || IS_IGD_GM(dev)) 1137 1138 - #define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_IGD_GM(dev)) 1139 1140 #define PRIMARY_RINGBUFFER_SIZE (128*1024) 1141
··· 1112 (dev)->pci_device == 0x29A2 || \ 1113 (dev)->pci_device == 0x2A02 || \ 1114 (dev)->pci_device == 0x2A12 || \ 1115 + (dev)->pci_device == 0x2A42 || \ 1116 + (dev)->pci_device == 0x2E02 || \ 1117 + (dev)->pci_device == 0x2E12 || \ 1118 + (dev)->pci_device == 0x2E22) 1119 1120 #define IS_I965GM(dev) ((dev)->pci_device == 0x2A02) 1121 1122 #define IS_IGD_GM(dev) ((dev)->pci_device == 0x2A42) 1123 + 1124 + #define IS_G4X(dev) ((dev)->pci_device == 0x2E02 || \ 1125 + (dev)->pci_device == 0x2E12 || \ 1126 + (dev)->pci_device == 0x2E22) 1127 1128 #define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \ 1129 (dev)->pci_device == 0x29B2 || \ ··· 1128 #define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \ 1129 IS_I945GM(dev) || IS_I965GM(dev) || IS_IGD_GM(dev)) 1130 1131 + #define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_IGD_GM(dev) || IS_G4X(dev)) 1132 1133 #define PRIMARY_RINGBUFFER_SIZE (128*1024) 1134
+95 -22
drivers/char/drm/r300_cmdbuf.c
··· 189 ADD_RANGE(R300_RE_CULL_CNTL, 1); 190 ADD_RANGE(0x42C0, 2); 191 ADD_RANGE(R300_RS_CNTL_0, 2); 192 - ADD_RANGE(R300_RS_INTERP_0, 8); 193 - ADD_RANGE(R300_RS_ROUTE_0, 8); 194 - ADD_RANGE(0x43A4, 2); 195 ADD_RANGE(0x43E8, 1); 196 - ADD_RANGE(R300_PFS_CNTL_0, 3); 197 - ADD_RANGE(R300_PFS_NODE_0, 4); 198 - ADD_RANGE(R300_PFS_TEXI_0, 64); 199 ADD_RANGE(0x46A4, 5); 200 - ADD_RANGE(R300_PFS_INSTR0_0, 64); 201 - ADD_RANGE(R300_PFS_INSTR1_0, 64); 202 - ADD_RANGE(R300_PFS_INSTR2_0, 64); 203 - ADD_RANGE(R300_PFS_INSTR3_0, 64); 204 ADD_RANGE(R300_RE_FOG_STATE, 1); 205 ADD_RANGE(R300_FOG_COLOR_R, 3); 206 ADD_RANGE(R300_PP_ALPHA_TEST, 2); ··· 209 ADD_RANGE(0x4E50, 9); 210 ADD_RANGE(0x4E88, 1); 211 ADD_RANGE(0x4EA0, 2); 212 - ADD_RANGE(R300_RB3D_ZSTENCIL_CNTL_0, 3); 213 - ADD_RANGE(R300_RB3D_ZSTENCIL_FORMAT, 4); 214 - ADD_RANGE_MARK(R300_RB3D_DEPTHOFFSET, 1, MARK_CHECK_OFFSET); /* check offset */ 215 - ADD_RANGE(R300_RB3D_DEPTHPITCH, 1); 216 - ADD_RANGE(0x4F28, 1); 217 - ADD_RANGE(0x4F30, 2); 218 - ADD_RANGE(0x4F44, 1); 219 - ADD_RANGE(0x4F54, 1); 220 221 ADD_RANGE(R300_TX_FILTER_0, 16); 222 ADD_RANGE(R300_TX_FILTER1_0, 16); ··· 227 ADD_RANGE(R300_TX_BORDER_COLOR_0, 16); 228 229 /* Sporadic registers used as primitives are emitted */ 230 - ADD_RANGE(R300_RB3D_ZCACHE_CTLSTAT, 1); 231 ADD_RANGE(R300_RB3D_DSTCACHE_CTLSTAT, 1); 232 ADD_RANGE(R300_VAP_INPUT_ROUTE_0_0, 8); 233 ADD_RANGE(R300_VAP_INPUT_ROUTE_1_0, 8); 234 235 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV515) { 236 - ADD_RANGE(0x4074, 16); 237 } 238 } 239 ··· 718 BEGIN_RING(6); 719 OUT_RING(CP_PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); 720 OUT_RING(R300_RB3D_DSTCACHE_UNKNOWN_0A); 721 - OUT_RING(CP_PACKET0(R300_RB3D_ZCACHE_CTLSTAT, 0)); 722 - OUT_RING(R300_RB3D_ZCACHE_UNKNOWN_03); 723 OUT_RING(CP_PACKET3(RADEON_CP_NOP, 0)); 724 OUT_RING(0x0); 725 ADVANCE_RING(); ··· 839 840 return 0; 841 } 842 843 /** 844 * Parses and validates a user-supplied command buffer and emits appropriate ··· 1023 } 1024 break; 1025 1026 default: 1027 DRM_ERROR("bad cmd_type %i at %p\n", 1028 header.header.cmd_type,
··· 189 ADD_RANGE(R300_RE_CULL_CNTL, 1); 190 ADD_RANGE(0x42C0, 2); 191 ADD_RANGE(R300_RS_CNTL_0, 2); 192 + 193 + ADD_RANGE(R300_SC_HYPERZ, 2); 194 ADD_RANGE(0x43E8, 1); 195 + 196 ADD_RANGE(0x46A4, 5); 197 + 198 ADD_RANGE(R300_RE_FOG_STATE, 1); 199 ADD_RANGE(R300_FOG_COLOR_R, 3); 200 ADD_RANGE(R300_PP_ALPHA_TEST, 2); ··· 215 ADD_RANGE(0x4E50, 9); 216 ADD_RANGE(0x4E88, 1); 217 ADD_RANGE(0x4EA0, 2); 218 + ADD_RANGE(R300_ZB_CNTL, 3); 219 + ADD_RANGE(R300_ZB_FORMAT, 4); 220 + ADD_RANGE_MARK(R300_ZB_DEPTHOFFSET, 1, MARK_CHECK_OFFSET); /* check offset */ 221 + ADD_RANGE(R300_ZB_DEPTHPITCH, 1); 222 + ADD_RANGE(R300_ZB_DEPTHCLEARVALUE, 1); 223 + ADD_RANGE(R300_ZB_ZMASK_OFFSET, 13); 224 225 ADD_RANGE(R300_TX_FILTER_0, 16); 226 ADD_RANGE(R300_TX_FILTER1_0, 16); ··· 235 ADD_RANGE(R300_TX_BORDER_COLOR_0, 16); 236 237 /* Sporadic registers used as primitives are emitted */ 238 + ADD_RANGE(R300_ZB_ZCACHE_CTLSTAT, 1); 239 ADD_RANGE(R300_RB3D_DSTCACHE_CTLSTAT, 1); 240 ADD_RANGE(R300_VAP_INPUT_ROUTE_0_0, 8); 241 ADD_RANGE(R300_VAP_INPUT_ROUTE_1_0, 8); 242 243 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV515) { 244 + ADD_RANGE(R500_VAP_INDEX_OFFSET, 1); 245 + ADD_RANGE(R500_US_CONFIG, 2); 246 + ADD_RANGE(R500_US_CODE_ADDR, 3); 247 + ADD_RANGE(R500_US_FC_CTRL, 1); 248 + ADD_RANGE(R500_RS_IP_0, 16); 249 + ADD_RANGE(R500_RS_INST_0, 16); 250 + ADD_RANGE(R500_RB3D_COLOR_CLEAR_VALUE_AR, 2); 251 + ADD_RANGE(R500_RB3D_CONSTANT_COLOR_AR, 2); 252 + ADD_RANGE(R500_ZB_FIFO_SIZE, 2); 253 + } else { 254 + ADD_RANGE(R300_PFS_CNTL_0, 3); 255 + ADD_RANGE(R300_PFS_NODE_0, 4); 256 + ADD_RANGE(R300_PFS_TEXI_0, 64); 257 + ADD_RANGE(R300_PFS_INSTR0_0, 64); 258 + ADD_RANGE(R300_PFS_INSTR1_0, 64); 259 + ADD_RANGE(R300_PFS_INSTR2_0, 64); 260 + ADD_RANGE(R300_PFS_INSTR3_0, 64); 261 + ADD_RANGE(R300_RS_INTERP_0, 8); 262 + ADD_RANGE(R300_RS_ROUTE_0, 8); 263 + 264 } 265 } 266 ··· 707 BEGIN_RING(6); 708 OUT_RING(CP_PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); 709 OUT_RING(R300_RB3D_DSTCACHE_UNKNOWN_0A); 710 + OUT_RING(CP_PACKET0(R300_ZB_ZCACHE_CTLSTAT, 0)); 711 + OUT_RING(R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE| 712 + R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); 713 OUT_RING(CP_PACKET3(RADEON_CP_NOP, 0)); 714 OUT_RING(0x0); 715 ADVANCE_RING(); ··· 827 828 return 0; 829 } 830 + 831 + /** 832 + * Uploads user-supplied vertex program instructions or parameters onto 833 + * the graphics card. 834 + * Called by r300_do_cp_cmdbuf. 835 + */ 836 + static inline int r300_emit_r500fp(drm_radeon_private_t *dev_priv, 837 + drm_radeon_kcmd_buffer_t *cmdbuf, 838 + drm_r300_cmd_header_t header) 839 + { 840 + int sz; 841 + int addr; 842 + int type; 843 + int clamp; 844 + int stride; 845 + RING_LOCALS; 846 + 847 + sz = header.r500fp.count; 848 + /* address is 9 bits 0 - 8, bit 1 of flags is part of address */ 849 + addr = ((header.r500fp.adrhi_flags & 1) << 8) | header.r500fp.adrlo; 850 + 851 + type = !!(header.r500fp.adrhi_flags & R500FP_CONSTANT_TYPE); 852 + clamp = !!(header.r500fp.adrhi_flags & R500FP_CONSTANT_CLAMP); 853 + 854 + addr |= (type << 16); 855 + addr |= (clamp << 17); 856 + 857 + stride = type ? 4 : 6; 858 + 859 + DRM_DEBUG("r500fp %d %d type: %d\n", sz, addr, type); 860 + if (!sz) 861 + return 0; 862 + if (sz * stride * 4 > cmdbuf->bufsz) 863 + return -EINVAL; 864 + 865 + BEGIN_RING(3 + sz * stride); 866 + OUT_RING_REG(R500_GA_US_VECTOR_INDEX, addr); 867 + OUT_RING(CP_PACKET0_TABLE(R500_GA_US_VECTOR_DATA, sz * stride - 1)); 868 + OUT_RING_TABLE((int *)cmdbuf->buf, sz * stride); 869 + 870 + ADVANCE_RING(); 871 + 872 + cmdbuf->buf += sz * stride * 4; 873 + cmdbuf->bufsz -= sz * stride * 4; 874 + 875 + return 0; 876 + } 877 + 878 879 /** 880 * Parses and validates a user-supplied command buffer and emits appropriate ··· 963 } 964 break; 965 966 + case R300_CMD_R500FP: 967 + if ((dev_priv->flags & RADEON_FAMILY_MASK) < CHIP_RV515) { 968 + DRM_ERROR("Calling r500 command on r300 card\n"); 969 + ret = -EINVAL; 970 + goto cleanup; 971 + } 972 + DRM_DEBUG("R300_CMD_R500FP\n"); 973 + ret = r300_emit_r500fp(dev_priv, cmdbuf, header); 974 + if (ret) { 975 + DRM_ERROR("r300_emit_r500fp failed\n"); 976 + goto cleanup; 977 + } 978 + break; 979 default: 980 DRM_ERROR("bad cmd_type %i at %p\n", 981 header.header.cmd_type,
+196 -50
drivers/char/drm/r300_reg.h
··· 702 # define R300_RS_ROUTE_1_UNKNOWN11 (1 << 11) 703 /* END: Rasterization / Interpolators - many guesses */ 704 705 /* BEGIN: Scissors and cliprects */ 706 707 /* There are four clipping rectangles. Their corner coordinates are inclusive. ··· 1367 /* Guess by Vladimir. 1368 * Set to 0A before 3D operations, set to 02 afterwards. 1369 */ 1370 - #define R300_RB3D_DSTCACHE_CTLSTAT 0x4E4C 1371 # define R300_RB3D_DSTCACHE_UNKNOWN_02 0x00000002 1372 # define R300_RB3D_DSTCACHE_UNKNOWN_0A 0x0000000A 1373 ··· 1376 * for this. 1377 * Bit (1<<8) is the "test" bit. so plain write is 6 - vd 1378 */ 1379 - #define R300_RB3D_ZSTENCIL_CNTL_0 0x4F00 1380 - # define R300_RB3D_Z_DISABLED_1 0x00000010 1381 - # define R300_RB3D_Z_DISABLED_2 0x00000014 1382 - # define R300_RB3D_Z_TEST 0x00000012 1383 - # define R300_RB3D_Z_TEST_AND_WRITE 0x00000016 1384 - # define R300_RB3D_Z_WRITE_ONLY 0x00000006 1385 1386 - # define R300_RB3D_Z_TEST 0x00000012 1387 - # define R300_RB3D_Z_TEST_AND_WRITE 0x00000016 1388 - # define R300_RB3D_Z_WRITE_ONLY 0x00000006 1389 - # define R300_RB3D_STENCIL_ENABLE 0x00000001 1390 - 1391 - #define R300_RB3D_ZSTENCIL_CNTL_1 0x4F04 1392 /* functions */ 1393 # define R300_ZS_NEVER 0 1394 # define R300_ZS_LESS 1 ··· 1403 # define R300_ZS_INVERT 5 1404 # define R300_ZS_INCR_WRAP 6 1405 # define R300_ZS_DECR_WRAP 7 1406 /* front and back refer to operations done for front 1407 and back faces, i.e. separate stencil function support */ 1408 - # define R300_RB3D_ZS1_DEPTH_FUNC_SHIFT 0 1409 - # define R300_RB3D_ZS1_FRONT_FUNC_SHIFT 3 1410 - # define R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT 6 1411 - # define R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT 9 1412 - # define R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT 12 1413 - # define R300_RB3D_ZS1_BACK_FUNC_SHIFT 15 1414 - # define R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT 18 1415 - # define R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT 21 1416 - # define R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT 24 1417 1418 - #define R300_RB3D_ZSTENCIL_CNTL_2 0x4F08 1419 - # define R300_RB3D_ZS2_STENCIL_REF_SHIFT 0 1420 - # define R300_RB3D_ZS2_STENCIL_MASK 0xFF 1421 - # define R300_RB3D_ZS2_STENCIL_MASK_SHIFT 8 1422 - # define R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT 16 1423 - 1424 - /* gap */ 1425 - 1426 - #define R300_RB3D_ZSTENCIL_FORMAT 0x4F10 1427 - # define R300_DEPTH_FORMAT_16BIT_INT_Z (0 << 0) 1428 - # define R300_DEPTH_FORMAT_24BIT_INT_Z (2 << 0) 1429 - /* 16 bit format or some aditional bit ? */ 1430 - # define R300_DEPTH_FORMAT_UNK32 (32 << 0) 1431 - 1432 - #define R300_RB3D_EARLY_Z 0x4F14 1433 - # define R300_EARLY_Z_DISABLE (0 << 0) 1434 - # define R300_EARLY_Z_ENABLE (1 << 0) 1435 1436 /* gap */ 1437 1438 - #define R300_RB3D_ZCACHE_CTLSTAT 0x4F18 /* GUESS */ 1439 - # define R300_RB3D_ZCACHE_UNKNOWN_01 0x1 1440 - # define R300_RB3D_ZCACHE_UNKNOWN_03 0x3 1441 1442 /* gap */ 1443 1444 - #define R300_RB3D_DEPTHOFFSET 0x4F20 1445 - #define R300_RB3D_DEPTHPITCH 0x4F24 1446 - # define R300_DEPTHPITCH_MASK 0x00001FF8 /* GUESS */ 1447 - # define R300_DEPTH_TILE_ENABLE (1 << 16) /* GUESS */ 1448 - # define R300_DEPTH_MICROTILE_ENABLE (1 << 17) /* GUESS */ 1449 - # define R300_DEPTH_ENDIAN_NO_SWAP (0 << 18) /* GUESS */ 1450 - # define R300_DEPTH_ENDIAN_WORD_SWAP (1 << 18) /* GUESS */ 1451 - # define R300_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) /* GUESS */ 1452 1453 /* BEGIN: Vertex program instruction set */ 1454 ··· 1752 * CP type-3 packets 1753 */ 1754 #define R300_CP_CMD_BITBLT_MULTI 0xC0009B00 1755 1756 #endif /* _R300_REG_H */
··· 702 # define R300_RS_ROUTE_1_UNKNOWN11 (1 << 11) 703 /* END: Rasterization / Interpolators - many guesses */ 704 705 + /* Hierarchical Z Enable */ 706 + #define R300_SC_HYPERZ 0x43a4 707 + # define R300_SC_HYPERZ_DISABLE (0 << 0) 708 + # define R300_SC_HYPERZ_ENABLE (1 << 0) 709 + # define R300_SC_HYPERZ_MIN (0 << 1) 710 + # define R300_SC_HYPERZ_MAX (1 << 1) 711 + # define R300_SC_HYPERZ_ADJ_256 (0 << 2) 712 + # define R300_SC_HYPERZ_ADJ_128 (1 << 2) 713 + # define R300_SC_HYPERZ_ADJ_64 (2 << 2) 714 + # define R300_SC_HYPERZ_ADJ_32 (3 << 2) 715 + # define R300_SC_HYPERZ_ADJ_16 (4 << 2) 716 + # define R300_SC_HYPERZ_ADJ_8 (5 << 2) 717 + # define R300_SC_HYPERZ_ADJ_4 (6 << 2) 718 + # define R300_SC_HYPERZ_ADJ_2 (7 << 2) 719 + # define R300_SC_HYPERZ_HZ_Z0MIN_NO (0 << 5) 720 + # define R300_SC_HYPERZ_HZ_Z0MIN (1 << 5) 721 + # define R300_SC_HYPERZ_HZ_Z0MAX_NO (0 << 6) 722 + # define R300_SC_HYPERZ_HZ_Z0MAX (1 << 6) 723 + 724 + #define R300_SC_EDGERULE 0x43a8 725 + 726 /* BEGIN: Scissors and cliprects */ 727 728 /* There are four clipping rectangles. Their corner coordinates are inclusive. ··· 1346 /* Guess by Vladimir. 1347 * Set to 0A before 3D operations, set to 02 afterwards. 1348 */ 1349 + /*#define R300_RB3D_DSTCACHE_CTLSTAT 0x4E4C*/ 1350 # define R300_RB3D_DSTCACHE_UNKNOWN_02 0x00000002 1351 # define R300_RB3D_DSTCACHE_UNKNOWN_0A 0x0000000A 1352 ··· 1355 * for this. 1356 * Bit (1<<8) is the "test" bit. so plain write is 6 - vd 1357 */ 1358 + #define R300_ZB_CNTL 0x4F00 1359 + # define R300_STENCIL_ENABLE (1 << 0) 1360 + # define R300_Z_ENABLE (1 << 1) 1361 + # define R300_Z_WRITE_ENABLE (1 << 2) 1362 + # define R300_Z_SIGNED_COMPARE (1 << 3) 1363 + # define R300_STENCIL_FRONT_BACK (1 << 4) 1364 1365 + #define R300_ZB_ZSTENCILCNTL 0x4f04 1366 /* functions */ 1367 # define R300_ZS_NEVER 0 1368 # define R300_ZS_LESS 1 ··· 1387 # define R300_ZS_INVERT 5 1388 # define R300_ZS_INCR_WRAP 6 1389 # define R300_ZS_DECR_WRAP 7 1390 + # define R300_Z_FUNC_SHIFT 0 1391 /* front and back refer to operations done for front 1392 and back faces, i.e. separate stencil function support */ 1393 + # define R300_S_FRONT_FUNC_SHIFT 3 1394 + # define R300_S_FRONT_SFAIL_OP_SHIFT 6 1395 + # define R300_S_FRONT_ZPASS_OP_SHIFT 9 1396 + # define R300_S_FRONT_ZFAIL_OP_SHIFT 12 1397 + # define R300_S_BACK_FUNC_SHIFT 15 1398 + # define R300_S_BACK_SFAIL_OP_SHIFT 18 1399 + # define R300_S_BACK_ZPASS_OP_SHIFT 21 1400 + # define R300_S_BACK_ZFAIL_OP_SHIFT 24 1401 1402 + #define R300_ZB_STENCILREFMASK 0x4f08 1403 + # define R300_STENCILREF_SHIFT 0 1404 + # define R300_STENCILREF_MASK 0x000000ff 1405 + # define R300_STENCILMASK_SHIFT 8 1406 + # define R300_STENCILMASK_MASK 0x0000ff00 1407 + # define R300_STENCILWRITEMASK_SHIFT 16 1408 + # define R300_STENCILWRITEMASK_MASK 0x00ff0000 1409 1410 /* gap */ 1411 1412 + #define R300_ZB_FORMAT 0x4f10 1413 + # define R300_DEPTHFORMAT_16BIT_INT_Z (0 << 0) 1414 + # define R300_DEPTHFORMAT_16BIT_13E3 (1 << 0) 1415 + # define R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL (2 << 0) 1416 + /* reserved up to (15 << 0) */ 1417 + # define R300_INVERT_13E3_LEADING_ONES (0 << 4) 1418 + # define R300_INVERT_13E3_LEADING_ZEROS (1 << 4) 1419 + 1420 + #define R300_ZB_ZTOP 0x4F14 1421 + # define R300_ZTOP_DISABLE (0 << 0) 1422 + # define R300_ZTOP_ENABLE (1 << 0) 1423 1424 /* gap */ 1425 1426 + #define R300_ZB_ZCACHE_CTLSTAT 0x4f18 1427 + # define R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_NO_EFFECT (0 << 0) 1428 + # define R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE (1 << 0) 1429 + # define R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_NO_EFFECT (0 << 1) 1430 + # define R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE (1 << 1) 1431 + # define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_IDLE (0 << 31) 1432 + # define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_BUSY (1 << 31) 1433 + 1434 + #define R300_ZB_BW_CNTL 0x4f1c 1435 + # define R300_HIZ_DISABLE (0 << 0) 1436 + # define R300_HIZ_ENABLE (1 << 0) 1437 + # define R300_HIZ_MIN (0 << 1) 1438 + # define R300_HIZ_MAX (1 << 1) 1439 + # define R300_FAST_FILL_DISABLE (0 << 2) 1440 + # define R300_FAST_FILL_ENABLE (1 << 2) 1441 + # define R300_RD_COMP_DISABLE (0 << 3) 1442 + # define R300_RD_COMP_ENABLE (1 << 3) 1443 + # define R300_WR_COMP_DISABLE (0 << 4) 1444 + # define R300_WR_COMP_ENABLE (1 << 4) 1445 + # define R300_ZB_CB_CLEAR_RMW (0 << 5) 1446 + # define R300_ZB_CB_CLEAR_CACHE_LINEAR (1 << 5) 1447 + # define R300_FORCE_COMPRESSED_STENCIL_VALUE_DISABLE (0 << 6) 1448 + # define R300_FORCE_COMPRESSED_STENCIL_VALUE_ENABLE (1 << 6) 1449 + 1450 + # define R500_ZEQUAL_OPTIMIZE_ENABLE (0 << 7) 1451 + # define R500_ZEQUAL_OPTIMIZE_DISABLE (1 << 7) 1452 + # define R500_SEQUAL_OPTIMIZE_ENABLE (0 << 8) 1453 + # define R500_SEQUAL_OPTIMIZE_DISABLE (1 << 8) 1454 + 1455 + # define R500_BMASK_ENABLE (0 << 10) 1456 + # define R500_BMASK_DISABLE (1 << 10) 1457 + # define R500_HIZ_EQUAL_REJECT_DISABLE (0 << 11) 1458 + # define R500_HIZ_EQUAL_REJECT_ENABLE (1 << 11) 1459 + # define R500_HIZ_FP_EXP_BITS_DISABLE (0 << 12) 1460 + # define R500_HIZ_FP_EXP_BITS_1 (1 << 12) 1461 + # define R500_HIZ_FP_EXP_BITS_2 (2 << 12) 1462 + # define R500_HIZ_FP_EXP_BITS_3 (3 << 12) 1463 + # define R500_HIZ_FP_EXP_BITS_4 (4 << 12) 1464 + # define R500_HIZ_FP_EXP_BITS_5 (5 << 12) 1465 + # define R500_HIZ_FP_INVERT_LEADING_ONES (0 << 15) 1466 + # define R500_HIZ_FP_INVERT_LEADING_ZEROS (1 << 15) 1467 + # define R500_TILE_OVERWRITE_RECOMPRESSION_ENABLE (0 << 16) 1468 + # define R500_TILE_OVERWRITE_RECOMPRESSION_DISABLE (1 << 16) 1469 + # define R500_CONTIGUOUS_6XAA_SAMPLES_ENABLE (0 << 17) 1470 + # define R500_CONTIGUOUS_6XAA_SAMPLES_DISABLE (1 << 17) 1471 + # define R500_PEQ_PACKING_DISABLE (0 << 18) 1472 + # define R500_PEQ_PACKING_ENABLE (1 << 18) 1473 + # define R500_COVERED_PTR_MASKING_DISABLE (0 << 18) 1474 + # define R500_COVERED_PTR_MASKING_ENABLE (1 << 18) 1475 + 1476 + 1477 + /* gap */ 1478 + 1479 + /* Z Buffer Address Offset. 1480 + * Bits 31 to 5 are used for aligned Z buffer address offset for macro tiles. 1481 + */ 1482 + #define R300_ZB_DEPTHOFFSET 0x4f20 1483 + 1484 + /* Z Buffer Pitch and Endian Control */ 1485 + #define R300_ZB_DEPTHPITCH 0x4f24 1486 + # define R300_DEPTHPITCH_MASK 0x00003FFC 1487 + # define R300_DEPTHMACROTILE_DISABLE (0 << 16) 1488 + # define R300_DEPTHMACROTILE_ENABLE (1 << 16) 1489 + # define R300_DEPTHMICROTILE_LINEAR (0 << 17) 1490 + # define R300_DEPTHMICROTILE_TILED (1 << 17) 1491 + # define R300_DEPTHMICROTILE_TILED_SQUARE (2 << 17) 1492 + # define R300_DEPTHENDIAN_NO_SWAP (0 << 18) 1493 + # define R300_DEPTHENDIAN_WORD_SWAP (1 << 18) 1494 + # define R300_DEPTHENDIAN_DWORD_SWAP (2 << 18) 1495 + # define R300_DEPTHENDIAN_HALF_DWORD_SWAP (3 << 18) 1496 + 1497 + /* Z Buffer Clear Value */ 1498 + #define R300_ZB_DEPTHCLEARVALUE 0x4f28 1499 + 1500 + #define R300_ZB_ZMASK_OFFSET 0x4f30 1501 + #define R300_ZB_ZMASK_PITCH 0x4f34 1502 + #define R300_ZB_ZMASK_WRINDEX 0x4f38 1503 + #define R300_ZB_ZMASK_DWORD 0x4f3c 1504 + #define R300_ZB_ZMASK_RDINDEX 0x4f40 1505 + 1506 + /* Hierarchical Z Memory Offset */ 1507 + #define R300_ZB_HIZ_OFFSET 0x4f44 1508 + 1509 + /* Hierarchical Z Write Index */ 1510 + #define R300_ZB_HIZ_WRINDEX 0x4f48 1511 + 1512 + /* Hierarchical Z Data */ 1513 + #define R300_ZB_HIZ_DWORD 0x4f4c 1514 + 1515 + /* Hierarchical Z Read Index */ 1516 + #define R300_ZB_HIZ_RDINDEX 0x4f50 1517 + 1518 + /* Hierarchical Z Pitch */ 1519 + #define R300_ZB_HIZ_PITCH 0x4f54 1520 + 1521 + /* Z Buffer Z Pass Counter Data */ 1522 + #define R300_ZB_ZPASS_DATA 0x4f58 1523 + 1524 + /* Z Buffer Z Pass Counter Address */ 1525 + #define R300_ZB_ZPASS_ADDR 0x4f5c 1526 + 1527 + /* Depth buffer X and Y coordinate offset */ 1528 + #define R300_ZB_DEPTHXY_OFFSET 0x4f60 1529 + # define R300_DEPTHX_OFFSET_SHIFT 1 1530 + # define R300_DEPTHX_OFFSET_MASK 0x000007FE 1531 + # define R300_DEPTHY_OFFSET_SHIFT 17 1532 + # define R300_DEPTHY_OFFSET_MASK 0x07FE0000 1533 + 1534 + /* Sets the fifo sizes */ 1535 + #define R500_ZB_FIFO_SIZE 0x4fd0 1536 + # define R500_OP_FIFO_SIZE_FULL (0 << 0) 1537 + # define R500_OP_FIFO_SIZE_HALF (1 << 0) 1538 + # define R500_OP_FIFO_SIZE_QUATER (2 << 0) 1539 + # define R500_OP_FIFO_SIZE_EIGTHS (4 << 0) 1540 + 1541 + /* Stencil Reference Value and Mask for backfacing quads */ 1542 + /* R300_ZB_STENCILREFMASK handles front face */ 1543 + #define R500_ZB_STENCILREFMASK_BF 0x4fd4 1544 + # define R500_STENCILREF_SHIFT 0 1545 + # define R500_STENCILREF_MASK 0x000000ff 1546 + # define R500_STENCILMASK_SHIFT 8 1547 + # define R500_STENCILMASK_MASK 0x0000ff00 1548 + # define R500_STENCILWRITEMASK_SHIFT 16 1549 + # define R500_STENCILWRITEMASK_MASK 0x00ff0000 1550 1551 /* BEGIN: Vertex program instruction set */ 1552 ··· 1622 * CP type-3 packets 1623 */ 1624 #define R300_CP_CMD_BITBLT_MULTI 0xC0009B00 1625 + 1626 + #define R500_VAP_INDEX_OFFSET 0x208c 1627 + 1628 + #define R500_GA_US_VECTOR_INDEX 0x4250 1629 + #define R500_GA_US_VECTOR_DATA 0x4254 1630 + 1631 + #define R500_RS_IP_0 0x4074 1632 + #define R500_RS_INST_0 0x4320 1633 + 1634 + #define R500_US_CONFIG 0x4600 1635 + 1636 + #define R500_US_FC_CTRL 0x4624 1637 + #define R500_US_CODE_ADDR 0x4630 1638 + 1639 + #define R500_RB3D_COLOR_CLEAR_VALUE_AR 0x46c0 1640 + #define R500_RB3D_CONSTANT_COLOR_AR 0x4ef8 1641 1642 #endif /* _R300_REG_H */
+241 -903
drivers/char/drm/radeon_cp.c
··· 2 /* 3 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas. 4 * Copyright 2000 VA Linux Systems, Inc., Fremont, California. 5 * All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a ··· 35 #include "radeon_drv.h" 36 #include "r300_reg.h" 37 38 #define RADEON_FIFO_DEBUG 0 39 40 static int radeon_do_cleanup_cp(struct drm_device * dev); 41 42 - /* CP microcode (from ATI) */ 43 - static const u32 R200_cp_microcode[][2] = { 44 - {0x21007000, 0000000000}, 45 - {0x20007000, 0000000000}, 46 - {0x000000ab, 0x00000004}, 47 - {0x000000af, 0x00000004}, 48 - {0x66544a49, 0000000000}, 49 - {0x49494174, 0000000000}, 50 - {0x54517d83, 0000000000}, 51 - {0x498d8b64, 0000000000}, 52 - {0x49494949, 0000000000}, 53 - {0x49da493c, 0000000000}, 54 - {0x49989898, 0000000000}, 55 - {0xd34949d5, 0000000000}, 56 - {0x9dc90e11, 0000000000}, 57 - {0xce9b9b9b, 0000000000}, 58 - {0x000f0000, 0x00000016}, 59 - {0x352e232c, 0000000000}, 60 - {0x00000013, 0x00000004}, 61 - {0x000f0000, 0x00000016}, 62 - {0x352e272c, 0000000000}, 63 - {0x000f0001, 0x00000016}, 64 - {0x3239362f, 0000000000}, 65 - {0x000077ef, 0x00000002}, 66 - {0x00061000, 0x00000002}, 67 - {0x00000020, 0x0000001a}, 68 - {0x00004000, 0x0000001e}, 69 - {0x00061000, 0x00000002}, 70 - {0x00000020, 0x0000001a}, 71 - {0x00004000, 0x0000001e}, 72 - {0x00061000, 0x00000002}, 73 - {0x00000020, 0x0000001a}, 74 - {0x00004000, 0x0000001e}, 75 - {0x00000016, 0x00000004}, 76 - {0x0003802a, 0x00000002}, 77 - {0x040067e0, 0x00000002}, 78 - {0x00000016, 0x00000004}, 79 - {0x000077e0, 0x00000002}, 80 - {0x00065000, 0x00000002}, 81 - {0x000037e1, 0x00000002}, 82 - {0x040067e1, 0x00000006}, 83 - {0x000077e0, 0x00000002}, 84 - {0x000077e1, 0x00000002}, 85 - {0x000077e1, 0x00000006}, 86 - {0xffffffff, 0000000000}, 87 - {0x10000000, 0000000000}, 88 - {0x0003802a, 0x00000002}, 89 - {0x040067e0, 0x00000006}, 90 - {0x00007675, 0x00000002}, 91 - {0x00007676, 0x00000002}, 92 - {0x00007677, 0x00000002}, 93 - {0x00007678, 0x00000006}, 94 - {0x0003802b, 0x00000002}, 95 - {0x04002676, 0x00000002}, 96 - {0x00007677, 0x00000002}, 97 - {0x00007678, 0x00000006}, 98 - {0x0000002e, 0x00000018}, 99 - {0x0000002e, 0x00000018}, 100 - {0000000000, 0x00000006}, 101 - {0x0000002f, 0x00000018}, 102 - {0x0000002f, 0x00000018}, 103 - {0000000000, 0x00000006}, 104 - {0x01605000, 0x00000002}, 105 - {0x00065000, 0x00000002}, 106 - {0x00098000, 0x00000002}, 107 - {0x00061000, 0x00000002}, 108 - {0x64c0603d, 0x00000004}, 109 - {0x00080000, 0x00000016}, 110 - {0000000000, 0000000000}, 111 - {0x0400251d, 0x00000002}, 112 - {0x00007580, 0x00000002}, 113 - {0x00067581, 0x00000002}, 114 - {0x04002580, 0x00000002}, 115 - {0x00067581, 0x00000002}, 116 - {0x00000046, 0x00000004}, 117 - {0x00005000, 0000000000}, 118 - {0x00061000, 0x00000002}, 119 - {0x0000750e, 0x00000002}, 120 - {0x00019000, 0x00000002}, 121 - {0x00011055, 0x00000014}, 122 - {0x00000055, 0x00000012}, 123 - {0x0400250f, 0x00000002}, 124 - {0x0000504a, 0x00000004}, 125 - {0x00007565, 0x00000002}, 126 - {0x00007566, 0x00000002}, 127 - {0x00000051, 0x00000004}, 128 - {0x01e655b4, 0x00000002}, 129 - {0x4401b0dc, 0x00000002}, 130 - {0x01c110dc, 0x00000002}, 131 - {0x2666705d, 0x00000018}, 132 - {0x040c2565, 0x00000002}, 133 - {0x0000005d, 0x00000018}, 134 - {0x04002564, 0x00000002}, 135 - {0x00007566, 0x00000002}, 136 - {0x00000054, 0x00000004}, 137 - {0x00401060, 0x00000008}, 138 - {0x00101000, 0x00000002}, 139 - {0x000d80ff, 0x00000002}, 140 - {0x00800063, 0x00000008}, 141 - {0x000f9000, 0x00000002}, 142 - {0x000e00ff, 0x00000002}, 143 - {0000000000, 0x00000006}, 144 - {0x00000080, 0x00000018}, 145 - {0x00000054, 0x00000004}, 146 - {0x00007576, 0x00000002}, 147 - {0x00065000, 0x00000002}, 148 - {0x00009000, 0x00000002}, 149 - {0x00041000, 0x00000002}, 150 - {0x0c00350e, 0x00000002}, 151 - {0x00049000, 0x00000002}, 152 - {0x00051000, 0x00000002}, 153 - {0x01e785f8, 0x00000002}, 154 - {0x00200000, 0x00000002}, 155 - {0x00600073, 0x0000000c}, 156 - {0x00007563, 0x00000002}, 157 - {0x006075f0, 0x00000021}, 158 - {0x20007068, 0x00000004}, 159 - {0x00005068, 0x00000004}, 160 - {0x00007576, 0x00000002}, 161 - {0x00007577, 0x00000002}, 162 - {0x0000750e, 0x00000002}, 163 - {0x0000750f, 0x00000002}, 164 - {0x00a05000, 0x00000002}, 165 - {0x00600076, 0x0000000c}, 166 - {0x006075f0, 0x00000021}, 167 - {0x000075f8, 0x00000002}, 168 - {0x00000076, 0x00000004}, 169 - {0x000a750e, 0x00000002}, 170 - {0x0020750f, 0x00000002}, 171 - {0x00600079, 0x00000004}, 172 - {0x00007570, 0x00000002}, 173 - {0x00007571, 0x00000002}, 174 - {0x00007572, 0x00000006}, 175 - {0x00005000, 0x00000002}, 176 - {0x00a05000, 0x00000002}, 177 - {0x00007568, 0x00000002}, 178 - {0x00061000, 0x00000002}, 179 - {0x00000084, 0x0000000c}, 180 - {0x00058000, 0x00000002}, 181 - {0x0c607562, 0x00000002}, 182 - {0x00000086, 0x00000004}, 183 - {0x00600085, 0x00000004}, 184 - {0x400070dd, 0000000000}, 185 - {0x000380dd, 0x00000002}, 186 - {0x00000093, 0x0000001c}, 187 - {0x00065095, 0x00000018}, 188 - {0x040025bb, 0x00000002}, 189 - {0x00061096, 0x00000018}, 190 - {0x040075bc, 0000000000}, 191 - {0x000075bb, 0x00000002}, 192 - {0x000075bc, 0000000000}, 193 - {0x00090000, 0x00000006}, 194 - {0x00090000, 0x00000002}, 195 - {0x000d8002, 0x00000006}, 196 - {0x00005000, 0x00000002}, 197 - {0x00007821, 0x00000002}, 198 - {0x00007800, 0000000000}, 199 - {0x00007821, 0x00000002}, 200 - {0x00007800, 0000000000}, 201 - {0x01665000, 0x00000002}, 202 - {0x000a0000, 0x00000002}, 203 - {0x000671cc, 0x00000002}, 204 - {0x0286f1cd, 0x00000002}, 205 - {0x000000a3, 0x00000010}, 206 - {0x21007000, 0000000000}, 207 - {0x000000aa, 0x0000001c}, 208 - {0x00065000, 0x00000002}, 209 - {0x000a0000, 0x00000002}, 210 - {0x00061000, 0x00000002}, 211 - {0x000b0000, 0x00000002}, 212 - {0x38067000, 0x00000002}, 213 - {0x000a00a6, 0x00000004}, 214 - {0x20007000, 0000000000}, 215 - {0x01200000, 0x00000002}, 216 - {0x20077000, 0x00000002}, 217 - {0x01200000, 0x00000002}, 218 - {0x20007000, 0000000000}, 219 - {0x00061000, 0x00000002}, 220 - {0x0120751b, 0x00000002}, 221 - {0x8040750a, 0x00000002}, 222 - {0x8040750b, 0x00000002}, 223 - {0x00110000, 0x00000002}, 224 - {0x000380dd, 0x00000002}, 225 - {0x000000bd, 0x0000001c}, 226 - {0x00061096, 0x00000018}, 227 - {0x844075bd, 0x00000002}, 228 - {0x00061095, 0x00000018}, 229 - {0x840075bb, 0x00000002}, 230 - {0x00061096, 0x00000018}, 231 - {0x844075bc, 0x00000002}, 232 - {0x000000c0, 0x00000004}, 233 - {0x804075bd, 0x00000002}, 234 - {0x800075bb, 0x00000002}, 235 - {0x804075bc, 0x00000002}, 236 - {0x00108000, 0x00000002}, 237 - {0x01400000, 0x00000002}, 238 - {0x006000c4, 0x0000000c}, 239 - {0x20c07000, 0x00000020}, 240 - {0x000000c6, 0x00000012}, 241 - {0x00800000, 0x00000006}, 242 - {0x0080751d, 0x00000006}, 243 - {0x000025bb, 0x00000002}, 244 - {0x000040c0, 0x00000004}, 245 - {0x0000775c, 0x00000002}, 246 - {0x00a05000, 0x00000002}, 247 - {0x00661000, 0x00000002}, 248 - {0x0460275d, 0x00000020}, 249 - {0x00004000, 0000000000}, 250 - {0x00007999, 0x00000002}, 251 - {0x00a05000, 0x00000002}, 252 - {0x00661000, 0x00000002}, 253 - {0x0460299b, 0x00000020}, 254 - {0x00004000, 0000000000}, 255 - {0x01e00830, 0x00000002}, 256 - {0x21007000, 0000000000}, 257 - {0x00005000, 0x00000002}, 258 - {0x00038042, 0x00000002}, 259 - {0x040025e0, 0x00000002}, 260 - {0x000075e1, 0000000000}, 261 - {0x00000001, 0000000000}, 262 - {0x000380d9, 0x00000002}, 263 - {0x04007394, 0000000000}, 264 - {0000000000, 0000000000}, 265 - {0000000000, 0000000000}, 266 - {0000000000, 0000000000}, 267 - {0000000000, 0000000000}, 268 - {0000000000, 0000000000}, 269 - {0000000000, 0000000000}, 270 - {0000000000, 0000000000}, 271 - {0000000000, 0000000000}, 272 - {0000000000, 0000000000}, 273 - {0000000000, 0000000000}, 274 - {0000000000, 0000000000}, 275 - {0000000000, 0000000000}, 276 - {0000000000, 0000000000}, 277 - {0000000000, 0000000000}, 278 - {0000000000, 0000000000}, 279 - {0000000000, 0000000000}, 280 - {0000000000, 0000000000}, 281 - {0000000000, 0000000000}, 282 - {0000000000, 0000000000}, 283 - {0000000000, 0000000000}, 284 - {0000000000, 0000000000}, 285 - {0000000000, 0000000000}, 286 - {0000000000, 0000000000}, 287 - {0000000000, 0000000000}, 288 - {0000000000, 0000000000}, 289 - {0000000000, 0000000000}, 290 - {0000000000, 0000000000}, 291 - {0000000000, 0000000000}, 292 - {0000000000, 0000000000}, 293 - {0000000000, 0000000000}, 294 - {0000000000, 0000000000}, 295 - {0000000000, 0000000000}, 296 - {0000000000, 0000000000}, 297 - {0000000000, 0000000000}, 298 - {0000000000, 0000000000}, 299 - {0000000000, 0000000000}, 300 - }; 301 - 302 - static const u32 radeon_cp_microcode[][2] = { 303 - {0x21007000, 0000000000}, 304 - {0x20007000, 0000000000}, 305 - {0x000000b4, 0x00000004}, 306 - {0x000000b8, 0x00000004}, 307 - {0x6f5b4d4c, 0000000000}, 308 - {0x4c4c427f, 0000000000}, 309 - {0x5b568a92, 0000000000}, 310 - {0x4ca09c6d, 0000000000}, 311 - {0xad4c4c4c, 0000000000}, 312 - {0x4ce1af3d, 0000000000}, 313 - {0xd8afafaf, 0000000000}, 314 - {0xd64c4cdc, 0000000000}, 315 - {0x4cd10d10, 0000000000}, 316 - {0x000f0000, 0x00000016}, 317 - {0x362f242d, 0000000000}, 318 - {0x00000012, 0x00000004}, 319 - {0x000f0000, 0x00000016}, 320 - {0x362f282d, 0000000000}, 321 - {0x000380e7, 0x00000002}, 322 - {0x04002c97, 0x00000002}, 323 - {0x000f0001, 0x00000016}, 324 - {0x333a3730, 0000000000}, 325 - {0x000077ef, 0x00000002}, 326 - {0x00061000, 0x00000002}, 327 - {0x00000021, 0x0000001a}, 328 - {0x00004000, 0x0000001e}, 329 - {0x00061000, 0x00000002}, 330 - {0x00000021, 0x0000001a}, 331 - {0x00004000, 0x0000001e}, 332 - {0x00061000, 0x00000002}, 333 - {0x00000021, 0x0000001a}, 334 - {0x00004000, 0x0000001e}, 335 - {0x00000017, 0x00000004}, 336 - {0x0003802b, 0x00000002}, 337 - {0x040067e0, 0x00000002}, 338 - {0x00000017, 0x00000004}, 339 - {0x000077e0, 0x00000002}, 340 - {0x00065000, 0x00000002}, 341 - {0x000037e1, 0x00000002}, 342 - {0x040067e1, 0x00000006}, 343 - {0x000077e0, 0x00000002}, 344 - {0x000077e1, 0x00000002}, 345 - {0x000077e1, 0x00000006}, 346 - {0xffffffff, 0000000000}, 347 - {0x10000000, 0000000000}, 348 - {0x0003802b, 0x00000002}, 349 - {0x040067e0, 0x00000006}, 350 - {0x00007675, 0x00000002}, 351 - {0x00007676, 0x00000002}, 352 - {0x00007677, 0x00000002}, 353 - {0x00007678, 0x00000006}, 354 - {0x0003802c, 0x00000002}, 355 - {0x04002676, 0x00000002}, 356 - {0x00007677, 0x00000002}, 357 - {0x00007678, 0x00000006}, 358 - {0x0000002f, 0x00000018}, 359 - {0x0000002f, 0x00000018}, 360 - {0000000000, 0x00000006}, 361 - {0x00000030, 0x00000018}, 362 - {0x00000030, 0x00000018}, 363 - {0000000000, 0x00000006}, 364 - {0x01605000, 0x00000002}, 365 - {0x00065000, 0x00000002}, 366 - {0x00098000, 0x00000002}, 367 - {0x00061000, 0x00000002}, 368 - {0x64c0603e, 0x00000004}, 369 - {0x000380e6, 0x00000002}, 370 - {0x040025c5, 0x00000002}, 371 - {0x00080000, 0x00000016}, 372 - {0000000000, 0000000000}, 373 - {0x0400251d, 0x00000002}, 374 - {0x00007580, 0x00000002}, 375 - {0x00067581, 0x00000002}, 376 - {0x04002580, 0x00000002}, 377 - {0x00067581, 0x00000002}, 378 - {0x00000049, 0x00000004}, 379 - {0x00005000, 0000000000}, 380 - {0x000380e6, 0x00000002}, 381 - {0x040025c5, 0x00000002}, 382 - {0x00061000, 0x00000002}, 383 - {0x0000750e, 0x00000002}, 384 - {0x00019000, 0x00000002}, 385 - {0x00011055, 0x00000014}, 386 - {0x00000055, 0x00000012}, 387 - {0x0400250f, 0x00000002}, 388 - {0x0000504f, 0x00000004}, 389 - {0x000380e6, 0x00000002}, 390 - {0x040025c5, 0x00000002}, 391 - {0x00007565, 0x00000002}, 392 - {0x00007566, 0x00000002}, 393 - {0x00000058, 0x00000004}, 394 - {0x000380e6, 0x00000002}, 395 - {0x040025c5, 0x00000002}, 396 - {0x01e655b4, 0x00000002}, 397 - {0x4401b0e4, 0x00000002}, 398 - {0x01c110e4, 0x00000002}, 399 - {0x26667066, 0x00000018}, 400 - {0x040c2565, 0x00000002}, 401 - {0x00000066, 0x00000018}, 402 - {0x04002564, 0x00000002}, 403 - {0x00007566, 0x00000002}, 404 - {0x0000005d, 0x00000004}, 405 - {0x00401069, 0x00000008}, 406 - {0x00101000, 0x00000002}, 407 - {0x000d80ff, 0x00000002}, 408 - {0x0080006c, 0x00000008}, 409 - {0x000f9000, 0x00000002}, 410 - {0x000e00ff, 0x00000002}, 411 - {0000000000, 0x00000006}, 412 - {0x0000008f, 0x00000018}, 413 - {0x0000005b, 0x00000004}, 414 - {0x000380e6, 0x00000002}, 415 - {0x040025c5, 0x00000002}, 416 - {0x00007576, 0x00000002}, 417 - {0x00065000, 0x00000002}, 418 - {0x00009000, 0x00000002}, 419 - {0x00041000, 0x00000002}, 420 - {0x0c00350e, 0x00000002}, 421 - {0x00049000, 0x00000002}, 422 - {0x00051000, 0x00000002}, 423 - {0x01e785f8, 0x00000002}, 424 - {0x00200000, 0x00000002}, 425 - {0x0060007e, 0x0000000c}, 426 - {0x00007563, 0x00000002}, 427 - {0x006075f0, 0x00000021}, 428 - {0x20007073, 0x00000004}, 429 - {0x00005073, 0x00000004}, 430 - {0x000380e6, 0x00000002}, 431 - {0x040025c5, 0x00000002}, 432 - {0x00007576, 0x00000002}, 433 - {0x00007577, 0x00000002}, 434 - {0x0000750e, 0x00000002}, 435 - {0x0000750f, 0x00000002}, 436 - {0x00a05000, 0x00000002}, 437 - {0x00600083, 0x0000000c}, 438 - {0x006075f0, 0x00000021}, 439 - {0x000075f8, 0x00000002}, 440 - {0x00000083, 0x00000004}, 441 - {0x000a750e, 0x00000002}, 442 - {0x000380e6, 0x00000002}, 443 - {0x040025c5, 0x00000002}, 444 - {0x0020750f, 0x00000002}, 445 - {0x00600086, 0x00000004}, 446 - {0x00007570, 0x00000002}, 447 - {0x00007571, 0x00000002}, 448 - {0x00007572, 0x00000006}, 449 - {0x000380e6, 0x00000002}, 450 - {0x040025c5, 0x00000002}, 451 - {0x00005000, 0x00000002}, 452 - {0x00a05000, 0x00000002}, 453 - {0x00007568, 0x00000002}, 454 - {0x00061000, 0x00000002}, 455 - {0x00000095, 0x0000000c}, 456 - {0x00058000, 0x00000002}, 457 - {0x0c607562, 0x00000002}, 458 - {0x00000097, 0x00000004}, 459 - {0x000380e6, 0x00000002}, 460 - {0x040025c5, 0x00000002}, 461 - {0x00600096, 0x00000004}, 462 - {0x400070e5, 0000000000}, 463 - {0x000380e6, 0x00000002}, 464 - {0x040025c5, 0x00000002}, 465 - {0x000380e5, 0x00000002}, 466 - {0x000000a8, 0x0000001c}, 467 - {0x000650aa, 0x00000018}, 468 - {0x040025bb, 0x00000002}, 469 - {0x000610ab, 0x00000018}, 470 - {0x040075bc, 0000000000}, 471 - {0x000075bb, 0x00000002}, 472 - {0x000075bc, 0000000000}, 473 - {0x00090000, 0x00000006}, 474 - {0x00090000, 0x00000002}, 475 - {0x000d8002, 0x00000006}, 476 - {0x00007832, 0x00000002}, 477 - {0x00005000, 0x00000002}, 478 - {0x000380e7, 0x00000002}, 479 - {0x04002c97, 0x00000002}, 480 - {0x00007820, 0x00000002}, 481 - {0x00007821, 0x00000002}, 482 - {0x00007800, 0000000000}, 483 - {0x01200000, 0x00000002}, 484 - {0x20077000, 0x00000002}, 485 - {0x01200000, 0x00000002}, 486 - {0x20007000, 0x00000002}, 487 - {0x00061000, 0x00000002}, 488 - {0x0120751b, 0x00000002}, 489 - {0x8040750a, 0x00000002}, 490 - {0x8040750b, 0x00000002}, 491 - {0x00110000, 0x00000002}, 492 - {0x000380e5, 0x00000002}, 493 - {0x000000c6, 0x0000001c}, 494 - {0x000610ab, 0x00000018}, 495 - {0x844075bd, 0x00000002}, 496 - {0x000610aa, 0x00000018}, 497 - {0x840075bb, 0x00000002}, 498 - {0x000610ab, 0x00000018}, 499 - {0x844075bc, 0x00000002}, 500 - {0x000000c9, 0x00000004}, 501 - {0x804075bd, 0x00000002}, 502 - {0x800075bb, 0x00000002}, 503 - {0x804075bc, 0x00000002}, 504 - {0x00108000, 0x00000002}, 505 - {0x01400000, 0x00000002}, 506 - {0x006000cd, 0x0000000c}, 507 - {0x20c07000, 0x00000020}, 508 - {0x000000cf, 0x00000012}, 509 - {0x00800000, 0x00000006}, 510 - {0x0080751d, 0x00000006}, 511 - {0000000000, 0000000000}, 512 - {0x0000775c, 0x00000002}, 513 - {0x00a05000, 0x00000002}, 514 - {0x00661000, 0x00000002}, 515 - {0x0460275d, 0x00000020}, 516 - {0x00004000, 0000000000}, 517 - {0x01e00830, 0x00000002}, 518 - {0x21007000, 0000000000}, 519 - {0x6464614d, 0000000000}, 520 - {0x69687420, 0000000000}, 521 - {0x00000073, 0000000000}, 522 - {0000000000, 0000000000}, 523 - {0x00005000, 0x00000002}, 524 - {0x000380d0, 0x00000002}, 525 - {0x040025e0, 0x00000002}, 526 - {0x000075e1, 0000000000}, 527 - {0x00000001, 0000000000}, 528 - {0x000380e0, 0x00000002}, 529 - {0x04002394, 0x00000002}, 530 - {0x00005000, 0000000000}, 531 - {0000000000, 0000000000}, 532 - {0000000000, 0000000000}, 533 - {0x00000008, 0000000000}, 534 - {0x00000004, 0000000000}, 535 - {0000000000, 0000000000}, 536 - {0000000000, 0000000000}, 537 - {0000000000, 0000000000}, 538 - {0000000000, 0000000000}, 539 - {0000000000, 0000000000}, 540 - {0000000000, 0000000000}, 541 - {0000000000, 0000000000}, 542 - {0000000000, 0000000000}, 543 - {0000000000, 0000000000}, 544 - {0000000000, 0000000000}, 545 - {0000000000, 0000000000}, 546 - {0000000000, 0000000000}, 547 - {0000000000, 0000000000}, 548 - {0000000000, 0000000000}, 549 - {0000000000, 0000000000}, 550 - {0000000000, 0000000000}, 551 - {0000000000, 0000000000}, 552 - {0000000000, 0000000000}, 553 - {0000000000, 0000000000}, 554 - {0000000000, 0000000000}, 555 - {0000000000, 0000000000}, 556 - {0000000000, 0000000000}, 557 - {0000000000, 0000000000}, 558 - {0000000000, 0000000000}, 559 - }; 560 - 561 - static const u32 R300_cp_microcode[][2] = { 562 - {0x4200e000, 0000000000}, 563 - {0x4000e000, 0000000000}, 564 - {0x000000af, 0x00000008}, 565 - {0x000000b3, 0x00000008}, 566 - {0x6c5a504f, 0000000000}, 567 - {0x4f4f497a, 0000000000}, 568 - {0x5a578288, 0000000000}, 569 - {0x4f91906a, 0000000000}, 570 - {0x4f4f4f4f, 0000000000}, 571 - {0x4fe24f44, 0000000000}, 572 - {0x4f9c9c9c, 0000000000}, 573 - {0xdc4f4fde, 0000000000}, 574 - {0xa1cd4f4f, 0000000000}, 575 - {0xd29d9d9d, 0000000000}, 576 - {0x4f0f9fd7, 0000000000}, 577 - {0x000ca000, 0x00000004}, 578 - {0x000d0012, 0x00000038}, 579 - {0x0000e8b4, 0x00000004}, 580 - {0x000d0014, 0x00000038}, 581 - {0x0000e8b6, 0x00000004}, 582 - {0x000d0016, 0x00000038}, 583 - {0x0000e854, 0x00000004}, 584 - {0x000d0018, 0x00000038}, 585 - {0x0000e855, 0x00000004}, 586 - {0x000d001a, 0x00000038}, 587 - {0x0000e856, 0x00000004}, 588 - {0x000d001c, 0x00000038}, 589 - {0x0000e857, 0x00000004}, 590 - {0x000d001e, 0x00000038}, 591 - {0x0000e824, 0x00000004}, 592 - {0x000d0020, 0x00000038}, 593 - {0x0000e825, 0x00000004}, 594 - {0x000d0022, 0x00000038}, 595 - {0x0000e830, 0x00000004}, 596 - {0x000d0024, 0x00000038}, 597 - {0x0000f0c0, 0x00000004}, 598 - {0x000d0026, 0x00000038}, 599 - {0x0000f0c1, 0x00000004}, 600 - {0x000d0028, 0x00000038}, 601 - {0x0000f041, 0x00000004}, 602 - {0x000d002a, 0x00000038}, 603 - {0x0000f184, 0x00000004}, 604 - {0x000d002c, 0x00000038}, 605 - {0x0000f185, 0x00000004}, 606 - {0x000d002e, 0x00000038}, 607 - {0x0000f186, 0x00000004}, 608 - {0x000d0030, 0x00000038}, 609 - {0x0000f187, 0x00000004}, 610 - {0x000d0032, 0x00000038}, 611 - {0x0000f180, 0x00000004}, 612 - {0x000d0034, 0x00000038}, 613 - {0x0000f393, 0x00000004}, 614 - {0x000d0036, 0x00000038}, 615 - {0x0000f38a, 0x00000004}, 616 - {0x000d0038, 0x00000038}, 617 - {0x0000f38e, 0x00000004}, 618 - {0x0000e821, 0x00000004}, 619 - {0x0140a000, 0x00000004}, 620 - {0x00000043, 0x00000018}, 621 - {0x00cce800, 0x00000004}, 622 - {0x001b0001, 0x00000004}, 623 - {0x08004800, 0x00000004}, 624 - {0x001b0001, 0x00000004}, 625 - {0x08004800, 0x00000004}, 626 - {0x001b0001, 0x00000004}, 627 - {0x08004800, 0x00000004}, 628 - {0x0000003a, 0x00000008}, 629 - {0x0000a000, 0000000000}, 630 - {0x02c0a000, 0x00000004}, 631 - {0x000ca000, 0x00000004}, 632 - {0x00130000, 0x00000004}, 633 - {0x000c2000, 0x00000004}, 634 - {0xc980c045, 0x00000008}, 635 - {0x2000451d, 0x00000004}, 636 - {0x0000e580, 0x00000004}, 637 - {0x000ce581, 0x00000004}, 638 - {0x08004580, 0x00000004}, 639 - {0x000ce581, 0x00000004}, 640 - {0x0000004c, 0x00000008}, 641 - {0x0000a000, 0000000000}, 642 - {0x000c2000, 0x00000004}, 643 - {0x0000e50e, 0x00000004}, 644 - {0x00032000, 0x00000004}, 645 - {0x00022056, 0x00000028}, 646 - {0x00000056, 0x00000024}, 647 - {0x0800450f, 0x00000004}, 648 - {0x0000a050, 0x00000008}, 649 - {0x0000e565, 0x00000004}, 650 - {0x0000e566, 0x00000004}, 651 - {0x00000057, 0x00000008}, 652 - {0x03cca5b4, 0x00000004}, 653 - {0x05432000, 0x00000004}, 654 - {0x00022000, 0x00000004}, 655 - {0x4ccce063, 0x00000030}, 656 - {0x08274565, 0x00000004}, 657 - {0x00000063, 0x00000030}, 658 - {0x08004564, 0x00000004}, 659 - {0x0000e566, 0x00000004}, 660 - {0x0000005a, 0x00000008}, 661 - {0x00802066, 0x00000010}, 662 - {0x00202000, 0x00000004}, 663 - {0x001b00ff, 0x00000004}, 664 - {0x01000069, 0x00000010}, 665 - {0x001f2000, 0x00000004}, 666 - {0x001c00ff, 0x00000004}, 667 - {0000000000, 0x0000000c}, 668 - {0x00000085, 0x00000030}, 669 - {0x0000005a, 0x00000008}, 670 - {0x0000e576, 0x00000004}, 671 - {0x000ca000, 0x00000004}, 672 - {0x00012000, 0x00000004}, 673 - {0x00082000, 0x00000004}, 674 - {0x1800650e, 0x00000004}, 675 - {0x00092000, 0x00000004}, 676 - {0x000a2000, 0x00000004}, 677 - {0x000f0000, 0x00000004}, 678 - {0x00400000, 0x00000004}, 679 - {0x00000079, 0x00000018}, 680 - {0x0000e563, 0x00000004}, 681 - {0x00c0e5f9, 0x000000c2}, 682 - {0x0000006e, 0x00000008}, 683 - {0x0000a06e, 0x00000008}, 684 - {0x0000e576, 0x00000004}, 685 - {0x0000e577, 0x00000004}, 686 - {0x0000e50e, 0x00000004}, 687 - {0x0000e50f, 0x00000004}, 688 - {0x0140a000, 0x00000004}, 689 - {0x0000007c, 0x00000018}, 690 - {0x00c0e5f9, 0x000000c2}, 691 - {0x0000007c, 0x00000008}, 692 - {0x0014e50e, 0x00000004}, 693 - {0x0040e50f, 0x00000004}, 694 - {0x00c0007f, 0x00000008}, 695 - {0x0000e570, 0x00000004}, 696 - {0x0000e571, 0x00000004}, 697 - {0x0000e572, 0x0000000c}, 698 - {0x0000a000, 0x00000004}, 699 - {0x0140a000, 0x00000004}, 700 - {0x0000e568, 0x00000004}, 701 - {0x000c2000, 0x00000004}, 702 - {0x00000089, 0x00000018}, 703 - {0x000b0000, 0x00000004}, 704 - {0x18c0e562, 0x00000004}, 705 - {0x0000008b, 0x00000008}, 706 - {0x00c0008a, 0x00000008}, 707 - {0x000700e4, 0x00000004}, 708 - {0x00000097, 0x00000038}, 709 - {0x000ca099, 0x00000030}, 710 - {0x080045bb, 0x00000004}, 711 - {0x000c209a, 0x00000030}, 712 - {0x0800e5bc, 0000000000}, 713 - {0x0000e5bb, 0x00000004}, 714 - {0x0000e5bc, 0000000000}, 715 - {0x00120000, 0x0000000c}, 716 - {0x00120000, 0x00000004}, 717 - {0x001b0002, 0x0000000c}, 718 - {0x0000a000, 0x00000004}, 719 - {0x0000e821, 0x00000004}, 720 - {0x0000e800, 0000000000}, 721 - {0x0000e821, 0x00000004}, 722 - {0x0000e82e, 0000000000}, 723 - {0x02cca000, 0x00000004}, 724 - {0x00140000, 0x00000004}, 725 - {0x000ce1cc, 0x00000004}, 726 - {0x050de1cd, 0x00000004}, 727 - {0x000000a7, 0x00000020}, 728 - {0x4200e000, 0000000000}, 729 - {0x000000ae, 0x00000038}, 730 - {0x000ca000, 0x00000004}, 731 - {0x00140000, 0x00000004}, 732 - {0x000c2000, 0x00000004}, 733 - {0x00160000, 0x00000004}, 734 - {0x700ce000, 0x00000004}, 735 - {0x001400aa, 0x00000008}, 736 - {0x4000e000, 0000000000}, 737 - {0x02400000, 0x00000004}, 738 - {0x400ee000, 0x00000004}, 739 - {0x02400000, 0x00000004}, 740 - {0x4000e000, 0000000000}, 741 - {0x000c2000, 0x00000004}, 742 - {0x0240e51b, 0x00000004}, 743 - {0x0080e50a, 0x00000005}, 744 - {0x0080e50b, 0x00000005}, 745 - {0x00220000, 0x00000004}, 746 - {0x000700e4, 0x00000004}, 747 - {0x000000c1, 0x00000038}, 748 - {0x000c209a, 0x00000030}, 749 - {0x0880e5bd, 0x00000005}, 750 - {0x000c2099, 0x00000030}, 751 - {0x0800e5bb, 0x00000005}, 752 - {0x000c209a, 0x00000030}, 753 - {0x0880e5bc, 0x00000005}, 754 - {0x000000c4, 0x00000008}, 755 - {0x0080e5bd, 0x00000005}, 756 - {0x0000e5bb, 0x00000005}, 757 - {0x0080e5bc, 0x00000005}, 758 - {0x00210000, 0x00000004}, 759 - {0x02800000, 0x00000004}, 760 - {0x00c000c8, 0x00000018}, 761 - {0x4180e000, 0x00000040}, 762 - {0x000000ca, 0x00000024}, 763 - {0x01000000, 0x0000000c}, 764 - {0x0100e51d, 0x0000000c}, 765 - {0x000045bb, 0x00000004}, 766 - {0x000080c4, 0x00000008}, 767 - {0x0000f3ce, 0x00000004}, 768 - {0x0140a000, 0x00000004}, 769 - {0x00cc2000, 0x00000004}, 770 - {0x08c053cf, 0x00000040}, 771 - {0x00008000, 0000000000}, 772 - {0x0000f3d2, 0x00000004}, 773 - {0x0140a000, 0x00000004}, 774 - {0x00cc2000, 0x00000004}, 775 - {0x08c053d3, 0x00000040}, 776 - {0x00008000, 0000000000}, 777 - {0x0000f39d, 0x00000004}, 778 - {0x0140a000, 0x00000004}, 779 - {0x00cc2000, 0x00000004}, 780 - {0x08c0539e, 0x00000040}, 781 - {0x00008000, 0000000000}, 782 - {0x03c00830, 0x00000004}, 783 - {0x4200e000, 0000000000}, 784 - {0x0000a000, 0x00000004}, 785 - {0x200045e0, 0x00000004}, 786 - {0x0000e5e1, 0000000000}, 787 - {0x00000001, 0000000000}, 788 - {0x000700e1, 0x00000004}, 789 - {0x0800e394, 0000000000}, 790 - {0000000000, 0000000000}, 791 - {0000000000, 0000000000}, 792 - {0000000000, 0000000000}, 793 - {0000000000, 0000000000}, 794 - {0000000000, 0000000000}, 795 - {0000000000, 0000000000}, 796 - {0000000000, 0000000000}, 797 - {0000000000, 0000000000}, 798 - {0000000000, 0000000000}, 799 - {0000000000, 0000000000}, 800 - {0000000000, 0000000000}, 801 - {0000000000, 0000000000}, 802 - {0000000000, 0000000000}, 803 - {0000000000, 0000000000}, 804 - {0000000000, 0000000000}, 805 - {0000000000, 0000000000}, 806 - {0000000000, 0000000000}, 807 - {0000000000, 0000000000}, 808 - {0000000000, 0000000000}, 809 - {0000000000, 0000000000}, 810 - {0000000000, 0000000000}, 811 - {0000000000, 0000000000}, 812 - {0000000000, 0000000000}, 813 - {0000000000, 0000000000}, 814 - {0000000000, 0000000000}, 815 - {0000000000, 0000000000}, 816 - {0000000000, 0000000000}, 817 - {0000000000, 0000000000}, 818 - }; 819 - 820 - static u32 RADEON_READ_MCIND(drm_radeon_private_t *dev_priv, int addr) 821 { 822 u32 ret; 823 RADEON_WRITE(R520_MC_IND_INDEX, 0x7f0000 | (addr & 0xff)); ··· 50 return ret; 51 } 52 53 static u32 RS690_READ_MCIND(drm_radeon_private_t *dev_priv, int addr) 54 { 55 RADEON_WRITE(RS690_MC_INDEX, (addr & RS690_MC_INDEX_MASK)); 56 - return RADEON_READ(RS690_MC_DATA); 57 } 58 59 u32 radeon_read_fb_location(drm_radeon_private_t *dev_priv) 60 { 61 62 if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) 63 - return RADEON_READ_MCIND(dev_priv, RV515_MC_FB_LOCATION); 64 else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) 65 return RS690_READ_MCIND(dev_priv, RS690_MC_FB_LOCATION); 66 else if ((dev_priv->flags & RADEON_FAMILY_MASK) > CHIP_RV515) 67 - return RADEON_READ_MCIND(dev_priv, R520_MC_FB_LOCATION); 68 else 69 return RADEON_READ(RADEON_MC_FB_LOCATION); 70 } ··· 92 static void radeon_write_fb_location(drm_radeon_private_t *dev_priv, u32 fb_loc) 93 { 94 if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) 95 - RADEON_WRITE_MCIND(RV515_MC_FB_LOCATION, fb_loc); 96 else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) 97 RS690_WRITE_MCIND(RS690_MC_FB_LOCATION, fb_loc); 98 else if ((dev_priv->flags & RADEON_FAMILY_MASK) > CHIP_RV515) 99 - RADEON_WRITE_MCIND(R520_MC_FB_LOCATION, fb_loc); 100 else 101 RADEON_WRITE(RADEON_MC_FB_LOCATION, fb_loc); 102 } ··· 104 static void radeon_write_agp_location(drm_radeon_private_t *dev_priv, u32 agp_loc) 105 { 106 if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) 107 - RADEON_WRITE_MCIND(RV515_MC_AGP_LOCATION, agp_loc); 108 else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) 109 RS690_WRITE_MCIND(RS690_MC_AGP_LOCATION, agp_loc); 110 else if ((dev_priv->flags & RADEON_FAMILY_MASK) > CHIP_RV515) 111 - RADEON_WRITE_MCIND(R520_MC_AGP_LOCATION, agp_loc); 112 else 113 RADEON_WRITE(RADEON_MC_AGP_LOCATION, agp_loc); 114 } 115 116 static int RADEON_READ_PLL(struct drm_device * dev, int addr) ··· 149 { 150 RADEON_WRITE8(RADEON_PCIE_INDEX, addr & 0xff); 151 return RADEON_READ(RADEON_PCIE_DATA); 152 - } 153 - 154 - static u32 RADEON_READ_IGPGART(drm_radeon_private_t *dev_priv, int addr) 155 - { 156 - u32 ret; 157 - RADEON_WRITE(RADEON_IGPGART_INDEX, addr & 0x7f); 158 - ret = RADEON_READ(RADEON_IGPGART_DATA); 159 - RADEON_WRITE(RADEON_IGPGART_INDEX, 0x7f); 160 - return ret; 161 } 162 163 #if RADEON_FIFO_DEBUG ··· 185 186 dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; 187 188 - tmp = RADEON_READ(RADEON_RB3D_DSTCACHE_CTLSTAT); 189 - tmp |= RADEON_RB3D_DC_FLUSH_ALL; 190 - RADEON_WRITE(RADEON_RB3D_DSTCACHE_CTLSTAT, tmp); 191 192 - for (i = 0; i < dev_priv->usec_timeout; i++) { 193 - if (!(RADEON_READ(RADEON_RB3D_DSTCACHE_CTLSTAT) 194 - & RADEON_RB3D_DC_BUSY)) { 195 - return 0; 196 } 197 - DRM_UDELAY(1); 198 } 199 200 #if RADEON_FIFO_DEBUG ··· 271 return -EBUSY; 272 } 273 274 /* ================================================================ 275 * CP control, initialization 276 */ ··· 328 radeon_do_wait_for_idle(dev_priv); 329 330 RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0); 331 - 332 - if (dev_priv->microcode_version == UCODE_R200) { 333 DRM_INFO("Loading R200 Microcode\n"); 334 for (i = 0; i < 256; i++) { 335 RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, ··· 351 RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 352 R200_cp_microcode[i][0]); 353 } 354 - } else if (dev_priv->microcode_version == UCODE_R300) { 355 DRM_INFO("Loading R300 Microcode\n"); 356 for (i = 0; i < 256; i++) { 357 RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, ··· 363 RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 364 R300_cp_microcode[i][0]); 365 } 366 - } else { 367 for (i = 0; i < 256; i++) { 368 RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, 369 - radeon_cp_microcode[i][1]); 370 RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 371 - radeon_cp_microcode[i][0]); 372 } 373 } 374 } ··· 486 static int radeon_do_engine_reset(struct drm_device * dev) 487 { 488 drm_radeon_private_t *dev_priv = dev->dev_private; 489 - u32 clock_cntl_index, mclk_cntl, rbbm_soft_reset; 490 DRM_DEBUG("\n"); 491 492 radeon_do_pixcache_flush(dev_priv); 493 494 - if ((dev_priv->flags & RADEON_FAMILY_MASK) < CHIP_RV515) { 495 clock_cntl_index = RADEON_READ(RADEON_CLOCK_CNTL_INDEX); 496 mclk_cntl = RADEON_READ_PLL(dev, RADEON_MCLK_CNTL); 497 ··· 503 RADEON_FORCEON_YCLKB | 504 RADEON_FORCEON_MC | 505 RADEON_FORCEON_AIC)); 506 507 - rbbm_soft_reset = RADEON_READ(RADEON_RBBM_SOFT_RESET); 508 509 - RADEON_WRITE(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset | 510 - RADEON_SOFT_RESET_CP | 511 - RADEON_SOFT_RESET_HI | 512 - RADEON_SOFT_RESET_SE | 513 - RADEON_SOFT_RESET_RE | 514 - RADEON_SOFT_RESET_PP | 515 - RADEON_SOFT_RESET_E2 | 516 - RADEON_SOFT_RESET_RB)); 517 - RADEON_READ(RADEON_RBBM_SOFT_RESET); 518 - RADEON_WRITE(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset & 519 - ~(RADEON_SOFT_RESET_CP | 520 - RADEON_SOFT_RESET_HI | 521 - RADEON_SOFT_RESET_SE | 522 - RADEON_SOFT_RESET_RE | 523 - RADEON_SOFT_RESET_PP | 524 - RADEON_SOFT_RESET_E2 | 525 - RADEON_SOFT_RESET_RB))); 526 - RADEON_READ(RADEON_RBBM_SOFT_RESET); 527 528 RADEON_WRITE_PLL(RADEON_MCLK_CNTL, mclk_cntl); 529 RADEON_WRITE(RADEON_CLOCK_CNTL_INDEX, clock_cntl_index); 530 RADEON_WRITE(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset); 531 } 532 533 /* Reset the CP ring */ 534 radeon_do_cp_reset(dev_priv); ··· 566 567 #if __OS_HAS_AGP 568 if (dev_priv->flags & RADEON_IS_AGP) { 569 - RADEON_WRITE(RADEON_AGP_BASE, (unsigned int)dev->agp->base); 570 radeon_write_agp_location(dev_priv, 571 (((dev_priv->gart_vm_start - 1 + 572 dev_priv->gart_size) & 0xffff0000) | ··· 712 /* Enable or disable IGP GART on the chip */ 713 static void radeon_set_igpgart(drm_radeon_private_t * dev_priv, int on) 714 { 715 - u32 temp, tmp; 716 - 717 - tmp = RADEON_READ(RADEON_AIC_CNTL); 718 - if (on) { 719 - DRM_DEBUG("programming igpgart %08X %08lX %08X\n", 720 - dev_priv->gart_vm_start, 721 - (long)dev_priv->gart_info.bus_addr, 722 - dev_priv->gart_size); 723 - 724 - RADEON_WRITE_IGPGART(RADEON_IGPGART_UNK_18, 0x1000); 725 - RADEON_WRITE_IGPGART(RADEON_IGPGART_ENABLE, 0x1); 726 - RADEON_WRITE_IGPGART(RADEON_IGPGART_CTRL, 0x42040800); 727 - RADEON_WRITE_IGPGART(RADEON_IGPGART_BASE_ADDR, 728 - dev_priv->gart_info.bus_addr); 729 - 730 - temp = RADEON_READ_IGPGART(dev_priv, RADEON_IGPGART_UNK_39); 731 - RADEON_WRITE_IGPGART(RADEON_IGPGART_UNK_39, temp); 732 - 733 - RADEON_WRITE(RADEON_AGP_BASE, (unsigned int)dev_priv->gart_vm_start); 734 - dev_priv->gart_size = 32*1024*1024; 735 - radeon_write_agp_location(dev_priv, 736 - (((dev_priv->gart_vm_start - 1 + 737 - dev_priv->gart_size) & 0xffff0000) | 738 - (dev_priv->gart_vm_start >> 16))); 739 - 740 - temp = RADEON_READ_IGPGART(dev_priv, RADEON_IGPGART_ENABLE); 741 - RADEON_WRITE_IGPGART(RADEON_IGPGART_ENABLE, temp); 742 - 743 - RADEON_READ_IGPGART(dev_priv, RADEON_IGPGART_FLUSH); 744 - RADEON_WRITE_IGPGART(RADEON_IGPGART_FLUSH, 0x1); 745 - RADEON_READ_IGPGART(dev_priv, RADEON_IGPGART_FLUSH); 746 - RADEON_WRITE_IGPGART(RADEON_IGPGART_FLUSH, 0x0); 747 - } 748 - } 749 - 750 - /* Enable or disable RS690 GART on the chip */ 751 - static void radeon_set_rs690gart(drm_radeon_private_t *dev_priv, int on) 752 - { 753 u32 temp; 754 755 if (on) { 756 - DRM_DEBUG("programming rs690 gart %08X %08lX %08X\n", 757 dev_priv->gart_vm_start, 758 (long)dev_priv->gart_info.bus_addr, 759 dev_priv->gart_size); 760 761 - temp = RS690_READ_MCIND(dev_priv, RS690_MC_MISC_CNTL); 762 - RS690_WRITE_MCIND(RS690_MC_MISC_CNTL, 0x5000); 763 764 - RS690_WRITE_MCIND(RS690_MC_AGP_SIZE, 765 - RS690_MC_GART_EN | RS690_MC_AGP_SIZE_32MB); 766 767 - temp = RS690_READ_MCIND(dev_priv, RS690_MC_GART_FEATURE_ID); 768 - RS690_WRITE_MCIND(RS690_MC_GART_FEATURE_ID, 0x42040800); 769 770 - RS690_WRITE_MCIND(RS690_MC_GART_BASE, 771 - dev_priv->gart_info.bus_addr); 772 773 - temp = RS690_READ_MCIND(dev_priv, RS690_MC_AGP_MODE_CONTROL); 774 - RS690_WRITE_MCIND(RS690_MC_AGP_MODE_CONTROL, 0x01400000); 775 776 - RS690_WRITE_MCIND(RS690_MC_AGP_BASE, 777 - (unsigned int)dev_priv->gart_vm_start); 778 779 dev_priv->gart_size = 32*1024*1024; 780 temp = (((dev_priv->gart_vm_start - 1 + dev_priv->gart_size) & 781 0xffff0000) | (dev_priv->gart_vm_start >> 16)); 782 783 - RS690_WRITE_MCIND(RS690_MC_AGP_LOCATION, temp); 784 785 - temp = RS690_READ_MCIND(dev_priv, RS690_MC_AGP_SIZE); 786 - RS690_WRITE_MCIND(RS690_MC_AGP_SIZE, 787 - RS690_MC_GART_EN | RS690_MC_AGP_SIZE_32MB); 788 789 do { 790 - temp = RS690_READ_MCIND(dev_priv, RS690_MC_GART_CACHE_CNTL); 791 - if ((temp & RS690_MC_GART_CLEAR_STATUS) == 792 - RS690_MC_GART_CLEAR_DONE) 793 break; 794 DRM_UDELAY(1); 795 } while (1); 796 797 - RS690_WRITE_MCIND(RS690_MC_GART_CACHE_CNTL, 798 - RS690_MC_GART_CC_CLEAR); 799 do { 800 - temp = RS690_READ_MCIND(dev_priv, RS690_MC_GART_CACHE_CNTL); 801 - if ((temp & RS690_MC_GART_CLEAR_STATUS) == 802 - RS690_MC_GART_CLEAR_DONE) 803 break; 804 DRM_UDELAY(1); 805 } while (1); 806 807 - RS690_WRITE_MCIND(RS690_MC_GART_CACHE_CNTL, 808 - RS690_MC_GART_CC_NO_CHANGE); 809 } else { 810 - RS690_WRITE_MCIND(RS690_MC_AGP_SIZE, RS690_MC_GART_DIS); 811 } 812 } 813 ··· 813 { 814 u32 tmp; 815 816 - if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) { 817 - radeon_set_rs690gart(dev_priv, on); 818 - return; 819 - } 820 - 821 - if (dev_priv->flags & RADEON_IS_IGPGART) { 822 radeon_set_igpgart(dev_priv, on); 823 return; 824 } ··· 1288 radeon_cp_init_ring_buffer(dev, dev_priv); 1289 1290 radeon_do_engine_reset(dev); 1291 1292 DRM_DEBUG("radeon_do_resume_cp() complete\n"); 1293
··· 2 /* 3 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas. 4 * Copyright 2000 VA Linux Systems, Inc., Fremont, California. 5 + * Copyright 2007 Advanced Micro Devices, Inc. 6 * All Rights Reserved. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a ··· 34 #include "radeon_drv.h" 35 #include "r300_reg.h" 36 37 + #include "radeon_microcode.h" 38 + 39 #define RADEON_FIFO_DEBUG 0 40 41 static int radeon_do_cleanup_cp(struct drm_device * dev); 42 43 + static u32 R500_READ_MCIND(drm_radeon_private_t *dev_priv, int addr) 44 { 45 u32 ret; 46 RADEON_WRITE(R520_MC_IND_INDEX, 0x7f0000 | (addr & 0xff)); ··· 825 return ret; 826 } 827 828 + static u32 RS480_READ_MCIND(drm_radeon_private_t *dev_priv, int addr) 829 + { 830 + u32 ret; 831 + RADEON_WRITE(RS480_NB_MC_INDEX, addr & 0xff); 832 + ret = RADEON_READ(RS480_NB_MC_DATA); 833 + RADEON_WRITE(RS480_NB_MC_INDEX, 0xff); 834 + return ret; 835 + } 836 + 837 static u32 RS690_READ_MCIND(drm_radeon_private_t *dev_priv, int addr) 838 { 839 + u32 ret; 840 RADEON_WRITE(RS690_MC_INDEX, (addr & RS690_MC_INDEX_MASK)); 841 + ret = RADEON_READ(RS690_MC_DATA); 842 + RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_MASK); 843 + return ret; 844 + } 845 + 846 + static u32 IGP_READ_MCIND(drm_radeon_private_t *dev_priv, int addr) 847 + { 848 + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) 849 + return RS690_READ_MCIND(dev_priv, addr); 850 + else 851 + return RS480_READ_MCIND(dev_priv, addr); 852 } 853 854 u32 radeon_read_fb_location(drm_radeon_private_t *dev_priv) 855 { 856 857 if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) 858 + return R500_READ_MCIND(dev_priv, RV515_MC_FB_LOCATION); 859 else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) 860 return RS690_READ_MCIND(dev_priv, RS690_MC_FB_LOCATION); 861 else if ((dev_priv->flags & RADEON_FAMILY_MASK) > CHIP_RV515) 862 + return R500_READ_MCIND(dev_priv, R520_MC_FB_LOCATION); 863 else 864 return RADEON_READ(RADEON_MC_FB_LOCATION); 865 } ··· 847 static void radeon_write_fb_location(drm_radeon_private_t *dev_priv, u32 fb_loc) 848 { 849 if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) 850 + R500_WRITE_MCIND(RV515_MC_FB_LOCATION, fb_loc); 851 else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) 852 RS690_WRITE_MCIND(RS690_MC_FB_LOCATION, fb_loc); 853 else if ((dev_priv->flags & RADEON_FAMILY_MASK) > CHIP_RV515) 854 + R500_WRITE_MCIND(R520_MC_FB_LOCATION, fb_loc); 855 else 856 RADEON_WRITE(RADEON_MC_FB_LOCATION, fb_loc); 857 } ··· 859 static void radeon_write_agp_location(drm_radeon_private_t *dev_priv, u32 agp_loc) 860 { 861 if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) 862 + R500_WRITE_MCIND(RV515_MC_AGP_LOCATION, agp_loc); 863 else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) 864 RS690_WRITE_MCIND(RS690_MC_AGP_LOCATION, agp_loc); 865 else if ((dev_priv->flags & RADEON_FAMILY_MASK) > CHIP_RV515) 866 + R500_WRITE_MCIND(R520_MC_AGP_LOCATION, agp_loc); 867 else 868 RADEON_WRITE(RADEON_MC_AGP_LOCATION, agp_loc); 869 + } 870 + 871 + static void radeon_write_agp_base(drm_radeon_private_t *dev_priv, u64 agp_base) 872 + { 873 + u32 agp_base_hi = upper_32_bits(agp_base); 874 + u32 agp_base_lo = agp_base & 0xffffffff; 875 + 876 + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) { 877 + R500_WRITE_MCIND(RV515_MC_AGP_BASE, agp_base_lo); 878 + R500_WRITE_MCIND(RV515_MC_AGP_BASE_2, agp_base_hi); 879 + } else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) { 880 + RS690_WRITE_MCIND(RS690_MC_AGP_BASE, agp_base_lo); 881 + RS690_WRITE_MCIND(RS690_MC_AGP_BASE_2, agp_base_hi); 882 + } else if ((dev_priv->flags & RADEON_FAMILY_MASK) > CHIP_RV515) { 883 + R500_WRITE_MCIND(R520_MC_AGP_BASE, agp_base_lo); 884 + R500_WRITE_MCIND(R520_MC_AGP_BASE_2, agp_base_hi); 885 + } else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS480) { 886 + RADEON_WRITE(RADEON_AGP_BASE, agp_base_lo); 887 + RADEON_WRITE(RS480_AGP_BASE_2, 0); 888 + } else { 889 + RADEON_WRITE(RADEON_AGP_BASE, agp_base_lo); 890 + if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R200) 891 + RADEON_WRITE(RADEON_AGP_BASE_2, agp_base_hi); 892 + } 893 } 894 895 static int RADEON_READ_PLL(struct drm_device * dev, int addr) ··· 880 { 881 RADEON_WRITE8(RADEON_PCIE_INDEX, addr & 0xff); 882 return RADEON_READ(RADEON_PCIE_DATA); 883 } 884 885 #if RADEON_FIFO_DEBUG ··· 925 926 dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; 927 928 + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { 929 + tmp = RADEON_READ(RADEON_RB3D_DSTCACHE_CTLSTAT); 930 + tmp |= RADEON_RB3D_DC_FLUSH_ALL; 931 + RADEON_WRITE(RADEON_RB3D_DSTCACHE_CTLSTAT, tmp); 932 933 + for (i = 0; i < dev_priv->usec_timeout; i++) { 934 + if (!(RADEON_READ(RADEON_RB3D_DSTCACHE_CTLSTAT) 935 + & RADEON_RB3D_DC_BUSY)) { 936 + return 0; 937 + } 938 + DRM_UDELAY(1); 939 } 940 + } else { 941 + /* 3D */ 942 + tmp = RADEON_READ(R300_RB3D_DSTCACHE_CTLSTAT); 943 + tmp |= RADEON_RB3D_DC_FLUSH_ALL; 944 + RADEON_WRITE(R300_RB3D_DSTCACHE_CTLSTAT, tmp); 945 + 946 + /* 2D */ 947 + tmp = RADEON_READ(R300_DSTCACHE_CTLSTAT); 948 + tmp |= RADEON_RB3D_DC_FLUSH_ALL; 949 + RADEON_WRITE(R300_DSTCACHE_CTLSTAT, tmp); 950 + 951 + for (i = 0; i < dev_priv->usec_timeout; i++) { 952 + if (!(RADEON_READ(R300_DSTCACHE_CTLSTAT) 953 + & RADEON_RB3D_DC_BUSY)) { 954 + return 0; 955 + } 956 + DRM_UDELAY(1); 957 + } 958 } 959 960 #if RADEON_FIFO_DEBUG ··· 991 return -EBUSY; 992 } 993 994 + static void radeon_init_pipes(drm_radeon_private_t *dev_priv) 995 + { 996 + uint32_t gb_tile_config, gb_pipe_sel = 0; 997 + 998 + /* RS4xx/RS6xx/R4xx/R5xx */ 999 + if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R420) { 1000 + gb_pipe_sel = RADEON_READ(R400_GB_PIPE_SELECT); 1001 + dev_priv->num_gb_pipes = ((gb_pipe_sel >> 12) & 0x3) + 1; 1002 + } else { 1003 + /* R3xx */ 1004 + if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R300) || 1005 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R350)) { 1006 + dev_priv->num_gb_pipes = 2; 1007 + } else { 1008 + /* R3Vxx */ 1009 + dev_priv->num_gb_pipes = 1; 1010 + } 1011 + } 1012 + DRM_INFO("Num pipes: %d\n", dev_priv->num_gb_pipes); 1013 + 1014 + gb_tile_config = (R300_ENABLE_TILING | R300_TILE_SIZE_16 /*| R300_SUBPIXEL_1_16*/); 1015 + 1016 + switch (dev_priv->num_gb_pipes) { 1017 + case 2: gb_tile_config |= R300_PIPE_COUNT_R300; break; 1018 + case 3: gb_tile_config |= R300_PIPE_COUNT_R420_3P; break; 1019 + case 4: gb_tile_config |= R300_PIPE_COUNT_R420; break; 1020 + default: 1021 + case 1: gb_tile_config |= R300_PIPE_COUNT_RV350; break; 1022 + } 1023 + 1024 + if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV515) { 1025 + RADEON_WRITE_PLL(R500_DYN_SCLK_PWMEM_PIPE, (1 | ((gb_pipe_sel >> 8) & 0xf) << 4)); 1026 + RADEON_WRITE(R500_SU_REG_DEST, ((1 << dev_priv->num_gb_pipes) - 1)); 1027 + } 1028 + RADEON_WRITE(R300_GB_TILE_CONFIG, gb_tile_config); 1029 + radeon_do_wait_for_idle(dev_priv); 1030 + RADEON_WRITE(R300_DST_PIPE_CONFIG, RADEON_READ(R300_DST_PIPE_CONFIG) | R300_PIPE_AUTO_CONFIG); 1031 + RADEON_WRITE(R300_RB2D_DSTCACHE_MODE, (RADEON_READ(R300_RB2D_DSTCACHE_MODE) | 1032 + R300_DC_AUTOFLUSH_ENABLE | 1033 + R300_DC_DC_DISABLE_IGNORE_PE)); 1034 + 1035 + 1036 + } 1037 + 1038 /* ================================================================ 1039 * CP control, initialization 1040 */ ··· 1004 radeon_do_wait_for_idle(dev_priv); 1005 1006 RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0); 1007 + if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R100) || 1008 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV100) || 1009 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV200) || 1010 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS100) || 1011 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS200)) { 1012 + DRM_INFO("Loading R100 Microcode\n"); 1013 + for (i = 0; i < 256; i++) { 1014 + RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, 1015 + R100_cp_microcode[i][1]); 1016 + RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 1017 + R100_cp_microcode[i][0]); 1018 + } 1019 + } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R200) || 1020 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV250) || 1021 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV280) || 1022 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS300)) { 1023 DRM_INFO("Loading R200 Microcode\n"); 1024 for (i = 0; i < 256; i++) { 1025 RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, ··· 1013 RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 1014 R200_cp_microcode[i][0]); 1015 } 1016 + } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R300) || 1017 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R350) || 1018 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV350) || 1019 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV380) || 1020 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS480)) { 1021 DRM_INFO("Loading R300 Microcode\n"); 1022 for (i = 0; i < 256; i++) { 1023 RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, ··· 1021 RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 1022 R300_cp_microcode[i][0]); 1023 } 1024 + } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R420) || 1025 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV410)) { 1026 + DRM_INFO("Loading R400 Microcode\n"); 1027 for (i = 0; i < 256; i++) { 1028 RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, 1029 + R420_cp_microcode[i][1]); 1030 RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 1031 + R420_cp_microcode[i][0]); 1032 + } 1033 + } else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) { 1034 + DRM_INFO("Loading RS690 Microcode\n"); 1035 + for (i = 0; i < 256; i++) { 1036 + RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, 1037 + RS690_cp_microcode[i][1]); 1038 + RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 1039 + RS690_cp_microcode[i][0]); 1040 + } 1041 + } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) || 1042 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R520) || 1043 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) || 1044 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R580) || 1045 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV560) || 1046 + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV570)) { 1047 + DRM_INFO("Loading R500 Microcode\n"); 1048 + for (i = 0; i < 256; i++) { 1049 + RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, 1050 + R520_cp_microcode[i][1]); 1051 + RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, 1052 + R520_cp_microcode[i][0]); 1053 } 1054 } 1055 } ··· 1121 static int radeon_do_engine_reset(struct drm_device * dev) 1122 { 1123 drm_radeon_private_t *dev_priv = dev->dev_private; 1124 + u32 clock_cntl_index = 0, mclk_cntl = 0, rbbm_soft_reset; 1125 DRM_DEBUG("\n"); 1126 1127 radeon_do_pixcache_flush(dev_priv); 1128 1129 + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV410) { 1130 + /* may need something similar for newer chips */ 1131 clock_cntl_index = RADEON_READ(RADEON_CLOCK_CNTL_INDEX); 1132 mclk_cntl = RADEON_READ_PLL(dev, RADEON_MCLK_CNTL); 1133 ··· 1137 RADEON_FORCEON_YCLKB | 1138 RADEON_FORCEON_MC | 1139 RADEON_FORCEON_AIC)); 1140 + } 1141 1142 + rbbm_soft_reset = RADEON_READ(RADEON_RBBM_SOFT_RESET); 1143 1144 + RADEON_WRITE(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset | 1145 + RADEON_SOFT_RESET_CP | 1146 + RADEON_SOFT_RESET_HI | 1147 + RADEON_SOFT_RESET_SE | 1148 + RADEON_SOFT_RESET_RE | 1149 + RADEON_SOFT_RESET_PP | 1150 + RADEON_SOFT_RESET_E2 | 1151 + RADEON_SOFT_RESET_RB)); 1152 + RADEON_READ(RADEON_RBBM_SOFT_RESET); 1153 + RADEON_WRITE(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset & 1154 + ~(RADEON_SOFT_RESET_CP | 1155 + RADEON_SOFT_RESET_HI | 1156 + RADEON_SOFT_RESET_SE | 1157 + RADEON_SOFT_RESET_RE | 1158 + RADEON_SOFT_RESET_PP | 1159 + RADEON_SOFT_RESET_E2 | 1160 + RADEON_SOFT_RESET_RB))); 1161 + RADEON_READ(RADEON_RBBM_SOFT_RESET); 1162 1163 + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV410) { 1164 RADEON_WRITE_PLL(RADEON_MCLK_CNTL, mclk_cntl); 1165 RADEON_WRITE(RADEON_CLOCK_CNTL_INDEX, clock_cntl_index); 1166 RADEON_WRITE(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset); 1167 } 1168 + 1169 + /* setup the raster pipes */ 1170 + if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R300) 1171 + radeon_init_pipes(dev_priv); 1172 1173 /* Reset the CP ring */ 1174 radeon_do_cp_reset(dev_priv); ··· 1194 1195 #if __OS_HAS_AGP 1196 if (dev_priv->flags & RADEON_IS_AGP) { 1197 + radeon_write_agp_base(dev_priv, dev->agp->base); 1198 + 1199 radeon_write_agp_location(dev_priv, 1200 (((dev_priv->gart_vm_start - 1 + 1201 dev_priv->gart_size) & 0xffff0000) | ··· 1339 /* Enable or disable IGP GART on the chip */ 1340 static void radeon_set_igpgart(drm_radeon_private_t * dev_priv, int on) 1341 { 1342 u32 temp; 1343 1344 if (on) { 1345 + DRM_DEBUG("programming igp gart %08X %08lX %08X\n", 1346 dev_priv->gart_vm_start, 1347 (long)dev_priv->gart_info.bus_addr, 1348 dev_priv->gart_size); 1349 1350 + temp = IGP_READ_MCIND(dev_priv, RS480_MC_MISC_CNTL); 1351 + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) 1352 + IGP_WRITE_MCIND(RS480_MC_MISC_CNTL, (RS480_GART_INDEX_REG_EN | 1353 + RS690_BLOCK_GFX_D3_EN)); 1354 + else 1355 + IGP_WRITE_MCIND(RS480_MC_MISC_CNTL, RS480_GART_INDEX_REG_EN); 1356 1357 + IGP_WRITE_MCIND(RS480_AGP_ADDRESS_SPACE_SIZE, (RS480_GART_EN | 1358 + RS480_VA_SIZE_32MB)); 1359 1360 + temp = IGP_READ_MCIND(dev_priv, RS480_GART_FEATURE_ID); 1361 + IGP_WRITE_MCIND(RS480_GART_FEATURE_ID, (RS480_HANG_EN | 1362 + RS480_TLB_ENABLE | 1363 + RS480_GTW_LAC_EN | 1364 + RS480_1LEVEL_GART)); 1365 1366 + temp = dev_priv->gart_info.bus_addr & 0xfffff000; 1367 + temp |= (upper_32_bits(dev_priv->gart_info.bus_addr) & 0xff) << 4; 1368 + IGP_WRITE_MCIND(RS480_GART_BASE, temp); 1369 1370 + temp = IGP_READ_MCIND(dev_priv, RS480_AGP_MODE_CNTL); 1371 + IGP_WRITE_MCIND(RS480_AGP_MODE_CNTL, ((1 << RS480_REQ_TYPE_SNOOP_SHIFT) | 1372 + RS480_REQ_TYPE_SNOOP_DIS)); 1373 1374 + radeon_write_agp_base(dev_priv, dev_priv->gart_vm_start); 1375 1376 dev_priv->gart_size = 32*1024*1024; 1377 temp = (((dev_priv->gart_vm_start - 1 + dev_priv->gart_size) & 1378 0xffff0000) | (dev_priv->gart_vm_start >> 16)); 1379 1380 + radeon_write_agp_location(dev_priv, temp); 1381 1382 + temp = IGP_READ_MCIND(dev_priv, RS480_AGP_ADDRESS_SPACE_SIZE); 1383 + IGP_WRITE_MCIND(RS480_AGP_ADDRESS_SPACE_SIZE, (RS480_GART_EN | 1384 + RS480_VA_SIZE_32MB)); 1385 1386 do { 1387 + temp = IGP_READ_MCIND(dev_priv, RS480_GART_CACHE_CNTRL); 1388 + if ((temp & RS480_GART_CACHE_INVALIDATE) == 0) 1389 break; 1390 DRM_UDELAY(1); 1391 } while (1); 1392 1393 + IGP_WRITE_MCIND(RS480_GART_CACHE_CNTRL, 1394 + RS480_GART_CACHE_INVALIDATE); 1395 + 1396 do { 1397 + temp = IGP_READ_MCIND(dev_priv, RS480_GART_CACHE_CNTRL); 1398 + if ((temp & RS480_GART_CACHE_INVALIDATE) == 0) 1399 break; 1400 DRM_UDELAY(1); 1401 } while (1); 1402 1403 + IGP_WRITE_MCIND(RS480_GART_CACHE_CNTRL, 0); 1404 } else { 1405 + IGP_WRITE_MCIND(RS480_AGP_ADDRESS_SPACE_SIZE, 0); 1406 } 1407 } 1408 ··· 1472 { 1473 u32 tmp; 1474 1475 + if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) || 1476 + (dev_priv->flags & RADEON_IS_IGPGART)) { 1477 radeon_set_igpgart(dev_priv, on); 1478 return; 1479 } ··· 1951 radeon_cp_init_ring_buffer(dev, dev_priv); 1952 1953 radeon_do_engine_reset(dev); 1954 + radeon_enable_interrupt(dev); 1955 1956 DRM_DEBUG("radeon_do_resume_cp() complete\n"); 1957
+8
drivers/char/drm/radeon_drm.h
··· 240 # define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8 241 242 #define R300_CMD_SCRATCH 8 243 244 typedef union { 245 unsigned int u; ··· 269 struct { 270 unsigned char cmd_type, reg, n_bufs, flags; 271 } scratch; 272 } drm_r300_cmd_header_t; 273 274 #define RADEON_FRONT 0x1 ··· 281 #define RADEON_CLEAR_FASTZ 0x80000000 282 #define RADEON_USE_HIERZ 0x40000000 283 #define RADEON_USE_COMP_ZBUF 0x20000000 284 285 /* Primitive types 286 */ ··· 676 #define RADEON_PARAM_CARD_TYPE 12 677 #define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */ 678 #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ 679 680 typedef struct drm_radeon_getparam { 681 int param;
··· 240 # define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8 241 242 #define R300_CMD_SCRATCH 8 243 + #define R300_CMD_R500FP 9 244 245 typedef union { 246 unsigned int u; ··· 268 struct { 269 unsigned char cmd_type, reg, n_bufs, flags; 270 } scratch; 271 + struct { 272 + unsigned char cmd_type, count, adrlo, adrhi_flags; 273 + } r500fp; 274 } drm_r300_cmd_header_t; 275 276 #define RADEON_FRONT 0x1 ··· 277 #define RADEON_CLEAR_FASTZ 0x80000000 278 #define RADEON_USE_HIERZ 0x40000000 279 #define RADEON_USE_COMP_ZBUF 0x20000000 280 + 281 + #define R500FP_CONSTANT_TYPE (1 << 1) 282 + #define R500FP_CONSTANT_CLAMP (1 << 2) 283 284 /* Primitive types 285 */ ··· 669 #define RADEON_PARAM_CARD_TYPE 12 670 #define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */ 671 #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ 672 + #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ 673 674 typedef struct drm_radeon_getparam { 675 int param;
+180 -73
drivers/char/drm/radeon_drv.h
··· 38 39 #define DRIVER_NAME "radeon" 40 #define DRIVER_DESC "ATI Radeon" 41 - #define DRIVER_DATE "20060524" 42 43 /* Interface history: 44 * ··· 98 * 1.26- Add support for variable size PCI(E) gart aperture 99 * 1.27- Add support for IGP GART 100 * 1.28- Add support for VBL on CRTC2 101 */ 102 #define DRIVER_MAJOR 1 103 - #define DRIVER_MINOR 28 104 #define DRIVER_PATCHLEVEL 0 105 106 /* ··· 123 CHIP_RV380, 124 CHIP_R420, 125 CHIP_RV410, 126 - CHIP_RS400, 127 CHIP_RS690, 128 CHIP_RV515, 129 CHIP_R520, ··· 295 int vblank_crtc; 296 uint32_t irq_enable_reg; 297 int irq_enabled; 298 299 struct radeon_surface surfaces[RADEON_MAX_SURFACES]; 300 struct radeon_virt_surface virt_surfaces[2 * RADEON_MAX_SURFACES]; ··· 309 /* starting from here on, data is preserved accross an open */ 310 uint32_t flags; /* see radeon_chip_flags */ 311 unsigned long fb_aper_offset; 312 } drm_radeon_private_t; 313 314 typedef struct drm_radeon_buf_priv { ··· 386 extern void radeon_driver_irq_preinstall(struct drm_device * dev); 387 extern void radeon_driver_irq_postinstall(struct drm_device * dev); 388 extern void radeon_driver_irq_uninstall(struct drm_device * dev); 389 extern int radeon_vblank_crtc_get(struct drm_device *dev); 390 extern int radeon_vblank_crtc_set(struct drm_device *dev, int64_t value); 391 ··· 449 #define RADEON_PCIE_DATA 0x0034 450 #define RADEON_PCIE_TX_GART_CNTL 0x10 451 # define RADEON_PCIE_TX_GART_EN (1 << 0) 452 - # define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_PASS_THRU (0<<1) 453 - # define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_CLAMP_LO (1<<1) 454 - # define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD (3<<1) 455 - # define RADEON_PCIE_TX_GART_MODE_32_128_CACHE (0<<3) 456 - # define RADEON_PCIE_TX_GART_MODE_8_4_128_CACHE (1<<3) 457 - # define RADEON_PCIE_TX_GART_CHK_RW_VALID_EN (1<<5) 458 - # define RADEON_PCIE_TX_GART_INVALIDATE_TLB (1<<8) 459 #define RADEON_PCIE_TX_DISCARD_RD_ADDR_LO 0x11 460 #define RADEON_PCIE_TX_DISCARD_RD_ADDR_HI 0x12 461 #define RADEON_PCIE_TX_GART_BASE 0x13 ··· 464 #define RADEON_PCIE_TX_GART_END_LO 0x16 465 #define RADEON_PCIE_TX_GART_END_HI 0x17 466 467 - #define RADEON_IGPGART_INDEX 0x168 468 - #define RADEON_IGPGART_DATA 0x16c 469 - #define RADEON_IGPGART_UNK_18 0x18 470 - #define RADEON_IGPGART_CTRL 0x2b 471 - #define RADEON_IGPGART_BASE_ADDR 0x2c 472 - #define RADEON_IGPGART_FLUSH 0x2e 473 - #define RADEON_IGPGART_ENABLE 0x38 474 - #define RADEON_IGPGART_UNK_39 0x39 475 476 #define RS690_MC_INDEX 0x78 477 # define RS690_MC_INDEX_MASK 0x1ff ··· 474 # define RS690_MC_INDEX_WR_ACK 0x7f 475 #define RS690_MC_DATA 0x7c 476 477 - #define RS690_MC_MISC_CNTL 0x18 478 - #define RS690_MC_GART_FEATURE_ID 0x2b 479 - #define RS690_MC_GART_BASE 0x2c 480 - #define RS690_MC_GART_CACHE_CNTL 0x2e 481 - # define RS690_MC_GART_CC_NO_CHANGE 0x0 482 - # define RS690_MC_GART_CC_CLEAR 0x1 483 - # define RS690_MC_GART_CLEAR_STATUS (1 << 1) 484 - # define RS690_MC_GART_CLEAR_DONE (0 << 1) 485 - # define RS690_MC_GART_CLEAR_PENDING (1 << 1) 486 - #define RS690_MC_AGP_SIZE 0x38 487 - # define RS690_MC_GART_DIS 0x0 488 - # define RS690_MC_GART_EN 0x1 489 - # define RS690_MC_AGP_SIZE_32MB (0 << 1) 490 - # define RS690_MC_AGP_SIZE_64MB (1 << 1) 491 - # define RS690_MC_AGP_SIZE_128MB (2 << 1) 492 - # define RS690_MC_AGP_SIZE_256MB (3 << 1) 493 - # define RS690_MC_AGP_SIZE_512MB (4 << 1) 494 - # define RS690_MC_AGP_SIZE_1GB (5 << 1) 495 - # define RS690_MC_AGP_SIZE_2GB (6 << 1) 496 - #define RS690_MC_AGP_MODE_CONTROL 0x39 497 #define RS690_MC_FB_LOCATION 0x100 498 #define RS690_MC_AGP_LOCATION 0x101 499 #define RS690_MC_AGP_BASE 0x102 500 501 #define R520_MC_IND_INDEX 0x70 502 - #define R520_MC_IND_WR_EN (1<<24) 503 #define R520_MC_IND_DATA 0x74 504 505 #define RV515_MC_FB_LOCATION 0x01 506 #define RV515_MC_AGP_LOCATION 0x02 507 508 #define R520_MC_FB_LOCATION 0x04 509 #define R520_MC_AGP_LOCATION 0x05 510 511 #define RADEON_MPP_TB_CONFIG 0x01c0 512 #define RADEON_MEM_CNTL 0x0140 513 #define RADEON_MEM_SDRAM_MODE_REG 0x0158 514 #define RADEON_AGP_BASE 0x0170 515 516 #define RADEON_RB3D_COLOROFFSET 0x1c40 517 #define RADEON_RB3D_COLORPITCH 0x1c48 ··· 662 #define RADEON_PP_TXFILTER_1 0x1c6c 663 #define RADEON_PP_TXFILTER_2 0x1c84 664 665 - #define RADEON_RB2D_DSTCACHE_CTLSTAT 0x342c 666 - # define RADEON_RB2D_DC_FLUSH (3 << 0) 667 - # define RADEON_RB2D_DC_FREE (3 << 2) 668 - # define RADEON_RB2D_DC_FLUSH_ALL 0xf 669 - # define RADEON_RB2D_DC_BUSY (1 << 31) 670 #define RADEON_RB3D_CNTL 0x1c3c 671 # define RADEON_ALPHA_BLEND_ENABLE (1 << 0) 672 # define RADEON_PLANE_MASK_ENABLE (1 << 1) ··· 690 # define RADEON_RB3D_ZC_FREE (1 << 2) 691 # define RADEON_RB3D_ZC_FLUSH_ALL 0x5 692 # define RADEON_RB3D_ZC_BUSY (1 << 31) 693 #define RADEON_RB3D_DSTCACHE_CTLSTAT 0x325c 694 # define RADEON_RB3D_DC_FLUSH (3 << 0) 695 # define RADEON_RB3D_DC_FREE (3 << 2) 696 # define RADEON_RB3D_DC_FLUSH_ALL 0xf 697 # define RADEON_RB3D_DC_BUSY (1 << 31) 698 #define RADEON_RB3D_ZSTENCILCNTL 0x1c2c 699 # define RADEON_Z_TEST_MASK (7 << 4) 700 # define RADEON_Z_TEST_ALWAYS (7 << 4) ··· 1111 1112 #define R200_VAP_PVS_CNTL_1 0x22D0 1113 1114 /* Constants */ 1115 #define RADEON_MAX_USEC_TIMEOUT 100000 /* 100 ms */ 1116 ··· 1157 #define RADEON_READ8(reg) DRM_READ8( dev_priv->mmio, (reg) ) 1158 #define RADEON_WRITE8(reg,val) DRM_WRITE8( dev_priv->mmio, (reg), (val) ) 1159 1160 - #define RADEON_WRITE_PLL( addr, val ) \ 1161 do { \ 1162 - RADEON_WRITE8( RADEON_CLOCK_CNTL_INDEX, \ 1163 ((addr) & 0x1f) | RADEON_PLL_WR_EN ); \ 1164 - RADEON_WRITE( RADEON_CLOCK_CNTL_DATA, (val) ); \ 1165 } while (0) 1166 1167 - #define RADEON_WRITE_IGPGART( addr, val ) \ 1168 do { \ 1169 - RADEON_WRITE( RADEON_IGPGART_INDEX, \ 1170 - ((addr) & 0x7f) | (1 << 8)); \ 1171 - RADEON_WRITE( RADEON_IGPGART_DATA, (val) ); \ 1172 - RADEON_WRITE( RADEON_IGPGART_INDEX, 0x7f ); \ 1173 - } while (0) 1174 - 1175 - #define RADEON_WRITE_PCIE( addr, val ) \ 1176 - do { \ 1177 - RADEON_WRITE8( RADEON_PCIE_INDEX, \ 1178 ((addr) & 0xff)); \ 1179 - RADEON_WRITE( RADEON_PCIE_DATA, (val) ); \ 1180 } while (0) 1181 1182 - #define RADEON_WRITE_MCIND( addr, val ) \ 1183 - do { \ 1184 - RADEON_WRITE(R520_MC_IND_INDEX, 0xff0000 | ((addr) & 0xff)); \ 1185 - RADEON_WRITE(R520_MC_IND_DATA, (val)); \ 1186 - RADEON_WRITE(R520_MC_IND_INDEX, 0); \ 1187 - } while (0) 1188 1189 - #define RS690_WRITE_MCIND( addr, val ) \ 1190 do { \ 1191 RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_EN | ((addr) & RS690_MC_INDEX_MASK)); \ 1192 RADEON_WRITE(RS690_MC_DATA, val); \ 1193 RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK); \ 1194 } while (0) 1195 1196 #define CP_PACKET0( reg, n ) \ ··· 1241 } while (0) 1242 1243 #define RADEON_FLUSH_CACHE() do { \ 1244 - OUT_RING( CP_PACKET0( RADEON_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ 1245 - OUT_RING( RADEON_RB3D_DC_FLUSH ); \ 1246 } while (0) 1247 1248 #define RADEON_PURGE_CACHE() do { \ 1249 - OUT_RING( CP_PACKET0( RADEON_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ 1250 - OUT_RING( RADEON_RB3D_DC_FLUSH_ALL ); \ 1251 } while (0) 1252 1253 #define RADEON_FLUSH_ZCACHE() do { \ 1254 - OUT_RING( CP_PACKET0( RADEON_RB3D_ZCACHE_CTLSTAT, 0 ) ); \ 1255 - OUT_RING( RADEON_RB3D_ZC_FLUSH ); \ 1256 } while (0) 1257 1258 #define RADEON_PURGE_ZCACHE() do { \ 1259 - OUT_RING( CP_PACKET0( RADEON_RB3D_ZCACHE_CTLSTAT, 0 ) ); \ 1260 - OUT_RING( RADEON_RB3D_ZC_FLUSH_ALL ); \ 1261 } while (0) 1262 1263 /* ================================================================
··· 38 39 #define DRIVER_NAME "radeon" 40 #define DRIVER_DESC "ATI Radeon" 41 + #define DRIVER_DATE "20080528" 42 43 /* Interface history: 44 * ··· 98 * 1.26- Add support for variable size PCI(E) gart aperture 99 * 1.27- Add support for IGP GART 100 * 1.28- Add support for VBL on CRTC2 101 + * 1.29- R500 3D cmd buffer support 102 */ 103 #define DRIVER_MAJOR 1 104 + #define DRIVER_MINOR 29 105 #define DRIVER_PATCHLEVEL 0 106 107 /* ··· 122 CHIP_RV380, 123 CHIP_R420, 124 CHIP_RV410, 125 + CHIP_RS480, 126 CHIP_RS690, 127 CHIP_RV515, 128 CHIP_R520, ··· 294 int vblank_crtc; 295 uint32_t irq_enable_reg; 296 int irq_enabled; 297 + uint32_t r500_disp_irq_reg; 298 299 struct radeon_surface surfaces[RADEON_MAX_SURFACES]; 300 struct radeon_virt_surface virt_surfaces[2 * RADEON_MAX_SURFACES]; ··· 307 /* starting from here on, data is preserved accross an open */ 308 uint32_t flags; /* see radeon_chip_flags */ 309 unsigned long fb_aper_offset; 310 + 311 + int num_gb_pipes; 312 } drm_radeon_private_t; 313 314 typedef struct drm_radeon_buf_priv { ··· 382 extern void radeon_driver_irq_preinstall(struct drm_device * dev); 383 extern void radeon_driver_irq_postinstall(struct drm_device * dev); 384 extern void radeon_driver_irq_uninstall(struct drm_device * dev); 385 + extern void radeon_enable_interrupt(struct drm_device *dev); 386 extern int radeon_vblank_crtc_get(struct drm_device *dev); 387 extern int radeon_vblank_crtc_set(struct drm_device *dev, int64_t value); 388 ··· 444 #define RADEON_PCIE_DATA 0x0034 445 #define RADEON_PCIE_TX_GART_CNTL 0x10 446 # define RADEON_PCIE_TX_GART_EN (1 << 0) 447 + # define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_PASS_THRU (0 << 1) 448 + # define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_CLAMP_LO (1 << 1) 449 + # define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD (3 << 1) 450 + # define RADEON_PCIE_TX_GART_MODE_32_128_CACHE (0 << 3) 451 + # define RADEON_PCIE_TX_GART_MODE_8_4_128_CACHE (1 << 3) 452 + # define RADEON_PCIE_TX_GART_CHK_RW_VALID_EN (1 << 5) 453 + # define RADEON_PCIE_TX_GART_INVALIDATE_TLB (1 << 8) 454 #define RADEON_PCIE_TX_DISCARD_RD_ADDR_LO 0x11 455 #define RADEON_PCIE_TX_DISCARD_RD_ADDR_HI 0x12 456 #define RADEON_PCIE_TX_GART_BASE 0x13 ··· 459 #define RADEON_PCIE_TX_GART_END_LO 0x16 460 #define RADEON_PCIE_TX_GART_END_HI 0x17 461 462 + #define RS480_NB_MC_INDEX 0x168 463 + # define RS480_NB_MC_IND_WR_EN (1 << 8) 464 + #define RS480_NB_MC_DATA 0x16c 465 466 #define RS690_MC_INDEX 0x78 467 # define RS690_MC_INDEX_MASK 0x1ff ··· 474 # define RS690_MC_INDEX_WR_ACK 0x7f 475 #define RS690_MC_DATA 0x7c 476 477 + /* MC indirect registers */ 478 + #define RS480_MC_MISC_CNTL 0x18 479 + # define RS480_DISABLE_GTW (1 << 1) 480 + /* switch between MCIND GART and MM GART registers. 0 = mmgart, 1 = mcind gart */ 481 + # define RS480_GART_INDEX_REG_EN (1 << 12) 482 + # define RS690_BLOCK_GFX_D3_EN (1 << 14) 483 + #define RS480_K8_FB_LOCATION 0x1e 484 + #define RS480_GART_FEATURE_ID 0x2b 485 + # define RS480_HANG_EN (1 << 11) 486 + # define RS480_TLB_ENABLE (1 << 18) 487 + # define RS480_P2P_ENABLE (1 << 19) 488 + # define RS480_GTW_LAC_EN (1 << 25) 489 + # define RS480_2LEVEL_GART (0 << 30) 490 + # define RS480_1LEVEL_GART (1 << 30) 491 + # define RS480_PDC_EN (1 << 31) 492 + #define RS480_GART_BASE 0x2c 493 + #define RS480_GART_CACHE_CNTRL 0x2e 494 + # define RS480_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ 495 + #define RS480_AGP_ADDRESS_SPACE_SIZE 0x38 496 + # define RS480_GART_EN (1 << 0) 497 + # define RS480_VA_SIZE_32MB (0 << 1) 498 + # define RS480_VA_SIZE_64MB (1 << 1) 499 + # define RS480_VA_SIZE_128MB (2 << 1) 500 + # define RS480_VA_SIZE_256MB (3 << 1) 501 + # define RS480_VA_SIZE_512MB (4 << 1) 502 + # define RS480_VA_SIZE_1GB (5 << 1) 503 + # define RS480_VA_SIZE_2GB (6 << 1) 504 + #define RS480_AGP_MODE_CNTL 0x39 505 + # define RS480_POST_GART_Q_SIZE (1 << 18) 506 + # define RS480_NONGART_SNOOP (1 << 19) 507 + # define RS480_AGP_RD_BUF_SIZE (1 << 20) 508 + # define RS480_REQ_TYPE_SNOOP_SHIFT 22 509 + # define RS480_REQ_TYPE_SNOOP_MASK 0x3 510 + # define RS480_REQ_TYPE_SNOOP_DIS (1 << 24) 511 + #define RS480_MC_MISC_UMA_CNTL 0x5f 512 + #define RS480_MC_MCLK_CNTL 0x7a 513 + #define RS480_MC_UMA_DUALCH_CNTL 0x86 514 + 515 #define RS690_MC_FB_LOCATION 0x100 516 #define RS690_MC_AGP_LOCATION 0x101 517 #define RS690_MC_AGP_BASE 0x102 518 + #define RS690_MC_AGP_BASE_2 0x103 519 520 #define R520_MC_IND_INDEX 0x70 521 + #define R520_MC_IND_WR_EN (1 << 24) 522 #define R520_MC_IND_DATA 0x74 523 524 #define RV515_MC_FB_LOCATION 0x01 525 #define RV515_MC_AGP_LOCATION 0x02 526 + #define RV515_MC_AGP_BASE 0x03 527 + #define RV515_MC_AGP_BASE_2 0x04 528 529 #define R520_MC_FB_LOCATION 0x04 530 #define R520_MC_AGP_LOCATION 0x05 531 + #define R520_MC_AGP_BASE 0x06 532 + #define R520_MC_AGP_BASE_2 0x07 533 534 #define RADEON_MPP_TB_CONFIG 0x01c0 535 #define RADEON_MEM_CNTL 0x0140 536 #define RADEON_MEM_SDRAM_MODE_REG 0x0158 537 + #define RADEON_AGP_BASE_2 0x015c /* r200+ only */ 538 + #define RS480_AGP_BASE_2 0x0164 539 #define RADEON_AGP_BASE 0x0170 540 + 541 + /* pipe config regs */ 542 + #define R400_GB_PIPE_SELECT 0x402c 543 + #define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ 544 + #define R500_SU_REG_DEST 0x42c8 545 + #define R300_GB_TILE_CONFIG 0x4018 546 + # define R300_ENABLE_TILING (1 << 0) 547 + # define R300_PIPE_COUNT_RV350 (0 << 1) 548 + # define R300_PIPE_COUNT_R300 (3 << 1) 549 + # define R300_PIPE_COUNT_R420_3P (6 << 1) 550 + # define R300_PIPE_COUNT_R420 (7 << 1) 551 + # define R300_TILE_SIZE_8 (0 << 4) 552 + # define R300_TILE_SIZE_16 (1 << 4) 553 + # define R300_TILE_SIZE_32 (2 << 4) 554 + # define R300_SUBPIXEL_1_12 (0 << 16) 555 + # define R300_SUBPIXEL_1_16 (1 << 16) 556 + #define R300_DST_PIPE_CONFIG 0x170c 557 + # define R300_PIPE_AUTO_CONFIG (1 << 31) 558 + #define R300_RB2D_DSTCACHE_MODE 0x3428 559 + # define R300_DC_AUTOFLUSH_ENABLE (1 << 8) 560 + # define R300_DC_DC_DISABLE_IGNORE_PE (1 << 17) 561 562 #define RADEON_RB3D_COLOROFFSET 0x1c40 563 #define RADEON_RB3D_COLORPITCH 0x1c48 ··· 616 #define RADEON_PP_TXFILTER_1 0x1c6c 617 #define RADEON_PP_TXFILTER_2 0x1c84 618 619 + #define R300_RB2D_DSTCACHE_CTLSTAT 0x342c /* use R300_DSTCACHE_CTLSTAT */ 620 + #define R300_DSTCACHE_CTLSTAT 0x1714 621 + # define R300_RB2D_DC_FLUSH (3 << 0) 622 + # define R300_RB2D_DC_FREE (3 << 2) 623 + # define R300_RB2D_DC_FLUSH_ALL 0xf 624 + # define R300_RB2D_DC_BUSY (1 << 31) 625 #define RADEON_RB3D_CNTL 0x1c3c 626 # define RADEON_ALPHA_BLEND_ENABLE (1 << 0) 627 # define RADEON_PLANE_MASK_ENABLE (1 << 1) ··· 643 # define RADEON_RB3D_ZC_FREE (1 << 2) 644 # define RADEON_RB3D_ZC_FLUSH_ALL 0x5 645 # define RADEON_RB3D_ZC_BUSY (1 << 31) 646 + #define R300_ZB_ZCACHE_CTLSTAT 0x4f18 647 + # define R300_ZC_FLUSH (1 << 0) 648 + # define R300_ZC_FREE (1 << 1) 649 + # define R300_ZC_FLUSH_ALL 0x3 650 + # define R300_ZC_BUSY (1 << 31) 651 #define RADEON_RB3D_DSTCACHE_CTLSTAT 0x325c 652 # define RADEON_RB3D_DC_FLUSH (3 << 0) 653 # define RADEON_RB3D_DC_FREE (3 << 2) 654 # define RADEON_RB3D_DC_FLUSH_ALL 0xf 655 # define RADEON_RB3D_DC_BUSY (1 << 31) 656 + #define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c 657 + # define R300_RB3D_DC_FINISH (1 << 4) 658 #define RADEON_RB3D_ZSTENCILCNTL 0x1c2c 659 # define RADEON_Z_TEST_MASK (7 << 4) 660 # define RADEON_Z_TEST_ALWAYS (7 << 4) ··· 1057 1058 #define R200_VAP_PVS_CNTL_1 0x22D0 1059 1060 + #define R500_D1CRTC_STATUS 0x609c 1061 + #define R500_D2CRTC_STATUS 0x689c 1062 + #define R500_CRTC_V_BLANK (1<<0) 1063 + 1064 + #define R500_D1CRTC_FRAME_COUNT 0x60a4 1065 + #define R500_D2CRTC_FRAME_COUNT 0x68a4 1066 + 1067 + #define R500_D1MODE_V_COUNTER 0x6530 1068 + #define R500_D2MODE_V_COUNTER 0x6d30 1069 + 1070 + #define R500_D1MODE_VBLANK_STATUS 0x6534 1071 + #define R500_D2MODE_VBLANK_STATUS 0x6d34 1072 + #define R500_VBLANK_OCCURED (1<<0) 1073 + #define R500_VBLANK_ACK (1<<4) 1074 + #define R500_VBLANK_STAT (1<<12) 1075 + #define R500_VBLANK_INT (1<<16) 1076 + 1077 + #define R500_DxMODE_INT_MASK 0x6540 1078 + #define R500_D1MODE_INT_MASK (1<<0) 1079 + #define R500_D2MODE_INT_MASK (1<<8) 1080 + 1081 + #define R500_DISP_INTERRUPT_STATUS 0x7edc 1082 + #define R500_D1_VBLANK_INTERRUPT (1 << 4) 1083 + #define R500_D2_VBLANK_INTERRUPT (1 << 5) 1084 + 1085 /* Constants */ 1086 #define RADEON_MAX_USEC_TIMEOUT 100000 /* 100 ms */ 1087 ··· 1078 #define RADEON_READ8(reg) DRM_READ8( dev_priv->mmio, (reg) ) 1079 #define RADEON_WRITE8(reg,val) DRM_WRITE8( dev_priv->mmio, (reg), (val) ) 1080 1081 + #define RADEON_WRITE_PLL(addr, val) \ 1082 do { \ 1083 + RADEON_WRITE8(RADEON_CLOCK_CNTL_INDEX, \ 1084 ((addr) & 0x1f) | RADEON_PLL_WR_EN ); \ 1085 + RADEON_WRITE(RADEON_CLOCK_CNTL_DATA, (val)); \ 1086 } while (0) 1087 1088 + #define RADEON_WRITE_PCIE(addr, val) \ 1089 do { \ 1090 + RADEON_WRITE8(RADEON_PCIE_INDEX, \ 1091 ((addr) & 0xff)); \ 1092 + RADEON_WRITE(RADEON_PCIE_DATA, (val)); \ 1093 } while (0) 1094 1095 + #define R500_WRITE_MCIND(addr, val) \ 1096 + do { \ 1097 + RADEON_WRITE(R520_MC_IND_INDEX, 0xff0000 | ((addr) & 0xff)); \ 1098 + RADEON_WRITE(R520_MC_IND_DATA, (val)); \ 1099 + RADEON_WRITE(R520_MC_IND_INDEX, 0); \ 1100 + } while (0) 1101 1102 + #define RS480_WRITE_MCIND(addr, val) \ 1103 + do { \ 1104 + RADEON_WRITE(RS480_NB_MC_INDEX, \ 1105 + ((addr) & 0xff) | RS480_NB_MC_IND_WR_EN); \ 1106 + RADEON_WRITE(RS480_NB_MC_DATA, (val)); \ 1107 + RADEON_WRITE(RS480_NB_MC_INDEX, 0xff); \ 1108 + } while (0) 1109 + 1110 + #define RS690_WRITE_MCIND(addr, val) \ 1111 do { \ 1112 RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_EN | ((addr) & RS690_MC_INDEX_MASK)); \ 1113 RADEON_WRITE(RS690_MC_DATA, val); \ 1114 RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK); \ 1115 + } while (0) 1116 + 1117 + #define IGP_WRITE_MCIND(addr, val) \ 1118 + do { \ 1119 + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) \ 1120 + RS690_WRITE_MCIND(addr, val); \ 1121 + else \ 1122 + RS480_WRITE_MCIND(addr, val); \ 1123 } while (0) 1124 1125 #define CP_PACKET0( reg, n ) \ ··· 1154 } while (0) 1155 1156 #define RADEON_FLUSH_CACHE() do { \ 1157 + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \ 1158 + OUT_RING(CP_PACKET0(RADEON_RB3D_DSTCACHE_CTLSTAT, 0)); \ 1159 + OUT_RING(RADEON_RB3D_DC_FLUSH); \ 1160 + } else { \ 1161 + OUT_RING(CP_PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); \ 1162 + OUT_RING(RADEON_RB3D_DC_FLUSH); \ 1163 + } \ 1164 } while (0) 1165 1166 #define RADEON_PURGE_CACHE() do { \ 1167 + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \ 1168 + OUT_RING(CP_PACKET0(RADEON_RB3D_DSTCACHE_CTLSTAT, 0)); \ 1169 + OUT_RING(RADEON_RB3D_DC_FLUSH_ALL); \ 1170 + } else { \ 1171 + OUT_RING(CP_PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); \ 1172 + OUT_RING(RADEON_RB3D_DC_FLUSH_ALL); \ 1173 + } \ 1174 } while (0) 1175 1176 #define RADEON_FLUSH_ZCACHE() do { \ 1177 + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \ 1178 + OUT_RING(CP_PACKET0(RADEON_RB3D_ZCACHE_CTLSTAT, 0)); \ 1179 + OUT_RING(RADEON_RB3D_ZC_FLUSH); \ 1180 + } else { \ 1181 + OUT_RING(CP_PACKET0(R300_ZB_ZCACHE_CTLSTAT, 0)); \ 1182 + OUT_RING(R300_ZC_FLUSH); \ 1183 + } \ 1184 } while (0) 1185 1186 #define RADEON_PURGE_ZCACHE() do { \ 1187 + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \ 1188 + OUT_RING(CP_PACKET0(RADEON_RB3D_ZCACHE_CTLSTAT, 0)); \ 1189 + OUT_RING(RADEON_RB3D_ZC_FLUSH_ALL); \ 1190 + } else { \ 1191 + OUT_RING(CP_PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); \ 1192 + OUT_RING(R300_ZC_FLUSH_ALL); \ 1193 + } \ 1194 } while (0) 1195 1196 /* ================================================================
+1 -1
drivers/char/drm/radeon_irq.c
··· 234 return radeon_wait_irq(dev, irqwait->irq_seq); 235 } 236 237 - static void radeon_enable_interrupt(struct drm_device *dev) 238 { 239 drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; 240
··· 234 return radeon_wait_irq(dev, irqwait->irq_seq); 235 } 236 237 + void radeon_enable_interrupt(struct drm_device *dev) 238 { 239 drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; 240
+1844
drivers/char/drm/radeon_microcode.h
···
··· 1 + /* 2 + * Copyright 2007 Advanced Micro Devices, Inc. 3 + * All Rights Reserved. 4 + * 5 + * Permission is hereby granted, free of charge, to any person obtaining a 6 + * copy of this software and associated documentation files (the "Software"), 7 + * to deal in the Software without restriction, including without limitation 8 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 + * and/or sell copies of the Software, and to permit persons to whom the 10 + * Software is furnished to do so, subject to the following conditions: 11 + * 12 + * The above copyright notice and this permission notice (including the next 13 + * paragraph) shall be included in all copies or substantial portions of the 14 + * Software. 15 + * 16 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE 20 + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 + * 24 + */ 25 + 26 + #ifndef RADEON_MICROCODE_H 27 + #define RADEON_MICROCODE_H 28 + 29 + /* production radeon ucode r1xx-r6xx */ 30 + static const u32 R100_cp_microcode[][2] = { 31 + { 0x21007000, 0000000000 }, 32 + { 0x20007000, 0000000000 }, 33 + { 0x000000b4, 0x00000004 }, 34 + { 0x000000b8, 0x00000004 }, 35 + { 0x6f5b4d4c, 0000000000 }, 36 + { 0x4c4c427f, 0000000000 }, 37 + { 0x5b568a92, 0000000000 }, 38 + { 0x4ca09c6d, 0000000000 }, 39 + { 0xad4c4c4c, 0000000000 }, 40 + { 0x4ce1af3d, 0000000000 }, 41 + { 0xd8afafaf, 0000000000 }, 42 + { 0xd64c4cdc, 0000000000 }, 43 + { 0x4cd10d10, 0000000000 }, 44 + { 0x000f0000, 0x00000016 }, 45 + { 0x362f242d, 0000000000 }, 46 + { 0x00000012, 0x00000004 }, 47 + { 0x000f0000, 0x00000016 }, 48 + { 0x362f282d, 0000000000 }, 49 + { 0x000380e7, 0x00000002 }, 50 + { 0x04002c97, 0x00000002 }, 51 + { 0x000f0001, 0x00000016 }, 52 + { 0x333a3730, 0000000000 }, 53 + { 0x000077ef, 0x00000002 }, 54 + { 0x00061000, 0x00000002 }, 55 + { 0x00000021, 0x0000001a }, 56 + { 0x00004000, 0x0000001e }, 57 + { 0x00061000, 0x00000002 }, 58 + { 0x00000021, 0x0000001a }, 59 + { 0x00004000, 0x0000001e }, 60 + { 0x00061000, 0x00000002 }, 61 + { 0x00000021, 0x0000001a }, 62 + { 0x00004000, 0x0000001e }, 63 + { 0x00000017, 0x00000004 }, 64 + { 0x0003802b, 0x00000002 }, 65 + { 0x040067e0, 0x00000002 }, 66 + { 0x00000017, 0x00000004 }, 67 + { 0x000077e0, 0x00000002 }, 68 + { 0x00065000, 0x00000002 }, 69 + { 0x000037e1, 0x00000002 }, 70 + { 0x040067e1, 0x00000006 }, 71 + { 0x000077e0, 0x00000002 }, 72 + { 0x000077e1, 0x00000002 }, 73 + { 0x000077e1, 0x00000006 }, 74 + { 0xffffffff, 0000000000 }, 75 + { 0x10000000, 0000000000 }, 76 + { 0x0003802b, 0x00000002 }, 77 + { 0x040067e0, 0x00000006 }, 78 + { 0x00007675, 0x00000002 }, 79 + { 0x00007676, 0x00000002 }, 80 + { 0x00007677, 0x00000002 }, 81 + { 0x00007678, 0x00000006 }, 82 + { 0x0003802c, 0x00000002 }, 83 + { 0x04002676, 0x00000002 }, 84 + { 0x00007677, 0x00000002 }, 85 + { 0x00007678, 0x00000006 }, 86 + { 0x0000002f, 0x00000018 }, 87 + { 0x0000002f, 0x00000018 }, 88 + { 0000000000, 0x00000006 }, 89 + { 0x00000030, 0x00000018 }, 90 + { 0x00000030, 0x00000018 }, 91 + { 0000000000, 0x00000006 }, 92 + { 0x01605000, 0x00000002 }, 93 + { 0x00065000, 0x00000002 }, 94 + { 0x00098000, 0x00000002 }, 95 + { 0x00061000, 0x00000002 }, 96 + { 0x64c0603e, 0x00000004 }, 97 + { 0x000380e6, 0x00000002 }, 98 + { 0x040025c5, 0x00000002 }, 99 + { 0x00080000, 0x00000016 }, 100 + { 0000000000, 0000000000 }, 101 + { 0x0400251d, 0x00000002 }, 102 + { 0x00007580, 0x00000002 }, 103 + { 0x00067581, 0x00000002 }, 104 + { 0x04002580, 0x00000002 }, 105 + { 0x00067581, 0x00000002 }, 106 + { 0x00000049, 0x00000004 }, 107 + { 0x00005000, 0000000000 }, 108 + { 0x000380e6, 0x00000002 }, 109 + { 0x040025c5, 0x00000002 }, 110 + { 0x00061000, 0x00000002 }, 111 + { 0x0000750e, 0x00000002 }, 112 + { 0x00019000, 0x00000002 }, 113 + { 0x00011055, 0x00000014 }, 114 + { 0x00000055, 0x00000012 }, 115 + { 0x0400250f, 0x00000002 }, 116 + { 0x0000504f, 0x00000004 }, 117 + { 0x000380e6, 0x00000002 }, 118 + { 0x040025c5, 0x00000002 }, 119 + { 0x00007565, 0x00000002 }, 120 + { 0x00007566, 0x00000002 }, 121 + { 0x00000058, 0x00000004 }, 122 + { 0x000380e6, 0x00000002 }, 123 + { 0x040025c5, 0x00000002 }, 124 + { 0x01e655b4, 0x00000002 }, 125 + { 0x4401b0e4, 0x00000002 }, 126 + { 0x01c110e4, 0x00000002 }, 127 + { 0x26667066, 0x00000018 }, 128 + { 0x040c2565, 0x00000002 }, 129 + { 0x00000066, 0x00000018 }, 130 + { 0x04002564, 0x00000002 }, 131 + { 0x00007566, 0x00000002 }, 132 + { 0x0000005d, 0x00000004 }, 133 + { 0x00401069, 0x00000008 }, 134 + { 0x00101000, 0x00000002 }, 135 + { 0x000d80ff, 0x00000002 }, 136 + { 0x0080006c, 0x00000008 }, 137 + { 0x000f9000, 0x00000002 }, 138 + { 0x000e00ff, 0x00000002 }, 139 + { 0000000000, 0x00000006 }, 140 + { 0x0000008f, 0x00000018 }, 141 + { 0x0000005b, 0x00000004 }, 142 + { 0x000380e6, 0x00000002 }, 143 + { 0x040025c5, 0x00000002 }, 144 + { 0x00007576, 0x00000002 }, 145 + { 0x00065000, 0x00000002 }, 146 + { 0x00009000, 0x00000002 }, 147 + { 0x00041000, 0x00000002 }, 148 + { 0x0c00350e, 0x00000002 }, 149 + { 0x00049000, 0x00000002 }, 150 + { 0x00051000, 0x00000002 }, 151 + { 0x01e785f8, 0x00000002 }, 152 + { 0x00200000, 0x00000002 }, 153 + { 0x0060007e, 0x0000000c }, 154 + { 0x00007563, 0x00000002 }, 155 + { 0x006075f0, 0x00000021 }, 156 + { 0x20007073, 0x00000004 }, 157 + { 0x00005073, 0x00000004 }, 158 + { 0x000380e6, 0x00000002 }, 159 + { 0x040025c5, 0x00000002 }, 160 + { 0x00007576, 0x00000002 }, 161 + { 0x00007577, 0x00000002 }, 162 + { 0x0000750e, 0x00000002 }, 163 + { 0x0000750f, 0x00000002 }, 164 + { 0x00a05000, 0x00000002 }, 165 + { 0x00600083, 0x0000000c }, 166 + { 0x006075f0, 0x00000021 }, 167 + { 0x000075f8, 0x00000002 }, 168 + { 0x00000083, 0x00000004 }, 169 + { 0x000a750e, 0x00000002 }, 170 + { 0x000380e6, 0x00000002 }, 171 + { 0x040025c5, 0x00000002 }, 172 + { 0x0020750f, 0x00000002 }, 173 + { 0x00600086, 0x00000004 }, 174 + { 0x00007570, 0x00000002 }, 175 + { 0x00007571, 0x00000002 }, 176 + { 0x00007572, 0x00000006 }, 177 + { 0x000380e6, 0x00000002 }, 178 + { 0x040025c5, 0x00000002 }, 179 + { 0x00005000, 0x00000002 }, 180 + { 0x00a05000, 0x00000002 }, 181 + { 0x00007568, 0x00000002 }, 182 + { 0x00061000, 0x00000002 }, 183 + { 0x00000095, 0x0000000c }, 184 + { 0x00058000, 0x00000002 }, 185 + { 0x0c607562, 0x00000002 }, 186 + { 0x00000097, 0x00000004 }, 187 + { 0x000380e6, 0x00000002 }, 188 + { 0x040025c5, 0x00000002 }, 189 + { 0x00600096, 0x00000004 }, 190 + { 0x400070e5, 0000000000 }, 191 + { 0x000380e6, 0x00000002 }, 192 + { 0x040025c5, 0x00000002 }, 193 + { 0x000380e5, 0x00000002 }, 194 + { 0x000000a8, 0x0000001c }, 195 + { 0x000650aa, 0x00000018 }, 196 + { 0x040025bb, 0x00000002 }, 197 + { 0x000610ab, 0x00000018 }, 198 + { 0x040075bc, 0000000000 }, 199 + { 0x000075bb, 0x00000002 }, 200 + { 0x000075bc, 0000000000 }, 201 + { 0x00090000, 0x00000006 }, 202 + { 0x00090000, 0x00000002 }, 203 + { 0x000d8002, 0x00000006 }, 204 + { 0x00007832, 0x00000002 }, 205 + { 0x00005000, 0x00000002 }, 206 + { 0x000380e7, 0x00000002 }, 207 + { 0x04002c97, 0x00000002 }, 208 + { 0x00007820, 0x00000002 }, 209 + { 0x00007821, 0x00000002 }, 210 + { 0x00007800, 0000000000 }, 211 + { 0x01200000, 0x00000002 }, 212 + { 0x20077000, 0x00000002 }, 213 + { 0x01200000, 0x00000002 }, 214 + { 0x20007000, 0x00000002 }, 215 + { 0x00061000, 0x00000002 }, 216 + { 0x0120751b, 0x00000002 }, 217 + { 0x8040750a, 0x00000002 }, 218 + { 0x8040750b, 0x00000002 }, 219 + { 0x00110000, 0x00000002 }, 220 + { 0x000380e5, 0x00000002 }, 221 + { 0x000000c6, 0x0000001c }, 222 + { 0x000610ab, 0x00000018 }, 223 + { 0x844075bd, 0x00000002 }, 224 + { 0x000610aa, 0x00000018 }, 225 + { 0x840075bb, 0x00000002 }, 226 + { 0x000610ab, 0x00000018 }, 227 + { 0x844075bc, 0x00000002 }, 228 + { 0x000000c9, 0x00000004 }, 229 + { 0x804075bd, 0x00000002 }, 230 + { 0x800075bb, 0x00000002 }, 231 + { 0x804075bc, 0x00000002 }, 232 + { 0x00108000, 0x00000002 }, 233 + { 0x01400000, 0x00000002 }, 234 + { 0x006000cd, 0x0000000c }, 235 + { 0x20c07000, 0x00000020 }, 236 + { 0x000000cf, 0x00000012 }, 237 + { 0x00800000, 0x00000006 }, 238 + { 0x0080751d, 0x00000006 }, 239 + { 0000000000, 0000000000 }, 240 + { 0x0000775c, 0x00000002 }, 241 + { 0x00a05000, 0x00000002 }, 242 + { 0x00661000, 0x00000002 }, 243 + { 0x0460275d, 0x00000020 }, 244 + { 0x00004000, 0000000000 }, 245 + { 0x01e00830, 0x00000002 }, 246 + { 0x21007000, 0000000000 }, 247 + { 0x6464614d, 0000000000 }, 248 + { 0x69687420, 0000000000 }, 249 + { 0x00000073, 0000000000 }, 250 + { 0000000000, 0000000000 }, 251 + { 0x00005000, 0x00000002 }, 252 + { 0x000380d0, 0x00000002 }, 253 + { 0x040025e0, 0x00000002 }, 254 + { 0x000075e1, 0000000000 }, 255 + { 0x00000001, 0000000000 }, 256 + { 0x000380e0, 0x00000002 }, 257 + { 0x04002394, 0x00000002 }, 258 + { 0x00005000, 0000000000 }, 259 + { 0000000000, 0000000000 }, 260 + { 0000000000, 0000000000 }, 261 + { 0x00000008, 0000000000 }, 262 + { 0x00000004, 0000000000 }, 263 + { 0000000000, 0000000000 }, 264 + { 0000000000, 0000000000 }, 265 + { 0000000000, 0000000000 }, 266 + { 0000000000, 0000000000 }, 267 + { 0000000000, 0000000000 }, 268 + { 0000000000, 0000000000 }, 269 + { 0000000000, 0000000000 }, 270 + { 0000000000, 0000000000 }, 271 + { 0000000000, 0000000000 }, 272 + { 0000000000, 0000000000 }, 273 + { 0000000000, 0000000000 }, 274 + { 0000000000, 0000000000 }, 275 + { 0000000000, 0000000000 }, 276 + { 0000000000, 0000000000 }, 277 + { 0000000000, 0000000000 }, 278 + { 0000000000, 0000000000 }, 279 + { 0000000000, 0000000000 }, 280 + { 0000000000, 0000000000 }, 281 + { 0000000000, 0000000000 }, 282 + { 0000000000, 0000000000 }, 283 + { 0000000000, 0000000000 }, 284 + { 0000000000, 0000000000 }, 285 + { 0000000000, 0000000000 }, 286 + { 0000000000, 0000000000 }, 287 + }; 288 + 289 + static const u32 R200_cp_microcode[][2] = { 290 + { 0x21007000, 0000000000 }, 291 + { 0x20007000, 0000000000 }, 292 + { 0x000000bf, 0x00000004 }, 293 + { 0x000000c3, 0x00000004 }, 294 + { 0x7a685e5d, 0000000000 }, 295 + { 0x5d5d5588, 0000000000 }, 296 + { 0x68659197, 0000000000 }, 297 + { 0x5da19f78, 0000000000 }, 298 + { 0x5d5d5d5d, 0000000000 }, 299 + { 0x5dee5d50, 0000000000 }, 300 + { 0xf2acacac, 0000000000 }, 301 + { 0xe75df9e9, 0000000000 }, 302 + { 0xb1dd0e11, 0000000000 }, 303 + { 0xe2afafaf, 0000000000 }, 304 + { 0x000f0000, 0x00000016 }, 305 + { 0x452f232d, 0000000000 }, 306 + { 0x00000013, 0x00000004 }, 307 + { 0x000f0000, 0x00000016 }, 308 + { 0x452f272d, 0000000000 }, 309 + { 0x000f0001, 0x00000016 }, 310 + { 0x3e4d4a37, 0000000000 }, 311 + { 0x000077ef, 0x00000002 }, 312 + { 0x00061000, 0x00000002 }, 313 + { 0x00000020, 0x0000001a }, 314 + { 0x00004000, 0x0000001e }, 315 + { 0x00061000, 0x00000002 }, 316 + { 0x00000020, 0x0000001a }, 317 + { 0x00004000, 0x0000001e }, 318 + { 0x00061000, 0x00000002 }, 319 + { 0x00000020, 0x0000001a }, 320 + { 0x00004000, 0x0000001e }, 321 + { 0x00000016, 0x00000004 }, 322 + { 0x0003802a, 0x00000002 }, 323 + { 0x040067e0, 0x00000002 }, 324 + { 0x00000016, 0x00000004 }, 325 + { 0x000077e0, 0x00000002 }, 326 + { 0x00065000, 0x00000002 }, 327 + { 0x000037e1, 0x00000002 }, 328 + { 0x040067e1, 0x00000006 }, 329 + { 0x000077e0, 0x00000002 }, 330 + { 0x000077e1, 0x00000002 }, 331 + { 0x000077e1, 0x00000006 }, 332 + { 0xffffffff, 0000000000 }, 333 + { 0x10000000, 0000000000 }, 334 + { 0x07f007f0, 0000000000 }, 335 + { 0x0003802a, 0x00000002 }, 336 + { 0x040067e0, 0x00000006 }, 337 + { 0x0003802c, 0x00000002 }, 338 + { 0x04002741, 0x00000002 }, 339 + { 0x04002741, 0x00000002 }, 340 + { 0x04002743, 0x00000002 }, 341 + { 0x00007675, 0x00000002 }, 342 + { 0x00007676, 0x00000002 }, 343 + { 0x00007677, 0x00000002 }, 344 + { 0x00007678, 0x00000006 }, 345 + { 0x0003802c, 0x00000002 }, 346 + { 0x04002741, 0x00000002 }, 347 + { 0x04002741, 0x00000002 }, 348 + { 0x04002743, 0x00000002 }, 349 + { 0x00007676, 0x00000002 }, 350 + { 0x00007677, 0x00000002 }, 351 + { 0x00007678, 0x00000006 }, 352 + { 0x0003802b, 0x00000002 }, 353 + { 0x04002676, 0x00000002 }, 354 + { 0x00007677, 0x00000002 }, 355 + { 0x0003802c, 0x00000002 }, 356 + { 0x04002741, 0x00000002 }, 357 + { 0x04002743, 0x00000002 }, 358 + { 0x00007678, 0x00000006 }, 359 + { 0x0003802c, 0x00000002 }, 360 + { 0x04002741, 0x00000002 }, 361 + { 0x04002741, 0x00000002 }, 362 + { 0x04002743, 0x00000002 }, 363 + { 0x00007678, 0x00000006 }, 364 + { 0x0000002f, 0x00000018 }, 365 + { 0x0000002f, 0x00000018 }, 366 + { 0000000000, 0x00000006 }, 367 + { 0x00000037, 0x00000018 }, 368 + { 0x00000037, 0x00000018 }, 369 + { 0000000000, 0x00000006 }, 370 + { 0x01605000, 0x00000002 }, 371 + { 0x00065000, 0x00000002 }, 372 + { 0x00098000, 0x00000002 }, 373 + { 0x00061000, 0x00000002 }, 374 + { 0x64c06051, 0x00000004 }, 375 + { 0x00080000, 0x00000016 }, 376 + { 0000000000, 0000000000 }, 377 + { 0x0400251d, 0x00000002 }, 378 + { 0x00007580, 0x00000002 }, 379 + { 0x00067581, 0x00000002 }, 380 + { 0x04002580, 0x00000002 }, 381 + { 0x00067581, 0x00000002 }, 382 + { 0x0000005a, 0x00000004 }, 383 + { 0x00005000, 0000000000 }, 384 + { 0x00061000, 0x00000002 }, 385 + { 0x0000750e, 0x00000002 }, 386 + { 0x00019000, 0x00000002 }, 387 + { 0x00011064, 0x00000014 }, 388 + { 0x00000064, 0x00000012 }, 389 + { 0x0400250f, 0x00000002 }, 390 + { 0x0000505e, 0x00000004 }, 391 + { 0x00007565, 0x00000002 }, 392 + { 0x00007566, 0x00000002 }, 393 + { 0x00000065, 0x00000004 }, 394 + { 0x01e655b4, 0x00000002 }, 395 + { 0x4401b0f0, 0x00000002 }, 396 + { 0x01c110f0, 0x00000002 }, 397 + { 0x26667071, 0x00000018 }, 398 + { 0x040c2565, 0x00000002 }, 399 + { 0x00000071, 0x00000018 }, 400 + { 0x04002564, 0x00000002 }, 401 + { 0x00007566, 0x00000002 }, 402 + { 0x00000068, 0x00000004 }, 403 + { 0x00401074, 0x00000008 }, 404 + { 0x00101000, 0x00000002 }, 405 + { 0x000d80ff, 0x00000002 }, 406 + { 0x00800077, 0x00000008 }, 407 + { 0x000f9000, 0x00000002 }, 408 + { 0x000e00ff, 0x00000002 }, 409 + { 0000000000, 0x00000006 }, 410 + { 0x00000094, 0x00000018 }, 411 + { 0x00000068, 0x00000004 }, 412 + { 0x00007576, 0x00000002 }, 413 + { 0x00065000, 0x00000002 }, 414 + { 0x00009000, 0x00000002 }, 415 + { 0x00041000, 0x00000002 }, 416 + { 0x0c00350e, 0x00000002 }, 417 + { 0x00049000, 0x00000002 }, 418 + { 0x00051000, 0x00000002 }, 419 + { 0x01e785f8, 0x00000002 }, 420 + { 0x00200000, 0x00000002 }, 421 + { 0x00600087, 0x0000000c }, 422 + { 0x00007563, 0x00000002 }, 423 + { 0x006075f0, 0x00000021 }, 424 + { 0x2000707c, 0x00000004 }, 425 + { 0x0000507c, 0x00000004 }, 426 + { 0x00007576, 0x00000002 }, 427 + { 0x00007577, 0x00000002 }, 428 + { 0x0000750e, 0x00000002 }, 429 + { 0x0000750f, 0x00000002 }, 430 + { 0x00a05000, 0x00000002 }, 431 + { 0x0060008a, 0x0000000c }, 432 + { 0x006075f0, 0x00000021 }, 433 + { 0x000075f8, 0x00000002 }, 434 + { 0x0000008a, 0x00000004 }, 435 + { 0x000a750e, 0x00000002 }, 436 + { 0x0020750f, 0x00000002 }, 437 + { 0x0060008d, 0x00000004 }, 438 + { 0x00007570, 0x00000002 }, 439 + { 0x00007571, 0x00000002 }, 440 + { 0x00007572, 0x00000006 }, 441 + { 0x00005000, 0x00000002 }, 442 + { 0x00a05000, 0x00000002 }, 443 + { 0x00007568, 0x00000002 }, 444 + { 0x00061000, 0x00000002 }, 445 + { 0x00000098, 0x0000000c }, 446 + { 0x00058000, 0x00000002 }, 447 + { 0x0c607562, 0x00000002 }, 448 + { 0x0000009a, 0x00000004 }, 449 + { 0x00600099, 0x00000004 }, 450 + { 0x400070f1, 0000000000 }, 451 + { 0x000380f1, 0x00000002 }, 452 + { 0x000000a7, 0x0000001c }, 453 + { 0x000650a9, 0x00000018 }, 454 + { 0x040025bb, 0x00000002 }, 455 + { 0x000610aa, 0x00000018 }, 456 + { 0x040075bc, 0000000000 }, 457 + { 0x000075bb, 0x00000002 }, 458 + { 0x000075bc, 0000000000 }, 459 + { 0x00090000, 0x00000006 }, 460 + { 0x00090000, 0x00000002 }, 461 + { 0x000d8002, 0x00000006 }, 462 + { 0x00005000, 0x00000002 }, 463 + { 0x00007821, 0x00000002 }, 464 + { 0x00007800, 0000000000 }, 465 + { 0x00007821, 0x00000002 }, 466 + { 0x00007800, 0000000000 }, 467 + { 0x01665000, 0x00000002 }, 468 + { 0x000a0000, 0x00000002 }, 469 + { 0x000671cc, 0x00000002 }, 470 + { 0x0286f1cd, 0x00000002 }, 471 + { 0x000000b7, 0x00000010 }, 472 + { 0x21007000, 0000000000 }, 473 + { 0x000000be, 0x0000001c }, 474 + { 0x00065000, 0x00000002 }, 475 + { 0x000a0000, 0x00000002 }, 476 + { 0x00061000, 0x00000002 }, 477 + { 0x000b0000, 0x00000002 }, 478 + { 0x38067000, 0x00000002 }, 479 + { 0x000a00ba, 0x00000004 }, 480 + { 0x20007000, 0000000000 }, 481 + { 0x01200000, 0x00000002 }, 482 + { 0x20077000, 0x00000002 }, 483 + { 0x01200000, 0x00000002 }, 484 + { 0x20007000, 0000000000 }, 485 + { 0x00061000, 0x00000002 }, 486 + { 0x0120751b, 0x00000002 }, 487 + { 0x8040750a, 0x00000002 }, 488 + { 0x8040750b, 0x00000002 }, 489 + { 0x00110000, 0x00000002 }, 490 + { 0x000380f1, 0x00000002 }, 491 + { 0x000000d1, 0x0000001c }, 492 + { 0x000610aa, 0x00000018 }, 493 + { 0x844075bd, 0x00000002 }, 494 + { 0x000610a9, 0x00000018 }, 495 + { 0x840075bb, 0x00000002 }, 496 + { 0x000610aa, 0x00000018 }, 497 + { 0x844075bc, 0x00000002 }, 498 + { 0x000000d4, 0x00000004 }, 499 + { 0x804075bd, 0x00000002 }, 500 + { 0x800075bb, 0x00000002 }, 501 + { 0x804075bc, 0x00000002 }, 502 + { 0x00108000, 0x00000002 }, 503 + { 0x01400000, 0x00000002 }, 504 + { 0x006000d8, 0x0000000c }, 505 + { 0x20c07000, 0x00000020 }, 506 + { 0x000000da, 0x00000012 }, 507 + { 0x00800000, 0x00000006 }, 508 + { 0x0080751d, 0x00000006 }, 509 + { 0x000025bb, 0x00000002 }, 510 + { 0x000040d4, 0x00000004 }, 511 + { 0x0000775c, 0x00000002 }, 512 + { 0x00a05000, 0x00000002 }, 513 + { 0x00661000, 0x00000002 }, 514 + { 0x0460275d, 0x00000020 }, 515 + { 0x00004000, 0000000000 }, 516 + { 0x00007999, 0x00000002 }, 517 + { 0x00a05000, 0x00000002 }, 518 + { 0x00661000, 0x00000002 }, 519 + { 0x0460299b, 0x00000020 }, 520 + { 0x00004000, 0000000000 }, 521 + { 0x01e00830, 0x00000002 }, 522 + { 0x21007000, 0000000000 }, 523 + { 0x00005000, 0x00000002 }, 524 + { 0x00038056, 0x00000002 }, 525 + { 0x040025e0, 0x00000002 }, 526 + { 0x000075e1, 0000000000 }, 527 + { 0x00000001, 0000000000 }, 528 + { 0x000380ed, 0x00000002 }, 529 + { 0x04007394, 0000000000 }, 530 + { 0000000000, 0000000000 }, 531 + { 0000000000, 0000000000 }, 532 + { 0x000078c4, 0x00000002 }, 533 + { 0x000078c5, 0x00000002 }, 534 + { 0x000078c6, 0x00000002 }, 535 + { 0x00007924, 0x00000002 }, 536 + { 0x00007925, 0x00000002 }, 537 + { 0x00007926, 0x00000002 }, 538 + { 0x000000f2, 0x00000004 }, 539 + { 0x00007924, 0x00000002 }, 540 + { 0x00007925, 0x00000002 }, 541 + { 0x00007926, 0x00000002 }, 542 + { 0x000000f9, 0x00000004 }, 543 + { 0000000000, 0000000000 }, 544 + { 0000000000, 0000000000 }, 545 + { 0000000000, 0000000000 }, 546 + }; 547 + 548 + static const u32 R300_cp_microcode[][2] = { 549 + { 0x4200e000, 0000000000 }, 550 + { 0x4000e000, 0000000000 }, 551 + { 0x000000ae, 0x00000008 }, 552 + { 0x000000b2, 0x00000008 }, 553 + { 0x67554b4a, 0000000000 }, 554 + { 0x4a4a4475, 0000000000 }, 555 + { 0x55527d83, 0000000000 }, 556 + { 0x4a8c8b65, 0000000000 }, 557 + { 0x4aef4af6, 0000000000 }, 558 + { 0x4ae14a4a, 0000000000 }, 559 + { 0xe4979797, 0000000000 }, 560 + { 0xdb4aebdd, 0000000000 }, 561 + { 0x9ccc4a4a, 0000000000 }, 562 + { 0xd1989898, 0000000000 }, 563 + { 0x4a0f9ad6, 0000000000 }, 564 + { 0x000ca000, 0x00000004 }, 565 + { 0x000d0012, 0x00000038 }, 566 + { 0x0000e8b4, 0x00000004 }, 567 + { 0x000d0014, 0x00000038 }, 568 + { 0x0000e8b6, 0x00000004 }, 569 + { 0x000d0016, 0x00000038 }, 570 + { 0x0000e854, 0x00000004 }, 571 + { 0x000d0018, 0x00000038 }, 572 + { 0x0000e855, 0x00000004 }, 573 + { 0x000d001a, 0x00000038 }, 574 + { 0x0000e856, 0x00000004 }, 575 + { 0x000d001c, 0x00000038 }, 576 + { 0x0000e857, 0x00000004 }, 577 + { 0x000d001e, 0x00000038 }, 578 + { 0x0000e824, 0x00000004 }, 579 + { 0x000d0020, 0x00000038 }, 580 + { 0x0000e825, 0x00000004 }, 581 + { 0x000d0022, 0x00000038 }, 582 + { 0x0000e830, 0x00000004 }, 583 + { 0x000d0024, 0x00000038 }, 584 + { 0x0000f0c0, 0x00000004 }, 585 + { 0x000d0026, 0x00000038 }, 586 + { 0x0000f0c1, 0x00000004 }, 587 + { 0x000d0028, 0x00000038 }, 588 + { 0x0000f041, 0x00000004 }, 589 + { 0x000d002a, 0x00000038 }, 590 + { 0x0000f184, 0x00000004 }, 591 + { 0x000d002c, 0x00000038 }, 592 + { 0x0000f185, 0x00000004 }, 593 + { 0x000d002e, 0x00000038 }, 594 + { 0x0000f186, 0x00000004 }, 595 + { 0x000d0030, 0x00000038 }, 596 + { 0x0000f187, 0x00000004 }, 597 + { 0x000d0032, 0x00000038 }, 598 + { 0x0000f180, 0x00000004 }, 599 + { 0x000d0034, 0x00000038 }, 600 + { 0x0000f393, 0x00000004 }, 601 + { 0x000d0036, 0x00000038 }, 602 + { 0x0000f38a, 0x00000004 }, 603 + { 0x000d0038, 0x00000038 }, 604 + { 0x0000f38e, 0x00000004 }, 605 + { 0x0000e821, 0x00000004 }, 606 + { 0x0140a000, 0x00000004 }, 607 + { 0x00000043, 0x00000018 }, 608 + { 0x00cce800, 0x00000004 }, 609 + { 0x001b0001, 0x00000004 }, 610 + { 0x08004800, 0x00000004 }, 611 + { 0x001b0001, 0x00000004 }, 612 + { 0x08004800, 0x00000004 }, 613 + { 0x001b0001, 0x00000004 }, 614 + { 0x08004800, 0x00000004 }, 615 + { 0x0000003a, 0x00000008 }, 616 + { 0x0000a000, 0000000000 }, 617 + { 0x2000451d, 0x00000004 }, 618 + { 0x0000e580, 0x00000004 }, 619 + { 0x000ce581, 0x00000004 }, 620 + { 0x08004580, 0x00000004 }, 621 + { 0x000ce581, 0x00000004 }, 622 + { 0x00000047, 0x00000008 }, 623 + { 0x0000a000, 0000000000 }, 624 + { 0x000c2000, 0x00000004 }, 625 + { 0x0000e50e, 0x00000004 }, 626 + { 0x00032000, 0x00000004 }, 627 + { 0x00022051, 0x00000028 }, 628 + { 0x00000051, 0x00000024 }, 629 + { 0x0800450f, 0x00000004 }, 630 + { 0x0000a04b, 0x00000008 }, 631 + { 0x0000e565, 0x00000004 }, 632 + { 0x0000e566, 0x00000004 }, 633 + { 0x00000052, 0x00000008 }, 634 + { 0x03cca5b4, 0x00000004 }, 635 + { 0x05432000, 0x00000004 }, 636 + { 0x00022000, 0x00000004 }, 637 + { 0x4ccce05e, 0x00000030 }, 638 + { 0x08274565, 0x00000004 }, 639 + { 0x0000005e, 0x00000030 }, 640 + { 0x08004564, 0x00000004 }, 641 + { 0x0000e566, 0x00000004 }, 642 + { 0x00000055, 0x00000008 }, 643 + { 0x00802061, 0x00000010 }, 644 + { 0x00202000, 0x00000004 }, 645 + { 0x001b00ff, 0x00000004 }, 646 + { 0x01000064, 0x00000010 }, 647 + { 0x001f2000, 0x00000004 }, 648 + { 0x001c00ff, 0x00000004 }, 649 + { 0000000000, 0x0000000c }, 650 + { 0x00000080, 0x00000030 }, 651 + { 0x00000055, 0x00000008 }, 652 + { 0x0000e576, 0x00000004 }, 653 + { 0x000ca000, 0x00000004 }, 654 + { 0x00012000, 0x00000004 }, 655 + { 0x00082000, 0x00000004 }, 656 + { 0x1800650e, 0x00000004 }, 657 + { 0x00092000, 0x00000004 }, 658 + { 0x000a2000, 0x00000004 }, 659 + { 0x000f0000, 0x00000004 }, 660 + { 0x00400000, 0x00000004 }, 661 + { 0x00000074, 0x00000018 }, 662 + { 0x0000e563, 0x00000004 }, 663 + { 0x00c0e5f9, 0x000000c2 }, 664 + { 0x00000069, 0x00000008 }, 665 + { 0x0000a069, 0x00000008 }, 666 + { 0x0000e576, 0x00000004 }, 667 + { 0x0000e577, 0x00000004 }, 668 + { 0x0000e50e, 0x00000004 }, 669 + { 0x0000e50f, 0x00000004 }, 670 + { 0x0140a000, 0x00000004 }, 671 + { 0x00000077, 0x00000018 }, 672 + { 0x00c0e5f9, 0x000000c2 }, 673 + { 0x00000077, 0x00000008 }, 674 + { 0x0014e50e, 0x00000004 }, 675 + { 0x0040e50f, 0x00000004 }, 676 + { 0x00c0007a, 0x00000008 }, 677 + { 0x0000e570, 0x00000004 }, 678 + { 0x0000e571, 0x00000004 }, 679 + { 0x0000e572, 0x0000000c }, 680 + { 0x0000a000, 0x00000004 }, 681 + { 0x0140a000, 0x00000004 }, 682 + { 0x0000e568, 0x00000004 }, 683 + { 0x000c2000, 0x00000004 }, 684 + { 0x00000084, 0x00000018 }, 685 + { 0x000b0000, 0x00000004 }, 686 + { 0x18c0e562, 0x00000004 }, 687 + { 0x00000086, 0x00000008 }, 688 + { 0x00c00085, 0x00000008 }, 689 + { 0x000700e3, 0x00000004 }, 690 + { 0x00000092, 0x00000038 }, 691 + { 0x000ca094, 0x00000030 }, 692 + { 0x080045bb, 0x00000004 }, 693 + { 0x000c2095, 0x00000030 }, 694 + { 0x0800e5bc, 0000000000 }, 695 + { 0x0000e5bb, 0x00000004 }, 696 + { 0x0000e5bc, 0000000000 }, 697 + { 0x00120000, 0x0000000c }, 698 + { 0x00120000, 0x00000004 }, 699 + { 0x001b0002, 0x0000000c }, 700 + { 0x0000a000, 0x00000004 }, 701 + { 0x0000e821, 0x00000004 }, 702 + { 0x0000e800, 0000000000 }, 703 + { 0x0000e821, 0x00000004 }, 704 + { 0x0000e82e, 0000000000 }, 705 + { 0x02cca000, 0x00000004 }, 706 + { 0x00140000, 0x00000004 }, 707 + { 0x000ce1cc, 0x00000004 }, 708 + { 0x050de1cd, 0x00000004 }, 709 + { 0x00400000, 0x00000004 }, 710 + { 0x000000a4, 0x00000018 }, 711 + { 0x00c0a000, 0x00000004 }, 712 + { 0x000000a1, 0x00000008 }, 713 + { 0x000000a6, 0x00000020 }, 714 + { 0x4200e000, 0000000000 }, 715 + { 0x000000ad, 0x00000038 }, 716 + { 0x000ca000, 0x00000004 }, 717 + { 0x00140000, 0x00000004 }, 718 + { 0x000c2000, 0x00000004 }, 719 + { 0x00160000, 0x00000004 }, 720 + { 0x700ce000, 0x00000004 }, 721 + { 0x001400a9, 0x00000008 }, 722 + { 0x4000e000, 0000000000 }, 723 + { 0x02400000, 0x00000004 }, 724 + { 0x400ee000, 0x00000004 }, 725 + { 0x02400000, 0x00000004 }, 726 + { 0x4000e000, 0000000000 }, 727 + { 0x000c2000, 0x00000004 }, 728 + { 0x0240e51b, 0x00000004 }, 729 + { 0x0080e50a, 0x00000005 }, 730 + { 0x0080e50b, 0x00000005 }, 731 + { 0x00220000, 0x00000004 }, 732 + { 0x000700e3, 0x00000004 }, 733 + { 0x000000c0, 0x00000038 }, 734 + { 0x000c2095, 0x00000030 }, 735 + { 0x0880e5bd, 0x00000005 }, 736 + { 0x000c2094, 0x00000030 }, 737 + { 0x0800e5bb, 0x00000005 }, 738 + { 0x000c2095, 0x00000030 }, 739 + { 0x0880e5bc, 0x00000005 }, 740 + { 0x000000c3, 0x00000008 }, 741 + { 0x0080e5bd, 0x00000005 }, 742 + { 0x0000e5bb, 0x00000005 }, 743 + { 0x0080e5bc, 0x00000005 }, 744 + { 0x00210000, 0x00000004 }, 745 + { 0x02800000, 0x00000004 }, 746 + { 0x00c000c7, 0x00000018 }, 747 + { 0x4180e000, 0x00000040 }, 748 + { 0x000000c9, 0x00000024 }, 749 + { 0x01000000, 0x0000000c }, 750 + { 0x0100e51d, 0x0000000c }, 751 + { 0x000045bb, 0x00000004 }, 752 + { 0x000080c3, 0x00000008 }, 753 + { 0x0000f3ce, 0x00000004 }, 754 + { 0x0140a000, 0x00000004 }, 755 + { 0x00cc2000, 0x00000004 }, 756 + { 0x08c053cf, 0x00000040 }, 757 + { 0x00008000, 0000000000 }, 758 + { 0x0000f3d2, 0x00000004 }, 759 + { 0x0140a000, 0x00000004 }, 760 + { 0x00cc2000, 0x00000004 }, 761 + { 0x08c053d3, 0x00000040 }, 762 + { 0x00008000, 0000000000 }, 763 + { 0x0000f39d, 0x00000004 }, 764 + { 0x0140a000, 0x00000004 }, 765 + { 0x00cc2000, 0x00000004 }, 766 + { 0x08c0539e, 0x00000040 }, 767 + { 0x00008000, 0000000000 }, 768 + { 0x03c00830, 0x00000004 }, 769 + { 0x4200e000, 0000000000 }, 770 + { 0x0000a000, 0x00000004 }, 771 + { 0x200045e0, 0x00000004 }, 772 + { 0x0000e5e1, 0000000000 }, 773 + { 0x00000001, 0000000000 }, 774 + { 0x000700e0, 0x00000004 }, 775 + { 0x0800e394, 0000000000 }, 776 + { 0000000000, 0000000000 }, 777 + { 0x0000e8c4, 0x00000004 }, 778 + { 0x0000e8c5, 0x00000004 }, 779 + { 0x0000e8c6, 0x00000004 }, 780 + { 0x0000e928, 0x00000004 }, 781 + { 0x0000e929, 0x00000004 }, 782 + { 0x0000e92a, 0x00000004 }, 783 + { 0x000000e4, 0x00000008 }, 784 + { 0x0000e928, 0x00000004 }, 785 + { 0x0000e929, 0x00000004 }, 786 + { 0x0000e92a, 0x00000004 }, 787 + { 0x000000eb, 0x00000008 }, 788 + { 0x02c02000, 0x00000004 }, 789 + { 0x00060000, 0x00000004 }, 790 + { 0x000000f3, 0x00000034 }, 791 + { 0x000000f0, 0x00000008 }, 792 + { 0x00008000, 0x00000004 }, 793 + { 0xc000e000, 0000000000 }, 794 + { 0000000000, 0000000000 }, 795 + { 0x000c2000, 0x00000004 }, 796 + { 0x001d0018, 0x00000004 }, 797 + { 0x001a0001, 0x00000004 }, 798 + { 0x000000fb, 0x00000034 }, 799 + { 0x0000004a, 0x00000008 }, 800 + { 0x0500a04a, 0x00000008 }, 801 + { 0000000000, 0000000000 }, 802 + { 0000000000, 0000000000 }, 803 + { 0000000000, 0000000000 }, 804 + { 0000000000, 0000000000 }, 805 + }; 806 + 807 + static const u32 R420_cp_microcode[][2] = { 808 + { 0x4200e000, 0000000000 }, 809 + { 0x4000e000, 0000000000 }, 810 + { 0x00000099, 0x00000008 }, 811 + { 0x0000009d, 0x00000008 }, 812 + { 0x4a554b4a, 0000000000 }, 813 + { 0x4a4a4467, 0000000000 }, 814 + { 0x55526f75, 0000000000 }, 815 + { 0x4a7e7d65, 0000000000 }, 816 + { 0xd9d3dff6, 0000000000 }, 817 + { 0x4ac54a4a, 0000000000 }, 818 + { 0xc8828282, 0000000000 }, 819 + { 0xbf4acfc1, 0000000000 }, 820 + { 0x87b04a4a, 0000000000 }, 821 + { 0xb5838383, 0000000000 }, 822 + { 0x4a0f85ba, 0000000000 }, 823 + { 0x000ca000, 0x00000004 }, 824 + { 0x000d0012, 0x00000038 }, 825 + { 0x0000e8b4, 0x00000004 }, 826 + { 0x000d0014, 0x00000038 }, 827 + { 0x0000e8b6, 0x00000004 }, 828 + { 0x000d0016, 0x00000038 }, 829 + { 0x0000e854, 0x00000004 }, 830 + { 0x000d0018, 0x00000038 }, 831 + { 0x0000e855, 0x00000004 }, 832 + { 0x000d001a, 0x00000038 }, 833 + { 0x0000e856, 0x00000004 }, 834 + { 0x000d001c, 0x00000038 }, 835 + { 0x0000e857, 0x00000004 }, 836 + { 0x000d001e, 0x00000038 }, 837 + { 0x0000e824, 0x00000004 }, 838 + { 0x000d0020, 0x00000038 }, 839 + { 0x0000e825, 0x00000004 }, 840 + { 0x000d0022, 0x00000038 }, 841 + { 0x0000e830, 0x00000004 }, 842 + { 0x000d0024, 0x00000038 }, 843 + { 0x0000f0c0, 0x00000004 }, 844 + { 0x000d0026, 0x00000038 }, 845 + { 0x0000f0c1, 0x00000004 }, 846 + { 0x000d0028, 0x00000038 }, 847 + { 0x0000f041, 0x00000004 }, 848 + { 0x000d002a, 0x00000038 }, 849 + { 0x0000f184, 0x00000004 }, 850 + { 0x000d002c, 0x00000038 }, 851 + { 0x0000f185, 0x00000004 }, 852 + { 0x000d002e, 0x00000038 }, 853 + { 0x0000f186, 0x00000004 }, 854 + { 0x000d0030, 0x00000038 }, 855 + { 0x0000f187, 0x00000004 }, 856 + { 0x000d0032, 0x00000038 }, 857 + { 0x0000f180, 0x00000004 }, 858 + { 0x000d0034, 0x00000038 }, 859 + { 0x0000f393, 0x00000004 }, 860 + { 0x000d0036, 0x00000038 }, 861 + { 0x0000f38a, 0x00000004 }, 862 + { 0x000d0038, 0x00000038 }, 863 + { 0x0000f38e, 0x00000004 }, 864 + { 0x0000e821, 0x00000004 }, 865 + { 0x0140a000, 0x00000004 }, 866 + { 0x00000043, 0x00000018 }, 867 + { 0x00cce800, 0x00000004 }, 868 + { 0x001b0001, 0x00000004 }, 869 + { 0x08004800, 0x00000004 }, 870 + { 0x001b0001, 0x00000004 }, 871 + { 0x08004800, 0x00000004 }, 872 + { 0x001b0001, 0x00000004 }, 873 + { 0x08004800, 0x00000004 }, 874 + { 0x0000003a, 0x00000008 }, 875 + { 0x0000a000, 0000000000 }, 876 + { 0x2000451d, 0x00000004 }, 877 + { 0x0000e580, 0x00000004 }, 878 + { 0x000ce581, 0x00000004 }, 879 + { 0x08004580, 0x00000004 }, 880 + { 0x000ce581, 0x00000004 }, 881 + { 0x00000047, 0x00000008 }, 882 + { 0x0000a000, 0000000000 }, 883 + { 0x000c2000, 0x00000004 }, 884 + { 0x0000e50e, 0x00000004 }, 885 + { 0x00032000, 0x00000004 }, 886 + { 0x00022051, 0x00000028 }, 887 + { 0x00000051, 0x00000024 }, 888 + { 0x0800450f, 0x00000004 }, 889 + { 0x0000a04b, 0x00000008 }, 890 + { 0x0000e565, 0x00000004 }, 891 + { 0x0000e566, 0x00000004 }, 892 + { 0x00000052, 0x00000008 }, 893 + { 0x03cca5b4, 0x00000004 }, 894 + { 0x05432000, 0x00000004 }, 895 + { 0x00022000, 0x00000004 }, 896 + { 0x4ccce05e, 0x00000030 }, 897 + { 0x08274565, 0x00000004 }, 898 + { 0x0000005e, 0x00000030 }, 899 + { 0x08004564, 0x00000004 }, 900 + { 0x0000e566, 0x00000004 }, 901 + { 0x00000055, 0x00000008 }, 902 + { 0x00802061, 0x00000010 }, 903 + { 0x00202000, 0x00000004 }, 904 + { 0x001b00ff, 0x00000004 }, 905 + { 0x01000064, 0x00000010 }, 906 + { 0x001f2000, 0x00000004 }, 907 + { 0x001c00ff, 0x00000004 }, 908 + { 0000000000, 0x0000000c }, 909 + { 0x00000072, 0x00000030 }, 910 + { 0x00000055, 0x00000008 }, 911 + { 0x0000e576, 0x00000004 }, 912 + { 0x0000e577, 0x00000004 }, 913 + { 0x0000e50e, 0x00000004 }, 914 + { 0x0000e50f, 0x00000004 }, 915 + { 0x0140a000, 0x00000004 }, 916 + { 0x00000069, 0x00000018 }, 917 + { 0x00c0e5f9, 0x000000c2 }, 918 + { 0x00000069, 0x00000008 }, 919 + { 0x0014e50e, 0x00000004 }, 920 + { 0x0040e50f, 0x00000004 }, 921 + { 0x00c0006c, 0x00000008 }, 922 + { 0x0000e570, 0x00000004 }, 923 + { 0x0000e571, 0x00000004 }, 924 + { 0x0000e572, 0x0000000c }, 925 + { 0x0000a000, 0x00000004 }, 926 + { 0x0140a000, 0x00000004 }, 927 + { 0x0000e568, 0x00000004 }, 928 + { 0x000c2000, 0x00000004 }, 929 + { 0x00000076, 0x00000018 }, 930 + { 0x000b0000, 0x00000004 }, 931 + { 0x18c0e562, 0x00000004 }, 932 + { 0x00000078, 0x00000008 }, 933 + { 0x00c00077, 0x00000008 }, 934 + { 0x000700c7, 0x00000004 }, 935 + { 0x00000080, 0x00000038 }, 936 + { 0x0000e5bb, 0x00000004 }, 937 + { 0x0000e5bc, 0000000000 }, 938 + { 0x0000a000, 0x00000004 }, 939 + { 0x0000e821, 0x00000004 }, 940 + { 0x0000e800, 0000000000 }, 941 + { 0x0000e821, 0x00000004 }, 942 + { 0x0000e82e, 0000000000 }, 943 + { 0x02cca000, 0x00000004 }, 944 + { 0x00140000, 0x00000004 }, 945 + { 0x000ce1cc, 0x00000004 }, 946 + { 0x050de1cd, 0x00000004 }, 947 + { 0x00400000, 0x00000004 }, 948 + { 0x0000008f, 0x00000018 }, 949 + { 0x00c0a000, 0x00000004 }, 950 + { 0x0000008c, 0x00000008 }, 951 + { 0x00000091, 0x00000020 }, 952 + { 0x4200e000, 0000000000 }, 953 + { 0x00000098, 0x00000038 }, 954 + { 0x000ca000, 0x00000004 }, 955 + { 0x00140000, 0x00000004 }, 956 + { 0x000c2000, 0x00000004 }, 957 + { 0x00160000, 0x00000004 }, 958 + { 0x700ce000, 0x00000004 }, 959 + { 0x00140094, 0x00000008 }, 960 + { 0x4000e000, 0000000000 }, 961 + { 0x02400000, 0x00000004 }, 962 + { 0x400ee000, 0x00000004 }, 963 + { 0x02400000, 0x00000004 }, 964 + { 0x4000e000, 0000000000 }, 965 + { 0x000c2000, 0x00000004 }, 966 + { 0x0240e51b, 0x00000004 }, 967 + { 0x0080e50a, 0x00000005 }, 968 + { 0x0080e50b, 0x00000005 }, 969 + { 0x00220000, 0x00000004 }, 970 + { 0x000700c7, 0x00000004 }, 971 + { 0x000000a4, 0x00000038 }, 972 + { 0x0080e5bd, 0x00000005 }, 973 + { 0x0000e5bb, 0x00000005 }, 974 + { 0x0080e5bc, 0x00000005 }, 975 + { 0x00210000, 0x00000004 }, 976 + { 0x02800000, 0x00000004 }, 977 + { 0x00c000ab, 0x00000018 }, 978 + { 0x4180e000, 0x00000040 }, 979 + { 0x000000ad, 0x00000024 }, 980 + { 0x01000000, 0x0000000c }, 981 + { 0x0100e51d, 0x0000000c }, 982 + { 0x000045bb, 0x00000004 }, 983 + { 0x000080a7, 0x00000008 }, 984 + { 0x0000f3ce, 0x00000004 }, 985 + { 0x0140a000, 0x00000004 }, 986 + { 0x00cc2000, 0x00000004 }, 987 + { 0x08c053cf, 0x00000040 }, 988 + { 0x00008000, 0000000000 }, 989 + { 0x0000f3d2, 0x00000004 }, 990 + { 0x0140a000, 0x00000004 }, 991 + { 0x00cc2000, 0x00000004 }, 992 + { 0x08c053d3, 0x00000040 }, 993 + { 0x00008000, 0000000000 }, 994 + { 0x0000f39d, 0x00000004 }, 995 + { 0x0140a000, 0x00000004 }, 996 + { 0x00cc2000, 0x00000004 }, 997 + { 0x08c0539e, 0x00000040 }, 998 + { 0x00008000, 0000000000 }, 999 + { 0x03c00830, 0x00000004 }, 1000 + { 0x4200e000, 0000000000 }, 1001 + { 0x0000a000, 0x00000004 }, 1002 + { 0x200045e0, 0x00000004 }, 1003 + { 0x0000e5e1, 0000000000 }, 1004 + { 0x00000001, 0000000000 }, 1005 + { 0x000700c4, 0x00000004 }, 1006 + { 0x0800e394, 0000000000 }, 1007 + { 0000000000, 0000000000 }, 1008 + { 0x0000e8c4, 0x00000004 }, 1009 + { 0x0000e8c5, 0x00000004 }, 1010 + { 0x0000e8c6, 0x00000004 }, 1011 + { 0x0000e928, 0x00000004 }, 1012 + { 0x0000e929, 0x00000004 }, 1013 + { 0x0000e92a, 0x00000004 }, 1014 + { 0x000000c8, 0x00000008 }, 1015 + { 0x0000e928, 0x00000004 }, 1016 + { 0x0000e929, 0x00000004 }, 1017 + { 0x0000e92a, 0x00000004 }, 1018 + { 0x000000cf, 0x00000008 }, 1019 + { 0x02c02000, 0x00000004 }, 1020 + { 0x00060000, 0x00000004 }, 1021 + { 0x000000d7, 0x00000034 }, 1022 + { 0x000000d4, 0x00000008 }, 1023 + { 0x00008000, 0x00000004 }, 1024 + { 0xc000e000, 0000000000 }, 1025 + { 0x0000e1cc, 0x00000004 }, 1026 + { 0x0500e1cd, 0x00000004 }, 1027 + { 0x000ca000, 0x00000004 }, 1028 + { 0x000000de, 0x00000034 }, 1029 + { 0x000000da, 0x00000008 }, 1030 + { 0x0000a000, 0000000000 }, 1031 + { 0x0019e1cc, 0x00000004 }, 1032 + { 0x001b0001, 0x00000004 }, 1033 + { 0x0500a000, 0x00000004 }, 1034 + { 0x080041cd, 0x00000004 }, 1035 + { 0x000ca000, 0x00000004 }, 1036 + { 0x000000fb, 0x00000034 }, 1037 + { 0x0000004a, 0x00000008 }, 1038 + { 0000000000, 0000000000 }, 1039 + { 0000000000, 0000000000 }, 1040 + { 0000000000, 0000000000 }, 1041 + { 0000000000, 0000000000 }, 1042 + { 0000000000, 0000000000 }, 1043 + { 0000000000, 0000000000 }, 1044 + { 0000000000, 0000000000 }, 1045 + { 0000000000, 0000000000 }, 1046 + { 0000000000, 0000000000 }, 1047 + { 0000000000, 0000000000 }, 1048 + { 0000000000, 0000000000 }, 1049 + { 0000000000, 0000000000 }, 1050 + { 0000000000, 0000000000 }, 1051 + { 0000000000, 0000000000 }, 1052 + { 0000000000, 0000000000 }, 1053 + { 0000000000, 0000000000 }, 1054 + { 0x000c2000, 0x00000004 }, 1055 + { 0x001d0018, 0x00000004 }, 1056 + { 0x001a0001, 0x00000004 }, 1057 + { 0x000000fb, 0x00000034 }, 1058 + { 0x0000004a, 0x00000008 }, 1059 + { 0x0500a04a, 0x00000008 }, 1060 + { 0000000000, 0000000000 }, 1061 + { 0000000000, 0000000000 }, 1062 + { 0000000000, 0000000000 }, 1063 + { 0000000000, 0000000000 }, 1064 + }; 1065 + 1066 + static const u32 RS600_cp_microcode[][2] = { 1067 + { 0x4200e000, 0000000000 }, 1068 + { 0x4000e000, 0000000000 }, 1069 + { 0x000000a0, 0x00000008 }, 1070 + { 0x000000a4, 0x00000008 }, 1071 + { 0x4a554b4a, 0000000000 }, 1072 + { 0x4a4a4467, 0000000000 }, 1073 + { 0x55526f75, 0000000000 }, 1074 + { 0x4a7e7d65, 0000000000 }, 1075 + { 0x4ae74af6, 0000000000 }, 1076 + { 0x4ad34a4a, 0000000000 }, 1077 + { 0xd6898989, 0000000000 }, 1078 + { 0xcd4addcf, 0000000000 }, 1079 + { 0x8ebe4ae2, 0000000000 }, 1080 + { 0xc38a8a8a, 0000000000 }, 1081 + { 0x4a0f8cc8, 0000000000 }, 1082 + { 0x000ca000, 0x00000004 }, 1083 + { 0x000d0012, 0x00000038 }, 1084 + { 0x0000e8b4, 0x00000004 }, 1085 + { 0x000d0014, 0x00000038 }, 1086 + { 0x0000e8b6, 0x00000004 }, 1087 + { 0x000d0016, 0x00000038 }, 1088 + { 0x0000e854, 0x00000004 }, 1089 + { 0x000d0018, 0x00000038 }, 1090 + { 0x0000e855, 0x00000004 }, 1091 + { 0x000d001a, 0x00000038 }, 1092 + { 0x0000e856, 0x00000004 }, 1093 + { 0x000d001c, 0x00000038 }, 1094 + { 0x0000e857, 0x00000004 }, 1095 + { 0x000d001e, 0x00000038 }, 1096 + { 0x0000e824, 0x00000004 }, 1097 + { 0x000d0020, 0x00000038 }, 1098 + { 0x0000e825, 0x00000004 }, 1099 + { 0x000d0022, 0x00000038 }, 1100 + { 0x0000e830, 0x00000004 }, 1101 + { 0x000d0024, 0x00000038 }, 1102 + { 0x0000f0c0, 0x00000004 }, 1103 + { 0x000d0026, 0x00000038 }, 1104 + { 0x0000f0c1, 0x00000004 }, 1105 + { 0x000d0028, 0x00000038 }, 1106 + { 0x0000f041, 0x00000004 }, 1107 + { 0x000d002a, 0x00000038 }, 1108 + { 0x0000f184, 0x00000004 }, 1109 + { 0x000d002c, 0x00000038 }, 1110 + { 0x0000f185, 0x00000004 }, 1111 + { 0x000d002e, 0x00000038 }, 1112 + { 0x0000f186, 0x00000004 }, 1113 + { 0x000d0030, 0x00000038 }, 1114 + { 0x0000f187, 0x00000004 }, 1115 + { 0x000d0032, 0x00000038 }, 1116 + { 0x0000f180, 0x00000004 }, 1117 + { 0x000d0034, 0x00000038 }, 1118 + { 0x0000f393, 0x00000004 }, 1119 + { 0x000d0036, 0x00000038 }, 1120 + { 0x0000f38a, 0x00000004 }, 1121 + { 0x000d0038, 0x00000038 }, 1122 + { 0x0000f38e, 0x00000004 }, 1123 + { 0x0000e821, 0x00000004 }, 1124 + { 0x0140a000, 0x00000004 }, 1125 + { 0x00000043, 0x00000018 }, 1126 + { 0x00cce800, 0x00000004 }, 1127 + { 0x001b0001, 0x00000004 }, 1128 + { 0x08004800, 0x00000004 }, 1129 + { 0x001b0001, 0x00000004 }, 1130 + { 0x08004800, 0x00000004 }, 1131 + { 0x001b0001, 0x00000004 }, 1132 + { 0x08004800, 0x00000004 }, 1133 + { 0x0000003a, 0x00000008 }, 1134 + { 0x0000a000, 0000000000 }, 1135 + { 0x2000451d, 0x00000004 }, 1136 + { 0x0000e580, 0x00000004 }, 1137 + { 0x000ce581, 0x00000004 }, 1138 + { 0x08004580, 0x00000004 }, 1139 + { 0x000ce581, 0x00000004 }, 1140 + { 0x00000047, 0x00000008 }, 1141 + { 0x0000a000, 0000000000 }, 1142 + { 0x000c2000, 0x00000004 }, 1143 + { 0x0000e50e, 0x00000004 }, 1144 + { 0x00032000, 0x00000004 }, 1145 + { 0x00022051, 0x00000028 }, 1146 + { 0x00000051, 0x00000024 }, 1147 + { 0x0800450f, 0x00000004 }, 1148 + { 0x0000a04b, 0x00000008 }, 1149 + { 0x0000e565, 0x00000004 }, 1150 + { 0x0000e566, 0x00000004 }, 1151 + { 0x00000052, 0x00000008 }, 1152 + { 0x03cca5b4, 0x00000004 }, 1153 + { 0x05432000, 0x00000004 }, 1154 + { 0x00022000, 0x00000004 }, 1155 + { 0x4ccce05e, 0x00000030 }, 1156 + { 0x08274565, 0x00000004 }, 1157 + { 0x0000005e, 0x00000030 }, 1158 + { 0x08004564, 0x00000004 }, 1159 + { 0x0000e566, 0x00000004 }, 1160 + { 0x00000055, 0x00000008 }, 1161 + { 0x00802061, 0x00000010 }, 1162 + { 0x00202000, 0x00000004 }, 1163 + { 0x001b00ff, 0x00000004 }, 1164 + { 0x01000064, 0x00000010 }, 1165 + { 0x001f2000, 0x00000004 }, 1166 + { 0x001c00ff, 0x00000004 }, 1167 + { 0000000000, 0x0000000c }, 1168 + { 0x00000072, 0x00000030 }, 1169 + { 0x00000055, 0x00000008 }, 1170 + { 0x0000e576, 0x00000004 }, 1171 + { 0x0000e577, 0x00000004 }, 1172 + { 0x0000e50e, 0x00000004 }, 1173 + { 0x0000e50f, 0x00000004 }, 1174 + { 0x0140a000, 0x00000004 }, 1175 + { 0x00000069, 0x00000018 }, 1176 + { 0x00c0e5f9, 0x000000c2 }, 1177 + { 0x00000069, 0x00000008 }, 1178 + { 0x0014e50e, 0x00000004 }, 1179 + { 0x0040e50f, 0x00000004 }, 1180 + { 0x00c0006c, 0x00000008 }, 1181 + { 0x0000e570, 0x00000004 }, 1182 + { 0x0000e571, 0x00000004 }, 1183 + { 0x0000e572, 0x0000000c }, 1184 + { 0x0000a000, 0x00000004 }, 1185 + { 0x0140a000, 0x00000004 }, 1186 + { 0x0000e568, 0x00000004 }, 1187 + { 0x000c2000, 0x00000004 }, 1188 + { 0x00000076, 0x00000018 }, 1189 + { 0x000b0000, 0x00000004 }, 1190 + { 0x18c0e562, 0x00000004 }, 1191 + { 0x00000078, 0x00000008 }, 1192 + { 0x00c00077, 0x00000008 }, 1193 + { 0x000700d5, 0x00000004 }, 1194 + { 0x00000084, 0x00000038 }, 1195 + { 0x000ca086, 0x00000030 }, 1196 + { 0x080045bb, 0x00000004 }, 1197 + { 0x000c2087, 0x00000030 }, 1198 + { 0x0800e5bc, 0000000000 }, 1199 + { 0x0000e5bb, 0x00000004 }, 1200 + { 0x0000e5bc, 0000000000 }, 1201 + { 0x00120000, 0x0000000c }, 1202 + { 0x00120000, 0x00000004 }, 1203 + { 0x001b0002, 0x0000000c }, 1204 + { 0x0000a000, 0x00000004 }, 1205 + { 0x0000e821, 0x00000004 }, 1206 + { 0x0000e800, 0000000000 }, 1207 + { 0x0000e821, 0x00000004 }, 1208 + { 0x0000e82e, 0000000000 }, 1209 + { 0x02cca000, 0x00000004 }, 1210 + { 0x00140000, 0x00000004 }, 1211 + { 0x000ce1cc, 0x00000004 }, 1212 + { 0x050de1cd, 0x00000004 }, 1213 + { 0x00400000, 0x00000004 }, 1214 + { 0x00000096, 0x00000018 }, 1215 + { 0x00c0a000, 0x00000004 }, 1216 + { 0x00000093, 0x00000008 }, 1217 + { 0x00000098, 0x00000020 }, 1218 + { 0x4200e000, 0000000000 }, 1219 + { 0x0000009f, 0x00000038 }, 1220 + { 0x000ca000, 0x00000004 }, 1221 + { 0x00140000, 0x00000004 }, 1222 + { 0x000c2000, 0x00000004 }, 1223 + { 0x00160000, 0x00000004 }, 1224 + { 0x700ce000, 0x00000004 }, 1225 + { 0x0014009b, 0x00000008 }, 1226 + { 0x4000e000, 0000000000 }, 1227 + { 0x02400000, 0x00000004 }, 1228 + { 0x400ee000, 0x00000004 }, 1229 + { 0x02400000, 0x00000004 }, 1230 + { 0x4000e000, 0000000000 }, 1231 + { 0x000c2000, 0x00000004 }, 1232 + { 0x0240e51b, 0x00000004 }, 1233 + { 0x0080e50a, 0x00000005 }, 1234 + { 0x0080e50b, 0x00000005 }, 1235 + { 0x00220000, 0x00000004 }, 1236 + { 0x000700d5, 0x00000004 }, 1237 + { 0x000000b2, 0x00000038 }, 1238 + { 0x000c2087, 0x00000030 }, 1239 + { 0x0880e5bd, 0x00000005 }, 1240 + { 0x000c2086, 0x00000030 }, 1241 + { 0x0800e5bb, 0x00000005 }, 1242 + { 0x000c2087, 0x00000030 }, 1243 + { 0x0880e5bc, 0x00000005 }, 1244 + { 0x000000b5, 0x00000008 }, 1245 + { 0x0080e5bd, 0x00000005 }, 1246 + { 0x0000e5bb, 0x00000005 }, 1247 + { 0x0080e5bc, 0x00000005 }, 1248 + { 0x00210000, 0x00000004 }, 1249 + { 0x02800000, 0x00000004 }, 1250 + { 0x00c000b9, 0x00000018 }, 1251 + { 0x4180e000, 0x00000040 }, 1252 + { 0x000000bb, 0x00000024 }, 1253 + { 0x01000000, 0x0000000c }, 1254 + { 0x0100e51d, 0x0000000c }, 1255 + { 0x000045bb, 0x00000004 }, 1256 + { 0x000080b5, 0x00000008 }, 1257 + { 0x0000f3ce, 0x00000004 }, 1258 + { 0x0140a000, 0x00000004 }, 1259 + { 0x00cc2000, 0x00000004 }, 1260 + { 0x08c053cf, 0x00000040 }, 1261 + { 0x00008000, 0000000000 }, 1262 + { 0x0000f3d2, 0x00000004 }, 1263 + { 0x0140a000, 0x00000004 }, 1264 + { 0x00cc2000, 0x00000004 }, 1265 + { 0x08c053d3, 0x00000040 }, 1266 + { 0x00008000, 0000000000 }, 1267 + { 0x0000f39d, 0x00000004 }, 1268 + { 0x0140a000, 0x00000004 }, 1269 + { 0x00cc2000, 0x00000004 }, 1270 + { 0x08c0539e, 0x00000040 }, 1271 + { 0x00008000, 0000000000 }, 1272 + { 0x03c00830, 0x00000004 }, 1273 + { 0x4200e000, 0000000000 }, 1274 + { 0x0000a000, 0x00000004 }, 1275 + { 0x200045e0, 0x00000004 }, 1276 + { 0x0000e5e1, 0000000000 }, 1277 + { 0x00000001, 0000000000 }, 1278 + { 0x000700d2, 0x00000004 }, 1279 + { 0x0800e394, 0000000000 }, 1280 + { 0000000000, 0000000000 }, 1281 + { 0x0000e8c4, 0x00000004 }, 1282 + { 0x0000e8c5, 0x00000004 }, 1283 + { 0x0000e8c6, 0x00000004 }, 1284 + { 0x0000e928, 0x00000004 }, 1285 + { 0x0000e929, 0x00000004 }, 1286 + { 0x0000e92a, 0x00000004 }, 1287 + { 0x000000d6, 0x00000008 }, 1288 + { 0x0000e928, 0x00000004 }, 1289 + { 0x0000e929, 0x00000004 }, 1290 + { 0x0000e92a, 0x00000004 }, 1291 + { 0x000000dd, 0x00000008 }, 1292 + { 0x00e00116, 0000000000 }, 1293 + { 0x000700e1, 0x00000004 }, 1294 + { 0x0800401c, 0x00000004 }, 1295 + { 0x200050e7, 0x00000004 }, 1296 + { 0x0000e01d, 0x00000004 }, 1297 + { 0x000000e4, 0x00000008 }, 1298 + { 0x02c02000, 0x00000004 }, 1299 + { 0x00060000, 0x00000004 }, 1300 + { 0x000000eb, 0x00000034 }, 1301 + { 0x000000e8, 0x00000008 }, 1302 + { 0x00008000, 0x00000004 }, 1303 + { 0xc000e000, 0000000000 }, 1304 + { 0000000000, 0000000000 }, 1305 + { 0000000000, 0000000000 }, 1306 + { 0000000000, 0000000000 }, 1307 + { 0000000000, 0000000000 }, 1308 + { 0000000000, 0000000000 }, 1309 + { 0000000000, 0000000000 }, 1310 + { 0000000000, 0000000000 }, 1311 + { 0000000000, 0000000000 }, 1312 + { 0000000000, 0000000000 }, 1313 + { 0x000c2000, 0x00000004 }, 1314 + { 0x001d0018, 0x00000004 }, 1315 + { 0x001a0001, 0x00000004 }, 1316 + { 0x000000fb, 0x00000034 }, 1317 + { 0x0000004a, 0x00000008 }, 1318 + { 0x0500a04a, 0x00000008 }, 1319 + { 0000000000, 0000000000 }, 1320 + { 0000000000, 0000000000 }, 1321 + { 0000000000, 0000000000 }, 1322 + { 0000000000, 0000000000 }, 1323 + }; 1324 + 1325 + static const u32 RS690_cp_microcode[][2] = { 1326 + { 0x000000dd, 0x00000008 }, 1327 + { 0x000000df, 0x00000008 }, 1328 + { 0x000000a0, 0x00000008 }, 1329 + { 0x000000a4, 0x00000008 }, 1330 + { 0x4a554b4a, 0000000000 }, 1331 + { 0x4a4a4467, 0000000000 }, 1332 + { 0x55526f75, 0000000000 }, 1333 + { 0x4a7e7d65, 0000000000 }, 1334 + { 0x4ad74af6, 0000000000 }, 1335 + { 0x4ac94a4a, 0000000000 }, 1336 + { 0xcc898989, 0000000000 }, 1337 + { 0xc34ad3c5, 0000000000 }, 1338 + { 0x8e4a4a4a, 0000000000 }, 1339 + { 0x4a8a8a8a, 0000000000 }, 1340 + { 0x4a0f8c4a, 0000000000 }, 1341 + { 0x000ca000, 0x00000004 }, 1342 + { 0x000d0012, 0x00000038 }, 1343 + { 0x0000e8b4, 0x00000004 }, 1344 + { 0x000d0014, 0x00000038 }, 1345 + { 0x0000e8b6, 0x00000004 }, 1346 + { 0x000d0016, 0x00000038 }, 1347 + { 0x0000e854, 0x00000004 }, 1348 + { 0x000d0018, 0x00000038 }, 1349 + { 0x0000e855, 0x00000004 }, 1350 + { 0x000d001a, 0x00000038 }, 1351 + { 0x0000e856, 0x00000004 }, 1352 + { 0x000d001c, 0x00000038 }, 1353 + { 0x0000e857, 0x00000004 }, 1354 + { 0x000d001e, 0x00000038 }, 1355 + { 0x0000e824, 0x00000004 }, 1356 + { 0x000d0020, 0x00000038 }, 1357 + { 0x0000e825, 0x00000004 }, 1358 + { 0x000d0022, 0x00000038 }, 1359 + { 0x0000e830, 0x00000004 }, 1360 + { 0x000d0024, 0x00000038 }, 1361 + { 0x0000f0c0, 0x00000004 }, 1362 + { 0x000d0026, 0x00000038 }, 1363 + { 0x0000f0c1, 0x00000004 }, 1364 + { 0x000d0028, 0x00000038 }, 1365 + { 0x0000f041, 0x00000004 }, 1366 + { 0x000d002a, 0x00000038 }, 1367 + { 0x0000f184, 0x00000004 }, 1368 + { 0x000d002c, 0x00000038 }, 1369 + { 0x0000f185, 0x00000004 }, 1370 + { 0x000d002e, 0x00000038 }, 1371 + { 0x0000f186, 0x00000004 }, 1372 + { 0x000d0030, 0x00000038 }, 1373 + { 0x0000f187, 0x00000004 }, 1374 + { 0x000d0032, 0x00000038 }, 1375 + { 0x0000f180, 0x00000004 }, 1376 + { 0x000d0034, 0x00000038 }, 1377 + { 0x0000f393, 0x00000004 }, 1378 + { 0x000d0036, 0x00000038 }, 1379 + { 0x0000f38a, 0x00000004 }, 1380 + { 0x000d0038, 0x00000038 }, 1381 + { 0x0000f38e, 0x00000004 }, 1382 + { 0x0000e821, 0x00000004 }, 1383 + { 0x0140a000, 0x00000004 }, 1384 + { 0x00000043, 0x00000018 }, 1385 + { 0x00cce800, 0x00000004 }, 1386 + { 0x001b0001, 0x00000004 }, 1387 + { 0x08004800, 0x00000004 }, 1388 + { 0x001b0001, 0x00000004 }, 1389 + { 0x08004800, 0x00000004 }, 1390 + { 0x001b0001, 0x00000004 }, 1391 + { 0x08004800, 0x00000004 }, 1392 + { 0x0000003a, 0x00000008 }, 1393 + { 0x0000a000, 0000000000 }, 1394 + { 0x2000451d, 0x00000004 }, 1395 + { 0x0000e580, 0x00000004 }, 1396 + { 0x000ce581, 0x00000004 }, 1397 + { 0x08004580, 0x00000004 }, 1398 + { 0x000ce581, 0x00000004 }, 1399 + { 0x00000047, 0x00000008 }, 1400 + { 0x0000a000, 0000000000 }, 1401 + { 0x000c2000, 0x00000004 }, 1402 + { 0x0000e50e, 0x00000004 }, 1403 + { 0x00032000, 0x00000004 }, 1404 + { 0x00022051, 0x00000028 }, 1405 + { 0x00000051, 0x00000024 }, 1406 + { 0x0800450f, 0x00000004 }, 1407 + { 0x0000a04b, 0x00000008 }, 1408 + { 0x0000e565, 0x00000004 }, 1409 + { 0x0000e566, 0x00000004 }, 1410 + { 0x00000052, 0x00000008 }, 1411 + { 0x03cca5b4, 0x00000004 }, 1412 + { 0x05432000, 0x00000004 }, 1413 + { 0x00022000, 0x00000004 }, 1414 + { 0x4ccce05e, 0x00000030 }, 1415 + { 0x08274565, 0x00000004 }, 1416 + { 0x0000005e, 0x00000030 }, 1417 + { 0x08004564, 0x00000004 }, 1418 + { 0x0000e566, 0x00000004 }, 1419 + { 0x00000055, 0x00000008 }, 1420 + { 0x00802061, 0x00000010 }, 1421 + { 0x00202000, 0x00000004 }, 1422 + { 0x001b00ff, 0x00000004 }, 1423 + { 0x01000064, 0x00000010 }, 1424 + { 0x001f2000, 0x00000004 }, 1425 + { 0x001c00ff, 0x00000004 }, 1426 + { 0000000000, 0x0000000c }, 1427 + { 0x00000072, 0x00000030 }, 1428 + { 0x00000055, 0x00000008 }, 1429 + { 0x0000e576, 0x00000004 }, 1430 + { 0x0000e577, 0x00000004 }, 1431 + { 0x0000e50e, 0x00000004 }, 1432 + { 0x0000e50f, 0x00000004 }, 1433 + { 0x0140a000, 0x00000004 }, 1434 + { 0x00000069, 0x00000018 }, 1435 + { 0x00c0e5f9, 0x000000c2 }, 1436 + { 0x00000069, 0x00000008 }, 1437 + { 0x0014e50e, 0x00000004 }, 1438 + { 0x0040e50f, 0x00000004 }, 1439 + { 0x00c0006c, 0x00000008 }, 1440 + { 0x0000e570, 0x00000004 }, 1441 + { 0x0000e571, 0x00000004 }, 1442 + { 0x0000e572, 0x0000000c }, 1443 + { 0x0000a000, 0x00000004 }, 1444 + { 0x0140a000, 0x00000004 }, 1445 + { 0x0000e568, 0x00000004 }, 1446 + { 0x000c2000, 0x00000004 }, 1447 + { 0x00000076, 0x00000018 }, 1448 + { 0x000b0000, 0x00000004 }, 1449 + { 0x18c0e562, 0x00000004 }, 1450 + { 0x00000078, 0x00000008 }, 1451 + { 0x00c00077, 0x00000008 }, 1452 + { 0x000700cb, 0x00000004 }, 1453 + { 0x00000084, 0x00000038 }, 1454 + { 0x000ca086, 0x00000030 }, 1455 + { 0x080045bb, 0x00000004 }, 1456 + { 0x000c2087, 0x00000030 }, 1457 + { 0x0800e5bc, 0000000000 }, 1458 + { 0x0000e5bb, 0x00000004 }, 1459 + { 0x0000e5bc, 0000000000 }, 1460 + { 0x00120000, 0x0000000c }, 1461 + { 0x00120000, 0x00000004 }, 1462 + { 0x001b0002, 0x0000000c }, 1463 + { 0x0000a000, 0x00000004 }, 1464 + { 0x0000e821, 0x00000004 }, 1465 + { 0x0000e800, 0000000000 }, 1466 + { 0x0000e821, 0x00000004 }, 1467 + { 0x0000e82e, 0000000000 }, 1468 + { 0x02cca000, 0x00000004 }, 1469 + { 0x00140000, 0x00000004 }, 1470 + { 0x000ce1cc, 0x00000004 }, 1471 + { 0x050de1cd, 0x00000004 }, 1472 + { 0x00400000, 0x00000004 }, 1473 + { 0x00000096, 0x00000018 }, 1474 + { 0x00c0a000, 0x00000004 }, 1475 + { 0x00000093, 0x00000008 }, 1476 + { 0x00000098, 0x00000020 }, 1477 + { 0x4200e000, 0000000000 }, 1478 + { 0x0000009f, 0x00000038 }, 1479 + { 0x000ca000, 0x00000004 }, 1480 + { 0x00140000, 0x00000004 }, 1481 + { 0x000c2000, 0x00000004 }, 1482 + { 0x00160000, 0x00000004 }, 1483 + { 0x700ce000, 0x00000004 }, 1484 + { 0x0014009b, 0x00000008 }, 1485 + { 0x4000e000, 0000000000 }, 1486 + { 0x02400000, 0x00000004 }, 1487 + { 0x400ee000, 0x00000004 }, 1488 + { 0x02400000, 0x00000004 }, 1489 + { 0x4000e000, 0000000000 }, 1490 + { 0x00100000, 0x0000002c }, 1491 + { 0x00004000, 0000000000 }, 1492 + { 0x080045c8, 0x00000004 }, 1493 + { 0x00240005, 0x00000004 }, 1494 + { 0x08004d0b, 0x00000004 }, 1495 + { 0x000c2000, 0x00000004 }, 1496 + { 0x0240e51b, 0x00000004 }, 1497 + { 0x0080e50a, 0x00000005 }, 1498 + { 0x0080e50b, 0x00000005 }, 1499 + { 0x00220000, 0x00000004 }, 1500 + { 0x000700cb, 0x00000004 }, 1501 + { 0x000000b7, 0x00000038 }, 1502 + { 0x000c2087, 0x00000030 }, 1503 + { 0x0880e5bd, 0x00000005 }, 1504 + { 0x000c2086, 0x00000030 }, 1505 + { 0x0800e5bb, 0x00000005 }, 1506 + { 0x000c2087, 0x00000030 }, 1507 + { 0x0880e5bc, 0x00000005 }, 1508 + { 0x000000ba, 0x00000008 }, 1509 + { 0x0080e5bd, 0x00000005 }, 1510 + { 0x0000e5bb, 0x00000005 }, 1511 + { 0x0080e5bc, 0x00000005 }, 1512 + { 0x00210000, 0x00000004 }, 1513 + { 0x02800000, 0x00000004 }, 1514 + { 0x00c000be, 0x00000018 }, 1515 + { 0x4180e000, 0x00000040 }, 1516 + { 0x000000c0, 0x00000024 }, 1517 + { 0x01000000, 0x0000000c }, 1518 + { 0x0100e51d, 0x0000000c }, 1519 + { 0x000045bb, 0x00000004 }, 1520 + { 0x000080ba, 0x00000008 }, 1521 + { 0x03c00830, 0x00000004 }, 1522 + { 0x4200e000, 0000000000 }, 1523 + { 0x0000a000, 0x00000004 }, 1524 + { 0x200045e0, 0x00000004 }, 1525 + { 0x0000e5e1, 0000000000 }, 1526 + { 0x00000001, 0000000000 }, 1527 + { 0x000700c8, 0x00000004 }, 1528 + { 0x0800e394, 0000000000 }, 1529 + { 0000000000, 0000000000 }, 1530 + { 0x0000e8c4, 0x00000004 }, 1531 + { 0x0000e8c5, 0x00000004 }, 1532 + { 0x0000e8c6, 0x00000004 }, 1533 + { 0x0000e928, 0x00000004 }, 1534 + { 0x0000e929, 0x00000004 }, 1535 + { 0x0000e92a, 0x00000004 }, 1536 + { 0x000000cc, 0x00000008 }, 1537 + { 0x0000e928, 0x00000004 }, 1538 + { 0x0000e929, 0x00000004 }, 1539 + { 0x0000e92a, 0x00000004 }, 1540 + { 0x000000d3, 0x00000008 }, 1541 + { 0x02c02000, 0x00000004 }, 1542 + { 0x00060000, 0x00000004 }, 1543 + { 0x000000db, 0x00000034 }, 1544 + { 0x000000d8, 0x00000008 }, 1545 + { 0x00008000, 0x00000004 }, 1546 + { 0xc000e000, 0000000000 }, 1547 + { 0x000000e1, 0x00000030 }, 1548 + { 0x4200e000, 0000000000 }, 1549 + { 0x000000e1, 0x00000030 }, 1550 + { 0x4000e000, 0000000000 }, 1551 + { 0x0025001b, 0x00000004 }, 1552 + { 0x00230000, 0x00000004 }, 1553 + { 0x00250005, 0x00000004 }, 1554 + { 0x000000e6, 0x00000034 }, 1555 + { 0000000000, 0x0000000c }, 1556 + { 0x00244000, 0x00000004 }, 1557 + { 0x080045c8, 0x00000004 }, 1558 + { 0x00240005, 0x00000004 }, 1559 + { 0x08004d0b, 0x0000000c }, 1560 + { 0000000000, 0000000000 }, 1561 + { 0000000000, 0000000000 }, 1562 + { 0000000000, 0000000000 }, 1563 + { 0000000000, 0000000000 }, 1564 + { 0000000000, 0000000000 }, 1565 + { 0000000000, 0000000000 }, 1566 + { 0000000000, 0000000000 }, 1567 + { 0000000000, 0000000000 }, 1568 + { 0000000000, 0000000000 }, 1569 + { 0000000000, 0000000000 }, 1570 + { 0000000000, 0000000000 }, 1571 + { 0000000000, 0000000000 }, 1572 + { 0x000c2000, 0x00000004 }, 1573 + { 0x001d0018, 0x00000004 }, 1574 + { 0x001a0001, 0x00000004 }, 1575 + { 0x000000fb, 0x00000034 }, 1576 + { 0x0000004a, 0x00000008 }, 1577 + { 0x0500a04a, 0x00000008 }, 1578 + { 0000000000, 0000000000 }, 1579 + { 0000000000, 0000000000 }, 1580 + { 0000000000, 0000000000 }, 1581 + { 0000000000, 0000000000 }, 1582 + }; 1583 + 1584 + static const u32 R520_cp_microcode[][2] = { 1585 + { 0x4200e000, 0000000000 }, 1586 + { 0x4000e000, 0000000000 }, 1587 + { 0x00000099, 0x00000008 }, 1588 + { 0x0000009d, 0x00000008 }, 1589 + { 0x4a554b4a, 0000000000 }, 1590 + { 0x4a4a4467, 0000000000 }, 1591 + { 0x55526f75, 0000000000 }, 1592 + { 0x4a7e7d65, 0000000000 }, 1593 + { 0xe0dae6f6, 0000000000 }, 1594 + { 0x4ac54a4a, 0000000000 }, 1595 + { 0xc8828282, 0000000000 }, 1596 + { 0xbf4acfc1, 0000000000 }, 1597 + { 0x87b04ad5, 0000000000 }, 1598 + { 0xb5838383, 0000000000 }, 1599 + { 0x4a0f85ba, 0000000000 }, 1600 + { 0x000ca000, 0x00000004 }, 1601 + { 0x000d0012, 0x00000038 }, 1602 + { 0x0000e8b4, 0x00000004 }, 1603 + { 0x000d0014, 0x00000038 }, 1604 + { 0x0000e8b6, 0x00000004 }, 1605 + { 0x000d0016, 0x00000038 }, 1606 + { 0x0000e854, 0x00000004 }, 1607 + { 0x000d0018, 0x00000038 }, 1608 + { 0x0000e855, 0x00000004 }, 1609 + { 0x000d001a, 0x00000038 }, 1610 + { 0x0000e856, 0x00000004 }, 1611 + { 0x000d001c, 0x00000038 }, 1612 + { 0x0000e857, 0x00000004 }, 1613 + { 0x000d001e, 0x00000038 }, 1614 + { 0x0000e824, 0x00000004 }, 1615 + { 0x000d0020, 0x00000038 }, 1616 + { 0x0000e825, 0x00000004 }, 1617 + { 0x000d0022, 0x00000038 }, 1618 + { 0x0000e830, 0x00000004 }, 1619 + { 0x000d0024, 0x00000038 }, 1620 + { 0x0000f0c0, 0x00000004 }, 1621 + { 0x000d0026, 0x00000038 }, 1622 + { 0x0000f0c1, 0x00000004 }, 1623 + { 0x000d0028, 0x00000038 }, 1624 + { 0x0000e000, 0x00000004 }, 1625 + { 0x000d002a, 0x00000038 }, 1626 + { 0x0000e000, 0x00000004 }, 1627 + { 0x000d002c, 0x00000038 }, 1628 + { 0x0000e000, 0x00000004 }, 1629 + { 0x000d002e, 0x00000038 }, 1630 + { 0x0000e000, 0x00000004 }, 1631 + { 0x000d0030, 0x00000038 }, 1632 + { 0x0000e000, 0x00000004 }, 1633 + { 0x000d0032, 0x00000038 }, 1634 + { 0x0000f180, 0x00000004 }, 1635 + { 0x000d0034, 0x00000038 }, 1636 + { 0x0000f393, 0x00000004 }, 1637 + { 0x000d0036, 0x00000038 }, 1638 + { 0x0000f38a, 0x00000004 }, 1639 + { 0x000d0038, 0x00000038 }, 1640 + { 0x0000f38e, 0x00000004 }, 1641 + { 0x0000e821, 0x00000004 }, 1642 + { 0x0140a000, 0x00000004 }, 1643 + { 0x00000043, 0x00000018 }, 1644 + { 0x00cce800, 0x00000004 }, 1645 + { 0x001b0001, 0x00000004 }, 1646 + { 0x08004800, 0x00000004 }, 1647 + { 0x001b0001, 0x00000004 }, 1648 + { 0x08004800, 0x00000004 }, 1649 + { 0x001b0001, 0x00000004 }, 1650 + { 0x08004800, 0x00000004 }, 1651 + { 0x0000003a, 0x00000008 }, 1652 + { 0x0000a000, 0000000000 }, 1653 + { 0x2000451d, 0x00000004 }, 1654 + { 0x0000e580, 0x00000004 }, 1655 + { 0x000ce581, 0x00000004 }, 1656 + { 0x08004580, 0x00000004 }, 1657 + { 0x000ce581, 0x00000004 }, 1658 + { 0x00000047, 0x00000008 }, 1659 + { 0x0000a000, 0000000000 }, 1660 + { 0x000c2000, 0x00000004 }, 1661 + { 0x0000e50e, 0x00000004 }, 1662 + { 0x00032000, 0x00000004 }, 1663 + { 0x00022051, 0x00000028 }, 1664 + { 0x00000051, 0x00000024 }, 1665 + { 0x0800450f, 0x00000004 }, 1666 + { 0x0000a04b, 0x00000008 }, 1667 + { 0x0000e565, 0x00000004 }, 1668 + { 0x0000e566, 0x00000004 }, 1669 + { 0x00000052, 0x00000008 }, 1670 + { 0x03cca5b4, 0x00000004 }, 1671 + { 0x05432000, 0x00000004 }, 1672 + { 0x00022000, 0x00000004 }, 1673 + { 0x4ccce05e, 0x00000030 }, 1674 + { 0x08274565, 0x00000004 }, 1675 + { 0x0000005e, 0x00000030 }, 1676 + { 0x08004564, 0x00000004 }, 1677 + { 0x0000e566, 0x00000004 }, 1678 + { 0x00000055, 0x00000008 }, 1679 + { 0x00802061, 0x00000010 }, 1680 + { 0x00202000, 0x00000004 }, 1681 + { 0x001b00ff, 0x00000004 }, 1682 + { 0x01000064, 0x00000010 }, 1683 + { 0x001f2000, 0x00000004 }, 1684 + { 0x001c00ff, 0x00000004 }, 1685 + { 0000000000, 0x0000000c }, 1686 + { 0x00000072, 0x00000030 }, 1687 + { 0x00000055, 0x00000008 }, 1688 + { 0x0000e576, 0x00000004 }, 1689 + { 0x0000e577, 0x00000004 }, 1690 + { 0x0000e50e, 0x00000004 }, 1691 + { 0x0000e50f, 0x00000004 }, 1692 + { 0x0140a000, 0x00000004 }, 1693 + { 0x00000069, 0x00000018 }, 1694 + { 0x00c0e5f9, 0x000000c2 }, 1695 + { 0x00000069, 0x00000008 }, 1696 + { 0x0014e50e, 0x00000004 }, 1697 + { 0x0040e50f, 0x00000004 }, 1698 + { 0x00c0006c, 0x00000008 }, 1699 + { 0x0000e570, 0x00000004 }, 1700 + { 0x0000e571, 0x00000004 }, 1701 + { 0x0000e572, 0x0000000c }, 1702 + { 0x0000a000, 0x00000004 }, 1703 + { 0x0140a000, 0x00000004 }, 1704 + { 0x0000e568, 0x00000004 }, 1705 + { 0x000c2000, 0x00000004 }, 1706 + { 0x00000076, 0x00000018 }, 1707 + { 0x000b0000, 0x00000004 }, 1708 + { 0x18c0e562, 0x00000004 }, 1709 + { 0x00000078, 0x00000008 }, 1710 + { 0x00c00077, 0x00000008 }, 1711 + { 0x000700c7, 0x00000004 }, 1712 + { 0x00000080, 0x00000038 }, 1713 + { 0x0000e5bb, 0x00000004 }, 1714 + { 0x0000e5bc, 0000000000 }, 1715 + { 0x0000a000, 0x00000004 }, 1716 + { 0x0000e821, 0x00000004 }, 1717 + { 0x0000e800, 0000000000 }, 1718 + { 0x0000e821, 0x00000004 }, 1719 + { 0x0000e82e, 0000000000 }, 1720 + { 0x02cca000, 0x00000004 }, 1721 + { 0x00140000, 0x00000004 }, 1722 + { 0x000ce1cc, 0x00000004 }, 1723 + { 0x050de1cd, 0x00000004 }, 1724 + { 0x00400000, 0x00000004 }, 1725 + { 0x0000008f, 0x00000018 }, 1726 + { 0x00c0a000, 0x00000004 }, 1727 + { 0x0000008c, 0x00000008 }, 1728 + { 0x00000091, 0x00000020 }, 1729 + { 0x4200e000, 0000000000 }, 1730 + { 0x00000098, 0x00000038 }, 1731 + { 0x000ca000, 0x00000004 }, 1732 + { 0x00140000, 0x00000004 }, 1733 + { 0x000c2000, 0x00000004 }, 1734 + { 0x00160000, 0x00000004 }, 1735 + { 0x700ce000, 0x00000004 }, 1736 + { 0x00140094, 0x00000008 }, 1737 + { 0x4000e000, 0000000000 }, 1738 + { 0x02400000, 0x00000004 }, 1739 + { 0x400ee000, 0x00000004 }, 1740 + { 0x02400000, 0x00000004 }, 1741 + { 0x4000e000, 0000000000 }, 1742 + { 0x000c2000, 0x00000004 }, 1743 + { 0x0240e51b, 0x00000004 }, 1744 + { 0x0080e50a, 0x00000005 }, 1745 + { 0x0080e50b, 0x00000005 }, 1746 + { 0x00220000, 0x00000004 }, 1747 + { 0x000700c7, 0x00000004 }, 1748 + { 0x000000a4, 0x00000038 }, 1749 + { 0x0080e5bd, 0x00000005 }, 1750 + { 0x0000e5bb, 0x00000005 }, 1751 + { 0x0080e5bc, 0x00000005 }, 1752 + { 0x00210000, 0x00000004 }, 1753 + { 0x02800000, 0x00000004 }, 1754 + { 0x00c000ab, 0x00000018 }, 1755 + { 0x4180e000, 0x00000040 }, 1756 + { 0x000000ad, 0x00000024 }, 1757 + { 0x01000000, 0x0000000c }, 1758 + { 0x0100e51d, 0x0000000c }, 1759 + { 0x000045bb, 0x00000004 }, 1760 + { 0x000080a7, 0x00000008 }, 1761 + { 0x0000f3ce, 0x00000004 }, 1762 + { 0x0140a000, 0x00000004 }, 1763 + { 0x00cc2000, 0x00000004 }, 1764 + { 0x08c053cf, 0x00000040 }, 1765 + { 0x00008000, 0000000000 }, 1766 + { 0x0000f3d2, 0x00000004 }, 1767 + { 0x0140a000, 0x00000004 }, 1768 + { 0x00cc2000, 0x00000004 }, 1769 + { 0x08c053d3, 0x00000040 }, 1770 + { 0x00008000, 0000000000 }, 1771 + { 0x0000f39d, 0x00000004 }, 1772 + { 0x0140a000, 0x00000004 }, 1773 + { 0x00cc2000, 0x00000004 }, 1774 + { 0x08c0539e, 0x00000040 }, 1775 + { 0x00008000, 0000000000 }, 1776 + { 0x03c00830, 0x00000004 }, 1777 + { 0x4200e000, 0000000000 }, 1778 + { 0x0000a000, 0x00000004 }, 1779 + { 0x200045e0, 0x00000004 }, 1780 + { 0x0000e5e1, 0000000000 }, 1781 + { 0x00000001, 0000000000 }, 1782 + { 0x000700c4, 0x00000004 }, 1783 + { 0x0800e394, 0000000000 }, 1784 + { 0000000000, 0000000000 }, 1785 + { 0x0000e8c4, 0x00000004 }, 1786 + { 0x0000e8c5, 0x00000004 }, 1787 + { 0x0000e8c6, 0x00000004 }, 1788 + { 0x0000e928, 0x00000004 }, 1789 + { 0x0000e929, 0x00000004 }, 1790 + { 0x0000e92a, 0x00000004 }, 1791 + { 0x000000c8, 0x00000008 }, 1792 + { 0x0000e928, 0x00000004 }, 1793 + { 0x0000e929, 0x00000004 }, 1794 + { 0x0000e92a, 0x00000004 }, 1795 + { 0x000000cf, 0x00000008 }, 1796 + { 0xdeadbeef, 0000000000 }, 1797 + { 0x00000116, 0000000000 }, 1798 + { 0x000700d3, 0x00000004 }, 1799 + { 0x080050e7, 0x00000004 }, 1800 + { 0x000700d4, 0x00000004 }, 1801 + { 0x0800401c, 0x00000004 }, 1802 + { 0x0000e01d, 0000000000 }, 1803 + { 0x02c02000, 0x00000004 }, 1804 + { 0x00060000, 0x00000004 }, 1805 + { 0x000000de, 0x00000034 }, 1806 + { 0x000000db, 0x00000008 }, 1807 + { 0x00008000, 0x00000004 }, 1808 + { 0xc000e000, 0000000000 }, 1809 + { 0x0000e1cc, 0x00000004 }, 1810 + { 0x0500e1cd, 0x00000004 }, 1811 + { 0x000ca000, 0x00000004 }, 1812 + { 0x000000e5, 0x00000034 }, 1813 + { 0x000000e1, 0x00000008 }, 1814 + { 0x0000a000, 0000000000 }, 1815 + { 0x0019e1cc, 0x00000004 }, 1816 + { 0x001b0001, 0x00000004 }, 1817 + { 0x0500a000, 0x00000004 }, 1818 + { 0x080041cd, 0x00000004 }, 1819 + { 0x000ca000, 0x00000004 }, 1820 + { 0x000000fb, 0x00000034 }, 1821 + { 0x0000004a, 0x00000008 }, 1822 + { 0000000000, 0000000000 }, 1823 + { 0000000000, 0000000000 }, 1824 + { 0000000000, 0000000000 }, 1825 + { 0000000000, 0000000000 }, 1826 + { 0000000000, 0000000000 }, 1827 + { 0000000000, 0000000000 }, 1828 + { 0000000000, 0000000000 }, 1829 + { 0000000000, 0000000000 }, 1830 + { 0000000000, 0000000000 }, 1831 + { 0x000c2000, 0x00000004 }, 1832 + { 0x001d0018, 0x00000004 }, 1833 + { 0x001a0001, 0x00000004 }, 1834 + { 0x000000fb, 0x00000034 }, 1835 + { 0x0000004a, 0x00000008 }, 1836 + { 0x0500a04a, 0x00000008 }, 1837 + { 0000000000, 0000000000 }, 1838 + { 0000000000, 0000000000 }, 1839 + { 0000000000, 0000000000 }, 1840 + { 0000000000, 0000000000 }, 1841 + }; 1842 + 1843 + 1844 + #endif
+14 -3
drivers/char/drm/radeon_state.c
··· 1662 u32 height; 1663 int i; 1664 u32 texpitch, microtile; 1665 - u32 offset; 1666 RING_LOCALS; 1667 1668 if (radeon_check_and_fixup_offset(dev_priv, file_priv, &tex->offset)) { ··· 1726 } 1727 } else 1728 microtile = 0; 1729 1730 DRM_DEBUG("tex=%dx%d blit=%d\n", tex_width, tex->height, blit_width); 1731 ··· 1847 } 1848 1849 #undef RADEON_COPY_MT 1850 buf->file_priv = file_priv; 1851 buf->used = size; 1852 offset = dev_priv->gart_buffers_offset + buf->offset; ··· 1862 RADEON_DP_SRC_SOURCE_MEMORY | 1863 RADEON_GMC_CLR_CMP_CNTL_DIS | RADEON_GMC_WR_MSK_DIS); 1864 OUT_RING((spitch << 22) | (offset >> 10)); 1865 - OUT_RING((texpitch << 22) | (tex->offset >> 10)); 1866 OUT_RING(0); 1867 - OUT_RING((image->x << 16) | image->y); 1868 OUT_RING((image->width << 16) | height); 1869 RADEON_WAIT_UNTIL_2D_IDLE(); 1870 ADVANCE_RING(); ··· 3044 break; 3045 case RADEON_PARAM_FB_LOCATION: 3046 value = radeon_read_fb_location(dev_priv); 3047 break; 3048 default: 3049 DRM_DEBUG("Invalid parameter %d\n", param->param);
··· 1662 u32 height; 1663 int i; 1664 u32 texpitch, microtile; 1665 + u32 offset, byte_offset; 1666 RING_LOCALS; 1667 1668 if (radeon_check_and_fixup_offset(dev_priv, file_priv, &tex->offset)) { ··· 1726 } 1727 } else 1728 microtile = 0; 1729 + 1730 + /* this might fail for zero-sized uploads - are those illegal? */ 1731 + if (!radeon_check_offset(dev_priv, tex->offset + image->height * 1732 + blit_width - 1)) { 1733 + DRM_ERROR("Invalid final destination offset\n"); 1734 + return -EINVAL; 1735 + } 1736 1737 DRM_DEBUG("tex=%dx%d blit=%d\n", tex_width, tex->height, blit_width); 1738 ··· 1840 } 1841 1842 #undef RADEON_COPY_MT 1843 + byte_offset = (image->y & ~2047) * blit_width; 1844 buf->file_priv = file_priv; 1845 buf->used = size; 1846 offset = dev_priv->gart_buffers_offset + buf->offset; ··· 1854 RADEON_DP_SRC_SOURCE_MEMORY | 1855 RADEON_GMC_CLR_CMP_CNTL_DIS | RADEON_GMC_WR_MSK_DIS); 1856 OUT_RING((spitch << 22) | (offset >> 10)); 1857 + OUT_RING((texpitch << 22) | ((tex->offset >> 10) + (byte_offset >> 10))); 1858 OUT_RING(0); 1859 + OUT_RING((image->x << 16) | (image->y % 2048)); 1860 OUT_RING((image->width << 16) | height); 1861 RADEON_WAIT_UNTIL_2D_IDLE(); 1862 ADVANCE_RING(); ··· 3036 break; 3037 case RADEON_PARAM_FB_LOCATION: 3038 value = radeon_read_fb_location(dev_priv); 3039 + break; 3040 + case RADEON_PARAM_NUM_GB_PIPES: 3041 + value = dev_priv->num_gb_pipes; 3042 break; 3043 default: 3044 DRM_DEBUG("Invalid parameter %d\n", param->param);
+15 -17
drivers/firewire/Kconfig
··· 1 - comment "An alternative FireWire stack is available with EXPERIMENTAL=y" 2 depends on EXPERIMENTAL=n 3 4 config FIREWIRE 5 - tristate "IEEE 1394 (FireWire) support - alternative stack, EXPERIMENTAL" 6 depends on EXPERIMENTAL 7 select CRC_ITU_T 8 help 9 This is the "Juju" FireWire stack, a new alternative implementation 10 designed for robustness and simplicity. You can build either this 11 - stack, or the classic stack (the ieee1394 driver, ohci1394 etc.) 12 - or both. Please read http://wiki.linux1394.org/JujuMigration before 13 - you enable the new stack. 14 15 To compile this driver as a module, say M here: the module will be 16 called firewire-core. It functionally replaces ieee1394, raw1394, 17 and video1394. 18 19 - NOTE: 20 - 21 - You should only build ONE of the stacks, unless you REALLY know what 22 - you are doing. 23 - 24 config FIREWIRE_OHCI 25 - tristate "Support for OHCI FireWire host controllers" 26 depends on PCI && FIREWIRE 27 help 28 Enable this driver if you have a FireWire controller based ··· 31 called firewire-ohci. It replaces ohci1394 of the classic IEEE 1394 32 stack. 33 34 - NOTE: 35 36 - You should only build ohci1394 or firewire-ohci, but not both. 37 - If you nevertheless want to install both, you should configure them 38 - only as modules and blacklist the driver(s) which you don't want to 39 - have auto-loaded. Add either 40 41 blacklist firewire-ohci 42 or ··· 58 default y 59 60 config FIREWIRE_SBP2 61 - tristate "Support for storage devices (SBP-2 protocol driver)" 62 depends on FIREWIRE && SCSI 63 help 64 This option enables you to use SBP-2 devices connected to a
··· 1 + comment "A new alternative FireWire stack is available with EXPERIMENTAL=y" 2 depends on EXPERIMENTAL=n 3 4 + comment "Enable only one of the two stacks, unless you know what you are doing" 5 + depends on EXPERIMENTAL 6 + 7 config FIREWIRE 8 + tristate "New FireWire stack, EXPERIMENTAL" 9 depends on EXPERIMENTAL 10 select CRC_ITU_T 11 help 12 This is the "Juju" FireWire stack, a new alternative implementation 13 designed for robustness and simplicity. You can build either this 14 + stack, or the old stack (the ieee1394 driver, ohci1394 etc.) or both. 15 + Please read http://wiki.linux1394.org/JujuMigration before you 16 + enable the new stack. 17 18 To compile this driver as a module, say M here: the module will be 19 called firewire-core. It functionally replaces ieee1394, raw1394, 20 and video1394. 21 22 config FIREWIRE_OHCI 23 + tristate "OHCI-1394 controllers" 24 depends on PCI && FIREWIRE 25 help 26 Enable this driver if you have a FireWire controller based ··· 33 called firewire-ohci. It replaces ohci1394 of the classic IEEE 1394 34 stack. 35 36 + NOTE: 37 38 + You should only build either firewire-ohci or the old ohci1394 driver, 39 + but not both. If you nevertheless want to install both, you should 40 + configure them only as modules and blacklist the driver(s) which you 41 + don't want to have auto-loaded. Add either 42 43 blacklist firewire-ohci 44 or ··· 60 default y 61 62 config FIREWIRE_SBP2 63 + tristate "Storage devices (SBP-2 protocol)" 64 depends on FIREWIRE && SCSI 65 help 66 This option enables you to use SBP-2 devices connected to a
+7 -2
drivers/firewire/fw-cdev.c
··· 205 return dequeue_event(client, buffer, count); 206 } 207 208 static void 209 fill_bus_reset_event(struct fw_cdev_event_bus_reset *event, 210 struct client *client) ··· 215 event->closure = client->bus_reset_closure; 216 event->type = FW_CDEV_EVENT_BUS_RESET; 217 event->generation = client->device->generation; 218 - smp_rmb(); /* node_id must not be older than generation */ 219 event->node_id = client->device->node_id; 220 event->local_node_id = card->local_node->node_id; 221 event->bm_node_id = 0; /* FIXME: We don't track the BM. */ ··· 274 { 275 struct fw_cdev_get_info *get_info = buffer; 276 struct fw_cdev_event_bus_reset bus_reset; 277 unsigned long ret = 0; 278 279 client->version = get_info->version; ··· 300 client->bus_reset_closure = get_info->bus_reset_closure; 301 if (get_info->bus_reset != 0) { 302 void __user *uptr = u64_to_uptr(get_info->bus_reset); 303 304 fill_bus_reset_event(&bus_reset, client); 305 if (copy_to_user(uptr, &bus_reset, sizeof(bus_reset))) 306 return -EFAULT; 307 } 308 309 - get_info->card = client->device->card->index; 310 311 return 0; 312 }
··· 205 return dequeue_event(client, buffer, count); 206 } 207 208 + /* caller must hold card->lock so that node pointers can be dereferenced here */ 209 static void 210 fill_bus_reset_event(struct fw_cdev_event_bus_reset *event, 211 struct client *client) ··· 214 event->closure = client->bus_reset_closure; 215 event->type = FW_CDEV_EVENT_BUS_RESET; 216 event->generation = client->device->generation; 217 event->node_id = client->device->node_id; 218 event->local_node_id = card->local_node->node_id; 219 event->bm_node_id = 0; /* FIXME: We don't track the BM. */ ··· 274 { 275 struct fw_cdev_get_info *get_info = buffer; 276 struct fw_cdev_event_bus_reset bus_reset; 277 + struct fw_card *card = client->device->card; 278 unsigned long ret = 0; 279 280 client->version = get_info->version; ··· 299 client->bus_reset_closure = get_info->bus_reset_closure; 300 if (get_info->bus_reset != 0) { 301 void __user *uptr = u64_to_uptr(get_info->bus_reset); 302 + unsigned long flags; 303 304 + spin_lock_irqsave(&card->lock, flags); 305 fill_bus_reset_event(&bus_reset, client); 306 + spin_unlock_irqrestore(&card->lock, flags); 307 + 308 if (copy_to_user(uptr, &bus_reset, sizeof(bus_reset))) 309 return -EFAULT; 310 } 311 312 + get_info->card = card->index; 313 314 return 0; 315 }
+56 -54
drivers/firewire/fw-ohci.c
··· 265 !(evt & OHCI1394_busReset)) 266 return; 267 268 - printk(KERN_DEBUG KBUILD_MODNAME ": IRQ " 269 - "%08x%s%s%s%s%s%s%s%s%s%s%s%s%s\n", 270 - evt, 271 - evt & OHCI1394_selfIDComplete ? " selfID" : "", 272 - evt & OHCI1394_RQPkt ? " AR_req" : "", 273 - evt & OHCI1394_RSPkt ? " AR_resp" : "", 274 - evt & OHCI1394_reqTxComplete ? " AT_req" : "", 275 - evt & OHCI1394_respTxComplete ? " AT_resp" : "", 276 - evt & OHCI1394_isochRx ? " IR" : "", 277 - evt & OHCI1394_isochTx ? " IT" : "", 278 - evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", 279 - evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", 280 - evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "", 281 - evt & OHCI1394_regAccessFail ? " regAccessFail" : "", 282 - evt & OHCI1394_busReset ? " busReset" : "", 283 - evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt | 284 - OHCI1394_RSPkt | OHCI1394_reqTxComplete | 285 - OHCI1394_respTxComplete | OHCI1394_isochRx | 286 - OHCI1394_isochTx | OHCI1394_postedWriteErr | 287 - OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds | 288 - OHCI1394_regAccessFail | OHCI1394_busReset) 289 ? " ?" : ""); 290 } 291 ··· 306 if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS))) 307 return; 308 309 - printk(KERN_DEBUG KBUILD_MODNAME ": %d selfIDs, generation %d, " 310 - "local node ID %04x\n", self_id_count, generation, node_id); 311 312 for (; self_id_count--; ++s) 313 if ((*s & 1 << 23) == 0) 314 - printk(KERN_DEBUG "selfID 0: %08x, phy %d [%c%c%c] " 315 - "%s gc=%d %s %s%s%s\n", 316 - *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2), 317 - speed[*s >> 14 & 3], *s >> 16 & 63, 318 - power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "", 319 - *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : ""); 320 else 321 - printk(KERN_DEBUG "selfID n: %08x, phy %d " 322 - "[%c%c%c%c%c%c%c%c]\n", 323 - *s, *s >> 24 & 63, 324 - _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10), 325 - _p(s, 8), _p(s, 6), _p(s, 4), _p(s, 2)); 326 } 327 328 static const char *evts[] = { ··· 370 evt = 0x1f; 371 372 if (evt == OHCI1394_evt_bus_reset) { 373 - printk(KERN_DEBUG "A%c evt_bus_reset, generation %d\n", 374 - dir, (header[2] >> 16) & 0xff); 375 return; 376 } 377 378 if (header[0] == ~header[1]) { 379 - printk(KERN_DEBUG "A%c %s, %s, %08x\n", 380 - dir, evts[evt], phys[header[0] >> 30 & 0x3], 381 - header[0]); 382 return; 383 } 384 ··· 396 397 switch (tcode) { 398 case 0xe: case 0xa: 399 - printk(KERN_DEBUG "A%c %s, %s\n", 400 - dir, evts[evt], tcodes[tcode]); 401 break; 402 case 0x0: case 0x1: case 0x4: case 0x5: case 0x9: 403 - printk(KERN_DEBUG "A%c spd %x tl %02x, " 404 - "%04x -> %04x, %s, " 405 - "%s, %04x%08x%s\n", 406 - dir, speed, header[0] >> 10 & 0x3f, 407 - header[1] >> 16, header[0] >> 16, evts[evt], 408 - tcodes[tcode], header[1] & 0xffff, header[2], specific); 409 break; 410 default: 411 - printk(KERN_DEBUG "A%c spd %x tl %02x, " 412 - "%04x -> %04x, %s, " 413 - "%s%s\n", 414 - dir, speed, header[0] >> 10 & 0x3f, 415 - header[1] >> 16, header[0] >> 16, evts[evt], 416 - tcodes[tcode], specific); 417 } 418 } 419 ··· 543 p.header_length = 12; 544 p.payload_length = 0; 545 break; 546 } 547 548 p.payload = (void *) buffer + p.header_length; ··· 1468 reg_write(ohci, OHCI1394_HCControlClear, 1469 OHCI1394_HCControl_noByteSwapData); 1470 1471 reg_write(ohci, OHCI1394_LinkControlSet, 1472 OHCI1394_LinkControl_rcvSelfID | 1473 OHCI1394_LinkControl_cycleTimerEnable | ··· 1484 ar_context_run(&ohci->ar_request_ctx); 1485 ar_context_run(&ohci->ar_response_ctx); 1486 1487 - reg_write(ohci, OHCI1394_SelfIDBuffer, ohci->self_id_bus); 1488 reg_write(ohci, OHCI1394_PhyUpperBound, 0x00010000); 1489 reg_write(ohci, OHCI1394_IntEventClear, ~0); 1490 reg_write(ohci, OHCI1394_IntMaskClear, ~0);
··· 265 !(evt & OHCI1394_busReset)) 266 return; 267 268 + fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, 269 + evt & OHCI1394_selfIDComplete ? " selfID" : "", 270 + evt & OHCI1394_RQPkt ? " AR_req" : "", 271 + evt & OHCI1394_RSPkt ? " AR_resp" : "", 272 + evt & OHCI1394_reqTxComplete ? " AT_req" : "", 273 + evt & OHCI1394_respTxComplete ? " AT_resp" : "", 274 + evt & OHCI1394_isochRx ? " IR" : "", 275 + evt & OHCI1394_isochTx ? " IT" : "", 276 + evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", 277 + evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", 278 + evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "", 279 + evt & OHCI1394_regAccessFail ? " regAccessFail" : "", 280 + evt & OHCI1394_busReset ? " busReset" : "", 281 + evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt | 282 + OHCI1394_RSPkt | OHCI1394_reqTxComplete | 283 + OHCI1394_respTxComplete | OHCI1394_isochRx | 284 + OHCI1394_isochTx | OHCI1394_postedWriteErr | 285 + OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds | 286 + OHCI1394_regAccessFail | OHCI1394_busReset) 287 ? " ?" : ""); 288 } 289 ··· 308 if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS))) 309 return; 310 311 + fw_notify("%d selfIDs, generation %d, local node ID %04x\n", 312 + self_id_count, generation, node_id); 313 314 for (; self_id_count--; ++s) 315 if ((*s & 1 << 23) == 0) 316 + fw_notify("selfID 0: %08x, phy %d [%c%c%c] " 317 + "%s gc=%d %s %s%s%s\n", 318 + *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2), 319 + speed[*s >> 14 & 3], *s >> 16 & 63, 320 + power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "", 321 + *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : ""); 322 else 323 + fw_notify("selfID n: %08x, phy %d [%c%c%c%c%c%c%c%c]\n", 324 + *s, *s >> 24 & 63, 325 + _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10), 326 + _p(s, 8), _p(s, 6), _p(s, 4), _p(s, 2)); 327 } 328 329 static const char *evts[] = { ··· 373 evt = 0x1f; 374 375 if (evt == OHCI1394_evt_bus_reset) { 376 + fw_notify("A%c evt_bus_reset, generation %d\n", 377 + dir, (header[2] >> 16) & 0xff); 378 return; 379 } 380 381 if (header[0] == ~header[1]) { 382 + fw_notify("A%c %s, %s, %08x\n", 383 + dir, evts[evt], phys[header[0] >> 30 & 0x3], header[0]); 384 return; 385 } 386 ··· 400 401 switch (tcode) { 402 case 0xe: case 0xa: 403 + fw_notify("A%c %s, %s\n", dir, evts[evt], tcodes[tcode]); 404 break; 405 case 0x0: case 0x1: case 0x4: case 0x5: case 0x9: 406 + fw_notify("A%c spd %x tl %02x, " 407 + "%04x -> %04x, %s, " 408 + "%s, %04x%08x%s\n", 409 + dir, speed, header[0] >> 10 & 0x3f, 410 + header[1] >> 16, header[0] >> 16, evts[evt], 411 + tcodes[tcode], header[1] & 0xffff, header[2], specific); 412 break; 413 default: 414 + fw_notify("A%c spd %x tl %02x, " 415 + "%04x -> %04x, %s, " 416 + "%s%s\n", 417 + dir, speed, header[0] >> 10 & 0x3f, 418 + header[1] >> 16, header[0] >> 16, evts[evt], 419 + tcodes[tcode], specific); 420 } 421 } 422 ··· 548 p.header_length = 12; 549 p.payload_length = 0; 550 break; 551 + 552 + default: 553 + /* FIXME: Stop context, discard everything, and restart? */ 554 + p.header_length = 0; 555 + p.payload_length = 0; 556 } 557 558 p.payload = (void *) buffer + p.header_length; ··· 1468 reg_write(ohci, OHCI1394_HCControlClear, 1469 OHCI1394_HCControl_noByteSwapData); 1470 1471 + reg_write(ohci, OHCI1394_SelfIDBuffer, ohci->self_id_bus); 1472 + reg_write(ohci, OHCI1394_LinkControlClear, 1473 + OHCI1394_LinkControl_rcvPhyPkt); 1474 reg_write(ohci, OHCI1394_LinkControlSet, 1475 OHCI1394_LinkControl_rcvSelfID | 1476 OHCI1394_LinkControl_cycleTimerEnable | ··· 1481 ar_context_run(&ohci->ar_request_ctx); 1482 ar_context_run(&ohci->ar_response_ctx); 1483 1484 reg_write(ohci, OHCI1394_PhyUpperBound, 0x00010000); 1485 reg_write(ohci, OHCI1394_IntEventClear, ~0); 1486 reg_write(ohci, OHCI1394_IntMaskClear, ~0);
+35 -15
drivers/firewire/fw-transaction.c
··· 20 21 #include <linux/completion.h> 22 #include <linux/kernel.h> 23 #include <linux/module.h> 24 #include <linux/init.h> 25 #include <linux/interrupt.h> ··· 298 struct fw_phy_packet { 299 struct fw_packet packet; 300 struct completion done; 301 }; 302 303 - static void 304 - transmit_phy_packet_callback(struct fw_packet *packet, 305 - struct fw_card *card, int status) 306 { 307 struct fw_phy_packet *p = 308 container_of(packet, struct fw_phy_packet, packet); 309 310 complete(&p->done); 311 } 312 313 void fw_send_phy_config(struct fw_card *card, 314 int node_id, int generation, int gap_count) 315 { 316 - struct fw_phy_packet p; 317 u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG) | 318 PHY_CONFIG_ROOT_ID(node_id) | 319 PHY_CONFIG_GAP_COUNT(gap_count); 320 321 - p.packet.header[0] = data; 322 - p.packet.header[1] = ~data; 323 - p.packet.header_length = 8; 324 - p.packet.payload_length = 0; 325 - p.packet.speed = SCODE_100; 326 - p.packet.generation = generation; 327 - p.packet.callback = transmit_phy_packet_callback; 328 - init_completion(&p.done); 329 330 - card->driver->send_request(card, &p.packet); 331 - wait_for_completion(&p.done); 332 } 333 334 void fw_flush_transactions(struct fw_card *card) ··· 591 break; 592 593 default: 594 - BUG(); 595 return NULL; 596 } 597
··· 20 21 #include <linux/completion.h> 22 #include <linux/kernel.h> 23 + #include <linux/kref.h> 24 #include <linux/module.h> 25 #include <linux/init.h> 26 #include <linux/interrupt.h> ··· 297 struct fw_phy_packet { 298 struct fw_packet packet; 299 struct completion done; 300 + struct kref kref; 301 }; 302 303 + static void phy_packet_release(struct kref *kref) 304 + { 305 + struct fw_phy_packet *p = 306 + container_of(kref, struct fw_phy_packet, kref); 307 + kfree(p); 308 + } 309 + 310 + static void transmit_phy_packet_callback(struct fw_packet *packet, 311 + struct fw_card *card, int status) 312 { 313 struct fw_phy_packet *p = 314 container_of(packet, struct fw_phy_packet, packet); 315 316 complete(&p->done); 317 + kref_put(&p->kref, phy_packet_release); 318 } 319 320 void fw_send_phy_config(struct fw_card *card, 321 int node_id, int generation, int gap_count) 322 { 323 + struct fw_phy_packet *p; 324 + long timeout = DIV_ROUND_UP(HZ, 10); 325 u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG) | 326 PHY_CONFIG_ROOT_ID(node_id) | 327 PHY_CONFIG_GAP_COUNT(gap_count); 328 329 + p = kmalloc(sizeof(*p), GFP_KERNEL); 330 + if (p == NULL) 331 + return; 332 333 + p->packet.header[0] = data; 334 + p->packet.header[1] = ~data; 335 + p->packet.header_length = 8; 336 + p->packet.payload_length = 0; 337 + p->packet.speed = SCODE_100; 338 + p->packet.generation = generation; 339 + p->packet.callback = transmit_phy_packet_callback; 340 + init_completion(&p->done); 341 + kref_set(&p->kref, 2); 342 + 343 + card->driver->send_request(card, &p->packet); 344 + timeout = wait_for_completion_timeout(&p->done, timeout); 345 + kref_put(&p->kref, phy_packet_release); 346 + 347 + /* will leak p if the callback is never executed */ 348 + WARN_ON(timeout == 0); 349 } 350 351 void fw_flush_transactions(struct fw_card *card) ··· 572 break; 573 574 default: 575 + fw_error("ERROR - corrupt request received - %08x %08x %08x\n", 576 + p->header[0], p->header[1], p->header[2]); 577 return NULL; 578 } 579
+15 -3
drivers/hwmon/abituguru3.c
··· 30 #include <linux/platform_device.h> 31 #include <linux/hwmon.h> 32 #include <linux/hwmon-sysfs.h> 33 #include <asm/io.h> 34 35 /* uGuru3 bank addresses */ ··· 324 { "AUX1 Fan", 36, 2, 60, 1, 0 }, 325 { NULL, 0, 0, 0, 0, 0 } } 326 }, 327 - { 0x0013, "unknown", { 328 { "CPU Core", 0, 0, 10, 1, 0 }, 329 { "DDR", 1, 0, 10, 1, 0 }, 330 { "DDR VTT", 2, 0, 10, 1, 0 }, ··· 350 { "AUX2 Fan", 36, 2, 60, 1, 0 }, 351 { "AUX3 Fan", 37, 2, 60, 1, 0 }, 352 { "AUX4 Fan", 38, 2, 60, 1, 0 }, 353 { NULL, 0, 0, 0, 0, 0 } } 354 }, 355 { 0x0014, "Abit AB9 Pro", { ··· 1113 { 1114 /* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or 1115 0x08 at DATA and 0xAC at CMD. Sometimes the uGuru3 will hold 0x05 1116 - at CMD instead, why is unknown. So we test for 0x05 too. */ 1117 u8 data_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_DATA); 1118 u8 cmd_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_CMD); 1119 if (((data_val == 0x00) || (data_val == 0x08)) && 1120 - ((cmd_val == 0xAC) || (cmd_val == 0x05))) 1121 return ABIT_UGURU3_BASE; 1122 1123 ABIT_UGURU3_DEBUG("no Abit uGuru3 found, data = 0x%02X, cmd = " ··· 1140 { 1141 int address, err; 1142 struct resource res = { .flags = IORESOURCE_IO }; 1143 1144 address = abituguru3_detect(); 1145 if (address < 0)
··· 30 #include <linux/platform_device.h> 31 #include <linux/hwmon.h> 32 #include <linux/hwmon-sysfs.h> 33 + #include <linux/dmi.h> 34 #include <asm/io.h> 35 36 /* uGuru3 bank addresses */ ··· 323 { "AUX1 Fan", 36, 2, 60, 1, 0 }, 324 { NULL, 0, 0, 0, 0, 0 } } 325 }, 326 + { 0x0013, "Abit AW8D", { 327 { "CPU Core", 0, 0, 10, 1, 0 }, 328 { "DDR", 1, 0, 10, 1, 0 }, 329 { "DDR VTT", 2, 0, 10, 1, 0 }, ··· 349 { "AUX2 Fan", 36, 2, 60, 1, 0 }, 350 { "AUX3 Fan", 37, 2, 60, 1, 0 }, 351 { "AUX4 Fan", 38, 2, 60, 1, 0 }, 352 + { "AUX5 Fan", 39, 2, 60, 1, 0 }, 353 { NULL, 0, 0, 0, 0, 0 } } 354 }, 355 { 0x0014, "Abit AB9 Pro", { ··· 1111 { 1112 /* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or 1113 0x08 at DATA and 0xAC at CMD. Sometimes the uGuru3 will hold 0x05 1114 + or 0x55 at CMD instead, why is unknown. */ 1115 u8 data_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_DATA); 1116 u8 cmd_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_CMD); 1117 if (((data_val == 0x00) || (data_val == 0x08)) && 1118 + ((cmd_val == 0xAC) || (cmd_val == 0x05) || 1119 + (cmd_val == 0x55))) 1120 return ABIT_UGURU3_BASE; 1121 1122 ABIT_UGURU3_DEBUG("no Abit uGuru3 found, data = 0x%02X, cmd = " ··· 1137 { 1138 int address, err; 1139 struct resource res = { .flags = IORESOURCE_IO }; 1140 + 1141 + #ifdef CONFIG_DMI 1142 + const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); 1143 + 1144 + /* safety check, refuse to load on non Abit motherboards */ 1145 + if (!force && (!board_vendor || 1146 + strcmp(board_vendor, "http://www.abit.com.tw/"))) 1147 + return -ENODEV; 1148 + #endif 1149 1150 address = abituguru3_detect(); 1151 if (address < 0)
+3
drivers/hwmon/adt7473.c
··· 309 ADT7473_REG_PWM_BHVR(i)); 310 } 311 312 data->limits_last_updated = local_jiffies; 313 data->limits_valid = 1; 314
··· 309 ADT7473_REG_PWM_BHVR(i)); 310 } 311 312 + i = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4); 313 + data->max_duty_at_overheat = !!(i & ADT7473_CFG4_MAX_DUTY_AT_OVT); 314 + 315 data->limits_last_updated = local_jiffies; 316 data->limits_valid = 1; 317
+15 -5
drivers/hwmon/lm75.c
··· 251 the SMBus standard. */ 252 static int lm75_read_value(struct i2c_client *client, u8 reg) 253 { 254 if (reg == LM75_REG_CONF) 255 return i2c_smbus_read_byte_data(client, reg); 256 - else 257 - return swab16(i2c_smbus_read_word_data(client, reg)); 258 } 259 260 static int lm75_write_value(struct i2c_client *client, u8 reg, u16 value) ··· 290 int i; 291 dev_dbg(&client->dev, "Starting lm75 update\n"); 292 293 - for (i = 0; i < ARRAY_SIZE(data->temp); i++) 294 - data->temp[i] = lm75_read_value(client, 295 - LM75_REG_TEMP[i]); 296 data->last_updated = jiffies; 297 data->valid = 1; 298 }
··· 251 the SMBus standard. */ 252 static int lm75_read_value(struct i2c_client *client, u8 reg) 253 { 254 + int value; 255 + 256 if (reg == LM75_REG_CONF) 257 return i2c_smbus_read_byte_data(client, reg); 258 + 259 + value = i2c_smbus_read_word_data(client, reg); 260 + return (value < 0) ? value : swab16(value); 261 } 262 263 static int lm75_write_value(struct i2c_client *client, u8 reg, u16 value) ··· 287 int i; 288 dev_dbg(&client->dev, "Starting lm75 update\n"); 289 290 + for (i = 0; i < ARRAY_SIZE(data->temp); i++) { 291 + int status; 292 + 293 + status = lm75_read_value(client, LM75_REG_TEMP[i]); 294 + if (status < 0) 295 + dev_dbg(&client->dev, "reg %d, err %d\n", 296 + LM75_REG_TEMP[i], status); 297 + else 298 + data->temp[i] = status; 299 + } 300 data->last_updated = jiffies; 301 data->valid = 1; 302 }
+11 -14
drivers/hwmon/lm85.c
··· 192 { 193 int i; 194 195 - if ( range < lm85_range_map[0] ) { 196 - return 0 ; 197 - } else if ( range > lm85_range_map[15] ) { 198 return 15 ; 199 - } else { /* find closest match */ 200 - for ( i = 14 ; i >= 0 ; --i ) { 201 - if ( range > lm85_range_map[i] ) { /* range bracketed */ 202 - if ((lm85_range_map[i+1] - range) < 203 - (range - lm85_range_map[i])) { 204 - i++; 205 - break; 206 - } 207 - break; 208 - } 209 } 210 } 211 - return( i & 0x0f ); 212 } 213 #define RANGE_FROM_REG(val) (lm85_range_map[(val)&0x0f]) 214
··· 192 { 193 int i; 194 195 + if (range >= lm85_range_map[15]) 196 return 15 ; 197 + 198 + /* Find the closest match */ 199 + for (i = 14; i >= 0; --i) { 200 + if (range >= lm85_range_map[i]) { 201 + if ((lm85_range_map[i + 1] - range) < 202 + (range - lm85_range_map[i])) 203 + return i + 1; 204 + return i; 205 } 206 } 207 + 208 + return 0; 209 } 210 #define RANGE_FROM_REG(val) (lm85_range_map[(val)&0x0f]) 211
-7
drivers/ide/Kconfig
··· 823 Say Y here if you want to support the Yellowstone RapIDE controller 824 manufactured for use with Acorn computers. 825 826 - config BLK_DEV_IDE_BAST 827 - tristate "Simtec BAST / Thorcom VR1000 IDE support" 828 - depends on ARM && (ARCH_BAST || MACH_VR1000) 829 - help 830 - Say Y here if you want to support the onboard IDE channels on the 831 - Simtec BAST or the Thorcom VR1000 832 - 833 config IDE_H8300 834 tristate "H8300 IDE support" 835 depends on H8300
··· 823 Say Y here if you want to support the Yellowstone RapIDE controller 824 manufactured for use with Acorn computers. 825 826 config IDE_H8300 827 tristate "H8300 IDE support" 828 depends on H8300
-1
drivers/ide/arm/Makefile
··· 1 2 obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o 3 obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o 4 - obj-$(CONFIG_BLK_DEV_IDE_BAST) += bast-ide.o 5 obj-$(CONFIG_BLK_DEV_PALMCHIP_BK3710) += palm_bk3710.o 6 7 ifeq ($(CONFIG_IDE_ARM), m)
··· 1 2 obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o 3 obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o 4 obj-$(CONFIG_BLK_DEV_PALMCHIP_BK3710) += palm_bk3710.o 5 6 ifeq ($(CONFIG_IDE_ARM), m)
-90
drivers/ide/arm/bast-ide.c
··· 1 - /* 2 - * Copyright (c) 2003-2004 Simtec Electronics 3 - * Ben Dooks <ben@simtec.co.uk> 4 - * 5 - * This program is free software; you can redistribute it and/or modify 6 - * it under the terms of the GNU General Public License version 2 as 7 - * published by the Free Software Foundation. 8 - * 9 - */ 10 - 11 - #include <linux/module.h> 12 - #include <linux/errno.h> 13 - #include <linux/ide.h> 14 - #include <linux/init.h> 15 - 16 - #include <asm/mach-types.h> 17 - 18 - #include <asm/io.h> 19 - #include <asm/irq.h> 20 - #include <asm/arch/map.h> 21 - #include <asm/arch/bast-map.h> 22 - #include <asm/arch/bast-irq.h> 23 - 24 - #define DRV_NAME "bast-ide" 25 - 26 - static int __init bastide_register(unsigned int base, unsigned int aux, int irq) 27 - { 28 - ide_hwif_t *hwif; 29 - hw_regs_t hw; 30 - int i; 31 - u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 32 - 33 - memset(&hw, 0, sizeof(hw)); 34 - 35 - base += BAST_IDE_CS; 36 - aux += BAST_IDE_CS; 37 - 38 - for (i = 0; i <= 7; i++) { 39 - hw.io_ports_array[i] = (unsigned long)base; 40 - base += 0x20; 41 - } 42 - 43 - hw.io_ports.ctl_addr = aux + (6 * 0x20); 44 - hw.irq = irq; 45 - hw.chipset = ide_generic; 46 - 47 - hwif = ide_find_port(); 48 - if (hwif == NULL) 49 - goto out; 50 - 51 - i = hwif->index; 52 - 53 - ide_init_port_data(hwif, i); 54 - ide_init_port_hw(hwif, &hw); 55 - hwif->port_ops = NULL; 56 - 57 - idx[0] = i; 58 - 59 - ide_device_add(idx, NULL); 60 - out: 61 - return 0; 62 - } 63 - 64 - static int __init bastide_init(void) 65 - { 66 - unsigned long base = BAST_VA_IDEPRI + BAST_IDE_CS; 67 - 68 - /* we can treat the VR1000 and the BAST the same */ 69 - 70 - if (!(machine_is_bast() || machine_is_vr1000())) 71 - return 0; 72 - 73 - printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n"); 74 - 75 - if (!request_mem_region(base, 0x400000, DRV_NAME)) { 76 - printk(KERN_ERR "%s: resources busy\n", DRV_NAME); 77 - return -EBUSY; 78 - } 79 - 80 - bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0); 81 - bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1); 82 - 83 - return 0; 84 - } 85 - 86 - module_init(bastide_init); 87 - 88 - MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 89 - MODULE_LICENSE("GPL"); 90 - MODULE_DESCRIPTION("Simtec BAST / Thorcom VR1000 IDE driver");
···
+13 -9
drivers/ide/arm/palm_bk3710.c
··· 353 struct clk *clkp; 354 struct resource *mem, *irq; 355 ide_hwif_t *hwif; 356 - void __iomem *base; 357 - int pribase, i; 358 hw_regs_t hw; 359 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 360 ··· 374 printk(KERN_ERR "failed to get memory region resource\n"); 375 return -ENODEV; 376 } 377 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 378 if (irq == NULL) { 379 printk(KERN_ERR "failed to get IRQ resource\n"); 380 return -ENODEV; 381 } 382 383 - base = (void *)mem->start; 384 385 /* Configure the Palm Chip controller */ 386 - palm_bk3710_chipinit(base); 387 388 - pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET; 389 for (i = 0; i < IDE_NR_PORTS - 2; i++) 390 - hw.io_ports_array[i] = pribase + i; 391 - hw.io_ports.ctl_addr = mem->start + 392 - IDE_PALM_ATA_PRI_CTL_OFFSET; 393 hw.irq = irq->start; 394 hw.chipset = ide_palm3710; 395 ··· 439 440 module_init(palm_bk3710_init); 441 MODULE_LICENSE("GPL"); 442 -
··· 353 struct clk *clkp; 354 struct resource *mem, *irq; 355 ide_hwif_t *hwif; 356 + unsigned long base; 357 + int i; 358 hw_regs_t hw; 359 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 360 ··· 374 printk(KERN_ERR "failed to get memory region resource\n"); 375 return -ENODEV; 376 } 377 + 378 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 379 if (irq == NULL) { 380 printk(KERN_ERR "failed to get IRQ resource\n"); 381 return -ENODEV; 382 } 383 384 + if (request_mem_region(mem->start, mem->end - mem->start + 1, 385 + "palm_bk3710") == NULL) { 386 + printk(KERN_ERR "failed to request memory region\n"); 387 + return -EBUSY; 388 + } 389 + 390 + base = IO_ADDRESS(mem->start); 391 392 /* Configure the Palm Chip controller */ 393 + palm_bk3710_chipinit((void __iomem *)base); 394 395 for (i = 0; i < IDE_NR_PORTS - 2; i++) 396 + hw.io_ports_array[i] = base + IDE_PALM_ATA_PRI_REG_OFFSET + i; 397 + hw.io_ports.ctl_addr = base + IDE_PALM_ATA_PRI_CTL_OFFSET; 398 hw.irq = irq->start; 399 hw.chipset = ide_palm3710; 400 ··· 434 435 module_init(palm_bk3710_init); 436 MODULE_LICENSE("GPL");
+3 -3
drivers/ide/ide-taskfile.c
··· 225 u8 stat; 226 227 /* 228 - * Last sector was transfered, wait until drive is ready. 229 - * This can take up to 10 usec, but we will wait max 1 ms. 230 */ 231 - for (retries = 0; retries < 100; retries++) { 232 stat = ide_read_status(drive); 233 234 if (stat & BUSY_STAT)
··· 225 u8 stat; 226 227 /* 228 + * Last sector was transfered, wait until device is ready. This can 229 + * take up to 6 ms on some ATAPI devices, so we will wait max 10 ms. 230 */ 231 + for (retries = 0; retries < 1000; retries++) { 232 stat = ide_read_status(drive); 233 234 if (stat & BUSY_STAT)
+3
drivers/ide/legacy/ide-cs.c
··· 410 PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ 411 PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), 412 PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ 413 PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ 414 PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), 415 PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ ··· 440 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), 441 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDEII", 0x547e66dc, 0xb3662674), 442 PCMCIA_DEVICE_PROD_ID12("LOOKMEET", "CBIDE2 ", 0xe37be2b5, 0x8671043b), 443 PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF500", 0x7ed2ad87, 0x7a13045c), 444 PCMCIA_DEVICE_PROD_ID2("NinjaATA-", 0xebe0bd79), 445 PCMCIA_DEVICE_PROD_ID12("PCMCIA", "CD-ROM", 0x281f1c5d, 0x66536591), ··· 451 PCMCIA_DEVICE_PROD_ID12("SMI VENDOR", "SMI PRODUCT", 0x30896c92, 0x703cc5f6), 452 PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), 453 PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), 454 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), 455 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), 456 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
··· 410 PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ 411 PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), 412 PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ 413 + PCMCIA_DEVICE_MANF_CARD(0x004f, 0x0000), /* Kingston */ 414 PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ 415 PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), 416 PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ ··· 439 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), 440 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDEII", 0x547e66dc, 0xb3662674), 441 PCMCIA_DEVICE_PROD_ID12("LOOKMEET", "CBIDE2 ", 0xe37be2b5, 0x8671043b), 442 + PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF300", 0x7ed2ad87, 0x7e9e78ee), 443 PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF500", 0x7ed2ad87, 0x7a13045c), 444 PCMCIA_DEVICE_PROD_ID2("NinjaATA-", 0xebe0bd79), 445 PCMCIA_DEVICE_PROD_ID12("PCMCIA", "CD-ROM", 0x281f1c5d, 0x66536591), ··· 449 PCMCIA_DEVICE_PROD_ID12("SMI VENDOR", "SMI PRODUCT", 0x30896c92, 0x703cc5f6), 450 PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), 451 PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), 452 + PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF45", 0x709b1bf1, 0xf68b6f32), 453 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), 454 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), 455 PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
+66 -52
drivers/ieee1394/Kconfig
··· 4 source "drivers/firewire/Kconfig" 5 6 config IEEE1394 7 - tristate "IEEE 1394 (FireWire) support" 8 depends on PCI || BROKEN 9 help 10 IEEE 1394 describes a high performance serial bus, which is also ··· 19 To compile this driver as a module, say M here: the 20 module will be called ieee1394. 21 22 - comment "Subsystem Options" 23 - depends on IEEE1394 24 - 25 - config IEEE1394_VERBOSEDEBUG 26 - bool "Excessive debugging output" 27 - depends on IEEE1394 28 help 29 - If you say Y here, you will get very verbose debugging logs from 30 - the subsystem which includes a dump of the header of every sent 31 - and received packet. This can amount to a high amount of data 32 - collected in a very short time which is usually also saved to 33 - disk by the system logging daemons. 34 35 - Say Y if you really want or need the debugging output, everyone 36 - else says N. 37 38 - comment "Controllers" 39 - depends on IEEE1394 40 41 - comment "Texas Instruments PCILynx requires I2C" 42 depends on IEEE1394 && I2C=n 43 44 config IEEE1394_PCILYNX 45 - tristate "Texas Instruments PCILynx support" 46 depends on PCI && IEEE1394 && I2C 47 select I2C_ALGOBIT 48 help ··· 72 PowerMacs G3 B&W contain the PCILynx controller. Therefore 73 almost everybody can say N here. 74 75 - config IEEE1394_OHCI1394 76 - tristate "OHCI-1394 support" 77 - depends on PCI && IEEE1394 78 - help 79 - Enable this driver if you have an IEEE 1394 controller based on the 80 - OHCI-1394 specification. The current driver is only tested with OHCI 81 - chipsets made by Texas Instruments and NEC. Most third-party vendors 82 - use one of these chipsets. It should work with any OHCI-1394 83 - compliant card, however. 84 - 85 - To compile this driver as a module, say M here: the 86 - module will be called ohci1394. 87 - 88 - comment "Protocols" 89 - depends on IEEE1394 90 - 91 - config IEEE1394_VIDEO1394 92 - tristate "OHCI-1394 Video support" 93 - depends on IEEE1394 && IEEE1394_OHCI1394 94 - help 95 - This option enables video device usage for OHCI-1394 cards. Enable 96 - this option only if you have an IEEE 1394 video device connected to 97 - an OHCI-1394 card. 98 - 99 comment "SBP-2 support (for storage devices) requires SCSI" 100 depends on IEEE1394 && SCSI=n 101 102 config IEEE1394_SBP2 103 - tristate "SBP-2 support (Harddisks etc.)" 104 depends on IEEE1394 && SCSI 105 help 106 This option enables you to use SBP-2 devices connected to an IEEE ··· 118 119 The module is called eth1394 although it does not emulate Ethernet. 120 121 config IEEE1394_DV1394 122 - tristate "OHCI-DV I/O support (deprecated)" 123 depends on IEEE1394 && IEEE1394_OHCI1394 124 help 125 The dv1394 driver is unsupported and may be removed from Linux in a 126 future release. Its functionality is now provided by raw1394 together 127 with libraries such as libiec61883. 128 129 - config IEEE1394_RAWIO 130 - tristate "Raw IEEE1394 I/O support" 131 depends on IEEE1394 132 help 133 - This option adds support for the raw1394 device file which enables 134 - direct communication of user programs with the IEEE 1394 bus and thus 135 - with the attached peripherals. Almost all application programs which 136 - access FireWire require this option. 137 138 - To compile this driver as a module, say M here: the module will be 139 - called raw1394. 140 141 endmenu
··· 4 source "drivers/firewire/Kconfig" 5 6 config IEEE1394 7 + tristate "Stable FireWire stack" 8 depends on PCI || BROKEN 9 help 10 IEEE 1394 describes a high performance serial bus, which is also ··· 19 To compile this driver as a module, say M here: the 20 module will be called ieee1394. 21 22 + config IEEE1394_OHCI1394 23 + tristate "OHCI-1394 controllers" 24 + depends on PCI && IEEE1394 25 help 26 + Enable this driver if you have an IEEE 1394 controller based on the 27 + OHCI-1394 specification. The current driver is only tested with OHCI 28 + chipsets made by Texas Instruments and NEC. Most third-party vendors 29 + use one of these chipsets. It should work with any OHCI-1394 30 + compliant card, however. 31 32 + To compile this driver as a module, say M here: the 33 + module will be called ohci1394. 34 35 + NOTE: 36 37 + You should only build either ohci1394 or the new firewire-ohci driver, 38 + but not both. If you nevertheless want to install both, you should 39 + configure them only as modules and blacklist the driver(s) which you 40 + don't want to have auto-loaded. Add either 41 + 42 + blacklist firewire-ohci 43 + or 44 + blacklist ohci1394 45 + blacklist video1394 46 + blacklist dv1394 47 + 48 + to /etc/modprobe.conf or /etc/modprobe.d/* and update modprobe.conf 49 + depending on your distribution. The latter two modules should be 50 + blacklisted together with ohci1394 because they depend on ohci1394. 51 + 52 + If you have an old modprobe which doesn't implement the blacklist 53 + directive, use "install modulename /bin/true" for the modules to be 54 + blacklisted. 55 + 56 + comment "PCILynx controller requires I2C" 57 depends on IEEE1394 && I2C=n 58 59 config IEEE1394_PCILYNX 60 + tristate "PCILynx controller" 61 depends on PCI && IEEE1394 && I2C 62 select I2C_ALGOBIT 63 help ··· 57 PowerMacs G3 B&W contain the PCILynx controller. Therefore 58 almost everybody can say N here. 59 60 comment "SBP-2 support (for storage devices) requires SCSI" 61 depends on IEEE1394 && SCSI=n 62 63 config IEEE1394_SBP2 64 + tristate "Storage devices (SBP-2 protocol)" 65 depends on IEEE1394 && SCSI 66 help 67 This option enables you to use SBP-2 devices connected to an IEEE ··· 127 128 The module is called eth1394 although it does not emulate Ethernet. 129 130 + config IEEE1394_RAWIO 131 + tristate "raw1394 userspace interface" 132 + depends on IEEE1394 133 + help 134 + This option adds support for the raw1394 device file which enables 135 + direct communication of user programs with IEEE 1394 devices 136 + (isochronous and asynchronous). Almost all application programs 137 + which access FireWire require this option. 138 + 139 + To compile this driver as a module, say M here: the module will be 140 + called raw1394. 141 + 142 + config IEEE1394_VIDEO1394 143 + tristate "video1394 userspace interface" 144 + depends on IEEE1394 && IEEE1394_OHCI1394 145 + help 146 + This option adds support for the video1394 device files which enable 147 + isochronous communication of user programs with IEEE 1394 devices, 148 + especially video capture or export. This interface is used by all 149 + libdc1394 based programs and by several other programs, in addition to 150 + the raw1394 interface. It is generally not required for DV capture. 151 + 152 + To compile this driver as a module, say M here: the module will be 153 + called video1394. 154 + 155 config IEEE1394_DV1394 156 + tristate "dv1394 userspace interface (deprecated)" 157 depends on IEEE1394 && IEEE1394_OHCI1394 158 help 159 The dv1394 driver is unsupported and may be removed from Linux in a 160 future release. Its functionality is now provided by raw1394 together 161 with libraries such as libiec61883. 162 163 + config IEEE1394_VERBOSEDEBUG 164 + bool "Excessive debugging output" 165 depends on IEEE1394 166 help 167 + If you say Y here, you will get very verbose debugging logs from the 168 + ieee1394 drivers, including sent and received packet headers. This 169 + will quickly result in large amounts of data sent to the system log. 170 171 + Say Y if you really need the debugging output. Everyone else says N. 172 173 endmenu
+1 -1
drivers/net/pppoe.c
··· 942 m->msg_namelen = 0; 943 944 if (skb) { 945 - total_len = min(total_len, skb->len); 946 error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len); 947 if (error == 0) 948 error = total_len;
··· 942 m->msg_namelen = 0; 943 944 if (skb) { 945 + total_len = min_t(size_t, total_len, skb->len); 946 error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len); 947 if (error == 0) 948 error = total_len;
+18 -22
drivers/serial/bfin_5xx.c
··· 49 #define DMA_RX_YCOUNT (PAGE_SIZE / DMA_RX_XCOUNT) 50 51 #define DMA_RX_FLUSH_JIFFIES (HZ / 50) 52 53 #ifdef CONFIG_SERIAL_BFIN_DMA 54 static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart); ··· 291 { 292 struct circ_buf *xmit = &uart->port.info->xmit; 293 294 - if (uart->port.x_char) { 295 - UART_PUT_CHAR(uart, uart->port.x_char); 296 - uart->port.icount.tx++; 297 - uart->port.x_char = 0; 298 - } 299 /* 300 * Check the modem control lines before 301 * transmitting anything. ··· 300 if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) { 301 bfin_serial_stop_tx(&uart->port); 302 return; 303 } 304 305 while ((UART_GET_LSR(uart) & THRE) && xmit->tail != xmit->head) { ··· 347 } 348 #endif 349 350 - #ifdef CONFIG_SERIAL_BFIN_CTSRTS 351 - static void bfin_serial_do_work(struct work_struct *work) 352 - { 353 - struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue); 354 - 355 - bfin_serial_mctrl_check(uart); 356 - } 357 - #endif 358 - 359 #ifdef CONFIG_SERIAL_BFIN_DMA 360 static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) 361 { 362 struct circ_buf *xmit = &uart->port.info->xmit; 363 364 uart->tx_done = 0; 365 366 if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) { 367 uart->tx_count = 0; ··· 371 uart->port.icount.tx++; 372 uart->port.x_char = 0; 373 } 374 - 375 - /* 376 - * Check the modem control lines before 377 - * transmitting anything. 378 - */ 379 - bfin_serial_mctrl_check(uart); 380 381 uart->tx_count = CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE); 382 if (uart->tx_count > (UART_XMIT_SIZE - xmit->tail)) ··· 558 uart_handle_cts_change(&uart->port, status & TIOCM_CTS); 559 if (!(status & TIOCM_CTS)) { 560 tty->hw_stopped = 1; 561 - schedule_work(&uart->cts_workqueue); 562 } else { 563 tty->hw_stopped = 0; 564 } ··· 881 init_timer(&(bfin_serial_ports[i].rx_dma_timer)); 882 #endif 883 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 884 - INIT_WORK(&bfin_serial_ports[i].cts_workqueue, bfin_serial_do_work); 885 bfin_serial_ports[i].cts_pin = 886 bfin_serial_resource[i].uart_cts_pin; 887 bfin_serial_ports[i].rts_pin =
··· 49 #define DMA_RX_YCOUNT (PAGE_SIZE / DMA_RX_XCOUNT) 50 51 #define DMA_RX_FLUSH_JIFFIES (HZ / 50) 52 + #define CTS_CHECK_JIFFIES (HZ / 50) 53 54 #ifdef CONFIG_SERIAL_BFIN_DMA 55 static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart); ··· 290 { 291 struct circ_buf *xmit = &uart->port.info->xmit; 292 293 /* 294 * Check the modem control lines before 295 * transmitting anything. ··· 304 if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) { 305 bfin_serial_stop_tx(&uart->port); 306 return; 307 + } 308 + 309 + if (uart->port.x_char) { 310 + UART_PUT_CHAR(uart, uart->port.x_char); 311 + uart->port.icount.tx++; 312 + uart->port.x_char = 0; 313 } 314 315 while ((UART_GET_LSR(uart) & THRE) && xmit->tail != xmit->head) { ··· 345 } 346 #endif 347 348 #ifdef CONFIG_SERIAL_BFIN_DMA 349 static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) 350 { 351 struct circ_buf *xmit = &uart->port.info->xmit; 352 353 uart->tx_done = 0; 354 + 355 + /* 356 + * Check the modem control lines before 357 + * transmitting anything. 358 + */ 359 + bfin_serial_mctrl_check(uart); 360 361 if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) { 362 uart->tx_count = 0; ··· 372 uart->port.icount.tx++; 373 uart->port.x_char = 0; 374 } 375 376 uart->tx_count = CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE); 377 if (uart->tx_count > (UART_XMIT_SIZE - xmit->tail)) ··· 565 uart_handle_cts_change(&uart->port, status & TIOCM_CTS); 566 if (!(status & TIOCM_CTS)) { 567 tty->hw_stopped = 1; 568 + uart->cts_timer.data = (unsigned long)(uart); 569 + uart->cts_timer.function = (void *)bfin_serial_mctrl_check; 570 + uart->cts_timer.expires = jiffies + CTS_CHECK_JIFFIES; 571 + add_timer(&(uart->cts_timer)); 572 } else { 573 tty->hw_stopped = 0; 574 } ··· 885 init_timer(&(bfin_serial_ports[i].rx_dma_timer)); 886 #endif 887 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 888 + init_timer(&(bfin_serial_ports[i].cts_timer)); 889 bfin_serial_ports[i].cts_pin = 890 bfin_serial_resource[i].uart_cts_pin; 891 bfin_serial_ports[i].rts_pin =
+80 -75
drivers/watchdog/hpwdt.c
··· 140 }; 141 MODULE_DEVICE_TABLE(pci, hpwdt_devices); 142 143 #ifndef CONFIG_X86_64 144 /* --32 Bit Bios------------------------------------------------------------ */ 145 146 #define HPWDT_ARCH 32 147 148 - asmlinkage void asminline_call(struct cmn_registers *pi86Regs, 149 - unsigned long *pRomEntry) 150 - { 151 - asm("pushl %ebp \n\t" 152 - "movl %esp, %ebp \n\t" 153 - "pusha \n\t" 154 - "pushf \n\t" 155 - "push %es \n\t" 156 - "push %ds \n\t" 157 - "pop %es \n\t" 158 - "movl 8(%ebp),%eax \n\t" 159 - "movl 4(%eax),%ebx \n\t" 160 - "movl 8(%eax),%ecx \n\t" 161 - "movl 12(%eax),%edx \n\t" 162 - "movl 16(%eax),%esi \n\t" 163 - "movl 20(%eax),%edi \n\t" 164 - "movl (%eax),%eax \n\t" 165 - "push %cs \n\t" 166 - "call *12(%ebp) \n\t" 167 - "pushf \n\t" 168 - "pushl %eax \n\t" 169 - "movl 8(%ebp),%eax \n\t" 170 - "movl %ebx,4(%eax) \n\t" 171 - "movl %ecx,8(%eax) \n\t" 172 - "movl %edx,12(%eax) \n\t" 173 - "movl %esi,16(%eax) \n\t" 174 - "movl %edi,20(%eax) \n\t" 175 - "movw %ds,24(%eax) \n\t" 176 - "movw %es,26(%eax) \n\t" 177 - "popl %ebx \n\t" 178 - "movl %ebx,(%eax) \n\t" 179 - "popl %ebx \n\t" 180 - "movl %ebx,28(%eax) \n\t" 181 - "pop %es \n\t" 182 - "popf \n\t" 183 - "popa \n\t" 184 - "leave \n\t" "ret"); 185 - } 186 187 /* 188 * cru_detect ··· 337 338 #define HPWDT_ARCH 64 339 340 - asmlinkage void asminline_call(struct cmn_registers *pi86Regs, 341 - unsigned long *pRomEntry) 342 - { 343 - asm("pushq %rbp \n\t" 344 - "movq %rsp, %rbp \n\t" 345 - "pushq %rax \n\t" 346 - "pushq %rbx \n\t" 347 - "pushq %rdx \n\t" 348 - "pushq %r12 \n\t" 349 - "pushq %r9 \n\t" 350 - "movq %rsi, %r12 \n\t" 351 - "movq %rdi, %r9 \n\t" 352 - "movl 4(%r9),%ebx \n\t" 353 - "movl 8(%r9),%ecx \n\t" 354 - "movl 12(%r9),%edx \n\t" 355 - "movl 16(%r9),%esi \n\t" 356 - "movl 20(%r9),%edi \n\t" 357 - "movl (%r9),%eax \n\t" 358 - "call *%r12 \n\t" 359 - "pushfq \n\t" 360 - "popq %r12 \n\t" 361 - "popfq \n\t" 362 - "movl %eax, (%r9) \n\t" 363 - "movl %ebx, 4(%r9) \n\t" 364 - "movl %ecx, 8(%r9) \n\t" 365 - "movl %edx, 12(%r9) \n\t" 366 - "movl %esi, 16(%r9) \n\t" 367 - "movl %edi, 20(%r9) \n\t" 368 - "movq %r12, %rax \n\t" 369 - "movl %eax, 28(%r9) \n\t" 370 - "popq %r9 \n\t" 371 - "popq %r12 \n\t" 372 - "popq %rdx \n\t" 373 - "popq %rbx \n\t" 374 - "popq %rax \n\t" 375 - "leave \n\t" "ret"); 376 - } 377 378 /* 379 * dmi_find_cru
··· 140 }; 141 MODULE_DEVICE_TABLE(pci, hpwdt_devices); 142 143 + extern asmlinkage void asminline_call(struct cmn_registers *pi86Regs, unsigned long *pRomEntry); 144 + 145 #ifndef CONFIG_X86_64 146 /* --32 Bit Bios------------------------------------------------------------ */ 147 148 #define HPWDT_ARCH 32 149 150 + asm(".text \n\t" 151 + ".align 4 \n" 152 + "asminline_call: \n\t" 153 + "pushl %ebp \n\t" 154 + "movl %esp, %ebp \n\t" 155 + "pusha \n\t" 156 + "pushf \n\t" 157 + "push %es \n\t" 158 + "push %ds \n\t" 159 + "pop %es \n\t" 160 + "movl 8(%ebp),%eax \n\t" 161 + "movl 4(%eax),%ebx \n\t" 162 + "movl 8(%eax),%ecx \n\t" 163 + "movl 12(%eax),%edx \n\t" 164 + "movl 16(%eax),%esi \n\t" 165 + "movl 20(%eax),%edi \n\t" 166 + "movl (%eax),%eax \n\t" 167 + "push %cs \n\t" 168 + "call *12(%ebp) \n\t" 169 + "pushf \n\t" 170 + "pushl %eax \n\t" 171 + "movl 8(%ebp),%eax \n\t" 172 + "movl %ebx,4(%eax) \n\t" 173 + "movl %ecx,8(%eax) \n\t" 174 + "movl %edx,12(%eax) \n\t" 175 + "movl %esi,16(%eax) \n\t" 176 + "movl %edi,20(%eax) \n\t" 177 + "movw %ds,24(%eax) \n\t" 178 + "movw %es,26(%eax) \n\t" 179 + "popl %ebx \n\t" 180 + "movl %ebx,(%eax) \n\t" 181 + "popl %ebx \n\t" 182 + "movl %ebx,28(%eax) \n\t" 183 + "pop %es \n\t" 184 + "popf \n\t" 185 + "popa \n\t" 186 + "leave \n\t" 187 + "ret \n\t" 188 + ".previous"); 189 + 190 191 /* 192 * cru_detect ··· 333 334 #define HPWDT_ARCH 64 335 336 + asm(".text \n\t" 337 + ".align 4 \n" 338 + "asminline_call: \n\t" 339 + "pushq %rbp \n\t" 340 + "movq %rsp, %rbp \n\t" 341 + "pushq %rax \n\t" 342 + "pushq %rbx \n\t" 343 + "pushq %rdx \n\t" 344 + "pushq %r12 \n\t" 345 + "pushq %r9 \n\t" 346 + "movq %rsi, %r12 \n\t" 347 + "movq %rdi, %r9 \n\t" 348 + "movl 4(%r9),%ebx \n\t" 349 + "movl 8(%r9),%ecx \n\t" 350 + "movl 12(%r9),%edx \n\t" 351 + "movl 16(%r9),%esi \n\t" 352 + "movl 20(%r9),%edi \n\t" 353 + "movl (%r9),%eax \n\t" 354 + "call *%r12 \n\t" 355 + "pushfq \n\t" 356 + "popq %r12 \n\t" 357 + "popfq \n\t" 358 + "movl %eax, (%r9) \n\t" 359 + "movl %ebx, 4(%r9) \n\t" 360 + "movl %ecx, 8(%r9) \n\t" 361 + "movl %edx, 12(%r9) \n\t" 362 + "movl %esi, 16(%r9) \n\t" 363 + "movl %edi, 20(%r9) \n\t" 364 + "movq %r12, %rax \n\t" 365 + "movl %eax, 28(%r9) \n\t" 366 + "popq %r9 \n\t" 367 + "popq %r12 \n\t" 368 + "popq %rdx \n\t" 369 + "popq %rbx \n\t" 370 + "popq %rax \n\t" 371 + "leave \n\t" 372 + "ret \n\t" 373 + ".previous"); 374 375 /* 376 * dmi_find_cru
+2 -1
fs/ext4/resize.c
··· 855 */ 856 857 /* Update group descriptor block for new group */ 858 - gdp = (struct ext4_group_desc *)primary->b_data + gdb_off; 859 860 ext4_block_bitmap_set(sb, gdp, input->block_bitmap); /* LV FIXME */ 861 ext4_inode_bitmap_set(sb, gdp, input->inode_bitmap); /* LV FIXME */
··· 855 */ 856 857 /* Update group descriptor block for new group */ 858 + gdp = (struct ext4_group_desc *)((char *)primary->b_data + 859 + gdb_off * EXT4_DESC_SIZE(sb)); 860 861 ext4_block_bitmap_set(sb, gdp, input->block_bitmap); /* LV FIXME */ 862 ext4_inode_bitmap_set(sb, gdp, input->inode_bitmap); /* LV FIXME */
+1 -1
include/asm-alpha/core_mcpcia.h
··· 261 } 262 #endif 263 264 - static inline int __mcpcia_is_mmio(unsigned long addr) 265 { 266 return (addr & 0x80000000UL) == 0; 267 }
··· 261 } 262 #endif 263 264 + extern inline int __mcpcia_is_mmio(unsigned long addr) 265 { 266 return (addr & 0x80000000UL) == 0; 267 }
+7 -7
include/asm-alpha/core_t2.h
··· 356 #define vip volatile int * 357 #define vuip volatile unsigned int * 358 359 - static inline u8 t2_inb(unsigned long addr) 360 { 361 long result = *(vip) ((addr << 5) + T2_IO + 0x00); 362 return __kernel_extbl(result, addr & 3); 363 } 364 365 - static inline void t2_outb(u8 b, unsigned long addr) 366 { 367 unsigned long w; 368 ··· 371 mb(); 372 } 373 374 - static inline u16 t2_inw(unsigned long addr) 375 { 376 long result = *(vip) ((addr << 5) + T2_IO + 0x08); 377 return __kernel_extwl(result, addr & 3); 378 } 379 380 - static inline void t2_outw(u16 b, unsigned long addr) 381 { 382 unsigned long w; 383 ··· 386 mb(); 387 } 388 389 - static inline u32 t2_inl(unsigned long addr) 390 { 391 return *(vuip) ((addr << 5) + T2_IO + 0x18); 392 } 393 394 - static inline void t2_outl(u32 b, unsigned long addr) 395 { 396 *(vuip) ((addr << 5) + T2_IO + 0x18) = b; 397 mb(); ··· 435 set_hae(msb); \ 436 } 437 438 - static DEFINE_SPINLOCK(t2_hae_lock); 439 440 /* 441 * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
··· 356 #define vip volatile int * 357 #define vuip volatile unsigned int * 358 359 + extern inline u8 t2_inb(unsigned long addr) 360 { 361 long result = *(vip) ((addr << 5) + T2_IO + 0x00); 362 return __kernel_extbl(result, addr & 3); 363 } 364 365 + extern inline void t2_outb(u8 b, unsigned long addr) 366 { 367 unsigned long w; 368 ··· 371 mb(); 372 } 373 374 + extern inline u16 t2_inw(unsigned long addr) 375 { 376 long result = *(vip) ((addr << 5) + T2_IO + 0x08); 377 return __kernel_extwl(result, addr & 3); 378 } 379 380 + extern inline void t2_outw(u16 b, unsigned long addr) 381 { 382 unsigned long w; 383 ··· 386 mb(); 387 } 388 389 + extern inline u32 t2_inl(unsigned long addr) 390 { 391 return *(vuip) ((addr << 5) + T2_IO + 0x18); 392 } 393 394 + extern inline void t2_outl(u32 b, unsigned long addr) 395 { 396 *(vuip) ((addr << 5) + T2_IO + 0x18) = b; 397 mb(); ··· 435 set_hae(msb); \ 436 } 437 438 + extern spinlock_t t2_hae_lock; 439 440 /* 441 * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
+3 -3
include/asm-alpha/io.h
··· 35 * register not being up-to-date with respect to the hardware 36 * value. 37 */ 38 - static inline void __set_hae(unsigned long new_hae) 39 { 40 unsigned long flags; 41 local_irq_save(flags); ··· 49 local_irq_restore(flags); 50 } 51 52 - static inline void set_hae(unsigned long new_hae) 53 { 54 if (new_hae != alpha_mv.hae_cache) 55 __set_hae(new_hae); ··· 176 #undef REMAP1 177 #undef REMAP2 178 179 - static inline void __iomem *generic_ioportmap(unsigned long a) 180 { 181 return alpha_mv.mv_ioportmap(a); 182 }
··· 35 * register not being up-to-date with respect to the hardware 36 * value. 37 */ 38 + extern inline void __set_hae(unsigned long new_hae) 39 { 40 unsigned long flags; 41 local_irq_save(flags); ··· 49 local_irq_restore(flags); 50 } 51 52 + extern inline void set_hae(unsigned long new_hae) 53 { 54 if (new_hae != alpha_mv.hae_cache) 55 __set_hae(new_hae); ··· 176 #undef REMAP1 177 #undef REMAP2 178 179 + extern inline void __iomem *generic_ioportmap(unsigned long a) 180 { 181 return alpha_mv.mv_ioportmap(a); 182 }
+3 -3
include/asm-alpha/mmu_context.h
··· 23 #endif 24 25 26 - extern inline unsigned long 27 __reload_thread(struct pcb_struct *pcb) 28 { 29 register unsigned long a0 __asm__("$16"); ··· 114 #define __MMU_EXTERN_INLINE 115 #endif 116 117 - static inline unsigned long 118 __get_new_mm_context(struct mm_struct *mm, long cpu) 119 { 120 unsigned long asn = cpu_last_asn(cpu); ··· 226 # endif 227 #endif 228 229 - extern inline int 230 init_new_context(struct task_struct *tsk, struct mm_struct *mm) 231 { 232 int i;
··· 23 #endif 24 25 26 + static inline unsigned long 27 __reload_thread(struct pcb_struct *pcb) 28 { 29 register unsigned long a0 __asm__("$16"); ··· 114 #define __MMU_EXTERN_INLINE 115 #endif 116 117 + extern inline unsigned long 118 __get_new_mm_context(struct mm_struct *mm, long cpu) 119 { 120 unsigned long asn = cpu_last_asn(cpu); ··· 226 # endif 227 #endif 228 229 + static inline int 230 init_new_context(struct task_struct *tsk, struct mm_struct *mm) 231 { 232 int i;
+71 -1
include/asm-alpha/percpu.h
··· 1 #ifndef __ALPHA_PERCPU_H 2 #define __ALPHA_PERCPU_H 3 4 - #include <asm-generic/percpu.h> 5 6 #endif /* __ALPHA_PERCPU_H */
··· 1 #ifndef __ALPHA_PERCPU_H 2 #define __ALPHA_PERCPU_H 3 + #include <linux/compiler.h> 4 + #include <linux/threads.h> 5 6 + /* 7 + * Determine the real variable name from the name visible in the 8 + * kernel sources. 9 + */ 10 + #define per_cpu_var(var) per_cpu__##var 11 + 12 + #ifdef CONFIG_SMP 13 + 14 + /* 15 + * per_cpu_offset() is the offset that has to be added to a 16 + * percpu variable to get to the instance for a certain processor. 17 + */ 18 + extern unsigned long __per_cpu_offset[NR_CPUS]; 19 + 20 + #define per_cpu_offset(x) (__per_cpu_offset[x]) 21 + 22 + #define __my_cpu_offset per_cpu_offset(raw_smp_processor_id()) 23 + #ifdef CONFIG_DEBUG_PREEMPT 24 + #define my_cpu_offset per_cpu_offset(smp_processor_id()) 25 + #else 26 + #define my_cpu_offset __my_cpu_offset 27 + #endif 28 + 29 + #ifndef MODULE 30 + #define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset)) 31 + #define PER_CPU_ATTRIBUTES 32 + #else 33 + /* 34 + * To calculate addresses of locally defined variables, GCC uses 32-bit 35 + * displacement from the GP. Which doesn't work for per cpu variables in 36 + * modules, as an offset to the kernel per cpu area is way above 4G. 37 + * 38 + * This forces allocation of a GOT entry for per cpu variable using 39 + * ldq instruction with a 'literal' relocation. 40 + */ 41 + #define SHIFT_PERCPU_PTR(var, offset) ({ \ 42 + extern int simple_identifier_##var(void); \ 43 + unsigned long __ptr, tmp_gp; \ 44 + asm ( "br %1, 1f \n\ 45 + 1: ldgp %1, 0(%1) \n\ 46 + ldq %0, per_cpu__" #var"(%1)\t!literal" \ 47 + : "=&r"(__ptr), "=&r"(tmp_gp)); \ 48 + (typeof(&per_cpu_var(var)))(__ptr + (offset)); }) 49 + 50 + #define PER_CPU_ATTRIBUTES __used 51 + 52 + #endif /* MODULE */ 53 + 54 + /* 55 + * A percpu variable may point to a discarded regions. The following are 56 + * established ways to produce a usable pointer from the percpu variable 57 + * offset. 58 + */ 59 + #define per_cpu(var, cpu) \ 60 + (*SHIFT_PERCPU_PTR(var, per_cpu_offset(cpu))) 61 + #define __get_cpu_var(var) \ 62 + (*SHIFT_PERCPU_PTR(var, my_cpu_offset)) 63 + #define __raw_get_cpu_var(var) \ 64 + (*SHIFT_PERCPU_PTR(var, __my_cpu_offset)) 65 + 66 + #else /* ! SMP */ 67 + 68 + #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var))) 69 + #define __get_cpu_var(var) per_cpu_var(var) 70 + #define __raw_get_cpu_var(var) per_cpu_var(var) 71 + 72 + #endif /* SMP */ 73 + 74 + #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu_var(name) 75 76 #endif /* __ALPHA_PERCPU_H */
+5 -5
include/asm-alpha/system.h
··· 184 __amask; }) 185 186 #define __CALL_PAL_R0(NAME, TYPE) \ 187 - static inline TYPE NAME(void) \ 188 { \ 189 register TYPE __r0 __asm__("$0"); \ 190 __asm__ __volatile__( \ ··· 196 } 197 198 #define __CALL_PAL_W1(NAME, TYPE0) \ 199 - static inline void NAME(TYPE0 arg0) \ 200 { \ 201 register TYPE0 __r16 __asm__("$16") = arg0; \ 202 __asm__ __volatile__( \ ··· 207 } 208 209 #define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \ 210 - static inline void NAME(TYPE0 arg0, TYPE1 arg1) \ 211 { \ 212 register TYPE0 __r16 __asm__("$16") = arg0; \ 213 register TYPE1 __r17 __asm__("$17") = arg1; \ ··· 219 } 220 221 #define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \ 222 - static inline RTYPE NAME(TYPE0 arg0) \ 223 { \ 224 register RTYPE __r0 __asm__("$0"); \ 225 register TYPE0 __r16 __asm__("$16") = arg0; \ ··· 232 } 233 234 #define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \ 235 - static inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \ 236 { \ 237 register RTYPE __r0 __asm__("$0"); \ 238 register TYPE0 __r16 __asm__("$16") = arg0; \
··· 184 __amask; }) 185 186 #define __CALL_PAL_R0(NAME, TYPE) \ 187 + extern inline TYPE NAME(void) \ 188 { \ 189 register TYPE __r0 __asm__("$0"); \ 190 __asm__ __volatile__( \ ··· 196 } 197 198 #define __CALL_PAL_W1(NAME, TYPE0) \ 199 + extern inline void NAME(TYPE0 arg0) \ 200 { \ 201 register TYPE0 __r16 __asm__("$16") = arg0; \ 202 __asm__ __volatile__( \ ··· 207 } 208 209 #define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \ 210 + extern inline void NAME(TYPE0 arg0, TYPE1 arg1) \ 211 { \ 212 register TYPE0 __r16 __asm__("$16") = arg0; \ 213 register TYPE1 __r17 __asm__("$17") = arg1; \ ··· 219 } 220 221 #define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \ 222 + extern inline RTYPE NAME(TYPE0 arg0) \ 223 { \ 224 register RTYPE __r0 __asm__("$0"); \ 225 register TYPE0 __r16 __asm__("$16") = arg0; \ ··· 232 } 233 234 #define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \ 235 + extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \ 236 { \ 237 register RTYPE __r0 __asm__("$0"); \ 238 register TYPE0 __r16 __asm__("$16") = arg0; \
+3 -3
include/asm-alpha/vga.h
··· 13 #define VT_BUF_HAVE_MEMSETW 14 #define VT_BUF_HAVE_MEMCPYW 15 16 - extern inline void scr_writew(u16 val, volatile u16 *addr) 17 { 18 if (__is_ioaddr(addr)) 19 __raw_writew(val, (volatile u16 __iomem *) addr); ··· 21 *addr = val; 22 } 23 24 - extern inline u16 scr_readw(volatile const u16 *addr) 25 { 26 if (__is_ioaddr(addr)) 27 return __raw_readw((volatile const u16 __iomem *) addr); ··· 29 return *addr; 30 } 31 32 - extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count) 33 { 34 if (__is_ioaddr(s)) 35 memsetw_io((u16 __iomem *) s, c, count);
··· 13 #define VT_BUF_HAVE_MEMSETW 14 #define VT_BUF_HAVE_MEMCPYW 15 16 + static inline void scr_writew(u16 val, volatile u16 *addr) 17 { 18 if (__is_ioaddr(addr)) 19 __raw_writew(val, (volatile u16 __iomem *) addr); ··· 21 *addr = val; 22 } 23 24 + static inline u16 scr_readw(volatile const u16 *addr) 25 { 26 if (__is_ioaddr(addr)) 27 return __raw_readw((volatile const u16 __iomem *) addr); ··· 29 return *addr; 30 } 31 32 + static inline void scr_memsetw(u16 *s, u16 c, unsigned int count) 33 { 34 if (__is_ioaddr(s)) 35 memsetw_io((u16 __iomem *) s, c, count);
+1 -1
include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
··· 96 struct work_struct tx_dma_workqueue; 97 #endif 98 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 99 - struct work_struct cts_workqueue; 100 int cts_pin; 101 int rts_pin; 102 #endif
··· 96 struct work_struct tx_dma_workqueue; 97 #endif 98 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 99 + struct timer_list cts_timer; 100 int cts_pin; 101 int rts_pin; 102 #endif
+1 -1
include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
··· 88 # endif 89 #endif 90 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 91 - struct work_struct cts_workqueue; 92 int cts_pin; 93 int rts_pin; 94 #endif
··· 88 # endif 89 #endif 90 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 91 + struct timer_list cts_timer; 92 int cts_pin; 93 int rts_pin; 94 #endif
+1 -1
include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
··· 96 struct work_struct tx_dma_workqueue; 97 #endif 98 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 99 - struct work_struct cts_workqueue; 100 int cts_pin; 101 int rts_pin; 102 #endif
··· 96 struct work_struct tx_dma_workqueue; 97 #endif 98 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 99 + struct timer_list cts_timer; 100 int cts_pin; 101 int rts_pin; 102 #endif
+3 -3
include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
··· 99 struct work_struct tx_dma_workqueue; 100 #endif 101 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 102 - struct work_struct cts_workqueue; 103 int cts_pin; 104 int rts_pin; 105 #endif ··· 187 188 #ifdef CONFIG_BFIN_UART1_CTSRTS 189 peripheral_request(P_UART1_RTS, DRIVER_NAME); 190 - peripheral_request(P_UART1_CTS DRIVER_NAME); 191 #endif 192 #endif 193 ··· 202 203 #ifdef CONFIG_BFIN_UART3_CTSRTS 204 peripheral_request(P_UART3_RTS, DRIVER_NAME); 205 - peripheral_request(P_UART3_CTS DRIVER_NAME); 206 #endif 207 #endif 208 SSYNC();
··· 99 struct work_struct tx_dma_workqueue; 100 #endif 101 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 102 + struct timer_list cts_timer; 103 int cts_pin; 104 int rts_pin; 105 #endif ··· 187 188 #ifdef CONFIG_BFIN_UART1_CTSRTS 189 peripheral_request(P_UART1_RTS, DRIVER_NAME); 190 + peripheral_request(P_UART1_CTS, DRIVER_NAME); 191 #endif 192 #endif 193 ··· 202 203 #ifdef CONFIG_BFIN_UART3_CTSRTS 204 peripheral_request(P_UART3_RTS, DRIVER_NAME); 205 + peripheral_request(P_UART3_CTS, DRIVER_NAME); 206 #endif 207 #endif 208 SSYNC();
+1 -1
include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
··· 88 # endif 89 #endif 90 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 91 - struct work_struct cts_workqueue; 92 int cts_pin; 93 int rts_pin; 94 #endif
··· 88 # endif 89 #endif 90 #ifdef CONFIG_SERIAL_BFIN_CTSRTS 91 + struct timer_list cts_timer; 92 int cts_pin; 93 int rts_pin; 94 #endif
+2 -2
include/asm-x86/geode.h
··· 112 #define VSA_VR_UNLOCK 0xFC53 /* unlock virtual register */ 113 #define VSA_VR_SIGNATURE 0x0003 114 #define VSA_VR_MEM_SIZE 0x0200 115 - #define VSA_SIG 0x4132 /* signature is ascii 'VSA2' */ 116 - 117 /* GPIO */ 118 119 #define GPIO_OUTPUT_VAL 0x00
··· 112 #define VSA_VR_UNLOCK 0xFC53 /* unlock virtual register */ 113 #define VSA_VR_SIGNATURE 0x0003 114 #define VSA_VR_MEM_SIZE 0x0200 115 + #define AMD_VSA_SIG 0x4132 /* signature is ascii 'VSA2' */ 116 + #define GSW_VSA_SIG 0x534d /* General Software signature */ 117 /* GPIO */ 118 119 #define GPIO_OUTPUT_VAL 0x00
+2 -1
include/asm-x86/page_32.h
··· 14 #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) 15 16 #ifdef CONFIG_X86_PAE 17 - #define __PHYSICAL_MASK_SHIFT 36 18 #define __VIRTUAL_MASK_SHIFT 32 19 #define PAGETABLE_LEVELS 3 20
··· 14 #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) 15 16 #ifdef CONFIG_X86_PAE 17 + /* 44=32+12, the limit we can fit into an unsigned long pfn */ 18 + #define __PHYSICAL_MASK_SHIFT 44 19 #define __VIRTUAL_MASK_SHIFT 32 20 #define PAGETABLE_LEVELS 3 21
+1 -1
include/linux/bootmem.h
··· 94 unsigned long freepfn, 95 unsigned long startpfn, 96 unsigned long endpfn); 97 - extern void reserve_bootmem_node(pg_data_t *pgdat, 98 unsigned long physaddr, 99 unsigned long size, 100 int flags);
··· 94 unsigned long freepfn, 95 unsigned long startpfn, 96 unsigned long endpfn); 97 + extern int reserve_bootmem_node(pg_data_t *pgdat, 98 unsigned long physaddr, 99 unsigned long size, 100 int flags);
+6
include/net/ipv6.h
··· 367 a->s6_addr32[2] | a->s6_addr32[3] ) == 0); 368 } 369 370 static inline int ipv6_addr_v4mapped(const struct in6_addr *a) 371 { 372 return ((a->s6_addr32[0] | a->s6_addr32[1] |
··· 367 a->s6_addr32[2] | a->s6_addr32[3] ) == 0); 368 } 369 370 + static inline int ipv6_addr_loopback(const struct in6_addr *a) 371 + { 372 + return ((a->s6_addr32[0] | a->s6_addr32[1] | 373 + a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0); 374 + } 375 + 376 static inline int ipv6_addr_v4mapped(const struct in6_addr *a) 377 { 378 return ((a->s6_addr32[0] | a->s6_addr32[1] |
+11
include/net/net_namespace.h
··· 95 #ifdef CONFIG_NET_NS 96 extern void __put_net(struct net *net); 97 98 static inline struct net *get_net(struct net *net) 99 { 100 atomic_inc(&net->count); ··· 130 return net1 == net2; 131 } 132 #else 133 static inline struct net *get_net(struct net *net) 134 { 135 return net;
··· 95 #ifdef CONFIG_NET_NS 96 extern void __put_net(struct net *net); 97 98 + static inline int net_alive(struct net *net) 99 + { 100 + return net && atomic_read(&net->count); 101 + } 102 + 103 static inline struct net *get_net(struct net *net) 104 { 105 atomic_inc(&net->count); ··· 125 return net1 == net2; 126 } 127 #else 128 + 129 + static inline int net_alive(struct net *net) 130 + { 131 + return 1; 132 + } 133 + 134 static inline struct net *get_net(struct net *net) 135 { 136 return net;
+2 -2
kernel/cpuset.c
··· 1037 1038 static int update_relax_domain_level(struct cpuset *cs, s64 val) 1039 { 1040 - if ((int)val < 0) 1041 - val = -1; 1042 1043 if (val != cs->relax_domain_level) { 1044 cs->relax_domain_level = val;
··· 1037 1038 static int update_relax_domain_level(struct cpuset *cs, s64 val) 1039 { 1040 + if (val < -1 || val >= SD_LV_MAX) 1041 + return -EINVAL; 1042 1043 if (val != cs->relax_domain_level) { 1044 cs->relax_domain_level = val;
-2
kernel/rcupreempt.c
··· 217 } 218 EXPORT_SYMBOL_GPL(rcu_batches_completed); 219 220 - EXPORT_SYMBOL_GPL(rcu_batches_completed_bh); 221 - 222 void __rcu_read_lock(void) 223 { 224 int idx;
··· 217 } 218 EXPORT_SYMBOL_GPL(rcu_batches_completed); 219 220 void __rcu_read_lock(void) 221 { 222 int idx;
+6 -1
kernel/sched.c
··· 6877 6878 static int __init setup_relax_domain_level(char *str) 6879 { 6880 - default_relax_domain_level = simple_strtoul(str, NULL, 0); 6881 return 1; 6882 } 6883 __setup("relax_domain_level=", setup_relax_domain_level);
··· 6877 6878 static int __init setup_relax_domain_level(char *str) 6879 { 6880 + unsigned long val; 6881 + 6882 + val = simple_strtoul(str, NULL, 0); 6883 + if (val < SD_LV_MAX) 6884 + default_relax_domain_level = val; 6885 + 6886 return 1; 6887 } 6888 __setup("relax_domain_level=", setup_relax_domain_level);
+10 -5
kernel/softlockup.c
··· 49 return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */ 50 } 51 52 - void touch_softlockup_watchdog(void) 53 { 54 int this_cpu = raw_smp_processor_id(); 55 56 __raw_get_cpu_var(touch_timestamp) = get_timestamp(this_cpu); 57 } 58 EXPORT_SYMBOL(touch_softlockup_watchdog); 59 ··· 85 unsigned long now; 86 87 if (touch_timestamp == 0) { 88 - touch_softlockup_watchdog(); 89 return; 90 } 91 ··· 100 101 /* do not print during early bootup: */ 102 if (unlikely(system_state != SYSTEM_RUNNING)) { 103 - touch_softlockup_watchdog(); 104 return; 105 } 106 ··· 219 sched_setscheduler(current, SCHED_FIFO, &param); 220 221 /* initialize timestamp */ 222 - touch_softlockup_watchdog(); 223 224 set_current_state(TASK_INTERRUPTIBLE); 225 /* ··· 228 * debug-printout triggers in softlockup_tick(). 229 */ 230 while (!kthread_should_stop()) { 231 - touch_softlockup_watchdog(); 232 schedule(); 233 234 if (kthread_should_stop())
··· 49 return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */ 50 } 51 52 + static void __touch_softlockup_watchdog(void) 53 { 54 int this_cpu = raw_smp_processor_id(); 55 56 __raw_get_cpu_var(touch_timestamp) = get_timestamp(this_cpu); 57 + } 58 + 59 + void touch_softlockup_watchdog(void) 60 + { 61 + __raw_get_cpu_var(touch_timestamp) = 0; 62 } 63 EXPORT_SYMBOL(touch_softlockup_watchdog); 64 ··· 80 unsigned long now; 81 82 if (touch_timestamp == 0) { 83 + __touch_softlockup_watchdog(); 84 return; 85 } 86 ··· 95 96 /* do not print during early bootup: */ 97 if (unlikely(system_state != SYSTEM_RUNNING)) { 98 + __touch_softlockup_watchdog(); 99 return; 100 } 101 ··· 214 sched_setscheduler(current, SCHED_FIFO, &param); 215 216 /* initialize timestamp */ 217 + __touch_softlockup_watchdog(); 218 219 set_current_state(TASK_INTERRUPTIBLE); 220 /* ··· 223 * debug-printout triggers in softlockup_tick(). 224 */ 225 while (!kthread_should_stop()) { 226 + __touch_softlockup_watchdog(); 227 schedule(); 228 229 if (kthread_should_stop())
+4 -2
mm/bootmem.c
··· 442 return init_bootmem_core(pgdat, freepfn, startpfn, endpfn); 443 } 444 445 - void __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, 446 unsigned long size, int flags) 447 { 448 int ret; 449 450 ret = can_reserve_bootmem_core(pgdat->bdata, physaddr, size, flags); 451 if (ret < 0) 452 - return; 453 reserve_bootmem_core(pgdat->bdata, physaddr, size, flags); 454 } 455 456 void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
··· 442 return init_bootmem_core(pgdat, freepfn, startpfn, endpfn); 443 } 444 445 + int __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, 446 unsigned long size, int flags) 447 { 448 int ret; 449 450 ret = can_reserve_bootmem_core(pgdat->bdata, physaddr, size, flags); 451 if (ret < 0) 452 + return -ENOMEM; 453 reserve_bootmem_core(pgdat->bdata, physaddr, size, flags); 454 + 455 + return 0; 456 } 457 458 void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
+13 -4
mm/memory.c
··· 999 goto no_page_table; 1000 1001 ptep = pte_offset_map_lock(mm, pmd, address, &ptl); 1002 - if (!ptep) 1003 - goto out; 1004 1005 pte = *ptep; 1006 if (!pte_present(pte)) 1007 - goto unlock; 1008 if ((flags & FOLL_WRITE) && !pte_write(pte)) 1009 goto unlock; 1010 page = vm_normal_page(vma, address, pte); 1011 if (unlikely(!page)) 1012 - goto unlock; 1013 1014 if (flags & FOLL_GET) 1015 get_page(page); ··· 1022 out: 1023 return page; 1024 1025 no_page_table: 1026 /* 1027 * When core dumping an enormous anonymous area that nobody ··· 1166 1167 cond_resched(); 1168 } 1169 if (pages) { 1170 pages[i] = page; 1171
··· 999 goto no_page_table; 1000 1001 ptep = pte_offset_map_lock(mm, pmd, address, &ptl); 1002 1003 pte = *ptep; 1004 if (!pte_present(pte)) 1005 + goto no_page; 1006 if ((flags & FOLL_WRITE) && !pte_write(pte)) 1007 goto unlock; 1008 page = vm_normal_page(vma, address, pte); 1009 if (unlikely(!page)) 1010 + goto bad_page; 1011 1012 if (flags & FOLL_GET) 1013 get_page(page); ··· 1024 out: 1025 return page; 1026 1027 + bad_page: 1028 + pte_unmap_unlock(ptep, ptl); 1029 + return ERR_PTR(-EFAULT); 1030 + 1031 + no_page: 1032 + pte_unmap_unlock(ptep, ptl); 1033 + if (!pte_none(pte)) 1034 + return page; 1035 + /* Fall through to ZERO_PAGE handling */ 1036 no_page_table: 1037 /* 1038 * When core dumping an enormous anonymous area that nobody ··· 1159 1160 cond_resched(); 1161 } 1162 + if (IS_ERR(page)) 1163 + return i ? i : PTR_ERR(page); 1164 if (pages) { 1165 pages[i] = page; 1166
+10
mm/migrate.c
··· 865 goto set_status; 866 867 page = follow_page(vma, pp->addr, FOLL_GET); 868 err = -ENOENT; 869 if (!page) 870 goto set_status; ··· 933 goto set_status; 934 935 page = follow_page(vma, pm->addr, 0); 936 err = -ENOENT; 937 /* Use PageReserved to check for zero page */ 938 if (!page || PageReserved(page))
··· 865 goto set_status; 866 867 page = follow_page(vma, pp->addr, FOLL_GET); 868 + 869 + err = PTR_ERR(page); 870 + if (IS_ERR(page)) 871 + goto set_status; 872 + 873 err = -ENOENT; 874 if (!page) 875 goto set_status; ··· 928 goto set_status; 929 930 page = follow_page(vma, pm->addr, 0); 931 + 932 + err = PTR_ERR(page); 933 + if (IS_ERR(page)) 934 + goto set_status; 935 + 936 err = -ENOENT; 937 /* Use PageReserved to check for zero page */ 938 if (!page || PageReserved(page))
+4 -1
mm/slab.c
··· 3263 3264 if (cpuset_zone_allowed_hardwall(zone, flags) && 3265 cache->nodelists[nid] && 3266 - cache->nodelists[nid]->free_objects) 3267 obj = ____cache_alloc_node(cache, 3268 flags | GFP_THISNODE, nid); 3269 } 3270 3271 if (!obj) {
··· 3263 3264 if (cpuset_zone_allowed_hardwall(zone, flags) && 3265 cache->nodelists[nid] && 3266 + cache->nodelists[nid]->free_objects) { 3267 obj = ____cache_alloc_node(cache, 3268 flags | GFP_THISNODE, nid); 3269 + if (obj) 3270 + break; 3271 + } 3272 } 3273 3274 if (!obj) {
+4
net/core/dev.c
··· 2077 2078 rcu_read_lock(); 2079 2080 #ifdef CONFIG_NET_CLS_ACT 2081 if (skb->tc_verd & TC_NCLS) { 2082 skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
··· 2077 2078 rcu_read_lock(); 2079 2080 + /* Don't receive packets in an exiting network namespace */ 2081 + if (!net_alive(dev_net(skb->dev))) 2082 + goto out; 2083 + 2084 #ifdef CONFIG_NET_CLS_ACT 2085 if (skb->tc_verd & TC_NCLS) { 2086 skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
+3
net/core/net_namespace.c
··· 140 struct pernet_operations *ops; 141 struct net *net; 142 143 net = container_of(work, struct net, work); 144 145 mutex_lock(&net_mutex);
··· 140 struct pernet_operations *ops; 141 struct net *net; 142 143 + /* Be very certain incoming network packets will not find us */ 144 + rcu_barrier(); 145 + 146 net = container_of(work, struct net, work); 147 148 mutex_lock(&net_mutex);
+9
net/ipv6/ip6_input.c
··· 102 if (hdr->version != 6) 103 goto err; 104 105 skb->transport_header = skb->network_header + sizeof(*hdr); 106 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); 107
··· 102 if (hdr->version != 6) 103 goto err; 104 105 + /* 106 + * RFC4291 2.5.3 107 + * A packet received on an interface with a destination address 108 + * of loopback must be dropped. 109 + */ 110 + if (!(dev->flags & IFF_LOOPBACK) && 111 + ipv6_addr_loopback(&hdr->daddr)) 112 + goto err; 113 + 114 skb->transport_header = skb->network_header + sizeof(*hdr); 115 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); 116
+7 -4
net/ipv6/ipv6_sockglue.c
··· 345 case IPV6_DSTOPTS: 346 { 347 struct ipv6_txoptions *opt; 348 if (optlen == 0) 349 optval = NULL; 350 351 /* hop-by-hop / destination options are privileged option */ 352 retv = -EPERM; 353 if (optname != IPV6_RTHDR && !capable(CAP_NET_RAW)) 354 break; 355 - 356 - if (optlen < sizeof(struct ipv6_opt_hdr) || 357 - optlen & 0x7 || optlen > 8 * 255) 358 - goto e_inval; 359 360 opt = ipv6_renew_options(sk, np->opt, optname, 361 (struct ipv6_opt_hdr __user *)optval,
··· 345 case IPV6_DSTOPTS: 346 { 347 struct ipv6_txoptions *opt; 348 + 349 + /* remove any sticky options header with a zero option 350 + * length, per RFC3542. 351 + */ 352 if (optlen == 0) 353 optval = NULL; 354 + else if (optlen < sizeof(struct ipv6_opt_hdr) || 355 + optlen & 0x7 || optlen > 8 * 255) 356 + goto e_inval; 357 358 /* hop-by-hop / destination options are privileged option */ 359 retv = -EPERM; 360 if (optname != IPV6_RTHDR && !capable(CAP_NET_RAW)) 361 break; 362 363 opt = ipv6_renew_options(sk, np->opt, optname, 364 (struct ipv6_opt_hdr __user *)optval,
+8 -1
net/mac80211/tx.c
··· 1132 ieee80211_tx_handler *handler; 1133 struct ieee80211_tx_data tx; 1134 ieee80211_tx_result res = TX_DROP, res_prepare; 1135 - int ret, i; 1136 1137 WARN_ON(__ieee80211_queue_pending(local, control->queue)); 1138 ··· 1216 if (!__ieee80211_queue_stopped(local, control->queue)) { 1217 clear_bit(IEEE80211_LINK_STATE_PENDING, 1218 &local->state[control->queue]); 1219 goto retry; 1220 } 1221 memcpy(&store->control, control,
··· 1132 ieee80211_tx_handler *handler; 1133 struct ieee80211_tx_data tx; 1134 ieee80211_tx_result res = TX_DROP, res_prepare; 1135 + int ret, i, retries = 0; 1136 1137 WARN_ON(__ieee80211_queue_pending(local, control->queue)); 1138 ··· 1216 if (!__ieee80211_queue_stopped(local, control->queue)) { 1217 clear_bit(IEEE80211_LINK_STATE_PENDING, 1218 &local->state[control->queue]); 1219 + retries++; 1220 + /* 1221 + * Driver bug, it's rejecting packets but 1222 + * not stopping queues. 1223 + */ 1224 + if (WARN_ON_ONCE(retries > 5)) 1225 + goto drop; 1226 goto retry; 1227 } 1228 memcpy(&store->control, control,
+3 -1
net/sctp/socket.c
··· 4401 if (copy_from_user(&getaddrs, optval, len)) 4402 return -EFAULT; 4403 4404 - if (getaddrs.addr_num <= 0) return -EINVAL; 4405 /* 4406 * For UDP-style sockets, id specifies the association to query. 4407 * If the id field is set to the value '0' then the locally bound
··· 4401 if (copy_from_user(&getaddrs, optval, len)) 4402 return -EFAULT; 4403 4404 + if (getaddrs.addr_num <= 0 || 4405 + getaddrs.addr_num >= (INT_MAX / sizeof(union sctp_addr))) 4406 + return -EINVAL; 4407 /* 4408 * For UDP-style sockets, id specifies the association to query. 4409 * If the id field is set to the value '0' then the locally bound