diff options
817 files changed, 33069 insertions, 7280 deletions
@@ -3786,14 +3786,11 @@ S: The Netherlands | |||
3786 | 3786 | ||
3787 | N: David Woodhouse | 3787 | N: David Woodhouse |
3788 | E: dwmw2@infradead.org | 3788 | E: dwmw2@infradead.org |
3789 | D: ARCnet stuff, Applicom board driver, SO_BINDTODEVICE, | 3789 | D: JFFS2 file system, Memory Technology Device subsystem, |
3790 | D: some Alpha platform porting from 2.0, Memory Technology Devices, | ||
3791 | D: Acquire watchdog timer, PC speaker driver maintenance, | ||
3792 | D: various other stuff that annoyed me by not working. | 3790 | D: various other stuff that annoyed me by not working. |
3793 | S: c/o Red Hat Engineering | 3791 | S: c/o Intel Corporation |
3794 | S: Rustat House | 3792 | S: Pipers Way |
3795 | S: 60 Clifton Road | 3793 | S: Swindon. SN3 1RJ |
3796 | S: Cambridge. CB1 7EG | ||
3797 | S: England | 3794 | S: England |
3798 | 3795 | ||
3799 | N: Chris Wright | 3796 | N: Chris Wright |
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt index b462bb149543..52441694fe03 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt | |||
@@ -170,16 +170,15 @@ Returns: 0 if successful and a negative error if not. | |||
170 | u64 | 170 | u64 |
171 | dma_get_required_mask(struct device *dev) | 171 | dma_get_required_mask(struct device *dev) |
172 | 172 | ||
173 | After setting the mask with dma_set_mask(), this API returns the | 173 | This API returns the mask that the platform requires to |
174 | actual mask (within that already set) that the platform actually | 174 | operate efficiently. Usually this means the returned mask |
175 | requires to operate efficiently. Usually this means the returned mask | ||
176 | is the minimum required to cover all of memory. Examining the | 175 | is the minimum required to cover all of memory. Examining the |
177 | required mask gives drivers with variable descriptor sizes the | 176 | required mask gives drivers with variable descriptor sizes the |
178 | opportunity to use smaller descriptors as necessary. | 177 | opportunity to use smaller descriptors as necessary. |
179 | 178 | ||
180 | Requesting the required mask does not alter the current mask. If you | 179 | Requesting the required mask does not alter the current mask. If you |
181 | wish to take advantage of it, you should issue another dma_set_mask() | 180 | wish to take advantage of it, you should issue a dma_set_mask() |
182 | call to lower the mask again. | 181 | call to set the mask to the value returned. |
183 | 182 | ||
184 | 183 | ||
185 | Part Id - Streaming DMA mappings | 184 | Part Id - Streaming DMA mappings |
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index cc49400b4af8..7ea231172c85 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
@@ -392,6 +392,10 @@ int main(int argc, char *argv[]) | |||
392 | goto err; | 392 | goto err; |
393 | } | 393 | } |
394 | } | 394 | } |
395 | if (!maskset && !tid && !containerset) { | ||
396 | usage(); | ||
397 | goto err; | ||
398 | } | ||
395 | 399 | ||
396 | do { | 400 | do { |
397 | int i; | 401 | int i; |
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index e33ee74eee77..d9e5d6f41b92 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -1,7 +1,8 @@ | |||
1 | CGROUPS | 1 | CGROUPS |
2 | ------- | 2 | ------- |
3 | 3 | ||
4 | Written by Paul Menage <menage@google.com> based on Documentation/cpusets.txt | 4 | Written by Paul Menage <menage@google.com> based on |
5 | Documentation/cgroups/cpusets.txt | ||
5 | 6 | ||
6 | Original copyright statements from cpusets.txt: | 7 | Original copyright statements from cpusets.txt: |
7 | Portions Copyright (C) 2004 BULL SA. | 8 | Portions Copyright (C) 2004 BULL SA. |
@@ -68,7 +69,7 @@ On their own, the only use for cgroups is for simple job | |||
68 | tracking. The intention is that other subsystems hook into the generic | 69 | tracking. The intention is that other subsystems hook into the generic |
69 | cgroup support to provide new attributes for cgroups, such as | 70 | cgroup support to provide new attributes for cgroups, such as |
70 | accounting/limiting the resources which processes in a cgroup can | 71 | accounting/limiting the resources which processes in a cgroup can |
71 | access. For example, cpusets (see Documentation/cpusets.txt) allows | 72 | access. For example, cpusets (see Documentation/cgroups/cpusets.txt) allows |
72 | you to associate a set of CPUs and a set of memory nodes with the | 73 | you to associate a set of CPUs and a set of memory nodes with the |
73 | tasks in each cgroup. | 74 | tasks in each cgroup. |
74 | 75 | ||
diff --git a/Documentation/controllers/cpuacct.txt b/Documentation/cgroups/cpuacct.txt index bb775fbe43d7..bb775fbe43d7 100644 --- a/Documentation/controllers/cpuacct.txt +++ b/Documentation/cgroups/cpuacct.txt | |||
diff --git a/Documentation/cpusets.txt b/Documentation/cgroups/cpusets.txt index 5c86c258c791..5c86c258c791 100644 --- a/Documentation/cpusets.txt +++ b/Documentation/cgroups/cpusets.txt | |||
diff --git a/Documentation/controllers/devices.txt b/Documentation/cgroups/devices.txt index 7cc6e6a60672..7cc6e6a60672 100644 --- a/Documentation/controllers/devices.txt +++ b/Documentation/cgroups/devices.txt | |||
diff --git a/Documentation/controllers/memcg_test.txt b/Documentation/cgroups/memcg_test.txt index 08d4d3ea0d79..19533f93b7a2 100644 --- a/Documentation/controllers/memcg_test.txt +++ b/Documentation/cgroups/memcg_test.txt | |||
@@ -6,7 +6,7 @@ Because VM is getting complex (one of reasons is memcg...), memcg's behavior | |||
6 | is complex. This is a document for memcg's internal behavior. | 6 | is complex. This is a document for memcg's internal behavior. |
7 | Please note that implementation details can be changed. | 7 | Please note that implementation details can be changed. |
8 | 8 | ||
9 | (*) Topics on API should be in Documentation/controllers/memory.txt) | 9 | (*) Topics on API should be in Documentation/cgroups/memory.txt) |
10 | 10 | ||
11 | 0. How to record usage ? | 11 | 0. How to record usage ? |
12 | 2 objects are used. | 12 | 2 objects are used. |
diff --git a/Documentation/controllers/memory.txt b/Documentation/cgroups/memory.txt index e1501964df1e..e1501964df1e 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
diff --git a/Documentation/controllers/resource_counter.txt b/Documentation/cgroups/resource_counter.txt index f196ac1d7d25..f196ac1d7d25 100644 --- a/Documentation/controllers/resource_counter.txt +++ b/Documentation/cgroups/resource_counter.txt | |||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index d105eb45282a..bbebc3a43ac0 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -1371,292 +1371,8 @@ auto_msgmni default value is 1. | |||
1371 | 2.4 /proc/sys/vm - The virtual memory subsystem | 1371 | 2.4 /proc/sys/vm - The virtual memory subsystem |
1372 | ----------------------------------------------- | 1372 | ----------------------------------------------- |
1373 | 1373 | ||
1374 | The files in this directory can be used to tune the operation of the virtual | 1374 | Please see: Documentation/sysctls/vm.txt for a description of these |
1375 | memory (VM) subsystem of the Linux kernel. | 1375 | entries. |
1376 | |||
1377 | vfs_cache_pressure | ||
1378 | ------------------ | ||
1379 | |||
1380 | Controls the tendency of the kernel to reclaim the memory which is used for | ||
1381 | caching of directory and inode objects. | ||
1382 | |||
1383 | At the default value of vfs_cache_pressure=100 the kernel will attempt to | ||
1384 | reclaim dentries and inodes at a "fair" rate with respect to pagecache and | ||
1385 | swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer | ||
1386 | to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 | ||
1387 | causes the kernel to prefer to reclaim dentries and inodes. | ||
1388 | |||
1389 | dirty_background_bytes | ||
1390 | ---------------------- | ||
1391 | |||
1392 | Contains the amount of dirty memory at which the pdflush background writeback | ||
1393 | daemon will start writeback. | ||
1394 | |||
1395 | If dirty_background_bytes is written, dirty_background_ratio becomes a function | ||
1396 | of its value (dirty_background_bytes / the amount of dirtyable system memory). | ||
1397 | |||
1398 | dirty_background_ratio | ||
1399 | ---------------------- | ||
1400 | |||
1401 | Contains, as a percentage of the dirtyable system memory (free pages + mapped | ||
1402 | pages + file cache, not including locked pages and HugePages), the number of | ||
1403 | pages at which the pdflush background writeback daemon will start writing out | ||
1404 | dirty data. | ||
1405 | |||
1406 | If dirty_background_ratio is written, dirty_background_bytes becomes a function | ||
1407 | of its value (dirty_background_ratio * the amount of dirtyable system memory). | ||
1408 | |||
1409 | dirty_bytes | ||
1410 | ----------- | ||
1411 | |||
1412 | Contains the amount of dirty memory at which a process generating disk writes | ||
1413 | will itself start writeback. | ||
1414 | |||
1415 | If dirty_bytes is written, dirty_ratio becomes a function of its value | ||
1416 | (dirty_bytes / the amount of dirtyable system memory). | ||
1417 | |||
1418 | dirty_ratio | ||
1419 | ----------- | ||
1420 | |||
1421 | Contains, as a percentage of the dirtyable system memory (free pages + mapped | ||
1422 | pages + file cache, not including locked pages and HugePages), the number of | ||
1423 | pages at which a process which is generating disk writes will itself start | ||
1424 | writing out dirty data. | ||
1425 | |||
1426 | If dirty_ratio is written, dirty_bytes becomes a function of its value | ||
1427 | (dirty_ratio * the amount of dirtyable system memory). | ||
1428 | |||
1429 | dirty_writeback_centisecs | ||
1430 | ------------------------- | ||
1431 | |||
1432 | The pdflush writeback daemons will periodically wake up and write `old' data | ||
1433 | out to disk. This tunable expresses the interval between those wakeups, in | ||
1434 | 100'ths of a second. | ||
1435 | |||
1436 | Setting this to zero disables periodic writeback altogether. | ||
1437 | |||
1438 | dirty_expire_centisecs | ||
1439 | ---------------------- | ||
1440 | |||
1441 | This tunable is used to define when dirty data is old enough to be eligible | ||
1442 | for writeout by the pdflush daemons. It is expressed in 100'ths of a second. | ||
1443 | Data which has been dirty in-memory for longer than this interval will be | ||
1444 | written out next time a pdflush daemon wakes up. | ||
1445 | |||
1446 | highmem_is_dirtyable | ||
1447 | -------------------- | ||
1448 | |||
1449 | Only present if CONFIG_HIGHMEM is set. | ||
1450 | |||
1451 | This defaults to 0 (false), meaning that the ratios set above are calculated | ||
1452 | as a percentage of lowmem only. This protects against excessive scanning | ||
1453 | in page reclaim, swapping and general VM distress. | ||
1454 | |||
1455 | Setting this to 1 can be useful on 32 bit machines where you want to make | ||
1456 | random changes within an MMAPed file that is larger than your available | ||
1457 | lowmem without causing large quantities of random IO. Is is safe if the | ||
1458 | behavior of all programs running on the machine is known and memory will | ||
1459 | not be otherwise stressed. | ||
1460 | |||
1461 | legacy_va_layout | ||
1462 | ---------------- | ||
1463 | |||
1464 | If non-zero, this sysctl disables the new 32-bit mmap mmap layout - the kernel | ||
1465 | will use the legacy (2.4) layout for all processes. | ||
1466 | |||
1467 | lowmem_reserve_ratio | ||
1468 | --------------------- | ||
1469 | |||
1470 | For some specialised workloads on highmem machines it is dangerous for | ||
1471 | the kernel to allow process memory to be allocated from the "lowmem" | ||
1472 | zone. This is because that memory could then be pinned via the mlock() | ||
1473 | system call, or by unavailability of swapspace. | ||
1474 | |||
1475 | And on large highmem machines this lack of reclaimable lowmem memory | ||
1476 | can be fatal. | ||
1477 | |||
1478 | So the Linux page allocator has a mechanism which prevents allocations | ||
1479 | which _could_ use highmem from using too much lowmem. This means that | ||
1480 | a certain amount of lowmem is defended from the possibility of being | ||
1481 | captured into pinned user memory. | ||
1482 | |||
1483 | (The same argument applies to the old 16 megabyte ISA DMA region. This | ||
1484 | mechanism will also defend that region from allocations which could use | ||
1485 | highmem or lowmem). | ||
1486 | |||
1487 | The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is | ||
1488 | in defending these lower zones. | ||
1489 | |||
1490 | If you have a machine which uses highmem or ISA DMA and your | ||
1491 | applications are using mlock(), or if you are running with no swap then | ||
1492 | you probably should change the lowmem_reserve_ratio setting. | ||
1493 | |||
1494 | The lowmem_reserve_ratio is an array. You can see them by reading this file. | ||
1495 | - | ||
1496 | % cat /proc/sys/vm/lowmem_reserve_ratio | ||
1497 | 256 256 32 | ||
1498 | - | ||
1499 | Note: # of this elements is one fewer than number of zones. Because the highest | ||
1500 | zone's value is not necessary for following calculation. | ||
1501 | |||
1502 | But, these values are not used directly. The kernel calculates # of protection | ||
1503 | pages for each zones from them. These are shown as array of protection pages | ||
1504 | in /proc/zoneinfo like followings. (This is an example of x86-64 box). | ||
1505 | Each zone has an array of protection pages like this. | ||
1506 | |||
1507 | - | ||
1508 | Node 0, zone DMA | ||
1509 | pages free 1355 | ||
1510 | min 3 | ||
1511 | low 3 | ||
1512 | high 4 | ||
1513 | : | ||
1514 | : | ||
1515 | numa_other 0 | ||
1516 | protection: (0, 2004, 2004, 2004) | ||
1517 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
1518 | pagesets | ||
1519 | cpu: 0 pcp: 0 | ||
1520 | : | ||
1521 | - | ||
1522 | These protections are added to score to judge whether this zone should be used | ||
1523 | for page allocation or should be reclaimed. | ||
1524 | |||
1525 | In this example, if normal pages (index=2) are required to this DMA zone and | ||
1526 | pages_high is used for watermark, the kernel judges this zone should not be | ||
1527 | used because pages_free(1355) is smaller than watermark + protection[2] | ||
1528 | (4 + 2004 = 2008). If this protection value is 0, this zone would be used for | ||
1529 | normal page requirement. If requirement is DMA zone(index=0), protection[0] | ||
1530 | (=0) is used. | ||
1531 | |||
1532 | zone[i]'s protection[j] is calculated by following expression. | ||
1533 | |||
1534 | (i < j): | ||
1535 | zone[i]->protection[j] | ||
1536 | = (total sums of present_pages from zone[i+1] to zone[j] on the node) | ||
1537 | / lowmem_reserve_ratio[i]; | ||
1538 | (i = j): | ||
1539 | (should not be protected. = 0; | ||
1540 | (i > j): | ||
1541 | (not necessary, but looks 0) | ||
1542 | |||
1543 | The default values of lowmem_reserve_ratio[i] are | ||
1544 | 256 (if zone[i] means DMA or DMA32 zone) | ||
1545 | 32 (others). | ||
1546 | As above expression, they are reciprocal number of ratio. | ||
1547 | 256 means 1/256. # of protection pages becomes about "0.39%" of total present | ||
1548 | pages of higher zones on the node. | ||
1549 | |||
1550 | If you would like to protect more pages, smaller values are effective. | ||
1551 | The minimum value is 1 (1/1 -> 100%). | ||
1552 | |||
1553 | page-cluster | ||
1554 | ------------ | ||
1555 | |||
1556 | page-cluster controls the number of pages which are written to swap in | ||
1557 | a single attempt. The swap I/O size. | ||
1558 | |||
1559 | It is a logarithmic value - setting it to zero means "1 page", setting | ||
1560 | it to 1 means "2 pages", setting it to 2 means "4 pages", etc. | ||
1561 | |||
1562 | The default value is three (eight pages at a time). There may be some | ||
1563 | small benefits in tuning this to a different value if your workload is | ||
1564 | swap-intensive. | ||
1565 | |||
1566 | overcommit_memory | ||
1567 | ----------------- | ||
1568 | |||
1569 | Controls overcommit of system memory, possibly allowing processes | ||
1570 | to allocate (but not use) more memory than is actually available. | ||
1571 | |||
1572 | |||
1573 | 0 - Heuristic overcommit handling. Obvious overcommits of | ||
1574 | address space are refused. Used for a typical system. It | ||
1575 | ensures a seriously wild allocation fails while allowing | ||
1576 | overcommit to reduce swap usage. root is allowed to | ||
1577 | allocate slightly more memory in this mode. This is the | ||
1578 | default. | ||
1579 | |||
1580 | 1 - Always overcommit. Appropriate for some scientific | ||
1581 | applications. | ||
1582 | |||
1583 | 2 - Don't overcommit. The total address space commit | ||
1584 | for the system is not permitted to exceed swap plus a | ||
1585 | configurable percentage (default is 50) of physical RAM. | ||
1586 | Depending on the percentage you use, in most situations | ||
1587 | this means a process will not be killed while attempting | ||
1588 | to use already-allocated memory but will receive errors | ||
1589 | on memory allocation as appropriate. | ||
1590 | |||
1591 | overcommit_ratio | ||
1592 | ---------------- | ||
1593 | |||
1594 | Percentage of physical memory size to include in overcommit calculations | ||
1595 | (see above.) | ||
1596 | |||
1597 | Memory allocation limit = swapspace + physmem * (overcommit_ratio / 100) | ||
1598 | |||
1599 | swapspace = total size of all swap areas | ||
1600 | physmem = size of physical memory in system | ||
1601 | |||
1602 | nr_hugepages and hugetlb_shm_group | ||
1603 | ---------------------------------- | ||
1604 | |||
1605 | nr_hugepages configures number of hugetlb page reserved for the system. | ||
1606 | |||
1607 | hugetlb_shm_group contains group id that is allowed to create SysV shared | ||
1608 | memory segment using hugetlb page. | ||
1609 | |||
1610 | hugepages_treat_as_movable | ||
1611 | -------------------------- | ||
1612 | |||
1613 | This parameter is only useful when kernelcore= is specified at boot time to | ||
1614 | create ZONE_MOVABLE for pages that may be reclaimed or migrated. Huge pages | ||
1615 | are not movable so are not normally allocated from ZONE_MOVABLE. A non-zero | ||
1616 | value written to hugepages_treat_as_movable allows huge pages to be allocated | ||
1617 | from ZONE_MOVABLE. | ||
1618 | |||
1619 | Once enabled, the ZONE_MOVABLE is treated as an area of memory the huge | ||
1620 | pages pool can easily grow or shrink within. Assuming that applications are | ||
1621 | not running that mlock() a lot of memory, it is likely the huge pages pool | ||
1622 | can grow to the size of ZONE_MOVABLE by repeatedly entering the desired value | ||
1623 | into nr_hugepages and triggering page reclaim. | ||
1624 | |||
1625 | laptop_mode | ||
1626 | ----------- | ||
1627 | |||
1628 | laptop_mode is a knob that controls "laptop mode". All the things that are | ||
1629 | controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt. | ||
1630 | |||
1631 | block_dump | ||
1632 | ---------- | ||
1633 | |||
1634 | block_dump enables block I/O debugging when set to a nonzero value. More | ||
1635 | information on block I/O debugging is in Documentation/laptops/laptop-mode.txt. | ||
1636 | |||
1637 | swap_token_timeout | ||
1638 | ------------------ | ||
1639 | |||
1640 | This file contains valid hold time of swap out protection token. The Linux | ||
1641 | VM has token based thrashing control mechanism and uses the token to prevent | ||
1642 | unnecessary page faults in thrashing situation. The unit of the value is | ||
1643 | second. The value would be useful to tune thrashing behavior. | ||
1644 | |||
1645 | drop_caches | ||
1646 | ----------- | ||
1647 | |||
1648 | Writing to this will cause the kernel to drop clean caches, dentries and | ||
1649 | inodes from memory, causing that memory to become free. | ||
1650 | |||
1651 | To free pagecache: | ||
1652 | echo 1 > /proc/sys/vm/drop_caches | ||
1653 | To free dentries and inodes: | ||
1654 | echo 2 > /proc/sys/vm/drop_caches | ||
1655 | To free pagecache, dentries and inodes: | ||
1656 | echo 3 > /proc/sys/vm/drop_caches | ||
1657 | |||
1658 | As this is a non-destructive operation and dirty objects are not freeable, the | ||
1659 | user should run `sync' first. | ||
1660 | 1376 | ||
1661 | 1377 | ||
1662 | 2.5 /proc/sys/dev - Device specific parameters | 1378 | 2.5 /proc/sys/dev - Device specific parameters |
diff --git a/Documentation/hwmon/adt7475 b/Documentation/hwmon/adt7475 new file mode 100644 index 000000000000..a2b1abec850e --- /dev/null +++ b/Documentation/hwmon/adt7475 | |||
@@ -0,0 +1,87 @@ | |||
1 | This describes the interface for the ADT7475 driver: | ||
2 | |||
3 | (there are 4 fans, numbered fan1 to fan4): | ||
4 | |||
5 | fanX_input Read the current speed of the fan (in RPMs) | ||
6 | fanX_min Read/write the minimum speed of the fan. Dropping | ||
7 | below this sets an alarm. | ||
8 | |||
9 | (there are three PWMs, numbered pwm1 to pwm3): | ||
10 | |||
11 | pwmX Read/write the current duty cycle of the PWM. Writes | ||
12 | only have effect when auto mode is turned off (see | ||
13 | below). Range is 0 - 255. | ||
14 | |||
15 | pwmX_enable Fan speed control method: | ||
16 | |||
17 | 0 - No control (fan at full speed) | ||
18 | 1 - Manual fan speed control (using pwm[1-*]) | ||
19 | 2 - Automatic fan speed control | ||
20 | |||
21 | pwmX_auto_channels_temp Select which channels affect this PWM | ||
22 | |||
23 | 1 - TEMP1 controls PWM | ||
24 | 2 - TEMP2 controls PWM | ||
25 | 4 - TEMP3 controls PWM | ||
26 | 6 - TEMP2 and TEMP3 control PWM | ||
27 | 7 - All three inputs control PWM | ||
28 | |||
29 | pwmX_freq Read/write the PWM frequency in Hz. The number | ||
30 | should be one of the following: | ||
31 | |||
32 | 11 Hz | ||
33 | 14 Hz | ||
34 | 22 Hz | ||
35 | 29 Hz | ||
36 | 35 Hz | ||
37 | 44 Hz | ||
38 | 58 Hz | ||
39 | 88 Hz | ||
40 | |||
41 | pwmX_auto_point1_pwm Read/write the minimum PWM duty cycle in automatic mode | ||
42 | |||
43 | pwmX_auto_point2_pwm Read/write the maximum PWM duty cycle in automatic mode | ||
44 | |||
45 | (there are three temperature settings numbered temp1 to temp3): | ||
46 | |||
47 | tempX_input Read the current temperature. The value is in milli | ||
48 | degrees of Celsius. | ||
49 | |||
50 | tempX_max Read/write the upper temperature limit - exceeding this | ||
51 | will cause an alarm. | ||
52 | |||
53 | tempX_min Read/write the lower temperature limit - exceeding this | ||
54 | will cause an alarm. | ||
55 | |||
56 | tempX_offset Read/write the temperature adjustment offset | ||
57 | |||
58 | tempX_crit Read/write the THERM limit for remote1. | ||
59 | |||
60 | tempX_crit_hyst Set the temperature value below crit where the | ||
61 | fans will stay on - this helps drive the temperature | ||
62 | low enough so it doesn't stay near the edge and | ||
63 | cause THERM to keep tripping. | ||
64 | |||
65 | tempX_auto_point1_temp Read/write the minimum temperature where the fans will | ||
66 | turn on in automatic mode. | ||
67 | |||
68 | tempX_auto_point2_temp Read/write the maximum temperature over which the fans | ||
69 | will run in automatic mode. tempX_auto_point1_temp | ||
70 | and tempX_auto_point2_temp together define the | ||
71 | range of automatic control. | ||
72 | |||
73 | tempX_alarm Read a 1 if the max/min alarm is set | ||
74 | tempX_fault Read a 1 if either temp1 or temp3 diode has a fault | ||
75 | |||
76 | (There are two voltage settings, in1 and in2): | ||
77 | |||
78 | inX_input Read the current voltage on VCC. Value is in | ||
79 | millivolts. | ||
80 | |||
81 | inX_min read/write the minimum voltage limit. | ||
82 | Dropping below this causes an alarm. | ||
83 | |||
84 | inX_max read/write the maximum voltage limit. | ||
85 | Exceeding this causes an alarm. | ||
86 | |||
87 | inX_alarm Read a 1 if the max/min alarm is set. | ||
diff --git a/Documentation/hwmon/lis3lv02d b/Documentation/hwmon/lis3lv02d index 65dfb0c0fd67..0fcfc4a7ccdc 100644 --- a/Documentation/hwmon/lis3lv02d +++ b/Documentation/hwmon/lis3lv02d | |||
@@ -13,18 +13,21 @@ Author: | |||
13 | Description | 13 | Description |
14 | ----------- | 14 | ----------- |
15 | 15 | ||
16 | This driver provides support for the accelerometer found in various HP laptops | 16 | This driver provides support for the accelerometer found in various HP |
17 | sporting the feature officially called "HP Mobile Data Protection System 3D" or | 17 | laptops sporting the feature officially called "HP Mobile Data |
18 | "HP 3D DriveGuard". It detect automatically laptops with this sensor. Known models | 18 | Protection System 3D" or "HP 3D DriveGuard". It detect automatically |
19 | (for now the HP 2133, nc6420, nc2510, nc8510, nc84x0, nw9440 and nx9420) will | 19 | laptops with this sensor. Known models (for now the HP 2133, nc6420, |
20 | have their axis automatically oriented on standard way (eg: you can directly | 20 | nc2510, nc8510, nc84x0, nw9440 and nx9420) will have their axis |
21 | play neverball). The accelerometer data is readable via | 21 | automatically oriented on standard way (eg: you can directly play |
22 | neverball). The accelerometer data is readable via | ||
22 | /sys/devices/platform/lis3lv02d. | 23 | /sys/devices/platform/lis3lv02d. |
23 | 24 | ||
24 | Sysfs attributes under /sys/devices/platform/lis3lv02d/: | 25 | Sysfs attributes under /sys/devices/platform/lis3lv02d/: |
25 | position - 3D position that the accelerometer reports. Format: "(x,y,z)" | 26 | position - 3D position that the accelerometer reports. Format: "(x,y,z)" |
26 | calibrate - read: values (x, y, z) that are used as the base for input class device operation. | 27 | calibrate - read: values (x, y, z) that are used as the base for input |
27 | write: forces the base to be recalibrated with the current position. | 28 | class device operation. |
29 | write: forces the base to be recalibrated with the current | ||
30 | position. | ||
28 | rate - reports the sampling rate of the accelerometer device in HZ | 31 | rate - reports the sampling rate of the accelerometer device in HZ |
29 | 32 | ||
30 | This driver also provides an absolute input class device, allowing | 33 | This driver also provides an absolute input class device, allowing |
@@ -39,11 +42,12 @@ the accelerometer are converted into a "standard" organisation of the axes | |||
39 | * When the laptop is horizontal the position reported is about 0 for X and Y | 42 | * When the laptop is horizontal the position reported is about 0 for X and Y |
40 | and a positive value for Z | 43 | and a positive value for Z |
41 | * If the left side is elevated, X increases (becomes positive) | 44 | * If the left side is elevated, X increases (becomes positive) |
42 | * If the front side (where the touchpad is) is elevated, Y decreases (becomes negative) | 45 | * If the front side (where the touchpad is) is elevated, Y decreases |
46 | (becomes negative) | ||
43 | * If the laptop is put upside-down, Z becomes negative | 47 | * If the laptop is put upside-down, Z becomes negative |
44 | 48 | ||
45 | If your laptop model is not recognized (cf "dmesg"), you can send an email to the | 49 | If your laptop model is not recognized (cf "dmesg"), you can send an |
46 | authors to add it to the database. When reporting a new laptop, please include | 50 | email to the authors to add it to the database. When reporting a new |
47 | the output of "dmidecode" plus the value of /sys/devices/platform/lis3lv02d/position | 51 | laptop, please include the output of "dmidecode" plus the value of |
48 | in these four cases. | 52 | /sys/devices/platform/lis3lv02d/position in these four cases. |
49 | 53 | ||
diff --git a/Documentation/mips/AU1xxx_IDE.README b/Documentation/mips/AU1xxx_IDE.README index f54962aea84d..8ace35ebdcd5 100644 --- a/Documentation/mips/AU1xxx_IDE.README +++ b/Documentation/mips/AU1xxx_IDE.README | |||
@@ -52,14 +52,12 @@ Two files are introduced: | |||
52 | b) 'drivers/ide/mips/au1xxx-ide.c' | 52 | b) 'drivers/ide/mips/au1xxx-ide.c' |
53 | contains the functionality of the AU1XXX IDE driver | 53 | contains the functionality of the AU1XXX IDE driver |
54 | 54 | ||
55 | Four configs variables are introduced: | 55 | Following extra configs variables are introduced: |
56 | 56 | ||
57 | CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA - enable the PIO+DBDMA mode | 57 | CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA - enable the PIO+DBDMA mode |
58 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - enable the MWDMA mode | 58 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - enable the MWDMA mode |
59 | CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON - set Burstable FIFO in DBDMA | 59 | CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON - set Burstable FIFO in DBDMA |
60 | controller | 60 | controller |
61 | CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ - maximum transfer size | ||
62 | per descriptor | ||
63 | 61 | ||
64 | 62 | ||
65 | SUPPORTED IDE MODES | 63 | SUPPORTED IDE MODES |
@@ -87,7 +85,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y | |||
87 | CONFIG_IDEDMA_PCI_AUTO=y | 85 | CONFIG_IDEDMA_PCI_AUTO=y |
88 | CONFIG_BLK_DEV_IDE_AU1XXX=y | 86 | CONFIG_BLK_DEV_IDE_AU1XXX=y |
89 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y | 87 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y |
90 | CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128 | ||
91 | CONFIG_BLK_DEV_IDEDMA=y | 88 | CONFIG_BLK_DEV_IDEDMA=y |
92 | CONFIG_IDEDMA_AUTO=y | 89 | CONFIG_IDEDMA_AUTO=y |
93 | 90 | ||
@@ -105,7 +102,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y | |||
105 | CONFIG_IDEDMA_PCI_AUTO=y | 102 | CONFIG_IDEDMA_PCI_AUTO=y |
106 | CONFIG_BLK_DEV_IDE_AU1XXX=y | 103 | CONFIG_BLK_DEV_IDE_AU1XXX=y |
107 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y | 104 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y |
108 | CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128 | ||
109 | CONFIG_BLK_DEV_IDEDMA=y | 105 | CONFIG_BLK_DEV_IDEDMA=y |
110 | CONFIG_IDEDMA_AUTO=y | 106 | CONFIG_IDEDMA_AUTO=y |
111 | 107 | ||
diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt index 8398ca4ff4ed..6f33593e59e2 100644 --- a/Documentation/scheduler/sched-design-CFS.txt +++ b/Documentation/scheduler/sched-design-CFS.txt | |||
@@ -231,7 +231,7 @@ CPU bandwidth control purposes: | |||
231 | 231 | ||
232 | This options needs CONFIG_CGROUPS to be defined, and lets the administrator | 232 | This options needs CONFIG_CGROUPS to be defined, and lets the administrator |
233 | create arbitrary groups of tasks, using the "cgroup" pseudo filesystem. See | 233 | create arbitrary groups of tasks, using the "cgroup" pseudo filesystem. See |
234 | Documentation/cgroups.txt for more information about this filesystem. | 234 | Documentation/cgroups/cgroups.txt for more information about this filesystem. |
235 | 235 | ||
236 | Only one of these options to group tasks can be chosen and not both. | 236 | Only one of these options to group tasks can be chosen and not both. |
237 | 237 | ||
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index 4b7ac21ea9eb..64eb1100eec1 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
@@ -275,7 +275,8 @@ STAC9200 | |||
275 | dell-m25 Dell Inspiron E1505n | 275 | dell-m25 Dell Inspiron E1505n |
276 | dell-m26 Dell Inspiron 1501 | 276 | dell-m26 Dell Inspiron 1501 |
277 | dell-m27 Dell Inspiron E1705/9400 | 277 | dell-m27 Dell Inspiron E1705/9400 |
278 | gateway Gateway laptops with EAPD control | 278 | gateway-m4 Gateway laptops with EAPD control |
279 | gateway-m4-2 Gateway laptops with EAPD control | ||
279 | panasonic Panasonic CF-74 | 280 | panasonic Panasonic CF-74 |
280 | 281 | ||
281 | STAC9205/9254 | 282 | STAC9205/9254 |
@@ -302,6 +303,7 @@ STAC9220/9221 | |||
302 | macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3) | 303 | macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3) |
303 | imac-intel Intel iMac (eq. type 2) | 304 | imac-intel Intel iMac (eq. type 2) |
304 | imac-intel-20 Intel iMac (newer version) (eq. type 3) | 305 | imac-intel-20 Intel iMac (newer version) (eq. type 3) |
306 | ecs202 ECS/PC chips | ||
305 | dell-d81 Dell (unknown) | 307 | dell-d81 Dell (unknown) |
306 | dell-d82 Dell (unknown) | 308 | dell-d82 Dell (unknown) |
307 | dell-m81 Dell (unknown) | 309 | dell-m81 Dell (unknown) |
@@ -310,9 +312,13 @@ STAC9220/9221 | |||
310 | STAC9202/9250/9251 | 312 | STAC9202/9250/9251 |
311 | ================== | 313 | ================== |
312 | ref Reference board, base config | 314 | ref Reference board, base config |
315 | m1 Some Gateway MX series laptops (NX560XL) | ||
316 | m1-2 Some Gateway MX series laptops (MX6453) | ||
317 | m2 Some Gateway MX series laptops (M255) | ||
313 | m2-2 Some Gateway MX series laptops | 318 | m2-2 Some Gateway MX series laptops |
319 | m3 Some Gateway MX series laptops | ||
320 | m5 Some Gateway MX series laptops (MP6954) | ||
314 | m6 Some Gateway NX series laptops | 321 | m6 Some Gateway NX series laptops |
315 | pa6 Gateway NX860 series | ||
316 | 322 | ||
317 | STAC9227/9228/9229/927x | 323 | STAC9227/9228/9229/927x |
318 | ======================= | 324 | ======================= |
@@ -329,6 +335,7 @@ STAC92HD71B* | |||
329 | dell-m4-1 Dell desktops | 335 | dell-m4-1 Dell desktops |
330 | dell-m4-2 Dell desktops | 336 | dell-m4-2 Dell desktops |
331 | dell-m4-3 Dell desktops | 337 | dell-m4-3 Dell desktops |
338 | hp-m4 HP dv laptops | ||
332 | 339 | ||
333 | STAC92HD73* | 340 | STAC92HD73* |
334 | =========== | 341 | =========== |
@@ -337,6 +344,7 @@ STAC92HD73* | |||
337 | dell-m6-amic Dell desktops/laptops with analog mics | 344 | dell-m6-amic Dell desktops/laptops with analog mics |
338 | dell-m6-dmic Dell desktops/laptops with digital mics | 345 | dell-m6-dmic Dell desktops/laptops with digital mics |
339 | dell-m6 Dell desktops/laptops with both type of mics | 346 | dell-m6 Dell desktops/laptops with both type of mics |
347 | dell-eq Dell desktops/laptops | ||
340 | 348 | ||
341 | STAC92HD83* | 349 | STAC92HD83* |
342 | =========== | 350 | =========== |
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index a3415070bcac..3197fc83bc51 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -1,12 +1,13 @@ | |||
1 | Documentation for /proc/sys/vm/* kernel version 2.2.10 | 1 | Documentation for /proc/sys/vm/* kernel version 2.6.29 |
2 | (c) 1998, 1999, Rik van Riel <riel@nl.linux.org> | 2 | (c) 1998, 1999, Rik van Riel <riel@nl.linux.org> |
3 | (c) 2008 Peter W. Morreale <pmorreale@novell.com> | ||
3 | 4 | ||
4 | For general info and legal blurb, please look in README. | 5 | For general info and legal blurb, please look in README. |
5 | 6 | ||
6 | ============================================================== | 7 | ============================================================== |
7 | 8 | ||
8 | This file contains the documentation for the sysctl files in | 9 | This file contains the documentation for the sysctl files in |
9 | /proc/sys/vm and is valid for Linux kernel version 2.2. | 10 | /proc/sys/vm and is valid for Linux kernel version 2.6.29. |
10 | 11 | ||
11 | The files in this directory can be used to tune the operation | 12 | The files in this directory can be used to tune the operation |
12 | of the virtual memory (VM) subsystem of the Linux kernel and | 13 | of the virtual memory (VM) subsystem of the Linux kernel and |
@@ -16,180 +17,274 @@ Default values and initialization routines for most of these | |||
16 | files can be found in mm/swap.c. | 17 | files can be found in mm/swap.c. |
17 | 18 | ||
18 | Currently, these files are in /proc/sys/vm: | 19 | Currently, these files are in /proc/sys/vm: |
19 | - overcommit_memory | 20 | |
20 | - page-cluster | 21 | - block_dump |
21 | - dirty_ratio | 22 | - dirty_background_bytes |
22 | - dirty_background_ratio | 23 | - dirty_background_ratio |
24 | - dirty_bytes | ||
23 | - dirty_expire_centisecs | 25 | - dirty_expire_centisecs |
26 | - dirty_ratio | ||
24 | - dirty_writeback_centisecs | 27 | - dirty_writeback_centisecs |
25 | - highmem_is_dirtyable (only if CONFIG_HIGHMEM set) | 28 | - drop_caches |
29 | - hugepages_treat_as_movable | ||
30 | - hugetlb_shm_group | ||
31 | - laptop_mode | ||
32 | - legacy_va_layout | ||
33 | - lowmem_reserve_ratio | ||
26 | - max_map_count | 34 | - max_map_count |
27 | - min_free_kbytes | 35 | - min_free_kbytes |
28 | - laptop_mode | ||
29 | - block_dump | ||
30 | - drop-caches | ||
31 | - zone_reclaim_mode | ||
32 | - min_unmapped_ratio | ||
33 | - min_slab_ratio | 36 | - min_slab_ratio |
34 | - panic_on_oom | 37 | - min_unmapped_ratio |
35 | - oom_dump_tasks | 38 | - mmap_min_addr |
36 | - oom_kill_allocating_task | ||
37 | - mmap_min_address | ||
38 | - numa_zonelist_order | ||
39 | - nr_hugepages | 39 | - nr_hugepages |
40 | - nr_overcommit_hugepages | 40 | - nr_overcommit_hugepages |
41 | - nr_trim_pages (only if CONFIG_MMU=n) | 41 | - nr_pdflush_threads |
42 | - nr_trim_pages (only if CONFIG_MMU=n) | ||
43 | - numa_zonelist_order | ||
44 | - oom_dump_tasks | ||
45 | - oom_kill_allocating_task | ||
46 | - overcommit_memory | ||
47 | - overcommit_ratio | ||
48 | - page-cluster | ||
49 | - panic_on_oom | ||
50 | - percpu_pagelist_fraction | ||
51 | - stat_interval | ||
52 | - swappiness | ||
53 | - vfs_cache_pressure | ||
54 | - zone_reclaim_mode | ||
55 | |||
42 | 56 | ||
43 | ============================================================== | 57 | ============================================================== |
44 | 58 | ||
45 | dirty_bytes, dirty_ratio, dirty_background_bytes, | 59 | block_dump |
46 | dirty_background_ratio, dirty_expire_centisecs, | ||
47 | dirty_writeback_centisecs, highmem_is_dirtyable, | ||
48 | vfs_cache_pressure, laptop_mode, block_dump, swap_token_timeout, | ||
49 | drop-caches, hugepages_treat_as_movable: | ||
50 | 60 | ||
51 | See Documentation/filesystems/proc.txt | 61 | block_dump enables block I/O debugging when set to a nonzero value. More |
62 | information on block I/O debugging is in Documentation/laptops/laptop-mode.txt. | ||
52 | 63 | ||
53 | ============================================================== | 64 | ============================================================== |
54 | 65 | ||
55 | overcommit_memory: | 66 | dirty_background_bytes |
56 | 67 | ||
57 | This value contains a flag that enables memory overcommitment. | 68 | Contains the amount of dirty memory at which the pdflush background writeback |
69 | daemon will start writeback. | ||
58 | 70 | ||
59 | When this flag is 0, the kernel attempts to estimate the amount | 71 | If dirty_background_bytes is written, dirty_background_ratio becomes a function |
60 | of free memory left when userspace requests more memory. | 72 | of its value (dirty_background_bytes / the amount of dirtyable system memory). |
61 | 73 | ||
62 | When this flag is 1, the kernel pretends there is always enough | 74 | ============================================================== |
63 | memory until it actually runs out. | ||
64 | 75 | ||
65 | When this flag is 2, the kernel uses a "never overcommit" | 76 | dirty_background_ratio |
66 | policy that attempts to prevent any overcommit of memory. | ||
67 | 77 | ||
68 | This feature can be very useful because there are a lot of | 78 | Contains, as a percentage of total system memory, the number of pages at which |
69 | programs that malloc() huge amounts of memory "just-in-case" | 79 | the pdflush background writeback daemon will start writing out dirty data. |
70 | and don't use much of it. | ||
71 | 80 | ||
72 | The default value is 0. | 81 | ============================================================== |
73 | 82 | ||
74 | See Documentation/vm/overcommit-accounting and | 83 | dirty_bytes |
75 | security/commoncap.c::cap_vm_enough_memory() for more information. | 84 | |
85 | Contains the amount of dirty memory at which a process generating disk writes | ||
86 | will itself start writeback. | ||
87 | |||
88 | If dirty_bytes is written, dirty_ratio becomes a function of its value | ||
89 | (dirty_bytes / the amount of dirtyable system memory). | ||
76 | 90 | ||
77 | ============================================================== | 91 | ============================================================== |
78 | 92 | ||
79 | overcommit_ratio: | 93 | dirty_expire_centisecs |
80 | 94 | ||
81 | When overcommit_memory is set to 2, the committed address | 95 | This tunable is used to define when dirty data is old enough to be eligible |
82 | space is not permitted to exceed swap plus this percentage | 96 | for writeout by the pdflush daemons. It is expressed in 100'ths of a second. |
83 | of physical RAM. See above. | 97 | Data which has been dirty in-memory for longer than this interval will be |
98 | written out next time a pdflush daemon wakes up. | ||
99 | |||
100 | ============================================================== | ||
101 | |||
102 | dirty_ratio | ||
103 | |||
104 | Contains, as a percentage of total system memory, the number of pages at which | ||
105 | a process which is generating disk writes will itself start writing out dirty | ||
106 | data. | ||
84 | 107 | ||
85 | ============================================================== | 108 | ============================================================== |
86 | 109 | ||
87 | page-cluster: | 110 | dirty_writeback_centisecs |
88 | 111 | ||
89 | The Linux VM subsystem avoids excessive disk seeks by reading | 112 | The pdflush writeback daemons will periodically wake up and write `old' data |
90 | multiple pages on a page fault. The number of pages it reads | 113 | out to disk. This tunable expresses the interval between those wakeups, in |
91 | is dependent on the amount of memory in your machine. | 114 | 100'ths of a second. |
92 | 115 | ||
93 | The number of pages the kernel reads in at once is equal to | 116 | Setting this to zero disables periodic writeback altogether. |
94 | 2 ^ page-cluster. Values above 2 ^ 5 don't make much sense | ||
95 | for swap because we only cluster swap data in 32-page groups. | ||
96 | 117 | ||
97 | ============================================================== | 118 | ============================================================== |
98 | 119 | ||
99 | max_map_count: | 120 | drop_caches |
100 | 121 | ||
101 | This file contains the maximum number of memory map areas a process | 122 | Writing to this will cause the kernel to drop clean caches, dentries and |
102 | may have. Memory map areas are used as a side-effect of calling | 123 | inodes from memory, causing that memory to become free. |
103 | malloc, directly by mmap and mprotect, and also when loading shared | ||
104 | libraries. | ||
105 | 124 | ||
106 | While most applications need less than a thousand maps, certain | 125 | To free pagecache: |
107 | programs, particularly malloc debuggers, may consume lots of them, | 126 | echo 1 > /proc/sys/vm/drop_caches |
108 | e.g., up to one or two maps per allocation. | 127 | To free dentries and inodes: |
128 | echo 2 > /proc/sys/vm/drop_caches | ||
129 | To free pagecache, dentries and inodes: | ||
130 | echo 3 > /proc/sys/vm/drop_caches | ||
109 | 131 | ||
110 | The default value is 65536. | 132 | As this is a non-destructive operation and dirty objects are not freeable, the |
133 | user should run `sync' first. | ||
111 | 134 | ||
112 | ============================================================== | 135 | ============================================================== |
113 | 136 | ||
114 | min_free_kbytes: | 137 | hugepages_treat_as_movable |
115 | 138 | ||
116 | This is used to force the Linux VM to keep a minimum number | 139 | This parameter is only useful when kernelcore= is specified at boot time to |
117 | of kilobytes free. The VM uses this number to compute a pages_min | 140 | create ZONE_MOVABLE for pages that may be reclaimed or migrated. Huge pages |
118 | value for each lowmem zone in the system. Each lowmem zone gets | 141 | are not movable so are not normally allocated from ZONE_MOVABLE. A non-zero |
119 | a number of reserved free pages based proportionally on its size. | 142 | value written to hugepages_treat_as_movable allows huge pages to be allocated |
143 | from ZONE_MOVABLE. | ||
120 | 144 | ||
121 | Some minimal amount of memory is needed to satisfy PF_MEMALLOC | 145 | Once enabled, the ZONE_MOVABLE is treated as an area of memory the huge |
122 | allocations; if you set this to lower than 1024KB, your system will | 146 | pages pool can easily grow or shrink within. Assuming that applications are |
123 | become subtly broken, and prone to deadlock under high loads. | 147 | not running that mlock() a lot of memory, it is likely the huge pages pool |
124 | 148 | can grow to the size of ZONE_MOVABLE by repeatedly entering the desired value | |
125 | Setting this too high will OOM your machine instantly. | 149 | into nr_hugepages and triggering page reclaim. |
126 | 150 | ||
127 | ============================================================== | 151 | ============================================================== |
128 | 152 | ||
129 | percpu_pagelist_fraction | 153 | hugetlb_shm_group |
130 | 154 | ||
131 | This is the fraction of pages at most (high mark pcp->high) in each zone that | 155 | hugetlb_shm_group contains group id that is allowed to create SysV |
132 | are allocated for each per cpu page list. The min value for this is 8. It | 156 | shared memory segment using hugetlb page. |
133 | means that we don't allow more than 1/8th of pages in each zone to be | ||
134 | allocated in any single per_cpu_pagelist. This entry only changes the value | ||
135 | of hot per cpu pagelists. User can specify a number like 100 to allocate | ||
136 | 1/100th of each zone to each per cpu page list. | ||
137 | 157 | ||
138 | The batch value of each per cpu pagelist is also updated as a result. It is | 158 | ============================================================== |
139 | set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8) | ||
140 | 159 | ||
141 | The initial value is zero. Kernel does not use this value at boot time to set | 160 | laptop_mode |
142 | the high water marks for each per cpu page list. | ||
143 | 161 | ||
144 | =============================================================== | 162 | laptop_mode is a knob that controls "laptop mode". All the things that are |
163 | controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt. | ||
145 | 164 | ||
146 | zone_reclaim_mode: | 165 | ============================================================== |
147 | 166 | ||
148 | Zone_reclaim_mode allows someone to set more or less aggressive approaches to | 167 | legacy_va_layout |
149 | reclaim memory when a zone runs out of memory. If it is set to zero then no | ||
150 | zone reclaim occurs. Allocations will be satisfied from other zones / nodes | ||
151 | in the system. | ||
152 | 168 | ||
153 | This is value ORed together of | 169 | If non-zero, this sysctl disables the new 32-bit mmap mmap layout - the kernel |
170 | will use the legacy (2.4) layout for all processes. | ||
154 | 171 | ||
155 | 1 = Zone reclaim on | 172 | ============================================================== |
156 | 2 = Zone reclaim writes dirty pages out | ||
157 | 4 = Zone reclaim swaps pages | ||
158 | 173 | ||
159 | zone_reclaim_mode is set during bootup to 1 if it is determined that pages | 174 | lowmem_reserve_ratio |
160 | from remote zones will cause a measurable performance reduction. The | 175 | |
161 | page allocator will then reclaim easily reusable pages (those page | 176 | For some specialised workloads on highmem machines it is dangerous for |
162 | cache pages that are currently not used) before allocating off node pages. | 177 | the kernel to allow process memory to be allocated from the "lowmem" |
178 | zone. This is because that memory could then be pinned via the mlock() | ||
179 | system call, or by unavailability of swapspace. | ||
180 | |||
181 | And on large highmem machines this lack of reclaimable lowmem memory | ||
182 | can be fatal. | ||
183 | |||
184 | So the Linux page allocator has a mechanism which prevents allocations | ||
185 | which _could_ use highmem from using too much lowmem. This means that | ||
186 | a certain amount of lowmem is defended from the possibility of being | ||
187 | captured into pinned user memory. | ||
188 | |||
189 | (The same argument applies to the old 16 megabyte ISA DMA region. This | ||
190 | mechanism will also defend that region from allocations which could use | ||
191 | highmem or lowmem). | ||
192 | |||
193 | The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is | ||
194 | in defending these lower zones. | ||
195 | |||
196 | If you have a machine which uses highmem or ISA DMA and your | ||
197 | applications are using mlock(), or if you are running with no swap then | ||
198 | you probably should change the lowmem_reserve_ratio setting. | ||
199 | |||
200 | The lowmem_reserve_ratio is an array. You can see them by reading this file. | ||
201 | - | ||
202 | % cat /proc/sys/vm/lowmem_reserve_ratio | ||
203 | 256 256 32 | ||
204 | - | ||
205 | Note: # of this elements is one fewer than number of zones. Because the highest | ||
206 | zone's value is not necessary for following calculation. | ||
207 | |||
208 | But, these values are not used directly. The kernel calculates # of protection | ||
209 | pages for each zones from them. These are shown as array of protection pages | ||
210 | in /proc/zoneinfo like followings. (This is an example of x86-64 box). | ||
211 | Each zone has an array of protection pages like this. | ||
212 | |||
213 | - | ||
214 | Node 0, zone DMA | ||
215 | pages free 1355 | ||
216 | min 3 | ||
217 | low 3 | ||
218 | high 4 | ||
219 | : | ||
220 | : | ||
221 | numa_other 0 | ||
222 | protection: (0, 2004, 2004, 2004) | ||
223 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
224 | pagesets | ||
225 | cpu: 0 pcp: 0 | ||
226 | : | ||
227 | - | ||
228 | These protections are added to score to judge whether this zone should be used | ||
229 | for page allocation or should be reclaimed. | ||
230 | |||
231 | In this example, if normal pages (index=2) are required to this DMA zone and | ||
232 | pages_high is used for watermark, the kernel judges this zone should not be | ||
233 | used because pages_free(1355) is smaller than watermark + protection[2] | ||
234 | (4 + 2004 = 2008). If this protection value is 0, this zone would be used for | ||
235 | normal page requirement. If requirement is DMA zone(index=0), protection[0] | ||
236 | (=0) is used. | ||
237 | |||
238 | zone[i]'s protection[j] is calculated by following expression. | ||
239 | |||
240 | (i < j): | ||
241 | zone[i]->protection[j] | ||
242 | = (total sums of present_pages from zone[i+1] to zone[j] on the node) | ||
243 | / lowmem_reserve_ratio[i]; | ||
244 | (i = j): | ||
245 | (should not be protected. = 0; | ||
246 | (i > j): | ||
247 | (not necessary, but looks 0) | ||
248 | |||
249 | The default values of lowmem_reserve_ratio[i] are | ||
250 | 256 (if zone[i] means DMA or DMA32 zone) | ||
251 | 32 (others). | ||
252 | As above expression, they are reciprocal number of ratio. | ||
253 | 256 means 1/256. # of protection pages becomes about "0.39%" of total present | ||
254 | pages of higher zones on the node. | ||
255 | |||
256 | If you would like to protect more pages, smaller values are effective. | ||
257 | The minimum value is 1 (1/1 -> 100%). | ||
163 | 258 | ||
164 | It may be beneficial to switch off zone reclaim if the system is | 259 | ============================================================== |
165 | used for a file server and all of memory should be used for caching files | ||
166 | from disk. In that case the caching effect is more important than | ||
167 | data locality. | ||
168 | 260 | ||
169 | Allowing zone reclaim to write out pages stops processes that are | 261 | max_map_count: |
170 | writing large amounts of data from dirtying pages on other nodes. Zone | ||
171 | reclaim will write out dirty pages if a zone fills up and so effectively | ||
172 | throttle the process. This may decrease the performance of a single process | ||
173 | since it cannot use all of system memory to buffer the outgoing writes | ||
174 | anymore but it preserve the memory on other nodes so that the performance | ||
175 | of other processes running on other nodes will not be affected. | ||
176 | 262 | ||
177 | Allowing regular swap effectively restricts allocations to the local | 263 | This file contains the maximum number of memory map areas a process |
178 | node unless explicitly overridden by memory policies or cpuset | 264 | may have. Memory map areas are used as a side-effect of calling |
179 | configurations. | 265 | malloc, directly by mmap and mprotect, and also when loading shared |
266 | libraries. | ||
180 | 267 | ||
181 | ============================================================= | 268 | While most applications need less than a thousand maps, certain |
269 | programs, particularly malloc debuggers, may consume lots of them, | ||
270 | e.g., up to one or two maps per allocation. | ||
182 | 271 | ||
183 | min_unmapped_ratio: | 272 | The default value is 65536. |
184 | 273 | ||
185 | This is available only on NUMA kernels. | 274 | ============================================================== |
186 | 275 | ||
187 | A percentage of the total pages in each zone. Zone reclaim will only | 276 | min_free_kbytes: |
188 | occur if more than this percentage of pages are file backed and unmapped. | ||
189 | This is to insure that a minimal amount of local pages is still available for | ||
190 | file I/O even if the node is overallocated. | ||
191 | 277 | ||
192 | The default is 1 percent. | 278 | This is used to force the Linux VM to keep a minimum number |
279 | of kilobytes free. The VM uses this number to compute a pages_min | ||
280 | value for each lowmem zone in the system. Each lowmem zone gets | ||
281 | a number of reserved free pages based proportionally on its size. | ||
282 | |||
283 | Some minimal amount of memory is needed to satisfy PF_MEMALLOC | ||
284 | allocations; if you set this to lower than 1024KB, your system will | ||
285 | become subtly broken, and prone to deadlock under high loads. | ||
286 | |||
287 | Setting this too high will OOM your machine instantly. | ||
193 | 288 | ||
194 | ============================================================= | 289 | ============================================================= |
195 | 290 | ||
@@ -211,82 +306,73 @@ and may not be fast. | |||
211 | 306 | ||
212 | ============================================================= | 307 | ============================================================= |
213 | 308 | ||
214 | panic_on_oom | 309 | min_unmapped_ratio: |
215 | 310 | ||
216 | This enables or disables panic on out-of-memory feature. | 311 | This is available only on NUMA kernels. |
217 | 312 | ||
218 | If this is set to 0, the kernel will kill some rogue process, | 313 | A percentage of the total pages in each zone. Zone reclaim will only |
219 | called oom_killer. Usually, oom_killer can kill rogue processes and | 314 | occur if more than this percentage of pages are file backed and unmapped. |
220 | system will survive. | 315 | This is to insure that a minimal amount of local pages is still available for |
316 | file I/O even if the node is overallocated. | ||
221 | 317 | ||
222 | If this is set to 1, the kernel panics when out-of-memory happens. | 318 | The default is 1 percent. |
223 | However, if a process limits using nodes by mempolicy/cpusets, | ||
224 | and those nodes become memory exhaustion status, one process | ||
225 | may be killed by oom-killer. No panic occurs in this case. | ||
226 | Because other nodes' memory may be free. This means system total status | ||
227 | may be not fatal yet. | ||
228 | 319 | ||
229 | If this is set to 2, the kernel panics compulsorily even on the | 320 | ============================================================== |
230 | above-mentioned. | ||
231 | 321 | ||
232 | The default value is 0. | 322 | mmap_min_addr |
233 | 1 and 2 are for failover of clustering. Please select either | ||
234 | according to your policy of failover. | ||
235 | 323 | ||
236 | ============================================================= | 324 | This file indicates the amount of address space which a user process will |
325 | be restricted from mmaping. Since kernel null dereference bugs could | ||
326 | accidentally operate based on the information in the first couple of pages | ||
327 | of memory userspace processes should not be allowed to write to them. By | ||
328 | default this value is set to 0 and no protections will be enforced by the | ||
329 | security module. Setting this value to something like 64k will allow the | ||
330 | vast majority of applications to work correctly and provide defense in depth | ||
331 | against future potential kernel bugs. | ||
237 | 332 | ||
238 | oom_dump_tasks | 333 | ============================================================== |
239 | 334 | ||
240 | Enables a system-wide task dump (excluding kernel threads) to be | 335 | nr_hugepages |
241 | produced when the kernel performs an OOM-killing and includes such | ||
242 | information as pid, uid, tgid, vm size, rss, cpu, oom_adj score, and | ||
243 | name. This is helpful to determine why the OOM killer was invoked | ||
244 | and to identify the rogue task that caused it. | ||
245 | 336 | ||
246 | If this is set to zero, this information is suppressed. On very | 337 | Change the minimum size of the hugepage pool. |
247 | large systems with thousands of tasks it may not be feasible to dump | ||
248 | the memory state information for each one. Such systems should not | ||
249 | be forced to incur a performance penalty in OOM conditions when the | ||
250 | information may not be desired. | ||
251 | 338 | ||
252 | If this is set to non-zero, this information is shown whenever the | 339 | See Documentation/vm/hugetlbpage.txt |
253 | OOM killer actually kills a memory-hogging task. | ||
254 | 340 | ||
255 | The default value is 0. | 341 | ============================================================== |
256 | 342 | ||
257 | ============================================================= | 343 | nr_overcommit_hugepages |
258 | 344 | ||
259 | oom_kill_allocating_task | 345 | Change the maximum size of the hugepage pool. The maximum is |
346 | nr_hugepages + nr_overcommit_hugepages. | ||
260 | 347 | ||
261 | This enables or disables killing the OOM-triggering task in | 348 | See Documentation/vm/hugetlbpage.txt |
262 | out-of-memory situations. | ||
263 | 349 | ||
264 | If this is set to zero, the OOM killer will scan through the entire | 350 | ============================================================== |
265 | tasklist and select a task based on heuristics to kill. This normally | ||
266 | selects a rogue memory-hogging task that frees up a large amount of | ||
267 | memory when killed. | ||
268 | 351 | ||
269 | If this is set to non-zero, the OOM killer simply kills the task that | 352 | nr_pdflush_threads |
270 | triggered the out-of-memory condition. This avoids the expensive | ||
271 | tasklist scan. | ||
272 | 353 | ||
273 | If panic_on_oom is selected, it takes precedence over whatever value | 354 | The current number of pdflush threads. This value is read-only. |
274 | is used in oom_kill_allocating_task. | 355 | The value changes according to the number of dirty pages in the system. |
275 | 356 | ||
276 | The default value is 0. | 357 | When neccessary, additional pdflush threads are created, one per second, up to |
358 | nr_pdflush_threads_max. | ||
277 | 359 | ||
278 | ============================================================== | 360 | ============================================================== |
279 | 361 | ||
280 | mmap_min_addr | 362 | nr_trim_pages |
281 | 363 | ||
282 | This file indicates the amount of address space which a user process will | 364 | This is available only on NOMMU kernels. |
283 | be restricted from mmaping. Since kernel null dereference bugs could | 365 | |
284 | accidentally operate based on the information in the first couple of pages | 366 | This value adjusts the excess page trimming behaviour of power-of-2 aligned |
285 | of memory userspace processes should not be allowed to write to them. By | 367 | NOMMU mmap allocations. |
286 | default this value is set to 0 and no protections will be enforced by the | 368 | |
287 | security module. Setting this value to something like 64k will allow the | 369 | A value of 0 disables trimming of allocations entirely, while a value of 1 |
288 | vast majority of applications to work correctly and provide defense in depth | 370 | trims excess pages aggressively. Any value >= 1 acts as the watermark where |
289 | against future potential kernel bugs. | 371 | trimming of allocations is initiated. |
372 | |||
373 | The default value is 1. | ||
374 | |||
375 | See Documentation/nommu-mmap.txt for more information. | ||
290 | 376 | ||
291 | ============================================================== | 377 | ============================================================== |
292 | 378 | ||
@@ -335,34 +421,199 @@ this is causing problems for your system/application. | |||
335 | 421 | ||
336 | ============================================================== | 422 | ============================================================== |
337 | 423 | ||
338 | nr_hugepages | 424 | oom_dump_tasks |
339 | 425 | ||
340 | Change the minimum size of the hugepage pool. | 426 | Enables a system-wide task dump (excluding kernel threads) to be |
427 | produced when the kernel performs an OOM-killing and includes such | ||
428 | information as pid, uid, tgid, vm size, rss, cpu, oom_adj score, and | ||
429 | name. This is helpful to determine why the OOM killer was invoked | ||
430 | and to identify the rogue task that caused it. | ||
341 | 431 | ||
342 | See Documentation/vm/hugetlbpage.txt | 432 | If this is set to zero, this information is suppressed. On very |
433 | large systems with thousands of tasks it may not be feasible to dump | ||
434 | the memory state information for each one. Such systems should not | ||
435 | be forced to incur a performance penalty in OOM conditions when the | ||
436 | information may not be desired. | ||
437 | |||
438 | If this is set to non-zero, this information is shown whenever the | ||
439 | OOM killer actually kills a memory-hogging task. | ||
440 | |||
441 | The default value is 0. | ||
343 | 442 | ||
344 | ============================================================== | 443 | ============================================================== |
345 | 444 | ||
346 | nr_overcommit_hugepages | 445 | oom_kill_allocating_task |
347 | 446 | ||
348 | Change the maximum size of the hugepage pool. The maximum is | 447 | This enables or disables killing the OOM-triggering task in |
349 | nr_hugepages + nr_overcommit_hugepages. | 448 | out-of-memory situations. |
350 | 449 | ||
351 | See Documentation/vm/hugetlbpage.txt | 450 | If this is set to zero, the OOM killer will scan through the entire |
451 | tasklist and select a task based on heuristics to kill. This normally | ||
452 | selects a rogue memory-hogging task that frees up a large amount of | ||
453 | memory when killed. | ||
454 | |||
455 | If this is set to non-zero, the OOM killer simply kills the task that | ||
456 | triggered the out-of-memory condition. This avoids the expensive | ||
457 | tasklist scan. | ||
458 | |||
459 | If panic_on_oom is selected, it takes precedence over whatever value | ||
460 | is used in oom_kill_allocating_task. | ||
461 | |||
462 | The default value is 0. | ||
352 | 463 | ||
353 | ============================================================== | 464 | ============================================================== |
354 | 465 | ||
355 | nr_trim_pages | 466 | overcommit_memory: |
356 | 467 | ||
357 | This is available only on NOMMU kernels. | 468 | This value contains a flag that enables memory overcommitment. |
358 | 469 | ||
359 | This value adjusts the excess page trimming behaviour of power-of-2 aligned | 470 | When this flag is 0, the kernel attempts to estimate the amount |
360 | NOMMU mmap allocations. | 471 | of free memory left when userspace requests more memory. |
361 | 472 | ||
362 | A value of 0 disables trimming of allocations entirely, while a value of 1 | 473 | When this flag is 1, the kernel pretends there is always enough |
363 | trims excess pages aggressively. Any value >= 1 acts as the watermark where | 474 | memory until it actually runs out. |
364 | trimming of allocations is initiated. | ||
365 | 475 | ||
366 | The default value is 1. | 476 | When this flag is 2, the kernel uses a "never overcommit" |
477 | policy that attempts to prevent any overcommit of memory. | ||
367 | 478 | ||
368 | See Documentation/nommu-mmap.txt for more information. | 479 | This feature can be very useful because there are a lot of |
480 | programs that malloc() huge amounts of memory "just-in-case" | ||
481 | and don't use much of it. | ||
482 | |||
483 | The default value is 0. | ||
484 | |||
485 | See Documentation/vm/overcommit-accounting and | ||
486 | security/commoncap.c::cap_vm_enough_memory() for more information. | ||
487 | |||
488 | ============================================================== | ||
489 | |||
490 | overcommit_ratio: | ||
491 | |||
492 | When overcommit_memory is set to 2, the committed address | ||
493 | space is not permitted to exceed swap plus this percentage | ||
494 | of physical RAM. See above. | ||
495 | |||
496 | ============================================================== | ||
497 | |||
498 | page-cluster | ||
499 | |||
500 | page-cluster controls the number of pages which are written to swap in | ||
501 | a single attempt. The swap I/O size. | ||
502 | |||
503 | It is a logarithmic value - setting it to zero means "1 page", setting | ||
504 | it to 1 means "2 pages", setting it to 2 means "4 pages", etc. | ||
505 | |||
506 | The default value is three (eight pages at a time). There may be some | ||
507 | small benefits in tuning this to a different value if your workload is | ||
508 | swap-intensive. | ||
509 | |||
510 | ============================================================= | ||
511 | |||
512 | panic_on_oom | ||
513 | |||
514 | This enables or disables panic on out-of-memory feature. | ||
515 | |||
516 | If this is set to 0, the kernel will kill some rogue process, | ||
517 | called oom_killer. Usually, oom_killer can kill rogue processes and | ||
518 | system will survive. | ||
519 | |||
520 | If this is set to 1, the kernel panics when out-of-memory happens. | ||
521 | However, if a process limits using nodes by mempolicy/cpusets, | ||
522 | and those nodes become memory exhaustion status, one process | ||
523 | may be killed by oom-killer. No panic occurs in this case. | ||
524 | Because other nodes' memory may be free. This means system total status | ||
525 | may be not fatal yet. | ||
526 | |||
527 | If this is set to 2, the kernel panics compulsorily even on the | ||
528 | above-mentioned. | ||
529 | |||
530 | The default value is 0. | ||
531 | 1 and 2 are for failover of clustering. Please select either | ||
532 | according to your policy of failover. | ||
533 | |||
534 | ============================================================= | ||
535 | |||
536 | percpu_pagelist_fraction | ||
537 | |||
538 | This is the fraction of pages at most (high mark pcp->high) in each zone that | ||
539 | are allocated for each per cpu page list. The min value for this is 8. It | ||
540 | means that we don't allow more than 1/8th of pages in each zone to be | ||
541 | allocated in any single per_cpu_pagelist. This entry only changes the value | ||
542 | of hot per cpu pagelists. User can specify a number like 100 to allocate | ||
543 | 1/100th of each zone to each per cpu page list. | ||
544 | |||
545 | The batch value of each per cpu pagelist is also updated as a result. It is | ||
546 | set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8) | ||
547 | |||
548 | The initial value is zero. Kernel does not use this value at boot time to set | ||
549 | the high water marks for each per cpu page list. | ||
550 | |||
551 | ============================================================== | ||
552 | |||
553 | stat_interval | ||
554 | |||
555 | The time interval between which vm statistics are updated. The default | ||
556 | is 1 second. | ||
557 | |||
558 | ============================================================== | ||
559 | |||
560 | swappiness | ||
561 | |||
562 | This control is used to define how aggressive the kernel will swap | ||
563 | memory pages. Higher values will increase agressiveness, lower values | ||
564 | descrease the amount of swap. | ||
565 | |||
566 | The default value is 60. | ||
567 | |||
568 | ============================================================== | ||
569 | |||
570 | vfs_cache_pressure | ||
571 | ------------------ | ||
572 | |||
573 | Controls the tendency of the kernel to reclaim the memory which is used for | ||
574 | caching of directory and inode objects. | ||
575 | |||
576 | At the default value of vfs_cache_pressure=100 the kernel will attempt to | ||
577 | reclaim dentries and inodes at a "fair" rate with respect to pagecache and | ||
578 | swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer | ||
579 | to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 | ||
580 | causes the kernel to prefer to reclaim dentries and inodes. | ||
581 | |||
582 | ============================================================== | ||
583 | |||
584 | zone_reclaim_mode: | ||
585 | |||
586 | Zone_reclaim_mode allows someone to set more or less aggressive approaches to | ||
587 | reclaim memory when a zone runs out of memory. If it is set to zero then no | ||
588 | zone reclaim occurs. Allocations will be satisfied from other zones / nodes | ||
589 | in the system. | ||
590 | |||
591 | This is value ORed together of | ||
592 | |||
593 | 1 = Zone reclaim on | ||
594 | 2 = Zone reclaim writes dirty pages out | ||
595 | 4 = Zone reclaim swaps pages | ||
596 | |||
597 | zone_reclaim_mode is set during bootup to 1 if it is determined that pages | ||
598 | from remote zones will cause a measurable performance reduction. The | ||
599 | page allocator will then reclaim easily reusable pages (those page | ||
600 | cache pages that are currently not used) before allocating off node pages. | ||
601 | |||
602 | It may be beneficial to switch off zone reclaim if the system is | ||
603 | used for a file server and all of memory should be used for caching files | ||
604 | from disk. In that case the caching effect is more important than | ||
605 | data locality. | ||
606 | |||
607 | Allowing zone reclaim to write out pages stops processes that are | ||
608 | writing large amounts of data from dirtying pages on other nodes. Zone | ||
609 | reclaim will write out dirty pages if a zone fills up and so effectively | ||
610 | throttle the process. This may decrease the performance of a single process | ||
611 | since it cannot use all of system memory to buffer the outgoing writes | ||
612 | anymore but it preserve the memory on other nodes so that the performance | ||
613 | of other processes running on other nodes will not be affected. | ||
614 | |||
615 | Allowing regular swap effectively restricts allocations to the local | ||
616 | node unless explicitly overridden by memory policies or cpuset | ||
617 | configurations. | ||
618 | |||
619 | ============ End of Document ================================= | ||
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt index 10a0263ebb3f..9e592c718afb 100644 --- a/Documentation/sysrq.txt +++ b/Documentation/sysrq.txt | |||
@@ -1,6 +1,5 @@ | |||
1 | Linux Magic System Request Key Hacks | 1 | Linux Magic System Request Key Hacks |
2 | Documentation for sysrq.c | 2 | Documentation for sysrq.c |
3 | Last update: 2007-AUG-04 | ||
4 | 3 | ||
5 | * What is the magic SysRq key? | 4 | * What is the magic SysRq key? |
6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 5 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -211,6 +210,24 @@ within a function called by handle_sysrq, you must be aware that you are in | |||
211 | a lock (you are also in an interrupt handler, which means don't sleep!), so | 210 | a lock (you are also in an interrupt handler, which means don't sleep!), so |
212 | you must call __handle_sysrq_nolock instead. | 211 | you must call __handle_sysrq_nolock instead. |
213 | 212 | ||
213 | * When I hit a SysRq key combination only the header appears on the console? | ||
214 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
215 | Sysrq output is subject to the same console loglevel control as all | ||
216 | other console output. This means that if the kernel was booted 'quiet' | ||
217 | as is common on distro kernels the output may not appear on the actual | ||
218 | console, even though it will appear in the dmesg buffer, and be accessible | ||
219 | via the dmesg command and to the consumers of /proc/kmsg. As a specific | ||
220 | exception the header line from the sysrq command is passed to all console | ||
221 | consumers as if the current loglevel was maximum. If only the header | ||
222 | is emitted it is almost certain that the kernel loglevel is too low. | ||
223 | Should you require the output on the console channel then you will need | ||
224 | to temporarily up the console loglevel using alt-sysrq-8 or: | ||
225 | |||
226 | echo 8 > /proc/sysrq-trigger | ||
227 | |||
228 | Remember to return the loglevel to normal after triggering the sysrq | ||
229 | command you are interested in. | ||
230 | |||
214 | * I have more questions, who can I ask? | 231 | * I have more questions, who can I ask? |
215 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 232 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
216 | And I'll answer any questions about the registration system you got, also | 233 | And I'll answer any questions about the registration system you got, also |
diff --git a/MAINTAINERS b/MAINTAINERS index 6f65a269cb17..3fe4dc2c2564 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1581,6 +1581,13 @@ L: bluesmoke-devel@lists.sourceforge.net | |||
1581 | W: bluesmoke.sourceforge.net | 1581 | W: bluesmoke.sourceforge.net |
1582 | S: Maintained | 1582 | S: Maintained |
1583 | 1583 | ||
1584 | EDAC-I5400 | ||
1585 | P: Mauro Carvalho Chehab | ||
1586 | M: mchehab@redhat.com | ||
1587 | L: bluesmoke-devel@lists.sourceforge.net | ||
1588 | W: bluesmoke.sourceforge.net | ||
1589 | S: Maintained | ||
1590 | |||
1584 | EDAC-I82975X | 1591 | EDAC-I82975X |
1585 | P: Ranganathan Desikan | 1592 | P: Ranganathan Desikan |
1586 | P: Arvind R. | 1593 | P: Arvind R. |
@@ -1814,6 +1821,14 @@ M: hch@infradead.org | |||
1814 | W: ftp://ftp.openlinux.org/pub/people/hch/vxfs | 1821 | W: ftp://ftp.openlinux.org/pub/people/hch/vxfs |
1815 | S: Maintained | 1822 | S: Maintained |
1816 | 1823 | ||
1824 | FREEZER | ||
1825 | P: Pavel Machek | ||
1826 | M: pavel@suse.cz | ||
1827 | P: Rafael J. Wysocki | ||
1828 | M: rjw@sisk.pl | ||
1829 | L: linux-pm@lists.linux-foundation.org | ||
1830 | S: Supported | ||
1831 | |||
1817 | FTRACE | 1832 | FTRACE |
1818 | P: Steven Rostedt | 1833 | P: Steven Rostedt |
1819 | M: rostedt@goodmis.org | 1834 | M: rostedt@goodmis.org |
@@ -4842,11 +4857,11 @@ S: Supported | |||
4842 | 4857 | ||
4843 | XFS FILESYSTEM | 4858 | XFS FILESYSTEM |
4844 | P: Silicon Graphics Inc | 4859 | P: Silicon Graphics Inc |
4845 | P: Tim Shimmin | 4860 | P: Bill O'Donnell |
4846 | M: xfs-masters@oss.sgi.com | 4861 | M: xfs-masters@oss.sgi.com |
4847 | L: xfs@oss.sgi.com | 4862 | L: xfs@oss.sgi.com |
4848 | W: http://oss.sgi.com/projects/xfs | 4863 | W: http://oss.sgi.com/projects/xfs |
4849 | T: git git://oss.sgi.com:8090/xfs/xfs-2.6.git | 4864 | T: git://oss.sgi.com/xfs/xfs.git |
4850 | S: Supported | 4865 | S: Supported |
4851 | 4866 | ||
4852 | XILINX SYSTEMACE DRIVER | 4867 | XILINX SYSTEMACE DRIVER |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 28 | 3 | SUBLEVEL = 29 |
4 | EXTRAVERSION = | 4 | EXTRAVERSION = -rc1 |
5 | NAME = Erotic Pickled Herring | 5 | NAME = Erotic Pickled Herring |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/Kconfig b/arch/Kconfig index 2e13aa261929..550dab22daa1 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -62,6 +62,9 @@ config HAVE_EFFICIENT_UNALIGNED_ACCESS | |||
62 | See Documentation/unaligned-memory-access.txt for more | 62 | See Documentation/unaligned-memory-access.txt for more |
63 | information on the topic of unaligned memory accesses. | 63 | information on the topic of unaligned memory accesses. |
64 | 64 | ||
65 | config HAVE_SYSCALL_WRAPPERS | ||
66 | bool | ||
67 | |||
65 | config KRETPROBES | 68 | config KRETPROBES |
66 | def_bool y | 69 | def_bool y |
67 | depends on KPROBES && HAVE_KRETPROBES | 70 | depends on KPROBES && HAVE_KRETPROBES |
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index 4dad27360576..b7c8f188b313 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild | |||
@@ -9,4 +9,3 @@ unifdef-y += console.h | |||
9 | unifdef-y += fpu.h | 9 | unifdef-y += fpu.h |
10 | unifdef-y += sysinfo.h | 10 | unifdef-y += sysinfo.h |
11 | unifdef-y += compiler.h | 11 | unifdef-y += compiler.h |
12 | unifdef-y += swab.h | ||
diff --git a/arch/alpha/include/asm/byteorder.h b/arch/alpha/include/asm/byteorder.h index 6772f3168701..73683093202d 100644 --- a/arch/alpha/include/asm/byteorder.h +++ b/arch/alpha/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ALPHA_BYTEORDER_H | 1 | #ifndef _ALPHA_BYTEORDER_H |
2 | #define _ALPHA_BYTEORDER_H | 2 | #define _ALPHA_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ALPHA_BYTEORDER_H */ | 6 | #endif /* _ALPHA_BYTEORDER_H */ |
diff --git a/arch/alpha/include/asm/machvec.h b/arch/alpha/include/asm/machvec.h index a86c083cdf7f..fea4ea75b79d 100644 --- a/arch/alpha/include/asm/machvec.h +++ b/arch/alpha/include/asm/machvec.h | |||
@@ -21,6 +21,7 @@ struct pci_dev; | |||
21 | struct pci_ops; | 21 | struct pci_ops; |
22 | struct pci_controller; | 22 | struct pci_controller; |
23 | struct _alpha_agp_info; | 23 | struct _alpha_agp_info; |
24 | struct rtc_time; | ||
24 | 25 | ||
25 | struct alpha_machine_vector | 26 | struct alpha_machine_vector |
26 | { | 27 | { |
@@ -94,6 +95,9 @@ struct alpha_machine_vector | |||
94 | 95 | ||
95 | struct _alpha_agp_info *(*agp_info)(void); | 96 | struct _alpha_agp_info *(*agp_info)(void); |
96 | 97 | ||
98 | unsigned int (*rtc_get_time)(struct rtc_time *); | ||
99 | int (*rtc_set_time)(struct rtc_time *); | ||
100 | |||
97 | const char *vector_name; | 101 | const char *vector_name; |
98 | 102 | ||
99 | /* NUMA information */ | 103 | /* NUMA information */ |
diff --git a/arch/alpha/include/asm/pgalloc.h b/arch/alpha/include/asm/pgalloc.h index fd090155dccd..bc2a0daf2d92 100644 --- a/arch/alpha/include/asm/pgalloc.h +++ b/arch/alpha/include/asm/pgalloc.h | |||
@@ -50,7 +50,12 @@ pmd_free(struct mm_struct *mm, pmd_t *pmd) | |||
50 | free_page((unsigned long)pmd); | 50 | free_page((unsigned long)pmd); |
51 | } | 51 | } |
52 | 52 | ||
53 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); | 53 | static inline pte_t * |
54 | pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | ||
55 | { | ||
56 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | ||
57 | return pte; | ||
58 | } | ||
54 | 59 | ||
55 | static inline void | 60 | static inline void |
56 | pte_free_kernel(struct mm_struct *mm, pte_t *pte) | 61 | pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
diff --git a/arch/alpha/include/asm/rtc.h b/arch/alpha/include/asm/rtc.h index 4e854b1333eb..1f7fba671ae6 100644 --- a/arch/alpha/include/asm/rtc.h +++ b/arch/alpha/include/asm/rtc.h | |||
@@ -1,9 +1,15 @@ | |||
1 | #ifndef _ALPHA_RTC_H | 1 | #ifndef _ALPHA_RTC_H |
2 | #define _ALPHA_RTC_H | 2 | #define _ALPHA_RTC_H |
3 | 3 | ||
4 | /* | 4 | #if defined(CONFIG_ALPHA_GENERIC) |
5 | * Alpha uses the default access methods for the RTC. | 5 | # define get_rtc_time alpha_mv.rtc_get_time |
6 | */ | 6 | # define set_rtc_time alpha_mv.rtc_set_time |
7 | #else | ||
8 | # if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP) | ||
9 | # define get_rtc_time marvel_get_rtc_time | ||
10 | # define set_rtc_time marvel_set_rtc_time | ||
11 | # endif | ||
12 | #endif | ||
7 | 13 | ||
8 | #include <asm-generic/rtc.h> | 14 | #include <asm-generic/rtc.h> |
9 | 15 | ||
diff --git a/arch/alpha/kernel/.gitignore b/arch/alpha/kernel/.gitignore new file mode 100644 index 000000000000..c5f676c3c224 --- /dev/null +++ b/arch/alpha/kernel/.gitignore | |||
@@ -0,0 +1 @@ | |||
vmlinux.lds | |||
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c index 9cd8dca742a7..e302daecbe56 100644 --- a/arch/alpha/kernel/core_marvel.c +++ b/arch/alpha/kernel/core_marvel.c | |||
@@ -658,16 +658,8 @@ __marvel_rtc_io(u8 b, unsigned long addr, int write) | |||
658 | rtc_access.data = bcd2bin(b); | 658 | rtc_access.data = bcd2bin(b); |
659 | rtc_access.function = 0x48 + !write; /* GET/PUT_TOY */ | 659 | rtc_access.function = 0x48 + !write; /* GET/PUT_TOY */ |
660 | 660 | ||
661 | #ifdef CONFIG_SMP | ||
662 | if (smp_processor_id() != boot_cpuid) | ||
663 | smp_call_function_single(boot_cpuid, | ||
664 | __marvel_access_rtc, | ||
665 | &rtc_access, 1); | ||
666 | else | ||
667 | __marvel_access_rtc(&rtc_access); | ||
668 | #else | ||
669 | __marvel_access_rtc(&rtc_access); | 661 | __marvel_access_rtc(&rtc_access); |
670 | #endif | 662 | |
671 | ret = bin2bcd(rtc_access.data); | 663 | ret = bin2bcd(rtc_access.data); |
672 | break; | 664 | break; |
673 | 665 | ||
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index f77345bc66a9..aa2e50cf9857 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S | |||
@@ -896,9 +896,9 @@ sys_getxpid: | |||
896 | .end sys_getxpid | 896 | .end sys_getxpid |
897 | 897 | ||
898 | .align 4 | 898 | .align 4 |
899 | .globl sys_pipe | 899 | .globl sys_alpha_pipe |
900 | .ent sys_pipe | 900 | .ent sys_alpha_pipe |
901 | sys_pipe: | 901 | sys_alpha_pipe: |
902 | lda $sp, -16($sp) | 902 | lda $sp, -16($sp) |
903 | stq $26, 0($sp) | 903 | stq $26, 0($sp) |
904 | .prologue 0 | 904 | .prologue 0 |
@@ -916,7 +916,7 @@ sys_pipe: | |||
916 | stq $1, 80+16($sp) | 916 | stq $1, 80+16($sp) |
917 | 1: lda $sp, 16($sp) | 917 | 1: lda $sp, 16($sp) |
918 | ret | 918 | ret |
919 | .end sys_pipe | 919 | .end sys_alpha_pipe |
920 | 920 | ||
921 | .align 4 | 921 | .align 4 |
922 | .globl sys_execve | 922 | .globl sys_execve |
diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c index 32212014fbe9..a03fbca4940e 100644 --- a/arch/alpha/kernel/irq_srm.c +++ b/arch/alpha/kernel/irq_srm.c | |||
@@ -63,6 +63,8 @@ init_srm_irqs(long max, unsigned long ignore_mask) | |||
63 | { | 63 | { |
64 | long i; | 64 | long i; |
65 | 65 | ||
66 | if (NR_IRQS <= 16) | ||
67 | return; | ||
66 | for (i = 16; i < max; ++i) { | 68 | for (i = 16; i < max; ++i) { |
67 | if (i < 64 && ((ignore_mask >> i) & 1)) | 69 | if (i < 64 && ((ignore_mask >> i) & 1)) |
68 | continue; | 70 | continue; |
diff --git a/arch/alpha/kernel/machvec_impl.h b/arch/alpha/kernel/machvec_impl.h index 466c9dff8181..512685f78097 100644 --- a/arch/alpha/kernel/machvec_impl.h +++ b/arch/alpha/kernel/machvec_impl.h | |||
@@ -40,7 +40,10 @@ | |||
40 | #define CAT1(x,y) x##y | 40 | #define CAT1(x,y) x##y |
41 | #define CAT(x,y) CAT1(x,y) | 41 | #define CAT(x,y) CAT1(x,y) |
42 | 42 | ||
43 | #define DO_DEFAULT_RTC .rtc_port = 0x70 | 43 | #define DO_DEFAULT_RTC \ |
44 | .rtc_port = 0x70, \ | ||
45 | .rtc_get_time = common_get_rtc_time, \ | ||
46 | .rtc_set_time = common_set_rtc_time | ||
44 | 47 | ||
45 | #define DO_EV4_MMU \ | 48 | #define DO_EV4_MMU \ |
46 | .max_asn = EV4_MAX_ASN, \ | 49 | .max_asn = EV4_MAX_ASN, \ |
diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index 708d5ca87782..fe14c6747cd6 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h | |||
@@ -145,6 +145,8 @@ extern void smp_percpu_timer_interrupt(struct pt_regs *); | |||
145 | extern irqreturn_t timer_interrupt(int irq, void *dev); | 145 | extern irqreturn_t timer_interrupt(int irq, void *dev); |
146 | extern void common_init_rtc(void); | 146 | extern void common_init_rtc(void); |
147 | extern unsigned long est_cycle_freq; | 147 | extern unsigned long est_cycle_freq; |
148 | extern unsigned int common_get_rtc_time(struct rtc_time *time); | ||
149 | extern int common_set_rtc_time(struct rtc_time *time); | ||
148 | 150 | ||
149 | /* smc37c93x.c */ | 151 | /* smc37c93x.c */ |
150 | extern void SMC93x_Init(void); | 152 | extern void SMC93x_Init(void); |
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c index 2c3de97de46c..e2516f9a8967 100644 --- a/arch/alpha/kernel/sys_jensen.c +++ b/arch/alpha/kernel/sys_jensen.c | |||
@@ -261,6 +261,8 @@ struct alpha_machine_vector jensen_mv __initmv = { | |||
261 | .machine_check = jensen_machine_check, | 261 | .machine_check = jensen_machine_check, |
262 | .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, | 262 | .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, |
263 | .rtc_port = 0x170, | 263 | .rtc_port = 0x170, |
264 | .rtc_get_time = common_get_rtc_time, | ||
265 | .rtc_set_time = common_set_rtc_time, | ||
264 | 266 | ||
265 | .nr_irqs = 16, | 267 | .nr_irqs = 16, |
266 | .device_interrupt = jensen_device_interrupt, | 268 | .device_interrupt = jensen_device_interrupt, |
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index 828449cd2636..c5a1a2438c67 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <asm/hwrpb.h> | 23 | #include <asm/hwrpb.h> |
24 | #include <asm/tlbflush.h> | 24 | #include <asm/tlbflush.h> |
25 | #include <asm/vga.h> | 25 | #include <asm/vga.h> |
26 | #include <asm/rtc.h> | ||
26 | 27 | ||
27 | #include "proto.h" | 28 | #include "proto.h" |
28 | #include "err_impl.h" | 29 | #include "err_impl.h" |
@@ -426,6 +427,57 @@ marvel_init_rtc(void) | |||
426 | init_rtc_irq(); | 427 | init_rtc_irq(); |
427 | } | 428 | } |
428 | 429 | ||
430 | struct marvel_rtc_time { | ||
431 | struct rtc_time *time; | ||
432 | int retval; | ||
433 | }; | ||
434 | |||
435 | #ifdef CONFIG_SMP | ||
436 | static void | ||
437 | smp_get_rtc_time(void *data) | ||
438 | { | ||
439 | struct marvel_rtc_time *mrt = data; | ||
440 | mrt->retval = __get_rtc_time(mrt->time); | ||
441 | } | ||
442 | |||
443 | static void | ||
444 | smp_set_rtc_time(void *data) | ||
445 | { | ||
446 | struct marvel_rtc_time *mrt = data; | ||
447 | mrt->retval = __set_rtc_time(mrt->time); | ||
448 | } | ||
449 | #endif | ||
450 | |||
451 | static unsigned int | ||
452 | marvel_get_rtc_time(struct rtc_time *time) | ||
453 | { | ||
454 | #ifdef CONFIG_SMP | ||
455 | struct marvel_rtc_time mrt; | ||
456 | |||
457 | if (smp_processor_id() != boot_cpuid) { | ||
458 | mrt.time = time; | ||
459 | smp_call_function_single(boot_cpuid, smp_get_rtc_time, &mrt, 1); | ||
460 | return mrt.retval; | ||
461 | } | ||
462 | #endif | ||
463 | return __get_rtc_time(time); | ||
464 | } | ||
465 | |||
466 | static int | ||
467 | marvel_set_rtc_time(struct rtc_time *time) | ||
468 | { | ||
469 | #ifdef CONFIG_SMP | ||
470 | struct marvel_rtc_time mrt; | ||
471 | |||
472 | if (smp_processor_id() != boot_cpuid) { | ||
473 | mrt.time = time; | ||
474 | smp_call_function_single(boot_cpuid, smp_set_rtc_time, &mrt, 1); | ||
475 | return mrt.retval; | ||
476 | } | ||
477 | #endif | ||
478 | return __set_rtc_time(time); | ||
479 | } | ||
480 | |||
429 | static void | 481 | static void |
430 | marvel_smp_callin(void) | 482 | marvel_smp_callin(void) |
431 | { | 483 | { |
@@ -466,7 +518,9 @@ marvel_smp_callin(void) | |||
466 | struct alpha_machine_vector marvel_ev7_mv __initmv = { | 518 | struct alpha_machine_vector marvel_ev7_mv __initmv = { |
467 | .vector_name = "MARVEL/EV7", | 519 | .vector_name = "MARVEL/EV7", |
468 | DO_EV7_MMU, | 520 | DO_EV7_MMU, |
469 | DO_DEFAULT_RTC, | 521 | .rtc_port = 0x70, |
522 | .rtc_get_time = marvel_get_rtc_time, | ||
523 | .rtc_set_time = marvel_set_rtc_time, | ||
470 | DO_MARVEL_IO, | 524 | DO_MARVEL_IO, |
471 | .machine_check = marvel_machine_check, | 525 | .machine_check = marvel_machine_check, |
472 | .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, | 526 | .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, |
diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c index a7f23b5ab814..99c0f46f6b9c 100644 --- a/arch/alpha/kernel/sys_nautilus.c +++ b/arch/alpha/kernel/sys_nautilus.c | |||
@@ -245,6 +245,10 @@ nautilus_init_pci(void) | |||
245 | IRONGATE0->pci_mem = pci_mem; | 245 | IRONGATE0->pci_mem = pci_mem; |
246 | 246 | ||
247 | pci_bus_assign_resources(bus); | 247 | pci_bus_assign_resources(bus); |
248 | |||
249 | /* pci_common_swizzle() relies on bus->self being NULL | ||
250 | for the root bus, so just clear it. */ | ||
251 | bus->self = NULL; | ||
248 | pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq); | 252 | pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq); |
249 | } | 253 | } |
250 | 254 | ||
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index ba914af18c4f..9d9e3a98bb95 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S | |||
@@ -52,7 +52,7 @@ sys_call_table: | |||
52 | .quad sys_setpgid | 52 | .quad sys_setpgid |
53 | .quad alpha_ni_syscall /* 40 */ | 53 | .quad alpha_ni_syscall /* 40 */ |
54 | .quad sys_dup | 54 | .quad sys_dup |
55 | .quad sys_pipe | 55 | .quad sys_alpha_pipe |
56 | .quad osf_set_program_attributes | 56 | .quad osf_set_program_attributes |
57 | .quad alpha_ni_syscall | 57 | .quad alpha_ni_syscall |
58 | .quad sys_open /* 45 */ | 58 | .quad sys_open /* 45 */ |
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index e6a231435cba..b04e2cbf23a4 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <asm/io.h> | 46 | #include <asm/io.h> |
47 | #include <asm/hwrpb.h> | 47 | #include <asm/hwrpb.h> |
48 | #include <asm/8253pit.h> | 48 | #include <asm/8253pit.h> |
49 | #include <asm/rtc.h> | ||
49 | 50 | ||
50 | #include <linux/mc146818rtc.h> | 51 | #include <linux/mc146818rtc.h> |
51 | #include <linux/time.h> | 52 | #include <linux/time.h> |
@@ -180,6 +181,15 @@ common_init_rtc(void) | |||
180 | init_rtc_irq(); | 181 | init_rtc_irq(); |
181 | } | 182 | } |
182 | 183 | ||
184 | unsigned int common_get_rtc_time(struct rtc_time *time) | ||
185 | { | ||
186 | return __get_rtc_time(time); | ||
187 | } | ||
188 | |||
189 | int common_set_rtc_time(struct rtc_time *time) | ||
190 | { | ||
191 | return __set_rtc_time(time); | ||
192 | } | ||
183 | 193 | ||
184 | /* Validate a computed cycle counter result against the known bounds for | 194 | /* Validate a computed cycle counter result against the known bounds for |
185 | the given processor core. There's too much brokenness in the way of | 195 | the given processor core. There's too much brokenness in the way of |
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c index 234e42b8ee74..5d7a16eab312 100644 --- a/arch/alpha/mm/init.c +++ b/arch/alpha/mm/init.c | |||
@@ -59,13 +59,6 @@ pgd_alloc(struct mm_struct *mm) | |||
59 | return ret; | 59 | return ret; |
60 | } | 60 | } |
61 | 61 | ||
62 | pte_t * | ||
63 | pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | ||
64 | { | ||
65 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | ||
66 | return pte; | ||
67 | } | ||
68 | |||
69 | 62 | ||
70 | /* | 63 | /* |
71 | * BAD_PAGE is the page that is used for page faults when linux | 64 | * BAD_PAGE is the page that is used for page faults when linux |
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 43b0b2ba392f..73237bd130a2 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | unifdef-y += hwcap.h | 3 | unifdef-y += hwcap.h |
4 | unifdef-y += swab.h | ||
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/asm/byteorder.h index c02b6fc28e1a..77379748b171 100644 --- a/arch/arm/include/asm/byteorder.h +++ b/arch/arm/include/asm/byteorder.h | |||
@@ -15,8 +15,6 @@ | |||
15 | #ifndef __ASM_ARM_BYTEORDER_H | 15 | #ifndef __ASM_ARM_BYTEORDER_H |
16 | #define __ASM_ARM_BYTEORDER_H | 16 | #define __ASM_ARM_BYTEORDER_H |
17 | 17 | ||
18 | #include <asm/swab.h> | ||
19 | |||
20 | #ifdef __ARMEB__ | 18 | #ifdef __ARMEB__ |
21 | #include <linux/byteorder/big_endian.h> | 19 | #include <linux/byteorder/big_endian.h> |
22 | #else | 20 | #else |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 09a061cb7838..9ca8d13f05f7 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -98,7 +98,7 @@ | |||
98 | CALL(sys_uselib) | 98 | CALL(sys_uselib) |
99 | CALL(sys_swapon) | 99 | CALL(sys_swapon) |
100 | CALL(sys_reboot) | 100 | CALL(sys_reboot) |
101 | CALL(OBSOLETE(old_readdir)) /* used by libc4 */ | 101 | CALL(OBSOLETE(sys_old_readdir)) /* used by libc4 */ |
102 | /* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ | 102 | /* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ |
103 | CALL(sys_munmap) | 103 | CALL(sys_munmap) |
104 | CALL(sys_truncate) | 104 | CALL(sys_truncate) |
diff --git a/arch/arm/mach-imx/clock.c b/arch/arm/mach-imx/clock.c index 7ec60fc91565..cf332aeb942e 100644 --- a/arch/arm/mach-imx/clock.c +++ b/arch/arm/mach-imx/clock.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/err.h> | 23 | #include <linux/err.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | 25 | ||
26 | #include <mach/imx-regs.h> | 26 | #include <mach/hardware.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Very simple approach: We can't disable clocks, so we do | 29 | * Very simple approach: We can't disable clocks, so we do |
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c index fa72174dd95c..887cb21f75b0 100644 --- a/arch/arm/mach-imx/generic.c +++ b/arch/arm/mach-imx/generic.c | |||
@@ -245,11 +245,11 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info) | |||
245 | imx_mmc_device.dev.platform_data = info; | 245 | imx_mmc_device.dev.platform_data = info; |
246 | } | 246 | } |
247 | 247 | ||
248 | static struct imxfb_mach_info imx_fb_info; | 248 | static struct imx_fb_platform_data imx_fb_info; |
249 | 249 | ||
250 | void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info) | 250 | void __init set_imx_fb_info(struct imx_fb_platform_data *hard_imx_fb_info) |
251 | { | 251 | { |
252 | memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info)); | 252 | memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imx_fb_platform_data)); |
253 | } | 253 | } |
254 | 254 | ||
255 | static struct resource imxfb_resources[] = { | 255 | static struct resource imxfb_resources[] = { |
diff --git a/arch/arm/mach-imx/include/mach/imx-regs.h b/arch/arm/mach-imx/include/mach/imx-regs.h index fb9de2733879..490297fc0e38 100644 --- a/arch/arm/mach-imx/include/mach/imx-regs.h +++ b/arch/arm/mach-imx/include/mach/imx-regs.h | |||
@@ -373,110 +373,4 @@ | |||
373 | #define TSTAT_CAPT (1<<1) | 373 | #define TSTAT_CAPT (1<<1) |
374 | #define TSTAT_COMP (1<<0) | 374 | #define TSTAT_COMP (1<<0) |
375 | 375 | ||
376 | /* | ||
377 | * LCD Controller | ||
378 | */ | ||
379 | |||
380 | #define LCDC_SSA __REG(IMX_LCDC_BASE+0x00) | ||
381 | |||
382 | #define LCDC_SIZE __REG(IMX_LCDC_BASE+0x04) | ||
383 | #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) | ||
384 | #define SIZE_YMAX(y) ( (y) & 0x1ff ) | ||
385 | |||
386 | #define LCDC_VPW __REG(IMX_LCDC_BASE+0x08) | ||
387 | #define VPW_VPW(x) ( (x) & 0x3ff ) | ||
388 | |||
389 | #define LCDC_CPOS __REG(IMX_LCDC_BASE+0x0C) | ||
390 | #define CPOS_CC1 (1<<31) | ||
391 | #define CPOS_CC0 (1<<30) | ||
392 | #define CPOS_OP (1<<28) | ||
393 | #define CPOS_CXP(x) (((x) & 3ff) << 16) | ||
394 | #define CPOS_CYP(y) ((y) & 0x1ff) | ||
395 | |||
396 | #define LCDC_LCWHB __REG(IMX_LCDC_BASE+0x10) | ||
397 | #define LCWHB_BK_EN (1<<31) | ||
398 | #define LCWHB_CW(w) (((w) & 0x1f) << 24) | ||
399 | #define LCWHB_CH(h) (((h) & 0x1f) << 16) | ||
400 | #define LCWHB_BD(x) ((x) & 0xff) | ||
401 | |||
402 | #define LCDC_LCHCC __REG(IMX_LCDC_BASE+0x14) | ||
403 | #define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11) | ||
404 | #define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5) | ||
405 | #define LCHCC_CUR_COL_B(b) ((b) & 0x1f) | ||
406 | |||
407 | #define LCDC_PCR __REG(IMX_LCDC_BASE+0x18) | ||
408 | #define PCR_TFT (1<<31) | ||
409 | #define PCR_COLOR (1<<30) | ||
410 | #define PCR_PBSIZ_1 (0<<28) | ||
411 | #define PCR_PBSIZ_2 (1<<28) | ||
412 | #define PCR_PBSIZ_4 (2<<28) | ||
413 | #define PCR_PBSIZ_8 (3<<28) | ||
414 | #define PCR_BPIX_1 (0<<25) | ||
415 | #define PCR_BPIX_2 (1<<25) | ||
416 | #define PCR_BPIX_4 (2<<25) | ||
417 | #define PCR_BPIX_8 (3<<25) | ||
418 | #define PCR_BPIX_12 (4<<25) | ||
419 | #define PCR_BPIX_16 (4<<25) | ||
420 | #define PCR_PIXPOL (1<<24) | ||
421 | #define PCR_FLMPOL (1<<23) | ||
422 | #define PCR_LPPOL (1<<22) | ||
423 | #define PCR_CLKPOL (1<<21) | ||
424 | #define PCR_OEPOL (1<<20) | ||
425 | #define PCR_SCLKIDLE (1<<19) | ||
426 | #define PCR_END_SEL (1<<18) | ||
427 | #define PCR_END_BYTE_SWAP (1<<17) | ||
428 | #define PCR_REV_VS (1<<16) | ||
429 | #define PCR_ACD_SEL (1<<15) | ||
430 | #define PCR_ACD(x) (((x) & 0x7f) << 8) | ||
431 | #define PCR_SCLK_SEL (1<<7) | ||
432 | #define PCR_SHARP (1<<6) | ||
433 | #define PCR_PCD(x) ((x) & 0x3f) | ||
434 | |||
435 | #define LCDC_HCR __REG(IMX_LCDC_BASE+0x1C) | ||
436 | #define HCR_H_WIDTH(x) (((x) & 0x3f) << 26) | ||
437 | #define HCR_H_WAIT_1(x) (((x) & 0xff) << 8) | ||
438 | #define HCR_H_WAIT_2(x) ((x) & 0xff) | ||
439 | |||
440 | #define LCDC_VCR __REG(IMX_LCDC_BASE+0x20) | ||
441 | #define VCR_V_WIDTH(x) (((x) & 0x3f) << 26) | ||
442 | #define VCR_V_WAIT_1(x) (((x) & 0xff) << 8) | ||
443 | #define VCR_V_WAIT_2(x) ((x) & 0xff) | ||
444 | |||
445 | #define LCDC_POS __REG(IMX_LCDC_BASE+0x24) | ||
446 | #define POS_POS(x) ((x) & 1f) | ||
447 | |||
448 | #define LCDC_LSCR1 __REG(IMX_LCDC_BASE+0x28) | ||
449 | #define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26) | ||
450 | #define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16) | ||
451 | #define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8) | ||
452 | #define LSCR1_GRAY2(x) (((x) & 0xf) << 4) | ||
453 | #define LSCR1_GRAY1(x) (((x) & 0xf)) | ||
454 | |||
455 | #define LCDC_PWMR __REG(IMX_LCDC_BASE+0x2C) | ||
456 | #define PWMR_CLS(x) (((x) & 0x1ff) << 16) | ||
457 | #define PWMR_LDMSK (1<<15) | ||
458 | #define PWMR_SCR1 (1<<10) | ||
459 | #define PWMR_SCR0 (1<<9) | ||
460 | #define PWMR_CC_EN (1<<8) | ||
461 | #define PWMR_PW(x) ((x) & 0xff) | ||
462 | |||
463 | #define LCDC_DMACR __REG(IMX_LCDC_BASE+0x30) | ||
464 | #define DMACR_BURST (1<<31) | ||
465 | #define DMACR_HM(x) (((x) & 0xf) << 16) | ||
466 | #define DMACR_TM(x) ((x) &0xf) | ||
467 | |||
468 | #define LCDC_RMCR __REG(IMX_LCDC_BASE+0x34) | ||
469 | #define RMCR_LCDC_EN (1<<1) | ||
470 | #define RMCR_SELF_REF (1<<0) | ||
471 | |||
472 | #define LCDC_LCDICR __REG(IMX_LCDC_BASE+0x38) | ||
473 | #define LCDICR_INT_SYN (1<<2) | ||
474 | #define LCDICR_INT_CON (1) | ||
475 | |||
476 | #define LCDC_LCDISR __REG(IMX_LCDC_BASE+0x40) | ||
477 | #define LCDISR_UDR_ERR (1<<3) | ||
478 | #define LCDISR_ERR_RES (1<<2) | ||
479 | #define LCDISR_EOF (1<<1) | ||
480 | #define LCDISR_BOF (1<<0) | ||
481 | |||
482 | #endif // _IMX_REGS_H | 376 | #endif // _IMX_REGS_H |
diff --git a/arch/arm/mach-w90x900/mach-w90p910evb.c b/arch/arm/mach-w90x900/mach-w90p910evb.c index 9307a2475438..9ebc93f48530 100644 --- a/arch/arm/mach-w90x900/mach-w90p910evb.c +++ b/arch/arm/mach-w90x900/mach-w90p910evb.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | 30 | ||
31 | #include <mach/regs-serial.h> | 31 | #include <mach/regs-serial.h> |
32 | #include <mach/map.h> | ||
32 | 33 | ||
33 | #include "cpu.h" | 34 | #include "cpu.h" |
34 | 35 | ||
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c index 3a69e381f316..bcc838f6b393 100644 --- a/arch/arm/mach-w90x900/time.c +++ b/arch/arm/mach-w90x900/time.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <asm/mach/irq.h> | 28 | #include <asm/mach/irq.h> |
29 | #include <asm/mach/time.h> | 29 | #include <asm/mach/time.h> |
30 | 30 | ||
31 | #include <mach/system.h> | ||
32 | #include <mach/map.h> | 31 | #include <mach/map.h> |
33 | #include <mach/regs-timer.h> | 32 | #include <mach/regs-timer.h> |
34 | 33 | ||
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c index 4ad3bf291ad3..195e48edd8c2 100644 --- a/arch/arm/mm/proc-syms.c +++ b/arch/arm/mm/proc-syms.c | |||
@@ -27,6 +27,7 @@ EXPORT_SYMBOL(__cpuc_flush_kern_all); | |||
27 | EXPORT_SYMBOL(__cpuc_flush_user_all); | 27 | EXPORT_SYMBOL(__cpuc_flush_user_all); |
28 | EXPORT_SYMBOL(__cpuc_flush_user_range); | 28 | EXPORT_SYMBOL(__cpuc_flush_user_range); |
29 | EXPORT_SYMBOL(__cpuc_coherent_kern_range); | 29 | EXPORT_SYMBOL(__cpuc_coherent_kern_range); |
30 | EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */ | ||
30 | #else | 31 | #else |
31 | EXPORT_SYMBOL(cpu_cache); | 32 | EXPORT_SYMBOL(cpu_cache); |
32 | #endif | 33 | #endif |
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index 219822c8ad18..3136628ba8d2 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | header-y += swab.h | ||
4 | header-y += cachectl.h | 3 | header-y += cachectl.h |
diff --git a/arch/avr32/include/asm/byteorder.h b/arch/avr32/include/asm/byteorder.h index 2aba64b4e122..50abc21619a8 100644 --- a/arch/avr32/include/asm/byteorder.h +++ b/arch/avr32/include/asm/byteorder.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #ifndef __ASM_AVR32_BYTEORDER_H | 4 | #ifndef __ASM_AVR32_BYTEORDER_H |
5 | #define __ASM_AVR32_BYTEORDER_H | 5 | #define __ASM_AVR32_BYTEORDER_H |
6 | 6 | ||
7 | #include <asm/swab.h> | ||
8 | #include <linux/byteorder/big_endian.h> | 7 | #include <linux/byteorder/big_endian.h> |
9 | 8 | ||
10 | #endif /* __ASM_AVR32_BYTEORDER_H */ | 9 | #endif /* __ASM_AVR32_BYTEORDER_H */ |
diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index d0d1ac435544..606ecfdcc962 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | unifdef-y += fixed_code.h | 3 | unifdef-y += fixed_code.h |
4 | unifdef-y += swab.h | ||
diff --git a/arch/blackfin/include/asm/byteorder.h b/arch/blackfin/include/asm/byteorder.h index b9e797a497b4..3e69106a4d37 100644 --- a/arch/blackfin/include/asm/byteorder.h +++ b/arch/blackfin/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _BLACKFIN_BYTEORDER_H | 1 | #ifndef _BLACKFIN_BYTEORDER_H |
2 | #define _BLACKFIN_BYTEORDER_H | 2 | #define _BLACKFIN_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _BLACKFIN_BYTEORDER_H */ | 6 | #endif /* _BLACKFIN_BYTEORDER_H */ |
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index ed171d389e65..72f5cd319b97 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S | |||
@@ -691,7 +691,7 @@ sys_call_table: | |||
691 | .long sys_uselib | 691 | .long sys_uselib |
692 | .long sys_swapon | 692 | .long sys_swapon |
693 | .long sys_reboot | 693 | .long sys_reboot |
694 | .long old_readdir | 694 | .long sys_old_readdir |
695 | .long old_mmap /* 90 */ | 695 | .long old_mmap /* 90 */ |
696 | .long sys_munmap | 696 | .long sys_munmap |
697 | .long sys_truncate | 697 | .long sys_truncate |
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S index 7f6f93e6b70e..5e674c8f7c51 100644 --- a/arch/cris/arch-v32/kernel/entry.S +++ b/arch/cris/arch-v32/kernel/entry.S | |||
@@ -614,7 +614,7 @@ sys_call_table: | |||
614 | .long sys_uselib | 614 | .long sys_uselib |
615 | .long sys_swapon | 615 | .long sys_swapon |
616 | .long sys_reboot | 616 | .long sys_reboot |
617 | .long old_readdir | 617 | .long sys_old_readdir |
618 | .long old_mmap /* 90 */ | 618 | .long old_mmap /* 90 */ |
619 | .long sys_munmap | 619 | .long sys_munmap |
620 | .long sys_truncate | 620 | .long sys_truncate |
diff --git a/arch/cris/include/arch-v10/arch/byteorder.h b/arch/cris/include/arch-v10/arch/swab.h index 255b646b7fa8..e4e847d8a05e 100644 --- a/arch/cris/include/arch-v10/arch/byteorder.h +++ b/arch/cris/include/arch-v10/arch/swab.h | |||
@@ -1,26 +1,30 @@ | |||
1 | #ifndef _CRIS_ARCH_BYTEORDER_H | 1 | #ifndef _CRIS_ARCH_SWAB_H |
2 | #define _CRIS_ARCH_BYTEORDER_H | 2 | #define _CRIS_ARCH_SWAB_H |
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | 6 | ||
7 | #define __SWAB_64_THRU_32__ | ||
8 | |||
7 | /* we just define these two (as we can do the swap in a single | 9 | /* we just define these two (as we can do the swap in a single |
8 | * asm instruction in CRIS) and the arch-independent files will put | 10 | * asm instruction in CRIS) and the arch-independent files will put |
9 | * them together into ntohl etc. | 11 | * them together into ntohl etc. |
10 | */ | 12 | */ |
11 | 13 | ||
12 | static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) | 14 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) |
13 | { | 15 | { |
14 | __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); | 16 | __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); |
15 | 17 | ||
16 | return(x); | 18 | return(x); |
17 | } | 19 | } |
20 | #define __arch_swab32 __arch_swab32 | ||
18 | 21 | ||
19 | static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) | 22 | static inline __attribute_const__ __u16 __arch_swab16(__u16 x) |
20 | { | 23 | { |
21 | __asm__ ("swapb %0" : "=r" (x) : "0" (x)); | 24 | __asm__ ("swapb %0" : "=r" (x) : "0" (x)); |
22 | 25 | ||
23 | return(x); | 26 | return(x); |
24 | } | 27 | } |
28 | #define __arch_swab16 __arch_swab16 | ||
25 | 29 | ||
26 | #endif | 30 | #endif |
diff --git a/arch/cris/include/arch-v32/arch/byteorder.h b/arch/cris/include/arch-v32/arch/byteorder.h deleted file mode 100644 index 6ef8fb4a35f2..000000000000 --- a/arch/cris/include/arch-v32/arch/byteorder.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef _ASM_CRIS_ARCH_BYTEORDER_H | ||
2 | #define _ASM_CRIS_ARCH_BYTEORDER_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | |||
6 | static inline __const__ __u32 | ||
7 | ___arch__swab32(__u32 x) | ||
8 | { | ||
9 | __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); | ||
10 | return (x); | ||
11 | } | ||
12 | |||
13 | static inline __const__ __u16 | ||
14 | ___arch__swab16(__u16 x) | ||
15 | { | ||
16 | __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); | ||
17 | return (x); | ||
18 | } | ||
19 | |||
20 | #endif /* _ASM_CRIS_ARCH_BYTEORDER_H */ | ||
diff --git a/arch/cris/include/arch-v32/arch/swab.h b/arch/cris/include/arch-v32/arch/swab.h new file mode 100644 index 000000000000..9a4ea5e209c2 --- /dev/null +++ b/arch/cris/include/arch-v32/arch/swab.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef _ASM_CRIS_ARCH_SWAB_H | ||
2 | #define _ASM_CRIS_ARCH_SWAB_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | |||
6 | #define __SWAB_64_THRU_32__ | ||
7 | |||
8 | static inline __const__ __u32 | ||
9 | __arch_swab32(__u32 x) | ||
10 | { | ||
11 | __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); | ||
12 | return (x); | ||
13 | } | ||
14 | #define __arch_swab32 __arch_swab32 | ||
15 | |||
16 | static inline __const__ __u16 | ||
17 | __arch_swab16(__u16 x) | ||
18 | { | ||
19 | __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); | ||
20 | return (x); | ||
21 | } | ||
22 | #define __arch_swab16 __arch_swab16 | ||
23 | |||
24 | #endif /* _ASM_CRIS_ARCH_SWAB_H */ | ||
diff --git a/arch/cris/include/asm/byteorder.h b/arch/cris/include/asm/byteorder.h index cc8e418cfd14..bcd189798e26 100644 --- a/arch/cris/include/asm/byteorder.h +++ b/arch/cris/include/asm/byteorder.h | |||
@@ -1,25 +1,6 @@ | |||
1 | #ifndef _CRIS_BYTEORDER_H | 1 | #ifndef _CRIS_BYTEORDER_H |
2 | #define _CRIS_BYTEORDER_H | 2 | #define _CRIS_BYTEORDER_H |
3 | 3 | ||
4 | #ifdef __GNUC__ | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | #include <arch/byteorder.h> | ||
8 | |||
9 | /* defines are necessary because the other files detect the presence | ||
10 | * of a defined __arch_swab32, not an inline | ||
11 | */ | ||
12 | #define __arch__swab32(x) ___arch__swab32(x) | ||
13 | #define __arch__swab16(x) ___arch__swab16(x) | ||
14 | #endif /* __KERNEL__ */ | ||
15 | |||
16 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
17 | # define __BYTEORDER_HAS_U64__ | ||
18 | # define __SWAB_64_THRU_32__ | ||
19 | #endif | ||
20 | |||
21 | #endif /* __GNUC__ */ | ||
22 | |||
23 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
24 | 5 | ||
25 | #endif | 6 | #endif |
diff --git a/arch/cris/include/asm/swab.h b/arch/cris/include/asm/swab.h new file mode 100644 index 000000000000..80668e88419c --- /dev/null +++ b/arch/cris/include/asm/swab.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _CRIS_SWAB_H | ||
2 | #define _CRIS_SWAB_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | #include <arch/swab.h> | ||
6 | #endif /* __KERNEL__ */ | ||
7 | |||
8 | #endif /* _CRIS_SWAB_H */ | ||
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 27b108a86b39..c68e1680da01 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild | |||
@@ -1,2 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | unifdef-y += swab.h | ||
diff --git a/arch/h8300/include/asm/byteorder.h b/arch/h8300/include/asm/byteorder.h index c36b80a3dd84..13539da99efd 100644 --- a/arch/h8300/include/asm/byteorder.h +++ b/arch/h8300/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _H8300_BYTEORDER_H | 1 | #ifndef _H8300_BYTEORDER_H |
2 | #define _H8300_BYTEORDER_H | 2 | #define _H8300_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _H8300_BYTEORDER_H */ | 6 | #endif /* _H8300_BYTEORDER_H */ |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index 54e21c3f2057..4eb67faac633 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -103,7 +103,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
103 | .long SYMBOL_NAME(sys_uselib) | 103 | .long SYMBOL_NAME(sys_uselib) |
104 | .long SYMBOL_NAME(sys_swapon) | 104 | .long SYMBOL_NAME(sys_swapon) |
105 | .long SYMBOL_NAME(sys_reboot) | 105 | .long SYMBOL_NAME(sys_reboot) |
106 | .long SYMBOL_NAME(old_readdir) | 106 | .long SYMBOL_NAME(sys_old_readdir) |
107 | .long SYMBOL_NAME(old_mmap) /* 90 */ | 107 | .long SYMBOL_NAME(old_mmap) /* 90 */ |
108 | .long SYMBOL_NAME(sys_munmap) | 108 | .long SYMBOL_NAME(sys_munmap) |
109 | .long SYMBOL_NAME(sys_truncate) | 109 | .long SYMBOL_NAME(sys_truncate) |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 3d31636cbafb..6183aeccecf1 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -17,6 +17,7 @@ config IA64 | |||
17 | select ACPI if (!IA64_HP_SIM) | 17 | select ACPI if (!IA64_HP_SIM) |
18 | select PM if (!IA64_HP_SIM) | 18 | select PM if (!IA64_HP_SIM) |
19 | select ARCH_SUPPORTS_MSI | 19 | select ARCH_SUPPORTS_MSI |
20 | select HAVE_UNSTABLE_SCHED_CLOCK | ||
20 | select HAVE_IDE | 21 | select HAVE_IDE |
21 | select HAVE_OPROFILE | 22 | select HAVE_OPROFILE |
22 | select HAVE_KPROBES | 23 | select HAVE_KPROBES |
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig index 27eb67604c53..a109db30ce55 100644 --- a/arch/ia64/configs/generic_defconfig +++ b/arch/ia64/configs/generic_defconfig | |||
@@ -578,7 +578,7 @@ CONFIG_ATA_PIIX=y | |||
578 | # CONFIG_SATA_SIS is not set | 578 | # CONFIG_SATA_SIS is not set |
579 | # CONFIG_SATA_ULI is not set | 579 | # CONFIG_SATA_ULI is not set |
580 | # CONFIG_SATA_VIA is not set | 580 | # CONFIG_SATA_VIA is not set |
581 | # CONFIG_SATA_VITESSE is not set | 581 | CONFIG_SATA_VITESSE=y |
582 | # CONFIG_SATA_INIC162X is not set | 582 | # CONFIG_SATA_INIC162X is not set |
583 | # CONFIG_PATA_ACPI is not set | 583 | # CONFIG_PATA_ACPI is not set |
584 | # CONFIG_PATA_ALI is not set | 584 | # CONFIG_PATA_ALI is not set |
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S index a8cf19958850..a46f8395e9a5 100644 --- a/arch/ia64/ia32/ia32_entry.S +++ b/arch/ia64/ia32/ia32_entry.S | |||
@@ -220,7 +220,7 @@ ia32_syscall_table: | |||
220 | data8 sys_mkdir | 220 | data8 sys_mkdir |
221 | data8 sys_rmdir /* 40 */ | 221 | data8 sys_rmdir /* 40 */ |
222 | data8 sys_dup | 222 | data8 sys_dup |
223 | data8 sys_pipe | 223 | data8 sys_ia64_pipe |
224 | data8 compat_sys_times | 224 | data8 compat_sys_times |
225 | data8 sys_ni_syscall /* old prof syscall holder */ | 225 | data8 sys_ni_syscall /* old prof syscall holder */ |
226 | data8 sys32_brk /* 45 */ | 226 | data8 sys32_brk /* 45 */ |
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 3b25bd9dca91..ccbe8ae47a61 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild | |||
@@ -14,4 +14,3 @@ unifdef-y += gcc_intrin.h | |||
14 | unifdef-y += intrinsics.h | 14 | unifdef-y += intrinsics.h |
15 | unifdef-y += perfmon.h | 15 | unifdef-y += perfmon.h |
16 | unifdef-y += ustack.h | 16 | unifdef-y += ustack.h |
17 | unifdef-y += swab.h | ||
diff --git a/arch/ia64/include/asm/byteorder.h b/arch/ia64/include/asm/byteorder.h index 0f84c5cb703d..a8dd73558150 100644 --- a/arch/ia64/include/asm/byteorder.h +++ b/arch/ia64/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_IA64_BYTEORDER_H | 1 | #ifndef _ASM_IA64_BYTEORDER_H |
2 | #define _ASM_IA64_BYTEORDER_H | 2 | #define _ASM_IA64_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_IA64_BYTEORDER_H */ | 6 | #endif /* _ASM_IA64_BYTEORDER_H */ |
diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index f4d4b1850a7e..abe52575e905 100644 --- a/arch/ia64/include/asm/dma-mapping.h +++ b/arch/ia64/include/asm/dma-mapping.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #include <linux/scatterlist.h> | 9 | #include <linux/scatterlist.h> |
10 | #include <asm/swiotlb.h> | 10 | #include <asm/swiotlb.h> |
11 | 11 | ||
12 | #define ARCH_HAS_DMA_GET_REQUIRED_MASK | ||
13 | |||
12 | extern struct dma_map_ops *dma_ops; | 14 | extern struct dma_map_ops *dma_ops; |
13 | extern struct ia64_machine_vector ia64_mv; | 15 | extern struct ia64_machine_vector ia64_mv; |
14 | extern void set_iommu_machvec(void); | 16 | extern void set_iommu_machvec(void); |
diff --git a/arch/ia64/include/asm/machvec.h b/arch/ia64/include/asm/machvec.h index 22a75fb55adb..367d299d9938 100644 --- a/arch/ia64/include/asm/machvec.h +++ b/arch/ia64/include/asm/machvec.h | |||
@@ -44,6 +44,7 @@ typedef void ia64_mv_kernel_launch_event_t(void); | |||
44 | 44 | ||
45 | /* DMA-mapping interface: */ | 45 | /* DMA-mapping interface: */ |
46 | typedef void ia64_mv_dma_init (void); | 46 | typedef void ia64_mv_dma_init (void); |
47 | typedef u64 ia64_mv_dma_get_required_mask (struct device *); | ||
47 | typedef struct dma_map_ops *ia64_mv_dma_get_ops(struct device *); | 48 | typedef struct dma_map_ops *ia64_mv_dma_get_ops(struct device *); |
48 | 49 | ||
49 | /* | 50 | /* |
@@ -128,6 +129,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); | |||
128 | # define platform_global_tlb_purge ia64_mv.global_tlb_purge | 129 | # define platform_global_tlb_purge ia64_mv.global_tlb_purge |
129 | # define platform_tlb_migrate_finish ia64_mv.tlb_migrate_finish | 130 | # define platform_tlb_migrate_finish ia64_mv.tlb_migrate_finish |
130 | # define platform_dma_init ia64_mv.dma_init | 131 | # define platform_dma_init ia64_mv.dma_init |
132 | # define platform_dma_get_required_mask ia64_mv.dma_get_required_mask | ||
131 | # define platform_dma_get_ops ia64_mv.dma_get_ops | 133 | # define platform_dma_get_ops ia64_mv.dma_get_ops |
132 | # define platform_irq_to_vector ia64_mv.irq_to_vector | 134 | # define platform_irq_to_vector ia64_mv.irq_to_vector |
133 | # define platform_local_vector_to_irq ia64_mv.local_vector_to_irq | 135 | # define platform_local_vector_to_irq ia64_mv.local_vector_to_irq |
@@ -171,6 +173,7 @@ struct ia64_machine_vector { | |||
171 | ia64_mv_global_tlb_purge_t *global_tlb_purge; | 173 | ia64_mv_global_tlb_purge_t *global_tlb_purge; |
172 | ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish; | 174 | ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish; |
173 | ia64_mv_dma_init *dma_init; | 175 | ia64_mv_dma_init *dma_init; |
176 | ia64_mv_dma_get_required_mask *dma_get_required_mask; | ||
174 | ia64_mv_dma_get_ops *dma_get_ops; | 177 | ia64_mv_dma_get_ops *dma_get_ops; |
175 | ia64_mv_irq_to_vector *irq_to_vector; | 178 | ia64_mv_irq_to_vector *irq_to_vector; |
176 | ia64_mv_local_vector_to_irq *local_vector_to_irq; | 179 | ia64_mv_local_vector_to_irq *local_vector_to_irq; |
@@ -210,6 +213,7 @@ struct ia64_machine_vector { | |||
210 | platform_global_tlb_purge, \ | 213 | platform_global_tlb_purge, \ |
211 | platform_tlb_migrate_finish, \ | 214 | platform_tlb_migrate_finish, \ |
212 | platform_dma_init, \ | 215 | platform_dma_init, \ |
216 | platform_dma_get_required_mask, \ | ||
213 | platform_dma_get_ops, \ | 217 | platform_dma_get_ops, \ |
214 | platform_irq_to_vector, \ | 218 | platform_irq_to_vector, \ |
215 | platform_local_vector_to_irq, \ | 219 | platform_local_vector_to_irq, \ |
@@ -284,6 +288,9 @@ extern struct dma_map_ops *dma_get_ops(struct device *); | |||
284 | #ifndef platform_dma_get_ops | 288 | #ifndef platform_dma_get_ops |
285 | # define platform_dma_get_ops dma_get_ops | 289 | # define platform_dma_get_ops dma_get_ops |
286 | #endif | 290 | #endif |
291 | #ifndef platform_dma_get_required_mask | ||
292 | # define platform_dma_get_required_mask ia64_dma_get_required_mask | ||
293 | #endif | ||
287 | #ifndef platform_irq_to_vector | 294 | #ifndef platform_irq_to_vector |
288 | # define platform_irq_to_vector __ia64_irq_to_vector | 295 | # define platform_irq_to_vector __ia64_irq_to_vector |
289 | #endif | 296 | #endif |
diff --git a/arch/ia64/include/asm/machvec_init.h b/arch/ia64/include/asm/machvec_init.h index ef964b286842..37a469849ab9 100644 --- a/arch/ia64/include/asm/machvec_init.h +++ b/arch/ia64/include/asm/machvec_init.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | extern ia64_mv_send_ipi_t ia64_send_ipi; | 4 | extern ia64_mv_send_ipi_t ia64_send_ipi; |
5 | extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; | 5 | extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; |
6 | extern ia64_mv_dma_get_required_mask ia64_dma_get_required_mask; | ||
6 | extern ia64_mv_irq_to_vector __ia64_irq_to_vector; | 7 | extern ia64_mv_irq_to_vector __ia64_irq_to_vector; |
7 | extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; | 8 | extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; |
8 | extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem; | 9 | extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem; |
diff --git a/arch/ia64/include/asm/machvec_sn2.h b/arch/ia64/include/asm/machvec_sn2.h index afd029b4797e..f061a30aac42 100644 --- a/arch/ia64/include/asm/machvec_sn2.h +++ b/arch/ia64/include/asm/machvec_sn2.h | |||
@@ -55,6 +55,7 @@ extern ia64_mv_readb_t __sn_readb_relaxed; | |||
55 | extern ia64_mv_readw_t __sn_readw_relaxed; | 55 | extern ia64_mv_readw_t __sn_readw_relaxed; |
56 | extern ia64_mv_readl_t __sn_readl_relaxed; | 56 | extern ia64_mv_readl_t __sn_readl_relaxed; |
57 | extern ia64_mv_readq_t __sn_readq_relaxed; | 57 | extern ia64_mv_readq_t __sn_readq_relaxed; |
58 | extern ia64_mv_dma_get_required_mask sn_dma_get_required_mask; | ||
58 | extern ia64_mv_dma_init sn_dma_init; | 59 | extern ia64_mv_dma_init sn_dma_init; |
59 | extern ia64_mv_migrate_t sn_migrate; | 60 | extern ia64_mv_migrate_t sn_migrate; |
60 | extern ia64_mv_kernel_launch_event_t sn_kernel_launch_event; | 61 | extern ia64_mv_kernel_launch_event_t sn_kernel_launch_event; |
@@ -99,6 +100,7 @@ extern ia64_mv_pci_fixup_bus_t sn_pci_fixup_bus; | |||
99 | #define platform_pci_get_legacy_mem sn_pci_get_legacy_mem | 100 | #define platform_pci_get_legacy_mem sn_pci_get_legacy_mem |
100 | #define platform_pci_legacy_read sn_pci_legacy_read | 101 | #define platform_pci_legacy_read sn_pci_legacy_read |
101 | #define platform_pci_legacy_write sn_pci_legacy_write | 102 | #define platform_pci_legacy_write sn_pci_legacy_write |
103 | #define platform_dma_get_required_mask sn_dma_get_required_mask | ||
102 | #define platform_dma_init sn_dma_init | 104 | #define platform_dma_init sn_dma_init |
103 | #define platform_migrate sn_migrate | 105 | #define platform_migrate sn_migrate |
104 | #define platform_kernel_launch_event sn_kernel_launch_event | 106 | #define platform_kernel_launch_event sn_kernel_launch_event |
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index f791576355ad..9015979ebe0f 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h | |||
@@ -364,7 +364,7 @@ struct pt_regs; | |||
364 | struct sigaction; | 364 | struct sigaction; |
365 | long sys_execve(char __user *filename, char __user * __user *argv, | 365 | long sys_execve(char __user *filename, char __user * __user *argv, |
366 | char __user * __user *envp, struct pt_regs *regs); | 366 | char __user * __user *envp, struct pt_regs *regs); |
367 | asmlinkage long sys_pipe(void); | 367 | asmlinkage long sys_ia64_pipe(void); |
368 | asmlinkage long sys_rt_sigaction(int sig, | 368 | asmlinkage long sys_rt_sigaction(int sig, |
369 | const struct sigaction __user *act, | 369 | const struct sigaction __user *act, |
370 | struct sigaction __user *oact, | 370 | struct sigaction __user *oact, |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index d435f4a7a96c..e5341e2c1175 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1442,7 +1442,7 @@ sys_call_table: | |||
1442 | data8 sys_mkdir // 1055 | 1442 | data8 sys_mkdir // 1055 |
1443 | data8 sys_rmdir | 1443 | data8 sys_rmdir |
1444 | data8 sys_dup | 1444 | data8 sys_dup |
1445 | data8 sys_pipe | 1445 | data8 sys_ia64_pipe |
1446 | data8 sys_times | 1446 | data8 sys_times |
1447 | data8 ia64_brk // 1060 | 1447 | data8 ia64_brk // 1060 |
1448 | data8 sys_setgid | 1448 | data8 sys_setgid |
diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c index bcbb6d8792d3..92ed83f34036 100644 --- a/arch/ia64/kernel/sys_ia64.c +++ b/arch/ia64/kernel/sys_ia64.c | |||
@@ -154,7 +154,7 @@ out: | |||
154 | * and r9) as this is faster than doing a copy_to_user(). | 154 | * and r9) as this is faster than doing a copy_to_user(). |
155 | */ | 155 | */ |
156 | asmlinkage long | 156 | asmlinkage long |
157 | sys_pipe (void) | 157 | sys_ia64_pipe (void) |
158 | { | 158 | { |
159 | struct pt_regs *regs = task_pt_regs(current); | 159 | struct pt_regs *regs = task_pt_regs(current); |
160 | int fd[2]; | 160 | int fd[2]; |
diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c index ff0e7c10faa7..6db08599ebbc 100644 --- a/arch/ia64/kernel/unaligned.c +++ b/arch/ia64/kernel/unaligned.c | |||
@@ -59,6 +59,7 @@ dump (const char *str, void *vp, size_t len) | |||
59 | * (i.e. don't allow attacker to fill up logs with unaligned accesses). | 59 | * (i.e. don't allow attacker to fill up logs with unaligned accesses). |
60 | */ | 60 | */ |
61 | int no_unaligned_warning; | 61 | int no_unaligned_warning; |
62 | int unaligned_dump_stack; | ||
62 | static int noprint_warning; | 63 | static int noprint_warning; |
63 | 64 | ||
64 | /* | 65 | /* |
@@ -1371,9 +1372,12 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) | |||
1371 | } | 1372 | } |
1372 | } | 1373 | } |
1373 | } else { | 1374 | } else { |
1374 | if (within_logging_rate_limit()) | 1375 | if (within_logging_rate_limit()) { |
1375 | printk(KERN_WARNING "kernel unaligned access to 0x%016lx, ip=0x%016lx\n", | 1376 | printk(KERN_WARNING "kernel unaligned access to 0x%016lx, ip=0x%016lx\n", |
1376 | ifa, regs->cr_iip + ipsr->ri); | 1377 | ifa, regs->cr_iip + ipsr->ri); |
1378 | if (unaligned_dump_stack) | ||
1379 | dump_stack(); | ||
1380 | } | ||
1377 | set_fs(KERNEL_DS); | 1381 | set_fs(KERNEL_DS); |
1378 | } | 1382 | } |
1379 | 1383 | ||
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 211fcfd115f9..61f1af5c23c1 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/ioport.h> | 19 | #include <linux/ioport.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
22 | #include <linux/bootmem.h> | ||
22 | 23 | ||
23 | #include <asm/machvec.h> | 24 | #include <asm/machvec.h> |
24 | #include <asm/page.h> | 25 | #include <asm/page.h> |
@@ -748,6 +749,32 @@ static void __init set_pci_cacheline_size(void) | |||
748 | pci_cache_line_size = (1 << cci.pcci_line_size) / 4; | 749 | pci_cache_line_size = (1 << cci.pcci_line_size) / 4; |
749 | } | 750 | } |
750 | 751 | ||
752 | u64 ia64_dma_get_required_mask(struct device *dev) | ||
753 | { | ||
754 | u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT); | ||
755 | u32 high_totalram = ((max_pfn - 1) >> (32 - PAGE_SHIFT)); | ||
756 | u64 mask; | ||
757 | |||
758 | if (!high_totalram) { | ||
759 | /* convert to mask just covering totalram */ | ||
760 | low_totalram = (1 << (fls(low_totalram) - 1)); | ||
761 | low_totalram += low_totalram - 1; | ||
762 | mask = low_totalram; | ||
763 | } else { | ||
764 | high_totalram = (1 << (fls(high_totalram) - 1)); | ||
765 | high_totalram += high_totalram - 1; | ||
766 | mask = (((u64)high_totalram) << 32) + 0xffffffff; | ||
767 | } | ||
768 | return mask; | ||
769 | } | ||
770 | EXPORT_SYMBOL_GPL(ia64_dma_get_required_mask); | ||
771 | |||
772 | u64 dma_get_required_mask(struct device *dev) | ||
773 | { | ||
774 | return platform_dma_get_required_mask(dev); | ||
775 | } | ||
776 | EXPORT_SYMBOL_GPL(dma_get_required_mask); | ||
777 | |||
751 | static int __init pcibios_init(void) | 778 | static int __init pcibios_init(void) |
752 | { | 779 | { |
753 | set_pci_cacheline_size(); | 780 | set_pci_cacheline_size(); |
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c index 9c788f9cedfd..8c130e8f00e1 100644 --- a/arch/ia64/sn/pci/pci_dma.c +++ b/arch/ia64/sn/pci/pci_dma.c | |||
@@ -347,6 +347,12 @@ static int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | |||
347 | return 0; | 347 | return 0; |
348 | } | 348 | } |
349 | 349 | ||
350 | u64 sn_dma_get_required_mask(struct device *dev) | ||
351 | { | ||
352 | return DMA_64BIT_MASK; | ||
353 | } | ||
354 | EXPORT_SYMBOL_GPL(sn_dma_get_required_mask); | ||
355 | |||
350 | char *sn_pci_get_legacy_mem(struct pci_bus *bus) | 356 | char *sn_pci_get_legacy_mem(struct pci_bus *bus) |
351 | { | 357 | { |
352 | if (!SN_PCIBUS_BUSSOFT(bus)) | 358 | if (!SN_PCIBUS_BUSSOFT(bus)) |
diff --git a/arch/ia64/xen/time.c b/arch/ia64/xen/time.c index d15a94c330fb..68d6204c3f16 100644 --- a/arch/ia64/xen/time.c +++ b/arch/ia64/xen/time.c | |||
@@ -129,8 +129,8 @@ consider_steal_time(unsigned long new_itm) | |||
129 | blocked = stolentick; | 129 | blocked = stolentick; |
130 | 130 | ||
131 | if (stolen > 0 || blocked > 0) { | 131 | if (stolen > 0 || blocked > 0) { |
132 | account_steal_time(NULL, jiffies_to_cputime(stolen)); | 132 | account_steal_ticks(stolen); |
133 | account_steal_time(idle_task(cpu), jiffies_to_cputime(blocked)); | 133 | account_idle_ticks(blocked); |
134 | run_local_timers(); | 134 | run_local_timers(); |
135 | 135 | ||
136 | if (rcu_pending(cpu)) | 136 | if (rcu_pending(cpu)) |
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index 907a5533c845..c5b5212cc3f9 100644 --- a/arch/m68k/amiga/amiints.c +++ b/arch/m68k/amiga/amiints.c | |||
@@ -72,10 +72,14 @@ static struct irq_controller amiga_irq_controller = { | |||
72 | 72 | ||
73 | void __init amiga_init_IRQ(void) | 73 | void __init amiga_init_IRQ(void) |
74 | { | 74 | { |
75 | request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL); | 75 | if (request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL)) |
76 | request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL); | 76 | pr_err("Couldn't register int%d\n", 1); |
77 | request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL); | 77 | if (request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL)) |
78 | request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL); | 78 | pr_err("Couldn't register int%d\n", 3); |
79 | if (request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL)) | ||
80 | pr_err("Couldn't register int%d\n", 4); | ||
81 | if (request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL)) | ||
82 | pr_err("Couldn't register int%d\n", 5); | ||
79 | 83 | ||
80 | m68k_setup_irq_controller(&amiga_irq_controller, IRQ_USER, AMI_STD_IRQS); | 84 | m68k_setup_irq_controller(&amiga_irq_controller, IRQ_USER, AMI_STD_IRQS); |
81 | 85 | ||
diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c index 343fab49bd9a..ecd0f7ca6f0e 100644 --- a/arch/m68k/amiga/cia.c +++ b/arch/m68k/amiga/cia.c | |||
@@ -176,5 +176,7 @@ void __init cia_init_IRQ(struct ciabase *base) | |||
176 | /* override auto int and install CIA handler */ | 176 | /* override auto int and install CIA handler */ |
177 | m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1); | 177 | m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1); |
178 | m68k_irq_startup(base->handler_irq); | 178 | m68k_irq_startup(base->handler_irq); |
179 | request_irq(base->handler_irq, cia_handler, IRQF_SHARED, base->name, base); | 179 | if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED, |
180 | base->name, base)) | ||
181 | pr_err("Couldn't register %s interrupt\n", base->name); | ||
180 | } | 182 | } |
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index ab9862c3a136..6e562751ad51 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c | |||
@@ -493,7 +493,8 @@ static void __init amiga_sched_init(irq_handler_t timer_routine) | |||
493 | * Please don't change this to use ciaa, as it interferes with the | 493 | * Please don't change this to use ciaa, as it interferes with the |
494 | * SCSI code. We'll have to take a look at this later | 494 | * SCSI code. We'll have to take a look at this later |
495 | */ | 495 | */ |
496 | request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL); | 496 | if (request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL)) |
497 | pr_err("Couldn't register timer interrupt\n"); | ||
497 | /* start timer */ | 498 | /* start timer */ |
498 | ciab.cra |= 0x11; | 499 | ciab.cra |= 0x11; |
499 | } | 500 | } |
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index 78df98f2029a..8d3eafab1ffe 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c | |||
@@ -31,10 +31,6 @@ extern unsigned long dn_gettimeoffset(void); | |||
31 | extern int dn_dummy_hwclk(int, struct rtc_time *); | 31 | extern int dn_dummy_hwclk(int, struct rtc_time *); |
32 | extern int dn_dummy_set_clock_mmss(unsigned long); | 32 | extern int dn_dummy_set_clock_mmss(unsigned long); |
33 | extern void dn_dummy_reset(void); | 33 | extern void dn_dummy_reset(void); |
34 | extern void dn_dummy_waitbut(void); | ||
35 | extern struct fb_info *dn_fb_init(long *); | ||
36 | extern void dn_dummy_debug_init(void); | ||
37 | extern irqreturn_t dn_process_int(int irq, struct pt_regs *fp); | ||
38 | #ifdef CONFIG_HEARTBEAT | 34 | #ifdef CONFIG_HEARTBEAT |
39 | static void dn_heartbeat(int on); | 35 | static void dn_heartbeat(int on); |
40 | #endif | 36 | #endif |
@@ -204,7 +200,8 @@ void dn_sched_init(irq_handler_t timer_routine) | |||
204 | printk("*(0x10803) %02x\n",*(volatile unsigned char *)(timer+0x3)); | 200 | printk("*(0x10803) %02x\n",*(volatile unsigned char *)(timer+0x3)); |
205 | #endif | 201 | #endif |
206 | 202 | ||
207 | request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", timer_routine); | 203 | if (request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", timer_routine)) |
204 | pr_err("Couldn't register timer interrupt\n"); | ||
208 | } | 205 | } |
209 | 206 | ||
210 | unsigned long dn_gettimeoffset(void) { | 207 | unsigned long dn_gettimeoffset(void) { |
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c index c038b7c7eff0..a5f33c059979 100644 --- a/arch/m68k/atari/atakeyb.c +++ b/arch/m68k/atari/atakeyb.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <asm/atari_joystick.h> | 33 | #include <asm/atari_joystick.h> |
34 | #include <asm/irq.h> | 34 | #include <asm/irq.h> |
35 | 35 | ||
36 | extern unsigned int keymap_count; | ||
37 | 36 | ||
38 | /* Hook for MIDI serial driver */ | 37 | /* Hook for MIDI serial driver */ |
39 | void (*atari_MIDI_interrupt_hook) (void); | 38 | void (*atari_MIDI_interrupt_hook) (void); |
@@ -567,14 +566,19 @@ static int atari_keyb_done = 0; | |||
567 | 566 | ||
568 | int atari_keyb_init(void) | 567 | int atari_keyb_init(void) |
569 | { | 568 | { |
569 | int error; | ||
570 | |||
570 | if (atari_keyb_done) | 571 | if (atari_keyb_done) |
571 | return 0; | 572 | return 0; |
572 | 573 | ||
573 | kb_state.state = KEYBOARD; | 574 | kb_state.state = KEYBOARD; |
574 | kb_state.len = 0; | 575 | kb_state.len = 0; |
575 | 576 | ||
576 | request_irq(IRQ_MFP_ACIA, atari_keyboard_interrupt, IRQ_TYPE_SLOW, | 577 | error = request_irq(IRQ_MFP_ACIA, atari_keyboard_interrupt, |
577 | "keyboard/mouse/MIDI", atari_keyboard_interrupt); | 578 | IRQ_TYPE_SLOW, "keyboard/mouse/MIDI", |
579 | atari_keyboard_interrupt); | ||
580 | if (error) | ||
581 | return error; | ||
578 | 582 | ||
579 | atari_turnoff_irq(IRQ_MFP_ACIA); | 583 | atari_turnoff_irq(IRQ_MFP_ACIA); |
580 | do { | 584 | do { |
diff --git a/arch/m68k/atari/stdma.c b/arch/m68k/atari/stdma.c index d1bd029a34ac..604329fafbb8 100644 --- a/arch/m68k/atari/stdma.c +++ b/arch/m68k/atari/stdma.c | |||
@@ -179,8 +179,9 @@ EXPORT_SYMBOL(stdma_islocked); | |||
179 | void __init stdma_init(void) | 179 | void __init stdma_init(void) |
180 | { | 180 | { |
181 | stdma_isr = NULL; | 181 | stdma_isr = NULL; |
182 | request_irq(IRQ_MFP_FDC, stdma_int, IRQ_TYPE_SLOW | IRQF_SHARED, | 182 | if (request_irq(IRQ_MFP_FDC, stdma_int, IRQ_TYPE_SLOW | IRQF_SHARED, |
183 | "ST-DMA: floppy/ACSI/IDE/Falcon-SCSI", stdma_int); | 183 | "ST-DMA: floppy/ACSI/IDE/Falcon-SCSI", stdma_int)) |
184 | pr_err("Couldn't register ST-DMA interrupt\n"); | ||
184 | } | 185 | } |
185 | 186 | ||
186 | 187 | ||
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index 1edde27fa32d..d076ff8d1b39 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c | |||
@@ -31,8 +31,9 @@ atari_sched_init(irq_handler_t timer_routine) | |||
31 | /* start timer C, div = 1:100 */ | 31 | /* start timer C, div = 1:100 */ |
32 | mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60; | 32 | mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60; |
33 | /* install interrupt service routine for MFP Timer C */ | 33 | /* install interrupt service routine for MFP Timer C */ |
34 | request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW, | 34 | if (request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW, |
35 | "timer", timer_routine); | 35 | "timer", timer_routine)) |
36 | pr_err("Couldn't register timer interrupt\n"); | ||
36 | } | 37 | } |
37 | 38 | ||
38 | /* ++andreas: gettimeoffset fixed to check for pending interrupt */ | 39 | /* ++andreas: gettimeoffset fixed to check for pending interrupt */ |
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index c072595928c0..9fe6fefb5e14 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c | |||
@@ -43,7 +43,6 @@ extern unsigned long bvme6000_gettimeoffset (void); | |||
43 | extern int bvme6000_hwclk (int, struct rtc_time *); | 43 | extern int bvme6000_hwclk (int, struct rtc_time *); |
44 | extern int bvme6000_set_clock_mmss (unsigned long); | 44 | extern int bvme6000_set_clock_mmss (unsigned long); |
45 | extern void bvme6000_reset (void); | 45 | extern void bvme6000_reset (void); |
46 | extern void bvme6000_waitbut(void); | ||
47 | void bvme6000_set_vectors (void); | 46 | void bvme6000_set_vectors (void); |
48 | 47 | ||
49 | /* Save tick handler routine pointer, will point to do_timer() in | 48 | /* Save tick handler routine pointer, will point to do_timer() in |
diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index dd7c8a2583d3..f6312c7d8727 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c | |||
@@ -70,7 +70,8 @@ void __init hp300_sched_init(irq_handler_t vector) | |||
70 | 70 | ||
71 | asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE)); | 71 | asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE)); |
72 | 72 | ||
73 | request_irq(IRQ_AUTO_6, hp300_tick, IRQ_FLG_STD, "timer tick", vector); | 73 | if (request_irq(IRQ_AUTO_6, hp300_tick, IRQ_FLG_STD, "timer tick", vector)) |
74 | pr_err("Couldn't register timer interrupt\n"); | ||
74 | 75 | ||
75 | out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */ | 76 | out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */ |
76 | out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */ | 77 | out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */ |
diff --git a/arch/m68k/kernel/.gitignore b/arch/m68k/kernel/.gitignore new file mode 100644 index 000000000000..c5f676c3c224 --- /dev/null +++ b/arch/m68k/kernel/.gitignore | |||
@@ -0,0 +1 @@ | |||
vmlinux.lds | |||
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index f28404d9a2bc..5c332f2b9b83 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S | |||
@@ -424,7 +424,7 @@ resume: | |||
424 | .data | 424 | .data |
425 | ALIGN | 425 | ALIGN |
426 | sys_call_table: | 426 | sys_call_table: |
427 | .long sys_ni_syscall /* 0 - old "setup()" system call*/ | 427 | .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ |
428 | .long sys_exit | 428 | .long sys_exit |
429 | .long sys_fork | 429 | .long sys_fork |
430 | .long sys_read | 430 | .long sys_read |
@@ -513,7 +513,7 @@ sys_call_table: | |||
513 | .long sys_uselib | 513 | .long sys_uselib |
514 | .long sys_swapon | 514 | .long sys_swapon |
515 | .long sys_reboot | 515 | .long sys_reboot |
516 | .long old_readdir | 516 | .long sys_old_readdir |
517 | .long old_mmap /* 90 */ | 517 | .long old_mmap /* 90 */ |
518 | .long sys_munmap | 518 | .long sys_munmap |
519 | .long sys_truncate | 519 | .long sys_truncate |
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index 4d97bd2bd573..303730afb1c9 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/initrd.h> | 26 | #include <linux/initrd.h> |
27 | 27 | ||
28 | #include <asm/bootinfo.h> | 28 | #include <asm/bootinfo.h> |
29 | #include <asm/sections.h> | ||
29 | #include <asm/setup.h> | 30 | #include <asm/setup.h> |
30 | #include <asm/fpu.h> | 31 | #include <asm/fpu.h> |
31 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
@@ -62,7 +63,6 @@ EXPORT_SYMBOL(vme_brdtype); | |||
62 | int m68k_is040or060; | 63 | int m68k_is040or060; |
63 | EXPORT_SYMBOL(m68k_is040or060); | 64 | EXPORT_SYMBOL(m68k_is040or060); |
64 | 65 | ||
65 | extern int end; | ||
66 | extern unsigned long availmem; | 66 | extern unsigned long availmem; |
67 | 67 | ||
68 | int m68k_num_memory; | 68 | int m68k_num_memory; |
@@ -215,11 +215,10 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record) | |||
215 | 215 | ||
216 | void __init setup_arch(char **cmdline_p) | 216 | void __init setup_arch(char **cmdline_p) |
217 | { | 217 | { |
218 | extern int _etext, _edata, _end; | ||
219 | int i; | 218 | int i; |
220 | 219 | ||
221 | /* The bootinfo is located right after the kernel bss */ | 220 | /* The bootinfo is located right after the kernel bss */ |
222 | m68k_parse_bootinfo((const struct bi_record *)&_end); | 221 | m68k_parse_bootinfo((const struct bi_record *)_end); |
223 | 222 | ||
224 | if (CPU_IS_040) | 223 | if (CPU_IS_040) |
225 | m68k_is040or060 = 4; | 224 | m68k_is040or060 = 4; |
@@ -252,9 +251,9 @@ void __init setup_arch(char **cmdline_p) | |||
252 | } | 251 | } |
253 | 252 | ||
254 | init_mm.start_code = PAGE_OFFSET; | 253 | init_mm.start_code = PAGE_OFFSET; |
255 | init_mm.end_code = (unsigned long) &_etext; | 254 | init_mm.end_code = (unsigned long)_etext; |
256 | init_mm.end_data = (unsigned long) &_edata; | 255 | init_mm.end_data = (unsigned long)_edata; |
257 | init_mm.brk = (unsigned long) &_end; | 256 | init_mm.brk = (unsigned long)_end; |
258 | 257 | ||
259 | *cmdline_p = m68k_command_line; | 258 | *cmdline_p = m68k_command_line; |
260 | memcpy(boot_command_line, *cmdline_p, CL_SIZE); | 259 | memcpy(boot_command_line, *cmdline_p, CL_SIZE); |
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index f9af893cd289..de2d05ddd86d 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c | |||
@@ -326,6 +326,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc, void __u | |||
326 | struct sigcontext context; | 326 | struct sigcontext context; |
327 | int err; | 327 | int err; |
328 | 328 | ||
329 | /* Always make any pending restarted system calls return -EINTR */ | ||
330 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
331 | |||
329 | /* get previous context */ | 332 | /* get previous context */ |
330 | if (copy_from_user(&context, usc, sizeof(context))) | 333 | if (copy_from_user(&context, usc, sizeof(context))) |
331 | goto badframe; | 334 | goto badframe; |
@@ -411,6 +414,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, | |||
411 | unsigned long usp; | 414 | unsigned long usp; |
412 | int err; | 415 | int err; |
413 | 416 | ||
417 | /* Always make any pending restarted system calls return -EINTR */ | ||
418 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
419 | |||
414 | err = __get_user(temp, &uc->uc_mcontext.version); | 420 | err = __get_user(temp, &uc->uc_mcontext.version); |
415 | if (temp != MCONTEXT_VERSION) | 421 | if (temp != MCONTEXT_VERSION) |
416 | goto badframe; | 422 | goto badframe; |
@@ -937,6 +943,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler) | |||
937 | regs->d0 = -EINTR; | 943 | regs->d0 = -EINTR; |
938 | break; | 944 | break; |
939 | 945 | ||
946 | case -ERESTART_RESTARTBLOCK: | ||
947 | if (!has_handler) { | ||
948 | regs->d0 = __NR_restart_syscall; | ||
949 | regs->pc -= 2; | ||
950 | break; | ||
951 | } | ||
952 | regs->d0 = -EINTR; | ||
953 | break; | ||
954 | |||
940 | case -ERESTARTSYS: | 955 | case -ERESTARTSYS: |
941 | if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { | 956 | if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { |
942 | regs->d0 = -EINTR; | 957 | regs->d0 = -EINTR; |
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds index 8a4919e4d36a..d9368c0709ba 100644 --- a/arch/m68k/kernel/vmlinux-sun3.lds +++ b/arch/m68k/kernel/vmlinux-sun3.lds | |||
@@ -33,6 +33,7 @@ SECTIONS | |||
33 | } :data | 33 | } :data |
34 | /* End of data goes *here* so that freeing init code works properly. */ | 34 | /* End of data goes *here* so that freeing init code works properly. */ |
35 | _edata = .; | 35 | _edata = .; |
36 | NOTES | ||
36 | 37 | ||
37 | /* will be freed after init */ | 38 | /* will be freed after init */ |
38 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | 39 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index 245d16d078ad..2a96bebd8969 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c | |||
@@ -92,7 +92,8 @@ static irqreturn_t baboon_irq(int irq, void *dev_id) | |||
92 | void __init baboon_register_interrupts(void) | 92 | void __init baboon_register_interrupts(void) |
93 | { | 93 | { |
94 | baboon_disabled = 0; | 94 | baboon_disabled = 0; |
95 | request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon); | 95 | if (request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon)) |
96 | pr_err("Couldn't register baboon interrupt\n"); | ||
96 | } | 97 | } |
97 | 98 | ||
98 | /* | 99 | /* |
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 8819b97be324..98b6bcfb37bf 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -47,13 +47,6 @@ | |||
47 | 47 | ||
48 | struct mac_booter_data mac_bi_data; | 48 | struct mac_booter_data mac_bi_data; |
49 | 49 | ||
50 | /* New m68k bootinfo stuff and videobase */ | ||
51 | |||
52 | extern int m68k_num_memory; | ||
53 | extern struct mem_info m68k_memory[NUM_MEMINFO]; | ||
54 | |||
55 | extern struct mem_info m68k_ramdisk; | ||
56 | |||
57 | /* The phys. video addr. - might be bogus on some machines */ | 50 | /* The phys. video addr. - might be bogus on some machines */ |
58 | static unsigned long mac_orig_videoaddr; | 51 | static unsigned long mac_orig_videoaddr; |
59 | 52 | ||
@@ -61,7 +54,6 @@ static unsigned long mac_orig_videoaddr; | |||
61 | extern unsigned long mac_gettimeoffset(void); | 54 | extern unsigned long mac_gettimeoffset(void); |
62 | extern int mac_hwclk(int, struct rtc_time *); | 55 | extern int mac_hwclk(int, struct rtc_time *); |
63 | extern int mac_set_clock_mmss(unsigned long); | 56 | extern int mac_set_clock_mmss(unsigned long); |
64 | extern int show_mac_interrupts(struct seq_file *, void *); | ||
65 | extern void iop_preinit(void); | 57 | extern void iop_preinit(void); |
66 | extern void iop_init(void); | 58 | extern void iop_init(void); |
67 | extern void via_init(void); | 59 | extern void via_init(void); |
@@ -805,10 +797,6 @@ static void __init mac_identify(void) | |||
805 | mac_bi_data.boottime, mac_bi_data.gmtbias); | 797 | mac_bi_data.boottime, mac_bi_data.gmtbias); |
806 | printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", | 798 | printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", |
807 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); | 799 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); |
808 | #if 0 | ||
809 | printk("Ramdisk: addr 0x%lx size 0x%lx\n", | ||
810 | m68k_ramdisk.addr, m68k_ramdisk.size); | ||
811 | #endif | ||
812 | 800 | ||
813 | iop_init(); | 801 | iop_init(); |
814 | via_init(); | 802 | via_init(); |
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c index 65dd77a742a3..bce074ceb768 100644 --- a/arch/m68k/mac/debug.c +++ b/arch/m68k/mac/debug.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <asm/macints.h> | 27 | #include <asm/macints.h> |
28 | 28 | ||
29 | extern unsigned long mac_videobase; | 29 | extern unsigned long mac_videobase; |
30 | extern unsigned long mac_videodepth; | ||
31 | extern unsigned long mac_rowbytes; | 30 | extern unsigned long mac_rowbytes; |
32 | 31 | ||
33 | extern void mac_serial_print(const char *); | 32 | extern void mac_serial_print(const char *); |
diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 326fb9978094..1ad4e9d80eba 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c | |||
@@ -305,14 +305,16 @@ void __init iop_register_interrupts(void) | |||
305 | { | 305 | { |
306 | if (iop_ism_present) { | 306 | if (iop_ism_present) { |
307 | if (oss_present) { | 307 | if (oss_present) { |
308 | request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, | 308 | if (request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, |
309 | IRQ_FLG_LOCK, "ISM IOP", | 309 | IRQ_FLG_LOCK, "ISM IOP", |
310 | (void *) IOP_NUM_ISM); | 310 | (void *) IOP_NUM_ISM)) |
311 | pr_err("Couldn't register ISM IOP interrupt\n"); | ||
311 | oss_irq_enable(IRQ_MAC_ADB); | 312 | oss_irq_enable(IRQ_MAC_ADB); |
312 | } else { | 313 | } else { |
313 | request_irq(IRQ_VIA2_0, iop_ism_irq, | 314 | if (request_irq(IRQ_VIA2_0, iop_ism_irq, |
314 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "ISM IOP", | 315 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "ISM IOP", |
315 | (void *) IOP_NUM_ISM); | 316 | (void *) IOP_NUM_ISM)) |
317 | pr_err("Couldn't register ISM IOP interrupt\n"); | ||
316 | } | 318 | } |
317 | if (!iop_alive(iop_base[IOP_NUM_ISM])) { | 319 | if (!iop_alive(iop_base[IOP_NUM_ISM])) { |
318 | printk("IOP: oh my god, they killed the ISM IOP!\n"); | 320 | printk("IOP: oh my god, they killed the ISM IOP!\n"); |
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 82e560c076ce..23711074e0e2 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c | |||
@@ -134,6 +134,7 @@ | |||
134 | #include <asm/errno.h> | 134 | #include <asm/errno.h> |
135 | #include <asm/macints.h> | 135 | #include <asm/macints.h> |
136 | #include <asm/irq_regs.h> | 136 | #include <asm/irq_regs.h> |
137 | #include <asm/mac_oss.h> | ||
137 | 138 | ||
138 | #define DEBUG_SPURIOUS | 139 | #define DEBUG_SPURIOUS |
139 | #define SHUTUP_SONIC | 140 | #define SHUTUP_SONIC |
@@ -146,7 +147,6 @@ static int scc_mask; | |||
146 | * VIA/RBV hooks | 147 | * VIA/RBV hooks |
147 | */ | 148 | */ |
148 | 149 | ||
149 | extern void via_init(void); | ||
150 | extern void via_register_interrupts(void); | 150 | extern void via_register_interrupts(void); |
151 | extern void via_irq_enable(int); | 151 | extern void via_irq_enable(int); |
152 | extern void via_irq_disable(int); | 152 | extern void via_irq_disable(int); |
@@ -157,9 +157,6 @@ extern int via_irq_pending(int); | |||
157 | * OSS hooks | 157 | * OSS hooks |
158 | */ | 158 | */ |
159 | 159 | ||
160 | extern int oss_present; | ||
161 | |||
162 | extern void oss_init(void); | ||
163 | extern void oss_register_interrupts(void); | 160 | extern void oss_register_interrupts(void); |
164 | extern void oss_irq_enable(int); | 161 | extern void oss_irq_enable(int); |
165 | extern void oss_irq_disable(int); | 162 | extern void oss_irq_disable(int); |
@@ -170,9 +167,6 @@ extern int oss_irq_pending(int); | |||
170 | * PSC hooks | 167 | * PSC hooks |
171 | */ | 168 | */ |
172 | 169 | ||
173 | extern int psc_present; | ||
174 | |||
175 | extern void psc_init(void); | ||
176 | extern void psc_register_interrupts(void); | 170 | extern void psc_register_interrupts(void); |
177 | extern void psc_irq_enable(int); | 171 | extern void psc_irq_enable(int); |
178 | extern void psc_irq_disable(int); | 172 | extern void psc_irq_disable(int); |
@@ -191,12 +185,10 @@ extern void iop_register_interrupts(void); | |||
191 | 185 | ||
192 | extern int baboon_present; | 186 | extern int baboon_present; |
193 | 187 | ||
194 | extern void baboon_init(void); | ||
195 | extern void baboon_register_interrupts(void); | 188 | extern void baboon_register_interrupts(void); |
196 | extern void baboon_irq_enable(int); | 189 | extern void baboon_irq_enable(int); |
197 | extern void baboon_irq_disable(int); | 190 | extern void baboon_irq_disable(int); |
198 | extern void baboon_irq_clear(int); | 191 | extern void baboon_irq_clear(int); |
199 | extern int baboon_irq_pending(int); | ||
200 | 192 | ||
201 | /* | 193 | /* |
202 | * SCC interrupt routines | 194 | * SCC interrupt routines |
@@ -258,8 +250,9 @@ void __init mac_init_IRQ(void) | |||
258 | if (baboon_present) | 250 | if (baboon_present) |
259 | baboon_register_interrupts(); | 251 | baboon_register_interrupts(); |
260 | iop_register_interrupts(); | 252 | iop_register_interrupts(); |
261 | request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI", | 253 | if (request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI", |
262 | mac_nmi_handler); | 254 | mac_nmi_handler)) |
255 | pr_err("Couldn't register NMI\n"); | ||
263 | #ifdef DEBUG_MACINTS | 256 | #ifdef DEBUG_MACINTS |
264 | printk("mac_init_IRQ(): Done!\n"); | 257 | printk("mac_init_IRQ(): Done!\n"); |
265 | #endif | 258 | #endif |
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index a44c7086ab39..5d818568b343 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c | |||
@@ -35,7 +35,6 @@ | |||
35 | 35 | ||
36 | #define RTC_OFFSET 2082844800 | 36 | #define RTC_OFFSET 2082844800 |
37 | 37 | ||
38 | extern struct mac_booter_data mac_bi_data; | ||
39 | static void (*rom_reset)(void); | 38 | static void (*rom_reset)(void); |
40 | 39 | ||
41 | #ifdef CONFIG_ADB_CUDA | 40 | #ifdef CONFIG_ADB_CUDA |
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 8426501119ca..f3d23d6ebcf8 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c | |||
@@ -66,16 +66,21 @@ void __init oss_init(void) | |||
66 | 66 | ||
67 | void __init oss_register_interrupts(void) | 67 | void __init oss_register_interrupts(void) |
68 | { | 68 | { |
69 | request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, | 69 | if (request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, |
70 | "scsi", (void *) oss); | 70 | "scsi", (void *) oss)) |
71 | request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, | 71 | pr_err("Couldn't register %s interrupt\n", "scsi"); |
72 | "scc", mac_scc_dispatch); | 72 | if (request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, |
73 | request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, | 73 | "scc", mac_scc_dispatch)) |
74 | "nubus", (void *) oss); | 74 | pr_err("Couldn't register %s interrupt\n", "scc"); |
75 | request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK, | 75 | if (request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, |
76 | "sound", (void *) oss); | 76 | "nubus", (void *) oss)) |
77 | request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK, | 77 | pr_err("Couldn't register %s interrupt\n", "nubus"); |
78 | "via1", (void *) via1); | 78 | if (request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK, |
79 | "sound", (void *) oss)) | ||
80 | pr_err("Couldn't register %s interrupt\n", "sound"); | ||
81 | if (request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK, | ||
82 | "via1", (void *) via1)) | ||
83 | pr_err("Couldn't register %s interrupt\n", "via1"); | ||
79 | } | 84 | } |
80 | 85 | ||
81 | /* | 86 | /* |
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index f84a4dd64f94..ba6ccab64018 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c | |||
@@ -117,10 +117,14 @@ void __init psc_init(void) | |||
117 | 117 | ||
118 | void __init psc_register_interrupts(void) | 118 | void __init psc_register_interrupts(void) |
119 | { | 119 | { |
120 | request_irq(IRQ_AUTO_3, psc_irq, 0, "psc3", (void *) 0x30); | 120 | if (request_irq(IRQ_AUTO_3, psc_irq, 0, "psc3", (void *) 0x30)) |
121 | request_irq(IRQ_AUTO_4, psc_irq, 0, "psc4", (void *) 0x40); | 121 | pr_err("Couldn't register psc%d interrupt\n", 3); |
122 | request_irq(IRQ_AUTO_5, psc_irq, 0, "psc5", (void *) 0x50); | 122 | if (request_irq(IRQ_AUTO_4, psc_irq, 0, "psc4", (void *) 0x40)) |
123 | request_irq(IRQ_AUTO_6, psc_irq, 0, "psc6", (void *) 0x60); | 123 | pr_err("Couldn't register psc%d interrupt\n", 4); |
124 | if (request_irq(IRQ_AUTO_5, psc_irq, 0, "psc5", (void *) 0x50)) | ||
125 | pr_err("Couldn't register psc%d interrupt\n", 5); | ||
126 | if (request_irq(IRQ_AUTO_6, psc_irq, 0, "psc6", (void *) 0x60)) | ||
127 | pr_err("Couldn't register psc%d interrupt\n", 6); | ||
124 | } | 128 | } |
125 | 129 | ||
126 | /* | 130 | /* |
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index f01d418e64fe..7d97ba54536e 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/macints.h> | 34 | #include <asm/macints.h> |
35 | #include <asm/mac_via.h> | 35 | #include <asm/mac_via.h> |
36 | #include <asm/mac_psc.h> | 36 | #include <asm/mac_psc.h> |
37 | #include <asm/mac_oss.h> | ||
37 | 38 | ||
38 | volatile __u8 *via1, *via2; | 39 | volatile __u8 *via1, *via2; |
39 | int rbv_present; | 40 | int rbv_present; |
@@ -84,7 +85,6 @@ void via_irq_disable(int irq); | |||
84 | void via_irq_clear(int irq); | 85 | void via_irq_clear(int irq); |
85 | 86 | ||
86 | extern irqreturn_t mac_scc_dispatch(int, void *); | 87 | extern irqreturn_t mac_scc_dispatch(int, void *); |
87 | extern int oss_present; | ||
88 | 88 | ||
89 | /* | 89 | /* |
90 | * Initialize the VIAs | 90 | * Initialize the VIAs |
@@ -283,7 +283,8 @@ void __init via_init_clock(irq_handler_t func) | |||
283 | via1[vT1CL] = MAC_CLOCK_LOW; | 283 | via1[vT1CL] = MAC_CLOCK_LOW; |
284 | via1[vT1CH] = MAC_CLOCK_HIGH; | 284 | via1[vT1CH] = MAC_CLOCK_HIGH; |
285 | 285 | ||
286 | request_irq(IRQ_MAC_TIMER_1, func, IRQ_FLG_LOCK, "timer", func); | 286 | if (request_irq(IRQ_MAC_TIMER_1, func, IRQ_FLG_LOCK, "timer", func)) |
287 | pr_err("Couldn't register %s interrupt\n", "timer"); | ||
287 | } | 288 | } |
288 | 289 | ||
289 | /* | 290 | /* |
@@ -293,25 +294,31 @@ void __init via_init_clock(irq_handler_t func) | |||
293 | void __init via_register_interrupts(void) | 294 | void __init via_register_interrupts(void) |
294 | { | 295 | { |
295 | if (via_alt_mapping) { | 296 | if (via_alt_mapping) { |
296 | request_irq(IRQ_AUTO_1, via1_irq, | 297 | if (request_irq(IRQ_AUTO_1, via1_irq, |
297 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "software", | 298 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "software", |
298 | (void *) via1); | 299 | (void *) via1)) |
299 | request_irq(IRQ_AUTO_6, via1_irq, | 300 | pr_err("Couldn't register %s interrupt\n", "software"); |
301 | if (request_irq(IRQ_AUTO_6, via1_irq, | ||
300 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", | 302 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", |
301 | (void *) via1); | 303 | (void *) via1)) |
304 | pr_err("Couldn't register %s interrupt\n", "via1"); | ||
302 | } else { | 305 | } else { |
303 | request_irq(IRQ_AUTO_1, via1_irq, | 306 | if (request_irq(IRQ_AUTO_1, via1_irq, |
304 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", | 307 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", |
305 | (void *) via1); | 308 | (void *) via1)) |
309 | pr_err("Couldn't register %s interrupt\n", "via1"); | ||
306 | } | 310 | } |
307 | request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | 311 | if (request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, |
308 | "via2", (void *) via2); | 312 | "via2", (void *) via2)) |
313 | pr_err("Couldn't register %s interrupt\n", "via2"); | ||
309 | if (!psc_present) { | 314 | if (!psc_present) { |
310 | request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, | 315 | if (request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, |
311 | "scc", mac_scc_dispatch); | 316 | "scc", mac_scc_dispatch)) |
317 | pr_err("Couldn't register %s interrupt\n", "scc"); | ||
312 | } | 318 | } |
313 | request_irq(IRQ_MAC_NUBUS, via_nubus_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | 319 | if (request_irq(IRQ_MAC_NUBUS, via_nubus_irq, |
314 | "nubus", (void *) via2); | 320 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "nubus", (void *) via2)) |
321 | pr_err("Couldn't register %s interrupt\n", "nubus"); | ||
315 | } | 322 | } |
316 | 323 | ||
317 | /* | 324 | /* |
diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index b1033ae0d6f0..367ecee2f981 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c | |||
@@ -24,7 +24,6 @@ static const struct fp_ext fp_one = | |||
24 | 24 | ||
25 | extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src); | 25 | extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src); |
26 | extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src); | 26 | extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src); |
27 | extern struct fp_ext *fp_fmul(struct fp_ext *dest, const struct fp_ext *src); | ||
28 | 27 | ||
29 | struct fp_ext * | 28 | struct fp_ext * |
30 | fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) | 29 | fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) |
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c index 81bb08ceec18..0007b2adf3a3 100644 --- a/arch/m68k/mm/init.c +++ b/arch/m68k/mm/init.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #ifdef CONFIG_ATARI | 28 | #ifdef CONFIG_ATARI |
29 | #include <asm/atari_stram.h> | 29 | #include <asm/atari_stram.h> |
30 | #endif | 30 | #endif |
31 | #include <asm/sections.h> | ||
31 | #include <asm/tlb.h> | 32 | #include <asm/tlb.h> |
32 | 33 | ||
33 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | 34 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); |
@@ -73,9 +74,6 @@ extern void init_pointer_table(unsigned long ptable); | |||
73 | 74 | ||
74 | /* References to section boundaries */ | 75 | /* References to section boundaries */ |
75 | 76 | ||
76 | extern char _text[], _etext[]; | ||
77 | extern char __init_begin[], __init_end[]; | ||
78 | |||
79 | extern pmd_t *zero_pgtable; | 77 | extern pmd_t *zero_pgtable; |
80 | 78 | ||
81 | void __init mem_init(void) | 79 | void __init mem_init(void) |
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c index c5dbb9bdb322..4665fc84b7dc 100644 --- a/arch/m68k/mm/motorola.c +++ b/arch/m68k/mm/motorola.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #ifdef CONFIG_ATARI | 30 | #ifdef CONFIG_ATARI |
31 | #include <asm/atari_stram.h> | 31 | #include <asm/atari_stram.h> |
32 | #endif | 32 | #endif |
33 | #include <asm/sections.h> | ||
33 | 34 | ||
34 | #undef DEBUG | 35 | #undef DEBUG |
35 | 36 | ||
@@ -301,14 +302,12 @@ void __init paging_init(void) | |||
301 | } | 302 | } |
302 | } | 303 | } |
303 | 304 | ||
304 | extern char __init_begin, __init_end; | ||
305 | |||
306 | void free_initmem(void) | 305 | void free_initmem(void) |
307 | { | 306 | { |
308 | unsigned long addr; | 307 | unsigned long addr; |
309 | 308 | ||
310 | addr = (unsigned long)&__init_begin; | 309 | addr = (unsigned long)__init_begin; |
311 | for (; addr < (unsigned long)&__init_end; addr += PAGE_SIZE) { | 310 | for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) { |
312 | virt_to_page(addr)->flags &= ~(1 << PG_reserved); | 311 | virt_to_page(addr)->flags &= ~(1 << PG_reserved); |
313 | init_page_count(virt_to_page(addr)); | 312 | init_page_count(virt_to_page(addr)); |
314 | free_page(addr); | 313 | free_page(addr); |
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index 43cdf476ffab..100baaa692a1 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c | |||
@@ -42,7 +42,6 @@ extern unsigned long mvme147_gettimeoffset (void); | |||
42 | extern int mvme147_hwclk (int, struct rtc_time *); | 42 | extern int mvme147_hwclk (int, struct rtc_time *); |
43 | extern int mvme147_set_clock_mmss (unsigned long); | 43 | extern int mvme147_set_clock_mmss (unsigned long); |
44 | extern void mvme147_reset (void); | 44 | extern void mvme147_reset (void); |
45 | extern void mvme147_waitbut(void); | ||
46 | 45 | ||
47 | 46 | ||
48 | static int bcd2int (unsigned char b); | 47 | static int bcd2int (unsigned char b); |
@@ -115,8 +114,9 @@ static irqreturn_t mvme147_timer_int (int irq, void *dev_id) | |||
115 | void mvme147_sched_init (irq_handler_t timer_routine) | 114 | void mvme147_sched_init (irq_handler_t timer_routine) |
116 | { | 115 | { |
117 | tick_handler = timer_routine; | 116 | tick_handler = timer_routine; |
118 | request_irq (PCC_IRQ_TIMER1, mvme147_timer_int, | 117 | if (request_irq(PCC_IRQ_TIMER1, mvme147_timer_int, IRQ_FLG_REPLACE, |
119 | IRQ_FLG_REPLACE, "timer 1", NULL); | 118 | "timer 1", NULL)) |
119 | pr_err("Couldn't register timer interrupt\n"); | ||
120 | 120 | ||
121 | /* Init the clock with a value */ | 121 | /* Init the clock with a value */ |
122 | /* our clock goes off every 6.25us */ | 122 | /* our clock goes off every 6.25us */ |
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index 1521826fc3c7..11edf61cc2c4 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c | |||
@@ -48,7 +48,6 @@ extern unsigned long mvme16x_gettimeoffset (void); | |||
48 | extern int mvme16x_hwclk (int, struct rtc_time *); | 48 | extern int mvme16x_hwclk (int, struct rtc_time *); |
49 | extern int mvme16x_set_clock_mmss (unsigned long); | 49 | extern int mvme16x_set_clock_mmss (unsigned long); |
50 | extern void mvme16x_reset (void); | 50 | extern void mvme16x_reset (void); |
51 | extern void mvme16x_waitbut(void); | ||
52 | 51 | ||
53 | int bcd2int (unsigned char b); | 52 | int bcd2int (unsigned char b); |
54 | 53 | ||
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 7110546e3c00..31ab3f08bbda 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <asm/machdep.h> | 36 | #include <asm/machdep.h> |
37 | #include <asm/q40_master.h> | 37 | #include <asm/q40_master.h> |
38 | 38 | ||
39 | extern irqreturn_t q40_process_int(int level, struct pt_regs *regs); | ||
40 | extern void q40_init_IRQ(void); | 39 | extern void q40_init_IRQ(void); |
41 | static void q40_get_model(char *model); | 40 | static void q40_get_model(char *model); |
42 | extern void q40_sched_init(irq_handler_t handler); | 41 | extern void q40_sched_init(irq_handler_t handler); |
@@ -47,8 +46,6 @@ static unsigned int q40_get_ss(void); | |||
47 | static int q40_set_clock_mmss(unsigned long); | 46 | static int q40_set_clock_mmss(unsigned long); |
48 | static int q40_get_rtc_pll(struct rtc_pll_info *pll); | 47 | static int q40_get_rtc_pll(struct rtc_pll_info *pll); |
49 | static int q40_set_rtc_pll(struct rtc_pll_info *pll); | 48 | static int q40_set_rtc_pll(struct rtc_pll_info *pll); |
50 | extern void q40_waitbut(void); | ||
51 | void q40_set_vectors(void); | ||
52 | 49 | ||
53 | extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/); | 50 | extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/); |
54 | 51 | ||
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 8dfaa201342e..2ca25bd01a96 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c | |||
@@ -27,23 +27,21 @@ | |||
27 | #include <asm/sun3mmu.h> | 27 | #include <asm/sun3mmu.h> |
28 | #include <asm/rtc.h> | 28 | #include <asm/rtc.h> |
29 | #include <asm/machdep.h> | 29 | #include <asm/machdep.h> |
30 | #include <asm/idprom.h> | ||
30 | #include <asm/intersil.h> | 31 | #include <asm/intersil.h> |
31 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
33 | #include <asm/sections.h> | ||
32 | #include <asm/segment.h> | 34 | #include <asm/segment.h> |
33 | #include <asm/sun3ints.h> | 35 | #include <asm/sun3ints.h> |
34 | 36 | ||
35 | extern char _text, _end; | ||
36 | |||
37 | char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; | 37 | char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; |
38 | 38 | ||
39 | extern unsigned long sun3_gettimeoffset(void); | 39 | extern unsigned long sun3_gettimeoffset(void); |
40 | static void sun3_sched_init(irq_handler_t handler); | 40 | static void sun3_sched_init(irq_handler_t handler); |
41 | extern void sun3_get_model (char* model); | 41 | extern void sun3_get_model (char* model); |
42 | extern void idprom_init (void); | ||
43 | extern int sun3_hwclk(int set, struct rtc_time *t); | 42 | extern int sun3_hwclk(int set, struct rtc_time *t); |
44 | 43 | ||
45 | volatile char* clock_va; | 44 | volatile char* clock_va; |
46 | extern volatile unsigned char* sun3_intreg; | ||
47 | extern unsigned long availmem; | 45 | extern unsigned long availmem; |
48 | unsigned long num_pages; | 46 | unsigned long num_pages; |
49 | 47 | ||
@@ -149,7 +147,7 @@ void __init config_sun3(void) | |||
149 | mach_halt = sun3_halt; | 147 | mach_halt = sun3_halt; |
150 | mach_get_hardware_list = sun3_get_hardware_list; | 148 | mach_get_hardware_list = sun3_get_hardware_list; |
151 | 149 | ||
152 | memory_start = ((((int)&_end) + 0x2000) & ~0x1fff); | 150 | memory_start = ((((unsigned long)_end) + 0x2000) & ~0x1fff); |
153 | // PROM seems to want the last couple of physical pages. --m | 151 | // PROM seems to want the last couple of physical pages. --m |
154 | memory_end = *(romvec->pv_sun3mem) + PAGE_OFFSET - 2*PAGE_SIZE; | 152 | memory_end = *(romvec->pv_sun3mem) + PAGE_OFFSET - 2*PAGE_SIZE; |
155 | 153 | ||
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c index 60f9d4500d72..3cd19390aae5 100644 --- a/arch/m68k/sun3/mmu_emu.c +++ b/arch/m68k/sun3/mmu_emu.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <asm/mmu_context.h> | 27 | #include <asm/mmu_context.h> |
28 | #include <asm/dvma.h> | 28 | #include <asm/dvma.h> |
29 | 29 | ||
30 | extern void prom_reboot (char *) __attribute__ ((__noreturn__)); | ||
31 | 30 | ||
32 | #undef DEBUG_MMU_EMU | 31 | #undef DEBUG_MMU_EMU |
33 | #define DEBUG_PROM_MAPS | 32 | #define DEBUG_PROM_MAPS |
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index 7364cd67455e..ad90393a3361 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c | |||
@@ -105,7 +105,10 @@ void __init sun3_init_IRQ(void) | |||
105 | m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7); | 105 | m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7); |
106 | m68k_setup_user_interrupt(VEC_USER, 128, NULL); | 106 | m68k_setup_user_interrupt(VEC_USER, 128, NULL); |
107 | 107 | ||
108 | request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL); | 108 | if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL)) |
109 | request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL); | 109 | pr_err("Couldn't register %s interrupt\n", "int5"); |
110 | request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL); | 110 | if (request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL)) |
111 | pr_err("Couldn't register %s interrupt\n", "int7"); | ||
112 | if (request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL)) | ||
113 | pr_err("Couldn't register %s interrupt\n", "vec255"); | ||
111 | } | 114 | } |
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index 2b1ca2db070f..fc599fad4a54 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include "time.h" | 23 | #include "time.h" |
24 | 24 | ||
25 | volatile char *clock_va; | 25 | volatile char *clock_va; |
26 | extern volatile unsigned char *sun3_intreg; | ||
27 | 26 | ||
28 | extern void sun3_get_model(char *model); | 27 | extern void sun3_get_model(char *model); |
29 | 28 | ||
diff --git a/arch/m68knommu/include/asm/Kbuild b/arch/m68knommu/include/asm/Kbuild index 58c02a454130..c68e1680da01 100644 --- a/arch/m68knommu/include/asm/Kbuild +++ b/arch/m68knommu/include/asm/Kbuild | |||
@@ -1,3 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | |||
3 | unifdef-y += swab.h | ||
diff --git a/arch/m68knommu/include/asm/byteorder.h b/arch/m68knommu/include/asm/byteorder.h index a6f0b8f7f622..9c6c76a15041 100644 --- a/arch/m68knommu/include/asm/byteorder.h +++ b/arch/m68knommu/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _M68KNOMMU_BYTEORDER_H | 1 | #ifndef _M68KNOMMU_BYTEORDER_H |
2 | #define _M68KNOMMU_BYTEORDER_H | 2 | #define _M68KNOMMU_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _M68KNOMMU_BYTEORDER_H */ | 6 | #endif /* _M68KNOMMU_BYTEORDER_H */ |
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S index 812f8d8b7a85..5c3e3f62194a 100644 --- a/arch/m68knommu/kernel/syscalltable.S +++ b/arch/m68knommu/kernel/syscalltable.S | |||
@@ -107,7 +107,7 @@ ENTRY(sys_call_table) | |||
107 | .long sys_uselib | 107 | .long sys_uselib |
108 | .long sys_ni_syscall /* sys_swapon */ | 108 | .long sys_ni_syscall /* sys_swapon */ |
109 | .long sys_reboot | 109 | .long sys_reboot |
110 | .long old_readdir | 110 | .long sys_old_readdir |
111 | .long old_mmap /* 90 */ | 111 | .long old_mmap /* 90 */ |
112 | .long sys_munmap | 112 | .long sys_munmap |
113 | .long sys_truncate | 113 | .long sys_truncate |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index a5255e7c79e0..52c80c2a57f2 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -595,6 +595,44 @@ config WR_PPMC | |||
595 | This enables support for the Wind River MIPS32 4KC PPMC evaluation | 595 | This enables support for the Wind River MIPS32 4KC PPMC evaluation |
596 | board, which is based on GT64120 bridge chip. | 596 | board, which is based on GT64120 bridge chip. |
597 | 597 | ||
598 | config CAVIUM_OCTEON_SIMULATOR | ||
599 | bool "Support for the Cavium Networks Octeon Simulator" | ||
600 | select CEVT_R4K | ||
601 | select 64BIT_PHYS_ADDR | ||
602 | select DMA_COHERENT | ||
603 | select SYS_SUPPORTS_64BIT_KERNEL | ||
604 | select SYS_SUPPORTS_BIG_ENDIAN | ||
605 | select SYS_SUPPORTS_HIGHMEM | ||
606 | select CPU_CAVIUM_OCTEON | ||
607 | help | ||
608 | The Octeon simulator is software performance model of the Cavium | ||
609 | Octeon Processor. It supports simulating Octeon processors on x86 | ||
610 | hardware. | ||
611 | |||
612 | config CAVIUM_OCTEON_REFERENCE_BOARD | ||
613 | bool "Support for the Cavium Networks Octeon reference board" | ||
614 | select CEVT_R4K | ||
615 | select 64BIT_PHYS_ADDR | ||
616 | select DMA_COHERENT | ||
617 | select SYS_SUPPORTS_64BIT_KERNEL | ||
618 | select SYS_SUPPORTS_BIG_ENDIAN | ||
619 | select SYS_SUPPORTS_HIGHMEM | ||
620 | select SYS_HAS_EARLY_PRINTK | ||
621 | select CPU_CAVIUM_OCTEON | ||
622 | select SWAP_IO_SPACE | ||
623 | help | ||
624 | This option supports all of the Octeon reference boards from Cavium | ||
625 | Networks. It builds a kernel that dynamically determines the Octeon | ||
626 | CPU type and supports all known board reference implementations. | ||
627 | Some of the supported boards are: | ||
628 | EBT3000 | ||
629 | EBH3000 | ||
630 | EBH3100 | ||
631 | Thunder | ||
632 | Kodama | ||
633 | Hikari | ||
634 | Say Y here for most Octeon reference boards. | ||
635 | |||
598 | endchoice | 636 | endchoice |
599 | 637 | ||
600 | source "arch/mips/alchemy/Kconfig" | 638 | source "arch/mips/alchemy/Kconfig" |
@@ -607,6 +645,7 @@ source "arch/mips/sgi-ip27/Kconfig" | |||
607 | source "arch/mips/sibyte/Kconfig" | 645 | source "arch/mips/sibyte/Kconfig" |
608 | source "arch/mips/txx9/Kconfig" | 646 | source "arch/mips/txx9/Kconfig" |
609 | source "arch/mips/vr41xx/Kconfig" | 647 | source "arch/mips/vr41xx/Kconfig" |
648 | source "arch/mips/cavium-octeon/Kconfig" | ||
610 | 649 | ||
611 | endmenu | 650 | endmenu |
612 | 651 | ||
@@ -682,7 +721,11 @@ config CEVT_DS1287 | |||
682 | config CEVT_GT641XX | 721 | config CEVT_GT641XX |
683 | bool | 722 | bool |
684 | 723 | ||
724 | config CEVT_R4K_LIB | ||
725 | bool | ||
726 | |||
685 | config CEVT_R4K | 727 | config CEVT_R4K |
728 | select CEVT_R4K_LIB | ||
686 | bool | 729 | bool |
687 | 730 | ||
688 | config CEVT_SB1250 | 731 | config CEVT_SB1250 |
@@ -697,7 +740,11 @@ config CSRC_BCM1480 | |||
697 | config CSRC_IOASIC | 740 | config CSRC_IOASIC |
698 | bool | 741 | bool |
699 | 742 | ||
743 | config CSRC_R4K_LIB | ||
744 | bool | ||
745 | |||
700 | config CSRC_R4K | 746 | config CSRC_R4K |
747 | select CSRC_R4K_LIB | ||
701 | bool | 748 | bool |
702 | 749 | ||
703 | config CSRC_SB1250 | 750 | config CSRC_SB1250 |
@@ -835,6 +882,9 @@ config IRQ_GT641XX | |||
835 | config IRQ_GIC | 882 | config IRQ_GIC |
836 | bool | 883 | bool |
837 | 884 | ||
885 | config IRQ_CPU_OCTEON | ||
886 | bool | ||
887 | |||
838 | config MIPS_BOARDS_GEN | 888 | config MIPS_BOARDS_GEN |
839 | bool | 889 | bool |
840 | 890 | ||
@@ -924,7 +974,7 @@ config BOOT_ELF32 | |||
924 | config MIPS_L1_CACHE_SHIFT | 974 | config MIPS_L1_CACHE_SHIFT |
925 | int | 975 | int |
926 | default "4" if MACH_DECSTATION || MIKROTIK_RB532 | 976 | default "4" if MACH_DECSTATION || MIKROTIK_RB532 |
927 | default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM | 977 | default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM || CPU_CAVIUM_OCTEON |
928 | default "4" if PMC_MSP4200_EVAL | 978 | default "4" if PMC_MSP4200_EVAL |
929 | default "5" | 979 | default "5" |
930 | 980 | ||
@@ -1185,6 +1235,23 @@ config CPU_SB1 | |||
1185 | select CPU_SUPPORTS_HIGHMEM | 1235 | select CPU_SUPPORTS_HIGHMEM |
1186 | select WEAK_ORDERING | 1236 | select WEAK_ORDERING |
1187 | 1237 | ||
1238 | config CPU_CAVIUM_OCTEON | ||
1239 | bool "Cavium Octeon processor" | ||
1240 | select IRQ_CPU | ||
1241 | select IRQ_CPU_OCTEON | ||
1242 | select CPU_HAS_PREFETCH | ||
1243 | select CPU_SUPPORTS_64BIT_KERNEL | ||
1244 | select SYS_SUPPORTS_SMP | ||
1245 | select NR_CPUS_DEFAULT_16 | ||
1246 | select WEAK_ORDERING | ||
1247 | select WEAK_REORDERING_BEYOND_LLSC | ||
1248 | select CPU_SUPPORTS_HIGHMEM | ||
1249 | help | ||
1250 | The Cavium Octeon processor is a highly integrated chip containing | ||
1251 | many ethernet hardware widgets for networking tasks. The processor | ||
1252 | can have up to 16 Mips64v2 cores and 8 integrated gigabit ethernets. | ||
1253 | Full details can be found at http://www.caviumnetworks.com. | ||
1254 | |||
1188 | endchoice | 1255 | endchoice |
1189 | 1256 | ||
1190 | config SYS_HAS_CPU_LOONGSON2 | 1257 | config SYS_HAS_CPU_LOONGSON2 |
@@ -1285,7 +1352,7 @@ config CPU_MIPSR1 | |||
1285 | 1352 | ||
1286 | config CPU_MIPSR2 | 1353 | config CPU_MIPSR2 |
1287 | bool | 1354 | bool |
1288 | default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 | 1355 | default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_CAVIUM_OCTEON |
1289 | 1356 | ||
1290 | config SYS_SUPPORTS_32BIT_KERNEL | 1357 | config SYS_SUPPORTS_32BIT_KERNEL |
1291 | bool | 1358 | bool |
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 28c55f608913..21b00e95daef 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -144,6 +144,10 @@ cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-march=sb1,-march=r5000) \ | |||
144 | cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap | 144 | cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap |
145 | cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) \ | 145 | cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) \ |
146 | -Wa,--trap | 146 | -Wa,--trap |
147 | cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += $(call cc-option,-march=octeon) -Wa,--trap | ||
148 | ifeq (,$(findstring march=octeon, $(cflags-$(CONFIG_CPU_CAVIUM_OCTEON)))) | ||
149 | cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += -Wa,-march=octeon | ||
150 | endif | ||
147 | 151 | ||
148 | cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,) | 152 | cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,) |
149 | cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,) | 153 | cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,) |
@@ -184,84 +188,84 @@ cflags-$(CONFIG_SOC_AU1X00) += -I$(srctree)/arch/mips/include/asm/mach-au1x00 | |||
184 | # | 188 | # |
185 | # AMD Alchemy Pb1000 eval board | 189 | # AMD Alchemy Pb1000 eval board |
186 | # | 190 | # |
187 | libs-$(CONFIG_MIPS_PB1000) += arch/mips/alchemy/pb1000/ | 191 | core-$(CONFIG_MIPS_PB1000) += arch/mips/alchemy/devboards/ |
188 | cflags-$(CONFIG_MIPS_PB1000) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 | 192 | cflags-$(CONFIG_MIPS_PB1000) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 |
189 | load-$(CONFIG_MIPS_PB1000) += 0xffffffff80100000 | 193 | load-$(CONFIG_MIPS_PB1000) += 0xffffffff80100000 |
190 | 194 | ||
191 | # | 195 | # |
192 | # AMD Alchemy Pb1100 eval board | 196 | # AMD Alchemy Pb1100 eval board |
193 | # | 197 | # |
194 | libs-$(CONFIG_MIPS_PB1100) += arch/mips/alchemy/pb1100/ | 198 | core-$(CONFIG_MIPS_PB1100) += arch/mips/alchemy/devboards/ |
195 | cflags-$(CONFIG_MIPS_PB1100) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 | 199 | cflags-$(CONFIG_MIPS_PB1100) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 |
196 | load-$(CONFIG_MIPS_PB1100) += 0xffffffff80100000 | 200 | load-$(CONFIG_MIPS_PB1100) += 0xffffffff80100000 |
197 | 201 | ||
198 | # | 202 | # |
199 | # AMD Alchemy Pb1500 eval board | 203 | # AMD Alchemy Pb1500 eval board |
200 | # | 204 | # |
201 | libs-$(CONFIG_MIPS_PB1500) += arch/mips/alchemy/pb1500/ | 205 | core-$(CONFIG_MIPS_PB1500) += arch/mips/alchemy/devboards/ |
202 | cflags-$(CONFIG_MIPS_PB1500) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 | 206 | cflags-$(CONFIG_MIPS_PB1500) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 |
203 | load-$(CONFIG_MIPS_PB1500) += 0xffffffff80100000 | 207 | load-$(CONFIG_MIPS_PB1500) += 0xffffffff80100000 |
204 | 208 | ||
205 | # | 209 | # |
206 | # AMD Alchemy Pb1550 eval board | 210 | # AMD Alchemy Pb1550 eval board |
207 | # | 211 | # |
208 | libs-$(CONFIG_MIPS_PB1550) += arch/mips/alchemy/pb1550/ | 212 | core-$(CONFIG_MIPS_PB1550) += arch/mips/alchemy/devboards/ |
209 | cflags-$(CONFIG_MIPS_PB1550) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 | 213 | cflags-$(CONFIG_MIPS_PB1550) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 |
210 | load-$(CONFIG_MIPS_PB1550) += 0xffffffff80100000 | 214 | load-$(CONFIG_MIPS_PB1550) += 0xffffffff80100000 |
211 | 215 | ||
212 | # | 216 | # |
213 | # AMD Alchemy Pb1200 eval board | 217 | # AMD Alchemy Pb1200 eval board |
214 | # | 218 | # |
215 | libs-$(CONFIG_MIPS_PB1200) += arch/mips/alchemy/pb1200/ | 219 | core-$(CONFIG_MIPS_PB1200) += arch/mips/alchemy/devboards/ |
216 | cflags-$(CONFIG_MIPS_PB1200) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 | 220 | cflags-$(CONFIG_MIPS_PB1200) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 |
217 | load-$(CONFIG_MIPS_PB1200) += 0xffffffff80100000 | 221 | load-$(CONFIG_MIPS_PB1200) += 0xffffffff80100000 |
218 | 222 | ||
219 | # | 223 | # |
220 | # AMD Alchemy Db1000 eval board | 224 | # AMD Alchemy Db1000 eval board |
221 | # | 225 | # |
222 | libs-$(CONFIG_MIPS_DB1000) += arch/mips/alchemy/db1x00/ | 226 | core-$(CONFIG_MIPS_DB1000) += arch/mips/alchemy/devboards/ |
223 | cflags-$(CONFIG_MIPS_DB1000) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 | 227 | cflags-$(CONFIG_MIPS_DB1000) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 |
224 | load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000 | 228 | load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000 |
225 | 229 | ||
226 | # | 230 | # |
227 | # AMD Alchemy Db1100 eval board | 231 | # AMD Alchemy Db1100 eval board |
228 | # | 232 | # |
229 | libs-$(CONFIG_MIPS_DB1100) += arch/mips/alchemy/db1x00/ | 233 | core-$(CONFIG_MIPS_DB1100) += arch/mips/alchemy/devboards/ |
230 | cflags-$(CONFIG_MIPS_DB1100) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 | 234 | cflags-$(CONFIG_MIPS_DB1100) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 |
231 | load-$(CONFIG_MIPS_DB1100) += 0xffffffff80100000 | 235 | load-$(CONFIG_MIPS_DB1100) += 0xffffffff80100000 |
232 | 236 | ||
233 | # | 237 | # |
234 | # AMD Alchemy Db1500 eval board | 238 | # AMD Alchemy Db1500 eval board |
235 | # | 239 | # |
236 | libs-$(CONFIG_MIPS_DB1500) += arch/mips/alchemy/db1x00/ | 240 | core-$(CONFIG_MIPS_DB1500) += arch/mips/alchemy/devboards/ |
237 | cflags-$(CONFIG_MIPS_DB1500) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 | 241 | cflags-$(CONFIG_MIPS_DB1500) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 |
238 | load-$(CONFIG_MIPS_DB1500) += 0xffffffff80100000 | 242 | load-$(CONFIG_MIPS_DB1500) += 0xffffffff80100000 |
239 | 243 | ||
240 | # | 244 | # |
241 | # AMD Alchemy Db1550 eval board | 245 | # AMD Alchemy Db1550 eval board |
242 | # | 246 | # |
243 | libs-$(CONFIG_MIPS_DB1550) += arch/mips/alchemy/db1x00/ | 247 | core-$(CONFIG_MIPS_DB1550) += arch/mips/alchemy/devboards/ |
244 | cflags-$(CONFIG_MIPS_DB1550) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 | 248 | cflags-$(CONFIG_MIPS_DB1550) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 |
245 | load-$(CONFIG_MIPS_DB1550) += 0xffffffff80100000 | 249 | load-$(CONFIG_MIPS_DB1550) += 0xffffffff80100000 |
246 | 250 | ||
247 | # | 251 | # |
248 | # AMD Alchemy Db1200 eval board | 252 | # AMD Alchemy Db1200 eval board |
249 | # | 253 | # |
250 | libs-$(CONFIG_MIPS_DB1200) += arch/mips/alchemy/pb1200/ | 254 | core-$(CONFIG_MIPS_DB1200) += arch/mips/alchemy/devboards/ |
251 | cflags-$(CONFIG_MIPS_DB1200) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 | 255 | cflags-$(CONFIG_MIPS_DB1200) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 |
252 | load-$(CONFIG_MIPS_DB1200) += 0xffffffff80100000 | 256 | load-$(CONFIG_MIPS_DB1200) += 0xffffffff80100000 |
253 | 257 | ||
254 | # | 258 | # |
255 | # AMD Alchemy Bosporus eval board | 259 | # AMD Alchemy Bosporus eval board |
256 | # | 260 | # |
257 | libs-$(CONFIG_MIPS_BOSPORUS) += arch/mips/alchemy/db1x00/ | 261 | core-$(CONFIG_MIPS_BOSPORUS) += arch/mips/alchemy/devboards/ |
258 | cflags-$(CONFIG_MIPS_BOSPORUS) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 | 262 | cflags-$(CONFIG_MIPS_BOSPORUS) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 |
259 | load-$(CONFIG_MIPS_BOSPORUS) += 0xffffffff80100000 | 263 | load-$(CONFIG_MIPS_BOSPORUS) += 0xffffffff80100000 |
260 | 264 | ||
261 | # | 265 | # |
262 | # AMD Alchemy Mirage eval board | 266 | # AMD Alchemy Mirage eval board |
263 | # | 267 | # |
264 | libs-$(CONFIG_MIPS_MIRAGE) += arch/mips/alchemy/db1x00/ | 268 | core-$(CONFIG_MIPS_MIRAGE) += arch/mips/alchemy/devboards/ |
265 | cflags-$(CONFIG_MIPS_MIRAGE) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 | 269 | cflags-$(CONFIG_MIPS_MIRAGE) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 |
266 | load-$(CONFIG_MIPS_MIRAGE) += 0xffffffff80100000 | 270 | load-$(CONFIG_MIPS_MIRAGE) += 0xffffffff80100000 |
267 | 271 | ||
@@ -586,6 +590,18 @@ core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/txx9/rbtx4927/ | |||
586 | core-$(CONFIG_TOSHIBA_RBTX4938) += arch/mips/txx9/rbtx4938/ | 590 | core-$(CONFIG_TOSHIBA_RBTX4938) += arch/mips/txx9/rbtx4938/ |
587 | core-$(CONFIG_TOSHIBA_RBTX4939) += arch/mips/txx9/rbtx4939/ | 591 | core-$(CONFIG_TOSHIBA_RBTX4939) += arch/mips/txx9/rbtx4939/ |
588 | 592 | ||
593 | # | ||
594 | # Cavium Octeon | ||
595 | # | ||
596 | core-$(CONFIG_CPU_CAVIUM_OCTEON) += arch/mips/cavium-octeon/ | ||
597 | cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += -I$(srctree)/arch/mips/include/asm/mach-cavium-octeon | ||
598 | core-$(CONFIG_CPU_CAVIUM_OCTEON) += arch/mips/cavium-octeon/executive/ | ||
599 | ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL | ||
600 | load-$(CONFIG_CPU_CAVIUM_OCTEON) += 0xffffffff84100000 | ||
601 | else | ||
602 | load-$(CONFIG_CPU_CAVIUM_OCTEON) += 0xffffffff81100000 | ||
603 | endif | ||
604 | |||
589 | cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic | 605 | cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic |
590 | drivers-$(CONFIG_PCI) += arch/mips/pci/ | 606 | drivers-$(CONFIG_PCI) += arch/mips/pci/ |
591 | 607 | ||
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig index e4a057d80ab6..7f8ef13d0014 100644 --- a/arch/mips/alchemy/Kconfig +++ b/arch/mips/alchemy/Kconfig | |||
@@ -128,9 +128,10 @@ config SOC_AU1200 | |||
128 | config SOC_AU1X00 | 128 | config SOC_AU1X00 |
129 | bool | 129 | bool |
130 | select 64BIT_PHYS_ADDR | 130 | select 64BIT_PHYS_ADDR |
131 | select CEVT_R4K | 131 | select CEVT_R4K_LIB |
132 | select CSRC_R4K | 132 | select CSRC_R4K_LIB |
133 | select IRQ_CPU | 133 | select IRQ_CPU |
134 | select SYS_HAS_CPU_MIPS32_R1 | 134 | select SYS_HAS_CPU_MIPS32_R1 |
135 | select SYS_SUPPORTS_32BIT_KERNEL | 135 | select SYS_SUPPORTS_32BIT_KERNEL |
136 | select SYS_SUPPORTS_APM_EMULATION | 136 | select SYS_SUPPORTS_APM_EMULATION |
137 | select GENERIC_HARDIRQS_NO__DO_IRQ | ||
diff --git a/arch/mips/alchemy/common/Makefile b/arch/mips/alchemy/common/Makefile index df48fd65bbf3..d50d4764eafe 100644 --- a/arch/mips/alchemy/common/Makefile +++ b/arch/mips/alchemy/common/Makefile | |||
@@ -6,8 +6,8 @@ | |||
6 | # | 6 | # |
7 | 7 | ||
8 | obj-y += prom.o irq.o puts.o time.o reset.o \ | 8 | obj-y += prom.o irq.o puts.o time.o reset.o \ |
9 | au1xxx_irqmap.o clocks.o platform.o power.o setup.o \ | 9 | clocks.o platform.o power.o setup.o \ |
10 | sleeper.o cputable.o dma.o dbdma.o gpio.o | 10 | sleeper.o dma.o dbdma.o gpio.o |
11 | 11 | ||
12 | obj-$(CONFIG_PCI) += pci.o | 12 | obj-$(CONFIG_PCI) += pci.o |
13 | 13 | ||
diff --git a/arch/mips/alchemy/common/au1xxx_irqmap.c b/arch/mips/alchemy/common/au1xxx_irqmap.c deleted file mode 100644 index c7ca1596394c..000000000000 --- a/arch/mips/alchemy/common/au1xxx_irqmap.c +++ /dev/null | |||
@@ -1,205 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Au1xxx processor specific IRQ tables | ||
4 | * | ||
5 | * Copyright 2004 Embedded Edge, LLC | ||
6 | * dan@embeddededge.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | #include <linux/init.h> | ||
29 | #include <linux/kernel.h> | ||
30 | |||
31 | #include <au1000.h> | ||
32 | |||
33 | /* The IC0 interrupt table. This is processor, rather than | ||
34 | * board dependent, so no reason to keep this info in the board | ||
35 | * dependent files. | ||
36 | * | ||
37 | * Careful if you change match 2 request! | ||
38 | * The interrupt handler is called directly from the low level dispatch code. | ||
39 | */ | ||
40 | struct au1xxx_irqmap __initdata au1xxx_ic0_map[] = { | ||
41 | |||
42 | #if defined(CONFIG_SOC_AU1000) | ||
43 | { AU1000_UART0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
44 | { AU1000_UART1_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
45 | { AU1000_UART2_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
46 | { AU1000_UART3_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
47 | { AU1000_SSI0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
48 | { AU1000_SSI1_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
49 | { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0 }, | ||
50 | { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0 }, | ||
51 | { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0 }, | ||
52 | { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0 }, | ||
53 | { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0 }, | ||
54 | { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0 }, | ||
55 | { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0 }, | ||
56 | { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0 }, | ||
57 | { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 }, | ||
58 | { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
59 | { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
60 | { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, | ||
61 | { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 }, | ||
62 | { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
63 | { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
64 | { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, | ||
65 | { AU1000_IRDA_TX_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
66 | { AU1000_IRDA_RX_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
67 | { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
68 | { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, | ||
69 | { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, | ||
70 | { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 }, | ||
71 | { AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
72 | { AU1000_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
73 | { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 }, | ||
74 | |||
75 | #elif defined(CONFIG_SOC_AU1500) | ||
76 | |||
77 | { AU1500_UART0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
78 | { AU1000_PCI_INTA, INTC_INT_LOW_LEVEL, 0 }, | ||
79 | { AU1000_PCI_INTB, INTC_INT_LOW_LEVEL, 0 }, | ||
80 | { AU1500_UART3_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
81 | { AU1000_PCI_INTC, INTC_INT_LOW_LEVEL, 0 }, | ||
82 | { AU1000_PCI_INTD, INTC_INT_LOW_LEVEL, 0 }, | ||
83 | { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0 }, | ||
84 | { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0 }, | ||
85 | { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0 }, | ||
86 | { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0 }, | ||
87 | { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0 }, | ||
88 | { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0 }, | ||
89 | { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0 }, | ||
90 | { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0 }, | ||
91 | { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 }, | ||
92 | { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
93 | { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
94 | { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, | ||
95 | { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 }, | ||
96 | { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
97 | { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
98 | { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, | ||
99 | { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
100 | { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, | ||
101 | { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, | ||
102 | { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 }, | ||
103 | { AU1500_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
104 | { AU1500_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
105 | { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 }, | ||
106 | |||
107 | #elif defined(CONFIG_SOC_AU1100) | ||
108 | |||
109 | { AU1100_UART0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
110 | { AU1100_UART1_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
111 | { AU1100_SD_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
112 | { AU1100_UART3_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
113 | { AU1000_SSI0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
114 | { AU1000_SSI1_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
115 | { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0 }, | ||
116 | { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0 }, | ||
117 | { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0 }, | ||
118 | { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0 }, | ||
119 | { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0 }, | ||
120 | { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0 }, | ||
121 | { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0 }, | ||
122 | { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0 }, | ||
123 | { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 }, | ||
124 | { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
125 | { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
126 | { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, | ||
127 | { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 }, | ||
128 | { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
129 | { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
130 | { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, | ||
131 | { AU1000_IRDA_TX_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
132 | { AU1000_IRDA_RX_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
133 | { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
134 | { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, | ||
135 | { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, | ||
136 | { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 }, | ||
137 | { AU1100_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
138 | /* { AU1000_GPIO215_208_INT, INTC_INT_HIGH_LEVEL, 0 }, */ | ||
139 | { AU1100_LCD_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
140 | { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 }, | ||
141 | |||
142 | #elif defined(CONFIG_SOC_AU1550) | ||
143 | |||
144 | { AU1550_UART0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
145 | { AU1550_PCI_INTA, INTC_INT_LOW_LEVEL, 0 }, | ||
146 | { AU1550_PCI_INTB, INTC_INT_LOW_LEVEL, 0 }, | ||
147 | { AU1550_DDMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
148 | { AU1550_CRYPTO_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
149 | { AU1550_PCI_INTC, INTC_INT_LOW_LEVEL, 0 }, | ||
150 | { AU1550_PCI_INTD, INTC_INT_LOW_LEVEL, 0 }, | ||
151 | { AU1550_PCI_RST_INT, INTC_INT_LOW_LEVEL, 0 }, | ||
152 | { AU1550_UART1_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
153 | { AU1550_UART3_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
154 | { AU1550_PSC0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
155 | { AU1550_PSC1_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
156 | { AU1550_PSC2_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
157 | { AU1550_PSC3_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
158 | { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 }, | ||
159 | { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
160 | { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
161 | { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, | ||
162 | { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 }, | ||
163 | { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
164 | { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
165 | { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, | ||
166 | { AU1550_NAND_INT, INTC_INT_RISE_EDGE, 0 }, | ||
167 | { AU1550_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
168 | { AU1550_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, | ||
169 | { AU1550_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, | ||
170 | { AU1550_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
171 | { AU1550_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
172 | |||
173 | #elif defined(CONFIG_SOC_AU1200) | ||
174 | |||
175 | { AU1200_UART0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
176 | { AU1200_SWT_INT, INTC_INT_RISE_EDGE, 0 }, | ||
177 | { AU1200_SD_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
178 | { AU1200_DDMA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
179 | { AU1200_MAE_BE_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
180 | { AU1200_UART1_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
181 | { AU1200_MAE_FE_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
182 | { AU1200_PSC0_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
183 | { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
184 | { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
185 | { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
186 | { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 }, | ||
187 | { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
188 | { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
189 | { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, | ||
190 | { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 }, | ||
191 | { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, | ||
192 | { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, | ||
193 | { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, | ||
194 | { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0 }, | ||
195 | { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
196 | { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
197 | { AU1200_MAE_BOTH_INT, INTC_INT_HIGH_LEVEL, 0 }, | ||
198 | |||
199 | #else | ||
200 | #error "Error: Unknown Alchemy SOC" | ||
201 | #endif | ||
202 | |||
203 | }; | ||
204 | |||
205 | int __initdata au1xxx_ic0_nr_irqs = ARRAY_SIZE(au1xxx_ic0_map); | ||
diff --git a/arch/mips/alchemy/common/clocks.c b/arch/mips/alchemy/common/clocks.c index 043429d17c5f..d8991854530e 100644 --- a/arch/mips/alchemy/common/clocks.c +++ b/arch/mips/alchemy/common/clocks.c | |||
@@ -27,12 +27,21 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/spinlock.h> | ||
31 | #include <asm/time.h> | ||
30 | #include <asm/mach-au1x00/au1000.h> | 32 | #include <asm/mach-au1x00/au1000.h> |
31 | 33 | ||
34 | /* | ||
35 | * I haven't found anyone that doesn't use a 12 MHz source clock, | ||
36 | * but just in case..... | ||
37 | */ | ||
38 | #define AU1000_SRC_CLK 12000000 | ||
39 | |||
32 | static unsigned int au1x00_clock; /* Hz */ | 40 | static unsigned int au1x00_clock; /* Hz */ |
33 | static unsigned int lcd_clock; /* KHz */ | ||
34 | static unsigned long uart_baud_base; | 41 | static unsigned long uart_baud_base; |
35 | 42 | ||
43 | static DEFINE_SPINLOCK(time_lock); | ||
44 | |||
36 | /* | 45 | /* |
37 | * Set the au1000_clock | 46 | * Set the au1000_clock |
38 | */ | 47 | */ |
@@ -63,31 +72,45 @@ void set_au1x00_uart_baud_base(unsigned long new_baud_base) | |||
63 | } | 72 | } |
64 | 73 | ||
65 | /* | 74 | /* |
66 | * Calculate the Au1x00's LCD clock based on the current | 75 | * We read the real processor speed from the PLL. This is important |
67 | * cpu clock and the system bus clock, and try to keep it | 76 | * because it is more accurate than computing it from the 32 KHz |
68 | * below 40 MHz (the Pb1000 board can lock-up if the LCD | 77 | * counter, if it exists. If we don't have an accurate processor |
69 | * clock is over 40 MHz). | 78 | * speed, all of the peripherals that derive their clocks based on |
79 | * this advertised speed will introduce error and sometimes not work | ||
80 | * properly. This function is futher convoluted to still allow configurations | ||
81 | * to do that in case they have really, really old silicon with a | ||
82 | * write-only PLL register. -- Dan | ||
70 | */ | 83 | */ |
71 | void set_au1x00_lcd_clock(void) | 84 | unsigned long au1xxx_calc_clock(void) |
72 | { | 85 | { |
73 | unsigned int static_cfg0; | 86 | unsigned long cpu_speed; |
74 | unsigned int sys_busclk = (get_au1x00_speed() / 1000) / | 87 | unsigned long flags; |
75 | ((int)(au_readl(SYS_POWERCTRL) & 0x03) + 2); | ||
76 | 88 | ||
77 | static_cfg0 = au_readl(MEM_STCFG0); | 89 | spin_lock_irqsave(&time_lock, flags); |
78 | 90 | ||
79 | if (static_cfg0 & (1 << 11)) | 91 | /* |
80 | lcd_clock = sys_busclk / 5; /* note: BCLK switching fails with D5 */ | 92 | * On early Au1000, sys_cpupll was write-only. Since these |
93 | * silicon versions of Au1000 are not sold by AMD, we don't bend | ||
94 | * over backwards trying to determine the frequency. | ||
95 | */ | ||
96 | if (au1xxx_cpu_has_pll_wo()) | ||
97 | #ifdef CONFIG_SOC_AU1000_FREQUENCY | ||
98 | cpu_speed = CONFIG_SOC_AU1000_FREQUENCY; | ||
99 | #else | ||
100 | cpu_speed = 396000000; | ||
101 | #endif | ||
81 | else | 102 | else |
82 | lcd_clock = sys_busclk / 4; | 103 | cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK; |
83 | 104 | ||
84 | if (lcd_clock > 50000) /* Epson MAX */ | 105 | /* On Alchemy CPU:counter ratio is 1:1 */ |
85 | printk(KERN_WARNING "warning: LCD clock too high (%u KHz)\n", | 106 | mips_hpt_frequency = cpu_speed; |
86 | lcd_clock); | 107 | /* Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16) */ |
87 | } | 108 | set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL) |
109 | & 0x03) + 2) * 16)); | ||
88 | 110 | ||
89 | unsigned int get_au1x00_lcd_clock(void) | 111 | spin_unlock_irqrestore(&time_lock, flags); |
90 | { | 112 | |
91 | return lcd_clock; | 113 | set_au1x00_speed(cpu_speed); |
114 | |||
115 | return cpu_speed; | ||
92 | } | 116 | } |
93 | EXPORT_SYMBOL(get_au1x00_lcd_clock); | ||
diff --git a/arch/mips/alchemy/common/cputable.c b/arch/mips/alchemy/common/cputable.c deleted file mode 100644 index ba6430bc2d03..000000000000 --- a/arch/mips/alchemy/common/cputable.c +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * arch/mips/au1000/common/cputable.c | ||
3 | * | ||
4 | * Copyright (C) 2004 Dan Malek (dan@embeddededge.com) | ||
5 | * Copied from PowerPC and updated for Alchemy Au1xxx processors. | ||
6 | * | ||
7 | * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | */ | ||
14 | |||
15 | #include <asm/mach-au1x00/au1000.h> | ||
16 | |||
17 | struct cpu_spec *cur_cpu_spec[NR_CPUS]; | ||
18 | |||
19 | /* With some thought, we can probably use the mask to reduce the | ||
20 | * size of the table. | ||
21 | */ | ||
22 | struct cpu_spec cpu_specs[] = { | ||
23 | { 0xffffffff, 0x00030100, "Au1000 DA", 1, 0, 1 }, | ||
24 | { 0xffffffff, 0x00030201, "Au1000 HA", 1, 0, 1 }, | ||
25 | { 0xffffffff, 0x00030202, "Au1000 HB", 1, 0, 1 }, | ||
26 | { 0xffffffff, 0x00030203, "Au1000 HC", 1, 1, 0 }, | ||
27 | { 0xffffffff, 0x00030204, "Au1000 HD", 1, 1, 0 }, | ||
28 | { 0xffffffff, 0x01030200, "Au1500 AB", 1, 1, 0 }, | ||
29 | { 0xffffffff, 0x01030201, "Au1500 AC", 0, 1, 0 }, | ||
30 | { 0xffffffff, 0x01030202, "Au1500 AD", 0, 1, 0 }, | ||
31 | { 0xffffffff, 0x02030200, "Au1100 AB", 1, 1, 0 }, | ||
32 | { 0xffffffff, 0x02030201, "Au1100 BA", 1, 1, 0 }, | ||
33 | { 0xffffffff, 0x02030202, "Au1100 BC", 1, 1, 0 }, | ||
34 | { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1, 0 }, | ||
35 | { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1, 0 }, | ||
36 | { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1, 0 }, | ||
37 | { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0, 0 }, | ||
38 | { 0xffffffff, 0x04030201, "Au1200 AC", 1, 0, 0 }, | ||
39 | { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0, 0 } | ||
40 | }; | ||
41 | |||
42 | void set_cpuspec(void) | ||
43 | { | ||
44 | struct cpu_spec *sp; | ||
45 | u32 prid; | ||
46 | |||
47 | prid = read_c0_prid(); | ||
48 | sp = cpu_specs; | ||
49 | while ((prid & sp->prid_mask) != sp->prid_value) | ||
50 | sp++; | ||
51 | cur_cpu_spec[0] = sp; | ||
52 | } | ||
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c index 601ee9180ee4..3ab6d80d150d 100644 --- a/arch/mips/alchemy/common/dbdma.c +++ b/arch/mips/alchemy/common/dbdma.c | |||
@@ -174,6 +174,11 @@ static dbdev_tab_t dbdev_tab[] = { | |||
174 | 174 | ||
175 | #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) | 175 | #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) |
176 | 176 | ||
177 | #ifdef CONFIG_PM | ||
178 | static u32 au1xxx_dbdma_pm_regs[NUM_DBDMA_CHANS + 1][8]; | ||
179 | #endif | ||
180 | |||
181 | |||
177 | static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; | 182 | static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; |
178 | 183 | ||
179 | static dbdev_tab_t *find_dbdev_id(u32 id) | 184 | static dbdev_tab_t *find_dbdev_id(u32 id) |
@@ -975,4 +980,64 @@ u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr) | |||
975 | return nbytes; | 980 | return nbytes; |
976 | } | 981 | } |
977 | 982 | ||
983 | #ifdef CONFIG_PM | ||
984 | void au1xxx_dbdma_suspend(void) | ||
985 | { | ||
986 | int i; | ||
987 | u32 addr; | ||
988 | |||
989 | addr = DDMA_GLOBAL_BASE; | ||
990 | au1xxx_dbdma_pm_regs[0][0] = au_readl(addr + 0x00); | ||
991 | au1xxx_dbdma_pm_regs[0][1] = au_readl(addr + 0x04); | ||
992 | au1xxx_dbdma_pm_regs[0][2] = au_readl(addr + 0x08); | ||
993 | au1xxx_dbdma_pm_regs[0][3] = au_readl(addr + 0x0c); | ||
994 | |||
995 | /* save channel configurations */ | ||
996 | for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) { | ||
997 | au1xxx_dbdma_pm_regs[i][0] = au_readl(addr + 0x00); | ||
998 | au1xxx_dbdma_pm_regs[i][1] = au_readl(addr + 0x04); | ||
999 | au1xxx_dbdma_pm_regs[i][2] = au_readl(addr + 0x08); | ||
1000 | au1xxx_dbdma_pm_regs[i][3] = au_readl(addr + 0x0c); | ||
1001 | au1xxx_dbdma_pm_regs[i][4] = au_readl(addr + 0x10); | ||
1002 | au1xxx_dbdma_pm_regs[i][5] = au_readl(addr + 0x14); | ||
1003 | au1xxx_dbdma_pm_regs[i][6] = au_readl(addr + 0x18); | ||
1004 | |||
1005 | /* halt channel */ | ||
1006 | au_writel(au1xxx_dbdma_pm_regs[i][0] & ~1, addr + 0x00); | ||
1007 | au_sync(); | ||
1008 | while (!(au_readl(addr + 0x14) & 1)) | ||
1009 | au_sync(); | ||
1010 | |||
1011 | addr += 0x100; /* next channel base */ | ||
1012 | } | ||
1013 | /* disable channel interrupts */ | ||
1014 | au_writel(0, DDMA_GLOBAL_BASE + 0x0c); | ||
1015 | au_sync(); | ||
1016 | } | ||
1017 | |||
1018 | void au1xxx_dbdma_resume(void) | ||
1019 | { | ||
1020 | int i; | ||
1021 | u32 addr; | ||
1022 | |||
1023 | addr = DDMA_GLOBAL_BASE; | ||
1024 | au_writel(au1xxx_dbdma_pm_regs[0][0], addr + 0x00); | ||
1025 | au_writel(au1xxx_dbdma_pm_regs[0][1], addr + 0x04); | ||
1026 | au_writel(au1xxx_dbdma_pm_regs[0][2], addr + 0x08); | ||
1027 | au_writel(au1xxx_dbdma_pm_regs[0][3], addr + 0x0c); | ||
1028 | |||
1029 | /* restore channel configurations */ | ||
1030 | for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) { | ||
1031 | au_writel(au1xxx_dbdma_pm_regs[i][0], addr + 0x00); | ||
1032 | au_writel(au1xxx_dbdma_pm_regs[i][1], addr + 0x04); | ||
1033 | au_writel(au1xxx_dbdma_pm_regs[i][2], addr + 0x08); | ||
1034 | au_writel(au1xxx_dbdma_pm_regs[i][3], addr + 0x0c); | ||
1035 | au_writel(au1xxx_dbdma_pm_regs[i][4], addr + 0x10); | ||
1036 | au_writel(au1xxx_dbdma_pm_regs[i][5], addr + 0x14); | ||
1037 | au_writel(au1xxx_dbdma_pm_regs[i][6], addr + 0x18); | ||
1038 | au_sync(); | ||
1039 | addr += 0x100; /* next channel base */ | ||
1040 | } | ||
1041 | } | ||
1042 | #endif /* CONFIG_PM */ | ||
978 | #endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ | 1043 | #endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ |
diff --git a/arch/mips/alchemy/common/irq.c b/arch/mips/alchemy/common/irq.c index 40c6ceceb5f9..c88c821b4c36 100644 --- a/arch/mips/alchemy/common/irq.c +++ b/arch/mips/alchemy/common/irq.c | |||
@@ -24,6 +24,7 @@ | |||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | 24 | * with this program; if not, write to the Free Software Foundation, Inc., |
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 25 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | */ | 26 | */ |
27 | |||
27 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
28 | #include <linux/init.h> | 29 | #include <linux/init.h> |
29 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
@@ -36,15 +37,172 @@ | |||
36 | #include <asm/mach-pb1x00/pb1000.h> | 37 | #include <asm/mach-pb1x00/pb1000.h> |
37 | #endif | 38 | #endif |
38 | 39 | ||
39 | #define EXT_INTC0_REQ0 2 /* IP 2 */ | 40 | static int au1x_ic_settype(unsigned int irq, unsigned int flow_type); |
40 | #define EXT_INTC0_REQ1 3 /* IP 3 */ | 41 | |
41 | #define EXT_INTC1_REQ0 4 /* IP 4 */ | 42 | /* per-processor fixed function irqs */ |
42 | #define EXT_INTC1_REQ1 5 /* IP 5 */ | 43 | struct au1xxx_irqmap au1xxx_ic0_map[] __initdata = { |
43 | #define MIPS_TIMER_IP 7 /* IP 7 */ | 44 | |
44 | 45 | #if defined(CONFIG_SOC_AU1000) | |
45 | void (*board_init_irq)(void) __initdata = NULL; | 46 | { AU1000_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, |
47 | { AU1000_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
48 | { AU1000_UART2_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
49 | { AU1000_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
50 | { AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
51 | { AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
52 | { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
53 | { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
54 | { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
55 | { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
56 | { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
57 | { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
58 | { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
59 | { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
60 | { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
61 | { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
62 | { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
63 | { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 }, | ||
64 | { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
65 | { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
66 | { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
67 | { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
68 | { AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
69 | { AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
70 | { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
71 | { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
72 | { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
73 | { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
74 | { AU1000_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
75 | { AU1000_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
76 | { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
77 | |||
78 | #elif defined(CONFIG_SOC_AU1500) | ||
79 | |||
80 | { AU1500_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
81 | { AU1000_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
82 | { AU1000_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
83 | { AU1500_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
84 | { AU1000_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
85 | { AU1000_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
86 | { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
87 | { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
88 | { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
89 | { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
90 | { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
91 | { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
92 | { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
93 | { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
94 | { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
95 | { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
96 | { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
97 | { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 }, | ||
98 | { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
99 | { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
100 | { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
101 | { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
102 | { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
103 | { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
104 | { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
105 | { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
106 | { AU1500_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
107 | { AU1500_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
108 | { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
109 | |||
110 | #elif defined(CONFIG_SOC_AU1100) | ||
111 | |||
112 | { AU1100_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
113 | { AU1100_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
114 | { AU1100_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
115 | { AU1100_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
116 | { AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
117 | { AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
118 | { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
119 | { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
120 | { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
121 | { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
122 | { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
123 | { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
124 | { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
125 | { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
126 | { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
127 | { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
128 | { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
129 | { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 }, | ||
130 | { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
131 | { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
132 | { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
133 | { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
134 | { AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
135 | { AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
136 | { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
137 | { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
138 | { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
139 | { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
140 | { AU1100_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
141 | { AU1100_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
142 | { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
143 | |||
144 | #elif defined(CONFIG_SOC_AU1550) | ||
145 | |||
146 | { AU1550_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
147 | { AU1550_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
148 | { AU1550_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
149 | { AU1550_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
150 | { AU1550_CRYPTO_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
151 | { AU1550_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
152 | { AU1550_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
153 | { AU1550_PCI_RST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
154 | { AU1550_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
155 | { AU1550_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
156 | { AU1550_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
157 | { AU1550_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
158 | { AU1550_PSC2_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
159 | { AU1550_PSC3_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
160 | { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
161 | { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
162 | { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
163 | { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 }, | ||
164 | { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
165 | { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
166 | { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
167 | { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
168 | { AU1550_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
169 | { AU1550_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
170 | { AU1550_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
171 | { AU1550_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 }, | ||
172 | { AU1550_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
173 | { AU1550_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
174 | |||
175 | #elif defined(CONFIG_SOC_AU1200) | ||
176 | |||
177 | { AU1200_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
178 | { AU1200_SWT_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
179 | { AU1200_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
180 | { AU1200_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
181 | { AU1200_MAE_BE_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
182 | { AU1200_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
183 | { AU1200_MAE_FE_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
184 | { AU1200_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
185 | { AU1200_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
186 | { AU1200_AES_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
187 | { AU1200_CAMERA_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
188 | { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
189 | { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
190 | { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
191 | { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 }, | ||
192 | { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
193 | { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
194 | { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
195 | { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
196 | { AU1200_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 }, | ||
197 | { AU1200_USB_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
198 | { AU1200_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
199 | { AU1200_MAE_BOTH_INT, IRQ_TYPE_LEVEL_HIGH, 0 }, | ||
200 | |||
201 | #else | ||
202 | #error "Error: Unknown Alchemy SOC" | ||
203 | #endif | ||
204 | }; | ||
46 | 205 | ||
47 | static DEFINE_SPINLOCK(irq_lock); | ||
48 | 206 | ||
49 | #ifdef CONFIG_PM | 207 | #ifdef CONFIG_PM |
50 | 208 | ||
@@ -130,67 +288,47 @@ void restore_au1xxx_intctl(void) | |||
130 | #endif /* CONFIG_PM */ | 288 | #endif /* CONFIG_PM */ |
131 | 289 | ||
132 | 290 | ||
133 | inline void local_enable_irq(unsigned int irq_nr) | 291 | static void au1x_ic0_unmask(unsigned int irq_nr) |
134 | { | 292 | { |
135 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; | 293 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; |
136 | 294 | au_writel(1 << bit, IC0_MASKSET); | |
137 | if (bit >= 32) { | 295 | au_writel(1 << bit, IC0_WAKESET); |
138 | au_writel(1 << (bit - 32), IC1_MASKSET); | ||
139 | au_writel(1 << (bit - 32), IC1_WAKESET); | ||
140 | } else { | ||
141 | au_writel(1 << bit, IC0_MASKSET); | ||
142 | au_writel(1 << bit, IC0_WAKESET); | ||
143 | } | ||
144 | au_sync(); | 296 | au_sync(); |
145 | } | 297 | } |
146 | 298 | ||
147 | 299 | static void au1x_ic1_unmask(unsigned int irq_nr) | |
148 | inline void local_disable_irq(unsigned int irq_nr) | ||
149 | { | 300 | { |
150 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; | 301 | unsigned int bit = irq_nr - AU1000_INTC1_INT_BASE; |
302 | au_writel(1 << bit, IC1_MASKSET); | ||
303 | au_writel(1 << bit, IC1_WAKESET); | ||
151 | 304 | ||
152 | if (bit >= 32) { | 305 | /* very hacky. does the pb1000 cpld auto-disable this int? |
153 | au_writel(1 << (bit - 32), IC1_MASKCLR); | 306 | * nowhere in the current kernel sources is it disabled. --mlau |
154 | au_writel(1 << (bit - 32), IC1_WAKECLR); | 307 | */ |
155 | } else { | 308 | #if defined(CONFIG_MIPS_PB1000) |
156 | au_writel(1 << bit, IC0_MASKCLR); | 309 | if (irq_nr == AU1000_GPIO_15) |
157 | au_writel(1 << bit, IC0_WAKECLR); | 310 | au_writel(0x4000, PB1000_MDR); /* enable int */ |
158 | } | 311 | #endif |
159 | au_sync(); | 312 | au_sync(); |
160 | } | 313 | } |
161 | 314 | ||
162 | 315 | static void au1x_ic0_mask(unsigned int irq_nr) | |
163 | static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr) | ||
164 | { | 316 | { |
165 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; | 317 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; |
166 | 318 | au_writel(1 << bit, IC0_MASKCLR); | |
167 | if (bit >= 32) { | 319 | au_writel(1 << bit, IC0_WAKECLR); |
168 | au_writel(1 << (bit - 32), IC1_RISINGCLR); | ||
169 | au_writel(1 << (bit - 32), IC1_MASKCLR); | ||
170 | } else { | ||
171 | au_writel(1 << bit, IC0_RISINGCLR); | ||
172 | au_writel(1 << bit, IC0_MASKCLR); | ||
173 | } | ||
174 | au_sync(); | 320 | au_sync(); |
175 | } | 321 | } |
176 | 322 | ||
177 | 323 | static void au1x_ic1_mask(unsigned int irq_nr) | |
178 | static inline void mask_and_ack_fall_edge_irq(unsigned int irq_nr) | ||
179 | { | 324 | { |
180 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; | 325 | unsigned int bit = irq_nr - AU1000_INTC1_INT_BASE; |
181 | 326 | au_writel(1 << bit, IC1_MASKCLR); | |
182 | if (bit >= 32) { | 327 | au_writel(1 << bit, IC1_WAKECLR); |
183 | au_writel(1 << (bit - 32), IC1_FALLINGCLR); | ||
184 | au_writel(1 << (bit - 32), IC1_MASKCLR); | ||
185 | } else { | ||
186 | au_writel(1 << bit, IC0_FALLINGCLR); | ||
187 | au_writel(1 << bit, IC0_MASKCLR); | ||
188 | } | ||
189 | au_sync(); | 328 | au_sync(); |
190 | } | 329 | } |
191 | 330 | ||
192 | 331 | static void au1x_ic0_ack(unsigned int irq_nr) | |
193 | static inline void mask_and_ack_either_edge_irq(unsigned int irq_nr) | ||
194 | { | 332 | { |
195 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; | 333 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; |
196 | 334 | ||
@@ -198,349 +336,229 @@ static inline void mask_and_ack_either_edge_irq(unsigned int irq_nr) | |||
198 | * This may assume that we don't get interrupts from | 336 | * This may assume that we don't get interrupts from |
199 | * both edges at once, or if we do, that we don't care. | 337 | * both edges at once, or if we do, that we don't care. |
200 | */ | 338 | */ |
201 | if (bit >= 32) { | 339 | au_writel(1 << bit, IC0_FALLINGCLR); |
202 | au_writel(1 << (bit - 32), IC1_FALLINGCLR); | 340 | au_writel(1 << bit, IC0_RISINGCLR); |
203 | au_writel(1 << (bit - 32), IC1_RISINGCLR); | ||
204 | au_writel(1 << (bit - 32), IC1_MASKCLR); | ||
205 | } else { | ||
206 | au_writel(1 << bit, IC0_FALLINGCLR); | ||
207 | au_writel(1 << bit, IC0_RISINGCLR); | ||
208 | au_writel(1 << bit, IC0_MASKCLR); | ||
209 | } | ||
210 | au_sync(); | 341 | au_sync(); |
211 | } | 342 | } |
212 | 343 | ||
213 | static inline void mask_and_ack_level_irq(unsigned int irq_nr) | 344 | static void au1x_ic1_ack(unsigned int irq_nr) |
214 | { | 345 | { |
215 | local_disable_irq(irq_nr); | 346 | unsigned int bit = irq_nr - AU1000_INTC1_INT_BASE; |
216 | au_sync(); | ||
217 | #if defined(CONFIG_MIPS_PB1000) | ||
218 | if (irq_nr == AU1000_GPIO_15) { | ||
219 | au_writel(0x8000, PB1000_MDR); /* ack int */ | ||
220 | au_sync(); | ||
221 | } | ||
222 | #endif | ||
223 | } | ||
224 | |||
225 | static void end_irq(unsigned int irq_nr) | ||
226 | { | ||
227 | if (!(irq_desc[irq_nr].status & (IRQ_DISABLED | IRQ_INPROGRESS))) | ||
228 | local_enable_irq(irq_nr); | ||
229 | 347 | ||
230 | #if defined(CONFIG_MIPS_PB1000) | 348 | /* |
231 | if (irq_nr == AU1000_GPIO_15) { | 349 | * This may assume that we don't get interrupts from |
232 | au_writel(0x4000, PB1000_MDR); /* enable int */ | 350 | * both edges at once, or if we do, that we don't care. |
233 | au_sync(); | 351 | */ |
234 | } | 352 | au_writel(1 << bit, IC1_FALLINGCLR); |
235 | #endif | 353 | au_writel(1 << bit, IC1_RISINGCLR); |
354 | au_sync(); | ||
236 | } | 355 | } |
237 | 356 | ||
238 | unsigned long save_local_and_disable(int controller) | 357 | static int au1x_ic1_setwake(unsigned int irq, unsigned int on) |
239 | { | 358 | { |
240 | int i; | 359 | unsigned int bit = irq - AU1000_INTC1_INT_BASE; |
241 | unsigned long flags, mask; | 360 | unsigned long wakemsk, flags; |
242 | |||
243 | spin_lock_irqsave(&irq_lock, flags); | ||
244 | if (controller) { | ||
245 | mask = au_readl(IC1_MASKSET); | ||
246 | for (i = 32; i < 64; i++) | ||
247 | local_disable_irq(i); | ||
248 | } else { | ||
249 | mask = au_readl(IC0_MASKSET); | ||
250 | for (i = 0; i < 32; i++) | ||
251 | local_disable_irq(i); | ||
252 | } | ||
253 | spin_unlock_irqrestore(&irq_lock, flags); | ||
254 | |||
255 | return mask; | ||
256 | } | ||
257 | 361 | ||
258 | void restore_local_and_enable(int controller, unsigned long mask) | 362 | /* only GPIO 0-7 can act as wakeup source: */ |
259 | { | 363 | if ((irq < AU1000_GPIO_0) || (irq > AU1000_GPIO_7)) |
260 | int i; | 364 | return -EINVAL; |
261 | unsigned long flags, new_mask; | ||
262 | |||
263 | spin_lock_irqsave(&irq_lock, flags); | ||
264 | for (i = 0; i < 32; i++) | ||
265 | if (mask & (1 << i)) { | ||
266 | if (controller) | ||
267 | local_enable_irq(i + 32); | ||
268 | else | ||
269 | local_enable_irq(i); | ||
270 | } | ||
271 | 365 | ||
272 | if (controller) | 366 | local_irq_save(flags); |
273 | new_mask = au_readl(IC1_MASKSET); | 367 | wakemsk = au_readl(SYS_WAKEMSK); |
368 | if (on) | ||
369 | wakemsk |= 1 << bit; | ||
274 | else | 370 | else |
275 | new_mask = au_readl(IC0_MASKSET); | 371 | wakemsk &= ~(1 << bit); |
372 | au_writel(wakemsk, SYS_WAKEMSK); | ||
373 | au_sync(); | ||
374 | local_irq_restore(flags); | ||
276 | 375 | ||
277 | spin_unlock_irqrestore(&irq_lock, flags); | 376 | return 0; |
278 | } | 377 | } |
279 | 378 | ||
280 | 379 | /* | |
281 | static struct irq_chip rise_edge_irq_type = { | 380 | * irq_chips for both ICs; this way the mask handlers can be |
282 | .name = "Au1000 Rise Edge", | 381 | * as short as possible. |
283 | .ack = mask_and_ack_rise_edge_irq, | 382 | * |
284 | .mask = local_disable_irq, | 383 | * NOTE: the ->ack() callback is used by the handle_edge_irq |
285 | .mask_ack = mask_and_ack_rise_edge_irq, | 384 | * flowhandler only, the ->mask_ack() one by handle_level_irq, |
286 | .unmask = local_enable_irq, | 385 | * so no need for an irq_chip for each type of irq (level/edge). |
287 | .end = end_irq, | 386 | */ |
288 | }; | 387 | static struct irq_chip au1x_ic0_chip = { |
289 | 388 | .name = "Alchemy-IC0", | |
290 | static struct irq_chip fall_edge_irq_type = { | 389 | .ack = au1x_ic0_ack, /* edge */ |
291 | .name = "Au1000 Fall Edge", | 390 | .mask = au1x_ic0_mask, |
292 | .ack = mask_and_ack_fall_edge_irq, | 391 | .mask_ack = au1x_ic0_mask, /* level */ |
293 | .mask = local_disable_irq, | 392 | .unmask = au1x_ic0_unmask, |
294 | .mask_ack = mask_and_ack_fall_edge_irq, | 393 | .set_type = au1x_ic_settype, |
295 | .unmask = local_enable_irq, | ||
296 | .end = end_irq, | ||
297 | }; | ||
298 | |||
299 | static struct irq_chip either_edge_irq_type = { | ||
300 | .name = "Au1000 Rise or Fall Edge", | ||
301 | .ack = mask_and_ack_either_edge_irq, | ||
302 | .mask = local_disable_irq, | ||
303 | .mask_ack = mask_and_ack_either_edge_irq, | ||
304 | .unmask = local_enable_irq, | ||
305 | .end = end_irq, | ||
306 | }; | 394 | }; |
307 | 395 | ||
308 | static struct irq_chip level_irq_type = { | 396 | static struct irq_chip au1x_ic1_chip = { |
309 | .name = "Au1000 Level", | 397 | .name = "Alchemy-IC1", |
310 | .ack = mask_and_ack_level_irq, | 398 | .ack = au1x_ic1_ack, /* edge */ |
311 | .mask = local_disable_irq, | 399 | .mask = au1x_ic1_mask, |
312 | .mask_ack = mask_and_ack_level_irq, | 400 | .mask_ack = au1x_ic1_mask, /* level */ |
313 | .unmask = local_enable_irq, | 401 | .unmask = au1x_ic1_unmask, |
314 | .end = end_irq, | 402 | .set_type = au1x_ic_settype, |
403 | .set_wake = au1x_ic1_setwake, | ||
315 | }; | 404 | }; |
316 | 405 | ||
317 | static void __init setup_local_irq(unsigned int irq_nr, int type, int int_req) | 406 | static int au1x_ic_settype(unsigned int irq, unsigned int flow_type) |
318 | { | 407 | { |
319 | unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; | 408 | struct irq_chip *chip; |
320 | 409 | unsigned long icr[6]; | |
321 | if (irq_nr > AU1000_MAX_INTR) | 410 | unsigned int bit, ic; |
322 | return; | 411 | int ret; |
323 | 412 | ||
324 | /* Config2[n], Config1[n], Config0[n] */ | 413 | if (irq >= AU1000_INTC1_INT_BASE) { |
325 | if (bit >= 32) { | 414 | bit = irq - AU1000_INTC1_INT_BASE; |
326 | switch (type) { | 415 | chip = &au1x_ic1_chip; |
327 | case INTC_INT_RISE_EDGE: /* 0:0:1 */ | 416 | ic = 1; |
328 | au_writel(1 << (bit - 32), IC1_CFG2CLR); | ||
329 | au_writel(1 << (bit - 32), IC1_CFG1CLR); | ||
330 | au_writel(1 << (bit - 32), IC1_CFG0SET); | ||
331 | set_irq_chip(irq_nr, &rise_edge_irq_type); | ||
332 | break; | ||
333 | case INTC_INT_FALL_EDGE: /* 0:1:0 */ | ||
334 | au_writel(1 << (bit - 32), IC1_CFG2CLR); | ||
335 | au_writel(1 << (bit - 32), IC1_CFG1SET); | ||
336 | au_writel(1 << (bit - 32), IC1_CFG0CLR); | ||
337 | set_irq_chip(irq_nr, &fall_edge_irq_type); | ||
338 | break; | ||
339 | case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ | ||
340 | au_writel(1 << (bit - 32), IC1_CFG2CLR); | ||
341 | au_writel(1 << (bit - 32), IC1_CFG1SET); | ||
342 | au_writel(1 << (bit - 32), IC1_CFG0SET); | ||
343 | set_irq_chip(irq_nr, &either_edge_irq_type); | ||
344 | break; | ||
345 | case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ | ||
346 | au_writel(1 << (bit - 32), IC1_CFG2SET); | ||
347 | au_writel(1 << (bit - 32), IC1_CFG1CLR); | ||
348 | au_writel(1 << (bit - 32), IC1_CFG0SET); | ||
349 | set_irq_chip(irq_nr, &level_irq_type); | ||
350 | break; | ||
351 | case INTC_INT_LOW_LEVEL: /* 1:1:0 */ | ||
352 | au_writel(1 << (bit - 32), IC1_CFG2SET); | ||
353 | au_writel(1 << (bit - 32), IC1_CFG1SET); | ||
354 | au_writel(1 << (bit - 32), IC1_CFG0CLR); | ||
355 | set_irq_chip(irq_nr, &level_irq_type); | ||
356 | break; | ||
357 | case INTC_INT_DISABLED: /* 0:0:0 */ | ||
358 | au_writel(1 << (bit - 32), IC1_CFG0CLR); | ||
359 | au_writel(1 << (bit - 32), IC1_CFG1CLR); | ||
360 | au_writel(1 << (bit - 32), IC1_CFG2CLR); | ||
361 | break; | ||
362 | default: /* disable the interrupt */ | ||
363 | printk(KERN_WARNING "unexpected int type %d (irq %d)\n", | ||
364 | type, irq_nr); | ||
365 | au_writel(1 << (bit - 32), IC1_CFG0CLR); | ||
366 | au_writel(1 << (bit - 32), IC1_CFG1CLR); | ||
367 | au_writel(1 << (bit - 32), IC1_CFG2CLR); | ||
368 | return; | ||
369 | } | ||
370 | if (int_req) /* assign to interrupt request 1 */ | ||
371 | au_writel(1 << (bit - 32), IC1_ASSIGNCLR); | ||
372 | else /* assign to interrupt request 0 */ | ||
373 | au_writel(1 << (bit - 32), IC1_ASSIGNSET); | ||
374 | au_writel(1 << (bit - 32), IC1_SRCSET); | ||
375 | au_writel(1 << (bit - 32), IC1_MASKCLR); | ||
376 | au_writel(1 << (bit - 32), IC1_WAKECLR); | ||
377 | } else { | 417 | } else { |
378 | switch (type) { | 418 | bit = irq - AU1000_INTC0_INT_BASE; |
379 | case INTC_INT_RISE_EDGE: /* 0:0:1 */ | 419 | chip = &au1x_ic0_chip; |
380 | au_writel(1 << bit, IC0_CFG2CLR); | 420 | ic = 0; |
381 | au_writel(1 << bit, IC0_CFG1CLR); | 421 | } |
382 | au_writel(1 << bit, IC0_CFG0SET); | 422 | |
383 | set_irq_chip(irq_nr, &rise_edge_irq_type); | 423 | if (bit > 31) |
384 | break; | 424 | return -EINVAL; |
385 | case INTC_INT_FALL_EDGE: /* 0:1:0 */ | 425 | |
386 | au_writel(1 << bit, IC0_CFG2CLR); | 426 | icr[0] = ic ? IC1_CFG0SET : IC0_CFG0SET; |
387 | au_writel(1 << bit, IC0_CFG1SET); | 427 | icr[1] = ic ? IC1_CFG1SET : IC0_CFG1SET; |
388 | au_writel(1 << bit, IC0_CFG0CLR); | 428 | icr[2] = ic ? IC1_CFG2SET : IC0_CFG2SET; |
389 | set_irq_chip(irq_nr, &fall_edge_irq_type); | 429 | icr[3] = ic ? IC1_CFG0CLR : IC0_CFG0CLR; |
390 | break; | 430 | icr[4] = ic ? IC1_CFG1CLR : IC0_CFG1CLR; |
391 | case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ | 431 | icr[5] = ic ? IC1_CFG2CLR : IC0_CFG2CLR; |
392 | au_writel(1 << bit, IC0_CFG2CLR); | 432 | |
393 | au_writel(1 << bit, IC0_CFG1SET); | 433 | ret = 0; |
394 | au_writel(1 << bit, IC0_CFG0SET); | 434 | |
395 | set_irq_chip(irq_nr, &either_edge_irq_type); | 435 | switch (flow_type) { /* cfgregs 2:1:0 */ |
396 | break; | 436 | case IRQ_TYPE_EDGE_RISING: /* 0:0:1 */ |
397 | case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ | 437 | au_writel(1 << bit, icr[5]); |
398 | au_writel(1 << bit, IC0_CFG2SET); | 438 | au_writel(1 << bit, icr[4]); |
399 | au_writel(1 << bit, IC0_CFG1CLR); | 439 | au_writel(1 << bit, icr[0]); |
400 | au_writel(1 << bit, IC0_CFG0SET); | 440 | set_irq_chip_and_handler_name(irq, chip, |
401 | set_irq_chip(irq_nr, &level_irq_type); | 441 | handle_edge_irq, "riseedge"); |
402 | break; | 442 | break; |
403 | case INTC_INT_LOW_LEVEL: /* 1:1:0 */ | 443 | case IRQ_TYPE_EDGE_FALLING: /* 0:1:0 */ |
404 | au_writel(1 << bit, IC0_CFG2SET); | 444 | au_writel(1 << bit, icr[5]); |
405 | au_writel(1 << bit, IC0_CFG1SET); | 445 | au_writel(1 << bit, icr[1]); |
406 | au_writel(1 << bit, IC0_CFG0CLR); | 446 | au_writel(1 << bit, icr[3]); |
407 | set_irq_chip(irq_nr, &level_irq_type); | 447 | set_irq_chip_and_handler_name(irq, chip, |
408 | break; | 448 | handle_edge_irq, "falledge"); |
409 | case INTC_INT_DISABLED: /* 0:0:0 */ | 449 | break; |
410 | au_writel(1 << bit, IC0_CFG0CLR); | 450 | case IRQ_TYPE_EDGE_BOTH: /* 0:1:1 */ |
411 | au_writel(1 << bit, IC0_CFG1CLR); | 451 | au_writel(1 << bit, icr[5]); |
412 | au_writel(1 << bit, IC0_CFG2CLR); | 452 | au_writel(1 << bit, icr[1]); |
413 | break; | 453 | au_writel(1 << bit, icr[0]); |
414 | default: /* disable the interrupt */ | 454 | set_irq_chip_and_handler_name(irq, chip, |
415 | printk(KERN_WARNING "unexpected int type %d (irq %d)\n", | 455 | handle_edge_irq, "bothedge"); |
416 | type, irq_nr); | 456 | break; |
417 | au_writel(1 << bit, IC0_CFG0CLR); | 457 | case IRQ_TYPE_LEVEL_HIGH: /* 1:0:1 */ |
418 | au_writel(1 << bit, IC0_CFG1CLR); | 458 | au_writel(1 << bit, icr[2]); |
419 | au_writel(1 << bit, IC0_CFG2CLR); | 459 | au_writel(1 << bit, icr[4]); |
420 | return; | 460 | au_writel(1 << bit, icr[0]); |
421 | } | 461 | set_irq_chip_and_handler_name(irq, chip, |
422 | if (int_req) /* assign to interrupt request 1 */ | 462 | handle_level_irq, "hilevel"); |
423 | au_writel(1 << bit, IC0_ASSIGNCLR); | 463 | break; |
424 | else /* assign to interrupt request 0 */ | 464 | case IRQ_TYPE_LEVEL_LOW: /* 1:1:0 */ |
425 | au_writel(1 << bit, IC0_ASSIGNSET); | 465 | au_writel(1 << bit, icr[2]); |
426 | au_writel(1 << bit, IC0_SRCSET); | 466 | au_writel(1 << bit, icr[1]); |
427 | au_writel(1 << bit, IC0_MASKCLR); | 467 | au_writel(1 << bit, icr[3]); |
428 | au_writel(1 << bit, IC0_WAKECLR); | 468 | set_irq_chip_and_handler_name(irq, chip, |
469 | handle_level_irq, "lowlevel"); | ||
470 | break; | ||
471 | case IRQ_TYPE_NONE: /* 0:0:0 */ | ||
472 | au_writel(1 << bit, icr[5]); | ||
473 | au_writel(1 << bit, icr[4]); | ||
474 | au_writel(1 << bit, icr[3]); | ||
475 | /* set at least chip so we can call set_irq_type() on it */ | ||
476 | set_irq_chip(irq, chip); | ||
477 | break; | ||
478 | default: | ||
479 | ret = -EINVAL; | ||
429 | } | 480 | } |
430 | au_sync(); | 481 | au_sync(); |
431 | } | ||
432 | 482 | ||
433 | /* | 483 | return ret; |
434 | * Interrupts are nested. Even if an interrupt handler is registered | 484 | } |
435 | * as "fast", we might get another interrupt before we return from | ||
436 | * intcX_reqX_irqdispatch(). | ||
437 | */ | ||
438 | 485 | ||
439 | static void intc0_req0_irqdispatch(void) | 486 | asmlinkage void plat_irq_dispatch(void) |
440 | { | 487 | { |
441 | static unsigned long intc0_req0; | 488 | unsigned int pending = read_c0_status() & read_c0_cause(); |
442 | unsigned int bit; | 489 | unsigned long s, off, bit; |
443 | |||
444 | intc0_req0 |= au_readl(IC0_REQ0INT); | ||
445 | 490 | ||
446 | if (!intc0_req0) | 491 | if (pending & CAUSEF_IP7) { |
492 | do_IRQ(MIPS_CPU_IRQ_BASE + 7); | ||
447 | return; | 493 | return; |
448 | 494 | } else if (pending & CAUSEF_IP2) { | |
495 | s = IC0_REQ0INT; | ||
496 | off = AU1000_INTC0_INT_BASE; | ||
497 | } else if (pending & CAUSEF_IP3) { | ||
498 | s = IC0_REQ1INT; | ||
499 | off = AU1000_INTC0_INT_BASE; | ||
500 | } else if (pending & CAUSEF_IP4) { | ||
501 | s = IC1_REQ0INT; | ||
502 | off = AU1000_INTC1_INT_BASE; | ||
503 | } else if (pending & CAUSEF_IP5) { | ||
504 | s = IC1_REQ1INT; | ||
505 | off = AU1000_INTC1_INT_BASE; | ||
506 | } else | ||
507 | goto spurious; | ||
508 | |||
509 | bit = 0; | ||
510 | s = au_readl(s); | ||
511 | if (unlikely(!s)) { | ||
512 | spurious: | ||
513 | spurious_interrupt(); | ||
514 | return; | ||
515 | } | ||
449 | #ifdef AU1000_USB_DEV_REQ_INT | 516 | #ifdef AU1000_USB_DEV_REQ_INT |
450 | /* | 517 | /* |
451 | * Because of the tight timing of SETUP token to reply | 518 | * Because of the tight timing of SETUP token to reply |
452 | * transactions, the USB devices-side packet complete | 519 | * transactions, the USB devices-side packet complete |
453 | * interrupt needs the highest priority. | 520 | * interrupt needs the highest priority. |
454 | */ | 521 | */ |
455 | if ((intc0_req0 & (1 << AU1000_USB_DEV_REQ_INT))) { | 522 | bit = 1 << (AU1000_USB_DEV_REQ_INT - AU1000_INTC0_INT_BASE); |
456 | intc0_req0 &= ~(1 << AU1000_USB_DEV_REQ_INT); | 523 | if ((pending & CAUSEF_IP2) && (s & bit)) { |
457 | do_IRQ(AU1000_USB_DEV_REQ_INT); | 524 | do_IRQ(AU1000_USB_DEV_REQ_INT); |
458 | return; | 525 | return; |
459 | } | 526 | } |
460 | #endif | 527 | #endif |
461 | bit = __ffs(intc0_req0); | 528 | do_IRQ(__ffs(s) + off); |
462 | intc0_req0 &= ~(1 << bit); | ||
463 | do_IRQ(AU1000_INTC0_INT_BASE + bit); | ||
464 | } | 529 | } |
465 | 530 | ||
466 | 531 | /* setup edge/level and assign request 0/1 */ | |
467 | static void intc0_req1_irqdispatch(void) | 532 | void __init au1xxx_setup_irqmap(struct au1xxx_irqmap *map, int count) |
468 | { | ||
469 | static unsigned long intc0_req1; | ||
470 | unsigned int bit; | ||
471 | |||
472 | intc0_req1 |= au_readl(IC0_REQ1INT); | ||
473 | |||
474 | if (!intc0_req1) | ||
475 | return; | ||
476 | |||
477 | bit = __ffs(intc0_req1); | ||
478 | intc0_req1 &= ~(1 << bit); | ||
479 | do_IRQ(AU1000_INTC0_INT_BASE + bit); | ||
480 | } | ||
481 | |||
482 | |||
483 | /* | ||
484 | * Interrupt Controller 1: | ||
485 | * interrupts 32 - 63 | ||
486 | */ | ||
487 | static void intc1_req0_irqdispatch(void) | ||
488 | { | 533 | { |
489 | static unsigned long intc1_req0; | 534 | unsigned int bit, irq_nr; |
490 | unsigned int bit; | 535 | |
491 | 536 | while (count--) { | |
492 | intc1_req0 |= au_readl(IC1_REQ0INT); | 537 | irq_nr = map[count].im_irq; |
493 | 538 | ||
494 | if (!intc1_req0) | 539 | if (((irq_nr < AU1000_INTC0_INT_BASE) || |
495 | return; | 540 | (irq_nr >= AU1000_INTC0_INT_BASE + 32)) && |
496 | 541 | ((irq_nr < AU1000_INTC1_INT_BASE) || | |
497 | bit = __ffs(intc1_req0); | 542 | (irq_nr >= AU1000_INTC1_INT_BASE + 32))) |
498 | intc1_req0 &= ~(1 << bit); | 543 | continue; |
499 | do_IRQ(AU1000_INTC1_INT_BASE + bit); | 544 | |
500 | } | 545 | if (irq_nr >= AU1000_INTC1_INT_BASE) { |
501 | 546 | bit = irq_nr - AU1000_INTC1_INT_BASE; | |
502 | 547 | if (map[count].im_request) | |
503 | static void intc1_req1_irqdispatch(void) | 548 | au_writel(1 << bit, IC1_ASSIGNCLR); |
504 | { | 549 | } else { |
505 | static unsigned long intc1_req1; | 550 | bit = irq_nr - AU1000_INTC0_INT_BASE; |
506 | unsigned int bit; | 551 | if (map[count].im_request) |
507 | 552 | au_writel(1 << bit, IC0_ASSIGNCLR); | |
508 | intc1_req1 |= au_readl(IC1_REQ1INT); | 553 | } |
509 | |||
510 | if (!intc1_req1) | ||
511 | return; | ||
512 | |||
513 | bit = __ffs(intc1_req1); | ||
514 | intc1_req1 &= ~(1 << bit); | ||
515 | do_IRQ(AU1000_INTC1_INT_BASE + bit); | ||
516 | } | ||
517 | |||
518 | asmlinkage void plat_irq_dispatch(void) | ||
519 | { | ||
520 | unsigned int pending = read_c0_status() & read_c0_cause(); | ||
521 | 554 | ||
522 | if (pending & CAUSEF_IP7) | 555 | au1x_ic_settype(irq_nr, map[count].im_type); |
523 | do_IRQ(MIPS_CPU_IRQ_BASE + 7); | 556 | } |
524 | else if (pending & CAUSEF_IP2) | ||
525 | intc0_req0_irqdispatch(); | ||
526 | else if (pending & CAUSEF_IP3) | ||
527 | intc0_req1_irqdispatch(); | ||
528 | else if (pending & CAUSEF_IP4) | ||
529 | intc1_req0_irqdispatch(); | ||
530 | else if (pending & CAUSEF_IP5) | ||
531 | intc1_req1_irqdispatch(); | ||
532 | else | ||
533 | spurious_interrupt(); | ||
534 | } | 557 | } |
535 | 558 | ||
536 | void __init arch_init_irq(void) | 559 | void __init arch_init_irq(void) |
537 | { | 560 | { |
538 | int i; | 561 | int i; |
539 | struct au1xxx_irqmap *imp; | ||
540 | extern struct au1xxx_irqmap au1xxx_irq_map[]; | ||
541 | extern struct au1xxx_irqmap au1xxx_ic0_map[]; | ||
542 | extern int au1xxx_nr_irqs; | ||
543 | extern int au1xxx_ic0_nr_irqs; | ||
544 | 562 | ||
545 | /* | 563 | /* |
546 | * Initialize interrupt controllers to a safe state. | 564 | * Initialize interrupt controllers to a safe state. |
@@ -569,28 +587,25 @@ void __init arch_init_irq(void) | |||
569 | 587 | ||
570 | mips_cpu_irq_init(); | 588 | mips_cpu_irq_init(); |
571 | 589 | ||
572 | /* | 590 | /* register all 64 possible IC0+IC1 irq sources as type "none". |
573 | * Initialize IC0, which is fixed per processor. | 591 | * Use set_irq_type() to set edge/level behaviour at runtime. |
574 | */ | 592 | */ |
575 | imp = au1xxx_ic0_map; | 593 | for (i = AU1000_INTC0_INT_BASE; |
576 | for (i = 0; i < au1xxx_ic0_nr_irqs; i++) { | 594 | (i < AU1000_INTC0_INT_BASE + 32); i++) |
577 | setup_local_irq(imp->im_irq, imp->im_type, imp->im_request); | 595 | au1x_ic_settype(i, IRQ_TYPE_NONE); |
578 | imp++; | 596 | |
579 | } | 597 | for (i = AU1000_INTC1_INT_BASE; |
598 | (i < AU1000_INTC1_INT_BASE + 32); i++) | ||
599 | au1x_ic_settype(i, IRQ_TYPE_NONE); | ||
580 | 600 | ||
581 | /* | 601 | /* |
582 | * Now set up the irq mapping for the board. | 602 | * Initialize IC0, which is fixed per processor. |
583 | */ | 603 | */ |
584 | imp = au1xxx_irq_map; | 604 | au1xxx_setup_irqmap(au1xxx_ic0_map, ARRAY_SIZE(au1xxx_ic0_map)); |
585 | for (i = 0; i < au1xxx_nr_irqs; i++) { | ||
586 | setup_local_irq(imp->im_irq, imp->im_type, imp->im_request); | ||
587 | imp++; | ||
588 | } | ||
589 | |||
590 | set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4); | ||
591 | 605 | ||
592 | /* Board specific IRQ initialization. | 606 | /* Boards can register additional (GPIO-based) IRQs. |
593 | */ | 607 | */ |
594 | if (board_init_irq) | 608 | board_init_irq(); |
595 | board_init_irq(); | 609 | |
610 | set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3); | ||
596 | } | 611 | } |
diff --git a/arch/mips/alchemy/common/power.c b/arch/mips/alchemy/common/power.c index bd854a6d1d89..6ab7b42aa1be 100644 --- a/arch/mips/alchemy/common/power.c +++ b/arch/mips/alchemy/common/power.c | |||
@@ -35,25 +35,12 @@ | |||
35 | #include <linux/jiffies.h> | 35 | #include <linux/jiffies.h> |
36 | 36 | ||
37 | #include <asm/uaccess.h> | 37 | #include <asm/uaccess.h> |
38 | #include <asm/cacheflush.h> | ||
39 | #include <asm/mach-au1x00/au1000.h> | 38 | #include <asm/mach-au1x00/au1000.h> |
40 | 39 | #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) | |
41 | #ifdef CONFIG_PM | 40 | #include <asm/mach-au1x00/au1xxx_dbdma.h> |
42 | |||
43 | #define DEBUG 1 | ||
44 | #ifdef DEBUG | ||
45 | #define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__, ## args) | ||
46 | #else | ||
47 | #define DPRINTK(fmt, args...) | ||
48 | #endif | 41 | #endif |
49 | 42 | ||
50 | static void au1000_calibrate_delay(void); | 43 | #ifdef CONFIG_PM |
51 | |||
52 | extern unsigned long save_local_and_disable(int controller); | ||
53 | extern void restore_local_and_enable(int controller, unsigned long mask); | ||
54 | extern void local_enable_irq(unsigned int irq_nr); | ||
55 | |||
56 | static DEFINE_SPINLOCK(pm_lock); | ||
57 | 44 | ||
58 | /* | 45 | /* |
59 | * We need to save/restore a bunch of core registers that are | 46 | * We need to save/restore a bunch of core registers that are |
@@ -65,29 +52,16 @@ static DEFINE_SPINLOCK(pm_lock); | |||
65 | * We only have to save/restore registers that aren't otherwise | 52 | * We only have to save/restore registers that aren't otherwise |
66 | * done as part of a driver pm_* function. | 53 | * done as part of a driver pm_* function. |
67 | */ | 54 | */ |
68 | static unsigned int sleep_aux_pll_cntrl; | 55 | static unsigned int sleep_uart0_inten; |
69 | static unsigned int sleep_cpu_pll_cntrl; | 56 | static unsigned int sleep_uart0_fifoctl; |
70 | static unsigned int sleep_pin_function; | 57 | static unsigned int sleep_uart0_linectl; |
71 | static unsigned int sleep_uart0_inten; | 58 | static unsigned int sleep_uart0_clkdiv; |
72 | static unsigned int sleep_uart0_fifoctl; | 59 | static unsigned int sleep_uart0_enable; |
73 | static unsigned int sleep_uart0_linectl; | 60 | static unsigned int sleep_usb[2]; |
74 | static unsigned int sleep_uart0_clkdiv; | 61 | static unsigned int sleep_sys_clocks[5]; |
75 | static unsigned int sleep_uart0_enable; | 62 | static unsigned int sleep_sys_pinfunc; |
76 | static unsigned int sleep_usbhost_enable; | 63 | static unsigned int sleep_static_memctlr[4][3]; |
77 | static unsigned int sleep_usbdev_enable; | ||
78 | static unsigned int sleep_static_memctlr[4][3]; | ||
79 | 64 | ||
80 | /* | ||
81 | * Define this to cause the value you write to /proc/sys/pm/sleep to | ||
82 | * set the TOY timer for the amount of time you want to sleep. | ||
83 | * This is done mainly for testing, but may be useful in other cases. | ||
84 | * The value is number of 32KHz ticks to sleep. | ||
85 | */ | ||
86 | #define SLEEP_TEST_TIMEOUT 1 | ||
87 | #ifdef SLEEP_TEST_TIMEOUT | ||
88 | static int sleep_ticks; | ||
89 | void wakeup_counter0_set(int ticks); | ||
90 | #endif | ||
91 | 65 | ||
92 | static void save_core_regs(void) | 66 | static void save_core_regs(void) |
93 | { | 67 | { |
@@ -105,31 +79,45 @@ static void save_core_regs(void) | |||
105 | sleep_uart0_linectl = au_readl(UART0_ADDR + UART_LCR); | 79 | sleep_uart0_linectl = au_readl(UART0_ADDR + UART_LCR); |
106 | sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK); | 80 | sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK); |
107 | sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL); | 81 | sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL); |
82 | au_sync(); | ||
108 | 83 | ||
84 | #ifndef CONFIG_SOC_AU1200 | ||
109 | /* Shutdown USB host/device. */ | 85 | /* Shutdown USB host/device. */ |
110 | sleep_usbhost_enable = au_readl(USB_HOST_CONFIG); | 86 | sleep_usb[0] = au_readl(USB_HOST_CONFIG); |
111 | 87 | ||
112 | /* There appears to be some undocumented reset register.... */ | 88 | /* There appears to be some undocumented reset register.... */ |
113 | au_writel(0, 0xb0100004); au_sync(); | 89 | au_writel(0, 0xb0100004); |
114 | au_writel(0, USB_HOST_CONFIG); au_sync(); | 90 | au_sync(); |
91 | au_writel(0, USB_HOST_CONFIG); | ||
92 | au_sync(); | ||
115 | 93 | ||
116 | sleep_usbdev_enable = au_readl(USBD_ENABLE); | 94 | sleep_usb[1] = au_readl(USBD_ENABLE); |
117 | au_writel(0, USBD_ENABLE); au_sync(); | 95 | au_writel(0, USBD_ENABLE); |
96 | au_sync(); | ||
97 | |||
98 | #else /* AU1200 */ | ||
99 | |||
100 | /* enable access to OTG mmio so we can save OTG CAP/MUX. | ||
101 | * FIXME: write an OTG driver and move this stuff there! | ||
102 | */ | ||
103 | au_writel(au_readl(USB_MSR_BASE + 4) | (1 << 6), USB_MSR_BASE + 4); | ||
104 | au_sync(); | ||
105 | sleep_usb[0] = au_readl(0xb4020020); /* OTG_CAP */ | ||
106 | sleep_usb[1] = au_readl(0xb4020024); /* OTG_MUX */ | ||
107 | #endif | ||
118 | 108 | ||
119 | /* Save interrupt controller state. */ | 109 | /* Save interrupt controller state. */ |
120 | save_au1xxx_intctl(); | 110 | save_au1xxx_intctl(); |
121 | 111 | ||
122 | /* Clocks and PLLs. */ | 112 | /* Clocks and PLLs. */ |
123 | sleep_aux_pll_cntrl = au_readl(SYS_AUXPLL); | 113 | sleep_sys_clocks[0] = au_readl(SYS_FREQCTRL0); |
114 | sleep_sys_clocks[1] = au_readl(SYS_FREQCTRL1); | ||
115 | sleep_sys_clocks[2] = au_readl(SYS_CLKSRC); | ||
116 | sleep_sys_clocks[3] = au_readl(SYS_CPUPLL); | ||
117 | sleep_sys_clocks[4] = au_readl(SYS_AUXPLL); | ||
124 | 118 | ||
125 | /* | 119 | /* pin mux config */ |
126 | * We don't really need to do this one, but unless we | 120 | sleep_sys_pinfunc = au_readl(SYS_PINFUNC); |
127 | * write it again it won't have a valid value if we | ||
128 | * happen to read it. | ||
129 | */ | ||
130 | sleep_cpu_pll_cntrl = au_readl(SYS_CPUPLL); | ||
131 | |||
132 | sleep_pin_function = au_readl(SYS_PINFUNC); | ||
133 | 121 | ||
134 | /* Save the static memory controller configuration. */ | 122 | /* Save the static memory controller configuration. */ |
135 | sleep_static_memctlr[0][0] = au_readl(MEM_STCFG0); | 123 | sleep_static_memctlr[0][0] = au_readl(MEM_STCFG0); |
@@ -144,16 +132,45 @@ static void save_core_regs(void) | |||
144 | sleep_static_memctlr[3][0] = au_readl(MEM_STCFG3); | 132 | sleep_static_memctlr[3][0] = au_readl(MEM_STCFG3); |
145 | sleep_static_memctlr[3][1] = au_readl(MEM_STTIME3); | 133 | sleep_static_memctlr[3][1] = au_readl(MEM_STTIME3); |
146 | sleep_static_memctlr[3][2] = au_readl(MEM_STADDR3); | 134 | sleep_static_memctlr[3][2] = au_readl(MEM_STADDR3); |
135 | |||
136 | #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) | ||
137 | au1xxx_dbdma_suspend(); | ||
138 | #endif | ||
147 | } | 139 | } |
148 | 140 | ||
149 | static void restore_core_regs(void) | 141 | static void restore_core_regs(void) |
150 | { | 142 | { |
151 | extern void restore_au1xxx_intctl(void); | 143 | /* restore clock configuration. Writing CPUPLL last will |
152 | extern void wakeup_counter0_adjust(void); | 144 | * stall a bit and stabilize other clocks (unless this is |
145 | * one of those Au1000 with a write-only PLL, where we dont | ||
146 | * have a valid value) | ||
147 | */ | ||
148 | au_writel(sleep_sys_clocks[0], SYS_FREQCTRL0); | ||
149 | au_writel(sleep_sys_clocks[1], SYS_FREQCTRL1); | ||
150 | au_writel(sleep_sys_clocks[2], SYS_CLKSRC); | ||
151 | au_writel(sleep_sys_clocks[4], SYS_AUXPLL); | ||
152 | if (!au1xxx_cpu_has_pll_wo()) | ||
153 | au_writel(sleep_sys_clocks[3], SYS_CPUPLL); | ||
154 | au_sync(); | ||
153 | 155 | ||
154 | au_writel(sleep_aux_pll_cntrl, SYS_AUXPLL); au_sync(); | 156 | au_writel(sleep_sys_pinfunc, SYS_PINFUNC); |
155 | au_writel(sleep_cpu_pll_cntrl, SYS_CPUPLL); au_sync(); | 157 | au_sync(); |
156 | au_writel(sleep_pin_function, SYS_PINFUNC); au_sync(); | 158 | |
159 | #ifndef CONFIG_SOC_AU1200 | ||
160 | au_writel(sleep_usb[0], USB_HOST_CONFIG); | ||
161 | au_writel(sleep_usb[1], USBD_ENABLE); | ||
162 | au_sync(); | ||
163 | #else | ||
164 | /* enable accces to OTG memory */ | ||
165 | au_writel(au_readl(USB_MSR_BASE + 4) | (1 << 6), USB_MSR_BASE + 4); | ||
166 | au_sync(); | ||
167 | |||
168 | /* restore OTG caps and port mux. */ | ||
169 | au_writel(sleep_usb[0], 0xb4020020 + 0); /* OTG_CAP */ | ||
170 | au_sync(); | ||
171 | au_writel(sleep_usb[1], 0xb4020020 + 4); /* OTG_MUX */ | ||
172 | au_sync(); | ||
173 | #endif | ||
157 | 174 | ||
158 | /* Restore the static memory controller configuration. */ | 175 | /* Restore the static memory controller configuration. */ |
159 | au_writel(sleep_static_memctlr[0][0], MEM_STCFG0); | 176 | au_writel(sleep_static_memctlr[0][0], MEM_STCFG0); |
@@ -184,282 +201,17 @@ static void restore_core_regs(void) | |||
184 | } | 201 | } |
185 | 202 | ||
186 | restore_au1xxx_intctl(); | 203 | restore_au1xxx_intctl(); |
187 | wakeup_counter0_adjust(); | ||
188 | } | ||
189 | |||
190 | unsigned long suspend_mode; | ||
191 | 204 | ||
192 | void wakeup_from_suspend(void) | 205 | #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) |
193 | { | 206 | au1xxx_dbdma_resume(); |
194 | suspend_mode = 0; | 207 | #endif |
195 | } | 208 | } |
196 | 209 | ||
197 | int au_sleep(void) | 210 | void au_sleep(void) |
198 | { | 211 | { |
199 | unsigned long wakeup, flags; | ||
200 | extern void save_and_sleep(void); | ||
201 | |||
202 | spin_lock_irqsave(&pm_lock, flags); | ||
203 | |||
204 | save_core_regs(); | 212 | save_core_regs(); |
205 | 213 | au1xxx_save_and_sleep(); | |
206 | flush_cache_all(); | ||
207 | |||
208 | /** | ||
209 | ** The code below is all system dependent and we should probably | ||
210 | ** have a function call out of here to set this up. You need | ||
211 | ** to configure the GPIO or timer interrupts that will bring | ||
212 | ** you out of sleep. | ||
213 | ** For testing, the TOY counter wakeup is useful. | ||
214 | **/ | ||
215 | #if 0 | ||
216 | au_writel(au_readl(SYS_PINSTATERD) & ~(1 << 11), SYS_PINSTATERD); | ||
217 | |||
218 | /* GPIO 6 can cause a wake up event */ | ||
219 | wakeup = au_readl(SYS_WAKEMSK); | ||
220 | wakeup &= ~(1 << 8); /* turn off match20 wakeup */ | ||
221 | wakeup |= 1 << 6; /* turn on GPIO 6 wakeup */ | ||
222 | #else | ||
223 | /* For testing, allow match20 to wake us up. */ | ||
224 | #ifdef SLEEP_TEST_TIMEOUT | ||
225 | wakeup_counter0_set(sleep_ticks); | ||
226 | #endif | ||
227 | wakeup = 1 << 8; /* turn on match20 wakeup */ | ||
228 | wakeup = 0; | ||
229 | #endif | ||
230 | au_writel(1, SYS_WAKESRC); /* clear cause */ | ||
231 | au_sync(); | ||
232 | au_writel(wakeup, SYS_WAKEMSK); | ||
233 | au_sync(); | ||
234 | |||
235 | save_and_sleep(); | ||
236 | |||
237 | /* | ||
238 | * After a wakeup, the cpu vectors back to 0x1fc00000, so | ||
239 | * it's up to the boot code to get us back here. | ||
240 | */ | ||
241 | restore_core_regs(); | 214 | restore_core_regs(); |
242 | spin_unlock_irqrestore(&pm_lock, flags); | ||
243 | return 0; | ||
244 | } | ||
245 | |||
246 | static int pm_do_sleep(ctl_table *ctl, int write, struct file *file, | ||
247 | void __user *buffer, size_t *len, loff_t *ppos) | ||
248 | { | ||
249 | #ifdef SLEEP_TEST_TIMEOUT | ||
250 | #define TMPBUFLEN2 16 | ||
251 | char buf[TMPBUFLEN2], *p; | ||
252 | #endif | ||
253 | |||
254 | if (!write) | ||
255 | *len = 0; | ||
256 | else { | ||
257 | #ifdef SLEEP_TEST_TIMEOUT | ||
258 | if (*len > TMPBUFLEN2 - 1) | ||
259 | return -EFAULT; | ||
260 | if (copy_from_user(buf, buffer, *len)) | ||
261 | return -EFAULT; | ||
262 | buf[*len] = 0; | ||
263 | p = buf; | ||
264 | sleep_ticks = simple_strtoul(p, &p, 0); | ||
265 | #endif | ||
266 | |||
267 | au_sleep(); | ||
268 | } | ||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | static int pm_do_freq(ctl_table *ctl, int write, struct file *file, | ||
273 | void __user *buffer, size_t *len, loff_t *ppos) | ||
274 | { | ||
275 | int retval = 0, i; | ||
276 | unsigned long val, pll; | ||
277 | #define TMPBUFLEN 64 | ||
278 | #define MAX_CPU_FREQ 396 | ||
279 | char buf[TMPBUFLEN], *p; | ||
280 | unsigned long flags, intc0_mask, intc1_mask; | ||
281 | unsigned long old_baud_base, old_cpu_freq, old_clk, old_refresh; | ||
282 | unsigned long new_baud_base, new_cpu_freq, new_clk, new_refresh; | ||
283 | unsigned long baud_rate; | ||
284 | |||
285 | spin_lock_irqsave(&pm_lock, flags); | ||
286 | if (!write) | ||
287 | *len = 0; | ||
288 | else { | ||
289 | /* Parse the new frequency */ | ||
290 | if (*len > TMPBUFLEN - 1) { | ||
291 | spin_unlock_irqrestore(&pm_lock, flags); | ||
292 | return -EFAULT; | ||
293 | } | ||
294 | if (copy_from_user(buf, buffer, *len)) { | ||
295 | spin_unlock_irqrestore(&pm_lock, flags); | ||
296 | return -EFAULT; | ||
297 | } | ||
298 | buf[*len] = 0; | ||
299 | p = buf; | ||
300 | val = simple_strtoul(p, &p, 0); | ||
301 | if (val > MAX_CPU_FREQ) { | ||
302 | spin_unlock_irqrestore(&pm_lock, flags); | ||
303 | return -EFAULT; | ||
304 | } | ||
305 | |||
306 | pll = val / 12; | ||
307 | if ((pll > 33) || (pll < 7)) { /* 396 MHz max, 84 MHz min */ | ||
308 | /* Revisit this for higher speed CPUs */ | ||
309 | spin_unlock_irqrestore(&pm_lock, flags); | ||
310 | return -EFAULT; | ||
311 | } | ||
312 | |||
313 | old_baud_base = get_au1x00_uart_baud_base(); | ||
314 | old_cpu_freq = get_au1x00_speed(); | ||
315 | |||
316 | new_cpu_freq = pll * 12 * 1000000; | ||
317 | new_baud_base = (new_cpu_freq / (2 * ((int)(au_readl(SYS_POWERCTRL) | ||
318 | & 0x03) + 2) * 16)); | ||
319 | set_au1x00_speed(new_cpu_freq); | ||
320 | set_au1x00_uart_baud_base(new_baud_base); | ||
321 | |||
322 | old_refresh = au_readl(MEM_SDREFCFG) & 0x1ffffff; | ||
323 | new_refresh = ((old_refresh * new_cpu_freq) / old_cpu_freq) | | ||
324 | (au_readl(MEM_SDREFCFG) & ~0x1ffffff); | ||
325 | |||
326 | au_writel(pll, SYS_CPUPLL); | ||
327 | au_sync_delay(1); | ||
328 | au_writel(new_refresh, MEM_SDREFCFG); | ||
329 | au_sync_delay(1); | ||
330 | |||
331 | for (i = 0; i < 4; i++) | ||
332 | if (au_readl(UART_BASE + UART_MOD_CNTRL + | ||
333 | i * 0x00100000) == 3) { | ||
334 | old_clk = au_readl(UART_BASE + UART_CLK + | ||
335 | i * 0x00100000); | ||
336 | baud_rate = old_baud_base / old_clk; | ||
337 | /* | ||
338 | * We won't get an exact baud rate and the error | ||
339 | * could be significant enough that our new | ||
340 | * calculation will result in a clock that will | ||
341 | * give us a baud rate that's too far off from | ||
342 | * what we really want. | ||
343 | */ | ||
344 | if (baud_rate > 100000) | ||
345 | baud_rate = 115200; | ||
346 | else if (baud_rate > 50000) | ||
347 | baud_rate = 57600; | ||
348 | else if (baud_rate > 30000) | ||
349 | baud_rate = 38400; | ||
350 | else if (baud_rate > 17000) | ||
351 | baud_rate = 19200; | ||
352 | else | ||
353 | baud_rate = 9600; | ||
354 | new_clk = new_baud_base / baud_rate; | ||
355 | au_writel(new_clk, UART_BASE + UART_CLK + | ||
356 | i * 0x00100000); | ||
357 | au_sync_delay(10); | ||
358 | } | ||
359 | } | ||
360 | |||
361 | /* | ||
362 | * We don't want _any_ interrupts other than match20. Otherwise our | ||
363 | * au1000_calibrate_delay() calculation will be off, potentially a lot. | ||
364 | */ | ||
365 | intc0_mask = save_local_and_disable(0); | ||
366 | intc1_mask = save_local_and_disable(1); | ||
367 | local_enable_irq(AU1000_TOY_MATCH2_INT); | ||
368 | spin_unlock_irqrestore(&pm_lock, flags); | ||
369 | au1000_calibrate_delay(); | ||
370 | restore_local_and_enable(0, intc0_mask); | ||
371 | restore_local_and_enable(1, intc1_mask); | ||
372 | |||
373 | return retval; | ||
374 | } | 215 | } |
375 | 216 | ||
376 | |||
377 | static struct ctl_table pm_table[] = { | ||
378 | { | ||
379 | .ctl_name = CTL_UNNUMBERED, | ||
380 | .procname = "sleep", | ||
381 | .data = NULL, | ||
382 | .maxlen = 0, | ||
383 | .mode = 0600, | ||
384 | .proc_handler = &pm_do_sleep | ||
385 | }, | ||
386 | { | ||
387 | .ctl_name = CTL_UNNUMBERED, | ||
388 | .procname = "freq", | ||
389 | .data = NULL, | ||
390 | .maxlen = 0, | ||
391 | .mode = 0600, | ||
392 | .proc_handler = &pm_do_freq | ||
393 | }, | ||
394 | {} | ||
395 | }; | ||
396 | |||
397 | static struct ctl_table pm_dir_table[] = { | ||
398 | { | ||
399 | .ctl_name = CTL_UNNUMBERED, | ||
400 | .procname = "pm", | ||
401 | .mode = 0555, | ||
402 | .child = pm_table | ||
403 | }, | ||
404 | {} | ||
405 | }; | ||
406 | |||
407 | /* | ||
408 | * Initialize power interface | ||
409 | */ | ||
410 | static int __init pm_init(void) | ||
411 | { | ||
412 | register_sysctl_table(pm_dir_table); | ||
413 | return 0; | ||
414 | } | ||
415 | |||
416 | __initcall(pm_init); | ||
417 | |||
418 | /* | ||
419 | * This is right out of init/main.c | ||
420 | */ | ||
421 | |||
422 | /* | ||
423 | * This is the number of bits of precision for the loops_per_jiffy. | ||
424 | * Each bit takes on average 1.5/HZ seconds. This (like the original) | ||
425 | * is a little better than 1%. | ||
426 | */ | ||
427 | #define LPS_PREC 8 | ||
428 | |||
429 | static void au1000_calibrate_delay(void) | ||
430 | { | ||
431 | unsigned long ticks, loopbit; | ||
432 | int lps_precision = LPS_PREC; | ||
433 | |||
434 | loops_per_jiffy = 1 << 12; | ||
435 | |||
436 | while (loops_per_jiffy <<= 1) { | ||
437 | /* Wait for "start of" clock tick */ | ||
438 | ticks = jiffies; | ||
439 | while (ticks == jiffies) | ||
440 | /* nothing */ ; | ||
441 | /* Go ... */ | ||
442 | ticks = jiffies; | ||
443 | __delay(loops_per_jiffy); | ||
444 | ticks = jiffies - ticks; | ||
445 | if (ticks) | ||
446 | break; | ||
447 | } | ||
448 | |||
449 | /* | ||
450 | * Do a binary approximation to get loops_per_jiffy set to be equal | ||
451 | * one clock (up to lps_precision bits) | ||
452 | */ | ||
453 | loops_per_jiffy >>= 1; | ||
454 | loopbit = loops_per_jiffy; | ||
455 | while (lps_precision-- && (loopbit >>= 1)) { | ||
456 | loops_per_jiffy |= loopbit; | ||
457 | ticks = jiffies; | ||
458 | while (ticks == jiffies); | ||
459 | ticks = jiffies; | ||
460 | __delay(loops_per_jiffy); | ||
461 | if (jiffies != ticks) /* longer than 1 tick */ | ||
462 | loops_per_jiffy &= ~loopbit; | ||
463 | } | ||
464 | } | ||
465 | #endif /* CONFIG_PM */ | 217 | #endif /* CONFIG_PM */ |
diff --git a/arch/mips/alchemy/common/reset.c b/arch/mips/alchemy/common/reset.c index d555429c8d6f..0191c936cb5e 100644 --- a/arch/mips/alchemy/common/reset.c +++ b/arch/mips/alchemy/common/reset.c | |||
@@ -31,8 +31,6 @@ | |||
31 | 31 | ||
32 | #include <asm/mach-au1x00/au1000.h> | 32 | #include <asm/mach-au1x00/au1000.h> |
33 | 33 | ||
34 | extern int au_sleep(void); | ||
35 | |||
36 | void au1000_restart(char *command) | 34 | void au1000_restart(char *command) |
37 | { | 35 | { |
38 | /* Set all integrated peripherals to disabled states */ | 36 | /* Set all integrated peripherals to disabled states */ |
diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c index 1ac6b06f42a3..3f036b3d400e 100644 --- a/arch/mips/alchemy/common/setup.c +++ b/arch/mips/alchemy/common/setup.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <asm/time.h> | 35 | #include <asm/time.h> |
36 | 36 | ||
37 | #include <au1000.h> | 37 | #include <au1000.h> |
38 | #include <prom.h> | ||
39 | 38 | ||
40 | extern void __init board_setup(void); | 39 | extern void __init board_setup(void); |
41 | extern void au1000_restart(char *); | 40 | extern void au1000_restart(char *); |
@@ -45,80 +44,34 @@ extern void set_cpuspec(void); | |||
45 | 44 | ||
46 | void __init plat_mem_setup(void) | 45 | void __init plat_mem_setup(void) |
47 | { | 46 | { |
48 | struct cpu_spec *sp; | 47 | unsigned long est_freq; |
49 | char *argptr; | ||
50 | unsigned long prid, cpufreq, bclk; | ||
51 | 48 | ||
52 | set_cpuspec(); | 49 | /* determine core clock */ |
53 | sp = cur_cpu_spec[0]; | 50 | est_freq = au1xxx_calc_clock(); |
51 | est_freq += 5000; /* round */ | ||
52 | est_freq -= est_freq % 10000; | ||
53 | printk(KERN_INFO "(PRId %08x) @ %lu.%02lu MHz\n", read_c0_prid(), | ||
54 | est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000); | ||
54 | 55 | ||
55 | board_setup(); /* board specific setup */ | 56 | _machine_restart = au1000_restart; |
56 | 57 | _machine_halt = au1000_halt; | |
57 | prid = read_c0_prid(); | 58 | pm_power_off = au1000_power_off; |
58 | if (sp->cpu_pll_wo) | ||
59 | #ifdef CONFIG_SOC_AU1000_FREQUENCY | ||
60 | cpufreq = CONFIG_SOC_AU1000_FREQUENCY / 1000000; | ||
61 | #else | ||
62 | cpufreq = 396; | ||
63 | #endif | ||
64 | else | ||
65 | cpufreq = (au_readl(SYS_CPUPLL) & 0x3F) * 12; | ||
66 | printk(KERN_INFO "(PRID %08lx) @ %ld MHz\n", prid, cpufreq); | ||
67 | 59 | ||
68 | if (sp->cpu_bclk) { | 60 | board_setup(); /* board specific setup */ |
69 | /* Enable BCLK switching */ | ||
70 | bclk = au_readl(SYS_POWERCTRL); | ||
71 | au_writel(bclk | 0x60, SYS_POWERCTRL); | ||
72 | printk(KERN_INFO "BCLK switching enabled!\n"); | ||
73 | } | ||
74 | 61 | ||
75 | if (sp->cpu_od) | 62 | if (au1xxx_cpu_needs_config_od()) |
76 | /* Various early Au1xx0 errata corrected by this */ | 63 | /* Various early Au1xx0 errata corrected by this */ |
77 | set_c0_config(1 << 19); /* Set Config[OD] */ | 64 | set_c0_config(1 << 19); /* Set Config[OD] */ |
78 | else | 65 | else |
79 | /* Clear to obtain best system bus performance */ | 66 | /* Clear to obtain best system bus performance */ |
80 | clear_c0_config(1 << 19); /* Clear Config[OD] */ | 67 | clear_c0_config(1 << 19); /* Clear Config[OD] */ |
81 | 68 | ||
82 | argptr = prom_getcmdline(); | ||
83 | |||
84 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
85 | argptr = strstr(argptr, "console="); | ||
86 | if (argptr == NULL) { | ||
87 | argptr = prom_getcmdline(); | ||
88 | strcat(argptr, " console=ttyS0,115200"); | ||
89 | } | ||
90 | #endif | ||
91 | |||
92 | #ifdef CONFIG_FB_AU1100 | ||
93 | argptr = strstr(argptr, "video="); | ||
94 | if (argptr == NULL) { | ||
95 | argptr = prom_getcmdline(); | ||
96 | /* default panel */ | ||
97 | /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/ | ||
98 | } | ||
99 | #endif | ||
100 | |||
101 | #if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) | ||
102 | /* au1000 does not support vra, au1500 and au1100 do */ | ||
103 | strcat(argptr, " au1000_audio=vra"); | ||
104 | argptr = prom_getcmdline(); | ||
105 | #endif | ||
106 | _machine_restart = au1000_restart; | ||
107 | _machine_halt = au1000_halt; | ||
108 | pm_power_off = au1000_power_off; | ||
109 | |||
110 | /* IO/MEM resources. */ | 69 | /* IO/MEM resources. */ |
111 | set_io_port_base(0); | 70 | set_io_port_base(0); |
112 | ioport_resource.start = IOPORT_RESOURCE_START; | 71 | ioport_resource.start = IOPORT_RESOURCE_START; |
113 | ioport_resource.end = IOPORT_RESOURCE_END; | 72 | ioport_resource.end = IOPORT_RESOURCE_END; |
114 | iomem_resource.start = IOMEM_RESOURCE_START; | 73 | iomem_resource.start = IOMEM_RESOURCE_START; |
115 | iomem_resource.end = IOMEM_RESOURCE_END; | 74 | iomem_resource.end = IOMEM_RESOURCE_END; |
116 | |||
117 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_E0S); | ||
118 | au_writel(SYS_CNTRL_E0 | SYS_CNTRL_EN0, SYS_COUNTER_CNTRL); | ||
119 | au_sync(); | ||
120 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S); | ||
121 | au_writel(0, SYS_TOYTRIM); | ||
122 | } | 75 | } |
123 | 76 | ||
124 | #if defined(CONFIG_64BIT_PHYS_ADDR) | 77 | #if defined(CONFIG_64BIT_PHYS_ADDR) |
diff --git a/arch/mips/alchemy/common/sleeper.S b/arch/mips/alchemy/common/sleeper.S index 3006e270c8bc..4f4b16741d12 100644 --- a/arch/mips/alchemy/common/sleeper.S +++ b/arch/mips/alchemy/common/sleeper.S | |||
@@ -15,16 +15,17 @@ | |||
15 | #include <asm/regdef.h> | 15 | #include <asm/regdef.h> |
16 | #include <asm/stackframe.h> | 16 | #include <asm/stackframe.h> |
17 | 17 | ||
18 | .extern __flush_cache_all | ||
19 | |||
18 | .text | 20 | .text |
19 | .set macro | 21 | .set noreorder |
20 | .set noat | 22 | .set noat |
21 | .align 5 | 23 | .align 5 |
22 | 24 | ||
23 | /* Save all of the processor general registers and go to sleep. | 25 | /* Save all of the processor general registers and go to sleep. |
24 | * A wakeup condition will get us back here to restore the registers. | 26 | * A wakeup condition will get us back here to restore the registers. |
25 | */ | 27 | */ |
26 | LEAF(save_and_sleep) | 28 | LEAF(au1xxx_save_and_sleep) |
27 | |||
28 | subu sp, PT_SIZE | 29 | subu sp, PT_SIZE |
29 | sw $1, PT_R1(sp) | 30 | sw $1, PT_R1(sp) |
30 | sw $2, PT_R2(sp) | 31 | sw $2, PT_R2(sp) |
@@ -33,14 +34,6 @@ LEAF(save_and_sleep) | |||
33 | sw $5, PT_R5(sp) | 34 | sw $5, PT_R5(sp) |
34 | sw $6, PT_R6(sp) | 35 | sw $6, PT_R6(sp) |
35 | sw $7, PT_R7(sp) | 36 | sw $7, PT_R7(sp) |
36 | sw $8, PT_R8(sp) | ||
37 | sw $9, PT_R9(sp) | ||
38 | sw $10, PT_R10(sp) | ||
39 | sw $11, PT_R11(sp) | ||
40 | sw $12, PT_R12(sp) | ||
41 | sw $13, PT_R13(sp) | ||
42 | sw $14, PT_R14(sp) | ||
43 | sw $15, PT_R15(sp) | ||
44 | sw $16, PT_R16(sp) | 37 | sw $16, PT_R16(sp) |
45 | sw $17, PT_R17(sp) | 38 | sw $17, PT_R17(sp) |
46 | sw $18, PT_R18(sp) | 39 | sw $18, PT_R18(sp) |
@@ -49,12 +42,9 @@ LEAF(save_and_sleep) | |||
49 | sw $21, PT_R21(sp) | 42 | sw $21, PT_R21(sp) |
50 | sw $22, PT_R22(sp) | 43 | sw $22, PT_R22(sp) |
51 | sw $23, PT_R23(sp) | 44 | sw $23, PT_R23(sp) |
52 | sw $24, PT_R24(sp) | ||
53 | sw $25, PT_R25(sp) | ||
54 | sw $26, PT_R26(sp) | 45 | sw $26, PT_R26(sp) |
55 | sw $27, PT_R27(sp) | 46 | sw $27, PT_R27(sp) |
56 | sw $28, PT_R28(sp) | 47 | sw $28, PT_R28(sp) |
57 | sw $29, PT_R29(sp) | ||
58 | sw $30, PT_R30(sp) | 48 | sw $30, PT_R30(sp) |
59 | sw $31, PT_R31(sp) | 49 | sw $31, PT_R31(sp) |
60 | mfc0 k0, CP0_STATUS | 50 | mfc0 k0, CP0_STATUS |
@@ -66,20 +56,26 @@ LEAF(save_and_sleep) | |||
66 | mfc0 k0, CP0_CONFIG | 56 | mfc0 k0, CP0_CONFIG |
67 | sw k0, 0x14(sp) | 57 | sw k0, 0x14(sp) |
68 | 58 | ||
59 | /* flush caches to make sure context is in memory */ | ||
60 | la t1, __flush_cache_all | ||
61 | lw t0, 0(t1) | ||
62 | jalr t0 | ||
63 | nop | ||
64 | |||
69 | /* Now set up the scratch registers so the boot rom will | 65 | /* Now set up the scratch registers so the boot rom will |
70 | * return to this point upon wakeup. | 66 | * return to this point upon wakeup. |
67 | * sys_scratch0 : SP | ||
68 | * sys_scratch1 : RA | ||
71 | */ | 69 | */ |
72 | la k0, 1f | 70 | lui t3, 0xb190 /* sys_xxx */ |
73 | lui k1, 0xb190 | 71 | sw sp, 0x0018(t3) |
74 | ori k1, 0x18 | 72 | la k0, 3f /* resume path */ |
75 | sw sp, 0(k1) | 73 | sw k0, 0x001c(t3) |
76 | ori k1, 0x1c | ||
77 | sw k0, 0(k1) | ||
78 | 74 | ||
79 | /* Put SDRAM into self refresh. Preload instructions into cache, | 75 | /* Put SDRAM into self refresh: Preload instructions into cache, |
80 | * issue a precharge, then auto refresh, then sleep commands to it. | 76 | * issue a precharge, auto/self refresh, then sleep commands to it. |
81 | */ | 77 | */ |
82 | la t0, sdsleep | 78 | la t0, 1f |
83 | .set mips3 | 79 | .set mips3 |
84 | cache 0x14, 0(t0) | 80 | cache 0x14, 0(t0) |
85 | cache 0x14, 32(t0) | 81 | cache 0x14, 32(t0) |
@@ -87,24 +83,57 @@ LEAF(save_and_sleep) | |||
87 | cache 0x14, 96(t0) | 83 | cache 0x14, 96(t0) |
88 | .set mips0 | 84 | .set mips0 |
89 | 85 | ||
90 | sdsleep: | 86 | 1: lui a0, 0xb400 /* mem_xxx */ |
91 | lui k0, 0xb400 | 87 | #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100) || \ |
92 | sw zero, 0x001c(k0) /* Precharge */ | 88 | defined(CONFIG_SOC_AU1500) |
93 | sw zero, 0x0020(k0) /* Auto refresh */ | 89 | sw zero, 0x001c(a0) /* Precharge */ |
94 | sw zero, 0x0030(k0) /* SDRAM sleep */ | 90 | sync |
91 | sw zero, 0x0020(a0) /* Auto Refresh */ | ||
92 | sync | ||
93 | sw zero, 0x0030(a0) /* Sleep */ | ||
94 | sync | ||
95 | #endif | ||
96 | |||
97 | #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) | ||
98 | sw zero, 0x08c0(a0) /* Precharge */ | ||
95 | sync | 99 | sync |
100 | sw zero, 0x08d0(a0) /* Self Refresh */ | ||
101 | sync | ||
102 | |||
103 | /* wait for sdram to enter self-refresh mode */ | ||
104 | lui t0, 0x0100 | ||
105 | 2: lw t1, 0x0850(a0) /* mem_sdstat */ | ||
106 | and t2, t1, t0 | ||
107 | beq t2, zero, 2b | ||
108 | nop | ||
96 | 109 | ||
97 | lui k1, 0xb190 | 110 | /* disable SDRAM clocks */ |
98 | sw zero, 0x0078(k1) /* get ready to sleep */ | 111 | lui t0, 0xcfff |
112 | ori t0, t0, 0xffff | ||
113 | lw t1, 0x0840(a0) /* mem_sdconfiga */ | ||
114 | and t1, t0, t1 /* clear CE[1:0] */ | ||
115 | sw t1, 0x0840(a0) /* mem_sdconfiga */ | ||
99 | sync | 116 | sync |
100 | sw zero, 0x007c(k1) /* Put processor to sleep */ | 117 | #endif |
118 | |||
119 | /* put power supply and processor to sleep */ | ||
120 | sw zero, 0x0078(t3) /* sys_slppwr */ | ||
121 | sync | ||
122 | sw zero, 0x007c(t3) /* sys_sleep */ | ||
101 | sync | 123 | sync |
124 | nop | ||
125 | nop | ||
126 | nop | ||
127 | nop | ||
128 | nop | ||
129 | nop | ||
130 | nop | ||
131 | nop | ||
102 | 132 | ||
103 | /* This is where we return upon wakeup. | 133 | /* This is where we return upon wakeup. |
104 | * Reload all of the registers and return. | 134 | * Reload all of the registers and return. |
105 | */ | 135 | */ |
106 | 1: nop | 136 | 3: lw k0, 0x20(sp) |
107 | lw k0, 0x20(sp) | ||
108 | mtc0 k0, CP0_STATUS | 137 | mtc0 k0, CP0_STATUS |
109 | lw k0, 0x1c(sp) | 138 | lw k0, 0x1c(sp) |
110 | mtc0 k0, CP0_CONTEXT | 139 | mtc0 k0, CP0_CONTEXT |
@@ -113,10 +142,11 @@ sdsleep: | |||
113 | lw k0, 0x14(sp) | 142 | lw k0, 0x14(sp) |
114 | mtc0 k0, CP0_CONFIG | 143 | mtc0 k0, CP0_CONFIG |
115 | 144 | ||
116 | /* We need to catch the ealry Alchemy SOCs with | 145 | /* We need to catch the early Alchemy SOCs with |
117 | * the write-only Config[OD] bit and set it back to one... | 146 | * the write-only Config[OD] bit and set it back to one... |
118 | */ | 147 | */ |
119 | jal au1x00_fixup_config_od | 148 | jal au1x00_fixup_config_od |
149 | nop | ||
120 | lw $1, PT_R1(sp) | 150 | lw $1, PT_R1(sp) |
121 | lw $2, PT_R2(sp) | 151 | lw $2, PT_R2(sp) |
122 | lw $3, PT_R3(sp) | 152 | lw $3, PT_R3(sp) |
@@ -124,14 +154,6 @@ sdsleep: | |||
124 | lw $5, PT_R5(sp) | 154 | lw $5, PT_R5(sp) |
125 | lw $6, PT_R6(sp) | 155 | lw $6, PT_R6(sp) |
126 | lw $7, PT_R7(sp) | 156 | lw $7, PT_R7(sp) |
127 | lw $8, PT_R8(sp) | ||
128 | lw $9, PT_R9(sp) | ||
129 | lw $10, PT_R10(sp) | ||
130 | lw $11, PT_R11(sp) | ||
131 | lw $12, PT_R12(sp) | ||
132 | lw $13, PT_R13(sp) | ||
133 | lw $14, PT_R14(sp) | ||
134 | lw $15, PT_R15(sp) | ||
135 | lw $16, PT_R16(sp) | 157 | lw $16, PT_R16(sp) |
136 | lw $17, PT_R17(sp) | 158 | lw $17, PT_R17(sp) |
137 | lw $18, PT_R18(sp) | 159 | lw $18, PT_R18(sp) |
@@ -140,15 +162,11 @@ sdsleep: | |||
140 | lw $21, PT_R21(sp) | 162 | lw $21, PT_R21(sp) |
141 | lw $22, PT_R22(sp) | 163 | lw $22, PT_R22(sp) |
142 | lw $23, PT_R23(sp) | 164 | lw $23, PT_R23(sp) |
143 | lw $24, PT_R24(sp) | ||
144 | lw $25, PT_R25(sp) | ||
145 | lw $26, PT_R26(sp) | 165 | lw $26, PT_R26(sp) |
146 | lw $27, PT_R27(sp) | 166 | lw $27, PT_R27(sp) |
147 | lw $28, PT_R28(sp) | 167 | lw $28, PT_R28(sp) |
148 | lw $29, PT_R29(sp) | ||
149 | lw $30, PT_R30(sp) | 168 | lw $30, PT_R30(sp) |
150 | lw $31, PT_R31(sp) | 169 | lw $31, PT_R31(sp) |
151 | addiu sp, PT_SIZE | ||
152 | |||
153 | jr ra | 170 | jr ra |
154 | END(save_and_sleep) | 171 | addiu sp, PT_SIZE |
172 | END(au1xxx_save_and_sleep) | ||
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c index 563d9390a872..32880146cbc1 100644 --- a/arch/mips/alchemy/common/time.c +++ b/arch/mips/alchemy/common/time.c | |||
@@ -1,5 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2008 Manuel Lauss <mano@roarinelk.homelinux.net> | ||
2 | * | 3 | * |
4 | * Previous incarnations were: | ||
3 | * Copyright (C) 2001, 2006, 2008 MontaVista Software, <source@mvista.com> | 5 | * Copyright (C) 2001, 2006, 2008 MontaVista Software, <source@mvista.com> |
4 | * Copied and modified Carsten Langgaard's time.c | 6 | * Copied and modified Carsten Langgaard's time.c |
5 | * | 7 | * |
@@ -23,244 +25,141 @@ | |||
23 | * | 25 | * |
24 | * ######################################################################## | 26 | * ######################################################################## |
25 | * | 27 | * |
26 | * Setting up the clock on the MIPS boards. | 28 | * Clocksource/event using the 32.768kHz-clocked Counter1 ('RTC' in the |
27 | * | 29 | * databooks). Firmware/Board init code must enable the counters in the |
28 | * We provide the clock interrupt processing and the timer offset compute | 30 | * counter control register, otherwise the CP0 counter clocksource/event |
29 | * functions. If CONFIG_PM is selected, we also ensure the 32KHz timer is | 31 | * will be installed instead (and use of 'wait' instruction is prohibited). |
30 | * available. -- Dan | ||
31 | */ | 32 | */ |
32 | 33 | ||
33 | #include <linux/types.h> | 34 | #include <linux/clockchips.h> |
34 | #include <linux/init.h> | 35 | #include <linux/clocksource.h> |
36 | #include <linux/interrupt.h> | ||
35 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
36 | 38 | ||
37 | #include <asm/mipsregs.h> | ||
38 | #include <asm/time.h> | 39 | #include <asm/time.h> |
39 | #include <asm/mach-au1x00/au1000.h> | 40 | #include <asm/mach-au1x00/au1000.h> |
40 | 41 | ||
41 | static int no_au1xxx_32khz; | 42 | /* 32kHz clock enabled and detected */ |
42 | extern int allow_au1k_wait; /* default off for CP0 Counter */ | 43 | #define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S) |
43 | |||
44 | #ifdef CONFIG_PM | ||
45 | #if HZ < 100 || HZ > 1000 | ||
46 | #error "unsupported HZ value! Must be in [100,1000]" | ||
47 | #endif | ||
48 | #define MATCH20_INC (328 * 100 / HZ) /* magic number 328 is for HZ=100... */ | ||
49 | static unsigned long last_pc0, last_match20; | ||
50 | #endif | ||
51 | 44 | ||
52 | static DEFINE_SPINLOCK(time_lock); | 45 | extern int allow_au1k_wait; /* default off for CP0 Counter */ |
53 | |||
54 | unsigned long wtimer; | ||
55 | 46 | ||
56 | #ifdef CONFIG_PM | 47 | static cycle_t au1x_counter1_read(void) |
57 | static irqreturn_t counter0_irq(int irq, void *dev_id) | ||
58 | { | 48 | { |
59 | unsigned long pc0; | 49 | return au_readl(SYS_RTCREAD); |
60 | int time_elapsed; | ||
61 | static int jiffie_drift; | ||
62 | |||
63 | if (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20) { | ||
64 | /* should never happen! */ | ||
65 | printk(KERN_WARNING "counter 0 w status error\n"); | ||
66 | return IRQ_NONE; | ||
67 | } | ||
68 | |||
69 | pc0 = au_readl(SYS_TOYREAD); | ||
70 | if (pc0 < last_match20) | ||
71 | /* counter overflowed */ | ||
72 | time_elapsed = (0xffffffff - last_match20) + pc0; | ||
73 | else | ||
74 | time_elapsed = pc0 - last_match20; | ||
75 | |||
76 | while (time_elapsed > 0) { | ||
77 | do_timer(1); | ||
78 | #ifndef CONFIG_SMP | ||
79 | update_process_times(user_mode(get_irq_regs())); | ||
80 | #endif | ||
81 | time_elapsed -= MATCH20_INC; | ||
82 | last_match20 += MATCH20_INC; | ||
83 | jiffie_drift++; | ||
84 | } | ||
85 | |||
86 | last_pc0 = pc0; | ||
87 | au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2); | ||
88 | au_sync(); | ||
89 | |||
90 | /* | ||
91 | * Our counter ticks at 10.009765625 ms/tick, we we're running | ||
92 | * almost 10 uS too slow per tick. | ||
93 | */ | ||
94 | |||
95 | if (jiffie_drift >= 999) { | ||
96 | jiffie_drift -= 999; | ||
97 | do_timer(1); /* increment jiffies by one */ | ||
98 | #ifndef CONFIG_SMP | ||
99 | update_process_times(user_mode(get_irq_regs())); | ||
100 | #endif | ||
101 | } | ||
102 | |||
103 | return IRQ_HANDLED; | ||
104 | } | 50 | } |
105 | 51 | ||
106 | struct irqaction counter0_action = { | 52 | static struct clocksource au1x_counter1_clocksource = { |
107 | .handler = counter0_irq, | 53 | .name = "alchemy-counter1", |
108 | .flags = IRQF_DISABLED, | 54 | .read = au1x_counter1_read, |
109 | .name = "alchemy-toy", | 55 | .mask = CLOCKSOURCE_MASK(32), |
110 | .dev_id = NULL, | 56 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
57 | .rating = 100, | ||
111 | }; | 58 | }; |
112 | 59 | ||
113 | /* When we wakeup from sleep, we have to "catch up" on all of the | 60 | static int au1x_rtcmatch2_set_next_event(unsigned long delta, |
114 | * timer ticks we have missed. | 61 | struct clock_event_device *cd) |
115 | */ | ||
116 | void wakeup_counter0_adjust(void) | ||
117 | { | 62 | { |
118 | unsigned long pc0; | 63 | delta += au_readl(SYS_RTCREAD); |
119 | int time_elapsed; | 64 | /* wait for register access */ |
120 | 65 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M21) | |
121 | pc0 = au_readl(SYS_TOYREAD); | 66 | ; |
122 | if (pc0 < last_match20) | 67 | au_writel(delta, SYS_RTCMATCH2); |
123 | /* counter overflowed */ | ||
124 | time_elapsed = (0xffffffff - last_match20) + pc0; | ||
125 | else | ||
126 | time_elapsed = pc0 - last_match20; | ||
127 | |||
128 | while (time_elapsed > 0) { | ||
129 | time_elapsed -= MATCH20_INC; | ||
130 | last_match20 += MATCH20_INC; | ||
131 | } | ||
132 | |||
133 | last_pc0 = pc0; | ||
134 | au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2); | ||
135 | au_sync(); | 68 | au_sync(); |
136 | 69 | ||
70 | return 0; | ||
137 | } | 71 | } |
138 | 72 | ||
139 | /* This is just for debugging to set the timer for a sleep delay. */ | 73 | static void au1x_rtcmatch2_set_mode(enum clock_event_mode mode, |
140 | void wakeup_counter0_set(int ticks) | 74 | struct clock_event_device *cd) |
141 | { | 75 | { |
142 | unsigned long pc0; | ||
143 | |||
144 | pc0 = au_readl(SYS_TOYREAD); | ||
145 | last_pc0 = pc0; | ||
146 | au_writel(last_match20 + (MATCH20_INC * ticks), SYS_TOYMATCH2); | ||
147 | au_sync(); | ||
148 | } | 76 | } |
149 | #endif | ||
150 | 77 | ||
151 | /* | 78 | static irqreturn_t au1x_rtcmatch2_irq(int irq, void *dev_id) |
152 | * I haven't found anyone that doesn't use a 12 MHz source clock, | ||
153 | * but just in case..... | ||
154 | */ | ||
155 | #define AU1000_SRC_CLK 12000000 | ||
156 | |||
157 | /* | ||
158 | * We read the real processor speed from the PLL. This is important | ||
159 | * because it is more accurate than computing it from the 32 KHz | ||
160 | * counter, if it exists. If we don't have an accurate processor | ||
161 | * speed, all of the peripherals that derive their clocks based on | ||
162 | * this advertised speed will introduce error and sometimes not work | ||
163 | * properly. This function is futher convoluted to still allow configurations | ||
164 | * to do that in case they have really, really old silicon with a | ||
165 | * write-only PLL register, that we need the 32 KHz when power management | ||
166 | * "wait" is enabled, and we need to detect if the 32 KHz isn't present | ||
167 | * but requested......got it? :-) -- Dan | ||
168 | */ | ||
169 | unsigned long calc_clock(void) | ||
170 | { | 79 | { |
171 | unsigned long cpu_speed; | 80 | struct clock_event_device *cd = dev_id; |
172 | unsigned long flags; | 81 | cd->event_handler(cd); |
173 | unsigned long counter; | 82 | return IRQ_HANDLED; |
174 | 83 | } | |
175 | spin_lock_irqsave(&time_lock, flags); | ||
176 | |||
177 | /* Power management cares if we don't have a 32 KHz counter. */ | ||
178 | no_au1xxx_32khz = 0; | ||
179 | counter = au_readl(SYS_COUNTER_CNTRL); | ||
180 | if (counter & SYS_CNTRL_E0) { | ||
181 | int trim_divide = 16; | ||
182 | |||
183 | au_writel(counter | SYS_CNTRL_EN1, SYS_COUNTER_CNTRL); | ||
184 | |||
185 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S); | ||
186 | /* RTC now ticks at 32.768/16 kHz */ | ||
187 | au_writel(trim_divide - 1, SYS_RTCTRIM); | ||
188 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S); | ||
189 | 84 | ||
190 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); | 85 | static struct clock_event_device au1x_rtcmatch2_clockdev = { |
191 | au_writel(0, SYS_TOYWRITE); | 86 | .name = "rtcmatch2", |
192 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); | 87 | .features = CLOCK_EVT_FEAT_ONESHOT, |
193 | } else | 88 | .rating = 100, |
194 | no_au1xxx_32khz = 1; | 89 | .irq = AU1000_RTC_MATCH2_INT, |
90 | .set_next_event = au1x_rtcmatch2_set_next_event, | ||
91 | .set_mode = au1x_rtcmatch2_set_mode, | ||
92 | .cpumask = CPU_MASK_ALL, | ||
93 | }; | ||
195 | 94 | ||
196 | /* | 95 | static struct irqaction au1x_rtcmatch2_irqaction = { |
197 | * On early Au1000, sys_cpupll was write-only. Since these | 96 | .handler = au1x_rtcmatch2_irq, |
198 | * silicon versions of Au1000 are not sold by AMD, we don't bend | 97 | .flags = IRQF_DISABLED | IRQF_TIMER, |
199 | * over backwards trying to determine the frequency. | 98 | .name = "timer", |
200 | */ | 99 | .dev_id = &au1x_rtcmatch2_clockdev, |
201 | if (cur_cpu_spec[0]->cpu_pll_wo) | 100 | }; |
202 | #ifdef CONFIG_SOC_AU1000_FREQUENCY | ||
203 | cpu_speed = CONFIG_SOC_AU1000_FREQUENCY; | ||
204 | #else | ||
205 | cpu_speed = 396000000; | ||
206 | #endif | ||
207 | else | ||
208 | cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK; | ||
209 | /* On Alchemy CPU:counter ratio is 1:1 */ | ||
210 | mips_hpt_frequency = cpu_speed; | ||
211 | /* Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16) */ | ||
212 | set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL) | ||
213 | & 0x03) + 2) * 16)); | ||
214 | spin_unlock_irqrestore(&time_lock, flags); | ||
215 | return cpu_speed; | ||
216 | } | ||
217 | 101 | ||
218 | void __init plat_time_init(void) | 102 | void __init plat_time_init(void) |
219 | { | 103 | { |
220 | unsigned int est_freq = calc_clock(); | 104 | struct clock_event_device *cd = &au1x_rtcmatch2_clockdev; |
221 | 105 | unsigned long t; | |
222 | est_freq += 5000; /* round */ | 106 | |
223 | est_freq -= est_freq%10000; | 107 | /* Check if firmware (YAMON, ...) has enabled 32kHz and clock |
224 | printk(KERN_INFO "CPU frequency %u.%02u MHz\n", | 108 | * has been detected. If so install the rtcmatch2 clocksource, |
225 | est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000); | 109 | * otherwise don't bother. Note that both bits being set is by |
226 | set_au1x00_speed(est_freq); | 110 | * no means a definite guarantee that the counters actually work |
227 | set_au1x00_lcd_clock(); /* program the LCD clock */ | 111 | * (the 32S bit seems to be stuck set to 1 once a single clock- |
112 | * edge is detected, hence the timeouts). | ||
113 | */ | ||
114 | if (CNTR_OK != (au_readl(SYS_COUNTER_CNTRL) & CNTR_OK)) | ||
115 | goto cntr_err; | ||
228 | 116 | ||
229 | #ifdef CONFIG_PM | ||
230 | /* | 117 | /* |
231 | * setup counter 0, since it keeps ticking after a | 118 | * setup counter 1 (RTC) to tick at full speed |
232 | * 'wait' instruction has been executed. The CP0 timer and | ||
233 | * counter 1 do NOT continue running after 'wait' | ||
234 | * | ||
235 | * It's too early to call request_irq() here, so we handle | ||
236 | * counter 0 interrupt as a special irq and it doesn't show | ||
237 | * up under /proc/interrupts. | ||
238 | * | ||
239 | * Check to ensure we really have a 32 KHz oscillator before | ||
240 | * we do this. | ||
241 | */ | 119 | */ |
242 | if (no_au1xxx_32khz) | 120 | t = 0xffffff; |
243 | printk(KERN_WARNING "WARNING: no 32KHz clock found.\n"); | 121 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && t--) |
244 | else { | 122 | asm volatile ("nop"); |
245 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S); | 123 | if (!t) |
246 | au_writel(0, SYS_TOYWRITE); | 124 | goto cntr_err; |
247 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S); | ||
248 | |||
249 | au_writel(au_readl(SYS_WAKEMSK) | (1 << 8), SYS_WAKEMSK); | ||
250 | au_writel(~0, SYS_WAKESRC); | ||
251 | au_sync(); | ||
252 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20); | ||
253 | 125 | ||
254 | /* Setup match20 to interrupt once every HZ */ | 126 | au_writel(0, SYS_RTCTRIM); /* 32.768 kHz */ |
255 | last_pc0 = last_match20 = au_readl(SYS_TOYREAD); | 127 | au_sync(); |
256 | au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2); | ||
257 | au_sync(); | ||
258 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20); | ||
259 | setup_irq(AU1000_TOY_MATCH2_INT, &counter0_action); | ||
260 | 128 | ||
261 | /* We can use the real 'wait' instruction. */ | 129 | t = 0xffffff; |
262 | allow_au1k_wait = 1; | 130 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--) |
263 | } | 131 | asm volatile ("nop"); |
132 | if (!t) | ||
133 | goto cntr_err; | ||
134 | au_writel(0, SYS_RTCWRITE); | ||
135 | au_sync(); | ||
264 | 136 | ||
265 | #endif | 137 | t = 0xffffff; |
138 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--) | ||
139 | asm volatile ("nop"); | ||
140 | if (!t) | ||
141 | goto cntr_err; | ||
142 | |||
143 | /* register counter1 clocksource and event device */ | ||
144 | clocksource_set_clock(&au1x_counter1_clocksource, 32768); | ||
145 | clocksource_register(&au1x_counter1_clocksource); | ||
146 | |||
147 | cd->shift = 32; | ||
148 | cd->mult = div_sc(32768, NSEC_PER_SEC, cd->shift); | ||
149 | cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd); | ||
150 | cd->min_delta_ns = clockevent_delta2ns(8, cd); /* ~0.25ms */ | ||
151 | clockevents_register_device(cd); | ||
152 | setup_irq(AU1000_RTC_MATCH2_INT, &au1x_rtcmatch2_irqaction); | ||
153 | |||
154 | printk(KERN_INFO "Alchemy clocksource installed\n"); | ||
155 | |||
156 | /* can now use 'wait' */ | ||
157 | allow_au1k_wait = 1; | ||
158 | return; | ||
159 | |||
160 | cntr_err: | ||
161 | /* counters unusable, use C0 counter */ | ||
162 | r4k_clockevent_init(); | ||
163 | init_r4k_clocksource(); | ||
164 | allow_au1k_wait = 0; | ||
266 | } | 165 | } |
diff --git a/arch/mips/alchemy/db1x00/init.c b/arch/mips/alchemy/db1x00/init.c deleted file mode 100644 index 847413514964..000000000000 --- a/arch/mips/alchemy/db1x00/init.c +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * PB1000 board setup | ||
4 | * | ||
5 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
6 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | #include <linux/kernel.h> | ||
31 | |||
32 | #include <asm/bootinfo.h> | ||
33 | |||
34 | #include <prom.h> | ||
35 | |||
36 | const char *get_system_type(void) | ||
37 | { | ||
38 | #ifdef CONFIG_MIPS_BOSPORUS | ||
39 | return "Alchemy Bosporus Gateway Reference"; | ||
40 | #else | ||
41 | return "Alchemy Db1x00"; | ||
42 | #endif | ||
43 | } | ||
44 | |||
45 | void __init prom_init(void) | ||
46 | { | ||
47 | unsigned char *memsize_str; | ||
48 | unsigned long memsize; | ||
49 | |||
50 | prom_argc = fw_arg0; | ||
51 | prom_argv = (char **)fw_arg1; | ||
52 | prom_envp = (char **)fw_arg2; | ||
53 | |||
54 | prom_init_cmdline(); | ||
55 | |||
56 | memsize_str = prom_getenv("memsize"); | ||
57 | if (!memsize_str) | ||
58 | memsize = 0x04000000; | ||
59 | else | ||
60 | strict_strtol(memsize_str, 0, &memsize); | ||
61 | add_memory_region(0, memsize, BOOT_MEM_RAM); | ||
62 | } | ||
diff --git a/arch/mips/alchemy/devboards/Makefile b/arch/mips/alchemy/devboards/Makefile new file mode 100644 index 000000000000..730f9f2b30e8 --- /dev/null +++ b/arch/mips/alchemy/devboards/Makefile | |||
@@ -0,0 +1,18 @@ | |||
1 | # | ||
2 | # Alchemy Develboards | ||
3 | # | ||
4 | |||
5 | obj-y += prom.o | ||
6 | obj-$(CONFIG_PM) += pm.o | ||
7 | obj-$(CONFIG_MIPS_PB1000) += pb1000/ | ||
8 | obj-$(CONFIG_MIPS_PB1100) += pb1100/ | ||
9 | obj-$(CONFIG_MIPS_PB1200) += pb1200/ | ||
10 | obj-$(CONFIG_MIPS_PB1500) += pb1500/ | ||
11 | obj-$(CONFIG_MIPS_PB1550) += pb1550/ | ||
12 | obj-$(CONFIG_MIPS_DB1000) += db1x00/ | ||
13 | obj-$(CONFIG_MIPS_DB1100) += db1x00/ | ||
14 | obj-$(CONFIG_MIPS_DB1200) += pb1200/ | ||
15 | obj-$(CONFIG_MIPS_DB1500) += db1x00/ | ||
16 | obj-$(CONFIG_MIPS_DB1550) += db1x00/ | ||
17 | obj-$(CONFIG_MIPS_BOSPORUS) += db1x00/ | ||
18 | obj-$(CONFIG_MIPS_MIRAGE) += db1x00/ | ||
diff --git a/arch/mips/alchemy/db1x00/Makefile b/arch/mips/alchemy/devboards/db1x00/Makefile index 274db3b55d82..432241ab8677 100644 --- a/arch/mips/alchemy/db1x00/Makefile +++ b/arch/mips/alchemy/devboards/db1x00/Makefile | |||
@@ -5,4 +5,4 @@ | |||
5 | # Makefile for the Alchemy Semiconductor DBAu1xx0 boards. | 5 | # Makefile for the Alchemy Semiconductor DBAu1xx0 boards. |
6 | # | 6 | # |
7 | 7 | ||
8 | lib-y := init.o board_setup.o irqmap.o | 8 | obj-y := board_setup.o irqmap.o |
diff --git a/arch/mips/alchemy/db1x00/board_setup.c b/arch/mips/alchemy/devboards/db1x00/board_setup.c index 9e5ccbbfcedd..a75ffbf99f25 100644 --- a/arch/mips/alchemy/db1x00/board_setup.c +++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c | |||
@@ -32,8 +32,20 @@ | |||
32 | #include <asm/mach-au1x00/au1000.h> | 32 | #include <asm/mach-au1x00/au1000.h> |
33 | #include <asm/mach-db1x00/db1x00.h> | 33 | #include <asm/mach-db1x00/db1x00.h> |
34 | 34 | ||
35 | #include <prom.h> | ||
36 | |||
37 | |||
35 | static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | 38 | static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; |
36 | 39 | ||
40 | const char *get_system_type(void) | ||
41 | { | ||
42 | #ifdef CONFIG_MIPS_BOSPORUS | ||
43 | return "Alchemy Bosporus Gateway Reference"; | ||
44 | #else | ||
45 | return "Alchemy Db1x00"; | ||
46 | #endif | ||
47 | } | ||
48 | |||
37 | void board_reset(void) | 49 | void board_reset(void) |
38 | { | 50 | { |
39 | /* Hit BCSR.SW_RESET[RESET] */ | 51 | /* Hit BCSR.SW_RESET[RESET] */ |
@@ -43,6 +55,31 @@ void board_reset(void) | |||
43 | void __init board_setup(void) | 55 | void __init board_setup(void) |
44 | { | 56 | { |
45 | u32 pin_func = 0; | 57 | u32 pin_func = 0; |
58 | char *argptr; | ||
59 | |||
60 | argptr = prom_getcmdline(); | ||
61 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
62 | argptr = strstr(argptr, "console="); | ||
63 | if (argptr == NULL) { | ||
64 | argptr = prom_getcmdline(); | ||
65 | strcat(argptr, " console=ttyS0,115200"); | ||
66 | } | ||
67 | #endif | ||
68 | |||
69 | #ifdef CONFIG_FB_AU1100 | ||
70 | argptr = strstr(argptr, "video="); | ||
71 | if (argptr == NULL) { | ||
72 | argptr = prom_getcmdline(); | ||
73 | /* default panel */ | ||
74 | /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/ | ||
75 | } | ||
76 | #endif | ||
77 | |||
78 | #if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) | ||
79 | /* au1000 does not support vra, au1500 and au1100 do */ | ||
80 | strcat(argptr, " au1000_audio=vra"); | ||
81 | argptr = prom_getcmdline(); | ||
82 | #endif | ||
46 | 83 | ||
47 | /* Not valid for Au1550 */ | 84 | /* Not valid for Au1550 */ |
48 | #if defined(CONFIG_IRDA) && \ | 85 | #if defined(CONFIG_IRDA) && \ |
diff --git a/arch/mips/alchemy/db1x00/irqmap.c b/arch/mips/alchemy/devboards/db1x00/irqmap.c index 94c090e8bf7a..0b09025087c6 100644 --- a/arch/mips/alchemy/db1x00/irqmap.c +++ b/arch/mips/alchemy/devboards/db1x00/irqmap.c | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <linux/interrupt.h> | ||
30 | 31 | ||
31 | #include <asm/mach-au1x00/au1000.h> | 32 | #include <asm/mach-au1x00/au1000.h> |
32 | 33 | ||
@@ -66,21 +67,24 @@ struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | |||
66 | 67 | ||
67 | #ifndef CONFIG_MIPS_MIRAGE | 68 | #ifndef CONFIG_MIPS_MIRAGE |
68 | #ifdef CONFIG_MIPS_DB1550 | 69 | #ifdef CONFIG_MIPS_DB1550 |
69 | { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 IRQ# */ | 70 | { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 IRQ# */ |
70 | { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 IRQ# */ | 71 | { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 IRQ# */ |
71 | #else | 72 | #else |
72 | { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 Fully_Interted# */ | 73 | { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 Fully_Interted# */ |
73 | { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 STSCHG# */ | 74 | { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 STSCHG# */ |
74 | { AU1000_GPIO_2, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 IRQ# */ | 75 | { AU1000_GPIO_2, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 IRQ# */ |
75 | 76 | ||
76 | { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 Fully_Interted# */ | 77 | { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 Fully_Interted# */ |
77 | { AU1000_GPIO_4, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 STSCHG# */ | 78 | { AU1000_GPIO_4, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 STSCHG# */ |
78 | { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 IRQ# */ | 79 | { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 IRQ# */ |
79 | #endif | 80 | #endif |
80 | #else | 81 | #else |
81 | { AU1000_GPIO_7, INTC_INT_RISE_EDGE, 0 }, /* touchscreen pen down */ | 82 | { AU1000_GPIO_7, IRQF_TRIGGER_RISING, 0 }, /* touchscreen pen down */ |
82 | #endif | 83 | #endif |
83 | 84 | ||
84 | }; | 85 | }; |
85 | 86 | ||
86 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | 87 | void __init board_init_irq(void) |
88 | { | ||
89 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
90 | } | ||
diff --git a/arch/mips/alchemy/pb1000/Makefile b/arch/mips/alchemy/devboards/pb1000/Makefile index 99bbec0ca41b..97c6615ba2bb 100644 --- a/arch/mips/alchemy/pb1000/Makefile +++ b/arch/mips/alchemy/devboards/pb1000/Makefile | |||
@@ -5,4 +5,4 @@ | |||
5 | # Makefile for the Alchemy Semiconductor Pb1000 board. | 5 | # Makefile for the Alchemy Semiconductor Pb1000 board. |
6 | # | 6 | # |
7 | 7 | ||
8 | lib-y := init.o board_setup.o irqmap.o | 8 | obj-y := board_setup.o |
diff --git a/arch/mips/alchemy/pb1000/board_setup.c b/arch/mips/alchemy/devboards/pb1000/board_setup.c index 25df167a95b3..aed2fdecc709 100644 --- a/arch/mips/alchemy/pb1000/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1000/board_setup.c | |||
@@ -23,22 +23,48 @@ | |||
23 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/init.h> | ||
27 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
28 | 27 | #include <linux/init.h> | |
28 | #include <linux/interrupt.h> | ||
29 | #include <asm/mach-au1x00/au1000.h> | 29 | #include <asm/mach-au1x00/au1000.h> |
30 | #include <asm/mach-pb1x00/pb1000.h> | 30 | #include <asm/mach-pb1x00/pb1000.h> |
31 | #include <prom.h> | ||
32 | |||
33 | |||
34 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
35 | { AU1000_GPIO_15, IRQF_TRIGGER_LOW, 0 }, | ||
36 | }; | ||
37 | |||
38 | |||
39 | const char *get_system_type(void) | ||
40 | { | ||
41 | return "Alchemy Pb1000"; | ||
42 | } | ||
31 | 43 | ||
32 | void board_reset(void) | 44 | void board_reset(void) |
33 | { | 45 | { |
34 | } | 46 | } |
35 | 47 | ||
48 | void __init board_init_irq(void) | ||
49 | { | ||
50 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
51 | } | ||
52 | |||
36 | void __init board_setup(void) | 53 | void __init board_setup(void) |
37 | { | 54 | { |
38 | u32 pin_func, static_cfg0; | 55 | u32 pin_func, static_cfg0; |
39 | u32 sys_freqctrl, sys_clksrc; | 56 | u32 sys_freqctrl, sys_clksrc; |
40 | u32 prid = read_c0_prid(); | 57 | u32 prid = read_c0_prid(); |
41 | 58 | ||
59 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
60 | char *argptr = prom_getcmdline(); | ||
61 | argptr = strstr(argptr, "console="); | ||
62 | if (argptr == NULL) { | ||
63 | argptr = prom_getcmdline(); | ||
64 | strcat(argptr, " console=ttyS0,115200"); | ||
65 | } | ||
66 | #endif | ||
67 | |||
42 | /* Set AUX clock to 12 MHz * 8 = 96 MHz */ | 68 | /* Set AUX clock to 12 MHz * 8 = 96 MHz */ |
43 | au_writel(8, SYS_AUXPLL); | 69 | au_writel(8, SYS_AUXPLL); |
44 | au_writel(0, SYS_PINSTATERD); | 70 | au_writel(0, SYS_PINSTATERD); |
diff --git a/arch/mips/alchemy/pb1100/Makefile b/arch/mips/alchemy/devboards/pb1100/Makefile index 793e97c49e46..c586dd7e91dc 100644 --- a/arch/mips/alchemy/pb1100/Makefile +++ b/arch/mips/alchemy/devboards/pb1100/Makefile | |||
@@ -5,4 +5,4 @@ | |||
5 | # Makefile for the Alchemy Semiconductor Pb1100 board. | 5 | # Makefile for the Alchemy Semiconductor Pb1100 board. |
6 | # | 6 | # |
7 | 7 | ||
8 | lib-y := init.o board_setup.o irqmap.o | 8 | obj-y := board_setup.o |
diff --git a/arch/mips/alchemy/pb1100/board_setup.c b/arch/mips/alchemy/devboards/pb1100/board_setup.c index c0bfd59a7a36..4df57fae15d4 100644 --- a/arch/mips/alchemy/pb1100/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1100/board_setup.c | |||
@@ -25,19 +25,66 @@ | |||
25 | 25 | ||
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/interrupt.h> | ||
28 | 29 | ||
29 | #include <asm/mach-au1x00/au1000.h> | 30 | #include <asm/mach-au1x00/au1000.h> |
30 | #include <asm/mach-pb1x00/pb1100.h> | 31 | #include <asm/mach-pb1x00/pb1100.h> |
31 | 32 | ||
33 | #include <prom.h> | ||
34 | |||
35 | |||
36 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
37 | { AU1000_GPIO_9, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card Fully_Inserted# */ | ||
38 | { AU1000_GPIO_10, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card STSCHG# */ | ||
39 | { AU1000_GPIO_11, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card IRQ# */ | ||
40 | { AU1000_GPIO_13, IRQF_TRIGGER_LOW, 0 }, /* DC_IRQ# */ | ||
41 | }; | ||
42 | |||
43 | |||
44 | const char *get_system_type(void) | ||
45 | { | ||
46 | return "Alchemy Pb1100"; | ||
47 | } | ||
48 | |||
32 | void board_reset(void) | 49 | void board_reset(void) |
33 | { | 50 | { |
34 | /* Hit BCSR.RST_VDDI[SOFT_RESET] */ | 51 | /* Hit BCSR.RST_VDDI[SOFT_RESET] */ |
35 | au_writel(0x00000000, PB1100_RST_VDDI); | 52 | au_writel(0x00000000, PB1100_RST_VDDI); |
36 | } | 53 | } |
37 | 54 | ||
55 | void __init board_init_irq(void) | ||
56 | { | ||
57 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
58 | } | ||
59 | |||
38 | void __init board_setup(void) | 60 | void __init board_setup(void) |
39 | { | 61 | { |
40 | volatile void __iomem *base = (volatile void __iomem *)0xac000000UL; | 62 | volatile void __iomem *base = (volatile void __iomem *)0xac000000UL; |
63 | char *argptr; | ||
64 | |||
65 | argptr = prom_getcmdline(); | ||
66 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
67 | argptr = strstr(argptr, "console="); | ||
68 | if (argptr == NULL) { | ||
69 | argptr = prom_getcmdline(); | ||
70 | strcat(argptr, " console=ttyS0,115200"); | ||
71 | } | ||
72 | #endif | ||
73 | |||
74 | #ifdef CONFIG_FB_AU1100 | ||
75 | argptr = strstr(argptr, "video="); | ||
76 | if (argptr == NULL) { | ||
77 | argptr = prom_getcmdline(); | ||
78 | /* default panel */ | ||
79 | /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/ | ||
80 | } | ||
81 | #endif | ||
82 | |||
83 | #if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) | ||
84 | /* au1000 does not support vra, au1500 and au1100 do */ | ||
85 | strcat(argptr, " au1000_audio=vra"); | ||
86 | argptr = prom_getcmdline(); | ||
87 | #endif | ||
41 | 88 | ||
42 | /* Set AUX clock to 12 MHz * 8 = 96 MHz */ | 89 | /* Set AUX clock to 12 MHz * 8 = 96 MHz */ |
43 | au_writel(8, SYS_AUXPLL); | 90 | au_writel(8, SYS_AUXPLL); |
diff --git a/arch/mips/alchemy/pb1200/Makefile b/arch/mips/alchemy/devboards/pb1200/Makefile index d678adf7ce85..c8c3a99fb68a 100644 --- a/arch/mips/alchemy/pb1200/Makefile +++ b/arch/mips/alchemy/devboards/pb1200/Makefile | |||
@@ -2,7 +2,6 @@ | |||
2 | # Makefile for the Alchemy Semiconductor Pb1200/DBAu1200 boards. | 2 | # Makefile for the Alchemy Semiconductor Pb1200/DBAu1200 boards. |
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y := init.o board_setup.o irqmap.o | 5 | obj-y := board_setup.o irqmap.o platform.o |
6 | obj-y += platform.o | ||
7 | 6 | ||
8 | EXTRA_CFLAGS += -Werror | 7 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/alchemy/pb1200/board_setup.c b/arch/mips/alchemy/devboards/pb1200/board_setup.c index 6cb2115059ad..94e6b7e7753d 100644 --- a/arch/mips/alchemy/pb1200/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1200/board_setup.c | |||
@@ -30,8 +30,11 @@ | |||
30 | #include <prom.h> | 30 | #include <prom.h> |
31 | #include <au1xxx.h> | 31 | #include <au1xxx.h> |
32 | 32 | ||
33 | extern void _board_init_irq(void); | 33 | |
34 | extern void (*board_init_irq)(void); | 34 | const char *get_system_type(void) |
35 | { | ||
36 | return "Alchemy Pb1200"; | ||
37 | } | ||
35 | 38 | ||
36 | void board_reset(void) | 39 | void board_reset(void) |
37 | { | 40 | { |
@@ -41,7 +44,19 @@ void board_reset(void) | |||
41 | 44 | ||
42 | void __init board_setup(void) | 45 | void __init board_setup(void) |
43 | { | 46 | { |
44 | char *argptr = NULL; | 47 | char *argptr; |
48 | |||
49 | argptr = prom_getcmdline(); | ||
50 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
51 | argptr = strstr(argptr, "console="); | ||
52 | if (argptr == NULL) { | ||
53 | argptr = prom_getcmdline(); | ||
54 | strcat(argptr, " console=ttyS0,115200"); | ||
55 | } | ||
56 | #endif | ||
57 | #ifdef CONFIG_FB_AU1200 | ||
58 | strcat(argptr, " video=au1200fb:panel:bs"); | ||
59 | #endif | ||
45 | 60 | ||
46 | #if 0 | 61 | #if 0 |
47 | { | 62 | { |
@@ -99,16 +114,6 @@ void __init board_setup(void) | |||
99 | } | 114 | } |
100 | #endif | 115 | #endif |
101 | 116 | ||
102 | #ifdef CONFIG_FB_AU1200 | ||
103 | argptr = prom_getcmdline(); | ||
104 | #ifdef CONFIG_MIPS_PB1200 | ||
105 | strcat(argptr, " video=au1200fb:panel:bs"); | ||
106 | #endif | ||
107 | #ifdef CONFIG_MIPS_DB1200 | ||
108 | strcat(argptr, " video=au1200fb:panel:bs"); | ||
109 | #endif | ||
110 | #endif | ||
111 | |||
112 | /* | 117 | /* |
113 | * The Pb1200 development board uses external MUX for PSC0 to | 118 | * The Pb1200 development board uses external MUX for PSC0 to |
114 | * support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI | 119 | * support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI |
@@ -124,9 +129,6 @@ void __init board_setup(void) | |||
124 | #ifdef CONFIG_MIPS_DB1200 | 129 | #ifdef CONFIG_MIPS_DB1200 |
125 | printk(KERN_INFO "AMD Alchemy Db1200 Board\n"); | 130 | printk(KERN_INFO "AMD Alchemy Db1200 Board\n"); |
126 | #endif | 131 | #endif |
127 | |||
128 | /* Setup Pb1200 External Interrupt Controller */ | ||
129 | board_init_irq = _board_init_irq; | ||
130 | } | 132 | } |
131 | 133 | ||
132 | int board_au1200fb_panel(void) | 134 | int board_au1200fb_panel(void) |
diff --git a/arch/mips/alchemy/pb1200/irqmap.c b/arch/mips/alchemy/devboards/pb1200/irqmap.c index 2a505ad8715b..fe47498da280 100644 --- a/arch/mips/alchemy/pb1200/irqmap.c +++ b/arch/mips/alchemy/devboards/pb1200/irqmap.c | |||
@@ -40,91 +40,65 @@ | |||
40 | 40 | ||
41 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | 41 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { |
42 | /* This is external interrupt cascade */ | 42 | /* This is external interrupt cascade */ |
43 | { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, | 43 | { AU1000_GPIO_7, IRQF_TRIGGER_LOW, 0 }, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | ||
47 | 46 | ||
48 | /* | 47 | /* |
49 | * Support for External interrupts on the Pb1200 Development platform. | 48 | * Support for External interrupts on the Pb1200 Development platform. |
50 | */ | 49 | */ |
51 | static volatile int pb1200_cascade_en; | ||
52 | 50 | ||
53 | irqreturn_t pb1200_cascade_handler(int irq, void *dev_id) | 51 | static void pb1200_cascade_handler(unsigned int irq, struct irq_desc *d) |
54 | { | 52 | { |
55 | unsigned short bisr = bcsr->int_status; | 53 | unsigned short bisr = bcsr->int_status; |
56 | int extirq_nr = 0; | ||
57 | |||
58 | /* Clear all the edge interrupts. This has no effect on level. */ | ||
59 | bcsr->int_status = bisr; | ||
60 | for ( ; bisr; bisr &= bisr - 1) { | ||
61 | extirq_nr = PB1200_INT_BEGIN + __ffs(bisr); | ||
62 | /* Ack and dispatch IRQ */ | ||
63 | do_IRQ(extirq_nr); | ||
64 | } | ||
65 | |||
66 | return IRQ_RETVAL(1); | ||
67 | } | ||
68 | 54 | ||
69 | inline void pb1200_enable_irq(unsigned int irq_nr) | 55 | for ( ; bisr; bisr &= bisr - 1) |
70 | { | 56 | generic_handle_irq(PB1200_INT_BEGIN + __ffs(bisr)); |
71 | bcsr->intset_mask = 1 << (irq_nr - PB1200_INT_BEGIN); | ||
72 | bcsr->intset = 1 << (irq_nr - PB1200_INT_BEGIN); | ||
73 | } | 57 | } |
74 | 58 | ||
75 | inline void pb1200_disable_irq(unsigned int irq_nr) | 59 | /* NOTE: both the enable and mask bits must be cleared, otherwise the |
60 | * CPLD generates tons of spurious interrupts (at least on the DB1200). | ||
61 | */ | ||
62 | static void pb1200_mask_irq(unsigned int irq_nr) | ||
76 | { | 63 | { |
77 | bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN); | 64 | bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN); |
78 | bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN); | 65 | bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN); |
66 | au_sync(); | ||
79 | } | 67 | } |
80 | 68 | ||
81 | static unsigned int pb1200_setup_cascade(void) | 69 | static void pb1200_maskack_irq(unsigned int irq_nr) |
82 | { | ||
83 | return request_irq(AU1000_GPIO_7, &pb1200_cascade_handler, | ||
84 | 0, "Pb1200 Cascade", &pb1200_cascade_handler); | ||
85 | } | ||
86 | |||
87 | static unsigned int pb1200_startup_irq(unsigned int irq) | ||
88 | { | 70 | { |
89 | if (++pb1200_cascade_en == 1) { | 71 | bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN); |
90 | int res; | 72 | bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN); |
91 | 73 | bcsr->int_status = 1 << (irq_nr - PB1200_INT_BEGIN); /* ack */ | |
92 | res = pb1200_setup_cascade(); | 74 | au_sync(); |
93 | if (res) | ||
94 | return res; | ||
95 | } | ||
96 | |||
97 | pb1200_enable_irq(irq); | ||
98 | |||
99 | return 0; | ||
100 | } | 75 | } |
101 | 76 | ||
102 | static void pb1200_shutdown_irq(unsigned int irq) | 77 | static void pb1200_unmask_irq(unsigned int irq_nr) |
103 | { | 78 | { |
104 | pb1200_disable_irq(irq); | 79 | bcsr->intset = 1 << (irq_nr - PB1200_INT_BEGIN); |
105 | if (--pb1200_cascade_en == 0) | 80 | bcsr->intset_mask = 1 << (irq_nr - PB1200_INT_BEGIN); |
106 | free_irq(AU1000_GPIO_7, &pb1200_cascade_handler); | 81 | au_sync(); |
107 | } | 82 | } |
108 | 83 | ||
109 | static struct irq_chip external_irq_type = { | 84 | static struct irq_chip pb1200_cpld_irq_type = { |
110 | #ifdef CONFIG_MIPS_PB1200 | 85 | #ifdef CONFIG_MIPS_PB1200 |
111 | .name = "Pb1200 Ext", | 86 | .name = "Pb1200 Ext", |
112 | #endif | 87 | #endif |
113 | #ifdef CONFIG_MIPS_DB1200 | 88 | #ifdef CONFIG_MIPS_DB1200 |
114 | .name = "Db1200 Ext", | 89 | .name = "Db1200 Ext", |
115 | #endif | 90 | #endif |
116 | .startup = pb1200_startup_irq, | 91 | .mask = pb1200_mask_irq, |
117 | .shutdown = pb1200_shutdown_irq, | 92 | .mask_ack = pb1200_maskack_irq, |
118 | .ack = pb1200_disable_irq, | 93 | .unmask = pb1200_unmask_irq, |
119 | .mask = pb1200_disable_irq, | ||
120 | .mask_ack = pb1200_disable_irq, | ||
121 | .unmask = pb1200_enable_irq, | ||
122 | }; | 94 | }; |
123 | 95 | ||
124 | void _board_init_irq(void) | 96 | void __init board_init_irq(void) |
125 | { | 97 | { |
126 | unsigned int irq; | 98 | unsigned int irq; |
127 | 99 | ||
100 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
101 | |||
128 | #ifdef CONFIG_MIPS_PB1200 | 102 | #ifdef CONFIG_MIPS_PB1200 |
129 | /* We have a problem with CPLD rev 3. */ | 103 | /* We have a problem with CPLD rev 3. */ |
130 | if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) { | 104 | if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) { |
@@ -146,15 +120,15 @@ void _board_init_irq(void) | |||
146 | panic("Game over. Your score is 0."); | 120 | panic("Game over. Your score is 0."); |
147 | } | 121 | } |
148 | #endif | 122 | #endif |
123 | /* mask & disable & ack all */ | ||
124 | bcsr->intclr_mask = 0xffff; | ||
125 | bcsr->intclr = 0xffff; | ||
126 | bcsr->int_status = 0xffff; | ||
127 | au_sync(); | ||
149 | 128 | ||
150 | for (irq = PB1200_INT_BEGIN; irq <= PB1200_INT_END; irq++) { | 129 | for (irq = PB1200_INT_BEGIN; irq <= PB1200_INT_END; irq++) |
151 | set_irq_chip_and_handler(irq, &external_irq_type, | 130 | set_irq_chip_and_handler_name(irq, &pb1200_cpld_irq_type, |
152 | handle_level_irq); | 131 | handle_level_irq, "level"); |
153 | pb1200_disable_irq(irq); | ||
154 | } | ||
155 | 132 | ||
156 | /* | 133 | set_irq_chained_handler(AU1000_GPIO_7, pb1200_cascade_handler); |
157 | * GPIO_7 can not be hooked here, so it is hooked upon first | ||
158 | * request of any source attached to the cascade. | ||
159 | */ | ||
160 | } | 134 | } |
diff --git a/arch/mips/alchemy/pb1200/platform.c b/arch/mips/alchemy/devboards/pb1200/platform.c index 95303297c534..95303297c534 100644 --- a/arch/mips/alchemy/pb1200/platform.c +++ b/arch/mips/alchemy/devboards/pb1200/platform.c | |||
diff --git a/arch/mips/alchemy/pb1500/Makefile b/arch/mips/alchemy/devboards/pb1500/Makefile index 602f38df20bb..173b419a7479 100644 --- a/arch/mips/alchemy/pb1500/Makefile +++ b/arch/mips/alchemy/devboards/pb1500/Makefile | |||
@@ -5,4 +5,4 @@ | |||
5 | # Makefile for the Alchemy Semiconductor Pb1500 board. | 5 | # Makefile for the Alchemy Semiconductor Pb1500 board. |
6 | # | 6 | # |
7 | 7 | ||
8 | lib-y := init.o board_setup.o irqmap.o | 8 | obj-y := board_setup.o |
diff --git a/arch/mips/alchemy/pb1500/board_setup.c b/arch/mips/alchemy/devboards/pb1500/board_setup.c index 035771c6e5b8..fed3b093156a 100644 --- a/arch/mips/alchemy/pb1500/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1500/board_setup.c | |||
@@ -25,20 +25,64 @@ | |||
25 | 25 | ||
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/interrupt.h> | ||
28 | 29 | ||
29 | #include <asm/mach-au1x00/au1000.h> | 30 | #include <asm/mach-au1x00/au1000.h> |
30 | #include <asm/mach-pb1x00/pb1500.h> | 31 | #include <asm/mach-pb1x00/pb1500.h> |
31 | 32 | ||
33 | #include <prom.h> | ||
34 | |||
35 | |||
36 | char irq_tab_alchemy[][5] __initdata = { | ||
37 | [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT370 */ | ||
38 | [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */ | ||
39 | }; | ||
40 | |||
41 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
42 | { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 }, | ||
43 | { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 }, | ||
44 | { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 }, | ||
45 | { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 }, | ||
46 | { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 }, | ||
47 | }; | ||
48 | |||
49 | |||
50 | const char *get_system_type(void) | ||
51 | { | ||
52 | return "Alchemy Pb1500"; | ||
53 | } | ||
54 | |||
32 | void board_reset(void) | 55 | void board_reset(void) |
33 | { | 56 | { |
34 | /* Hit BCSR.RST_VDDI[SOFT_RESET] */ | 57 | /* Hit BCSR.RST_VDDI[SOFT_RESET] */ |
35 | au_writel(0x00000000, PB1500_RST_VDDI); | 58 | au_writel(0x00000000, PB1500_RST_VDDI); |
36 | } | 59 | } |
37 | 60 | ||
61 | void __init board_init_irq(void) | ||
62 | { | ||
63 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
64 | } | ||
65 | |||
38 | void __init board_setup(void) | 66 | void __init board_setup(void) |
39 | { | 67 | { |
40 | u32 pin_func; | 68 | u32 pin_func; |
41 | u32 sys_freqctrl, sys_clksrc; | 69 | u32 sys_freqctrl, sys_clksrc; |
70 | char *argptr; | ||
71 | |||
72 | argptr = prom_getcmdline(); | ||
73 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
74 | argptr = strstr(argptr, "console="); | ||
75 | if (argptr == NULL) { | ||
76 | argptr = prom_getcmdline(); | ||
77 | strcat(argptr, " console=ttyS0,115200"); | ||
78 | } | ||
79 | #endif | ||
80 | |||
81 | #if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000) | ||
82 | /* au1000 does not support vra, au1500 and au1100 do */ | ||
83 | strcat(argptr, " au1000_audio=vra"); | ||
84 | argptr = prom_getcmdline(); | ||
85 | #endif | ||
42 | 86 | ||
43 | sys_clksrc = sys_freqctrl = pin_func = 0; | 87 | sys_clksrc = sys_freqctrl = pin_func = 0; |
44 | /* Set AUX clock to 12 MHz * 8 = 96 MHz */ | 88 | /* Set AUX clock to 12 MHz * 8 = 96 MHz */ |
diff --git a/arch/mips/alchemy/pb1550/Makefile b/arch/mips/alchemy/devboards/pb1550/Makefile index 7d8beca87fa5..cff95bcdb2ca 100644 --- a/arch/mips/alchemy/pb1550/Makefile +++ b/arch/mips/alchemy/devboards/pb1550/Makefile | |||
@@ -5,4 +5,4 @@ | |||
5 | # Makefile for the Alchemy Semiconductor Pb1550 board. | 5 | # Makefile for the Alchemy Semiconductor Pb1550 board. |
6 | # | 6 | # |
7 | 7 | ||
8 | lib-y := init.o board_setup.o irqmap.o | 8 | obj-y := board_setup.o |
diff --git a/arch/mips/alchemy/pb1550/board_setup.c b/arch/mips/alchemy/devboards/pb1550/board_setup.c index 0ed76b64b6ab..b6e9e7d247a3 100644 --- a/arch/mips/alchemy/pb1550/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1550/board_setup.c | |||
@@ -28,20 +28,54 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/interrupt.h> | ||
31 | 32 | ||
32 | #include <asm/mach-au1x00/au1000.h> | 33 | #include <asm/mach-au1x00/au1000.h> |
33 | #include <asm/mach-pb1x00/pb1550.h> | 34 | #include <asm/mach-pb1x00/pb1550.h> |
34 | 35 | ||
36 | #include <prom.h> | ||
37 | |||
38 | |||
39 | char irq_tab_alchemy[][5] __initdata = { | ||
40 | [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */ | ||
41 | [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot 1 (right) */ | ||
42 | }; | ||
43 | |||
44 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
45 | { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 }, | ||
46 | { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 }, | ||
47 | }; | ||
48 | |||
49 | const char *get_system_type(void) | ||
50 | { | ||
51 | return "Alchemy Pb1550"; | ||
52 | } | ||
53 | |||
35 | void board_reset(void) | 54 | void board_reset(void) |
36 | { | 55 | { |
37 | /* Hit BCSR.SYSTEM[RESET] */ | 56 | /* Hit BCSR.SYSTEM[RESET] */ |
38 | au_writew(au_readw(0xAF00001C) & ~BCSR_SYSTEM_RESET, 0xAF00001C); | 57 | au_writew(au_readw(0xAF00001C) & ~BCSR_SYSTEM_RESET, 0xAF00001C); |
39 | } | 58 | } |
40 | 59 | ||
60 | void __init board_init_irq(void) | ||
61 | { | ||
62 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
63 | } | ||
64 | |||
41 | void __init board_setup(void) | 65 | void __init board_setup(void) |
42 | { | 66 | { |
43 | u32 pin_func; | 67 | u32 pin_func; |
44 | 68 | ||
69 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
70 | char *argptr; | ||
71 | argptr = prom_getcmdline(); | ||
72 | argptr = strstr(argptr, "console="); | ||
73 | if (argptr == NULL) { | ||
74 | argptr = prom_getcmdline(); | ||
75 | strcat(argptr, " console=ttyS0,115200"); | ||
76 | } | ||
77 | #endif | ||
78 | |||
45 | /* | 79 | /* |
46 | * Enable PSC1 SYNC for AC'97. Normaly done in audio driver, | 80 | * Enable PSC1 SYNC for AC'97. Normaly done in audio driver, |
47 | * but it is board specific code, so put it here. | 81 | * but it is board specific code, so put it here. |
diff --git a/arch/mips/alchemy/devboards/pm.c b/arch/mips/alchemy/devboards/pm.c new file mode 100644 index 000000000000..d5eb9c325ed0 --- /dev/null +++ b/arch/mips/alchemy/devboards/pm.c | |||
@@ -0,0 +1,229 @@ | |||
1 | /* | ||
2 | * Alchemy Development Board example suspend userspace interface. | ||
3 | * | ||
4 | * (c) 2008 Manuel Lauss <mano@roarinelk.homelinux.net> | ||
5 | */ | ||
6 | |||
7 | #include <linux/init.h> | ||
8 | #include <linux/kobject.h> | ||
9 | #include <linux/suspend.h> | ||
10 | #include <linux/sysfs.h> | ||
11 | #include <asm/mach-au1x00/au1000.h> | ||
12 | |||
13 | /* | ||
14 | * Generic suspend userspace interface for Alchemy development boards. | ||
15 | * This code exports a few sysfs nodes under /sys/power/db1x/ which | ||
16 | * can be used by userspace to en/disable all au1x-provided wakeup | ||
17 | * sources and configure the timeout after which the the TOYMATCH2 irq | ||
18 | * is to trigger a wakeup. | ||
19 | */ | ||
20 | |||
21 | |||
22 | static unsigned long db1x_pm_sleep_secs; | ||
23 | static unsigned long db1x_pm_wakemsk; | ||
24 | static unsigned long db1x_pm_last_wakesrc; | ||
25 | |||
26 | static int db1x_pm_enter(suspend_state_t state) | ||
27 | { | ||
28 | /* enable GPIO based wakeup */ | ||
29 | au_writel(1, SYS_PININPUTEN); | ||
30 | |||
31 | /* clear and setup wake cause and source */ | ||
32 | au_writel(0, SYS_WAKEMSK); | ||
33 | au_sync(); | ||
34 | au_writel(0, SYS_WAKESRC); | ||
35 | au_sync(); | ||
36 | |||
37 | au_writel(db1x_pm_wakemsk, SYS_WAKEMSK); | ||
38 | au_sync(); | ||
39 | |||
40 | /* setup 1Hz-timer-based wakeup: wait for reg access */ | ||
41 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20) | ||
42 | asm volatile ("nop"); | ||
43 | |||
44 | au_writel(au_readl(SYS_TOYREAD) + db1x_pm_sleep_secs, SYS_TOYMATCH2); | ||
45 | au_sync(); | ||
46 | |||
47 | /* wait for value to really hit the register */ | ||
48 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20) | ||
49 | asm volatile ("nop"); | ||
50 | |||
51 | /* ...and now the sandman can come! */ | ||
52 | au_sleep(); | ||
53 | |||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | static int db1x_pm_begin(suspend_state_t state) | ||
58 | { | ||
59 | if (!db1x_pm_wakemsk) { | ||
60 | printk(KERN_ERR "db1x: no wakeup source activated!\n"); | ||
61 | return -EINVAL; | ||
62 | } | ||
63 | |||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | static void db1x_pm_end(void) | ||
68 | { | ||
69 | /* read and store wakeup source, the clear the register. To | ||
70 | * be able to clear it, WAKEMSK must be cleared first. | ||
71 | */ | ||
72 | db1x_pm_last_wakesrc = au_readl(SYS_WAKESRC); | ||
73 | |||
74 | au_writel(0, SYS_WAKEMSK); | ||
75 | au_writel(0, SYS_WAKESRC); | ||
76 | au_sync(); | ||
77 | |||
78 | } | ||
79 | |||
80 | static struct platform_suspend_ops db1x_pm_ops = { | ||
81 | .valid = suspend_valid_only_mem, | ||
82 | .begin = db1x_pm_begin, | ||
83 | .enter = db1x_pm_enter, | ||
84 | .end = db1x_pm_end, | ||
85 | }; | ||
86 | |||
87 | #define ATTRCMP(x) (0 == strcmp(attr->attr.name, #x)) | ||
88 | |||
89 | static ssize_t db1x_pmattr_show(struct kobject *kobj, | ||
90 | struct kobj_attribute *attr, | ||
91 | char *buf) | ||
92 | { | ||
93 | int idx; | ||
94 | |||
95 | if (ATTRCMP(timer_timeout)) | ||
96 | return sprintf(buf, "%lu\n", db1x_pm_sleep_secs); | ||
97 | |||
98 | else if (ATTRCMP(timer)) | ||
99 | return sprintf(buf, "%u\n", | ||
100 | !!(db1x_pm_wakemsk & SYS_WAKEMSK_M2)); | ||
101 | |||
102 | else if (ATTRCMP(wakesrc)) | ||
103 | return sprintf(buf, "%lu\n", db1x_pm_last_wakesrc); | ||
104 | |||
105 | else if (ATTRCMP(gpio0) || ATTRCMP(gpio1) || ATTRCMP(gpio2) || | ||
106 | ATTRCMP(gpio3) || ATTRCMP(gpio4) || ATTRCMP(gpio5) || | ||
107 | ATTRCMP(gpio6) || ATTRCMP(gpio7)) { | ||
108 | idx = (attr->attr.name)[4] - '0'; | ||
109 | return sprintf(buf, "%d\n", | ||
110 | !!(db1x_pm_wakemsk & SYS_WAKEMSK_GPIO(idx))); | ||
111 | |||
112 | } else if (ATTRCMP(wakemsk)) { | ||
113 | return sprintf(buf, "%08lx\n", db1x_pm_wakemsk); | ||
114 | } | ||
115 | |||
116 | return -ENOENT; | ||
117 | } | ||
118 | |||
119 | static ssize_t db1x_pmattr_store(struct kobject *kobj, | ||
120 | struct kobj_attribute *attr, | ||
121 | const char *instr, | ||
122 | size_t bytes) | ||
123 | { | ||
124 | unsigned long l; | ||
125 | int tmp; | ||
126 | |||
127 | if (ATTRCMP(timer_timeout)) { | ||
128 | tmp = strict_strtoul(instr, 0, &l); | ||
129 | if (tmp) | ||
130 | return tmp; | ||
131 | |||
132 | db1x_pm_sleep_secs = l; | ||
133 | |||
134 | } else if (ATTRCMP(timer)) { | ||
135 | if (instr[0] != '0') | ||
136 | db1x_pm_wakemsk |= SYS_WAKEMSK_M2; | ||
137 | else | ||
138 | db1x_pm_wakemsk &= ~SYS_WAKEMSK_M2; | ||
139 | |||
140 | } else if (ATTRCMP(gpio0) || ATTRCMP(gpio1) || ATTRCMP(gpio2) || | ||
141 | ATTRCMP(gpio3) || ATTRCMP(gpio4) || ATTRCMP(gpio5) || | ||
142 | ATTRCMP(gpio6) || ATTRCMP(gpio7)) { | ||
143 | tmp = (attr->attr.name)[4] - '0'; | ||
144 | if (instr[0] != '0') { | ||
145 | db1x_pm_wakemsk |= SYS_WAKEMSK_GPIO(tmp); | ||
146 | } else { | ||
147 | db1x_pm_wakemsk &= ~SYS_WAKEMSK_GPIO(tmp); | ||
148 | } | ||
149 | |||
150 | } else if (ATTRCMP(wakemsk)) { | ||
151 | tmp = strict_strtoul(instr, 0, &l); | ||
152 | if (tmp) | ||
153 | return tmp; | ||
154 | |||
155 | db1x_pm_wakemsk = l & 0x0000003f; | ||
156 | |||
157 | } else | ||
158 | bytes = -ENOENT; | ||
159 | |||
160 | return bytes; | ||
161 | } | ||
162 | |||
163 | #define ATTR(x) \ | ||
164 | static struct kobj_attribute x##_attribute = \ | ||
165 | __ATTR(x, 0664, db1x_pmattr_show, \ | ||
166 | db1x_pmattr_store); | ||
167 | |||
168 | ATTR(gpio0) /* GPIO-based wakeup enable */ | ||
169 | ATTR(gpio1) | ||
170 | ATTR(gpio2) | ||
171 | ATTR(gpio3) | ||
172 | ATTR(gpio4) | ||
173 | ATTR(gpio5) | ||
174 | ATTR(gpio6) | ||
175 | ATTR(gpio7) | ||
176 | ATTR(timer) /* TOYMATCH2-based wakeup enable */ | ||
177 | ATTR(timer_timeout) /* timer-based wakeup timeout value, in seconds */ | ||
178 | ATTR(wakesrc) /* contents of SYS_WAKESRC after last wakeup */ | ||
179 | ATTR(wakemsk) /* direct access to SYS_WAKEMSK */ | ||
180 | |||
181 | #define ATTR_LIST(x) & x ## _attribute.attr | ||
182 | static struct attribute *db1x_pmattrs[] = { | ||
183 | ATTR_LIST(gpio0), | ||
184 | ATTR_LIST(gpio1), | ||
185 | ATTR_LIST(gpio2), | ||
186 | ATTR_LIST(gpio3), | ||
187 | ATTR_LIST(gpio4), | ||
188 | ATTR_LIST(gpio5), | ||
189 | ATTR_LIST(gpio6), | ||
190 | ATTR_LIST(gpio7), | ||
191 | ATTR_LIST(timer), | ||
192 | ATTR_LIST(timer_timeout), | ||
193 | ATTR_LIST(wakesrc), | ||
194 | ATTR_LIST(wakemsk), | ||
195 | NULL, /* terminator */ | ||
196 | }; | ||
197 | |||
198 | static struct attribute_group db1x_pmattr_group = { | ||
199 | .name = "db1x", | ||
200 | .attrs = db1x_pmattrs, | ||
201 | }; | ||
202 | |||
203 | /* | ||
204 | * Initialize suspend interface | ||
205 | */ | ||
206 | static int __init pm_init(void) | ||
207 | { | ||
208 | /* init TOY to tick at 1Hz if not already done. No need to wait | ||
209 | * for confirmation since there's plenty of time from here to | ||
210 | * the next suspend cycle. | ||
211 | */ | ||
212 | if (au_readl(SYS_TOYTRIM) != 32767) { | ||
213 | au_writel(32767, SYS_TOYTRIM); | ||
214 | au_sync(); | ||
215 | } | ||
216 | |||
217 | db1x_pm_last_wakesrc = au_readl(SYS_WAKESRC); | ||
218 | |||
219 | au_writel(0, SYS_WAKESRC); | ||
220 | au_sync(); | ||
221 | au_writel(0, SYS_WAKEMSK); | ||
222 | au_sync(); | ||
223 | |||
224 | suspend_set_ops(&db1x_pm_ops); | ||
225 | |||
226 | return sysfs_create_group(power_kobj, &db1x_pmattr_group); | ||
227 | } | ||
228 | |||
229 | late_initcall(pm_init); | ||
diff --git a/arch/mips/alchemy/pb1550/init.c b/arch/mips/alchemy/devboards/prom.c index e1055a13a1a0..0042bd6b1d7d 100644 --- a/arch/mips/alchemy/pb1550/init.c +++ b/arch/mips/alchemy/devboards/prom.c | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * Common code used by all Alchemy develboards. | ||
2 | * | 3 | * |
3 | * BRIEF MODULE DESCRIPTION | 4 | * Extracted from files which had this to say: |
4 | * Pb1550 board setup | ||
5 | * | 5 | * |
6 | * Copyright 2001, 2008 MontaVista Software Inc. | 6 | * Copyright 2000, 2008 MontaVista Software Inc. |
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | 7 | * Author: MontaVista Software, Inc. <source@mvista.com> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify it | 9 | * This program is free software; you can redistribute it and/or modify it |
@@ -29,15 +29,19 @@ | |||
29 | 29 | ||
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
32 | |||
33 | #include <asm/bootinfo.h> | 32 | #include <asm/bootinfo.h> |
34 | 33 | #include <asm/mach-au1x00/au1000.h> | |
35 | #include <prom.h> | 34 | #include <prom.h> |
36 | 35 | ||
37 | const char *get_system_type(void) | 36 | #if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_DB1000) || \ |
38 | { | 37 | defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1100) || \ |
39 | return "Alchemy Pb1550"; | 38 | defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_DB1500) || \ |
40 | } | 39 | defined(CONFIG_MIPS_BOSPORUS) || defined(CONFIG_MIPS_MIRAGE) |
40 | #define ALCHEMY_BOARD_DEFAULT_MEMSIZE 0x04000000 | ||
41 | |||
42 | #else /* Au1550/Au1200-based develboards */ | ||
43 | #define ALCHEMY_BOARD_DEFAULT_MEMSIZE 0x08000000 | ||
44 | #endif | ||
41 | 45 | ||
42 | void __init prom_init(void) | 46 | void __init prom_init(void) |
43 | { | 47 | { |
@@ -51,8 +55,8 @@ void __init prom_init(void) | |||
51 | prom_init_cmdline(); | 55 | prom_init_cmdline(); |
52 | memsize_str = prom_getenv("memsize"); | 56 | memsize_str = prom_getenv("memsize"); |
53 | if (!memsize_str) | 57 | if (!memsize_str) |
54 | memsize = 0x08000000; | 58 | memsize = ALCHEMY_BOARD_DEFAULT_MEMSIZE; |
55 | else | 59 | else |
56 | strict_strtol(memsize_str, 0, &memsize); | 60 | strict_strtoul(memsize_str, 0, &memsize); |
57 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 61 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
58 | } | 62 | } |
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c index 3f8079186cf2..8ed1ae12bc55 100644 --- a/arch/mips/alchemy/mtx-1/board_setup.c +++ b/arch/mips/alchemy/mtx-1/board_setup.c | |||
@@ -32,6 +32,8 @@ | |||
32 | 32 | ||
33 | #include <asm/mach-au1x00/au1000.h> | 33 | #include <asm/mach-au1x00/au1000.h> |
34 | 34 | ||
35 | #include <prom.h> | ||
36 | |||
35 | extern int (*board_pci_idsel)(unsigned int devsel, int assert); | 37 | extern int (*board_pci_idsel)(unsigned int devsel, int assert); |
36 | int mtx1_pci_idsel(unsigned int devsel, int assert); | 38 | int mtx1_pci_idsel(unsigned int devsel, int assert); |
37 | 39 | ||
@@ -43,6 +45,16 @@ void board_reset(void) | |||
43 | 45 | ||
44 | void __init board_setup(void) | 46 | void __init board_setup(void) |
45 | { | 47 | { |
48 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
49 | char *argptr; | ||
50 | argptr = prom_getcmdline(); | ||
51 | argptr = strstr(argptr, "console="); | ||
52 | if (argptr == NULL) { | ||
53 | argptr = prom_getcmdline(); | ||
54 | strcat(argptr, " console=ttyS0,115200"); | ||
55 | } | ||
56 | #endif | ||
57 | |||
46 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 58 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
47 | /* Enable USB power switch */ | 59 | /* Enable USB power switch */ |
48 | au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR); | 60 | au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR); |
diff --git a/arch/mips/alchemy/mtx-1/init.c b/arch/mips/alchemy/mtx-1/init.c index 3bae13c28954..5e871c8d9e96 100644 --- a/arch/mips/alchemy/mtx-1/init.c +++ b/arch/mips/alchemy/mtx-1/init.c | |||
@@ -55,6 +55,6 @@ void __init prom_init(void) | |||
55 | if (!memsize_str) | 55 | if (!memsize_str) |
56 | memsize = 0x04000000; | 56 | memsize = 0x04000000; |
57 | else | 57 | else |
58 | strict_strtol(memsize_str, 0, &memsize); | 58 | strict_strtoul(memsize_str, 0, &memsize); |
59 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 59 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
60 | } | 60 | } |
diff --git a/arch/mips/alchemy/mtx-1/irqmap.c b/arch/mips/alchemy/mtx-1/irqmap.c index f2bf02951e9c..f1ab12ab3433 100644 --- a/arch/mips/alchemy/mtx-1/irqmap.c +++ b/arch/mips/alchemy/mtx-1/irqmap.c | |||
@@ -27,7 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | 30 | #include <linux/interrupt.h> | |
31 | #include <asm/mach-au1x00/au1000.h> | 31 | #include <asm/mach-au1x00/au1000.h> |
32 | 32 | ||
33 | char irq_tab_alchemy[][5] __initdata = { | 33 | char irq_tab_alchemy[][5] __initdata = { |
@@ -42,11 +42,15 @@ char irq_tab_alchemy[][5] __initdata = { | |||
42 | }; | 42 | }; |
43 | 43 | ||
44 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | 44 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { |
45 | { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0 }, | 45 | { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 }, |
46 | { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, | 46 | { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 }, |
47 | { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 }, | 47 | { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 }, |
48 | { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 }, | 48 | { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 }, |
49 | { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, | 49 | { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 }, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | 52 | |
53 | void __init board_init_irq(void) | ||
54 | { | ||
55 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
56 | } | ||
diff --git a/arch/mips/alchemy/pb1000/init.c b/arch/mips/alchemy/pb1000/init.c deleted file mode 100644 index 8a9c7d57208d..000000000000 --- a/arch/mips/alchemy/pb1000/init.c +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Pb1000 board setup | ||
4 | * | ||
5 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
6 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | #include <linux/kernel.h> | ||
31 | |||
32 | #include <asm/bootinfo.h> | ||
33 | |||
34 | #include <prom.h> | ||
35 | |||
36 | const char *get_system_type(void) | ||
37 | { | ||
38 | return "Alchemy Pb1000"; | ||
39 | } | ||
40 | |||
41 | void __init prom_init(void) | ||
42 | { | ||
43 | unsigned char *memsize_str; | ||
44 | unsigned long memsize; | ||
45 | |||
46 | prom_argc = (int)fw_arg0; | ||
47 | prom_argv = (char **)fw_arg1; | ||
48 | prom_envp = (char **)fw_arg2; | ||
49 | |||
50 | prom_init_cmdline(); | ||
51 | memsize_str = prom_getenv("memsize"); | ||
52 | if (!memsize_str) | ||
53 | memsize = 0x04000000; | ||
54 | else | ||
55 | strict_strtol(memsize_str, 0, &memsize); | ||
56 | add_memory_region(0, memsize, BOOT_MEM_RAM); | ||
57 | } | ||
diff --git a/arch/mips/alchemy/pb1000/irqmap.c b/arch/mips/alchemy/pb1000/irqmap.c deleted file mode 100644 index b3d56b0af321..000000000000 --- a/arch/mips/alchemy/pb1000/irqmap.c +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Au1xxx irq map table | ||
4 | * | ||
5 | * Copyright 2003 Embedded Edge, LLC | ||
6 | * dan@embeddededge.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | #include <linux/interrupt.h> | ||
31 | |||
32 | #include <asm/mach-au1x00/au1000.h> | ||
33 | |||
34 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
35 | { AU1000_GPIO_15, INTC_INT_LOW_LEVEL, 0 }, | ||
36 | }; | ||
37 | |||
38 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | ||
diff --git a/arch/mips/alchemy/pb1100/init.c b/arch/mips/alchemy/pb1100/init.c deleted file mode 100644 index 7c6792308bc5..000000000000 --- a/arch/mips/alchemy/pb1100/init.c +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Pb1100 board setup | ||
5 | * | ||
6 | * Copyright 2002, 2008 MontaVista Software Inc. | ||
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | */ | ||
29 | |||
30 | #include <linux/init.h> | ||
31 | #include <linux/kernel.h> | ||
32 | |||
33 | #include <asm/bootinfo.h> | ||
34 | |||
35 | #include <prom.h> | ||
36 | |||
37 | const char *get_system_type(void) | ||
38 | { | ||
39 | return "Alchemy Pb1100"; | ||
40 | } | ||
41 | |||
42 | void __init prom_init(void) | ||
43 | { | ||
44 | unsigned char *memsize_str; | ||
45 | unsigned long memsize; | ||
46 | |||
47 | prom_argc = fw_arg0; | ||
48 | prom_argv = (char **)fw_arg1; | ||
49 | prom_envp = (char **)fw_arg3; | ||
50 | |||
51 | prom_init_cmdline(); | ||
52 | |||
53 | memsize_str = prom_getenv("memsize"); | ||
54 | if (!memsize_str) | ||
55 | memsize = 0x04000000; | ||
56 | else | ||
57 | strict_strtol(memsize_str, 0, &memsize); | ||
58 | |||
59 | add_memory_region(0, memsize, BOOT_MEM_RAM); | ||
60 | } | ||
diff --git a/arch/mips/alchemy/pb1100/irqmap.c b/arch/mips/alchemy/pb1100/irqmap.c deleted file mode 100644 index 9b7dd8b41283..000000000000 --- a/arch/mips/alchemy/pb1100/irqmap.c +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Au1xx0 IRQ map table | ||
4 | * | ||
5 | * Copyright 2003 Embedded Edge, LLC | ||
6 | * dan@embeddededge.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | |||
31 | #include <asm/mach-au1x00/au1000.h> | ||
32 | |||
33 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
34 | { AU1000_GPIO_9, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card Fully_Inserted# */ | ||
35 | { AU1000_GPIO_10, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card STSCHG# */ | ||
36 | { AU1000_GPIO_11, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card IRQ# */ | ||
37 | { AU1000_GPIO_13, INTC_INT_LOW_LEVEL, 0 }, /* DC_IRQ# */ | ||
38 | }; | ||
39 | |||
40 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | ||
diff --git a/arch/mips/alchemy/pb1200/init.c b/arch/mips/alchemy/pb1200/init.c deleted file mode 100644 index e9b2a0fd48ae..000000000000 --- a/arch/mips/alchemy/pb1200/init.c +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * PB1200 board setup | ||
5 | * | ||
6 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | */ | ||
29 | |||
30 | #include <linux/init.h> | ||
31 | #include <linux/kernel.h> | ||
32 | |||
33 | #include <asm/bootinfo.h> | ||
34 | |||
35 | #include <prom.h> | ||
36 | |||
37 | const char *get_system_type(void) | ||
38 | { | ||
39 | return "Alchemy Pb1200"; | ||
40 | } | ||
41 | |||
42 | void __init prom_init(void) | ||
43 | { | ||
44 | unsigned char *memsize_str; | ||
45 | unsigned long memsize; | ||
46 | |||
47 | prom_argc = (int)fw_arg0; | ||
48 | prom_argv = (char **)fw_arg1; | ||
49 | prom_envp = (char **)fw_arg2; | ||
50 | |||
51 | prom_init_cmdline(); | ||
52 | memsize_str = prom_getenv("memsize"); | ||
53 | if (!memsize_str) | ||
54 | memsize = 0x08000000; | ||
55 | else | ||
56 | strict_strtol(memsize_str, 0, &memsize); | ||
57 | add_memory_region(0, memsize, BOOT_MEM_RAM); | ||
58 | } | ||
diff --git a/arch/mips/alchemy/pb1500/init.c b/arch/mips/alchemy/pb1500/init.c deleted file mode 100644 index 3b6e395cf952..000000000000 --- a/arch/mips/alchemy/pb1500/init.c +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Pb1500 board setup | ||
5 | * | ||
6 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | */ | ||
29 | |||
30 | #include <linux/init.h> | ||
31 | #include <linux/kernel.h> | ||
32 | |||
33 | #include <asm/bootinfo.h> | ||
34 | |||
35 | #include <prom.h> | ||
36 | |||
37 | const char *get_system_type(void) | ||
38 | { | ||
39 | return "Alchemy Pb1500"; | ||
40 | } | ||
41 | |||
42 | void __init prom_init(void) | ||
43 | { | ||
44 | unsigned char *memsize_str; | ||
45 | unsigned long memsize; | ||
46 | |||
47 | prom_argc = (int)fw_arg0; | ||
48 | prom_argv = (char **)fw_arg1; | ||
49 | prom_envp = (char **)fw_arg2; | ||
50 | |||
51 | prom_init_cmdline(); | ||
52 | memsize_str = prom_getenv("memsize"); | ||
53 | if (!memsize_str) | ||
54 | memsize = 0x04000000; | ||
55 | else | ||
56 | strict_strtol(memsize_str, 0, &memsize); | ||
57 | add_memory_region(0, memsize, BOOT_MEM_RAM); | ||
58 | } | ||
diff --git a/arch/mips/alchemy/pb1500/irqmap.c b/arch/mips/alchemy/pb1500/irqmap.c deleted file mode 100644 index 39c4682766a8..000000000000 --- a/arch/mips/alchemy/pb1500/irqmap.c +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Au1xxx irq map table | ||
4 | * | ||
5 | * Copyright 2003 Embedded Edge, LLC | ||
6 | * dan@embeddededge.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | |||
31 | #include <asm/mach-au1x00/au1000.h> | ||
32 | |||
33 | char irq_tab_alchemy[][5] __initdata = { | ||
34 | [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT370 */ | ||
35 | [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */ | ||
36 | }; | ||
37 | |||
38 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
39 | { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0 }, | ||
40 | { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, | ||
41 | { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 }, | ||
42 | { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 }, | ||
43 | { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, | ||
44 | }; | ||
45 | |||
46 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | ||
diff --git a/arch/mips/alchemy/pb1550/irqmap.c b/arch/mips/alchemy/pb1550/irqmap.c deleted file mode 100644 index a02a4d1fa899..000000000000 --- a/arch/mips/alchemy/pb1550/irqmap.c +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Au1xx0 IRQ map table | ||
4 | * | ||
5 | * Copyright 2003 Embedded Edge, LLC | ||
6 | * dan@embeddededge.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | |||
31 | #include <asm/mach-au1x00/au1000.h> | ||
32 | |||
33 | char irq_tab_alchemy[][5] __initdata = { | ||
34 | [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */ | ||
35 | [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot 1 (right) */ | ||
36 | }; | ||
37 | |||
38 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
39 | { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, | ||
40 | { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, | ||
41 | }; | ||
42 | |||
43 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | ||
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c index 4c587acac5c3..a2634fabc50d 100644 --- a/arch/mips/alchemy/xxs1500/board_setup.c +++ b/arch/mips/alchemy/xxs1500/board_setup.c | |||
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | #include <asm/mach-au1x00/au1000.h> | 29 | #include <asm/mach-au1x00/au1000.h> |
30 | 30 | ||
31 | #include <prom.h> | ||
32 | |||
31 | void board_reset(void) | 33 | void board_reset(void) |
32 | { | 34 | { |
33 | /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ | 35 | /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ |
@@ -38,6 +40,16 @@ void __init board_setup(void) | |||
38 | { | 40 | { |
39 | u32 pin_func; | 41 | u32 pin_func; |
40 | 42 | ||
43 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
44 | char *argptr; | ||
45 | argptr = prom_getcmdline(); | ||
46 | argptr = strstr(argptr, "console="); | ||
47 | if (argptr == NULL) { | ||
48 | argptr = prom_getcmdline(); | ||
49 | strcat(argptr, " console=ttyS0,115200"); | ||
50 | } | ||
51 | #endif | ||
52 | |||
41 | /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */ | 53 | /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */ |
42 | pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3; | 54 | pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3; |
43 | pin_func |= SYS_PF_UR3; | 55 | pin_func |= SYS_PF_UR3; |
diff --git a/arch/mips/alchemy/xxs1500/init.c b/arch/mips/alchemy/xxs1500/init.c index 7516434760a1..456fa142c093 100644 --- a/arch/mips/alchemy/xxs1500/init.c +++ b/arch/mips/alchemy/xxs1500/init.c | |||
@@ -53,6 +53,6 @@ void __init prom_init(void) | |||
53 | if (!memsize_str) | 53 | if (!memsize_str) |
54 | memsize = 0x04000000; | 54 | memsize = 0x04000000; |
55 | else | 55 | else |
56 | strict_strtol(memsize_str, 0, &memsize); | 56 | strict_strtoul(memsize_str, 0, &memsize); |
57 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 57 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
58 | } | 58 | } |
diff --git a/arch/mips/alchemy/xxs1500/irqmap.c b/arch/mips/alchemy/xxs1500/irqmap.c index edf06ed11870..0f0f3012e5fd 100644 --- a/arch/mips/alchemy/xxs1500/irqmap.c +++ b/arch/mips/alchemy/xxs1500/irqmap.c | |||
@@ -27,23 +27,26 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | 30 | #include <linux/interrupt.h> | |
31 | #include <asm/mach-au1x00/au1000.h> | 31 | #include <asm/mach-au1x00/au1000.h> |
32 | 32 | ||
33 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | 33 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { |
34 | { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0 }, | 34 | { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 }, |
35 | { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, | 35 | { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 }, |
36 | { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 }, | 36 | { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 }, |
37 | { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 }, | 37 | { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 }, |
38 | { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, | 38 | { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 }, |
39 | { AU1500_GPIO_207, INTC_INT_LOW_LEVEL, 0 }, | 39 | { AU1500_GPIO_207, IRQF_TRIGGER_LOW, 0 }, |
40 | 40 | ||
41 | { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, | 41 | { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 }, |
42 | { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, | 42 | { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 }, |
43 | { AU1000_GPIO_2, INTC_INT_LOW_LEVEL, 0 }, | 43 | { AU1000_GPIO_2, IRQF_TRIGGER_LOW, 0 }, |
44 | { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, | 44 | { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 }, |
45 | { AU1000_GPIO_4, INTC_INT_LOW_LEVEL, 0 }, /* CF interrupt */ | 45 | { AU1000_GPIO_4, IRQF_TRIGGER_LOW, 0 }, /* CF interrupt */ |
46 | { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, | 46 | { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 }, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | 49 | void __init board_init_irq(void) |
50 | { | ||
51 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
52 | } | ||
diff --git a/arch/mips/cavium-octeon/Kconfig b/arch/mips/cavium-octeon/Kconfig new file mode 100644 index 000000000000..094c17e38e16 --- /dev/null +++ b/arch/mips/cavium-octeon/Kconfig | |||
@@ -0,0 +1,85 @@ | |||
1 | config CAVIUM_OCTEON_SPECIFIC_OPTIONS | ||
2 | bool "Enable Octeon specific options" | ||
3 | depends on CPU_CAVIUM_OCTEON | ||
4 | default "y" | ||
5 | |||
6 | config CAVIUM_OCTEON_2ND_KERNEL | ||
7 | bool "Build the kernel to be used as a 2nd kernel on the same chip" | ||
8 | depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS | ||
9 | default "n" | ||
10 | help | ||
11 | This option configures this kernel to be linked at a different | ||
12 | address and use the 2nd uart for output. This allows a kernel built | ||
13 | with this option to be run at the same time as one built without this | ||
14 | option. | ||
15 | |||
16 | config CAVIUM_OCTEON_HW_FIX_UNALIGNED | ||
17 | bool "Enable hardware fixups of unaligned loads and stores" | ||
18 | depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS | ||
19 | default "y" | ||
20 | help | ||
21 | Configure the Octeon hardware to automatically fix unaligned loads | ||
22 | and stores. Normally unaligned accesses are fixed using a kernel | ||
23 | exception handler. This option enables the hardware automatic fixups, | ||
24 | which requires only an extra 3 cycles. Disable this option if you | ||
25 | are running code that relies on address exceptions on unaligned | ||
26 | accesses. | ||
27 | |||
28 | config CAVIUM_OCTEON_CVMSEG_SIZE | ||
29 | int "Number of L1 cache lines reserved for CVMSEG memory" | ||
30 | depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS | ||
31 | range 0 54 | ||
32 | default 1 | ||
33 | help | ||
34 | CVMSEG LM is a segment that accesses portions of the dcache as a | ||
35 | local memory; the larger CVMSEG is, the smaller the cache is. | ||
36 | This selects the size of CVMSEG LM, which is in cache blocks. The | ||
37 | legally range is from zero to 54 cache blocks (i.e. CVMSEG LM is | ||
38 | between zero and 6192 bytes). | ||
39 | |||
40 | config CAVIUM_OCTEON_LOCK_L2 | ||
41 | bool "Lock often used kernel code in the L2" | ||
42 | depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS | ||
43 | default "y" | ||
44 | help | ||
45 | Enable locking parts of the kernel into the L2 cache. | ||
46 | |||
47 | config CAVIUM_OCTEON_LOCK_L2_TLB | ||
48 | bool "Lock the TLB handler in L2" | ||
49 | depends on CAVIUM_OCTEON_LOCK_L2 | ||
50 | default "y" | ||
51 | help | ||
52 | Lock the low level TLB fast path into L2. | ||
53 | |||
54 | config CAVIUM_OCTEON_LOCK_L2_EXCEPTION | ||
55 | bool "Lock the exception handler in L2" | ||
56 | depends on CAVIUM_OCTEON_LOCK_L2 | ||
57 | default "y" | ||
58 | help | ||
59 | Lock the low level exception handler into L2. | ||
60 | |||
61 | config CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT | ||
62 | bool "Lock the interrupt handler in L2" | ||
63 | depends on CAVIUM_OCTEON_LOCK_L2 | ||
64 | default "y" | ||
65 | help | ||
66 | Lock the low level interrupt handler into L2. | ||
67 | |||
68 | config CAVIUM_OCTEON_LOCK_L2_INTERRUPT | ||
69 | bool "Lock the 2nd level interrupt handler in L2" | ||
70 | depends on CAVIUM_OCTEON_LOCK_L2 | ||
71 | default "y" | ||
72 | help | ||
73 | Lock the 2nd level interrupt handler in L2. | ||
74 | |||
75 | config CAVIUM_OCTEON_LOCK_L2_MEMCPY | ||
76 | bool "Lock memcpy() in L2" | ||
77 | depends on CAVIUM_OCTEON_LOCK_L2 | ||
78 | default "y" | ||
79 | help | ||
80 | Lock the kernel's implementation of memcpy() into L2. | ||
81 | |||
82 | config ARCH_SPARSEMEM_ENABLE | ||
83 | def_bool y | ||
84 | select SPARSEMEM_STATIC | ||
85 | depends on CPU_CAVIUM_OCTEON | ||
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile new file mode 100644 index 000000000000..1c2a7faf5881 --- /dev/null +++ b/arch/mips/cavium-octeon/Makefile | |||
@@ -0,0 +1,16 @@ | |||
1 | # | ||
2 | # Makefile for the Cavium Octeon specific kernel interface routines | ||
3 | # under Linux. | ||
4 | # | ||
5 | # This file is subject to the terms and conditions of the GNU General Public | ||
6 | # License. See the file "COPYING" in the main directory of this archive | ||
7 | # for more details. | ||
8 | # | ||
9 | # Copyright (C) 2005-2008 Cavium Networks | ||
10 | # | ||
11 | |||
12 | obj-y := setup.o serial.o octeon-irq.o csrc-octeon.o | ||
13 | obj-y += dma-octeon.o flash_setup.o | ||
14 | obj-y += octeon-memcpy.o | ||
15 | |||
16 | obj-$(CONFIG_SMP) += smp.o | ||
diff --git a/arch/mips/cavium-octeon/csrc-octeon.c b/arch/mips/cavium-octeon/csrc-octeon.c new file mode 100644 index 000000000000..70fd92c31657 --- /dev/null +++ b/arch/mips/cavium-octeon/csrc-octeon.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 by Ralf Baechle | ||
7 | */ | ||
8 | #include <linux/clocksource.h> | ||
9 | #include <linux/init.h> | ||
10 | |||
11 | #include <asm/time.h> | ||
12 | |||
13 | #include <asm/octeon/octeon.h> | ||
14 | #include <asm/octeon/cvmx-ipd-defs.h> | ||
15 | |||
16 | /* | ||
17 | * Set the current core's cvmcount counter to the value of the | ||
18 | * IPD_CLK_COUNT. We do this on all cores as they are brought | ||
19 | * on-line. This allows for a read from a local cpu register to | ||
20 | * access a synchronized counter. | ||
21 | * | ||
22 | */ | ||
23 | void octeon_init_cvmcount(void) | ||
24 | { | ||
25 | unsigned long flags; | ||
26 | unsigned loops = 2; | ||
27 | |||
28 | /* Clobber loops so GCC will not unroll the following while loop. */ | ||
29 | asm("" : "+r" (loops)); | ||
30 | |||
31 | local_irq_save(flags); | ||
32 | /* | ||
33 | * Loop several times so we are executing from the cache, | ||
34 | * which should give more deterministic timing. | ||
35 | */ | ||
36 | while (loops--) | ||
37 | write_c0_cvmcount(cvmx_read_csr(CVMX_IPD_CLK_COUNT)); | ||
38 | local_irq_restore(flags); | ||
39 | } | ||
40 | |||
41 | static cycle_t octeon_cvmcount_read(void) | ||
42 | { | ||
43 | return read_c0_cvmcount(); | ||
44 | } | ||
45 | |||
46 | static struct clocksource clocksource_mips = { | ||
47 | .name = "OCTEON_CVMCOUNT", | ||
48 | .read = octeon_cvmcount_read, | ||
49 | .mask = CLOCKSOURCE_MASK(64), | ||
50 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
51 | }; | ||
52 | |||
53 | void __init plat_time_init(void) | ||
54 | { | ||
55 | clocksource_mips.rating = 300; | ||
56 | clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); | ||
57 | clocksource_register(&clocksource_mips); | ||
58 | } | ||
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c new file mode 100644 index 000000000000..01b1ef94b361 --- /dev/null +++ b/arch/mips/cavium-octeon/dma-octeon.c | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000 Ani Joshi <ajoshi@unixbox.com> | ||
7 | * Copyright (C) 2000, 2001 Ralf Baechle <ralf@gnu.org> | ||
8 | * Copyright (C) 2005 Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com> | ||
9 | * swiped from i386, and cloned for MIPS by Geert, polished by Ralf. | ||
10 | * IP32 changes by Ilya. | ||
11 | * Cavium Networks: Create new dma setup for Cavium Networks Octeon based on | ||
12 | * the kernels original. | ||
13 | */ | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/mm.h> | ||
16 | |||
17 | #include <dma-coherence.h> | ||
18 | |||
19 | dma_addr_t octeon_map_dma_mem(struct device *dev, void *ptr, size_t size) | ||
20 | { | ||
21 | /* Without PCI/PCIe this function can be called for Octeon internal | ||
22 | devices such as USB. These devices all support 64bit addressing */ | ||
23 | mb(); | ||
24 | return virt_to_phys(ptr); | ||
25 | } | ||
26 | |||
27 | void octeon_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | ||
28 | { | ||
29 | /* Without PCI/PCIe this function can be called for Octeon internal | ||
30 | * devices such as USB. These devices all support 64bit addressing */ | ||
31 | return; | ||
32 | } | ||
diff --git a/arch/mips/cavium-octeon/executive/Makefile b/arch/mips/cavium-octeon/executive/Makefile new file mode 100644 index 000000000000..80d6cb26766b --- /dev/null +++ b/arch/mips/cavium-octeon/executive/Makefile | |||
@@ -0,0 +1,13 @@ | |||
1 | # | ||
2 | # Makefile for the Cavium Octeon specific kernel interface routines | ||
3 | # under Linux. | ||
4 | # | ||
5 | # This file is subject to the terms and conditions of the GNU General Public | ||
6 | # License. See the file "COPYING" in the main directory of this archive | ||
7 | # for more details. | ||
8 | # | ||
9 | # Copyright (C) 2005-2008 Cavium Networks | ||
10 | # | ||
11 | |||
12 | obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o | ||
13 | |||
diff --git a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c new file mode 100644 index 000000000000..4f5a08b37ccd --- /dev/null +++ b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c | |||
@@ -0,0 +1,586 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * Simple allocate only memory allocator. Used to allocate memory at | ||
30 | * application start time. | ||
31 | */ | ||
32 | |||
33 | #include <linux/kernel.h> | ||
34 | |||
35 | #include <asm/octeon/cvmx.h> | ||
36 | #include <asm/octeon/cvmx-spinlock.h> | ||
37 | #include <asm/octeon/cvmx-bootmem.h> | ||
38 | |||
39 | /*#define DEBUG */ | ||
40 | |||
41 | |||
42 | static struct cvmx_bootmem_desc *cvmx_bootmem_desc; | ||
43 | |||
44 | /* See header file for descriptions of functions */ | ||
45 | |||
46 | /* | ||
47 | * Wrapper functions are provided for reading/writing the size and | ||
48 | * next block values as these may not be directly addressible (in 32 | ||
49 | * bit applications, for instance.) Offsets of data elements in | ||
50 | * bootmem list, must match cvmx_bootmem_block_header_t. | ||
51 | */ | ||
52 | #define NEXT_OFFSET 0 | ||
53 | #define SIZE_OFFSET 8 | ||
54 | |||
55 | static void cvmx_bootmem_phy_set_size(uint64_t addr, uint64_t size) | ||
56 | { | ||
57 | cvmx_write64_uint64((addr + SIZE_OFFSET) | (1ull << 63), size); | ||
58 | } | ||
59 | |||
60 | static void cvmx_bootmem_phy_set_next(uint64_t addr, uint64_t next) | ||
61 | { | ||
62 | cvmx_write64_uint64((addr + NEXT_OFFSET) | (1ull << 63), next); | ||
63 | } | ||
64 | |||
65 | static uint64_t cvmx_bootmem_phy_get_size(uint64_t addr) | ||
66 | { | ||
67 | return cvmx_read64_uint64((addr + SIZE_OFFSET) | (1ull << 63)); | ||
68 | } | ||
69 | |||
70 | static uint64_t cvmx_bootmem_phy_get_next(uint64_t addr) | ||
71 | { | ||
72 | return cvmx_read64_uint64((addr + NEXT_OFFSET) | (1ull << 63)); | ||
73 | } | ||
74 | |||
75 | void *cvmx_bootmem_alloc_range(uint64_t size, uint64_t alignment, | ||
76 | uint64_t min_addr, uint64_t max_addr) | ||
77 | { | ||
78 | int64_t address; | ||
79 | address = | ||
80 | cvmx_bootmem_phy_alloc(size, min_addr, max_addr, alignment, 0); | ||
81 | |||
82 | if (address > 0) | ||
83 | return cvmx_phys_to_ptr(address); | ||
84 | else | ||
85 | return NULL; | ||
86 | } | ||
87 | |||
88 | void *cvmx_bootmem_alloc_address(uint64_t size, uint64_t address, | ||
89 | uint64_t alignment) | ||
90 | { | ||
91 | return cvmx_bootmem_alloc_range(size, alignment, address, | ||
92 | address + size); | ||
93 | } | ||
94 | |||
95 | void *cvmx_bootmem_alloc(uint64_t size, uint64_t alignment) | ||
96 | { | ||
97 | return cvmx_bootmem_alloc_range(size, alignment, 0, 0); | ||
98 | } | ||
99 | |||
100 | int cvmx_bootmem_free_named(char *name) | ||
101 | { | ||
102 | return cvmx_bootmem_phy_named_block_free(name, 0); | ||
103 | } | ||
104 | |||
105 | struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name) | ||
106 | { | ||
107 | return cvmx_bootmem_phy_named_block_find(name, 0); | ||
108 | } | ||
109 | |||
110 | void cvmx_bootmem_lock(void) | ||
111 | { | ||
112 | cvmx_spinlock_lock((cvmx_spinlock_t *) &(cvmx_bootmem_desc->lock)); | ||
113 | } | ||
114 | |||
115 | void cvmx_bootmem_unlock(void) | ||
116 | { | ||
117 | cvmx_spinlock_unlock((cvmx_spinlock_t *) &(cvmx_bootmem_desc->lock)); | ||
118 | } | ||
119 | |||
120 | int cvmx_bootmem_init(void *mem_desc_ptr) | ||
121 | { | ||
122 | /* Here we set the global pointer to the bootmem descriptor | ||
123 | * block. This pointer will be used directly, so we will set | ||
124 | * it up to be directly usable by the application. It is set | ||
125 | * up as follows for the various runtime/ABI combinations: | ||
126 | * | ||
127 | * Linux 64 bit: Set XKPHYS bit | ||
128 | * Linux 32 bit: use mmap to create mapping, use virtual address | ||
129 | * CVMX 64 bit: use physical address directly | ||
130 | * CVMX 32 bit: use physical address directly | ||
131 | * | ||
132 | * Note that the CVMX environment assumes the use of 1-1 TLB | ||
133 | * mappings so that the physical addresses can be used | ||
134 | * directly | ||
135 | */ | ||
136 | if (!cvmx_bootmem_desc) { | ||
137 | #if defined(CVMX_ABI_64) | ||
138 | /* Set XKPHYS bit */ | ||
139 | cvmx_bootmem_desc = cvmx_phys_to_ptr(CAST64(mem_desc_ptr)); | ||
140 | #else | ||
141 | cvmx_bootmem_desc = (struct cvmx_bootmem_desc *) mem_desc_ptr; | ||
142 | #endif | ||
143 | } | ||
144 | |||
145 | return 0; | ||
146 | } | ||
147 | |||
148 | /* | ||
149 | * The cvmx_bootmem_phy* functions below return 64 bit physical | ||
150 | * addresses, and expose more features that the cvmx_bootmem_functions | ||
151 | * above. These are required for full memory space access in 32 bit | ||
152 | * applications, as well as for using some advance features. Most | ||
153 | * applications should not need to use these. | ||
154 | */ | ||
155 | |||
156 | int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min, | ||
157 | uint64_t address_max, uint64_t alignment, | ||
158 | uint32_t flags) | ||
159 | { | ||
160 | |||
161 | uint64_t head_addr; | ||
162 | uint64_t ent_addr; | ||
163 | /* points to previous list entry, NULL current entry is head of list */ | ||
164 | uint64_t prev_addr = 0; | ||
165 | uint64_t new_ent_addr = 0; | ||
166 | uint64_t desired_min_addr; | ||
167 | |||
168 | #ifdef DEBUG | ||
169 | cvmx_dprintf("cvmx_bootmem_phy_alloc: req_size: 0x%llx, " | ||
170 | "min_addr: 0x%llx, max_addr: 0x%llx, align: 0x%llx\n", | ||
171 | (unsigned long long)req_size, | ||
172 | (unsigned long long)address_min, | ||
173 | (unsigned long long)address_max, | ||
174 | (unsigned long long)alignment); | ||
175 | #endif | ||
176 | |||
177 | if (cvmx_bootmem_desc->major_version > 3) { | ||
178 | cvmx_dprintf("ERROR: Incompatible bootmem descriptor " | ||
179 | "version: %d.%d at addr: %p\n", | ||
180 | (int)cvmx_bootmem_desc->major_version, | ||
181 | (int)cvmx_bootmem_desc->minor_version, | ||
182 | cvmx_bootmem_desc); | ||
183 | goto error_out; | ||
184 | } | ||
185 | |||
186 | /* | ||
187 | * Do a variety of checks to validate the arguments. The | ||
188 | * allocator code will later assume that these checks have | ||
189 | * been made. We validate that the requested constraints are | ||
190 | * not self-contradictory before we look through the list of | ||
191 | * available memory. | ||
192 | */ | ||
193 | |||
194 | /* 0 is not a valid req_size for this allocator */ | ||
195 | if (!req_size) | ||
196 | goto error_out; | ||
197 | |||
198 | /* Round req_size up to mult of minimum alignment bytes */ | ||
199 | req_size = (req_size + (CVMX_BOOTMEM_ALIGNMENT_SIZE - 1)) & | ||
200 | ~(CVMX_BOOTMEM_ALIGNMENT_SIZE - 1); | ||
201 | |||
202 | /* | ||
203 | * Convert !0 address_min and 0 address_max to special case of | ||
204 | * range that specifies an exact memory block to allocate. Do | ||
205 | * this before other checks and adjustments so that this | ||
206 | * tranformation will be validated. | ||
207 | */ | ||
208 | if (address_min && !address_max) | ||
209 | address_max = address_min + req_size; | ||
210 | else if (!address_min && !address_max) | ||
211 | address_max = ~0ull; /* If no limits given, use max limits */ | ||
212 | |||
213 | |||
214 | /* | ||
215 | * Enforce minimum alignment (this also keeps the minimum free block | ||
216 | * req_size the same as the alignment req_size. | ||
217 | */ | ||
218 | if (alignment < CVMX_BOOTMEM_ALIGNMENT_SIZE) | ||
219 | alignment = CVMX_BOOTMEM_ALIGNMENT_SIZE; | ||
220 | |||
221 | /* | ||
222 | * Adjust address minimum based on requested alignment (round | ||
223 | * up to meet alignment). Do this here so we can reject | ||
224 | * impossible requests up front. (NOP for address_min == 0) | ||
225 | */ | ||
226 | if (alignment) | ||
227 | address_min = __ALIGN_MASK(address_min, (alignment - 1)); | ||
228 | |||
229 | /* | ||
230 | * Reject inconsistent args. We have adjusted these, so this | ||
231 | * may fail due to our internal changes even if this check | ||
232 | * would pass for the values the user supplied. | ||
233 | */ | ||
234 | if (req_size > address_max - address_min) | ||
235 | goto error_out; | ||
236 | |||
237 | /* Walk through the list entries - first fit found is returned */ | ||
238 | |||
239 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
240 | cvmx_bootmem_lock(); | ||
241 | head_addr = cvmx_bootmem_desc->head_addr; | ||
242 | ent_addr = head_addr; | ||
243 | for (; ent_addr; | ||
244 | prev_addr = ent_addr, | ||
245 | ent_addr = cvmx_bootmem_phy_get_next(ent_addr)) { | ||
246 | uint64_t usable_base, usable_max; | ||
247 | uint64_t ent_size = cvmx_bootmem_phy_get_size(ent_addr); | ||
248 | |||
249 | if (cvmx_bootmem_phy_get_next(ent_addr) | ||
250 | && ent_addr > cvmx_bootmem_phy_get_next(ent_addr)) { | ||
251 | cvmx_dprintf("Internal bootmem_alloc() error: ent: " | ||
252 | "0x%llx, next: 0x%llx\n", | ||
253 | (unsigned long long)ent_addr, | ||
254 | (unsigned long long) | ||
255 | cvmx_bootmem_phy_get_next(ent_addr)); | ||
256 | goto error_out; | ||
257 | } | ||
258 | |||
259 | /* | ||
260 | * Determine if this is an entry that can satisify the | ||
261 | * request Check to make sure entry is large enough to | ||
262 | * satisfy request. | ||
263 | */ | ||
264 | usable_base = | ||
265 | __ALIGN_MASK(max(address_min, ent_addr), alignment - 1); | ||
266 | usable_max = min(address_max, ent_addr + ent_size); | ||
267 | /* | ||
268 | * We should be able to allocate block at address | ||
269 | * usable_base. | ||
270 | */ | ||
271 | |||
272 | desired_min_addr = usable_base; | ||
273 | /* | ||
274 | * Determine if request can be satisfied from the | ||
275 | * current entry. | ||
276 | */ | ||
277 | if (!((ent_addr + ent_size) > usable_base | ||
278 | && ent_addr < address_max | ||
279 | && req_size <= usable_max - usable_base)) | ||
280 | continue; | ||
281 | /* | ||
282 | * We have found an entry that has room to satisfy the | ||
283 | * request, so allocate it from this entry. If end | ||
284 | * CVMX_BOOTMEM_FLAG_END_ALLOC set, then allocate from | ||
285 | * the end of this block rather than the beginning. | ||
286 | */ | ||
287 | if (flags & CVMX_BOOTMEM_FLAG_END_ALLOC) { | ||
288 | desired_min_addr = usable_max - req_size; | ||
289 | /* | ||
290 | * Align desired address down to required | ||
291 | * alignment. | ||
292 | */ | ||
293 | desired_min_addr &= ~(alignment - 1); | ||
294 | } | ||
295 | |||
296 | /* Match at start of entry */ | ||
297 | if (desired_min_addr == ent_addr) { | ||
298 | if (req_size < ent_size) { | ||
299 | /* | ||
300 | * big enough to create a new block | ||
301 | * from top portion of block. | ||
302 | */ | ||
303 | new_ent_addr = ent_addr + req_size; | ||
304 | cvmx_bootmem_phy_set_next(new_ent_addr, | ||
305 | cvmx_bootmem_phy_get_next(ent_addr)); | ||
306 | cvmx_bootmem_phy_set_size(new_ent_addr, | ||
307 | ent_size - | ||
308 | req_size); | ||
309 | |||
310 | /* | ||
311 | * Adjust next pointer as following | ||
312 | * code uses this. | ||
313 | */ | ||
314 | cvmx_bootmem_phy_set_next(ent_addr, | ||
315 | new_ent_addr); | ||
316 | } | ||
317 | |||
318 | /* | ||
319 | * adjust prev ptr or head to remove this | ||
320 | * entry from list. | ||
321 | */ | ||
322 | if (prev_addr) | ||
323 | cvmx_bootmem_phy_set_next(prev_addr, | ||
324 | cvmx_bootmem_phy_get_next(ent_addr)); | ||
325 | else | ||
326 | /* | ||
327 | * head of list being returned, so | ||
328 | * update head ptr. | ||
329 | */ | ||
330 | cvmx_bootmem_desc->head_addr = | ||
331 | cvmx_bootmem_phy_get_next(ent_addr); | ||
332 | |||
333 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
334 | cvmx_bootmem_unlock(); | ||
335 | return desired_min_addr; | ||
336 | } | ||
337 | /* | ||
338 | * block returned doesn't start at beginning of entry, | ||
339 | * so we know that we will be splitting a block off | ||
340 | * the front of this one. Create a new block from the | ||
341 | * beginning, add to list, and go to top of loop | ||
342 | * again. | ||
343 | * | ||
344 | * create new block from high portion of | ||
345 | * block, so that top block starts at desired | ||
346 | * addr. | ||
347 | */ | ||
348 | new_ent_addr = desired_min_addr; | ||
349 | cvmx_bootmem_phy_set_next(new_ent_addr, | ||
350 | cvmx_bootmem_phy_get_next | ||
351 | (ent_addr)); | ||
352 | cvmx_bootmem_phy_set_size(new_ent_addr, | ||
353 | cvmx_bootmem_phy_get_size | ||
354 | (ent_addr) - | ||
355 | (desired_min_addr - | ||
356 | ent_addr)); | ||
357 | cvmx_bootmem_phy_set_size(ent_addr, | ||
358 | desired_min_addr - ent_addr); | ||
359 | cvmx_bootmem_phy_set_next(ent_addr, new_ent_addr); | ||
360 | /* Loop again to handle actual alloc from new block */ | ||
361 | } | ||
362 | error_out: | ||
363 | /* We didn't find anything, so return error */ | ||
364 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
365 | cvmx_bootmem_unlock(); | ||
366 | return -1; | ||
367 | } | ||
368 | |||
369 | int __cvmx_bootmem_phy_free(uint64_t phy_addr, uint64_t size, uint32_t flags) | ||
370 | { | ||
371 | uint64_t cur_addr; | ||
372 | uint64_t prev_addr = 0; /* zero is invalid */ | ||
373 | int retval = 0; | ||
374 | |||
375 | #ifdef DEBUG | ||
376 | cvmx_dprintf("__cvmx_bootmem_phy_free addr: 0x%llx, size: 0x%llx\n", | ||
377 | (unsigned long long)phy_addr, (unsigned long long)size); | ||
378 | #endif | ||
379 | if (cvmx_bootmem_desc->major_version > 3) { | ||
380 | cvmx_dprintf("ERROR: Incompatible bootmem descriptor " | ||
381 | "version: %d.%d at addr: %p\n", | ||
382 | (int)cvmx_bootmem_desc->major_version, | ||
383 | (int)cvmx_bootmem_desc->minor_version, | ||
384 | cvmx_bootmem_desc); | ||
385 | return 0; | ||
386 | } | ||
387 | |||
388 | /* 0 is not a valid size for this allocator */ | ||
389 | if (!size) | ||
390 | return 0; | ||
391 | |||
392 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
393 | cvmx_bootmem_lock(); | ||
394 | cur_addr = cvmx_bootmem_desc->head_addr; | ||
395 | if (cur_addr == 0 || phy_addr < cur_addr) { | ||
396 | /* add at front of list - special case with changing head ptr */ | ||
397 | if (cur_addr && phy_addr + size > cur_addr) | ||
398 | goto bootmem_free_done; /* error, overlapping section */ | ||
399 | else if (phy_addr + size == cur_addr) { | ||
400 | /* Add to front of existing first block */ | ||
401 | cvmx_bootmem_phy_set_next(phy_addr, | ||
402 | cvmx_bootmem_phy_get_next | ||
403 | (cur_addr)); | ||
404 | cvmx_bootmem_phy_set_size(phy_addr, | ||
405 | cvmx_bootmem_phy_get_size | ||
406 | (cur_addr) + size); | ||
407 | cvmx_bootmem_desc->head_addr = phy_addr; | ||
408 | |||
409 | } else { | ||
410 | /* New block before first block. OK if cur_addr is 0 */ | ||
411 | cvmx_bootmem_phy_set_next(phy_addr, cur_addr); | ||
412 | cvmx_bootmem_phy_set_size(phy_addr, size); | ||
413 | cvmx_bootmem_desc->head_addr = phy_addr; | ||
414 | } | ||
415 | retval = 1; | ||
416 | goto bootmem_free_done; | ||
417 | } | ||
418 | |||
419 | /* Find place in list to add block */ | ||
420 | while (cur_addr && phy_addr > cur_addr) { | ||
421 | prev_addr = cur_addr; | ||
422 | cur_addr = cvmx_bootmem_phy_get_next(cur_addr); | ||
423 | } | ||
424 | |||
425 | if (!cur_addr) { | ||
426 | /* | ||
427 | * We have reached the end of the list, add on to end, | ||
428 | * checking to see if we need to combine with last | ||
429 | * block | ||
430 | */ | ||
431 | if (prev_addr + cvmx_bootmem_phy_get_size(prev_addr) == | ||
432 | phy_addr) { | ||
433 | cvmx_bootmem_phy_set_size(prev_addr, | ||
434 | cvmx_bootmem_phy_get_size | ||
435 | (prev_addr) + size); | ||
436 | } else { | ||
437 | cvmx_bootmem_phy_set_next(prev_addr, phy_addr); | ||
438 | cvmx_bootmem_phy_set_size(phy_addr, size); | ||
439 | cvmx_bootmem_phy_set_next(phy_addr, 0); | ||
440 | } | ||
441 | retval = 1; | ||
442 | goto bootmem_free_done; | ||
443 | } else { | ||
444 | /* | ||
445 | * insert between prev and cur nodes, checking for | ||
446 | * merge with either/both. | ||
447 | */ | ||
448 | if (prev_addr + cvmx_bootmem_phy_get_size(prev_addr) == | ||
449 | phy_addr) { | ||
450 | /* Merge with previous */ | ||
451 | cvmx_bootmem_phy_set_size(prev_addr, | ||
452 | cvmx_bootmem_phy_get_size | ||
453 | (prev_addr) + size); | ||
454 | if (phy_addr + size == cur_addr) { | ||
455 | /* Also merge with current */ | ||
456 | cvmx_bootmem_phy_set_size(prev_addr, | ||
457 | cvmx_bootmem_phy_get_size(cur_addr) + | ||
458 | cvmx_bootmem_phy_get_size(prev_addr)); | ||
459 | cvmx_bootmem_phy_set_next(prev_addr, | ||
460 | cvmx_bootmem_phy_get_next(cur_addr)); | ||
461 | } | ||
462 | retval = 1; | ||
463 | goto bootmem_free_done; | ||
464 | } else if (phy_addr + size == cur_addr) { | ||
465 | /* Merge with current */ | ||
466 | cvmx_bootmem_phy_set_size(phy_addr, | ||
467 | cvmx_bootmem_phy_get_size | ||
468 | (cur_addr) + size); | ||
469 | cvmx_bootmem_phy_set_next(phy_addr, | ||
470 | cvmx_bootmem_phy_get_next | ||
471 | (cur_addr)); | ||
472 | cvmx_bootmem_phy_set_next(prev_addr, phy_addr); | ||
473 | retval = 1; | ||
474 | goto bootmem_free_done; | ||
475 | } | ||
476 | |||
477 | /* It is a standalone block, add in between prev and cur */ | ||
478 | cvmx_bootmem_phy_set_size(phy_addr, size); | ||
479 | cvmx_bootmem_phy_set_next(phy_addr, cur_addr); | ||
480 | cvmx_bootmem_phy_set_next(prev_addr, phy_addr); | ||
481 | |||
482 | } | ||
483 | retval = 1; | ||
484 | |||
485 | bootmem_free_done: | ||
486 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
487 | cvmx_bootmem_unlock(); | ||
488 | return retval; | ||
489 | |||
490 | } | ||
491 | |||
492 | struct cvmx_bootmem_named_block_desc * | ||
493 | cvmx_bootmem_phy_named_block_find(char *name, uint32_t flags) | ||
494 | { | ||
495 | unsigned int i; | ||
496 | struct cvmx_bootmem_named_block_desc *named_block_array_ptr; | ||
497 | |||
498 | #ifdef DEBUG | ||
499 | cvmx_dprintf("cvmx_bootmem_phy_named_block_find: %s\n", name); | ||
500 | #endif | ||
501 | /* | ||
502 | * Lock the structure to make sure that it is not being | ||
503 | * changed while we are examining it. | ||
504 | */ | ||
505 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
506 | cvmx_bootmem_lock(); | ||
507 | |||
508 | /* Use XKPHYS for 64 bit linux */ | ||
509 | named_block_array_ptr = (struct cvmx_bootmem_named_block_desc *) | ||
510 | cvmx_phys_to_ptr(cvmx_bootmem_desc->named_block_array_addr); | ||
511 | |||
512 | #ifdef DEBUG | ||
513 | cvmx_dprintf | ||
514 | ("cvmx_bootmem_phy_named_block_find: named_block_array_ptr: %p\n", | ||
515 | named_block_array_ptr); | ||
516 | #endif | ||
517 | if (cvmx_bootmem_desc->major_version == 3) { | ||
518 | for (i = 0; | ||
519 | i < cvmx_bootmem_desc->named_block_num_blocks; i++) { | ||
520 | if ((name && named_block_array_ptr[i].size | ||
521 | && !strncmp(name, named_block_array_ptr[i].name, | ||
522 | cvmx_bootmem_desc->named_block_name_len | ||
523 | - 1)) | ||
524 | || (!name && !named_block_array_ptr[i].size)) { | ||
525 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
526 | cvmx_bootmem_unlock(); | ||
527 | |||
528 | return &(named_block_array_ptr[i]); | ||
529 | } | ||
530 | } | ||
531 | } else { | ||
532 | cvmx_dprintf("ERROR: Incompatible bootmem descriptor " | ||
533 | "version: %d.%d at addr: %p\n", | ||
534 | (int)cvmx_bootmem_desc->major_version, | ||
535 | (int)cvmx_bootmem_desc->minor_version, | ||
536 | cvmx_bootmem_desc); | ||
537 | } | ||
538 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
539 | cvmx_bootmem_unlock(); | ||
540 | |||
541 | return NULL; | ||
542 | } | ||
543 | |||
544 | int cvmx_bootmem_phy_named_block_free(char *name, uint32_t flags) | ||
545 | { | ||
546 | struct cvmx_bootmem_named_block_desc *named_block_ptr; | ||
547 | |||
548 | if (cvmx_bootmem_desc->major_version != 3) { | ||
549 | cvmx_dprintf("ERROR: Incompatible bootmem descriptor version: " | ||
550 | "%d.%d at addr: %p\n", | ||
551 | (int)cvmx_bootmem_desc->major_version, | ||
552 | (int)cvmx_bootmem_desc->minor_version, | ||
553 | cvmx_bootmem_desc); | ||
554 | return 0; | ||
555 | } | ||
556 | #ifdef DEBUG | ||
557 | cvmx_dprintf("cvmx_bootmem_phy_named_block_free: %s\n", name); | ||
558 | #endif | ||
559 | |||
560 | /* | ||
561 | * Take lock here, as name lookup/block free/name free need to | ||
562 | * be atomic. | ||
563 | */ | ||
564 | cvmx_bootmem_lock(); | ||
565 | |||
566 | named_block_ptr = | ||
567 | cvmx_bootmem_phy_named_block_find(name, | ||
568 | CVMX_BOOTMEM_FLAG_NO_LOCKING); | ||
569 | if (named_block_ptr) { | ||
570 | #ifdef DEBUG | ||
571 | cvmx_dprintf("cvmx_bootmem_phy_named_block_free: " | ||
572 | "%s, base: 0x%llx, size: 0x%llx\n", | ||
573 | name, | ||
574 | (unsigned long long)named_block_ptr->base_addr, | ||
575 | (unsigned long long)named_block_ptr->size); | ||
576 | #endif | ||
577 | __cvmx_bootmem_phy_free(named_block_ptr->base_addr, | ||
578 | named_block_ptr->size, | ||
579 | CVMX_BOOTMEM_FLAG_NO_LOCKING); | ||
580 | named_block_ptr->size = 0; | ||
581 | /* Set size to zero to indicate block not used. */ | ||
582 | } | ||
583 | |||
584 | cvmx_bootmem_unlock(); | ||
585 | return named_block_ptr != NULL; /* 0 on failure, 1 on success */ | ||
586 | } | ||
diff --git a/arch/mips/cavium-octeon/executive/cvmx-l2c.c b/arch/mips/cavium-octeon/executive/cvmx-l2c.c new file mode 100644 index 000000000000..6abe56f1e097 --- /dev/null +++ b/arch/mips/cavium-octeon/executive/cvmx-l2c.c | |||
@@ -0,0 +1,734 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * Implementation of the Level 2 Cache (L2C) control, measurement, and | ||
30 | * debugging facilities. | ||
31 | */ | ||
32 | |||
33 | #include <asm/octeon/cvmx.h> | ||
34 | #include <asm/octeon/cvmx-l2c.h> | ||
35 | #include <asm/octeon/cvmx-spinlock.h> | ||
36 | |||
37 | /* | ||
38 | * This spinlock is used internally to ensure that only one core is | ||
39 | * performing certain L2 operations at a time. | ||
40 | * | ||
41 | * NOTE: This only protects calls from within a single application - | ||
42 | * if multiple applications or operating systems are running, then it | ||
43 | * is up to the user program to coordinate between them. | ||
44 | */ | ||
45 | static cvmx_spinlock_t cvmx_l2c_spinlock; | ||
46 | |||
47 | static inline int l2_size_half(void) | ||
48 | { | ||
49 | uint64_t val = cvmx_read_csr(CVMX_L2D_FUS3); | ||
50 | return !!(val & (1ull << 34)); | ||
51 | } | ||
52 | |||
53 | int cvmx_l2c_get_core_way_partition(uint32_t core) | ||
54 | { | ||
55 | uint32_t field; | ||
56 | |||
57 | /* Validate the core number */ | ||
58 | if (core >= cvmx_octeon_num_cores()) | ||
59 | return -1; | ||
60 | |||
61 | /* | ||
62 | * Use the lower two bits of the coreNumber to determine the | ||
63 | * bit offset of the UMSK[] field in the L2C_SPAR register. | ||
64 | */ | ||
65 | field = (core & 0x3) * 8; | ||
66 | |||
67 | /* | ||
68 | * Return the UMSK[] field from the appropriate L2C_SPAR | ||
69 | * register based on the coreNumber. | ||
70 | */ | ||
71 | |||
72 | switch (core & 0xC) { | ||
73 | case 0x0: | ||
74 | return (cvmx_read_csr(CVMX_L2C_SPAR0) & (0xFF << field)) >> | ||
75 | field; | ||
76 | case 0x4: | ||
77 | return (cvmx_read_csr(CVMX_L2C_SPAR1) & (0xFF << field)) >> | ||
78 | field; | ||
79 | case 0x8: | ||
80 | return (cvmx_read_csr(CVMX_L2C_SPAR2) & (0xFF << field)) >> | ||
81 | field; | ||
82 | case 0xC: | ||
83 | return (cvmx_read_csr(CVMX_L2C_SPAR3) & (0xFF << field)) >> | ||
84 | field; | ||
85 | } | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask) | ||
90 | { | ||
91 | uint32_t field; | ||
92 | uint32_t valid_mask; | ||
93 | |||
94 | valid_mask = (0x1 << cvmx_l2c_get_num_assoc()) - 1; | ||
95 | |||
96 | mask &= valid_mask; | ||
97 | |||
98 | /* A UMSK setting which blocks all L2C Ways is an error. */ | ||
99 | if (mask == valid_mask) | ||
100 | return -1; | ||
101 | |||
102 | /* Validate the core number */ | ||
103 | if (core >= cvmx_octeon_num_cores()) | ||
104 | return -1; | ||
105 | |||
106 | /* Check to make sure current mask & new mask don't block all ways */ | ||
107 | if (((mask | cvmx_l2c_get_core_way_partition(core)) & valid_mask) == | ||
108 | valid_mask) | ||
109 | return -1; | ||
110 | |||
111 | /* Use the lower two bits of core to determine the bit offset of the | ||
112 | * UMSK[] field in the L2C_SPAR register. | ||
113 | */ | ||
114 | field = (core & 0x3) * 8; | ||
115 | |||
116 | /* Assign the new mask setting to the UMSK[] field in the appropriate | ||
117 | * L2C_SPAR register based on the core_num. | ||
118 | * | ||
119 | */ | ||
120 | switch (core & 0xC) { | ||
121 | case 0x0: | ||
122 | cvmx_write_csr(CVMX_L2C_SPAR0, | ||
123 | (cvmx_read_csr(CVMX_L2C_SPAR0) & | ||
124 | ~(0xFF << field)) | mask << field); | ||
125 | break; | ||
126 | case 0x4: | ||
127 | cvmx_write_csr(CVMX_L2C_SPAR1, | ||
128 | (cvmx_read_csr(CVMX_L2C_SPAR1) & | ||
129 | ~(0xFF << field)) | mask << field); | ||
130 | break; | ||
131 | case 0x8: | ||
132 | cvmx_write_csr(CVMX_L2C_SPAR2, | ||
133 | (cvmx_read_csr(CVMX_L2C_SPAR2) & | ||
134 | ~(0xFF << field)) | mask << field); | ||
135 | break; | ||
136 | case 0xC: | ||
137 | cvmx_write_csr(CVMX_L2C_SPAR3, | ||
138 | (cvmx_read_csr(CVMX_L2C_SPAR3) & | ||
139 | ~(0xFF << field)) | mask << field); | ||
140 | break; | ||
141 | } | ||
142 | return 0; | ||
143 | } | ||
144 | |||
145 | int cvmx_l2c_set_hw_way_partition(uint32_t mask) | ||
146 | { | ||
147 | uint32_t valid_mask; | ||
148 | |||
149 | valid_mask = 0xff; | ||
150 | |||
151 | if (OCTEON_IS_MODEL(OCTEON_CN58XX) || OCTEON_IS_MODEL(OCTEON_CN38XX)) { | ||
152 | if (l2_size_half()) | ||
153 | valid_mask = 0xf; | ||
154 | } else if (l2_size_half()) | ||
155 | valid_mask = 0x3; | ||
156 | |||
157 | mask &= valid_mask; | ||
158 | |||
159 | /* A UMSK setting which blocks all L2C Ways is an error. */ | ||
160 | if (mask == valid_mask) | ||
161 | return -1; | ||
162 | /* Check to make sure current mask & new mask don't block all ways */ | ||
163 | if (((mask | cvmx_l2c_get_hw_way_partition()) & valid_mask) == | ||
164 | valid_mask) | ||
165 | return -1; | ||
166 | |||
167 | cvmx_write_csr(CVMX_L2C_SPAR4, | ||
168 | (cvmx_read_csr(CVMX_L2C_SPAR4) & ~0xFF) | mask); | ||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | int cvmx_l2c_get_hw_way_partition(void) | ||
173 | { | ||
174 | return cvmx_read_csr(CVMX_L2C_SPAR4) & (0xFF); | ||
175 | } | ||
176 | |||
177 | void cvmx_l2c_config_perf(uint32_t counter, enum cvmx_l2c_event event, | ||
178 | uint32_t clear_on_read) | ||
179 | { | ||
180 | union cvmx_l2c_pfctl pfctl; | ||
181 | |||
182 | pfctl.u64 = cvmx_read_csr(CVMX_L2C_PFCTL); | ||
183 | |||
184 | switch (counter) { | ||
185 | case 0: | ||
186 | pfctl.s.cnt0sel = event; | ||
187 | pfctl.s.cnt0ena = 1; | ||
188 | if (!cvmx_octeon_is_pass1()) | ||
189 | pfctl.s.cnt0rdclr = clear_on_read; | ||
190 | break; | ||
191 | case 1: | ||
192 | pfctl.s.cnt1sel = event; | ||
193 | pfctl.s.cnt1ena = 1; | ||
194 | if (!cvmx_octeon_is_pass1()) | ||
195 | pfctl.s.cnt1rdclr = clear_on_read; | ||
196 | break; | ||
197 | case 2: | ||
198 | pfctl.s.cnt2sel = event; | ||
199 | pfctl.s.cnt2ena = 1; | ||
200 | if (!cvmx_octeon_is_pass1()) | ||
201 | pfctl.s.cnt2rdclr = clear_on_read; | ||
202 | break; | ||
203 | case 3: | ||
204 | default: | ||
205 | pfctl.s.cnt3sel = event; | ||
206 | pfctl.s.cnt3ena = 1; | ||
207 | if (!cvmx_octeon_is_pass1()) | ||
208 | pfctl.s.cnt3rdclr = clear_on_read; | ||
209 | break; | ||
210 | } | ||
211 | |||
212 | cvmx_write_csr(CVMX_L2C_PFCTL, pfctl.u64); | ||
213 | } | ||
214 | |||
215 | uint64_t cvmx_l2c_read_perf(uint32_t counter) | ||
216 | { | ||
217 | switch (counter) { | ||
218 | case 0: | ||
219 | return cvmx_read_csr(CVMX_L2C_PFC0); | ||
220 | case 1: | ||
221 | return cvmx_read_csr(CVMX_L2C_PFC1); | ||
222 | case 2: | ||
223 | return cvmx_read_csr(CVMX_L2C_PFC2); | ||
224 | case 3: | ||
225 | default: | ||
226 | return cvmx_read_csr(CVMX_L2C_PFC3); | ||
227 | } | ||
228 | } | ||
229 | |||
230 | /** | ||
231 | * @INTERNAL | ||
232 | * Helper function use to fault in cache lines for L2 cache locking | ||
233 | * | ||
234 | * @addr: Address of base of memory region to read into L2 cache | ||
235 | * @len: Length (in bytes) of region to fault in | ||
236 | */ | ||
237 | static void fault_in(uint64_t addr, int len) | ||
238 | { | ||
239 | volatile char *ptr; | ||
240 | volatile char dummy; | ||
241 | /* | ||
242 | * Adjust addr and length so we get all cache lines even for | ||
243 | * small ranges spanning two cache lines | ||
244 | */ | ||
245 | len += addr & CVMX_CACHE_LINE_MASK; | ||
246 | addr &= ~CVMX_CACHE_LINE_MASK; | ||
247 | ptr = (volatile char *)cvmx_phys_to_ptr(addr); | ||
248 | /* | ||
249 | * Invalidate L1 cache to make sure all loads result in data | ||
250 | * being in L2. | ||
251 | */ | ||
252 | CVMX_DCACHE_INVALIDATE; | ||
253 | while (len > 0) { | ||
254 | dummy += *ptr; | ||
255 | len -= CVMX_CACHE_LINE_SIZE; | ||
256 | ptr += CVMX_CACHE_LINE_SIZE; | ||
257 | } | ||
258 | } | ||
259 | |||
260 | int cvmx_l2c_lock_line(uint64_t addr) | ||
261 | { | ||
262 | int retval = 0; | ||
263 | union cvmx_l2c_dbg l2cdbg; | ||
264 | union cvmx_l2c_lckbase lckbase; | ||
265 | union cvmx_l2c_lckoff lckoff; | ||
266 | union cvmx_l2t_err l2t_err; | ||
267 | l2cdbg.u64 = 0; | ||
268 | lckbase.u64 = 0; | ||
269 | lckoff.u64 = 0; | ||
270 | |||
271 | cvmx_spinlock_lock(&cvmx_l2c_spinlock); | ||
272 | |||
273 | /* Clear l2t error bits if set */ | ||
274 | l2t_err.u64 = cvmx_read_csr(CVMX_L2T_ERR); | ||
275 | l2t_err.s.lckerr = 1; | ||
276 | l2t_err.s.lckerr2 = 1; | ||
277 | cvmx_write_csr(CVMX_L2T_ERR, l2t_err.u64); | ||
278 | |||
279 | addr &= ~CVMX_CACHE_LINE_MASK; | ||
280 | |||
281 | /* Set this core as debug core */ | ||
282 | l2cdbg.s.ppnum = cvmx_get_core_num(); | ||
283 | CVMX_SYNC; | ||
284 | cvmx_write_csr(CVMX_L2C_DBG, l2cdbg.u64); | ||
285 | cvmx_read_csr(CVMX_L2C_DBG); | ||
286 | |||
287 | lckoff.s.lck_offset = 0; /* Only lock 1 line at a time */ | ||
288 | cvmx_write_csr(CVMX_L2C_LCKOFF, lckoff.u64); | ||
289 | cvmx_read_csr(CVMX_L2C_LCKOFF); | ||
290 | |||
291 | if (((union cvmx_l2c_cfg) (cvmx_read_csr(CVMX_L2C_CFG))).s.idxalias) { | ||
292 | int alias_shift = | ||
293 | CVMX_L2C_IDX_ADDR_SHIFT + 2 * CVMX_L2_SET_BITS - 1; | ||
294 | uint64_t addr_tmp = | ||
295 | addr ^ (addr & ((1 << alias_shift) - 1)) >> | ||
296 | CVMX_L2_SET_BITS; | ||
297 | lckbase.s.lck_base = addr_tmp >> 7; | ||
298 | } else { | ||
299 | lckbase.s.lck_base = addr >> 7; | ||
300 | } | ||
301 | |||
302 | lckbase.s.lck_ena = 1; | ||
303 | cvmx_write_csr(CVMX_L2C_LCKBASE, lckbase.u64); | ||
304 | cvmx_read_csr(CVMX_L2C_LCKBASE); /* Make sure it gets there */ | ||
305 | |||
306 | fault_in(addr, CVMX_CACHE_LINE_SIZE); | ||
307 | |||
308 | lckbase.s.lck_ena = 0; | ||
309 | cvmx_write_csr(CVMX_L2C_LCKBASE, lckbase.u64); | ||
310 | cvmx_read_csr(CVMX_L2C_LCKBASE); /* Make sure it gets there */ | ||
311 | |||
312 | /* Stop being debug core */ | ||
313 | cvmx_write_csr(CVMX_L2C_DBG, 0); | ||
314 | cvmx_read_csr(CVMX_L2C_DBG); | ||
315 | |||
316 | l2t_err.u64 = cvmx_read_csr(CVMX_L2T_ERR); | ||
317 | if (l2t_err.s.lckerr || l2t_err.s.lckerr2) | ||
318 | retval = 1; /* We were unable to lock the line */ | ||
319 | |||
320 | cvmx_spinlock_unlock(&cvmx_l2c_spinlock); | ||
321 | |||
322 | return retval; | ||
323 | } | ||
324 | |||
325 | int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len) | ||
326 | { | ||
327 | int retval = 0; | ||
328 | |||
329 | /* Round start/end to cache line boundaries */ | ||
330 | len += start & CVMX_CACHE_LINE_MASK; | ||
331 | start &= ~CVMX_CACHE_LINE_MASK; | ||
332 | len = (len + CVMX_CACHE_LINE_MASK) & ~CVMX_CACHE_LINE_MASK; | ||
333 | |||
334 | while (len) { | ||
335 | retval += cvmx_l2c_lock_line(start); | ||
336 | start += CVMX_CACHE_LINE_SIZE; | ||
337 | len -= CVMX_CACHE_LINE_SIZE; | ||
338 | } | ||
339 | |||
340 | return retval; | ||
341 | } | ||
342 | |||
343 | void cvmx_l2c_flush(void) | ||
344 | { | ||
345 | uint64_t assoc, set; | ||
346 | uint64_t n_assoc, n_set; | ||
347 | union cvmx_l2c_dbg l2cdbg; | ||
348 | |||
349 | cvmx_spinlock_lock(&cvmx_l2c_spinlock); | ||
350 | |||
351 | l2cdbg.u64 = 0; | ||
352 | if (!OCTEON_IS_MODEL(OCTEON_CN30XX)) | ||
353 | l2cdbg.s.ppnum = cvmx_get_core_num(); | ||
354 | l2cdbg.s.finv = 1; | ||
355 | n_set = CVMX_L2_SETS; | ||
356 | n_assoc = l2_size_half() ? (CVMX_L2_ASSOC / 2) : CVMX_L2_ASSOC; | ||
357 | for (set = 0; set < n_set; set++) { | ||
358 | for (assoc = 0; assoc < n_assoc; assoc++) { | ||
359 | l2cdbg.s.set = assoc; | ||
360 | /* Enter debug mode, and make sure all other | ||
361 | ** writes complete before we enter debug | ||
362 | ** mode */ | ||
363 | CVMX_SYNCW; | ||
364 | cvmx_write_csr(CVMX_L2C_DBG, l2cdbg.u64); | ||
365 | cvmx_read_csr(CVMX_L2C_DBG); | ||
366 | |||
367 | CVMX_PREPARE_FOR_STORE(CVMX_ADD_SEG | ||
368 | (CVMX_MIPS_SPACE_XKPHYS, | ||
369 | set * CVMX_CACHE_LINE_SIZE), 0); | ||
370 | CVMX_SYNCW; /* Push STF out to L2 */ | ||
371 | /* Exit debug mode */ | ||
372 | CVMX_SYNC; | ||
373 | cvmx_write_csr(CVMX_L2C_DBG, 0); | ||
374 | cvmx_read_csr(CVMX_L2C_DBG); | ||
375 | } | ||
376 | } | ||
377 | |||
378 | cvmx_spinlock_unlock(&cvmx_l2c_spinlock); | ||
379 | } | ||
380 | |||
381 | int cvmx_l2c_unlock_line(uint64_t address) | ||
382 | { | ||
383 | int assoc; | ||
384 | union cvmx_l2c_tag tag; | ||
385 | union cvmx_l2c_dbg l2cdbg; | ||
386 | uint32_t tag_addr; | ||
387 | |||
388 | uint32_t index = cvmx_l2c_address_to_index(address); | ||
389 | |||
390 | cvmx_spinlock_lock(&cvmx_l2c_spinlock); | ||
391 | /* Compute portion of address that is stored in tag */ | ||
392 | tag_addr = | ||
393 | ((address >> CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) & | ||
394 | ((1 << CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) - 1)); | ||
395 | for (assoc = 0; assoc < CVMX_L2_ASSOC; assoc++) { | ||
396 | tag = cvmx_get_l2c_tag(assoc, index); | ||
397 | |||
398 | if (tag.s.V && (tag.s.addr == tag_addr)) { | ||
399 | l2cdbg.u64 = 0; | ||
400 | l2cdbg.s.ppnum = cvmx_get_core_num(); | ||
401 | l2cdbg.s.set = assoc; | ||
402 | l2cdbg.s.finv = 1; | ||
403 | |||
404 | CVMX_SYNC; | ||
405 | /* Enter debug mode */ | ||
406 | cvmx_write_csr(CVMX_L2C_DBG, l2cdbg.u64); | ||
407 | cvmx_read_csr(CVMX_L2C_DBG); | ||
408 | |||
409 | CVMX_PREPARE_FOR_STORE(CVMX_ADD_SEG | ||
410 | (CVMX_MIPS_SPACE_XKPHYS, | ||
411 | address), 0); | ||
412 | CVMX_SYNC; | ||
413 | /* Exit debug mode */ | ||
414 | cvmx_write_csr(CVMX_L2C_DBG, 0); | ||
415 | cvmx_read_csr(CVMX_L2C_DBG); | ||
416 | cvmx_spinlock_unlock(&cvmx_l2c_spinlock); | ||
417 | return tag.s.L; | ||
418 | } | ||
419 | } | ||
420 | cvmx_spinlock_unlock(&cvmx_l2c_spinlock); | ||
421 | return 0; | ||
422 | } | ||
423 | |||
424 | int cvmx_l2c_unlock_mem_region(uint64_t start, uint64_t len) | ||
425 | { | ||
426 | int num_unlocked = 0; | ||
427 | /* Round start/end to cache line boundaries */ | ||
428 | len += start & CVMX_CACHE_LINE_MASK; | ||
429 | start &= ~CVMX_CACHE_LINE_MASK; | ||
430 | len = (len + CVMX_CACHE_LINE_MASK) & ~CVMX_CACHE_LINE_MASK; | ||
431 | while (len > 0) { | ||
432 | num_unlocked += cvmx_l2c_unlock_line(start); | ||
433 | start += CVMX_CACHE_LINE_SIZE; | ||
434 | len -= CVMX_CACHE_LINE_SIZE; | ||
435 | } | ||
436 | |||
437 | return num_unlocked; | ||
438 | } | ||
439 | |||
440 | /* | ||
441 | * Internal l2c tag types. These are converted to a generic structure | ||
442 | * that can be used on all chips. | ||
443 | */ | ||
444 | union __cvmx_l2c_tag { | ||
445 | uint64_t u64; | ||
446 | struct cvmx_l2c_tag_cn50xx { | ||
447 | uint64_t reserved:40; | ||
448 | uint64_t V:1; /* Line valid */ | ||
449 | uint64_t D:1; /* Line dirty */ | ||
450 | uint64_t L:1; /* Line locked */ | ||
451 | uint64_t U:1; /* Use, LRU eviction */ | ||
452 | uint64_t addr:20; /* Phys mem addr (33..14) */ | ||
453 | } cn50xx; | ||
454 | struct cvmx_l2c_tag_cn30xx { | ||
455 | uint64_t reserved:41; | ||
456 | uint64_t V:1; /* Line valid */ | ||
457 | uint64_t D:1; /* Line dirty */ | ||
458 | uint64_t L:1; /* Line locked */ | ||
459 | uint64_t U:1; /* Use, LRU eviction */ | ||
460 | uint64_t addr:19; /* Phys mem addr (33..15) */ | ||
461 | } cn30xx; | ||
462 | struct cvmx_l2c_tag_cn31xx { | ||
463 | uint64_t reserved:42; | ||
464 | uint64_t V:1; /* Line valid */ | ||
465 | uint64_t D:1; /* Line dirty */ | ||
466 | uint64_t L:1; /* Line locked */ | ||
467 | uint64_t U:1; /* Use, LRU eviction */ | ||
468 | uint64_t addr:18; /* Phys mem addr (33..16) */ | ||
469 | } cn31xx; | ||
470 | struct cvmx_l2c_tag_cn38xx { | ||
471 | uint64_t reserved:43; | ||
472 | uint64_t V:1; /* Line valid */ | ||
473 | uint64_t D:1; /* Line dirty */ | ||
474 | uint64_t L:1; /* Line locked */ | ||
475 | uint64_t U:1; /* Use, LRU eviction */ | ||
476 | uint64_t addr:17; /* Phys mem addr (33..17) */ | ||
477 | } cn38xx; | ||
478 | struct cvmx_l2c_tag_cn58xx { | ||
479 | uint64_t reserved:44; | ||
480 | uint64_t V:1; /* Line valid */ | ||
481 | uint64_t D:1; /* Line dirty */ | ||
482 | uint64_t L:1; /* Line locked */ | ||
483 | uint64_t U:1; /* Use, LRU eviction */ | ||
484 | uint64_t addr:16; /* Phys mem addr (33..18) */ | ||
485 | } cn58xx; | ||
486 | struct cvmx_l2c_tag_cn58xx cn56xx; /* 2048 sets */ | ||
487 | struct cvmx_l2c_tag_cn31xx cn52xx; /* 512 sets */ | ||
488 | }; | ||
489 | |||
490 | /** | ||
491 | * @INTERNAL | ||
492 | * Function to read a L2C tag. This code make the current core | ||
493 | * the 'debug core' for the L2. This code must only be executed by | ||
494 | * 1 core at a time. | ||
495 | * | ||
496 | * @assoc: Association (way) of the tag to dump | ||
497 | * @index: Index of the cacheline | ||
498 | * | ||
499 | * Returns The Octeon model specific tag structure. This is | ||
500 | * translated by a wrapper function to a generic form that is | ||
501 | * easier for applications to use. | ||
502 | */ | ||
503 | static union __cvmx_l2c_tag __read_l2_tag(uint64_t assoc, uint64_t index) | ||
504 | { | ||
505 | |||
506 | uint64_t debug_tag_addr = (((1ULL << 63) | (index << 7)) + 96); | ||
507 | uint64_t core = cvmx_get_core_num(); | ||
508 | union __cvmx_l2c_tag tag_val; | ||
509 | uint64_t dbg_addr = CVMX_L2C_DBG; | ||
510 | unsigned long flags; | ||
511 | |||
512 | union cvmx_l2c_dbg debug_val; | ||
513 | debug_val.u64 = 0; | ||
514 | /* | ||
515 | * For low core count parts, the core number is always small enough | ||
516 | * to stay in the correct field and not set any reserved bits. | ||
517 | */ | ||
518 | debug_val.s.ppnum = core; | ||
519 | debug_val.s.l2t = 1; | ||
520 | debug_val.s.set = assoc; | ||
521 | /* | ||
522 | * Make sure core is quiet (no prefetches, etc.) before | ||
523 | * entering debug mode. | ||
524 | */ | ||
525 | CVMX_SYNC; | ||
526 | /* Flush L1 to make sure debug load misses L1 */ | ||
527 | CVMX_DCACHE_INVALIDATE; | ||
528 | |||
529 | local_irq_save(flags); | ||
530 | |||
531 | /* | ||
532 | * The following must be done in assembly as when in debug | ||
533 | * mode all data loads from L2 return special debug data, not | ||
534 | * normal memory contents. Also, interrupts must be | ||
535 | * disabled, since if an interrupt occurs while in debug mode | ||
536 | * the ISR will get debug data from all its memory reads | ||
537 | * instead of the contents of memory | ||
538 | */ | ||
539 | |||
540 | asm volatile (".set push \n" | ||
541 | " .set mips64 \n" | ||
542 | " .set noreorder \n" | ||
543 | /* Enter debug mode, wait for store */ | ||
544 | " sd %[dbg_val], 0(%[dbg_addr]) \n" | ||
545 | " ld $0, 0(%[dbg_addr]) \n" | ||
546 | /* Read L2C tag data */ | ||
547 | " ld %[tag_val], 0(%[tag_addr]) \n" | ||
548 | /* Exit debug mode, wait for store */ | ||
549 | " sd $0, 0(%[dbg_addr]) \n" | ||
550 | " ld $0, 0(%[dbg_addr]) \n" | ||
551 | /* Invalidate dcache to discard debug data */ | ||
552 | " cache 9, 0($0) \n" | ||
553 | " .set pop" : | ||
554 | [tag_val] "=r"(tag_val.u64) : [dbg_addr] "r"(dbg_addr), | ||
555 | [dbg_val] "r"(debug_val.u64), | ||
556 | [tag_addr] "r"(debug_tag_addr) : "memory"); | ||
557 | |||
558 | local_irq_restore(flags); | ||
559 | return tag_val; | ||
560 | |||
561 | } | ||
562 | |||
563 | union cvmx_l2c_tag cvmx_l2c_get_tag(uint32_t association, uint32_t index) | ||
564 | { | ||
565 | union __cvmx_l2c_tag tmp_tag; | ||
566 | union cvmx_l2c_tag tag; | ||
567 | tag.u64 = 0; | ||
568 | |||
569 | if ((int)association >= cvmx_l2c_get_num_assoc()) { | ||
570 | cvmx_dprintf | ||
571 | ("ERROR: cvmx_get_l2c_tag association out of range\n"); | ||
572 | return tag; | ||
573 | } | ||
574 | if ((int)index >= cvmx_l2c_get_num_sets()) { | ||
575 | cvmx_dprintf("ERROR: cvmx_get_l2c_tag " | ||
576 | "index out of range (arg: %d, max: %d\n", | ||
577 | index, cvmx_l2c_get_num_sets()); | ||
578 | return tag; | ||
579 | } | ||
580 | /* __read_l2_tag is intended for internal use only */ | ||
581 | tmp_tag = __read_l2_tag(association, index); | ||
582 | |||
583 | /* | ||
584 | * Convert all tag structure types to generic version, as it | ||
585 | * can represent all models. | ||
586 | */ | ||
587 | if (OCTEON_IS_MODEL(OCTEON_CN58XX) || OCTEON_IS_MODEL(OCTEON_CN56XX)) { | ||
588 | tag.s.V = tmp_tag.cn58xx.V; | ||
589 | tag.s.D = tmp_tag.cn58xx.D; | ||
590 | tag.s.L = tmp_tag.cn58xx.L; | ||
591 | tag.s.U = tmp_tag.cn58xx.U; | ||
592 | tag.s.addr = tmp_tag.cn58xx.addr; | ||
593 | } else if (OCTEON_IS_MODEL(OCTEON_CN38XX)) { | ||
594 | tag.s.V = tmp_tag.cn38xx.V; | ||
595 | tag.s.D = tmp_tag.cn38xx.D; | ||
596 | tag.s.L = tmp_tag.cn38xx.L; | ||
597 | tag.s.U = tmp_tag.cn38xx.U; | ||
598 | tag.s.addr = tmp_tag.cn38xx.addr; | ||
599 | } else if (OCTEON_IS_MODEL(OCTEON_CN31XX) | ||
600 | || OCTEON_IS_MODEL(OCTEON_CN52XX)) { | ||
601 | tag.s.V = tmp_tag.cn31xx.V; | ||
602 | tag.s.D = tmp_tag.cn31xx.D; | ||
603 | tag.s.L = tmp_tag.cn31xx.L; | ||
604 | tag.s.U = tmp_tag.cn31xx.U; | ||
605 | tag.s.addr = tmp_tag.cn31xx.addr; | ||
606 | } else if (OCTEON_IS_MODEL(OCTEON_CN30XX)) { | ||
607 | tag.s.V = tmp_tag.cn30xx.V; | ||
608 | tag.s.D = tmp_tag.cn30xx.D; | ||
609 | tag.s.L = tmp_tag.cn30xx.L; | ||
610 | tag.s.U = tmp_tag.cn30xx.U; | ||
611 | tag.s.addr = tmp_tag.cn30xx.addr; | ||
612 | } else if (OCTEON_IS_MODEL(OCTEON_CN50XX)) { | ||
613 | tag.s.V = tmp_tag.cn50xx.V; | ||
614 | tag.s.D = tmp_tag.cn50xx.D; | ||
615 | tag.s.L = tmp_tag.cn50xx.L; | ||
616 | tag.s.U = tmp_tag.cn50xx.U; | ||
617 | tag.s.addr = tmp_tag.cn50xx.addr; | ||
618 | } else { | ||
619 | cvmx_dprintf("Unsupported OCTEON Model in %s\n", __func__); | ||
620 | } | ||
621 | |||
622 | return tag; | ||
623 | } | ||
624 | |||
625 | uint32_t cvmx_l2c_address_to_index(uint64_t addr) | ||
626 | { | ||
627 | uint64_t idx = addr >> CVMX_L2C_IDX_ADDR_SHIFT; | ||
628 | union cvmx_l2c_cfg l2c_cfg; | ||
629 | l2c_cfg.u64 = cvmx_read_csr(CVMX_L2C_CFG); | ||
630 | |||
631 | if (l2c_cfg.s.idxalias) { | ||
632 | idx ^= | ||
633 | ((addr & CVMX_L2C_ALIAS_MASK) >> | ||
634 | CVMX_L2C_TAG_ADDR_ALIAS_SHIFT); | ||
635 | } | ||
636 | idx &= CVMX_L2C_IDX_MASK; | ||
637 | return idx; | ||
638 | } | ||
639 | |||
640 | int cvmx_l2c_get_cache_size_bytes(void) | ||
641 | { | ||
642 | return cvmx_l2c_get_num_sets() * cvmx_l2c_get_num_assoc() * | ||
643 | CVMX_CACHE_LINE_SIZE; | ||
644 | } | ||
645 | |||
646 | /** | ||
647 | * Return log base 2 of the number of sets in the L2 cache | ||
648 | * Returns | ||
649 | */ | ||
650 | int cvmx_l2c_get_set_bits(void) | ||
651 | { | ||
652 | int l2_set_bits; | ||
653 | if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN58XX)) | ||
654 | l2_set_bits = 11; /* 2048 sets */ | ||
655 | else if (OCTEON_IS_MODEL(OCTEON_CN38XX)) | ||
656 | l2_set_bits = 10; /* 1024 sets */ | ||
657 | else if (OCTEON_IS_MODEL(OCTEON_CN31XX) | ||
658 | || OCTEON_IS_MODEL(OCTEON_CN52XX)) | ||
659 | l2_set_bits = 9; /* 512 sets */ | ||
660 | else if (OCTEON_IS_MODEL(OCTEON_CN30XX)) | ||
661 | l2_set_bits = 8; /* 256 sets */ | ||
662 | else if (OCTEON_IS_MODEL(OCTEON_CN50XX)) | ||
663 | l2_set_bits = 7; /* 128 sets */ | ||
664 | else { | ||
665 | cvmx_dprintf("Unsupported OCTEON Model in %s\n", __func__); | ||
666 | l2_set_bits = 11; /* 2048 sets */ | ||
667 | } | ||
668 | return l2_set_bits; | ||
669 | |||
670 | } | ||
671 | |||
672 | /* Return the number of sets in the L2 Cache */ | ||
673 | int cvmx_l2c_get_num_sets(void) | ||
674 | { | ||
675 | return 1 << cvmx_l2c_get_set_bits(); | ||
676 | } | ||
677 | |||
678 | /* Return the number of associations in the L2 Cache */ | ||
679 | int cvmx_l2c_get_num_assoc(void) | ||
680 | { | ||
681 | int l2_assoc; | ||
682 | if (OCTEON_IS_MODEL(OCTEON_CN56XX) || | ||
683 | OCTEON_IS_MODEL(OCTEON_CN52XX) || | ||
684 | OCTEON_IS_MODEL(OCTEON_CN58XX) || | ||
685 | OCTEON_IS_MODEL(OCTEON_CN50XX) || OCTEON_IS_MODEL(OCTEON_CN38XX)) | ||
686 | l2_assoc = 8; | ||
687 | else if (OCTEON_IS_MODEL(OCTEON_CN31XX) || | ||
688 | OCTEON_IS_MODEL(OCTEON_CN30XX)) | ||
689 | l2_assoc = 4; | ||
690 | else { | ||
691 | cvmx_dprintf("Unsupported OCTEON Model in %s\n", __func__); | ||
692 | l2_assoc = 8; | ||
693 | } | ||
694 | |||
695 | /* Check to see if part of the cache is disabled */ | ||
696 | if (cvmx_fuse_read(265)) | ||
697 | l2_assoc = l2_assoc >> 2; | ||
698 | else if (cvmx_fuse_read(264)) | ||
699 | l2_assoc = l2_assoc >> 1; | ||
700 | |||
701 | return l2_assoc; | ||
702 | } | ||
703 | |||
704 | /** | ||
705 | * Flush a line from the L2 cache | ||
706 | * This should only be called from one core at a time, as this routine | ||
707 | * sets the core to the 'debug' core in order to flush the line. | ||
708 | * | ||
709 | * @assoc: Association (or way) to flush | ||
710 | * @index: Index to flush | ||
711 | */ | ||
712 | void cvmx_l2c_flush_line(uint32_t assoc, uint32_t index) | ||
713 | { | ||
714 | union cvmx_l2c_dbg l2cdbg; | ||
715 | |||
716 | l2cdbg.u64 = 0; | ||
717 | l2cdbg.s.ppnum = cvmx_get_core_num(); | ||
718 | l2cdbg.s.finv = 1; | ||
719 | |||
720 | l2cdbg.s.set = assoc; | ||
721 | /* | ||
722 | * Enter debug mode, and make sure all other writes complete | ||
723 | * before we enter debug mode. | ||
724 | */ | ||
725 | asm volatile ("sync" : : : "memory"); | ||
726 | cvmx_write_csr(CVMX_L2C_DBG, l2cdbg.u64); | ||
727 | cvmx_read_csr(CVMX_L2C_DBG); | ||
728 | |||
729 | CVMX_PREPARE_FOR_STORE(((1ULL << 63) + (index) * 128), 0); | ||
730 | /* Exit debug mode */ | ||
731 | asm volatile ("sync" : : : "memory"); | ||
732 | cvmx_write_csr(CVMX_L2C_DBG, 0); | ||
733 | cvmx_read_csr(CVMX_L2C_DBG); | ||
734 | } | ||
diff --git a/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c new file mode 100644 index 000000000000..4812370706a1 --- /dev/null +++ b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c | |||
@@ -0,0 +1,116 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * This module provides system/board/application information obtained | ||
30 | * by the bootloader. | ||
31 | */ | ||
32 | |||
33 | #include <asm/octeon/cvmx.h> | ||
34 | #include <asm/octeon/cvmx-spinlock.h> | ||
35 | #include <asm/octeon/cvmx-sysinfo.h> | ||
36 | |||
37 | /** | ||
38 | * This structure defines the private state maintained by sysinfo module. | ||
39 | * | ||
40 | */ | ||
41 | static struct { | ||
42 | struct cvmx_sysinfo sysinfo; /* system information */ | ||
43 | cvmx_spinlock_t lock; /* mutex spinlock */ | ||
44 | |||
45 | } state = { | ||
46 | .lock = CVMX_SPINLOCK_UNLOCKED_INITIALIZER | ||
47 | }; | ||
48 | |||
49 | |||
50 | /* | ||
51 | * Global variables that define the min/max of the memory region set | ||
52 | * up for 32 bit userspace access. | ||
53 | */ | ||
54 | uint64_t linux_mem32_min; | ||
55 | uint64_t linux_mem32_max; | ||
56 | uint64_t linux_mem32_wired; | ||
57 | uint64_t linux_mem32_offset; | ||
58 | |||
59 | /** | ||
60 | * This function returns the application information as obtained | ||
61 | * by the bootloader. This provides the core mask of the cores | ||
62 | * running the same application image, as well as the physical | ||
63 | * memory regions available to the core. | ||
64 | * | ||
65 | * Returns Pointer to the boot information structure | ||
66 | * | ||
67 | */ | ||
68 | struct cvmx_sysinfo *cvmx_sysinfo_get(void) | ||
69 | { | ||
70 | return &(state.sysinfo); | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * This function is used in non-simple executive environments (such as | ||
75 | * Linux kernel, u-boot, etc.) to configure the minimal fields that | ||
76 | * are required to use simple executive files directly. | ||
77 | * | ||
78 | * Locking (if required) must be handled outside of this | ||
79 | * function | ||
80 | * | ||
81 | * @phy_mem_desc_ptr: | ||
82 | * Pointer to global physical memory descriptor | ||
83 | * (bootmem descriptor) @board_type: Octeon board | ||
84 | * type enumeration | ||
85 | * | ||
86 | * @board_rev_major: | ||
87 | * Board major revision | ||
88 | * @board_rev_minor: | ||
89 | * Board minor revision | ||
90 | * @cpu_clock_hz: | ||
91 | * CPU clock freqency in hertz | ||
92 | * | ||
93 | * Returns 0: Failure | ||
94 | * 1: success | ||
95 | */ | ||
96 | int cvmx_sysinfo_minimal_initialize(void *phy_mem_desc_ptr, | ||
97 | uint16_t board_type, | ||
98 | uint8_t board_rev_major, | ||
99 | uint8_t board_rev_minor, | ||
100 | uint32_t cpu_clock_hz) | ||
101 | { | ||
102 | |||
103 | /* The sysinfo structure was already initialized */ | ||
104 | if (state.sysinfo.board_type) | ||
105 | return 0; | ||
106 | |||
107 | memset(&(state.sysinfo), 0x0, sizeof(state.sysinfo)); | ||
108 | state.sysinfo.phy_mem_desc_ptr = phy_mem_desc_ptr; | ||
109 | state.sysinfo.board_type = board_type; | ||
110 | state.sysinfo.board_rev_major = board_rev_major; | ||
111 | state.sysinfo.board_rev_minor = board_rev_minor; | ||
112 | state.sysinfo.cpu_clock_hz = cpu_clock_hz; | ||
113 | |||
114 | return 1; | ||
115 | } | ||
116 | |||
diff --git a/arch/mips/cavium-octeon/executive/octeon-model.c b/arch/mips/cavium-octeon/executive/octeon-model.c new file mode 100644 index 000000000000..9afc3794ed1b --- /dev/null +++ b/arch/mips/cavium-octeon/executive/octeon-model.c | |||
@@ -0,0 +1,358 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * File defining functions for working with different Octeon | ||
30 | * models. | ||
31 | */ | ||
32 | #include <asm/octeon/octeon.h> | ||
33 | |||
34 | /** | ||
35 | * Given the chip processor ID from COP0, this function returns a | ||
36 | * string representing the chip model number. The string is of the | ||
37 | * form CNXXXXpX.X-FREQ-SUFFIX. | ||
38 | * - XXXX = The chip model number | ||
39 | * - X.X = Chip pass number | ||
40 | * - FREQ = Current frequency in Mhz | ||
41 | * - SUFFIX = NSP, EXP, SCP, SSP, or CP | ||
42 | * | ||
43 | * @chip_id: Chip ID | ||
44 | * | ||
45 | * Returns Model string | ||
46 | */ | ||
47 | const char *octeon_model_get_string(uint32_t chip_id) | ||
48 | { | ||
49 | static char buffer[32]; | ||
50 | return octeon_model_get_string_buffer(chip_id, buffer); | ||
51 | } | ||
52 | |||
53 | /* | ||
54 | * Version of octeon_model_get_string() that takes buffer as argument, | ||
55 | * as running early in u-boot static/global variables don't work when | ||
56 | * running from flash. | ||
57 | */ | ||
58 | const char *octeon_model_get_string_buffer(uint32_t chip_id, char *buffer) | ||
59 | { | ||
60 | const char *family; | ||
61 | const char *core_model; | ||
62 | char pass[4]; | ||
63 | int clock_mhz; | ||
64 | const char *suffix; | ||
65 | union cvmx_l2d_fus3 fus3; | ||
66 | int num_cores; | ||
67 | union cvmx_mio_fus_dat2 fus_dat2; | ||
68 | union cvmx_mio_fus_dat3 fus_dat3; | ||
69 | char fuse_model[10]; | ||
70 | uint32_t fuse_data = 0; | ||
71 | |||
72 | fus3.u64 = cvmx_read_csr(CVMX_L2D_FUS3); | ||
73 | fus_dat2.u64 = cvmx_read_csr(CVMX_MIO_FUS_DAT2); | ||
74 | fus_dat3.u64 = cvmx_read_csr(CVMX_MIO_FUS_DAT3); | ||
75 | |||
76 | num_cores = cvmx_octeon_num_cores(); | ||
77 | |||
78 | /* Make sure the non existant devices look disabled */ | ||
79 | switch ((chip_id >> 8) & 0xff) { | ||
80 | case 6: /* CN50XX */ | ||
81 | case 2: /* CN30XX */ | ||
82 | fus_dat3.s.nodfa_dte = 1; | ||
83 | fus_dat3.s.nozip = 1; | ||
84 | break; | ||
85 | case 4: /* CN57XX or CN56XX */ | ||
86 | fus_dat3.s.nodfa_dte = 1; | ||
87 | break; | ||
88 | default: | ||
89 | break; | ||
90 | } | ||
91 | |||
92 | /* Make a guess at the suffix */ | ||
93 | /* NSP = everything */ | ||
94 | /* EXP = No crypto */ | ||
95 | /* SCP = No DFA, No zip */ | ||
96 | /* CP = No DFA, No crypto, No zip */ | ||
97 | if (fus_dat3.s.nodfa_dte) { | ||
98 | if (fus_dat2.s.nocrypto) | ||
99 | suffix = "CP"; | ||
100 | else | ||
101 | suffix = "SCP"; | ||
102 | } else if (fus_dat2.s.nocrypto) | ||
103 | suffix = "EXP"; | ||
104 | else | ||
105 | suffix = "NSP"; | ||
106 | |||
107 | /* | ||
108 | * Assume pass number is encoded using <5:3><2:0>. Exceptions | ||
109 | * will be fixed later. | ||
110 | */ | ||
111 | sprintf(pass, "%u.%u", ((chip_id >> 3) & 7) + 1, chip_id & 7); | ||
112 | |||
113 | /* | ||
114 | * Use the number of cores to determine the last 2 digits of | ||
115 | * the model number. There are some exceptions that are fixed | ||
116 | * later. | ||
117 | */ | ||
118 | switch (num_cores) { | ||
119 | case 16: | ||
120 | core_model = "60"; | ||
121 | break; | ||
122 | case 15: | ||
123 | core_model = "58"; | ||
124 | break; | ||
125 | case 14: | ||
126 | core_model = "55"; | ||
127 | break; | ||
128 | case 13: | ||
129 | core_model = "52"; | ||
130 | break; | ||
131 | case 12: | ||
132 | core_model = "50"; | ||
133 | break; | ||
134 | case 11: | ||
135 | core_model = "48"; | ||
136 | break; | ||
137 | case 10: | ||
138 | core_model = "45"; | ||
139 | break; | ||
140 | case 9: | ||
141 | core_model = "42"; | ||
142 | break; | ||
143 | case 8: | ||
144 | core_model = "40"; | ||
145 | break; | ||
146 | case 7: | ||
147 | core_model = "38"; | ||
148 | break; | ||
149 | case 6: | ||
150 | core_model = "34"; | ||
151 | break; | ||
152 | case 5: | ||
153 | core_model = "32"; | ||
154 | break; | ||
155 | case 4: | ||
156 | core_model = "30"; | ||
157 | break; | ||
158 | case 3: | ||
159 | core_model = "25"; | ||
160 | break; | ||
161 | case 2: | ||
162 | core_model = "20"; | ||
163 | break; | ||
164 | case 1: | ||
165 | core_model = "10"; | ||
166 | break; | ||
167 | default: | ||
168 | core_model = "XX"; | ||
169 | break; | ||
170 | } | ||
171 | |||
172 | /* Now figure out the family, the first two digits */ | ||
173 | switch ((chip_id >> 8) & 0xff) { | ||
174 | case 0: /* CN38XX, CN37XX or CN36XX */ | ||
175 | if (fus3.cn38xx.crip_512k) { | ||
176 | /* | ||
177 | * For some unknown reason, the 16 core one is | ||
178 | * called 37 instead of 36. | ||
179 | */ | ||
180 | if (num_cores >= 16) | ||
181 | family = "37"; | ||
182 | else | ||
183 | family = "36"; | ||
184 | } else | ||
185 | family = "38"; | ||
186 | /* | ||
187 | * This series of chips didn't follow the standard | ||
188 | * pass numbering. | ||
189 | */ | ||
190 | switch (chip_id & 0xf) { | ||
191 | case 0: | ||
192 | strcpy(pass, "1.X"); | ||
193 | break; | ||
194 | case 1: | ||
195 | strcpy(pass, "2.X"); | ||
196 | break; | ||
197 | case 3: | ||
198 | strcpy(pass, "3.X"); | ||
199 | break; | ||
200 | default: | ||
201 | strcpy(pass, "X.X"); | ||
202 | break; | ||
203 | } | ||
204 | break; | ||
205 | case 1: /* CN31XX or CN3020 */ | ||
206 | if ((chip_id & 0x10) || fus3.cn31xx.crip_128k) | ||
207 | family = "30"; | ||
208 | else | ||
209 | family = "31"; | ||
210 | /* | ||
211 | * This series of chips didn't follow the standard | ||
212 | * pass numbering. | ||
213 | */ | ||
214 | switch (chip_id & 0xf) { | ||
215 | case 0: | ||
216 | strcpy(pass, "1.0"); | ||
217 | break; | ||
218 | case 2: | ||
219 | strcpy(pass, "1.1"); | ||
220 | break; | ||
221 | default: | ||
222 | strcpy(pass, "X.X"); | ||
223 | break; | ||
224 | } | ||
225 | break; | ||
226 | case 2: /* CN3010 or CN3005 */ | ||
227 | family = "30"; | ||
228 | /* A chip with half cache is an 05 */ | ||
229 | if (fus3.cn30xx.crip_64k) | ||
230 | core_model = "05"; | ||
231 | /* | ||
232 | * This series of chips didn't follow the standard | ||
233 | * pass numbering. | ||
234 | */ | ||
235 | switch (chip_id & 0xf) { | ||
236 | case 0: | ||
237 | strcpy(pass, "1.0"); | ||
238 | break; | ||
239 | case 2: | ||
240 | strcpy(pass, "1.1"); | ||
241 | break; | ||
242 | default: | ||
243 | strcpy(pass, "X.X"); | ||
244 | break; | ||
245 | } | ||
246 | break; | ||
247 | case 3: /* CN58XX */ | ||
248 | family = "58"; | ||
249 | /* Special case. 4 core, no crypto */ | ||
250 | if ((num_cores == 4) && fus_dat2.cn38xx.nocrypto) | ||
251 | core_model = "29"; | ||
252 | |||
253 | /* Pass 1 uses different encodings for pass numbers */ | ||
254 | if ((chip_id & 0xFF) < 0x8) { | ||
255 | switch (chip_id & 0x3) { | ||
256 | case 0: | ||
257 | strcpy(pass, "1.0"); | ||
258 | break; | ||
259 | case 1: | ||
260 | strcpy(pass, "1.1"); | ||
261 | break; | ||
262 | case 3: | ||
263 | strcpy(pass, "1.2"); | ||
264 | break; | ||
265 | default: | ||
266 | strcpy(pass, "1.X"); | ||
267 | break; | ||
268 | } | ||
269 | } | ||
270 | break; | ||
271 | case 4: /* CN57XX, CN56XX, CN55XX, CN54XX */ | ||
272 | if (fus_dat2.cn56xx.raid_en) { | ||
273 | if (fus3.cn56xx.crip_1024k) | ||
274 | family = "55"; | ||
275 | else | ||
276 | family = "57"; | ||
277 | if (fus_dat2.cn56xx.nocrypto) | ||
278 | suffix = "SP"; | ||
279 | else | ||
280 | suffix = "SSP"; | ||
281 | } else { | ||
282 | if (fus_dat2.cn56xx.nocrypto) | ||
283 | suffix = "CP"; | ||
284 | else { | ||
285 | suffix = "NSP"; | ||
286 | if (fus_dat3.s.nozip) | ||
287 | suffix = "SCP"; | ||
288 | } | ||
289 | if (fus3.cn56xx.crip_1024k) | ||
290 | family = "54"; | ||
291 | else | ||
292 | family = "56"; | ||
293 | } | ||
294 | break; | ||
295 | case 6: /* CN50XX */ | ||
296 | family = "50"; | ||
297 | break; | ||
298 | case 7: /* CN52XX */ | ||
299 | if (fus3.cn52xx.crip_256k) | ||
300 | family = "51"; | ||
301 | else | ||
302 | family = "52"; | ||
303 | break; | ||
304 | default: | ||
305 | family = "XX"; | ||
306 | core_model = "XX"; | ||
307 | strcpy(pass, "X.X"); | ||
308 | suffix = "XXX"; | ||
309 | break; | ||
310 | } | ||
311 | |||
312 | clock_mhz = octeon_get_clock_rate() / 1000000; | ||
313 | |||
314 | if (family[0] != '3') { | ||
315 | /* Check for model in fuses, overrides normal decode */ | ||
316 | /* This is _not_ valid for Octeon CN3XXX models */ | ||
317 | fuse_data |= cvmx_fuse_read_byte(51); | ||
318 | fuse_data = fuse_data << 8; | ||
319 | fuse_data |= cvmx_fuse_read_byte(50); | ||
320 | fuse_data = fuse_data << 8; | ||
321 | fuse_data |= cvmx_fuse_read_byte(49); | ||
322 | fuse_data = fuse_data << 8; | ||
323 | fuse_data |= cvmx_fuse_read_byte(48); | ||
324 | if (fuse_data & 0x7ffff) { | ||
325 | int model = fuse_data & 0x3fff; | ||
326 | int suffix = (fuse_data >> 14) & 0x1f; | ||
327 | if (suffix && model) { | ||
328 | /* | ||
329 | * Have both number and suffix in | ||
330 | * fuses, so both | ||
331 | */ | ||
332 | sprintf(fuse_model, "%d%c", | ||
333 | model, 'A' + suffix - 1); | ||
334 | core_model = ""; | ||
335 | family = fuse_model; | ||
336 | } else if (suffix && !model) { | ||
337 | /* | ||
338 | * Only have suffix, so add suffix to | ||
339 | * 'normal' model number. | ||
340 | */ | ||
341 | sprintf(fuse_model, "%s%c", core_model, | ||
342 | 'A' + suffix - 1); | ||
343 | core_model = fuse_model; | ||
344 | } else { | ||
345 | /* | ||
346 | * Don't have suffix, so just use | ||
347 | * model from fuses. | ||
348 | */ | ||
349 | sprintf(fuse_model, "%d", model); | ||
350 | core_model = ""; | ||
351 | family = fuse_model; | ||
352 | } | ||
353 | } | ||
354 | } | ||
355 | sprintf(buffer, "CN%s%sp%s-%d-%s", | ||
356 | family, core_model, pass, clock_mhz, suffix); | ||
357 | return buffer; | ||
358 | } | ||
diff --git a/arch/mips/cavium-octeon/flash_setup.c b/arch/mips/cavium-octeon/flash_setup.c new file mode 100644 index 000000000000..553d36cbcc42 --- /dev/null +++ b/arch/mips/cavium-octeon/flash_setup.c | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * Octeon Bootbus flash setup | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2007, 2008 Cavium Networks | ||
9 | */ | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/mtd/mtd.h> | ||
12 | #include <linux/mtd/map.h> | ||
13 | #include <linux/mtd/partitions.h> | ||
14 | |||
15 | #include <asm/octeon/octeon.h> | ||
16 | |||
17 | static struct map_info flash_map; | ||
18 | static struct mtd_info *mymtd; | ||
19 | #ifdef CONFIG_MTD_PARTITIONS | ||
20 | static int nr_parts; | ||
21 | static struct mtd_partition *parts; | ||
22 | static const char *part_probe_types[] = { | ||
23 | "cmdlinepart", | ||
24 | #ifdef CONFIG_MTD_REDBOOT_PARTS | ||
25 | "RedBoot", | ||
26 | #endif | ||
27 | NULL | ||
28 | }; | ||
29 | #endif | ||
30 | |||
31 | /** | ||
32 | * Module/ driver initialization. | ||
33 | * | ||
34 | * Returns Zero on success | ||
35 | */ | ||
36 | static int __init flash_init(void) | ||
37 | { | ||
38 | /* | ||
39 | * Read the bootbus region 0 setup to determine the base | ||
40 | * address of the flash. | ||
41 | */ | ||
42 | union cvmx_mio_boot_reg_cfgx region_cfg; | ||
43 | region_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(0)); | ||
44 | if (region_cfg.s.en) { | ||
45 | /* | ||
46 | * The bootloader always takes the flash and sets its | ||
47 | * address so the entire flash fits below | ||
48 | * 0x1fc00000. This way the flash aliases to | ||
49 | * 0x1fc00000 for booting. Software can access the | ||
50 | * full flash at the true address, while core boot can | ||
51 | * access 4MB. | ||
52 | */ | ||
53 | /* Use this name so old part lines work */ | ||
54 | flash_map.name = "phys_mapped_flash"; | ||
55 | flash_map.phys = region_cfg.s.base << 16; | ||
56 | flash_map.size = 0x1fc00000 - flash_map.phys; | ||
57 | flash_map.bankwidth = 1; | ||
58 | flash_map.virt = ioremap(flash_map.phys, flash_map.size); | ||
59 | pr_notice("Bootbus flash: Setting flash for %luMB flash at " | ||
60 | "0x%08lx\n", flash_map.size >> 20, flash_map.phys); | ||
61 | simple_map_init(&flash_map); | ||
62 | mymtd = do_map_probe("cfi_probe", &flash_map); | ||
63 | if (mymtd) { | ||
64 | mymtd->owner = THIS_MODULE; | ||
65 | |||
66 | #ifdef CONFIG_MTD_PARTITIONS | ||
67 | nr_parts = parse_mtd_partitions(mymtd, | ||
68 | part_probe_types, | ||
69 | &parts, 0); | ||
70 | if (nr_parts > 0) | ||
71 | add_mtd_partitions(mymtd, parts, nr_parts); | ||
72 | else | ||
73 | add_mtd_device(mymtd); | ||
74 | #else | ||
75 | add_mtd_device(mymtd); | ||
76 | #endif | ||
77 | } else { | ||
78 | pr_err("Failed to register MTD device for flash\n"); | ||
79 | } | ||
80 | } | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | late_initcall(flash_init); | ||
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c new file mode 100644 index 000000000000..fc72984a5dae --- /dev/null +++ b/arch/mips/cavium-octeon/octeon-irq.c | |||
@@ -0,0 +1,497 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004-2008 Cavium Networks | ||
7 | */ | ||
8 | #include <linux/irq.h> | ||
9 | #include <linux/interrupt.h> | ||
10 | #include <linux/hardirq.h> | ||
11 | |||
12 | #include <asm/octeon/octeon.h> | ||
13 | |||
14 | DEFINE_RWLOCK(octeon_irq_ciu0_rwlock); | ||
15 | DEFINE_RWLOCK(octeon_irq_ciu1_rwlock); | ||
16 | DEFINE_SPINLOCK(octeon_irq_msi_lock); | ||
17 | |||
18 | static void octeon_irq_core_ack(unsigned int irq) | ||
19 | { | ||
20 | unsigned int bit = irq - OCTEON_IRQ_SW0; | ||
21 | /* | ||
22 | * We don't need to disable IRQs to make these atomic since | ||
23 | * they are already disabled earlier in the low level | ||
24 | * interrupt code. | ||
25 | */ | ||
26 | clear_c0_status(0x100 << bit); | ||
27 | /* The two user interrupts must be cleared manually. */ | ||
28 | if (bit < 2) | ||
29 | clear_c0_cause(0x100 << bit); | ||
30 | } | ||
31 | |||
32 | static void octeon_irq_core_eoi(unsigned int irq) | ||
33 | { | ||
34 | irq_desc_t *desc = irq_desc + irq; | ||
35 | unsigned int bit = irq - OCTEON_IRQ_SW0; | ||
36 | /* | ||
37 | * If an IRQ is being processed while we are disabling it the | ||
38 | * handler will attempt to unmask the interrupt after it has | ||
39 | * been disabled. | ||
40 | */ | ||
41 | if (desc->status & IRQ_DISABLED) | ||
42 | return; | ||
43 | |||
44 | /* There is a race here. We should fix it. */ | ||
45 | |||
46 | /* | ||
47 | * We don't need to disable IRQs to make these atomic since | ||
48 | * they are already disabled earlier in the low level | ||
49 | * interrupt code. | ||
50 | */ | ||
51 | set_c0_status(0x100 << bit); | ||
52 | } | ||
53 | |||
54 | static void octeon_irq_core_enable(unsigned int irq) | ||
55 | { | ||
56 | unsigned long flags; | ||
57 | unsigned int bit = irq - OCTEON_IRQ_SW0; | ||
58 | |||
59 | /* | ||
60 | * We need to disable interrupts to make sure our updates are | ||
61 | * atomic. | ||
62 | */ | ||
63 | local_irq_save(flags); | ||
64 | set_c0_status(0x100 << bit); | ||
65 | local_irq_restore(flags); | ||
66 | } | ||
67 | |||
68 | static void octeon_irq_core_disable_local(unsigned int irq) | ||
69 | { | ||
70 | unsigned long flags; | ||
71 | unsigned int bit = irq - OCTEON_IRQ_SW0; | ||
72 | /* | ||
73 | * We need to disable interrupts to make sure our updates are | ||
74 | * atomic. | ||
75 | */ | ||
76 | local_irq_save(flags); | ||
77 | clear_c0_status(0x100 << bit); | ||
78 | local_irq_restore(flags); | ||
79 | } | ||
80 | |||
81 | static void octeon_irq_core_disable(unsigned int irq) | ||
82 | { | ||
83 | #ifdef CONFIG_SMP | ||
84 | on_each_cpu((void (*)(void *)) octeon_irq_core_disable_local, | ||
85 | (void *) (long) irq, 1); | ||
86 | #else | ||
87 | octeon_irq_core_disable_local(irq); | ||
88 | #endif | ||
89 | } | ||
90 | |||
91 | static struct irq_chip octeon_irq_chip_core = { | ||
92 | .name = "Core", | ||
93 | .enable = octeon_irq_core_enable, | ||
94 | .disable = octeon_irq_core_disable, | ||
95 | .ack = octeon_irq_core_ack, | ||
96 | .eoi = octeon_irq_core_eoi, | ||
97 | }; | ||
98 | |||
99 | |||
100 | static void octeon_irq_ciu0_ack(unsigned int irq) | ||
101 | { | ||
102 | /* | ||
103 | * In order to avoid any locking accessing the CIU, we | ||
104 | * acknowledge CIU interrupts by disabling all of them. This | ||
105 | * way we can use a per core register and avoid any out of | ||
106 | * core locking requirements. This has the side affect that | ||
107 | * CIU interrupts can't be processed recursively. | ||
108 | * | ||
109 | * We don't need to disable IRQs to make these atomic since | ||
110 | * they are already disabled earlier in the low level | ||
111 | * interrupt code. | ||
112 | */ | ||
113 | clear_c0_status(0x100 << 2); | ||
114 | } | ||
115 | |||
116 | static void octeon_irq_ciu0_eoi(unsigned int irq) | ||
117 | { | ||
118 | /* | ||
119 | * Enable all CIU interrupts again. We don't need to disable | ||
120 | * IRQs to make these atomic since they are already disabled | ||
121 | * earlier in the low level interrupt code. | ||
122 | */ | ||
123 | set_c0_status(0x100 << 2); | ||
124 | } | ||
125 | |||
126 | static void octeon_irq_ciu0_enable(unsigned int irq) | ||
127 | { | ||
128 | int coreid = cvmx_get_core_num(); | ||
129 | unsigned long flags; | ||
130 | uint64_t en0; | ||
131 | int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */ | ||
132 | |||
133 | /* | ||
134 | * A read lock is used here to make sure only one core is ever | ||
135 | * updating the CIU enable bits at a time. During an enable | ||
136 | * the cores don't interfere with each other. During a disable | ||
137 | * the write lock stops any enables that might cause a | ||
138 | * problem. | ||
139 | */ | ||
140 | read_lock_irqsave(&octeon_irq_ciu0_rwlock, flags); | ||
141 | en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); | ||
142 | en0 |= 1ull << bit; | ||
143 | cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0); | ||
144 | cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); | ||
145 | read_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags); | ||
146 | } | ||
147 | |||
148 | static void octeon_irq_ciu0_disable(unsigned int irq) | ||
149 | { | ||
150 | int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */ | ||
151 | unsigned long flags; | ||
152 | uint64_t en0; | ||
153 | #ifdef CONFIG_SMP | ||
154 | int cpu; | ||
155 | write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags); | ||
156 | for_each_online_cpu(cpu) { | ||
157 | int coreid = cpu_logical_map(cpu); | ||
158 | en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); | ||
159 | en0 &= ~(1ull << bit); | ||
160 | cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0); | ||
161 | } | ||
162 | /* | ||
163 | * We need to do a read after the last update to make sure all | ||
164 | * of them are done. | ||
165 | */ | ||
166 | cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2)); | ||
167 | write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags); | ||
168 | #else | ||
169 | int coreid = cvmx_get_core_num(); | ||
170 | local_irq_save(flags); | ||
171 | en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); | ||
172 | en0 &= ~(1ull << bit); | ||
173 | cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0); | ||
174 | cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); | ||
175 | local_irq_restore(flags); | ||
176 | #endif | ||
177 | } | ||
178 | |||
179 | #ifdef CONFIG_SMP | ||
180 | static void octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *dest) | ||
181 | { | ||
182 | int cpu; | ||
183 | int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */ | ||
184 | |||
185 | write_lock(&octeon_irq_ciu0_rwlock); | ||
186 | for_each_online_cpu(cpu) { | ||
187 | int coreid = cpu_logical_map(cpu); | ||
188 | uint64_t en0 = | ||
189 | cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); | ||
190 | if (cpumask_test_cpu(cpu, dest)) | ||
191 | en0 |= 1ull << bit; | ||
192 | else | ||
193 | en0 &= ~(1ull << bit); | ||
194 | cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0); | ||
195 | } | ||
196 | /* | ||
197 | * We need to do a read after the last update to make sure all | ||
198 | * of them are done. | ||
199 | */ | ||
200 | cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2)); | ||
201 | write_unlock(&octeon_irq_ciu0_rwlock); | ||
202 | } | ||
203 | #endif | ||
204 | |||
205 | static struct irq_chip octeon_irq_chip_ciu0 = { | ||
206 | .name = "CIU0", | ||
207 | .enable = octeon_irq_ciu0_enable, | ||
208 | .disable = octeon_irq_ciu0_disable, | ||
209 | .ack = octeon_irq_ciu0_ack, | ||
210 | .eoi = octeon_irq_ciu0_eoi, | ||
211 | #ifdef CONFIG_SMP | ||
212 | .set_affinity = octeon_irq_ciu0_set_affinity, | ||
213 | #endif | ||
214 | }; | ||
215 | |||
216 | |||
217 | static void octeon_irq_ciu1_ack(unsigned int irq) | ||
218 | { | ||
219 | /* | ||
220 | * In order to avoid any locking accessing the CIU, we | ||
221 | * acknowledge CIU interrupts by disabling all of them. This | ||
222 | * way we can use a per core register and avoid any out of | ||
223 | * core locking requirements. This has the side affect that | ||
224 | * CIU interrupts can't be processed recursively. We don't | ||
225 | * need to disable IRQs to make these atomic since they are | ||
226 | * already disabled earlier in the low level interrupt code. | ||
227 | */ | ||
228 | clear_c0_status(0x100 << 3); | ||
229 | } | ||
230 | |||
231 | static void octeon_irq_ciu1_eoi(unsigned int irq) | ||
232 | { | ||
233 | /* | ||
234 | * Enable all CIU interrupts again. We don't need to disable | ||
235 | * IRQs to make these atomic since they are already disabled | ||
236 | * earlier in the low level interrupt code. | ||
237 | */ | ||
238 | set_c0_status(0x100 << 3); | ||
239 | } | ||
240 | |||
241 | static void octeon_irq_ciu1_enable(unsigned int irq) | ||
242 | { | ||
243 | int coreid = cvmx_get_core_num(); | ||
244 | unsigned long flags; | ||
245 | uint64_t en1; | ||
246 | int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */ | ||
247 | |||
248 | /* | ||
249 | * A read lock is used here to make sure only one core is ever | ||
250 | * updating the CIU enable bits at a time. During an enable | ||
251 | * the cores don't interfere with each other. During a disable | ||
252 | * the write lock stops any enables that might cause a | ||
253 | * problem. | ||
254 | */ | ||
255 | read_lock_irqsave(&octeon_irq_ciu1_rwlock, flags); | ||
256 | en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); | ||
257 | en1 |= 1ull << bit; | ||
258 | cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1); | ||
259 | cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); | ||
260 | read_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags); | ||
261 | } | ||
262 | |||
263 | static void octeon_irq_ciu1_disable(unsigned int irq) | ||
264 | { | ||
265 | int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */ | ||
266 | unsigned long flags; | ||
267 | uint64_t en1; | ||
268 | #ifdef CONFIG_SMP | ||
269 | int cpu; | ||
270 | write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags); | ||
271 | for_each_online_cpu(cpu) { | ||
272 | int coreid = cpu_logical_map(cpu); | ||
273 | en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); | ||
274 | en1 &= ~(1ull << bit); | ||
275 | cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1); | ||
276 | } | ||
277 | /* | ||
278 | * We need to do a read after the last update to make sure all | ||
279 | * of them are done. | ||
280 | */ | ||
281 | cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1)); | ||
282 | write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags); | ||
283 | #else | ||
284 | int coreid = cvmx_get_core_num(); | ||
285 | local_irq_save(flags); | ||
286 | en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); | ||
287 | en1 &= ~(1ull << bit); | ||
288 | cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1); | ||
289 | cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); | ||
290 | local_irq_restore(flags); | ||
291 | #endif | ||
292 | } | ||
293 | |||
294 | #ifdef CONFIG_SMP | ||
295 | static void octeon_irq_ciu1_set_affinity(unsigned int irq, const struct cpumask *dest) | ||
296 | { | ||
297 | int cpu; | ||
298 | int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */ | ||
299 | |||
300 | write_lock(&octeon_irq_ciu1_rwlock); | ||
301 | for_each_online_cpu(cpu) { | ||
302 | int coreid = cpu_logical_map(cpu); | ||
303 | uint64_t en1 = | ||
304 | cvmx_read_csr(CVMX_CIU_INTX_EN1 | ||
305 | (coreid * 2 + 1)); | ||
306 | if (cpumask_test_cpu(cpu, dest)) | ||
307 | en1 |= 1ull << bit; | ||
308 | else | ||
309 | en1 &= ~(1ull << bit); | ||
310 | cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1); | ||
311 | } | ||
312 | /* | ||
313 | * We need to do a read after the last update to make sure all | ||
314 | * of them are done. | ||
315 | */ | ||
316 | cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1)); | ||
317 | write_unlock(&octeon_irq_ciu1_rwlock); | ||
318 | } | ||
319 | #endif | ||
320 | |||
321 | static struct irq_chip octeon_irq_chip_ciu1 = { | ||
322 | .name = "CIU1", | ||
323 | .enable = octeon_irq_ciu1_enable, | ||
324 | .disable = octeon_irq_ciu1_disable, | ||
325 | .ack = octeon_irq_ciu1_ack, | ||
326 | .eoi = octeon_irq_ciu1_eoi, | ||
327 | #ifdef CONFIG_SMP | ||
328 | .set_affinity = octeon_irq_ciu1_set_affinity, | ||
329 | #endif | ||
330 | }; | ||
331 | |||
332 | #ifdef CONFIG_PCI_MSI | ||
333 | |||
334 | static void octeon_irq_msi_ack(unsigned int irq) | ||
335 | { | ||
336 | if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) { | ||
337 | /* These chips have PCI */ | ||
338 | cvmx_write_csr(CVMX_NPI_NPI_MSI_RCV, | ||
339 | 1ull << (irq - OCTEON_IRQ_MSI_BIT0)); | ||
340 | } else { | ||
341 | /* | ||
342 | * These chips have PCIe. Thankfully the ACK doesn't | ||
343 | * need any locking. | ||
344 | */ | ||
345 | cvmx_write_csr(CVMX_PEXP_NPEI_MSI_RCV0, | ||
346 | 1ull << (irq - OCTEON_IRQ_MSI_BIT0)); | ||
347 | } | ||
348 | } | ||
349 | |||
350 | static void octeon_irq_msi_eoi(unsigned int irq) | ||
351 | { | ||
352 | /* Nothing needed */ | ||
353 | } | ||
354 | |||
355 | static void octeon_irq_msi_enable(unsigned int irq) | ||
356 | { | ||
357 | if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) { | ||
358 | /* | ||
359 | * Octeon PCI doesn't have the ability to mask/unmask | ||
360 | * MSI interrupts individually. Instead of | ||
361 | * masking/unmasking them in groups of 16, we simple | ||
362 | * assume MSI devices are well behaved. MSI | ||
363 | * interrupts are always enable and the ACK is assumed | ||
364 | * to be enough. | ||
365 | */ | ||
366 | } else { | ||
367 | /* These chips have PCIe. Note that we only support | ||
368 | * the first 64 MSI interrupts. Unfortunately all the | ||
369 | * MSI enables are in the same register. We use | ||
370 | * MSI0's lock to control access to them all. | ||
371 | */ | ||
372 | uint64_t en; | ||
373 | unsigned long flags; | ||
374 | spin_lock_irqsave(&octeon_irq_msi_lock, flags); | ||
375 | en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); | ||
376 | en |= 1ull << (irq - OCTEON_IRQ_MSI_BIT0); | ||
377 | cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en); | ||
378 | cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); | ||
379 | spin_unlock_irqrestore(&octeon_irq_msi_lock, flags); | ||
380 | } | ||
381 | } | ||
382 | |||
383 | static void octeon_irq_msi_disable(unsigned int irq) | ||
384 | { | ||
385 | if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) { | ||
386 | /* See comment in enable */ | ||
387 | } else { | ||
388 | /* | ||
389 | * These chips have PCIe. Note that we only support | ||
390 | * the first 64 MSI interrupts. Unfortunately all the | ||
391 | * MSI enables are in the same register. We use | ||
392 | * MSI0's lock to control access to them all. | ||
393 | */ | ||
394 | uint64_t en; | ||
395 | unsigned long flags; | ||
396 | spin_lock_irqsave(&octeon_irq_msi_lock, flags); | ||
397 | en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); | ||
398 | en &= ~(1ull << (irq - OCTEON_IRQ_MSI_BIT0)); | ||
399 | cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en); | ||
400 | cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); | ||
401 | spin_unlock_irqrestore(&octeon_irq_msi_lock, flags); | ||
402 | } | ||
403 | } | ||
404 | |||
405 | static struct irq_chip octeon_irq_chip_msi = { | ||
406 | .name = "MSI", | ||
407 | .enable = octeon_irq_msi_enable, | ||
408 | .disable = octeon_irq_msi_disable, | ||
409 | .ack = octeon_irq_msi_ack, | ||
410 | .eoi = octeon_irq_msi_eoi, | ||
411 | }; | ||
412 | #endif | ||
413 | |||
414 | void __init arch_init_irq(void) | ||
415 | { | ||
416 | int irq; | ||
417 | |||
418 | #ifdef CONFIG_SMP | ||
419 | /* Set the default affinity to the boot cpu. */ | ||
420 | cpumask_clear(irq_default_affinity); | ||
421 | cpumask_set_cpu(smp_processor_id(), irq_default_affinity); | ||
422 | #endif | ||
423 | |||
424 | if (NR_IRQS < OCTEON_IRQ_LAST) | ||
425 | pr_err("octeon_irq_init: NR_IRQS is set too low\n"); | ||
426 | |||
427 | /* 0 - 15 reserved for i8259 master and slave controller. */ | ||
428 | |||
429 | /* 17 - 23 Mips internal */ | ||
430 | for (irq = OCTEON_IRQ_SW0; irq <= OCTEON_IRQ_TIMER; irq++) { | ||
431 | set_irq_chip_and_handler(irq, &octeon_irq_chip_core, | ||
432 | handle_percpu_irq); | ||
433 | } | ||
434 | |||
435 | /* 24 - 87 CIU_INT_SUM0 */ | ||
436 | for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_BOOTDMA; irq++) { | ||
437 | set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu0, | ||
438 | handle_percpu_irq); | ||
439 | } | ||
440 | |||
441 | /* 88 - 151 CIU_INT_SUM1 */ | ||
442 | for (irq = OCTEON_IRQ_WDOG0; irq <= OCTEON_IRQ_RESERVED151; irq++) { | ||
443 | set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu1, | ||
444 | handle_percpu_irq); | ||
445 | } | ||
446 | |||
447 | #ifdef CONFIG_PCI_MSI | ||
448 | /* 152 - 215 PCI/PCIe MSI interrupts */ | ||
449 | for (irq = OCTEON_IRQ_MSI_BIT0; irq <= OCTEON_IRQ_MSI_BIT63; irq++) { | ||
450 | set_irq_chip_and_handler(irq, &octeon_irq_chip_msi, | ||
451 | handle_percpu_irq); | ||
452 | } | ||
453 | #endif | ||
454 | set_c0_status(0x300 << 2); | ||
455 | } | ||
456 | |||
457 | asmlinkage void plat_irq_dispatch(void) | ||
458 | { | ||
459 | const unsigned long core_id = cvmx_get_core_num(); | ||
460 | const uint64_t ciu_sum0_address = CVMX_CIU_INTX_SUM0(core_id * 2); | ||
461 | const uint64_t ciu_en0_address = CVMX_CIU_INTX_EN0(core_id * 2); | ||
462 | const uint64_t ciu_sum1_address = CVMX_CIU_INT_SUM1; | ||
463 | const uint64_t ciu_en1_address = CVMX_CIU_INTX_EN1(core_id * 2 + 1); | ||
464 | unsigned long cop0_cause; | ||
465 | unsigned long cop0_status; | ||
466 | uint64_t ciu_en; | ||
467 | uint64_t ciu_sum; | ||
468 | |||
469 | while (1) { | ||
470 | cop0_cause = read_c0_cause(); | ||
471 | cop0_status = read_c0_status(); | ||
472 | cop0_cause &= cop0_status; | ||
473 | cop0_cause &= ST0_IM; | ||
474 | |||
475 | if (unlikely(cop0_cause & STATUSF_IP2)) { | ||
476 | ciu_sum = cvmx_read_csr(ciu_sum0_address); | ||
477 | ciu_en = cvmx_read_csr(ciu_en0_address); | ||
478 | ciu_sum &= ciu_en; | ||
479 | if (likely(ciu_sum)) | ||
480 | do_IRQ(fls64(ciu_sum) + OCTEON_IRQ_WORKQ0 - 1); | ||
481 | else | ||
482 | spurious_interrupt(); | ||
483 | } else if (unlikely(cop0_cause & STATUSF_IP3)) { | ||
484 | ciu_sum = cvmx_read_csr(ciu_sum1_address); | ||
485 | ciu_en = cvmx_read_csr(ciu_en1_address); | ||
486 | ciu_sum &= ciu_en; | ||
487 | if (likely(ciu_sum)) | ||
488 | do_IRQ(fls64(ciu_sum) + OCTEON_IRQ_WDOG0 - 1); | ||
489 | else | ||
490 | spurious_interrupt(); | ||
491 | } else if (likely(cop0_cause)) { | ||
492 | do_IRQ(fls(cop0_cause) - 9 + MIPS_CPU_IRQ_BASE); | ||
493 | } else { | ||
494 | break; | ||
495 | } | ||
496 | } | ||
497 | } | ||
diff --git a/arch/mips/cavium-octeon/octeon-memcpy.S b/arch/mips/cavium-octeon/octeon-memcpy.S new file mode 100644 index 000000000000..88e0cddca205 --- /dev/null +++ b/arch/mips/cavium-octeon/octeon-memcpy.S | |||
@@ -0,0 +1,521 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Unified implementation of memcpy, memmove and the __copy_user backend. | ||
7 | * | ||
8 | * Copyright (C) 1998, 99, 2000, 01, 2002 Ralf Baechle (ralf@gnu.org) | ||
9 | * Copyright (C) 1999, 2000, 01, 2002 Silicon Graphics, Inc. | ||
10 | * Copyright (C) 2002 Broadcom, Inc. | ||
11 | * memcpy/copy_user author: Mark Vandevoorde | ||
12 | * | ||
13 | * Mnemonic names for arguments to memcpy/__copy_user | ||
14 | */ | ||
15 | |||
16 | #include <asm/asm.h> | ||
17 | #include <asm/asm-offsets.h> | ||
18 | #include <asm/regdef.h> | ||
19 | |||
20 | #define dst a0 | ||
21 | #define src a1 | ||
22 | #define len a2 | ||
23 | |||
24 | /* | ||
25 | * Spec | ||
26 | * | ||
27 | * memcpy copies len bytes from src to dst and sets v0 to dst. | ||
28 | * It assumes that | ||
29 | * - src and dst don't overlap | ||
30 | * - src is readable | ||
31 | * - dst is writable | ||
32 | * memcpy uses the standard calling convention | ||
33 | * | ||
34 | * __copy_user copies up to len bytes from src to dst and sets a2 (len) to | ||
35 | * the number of uncopied bytes due to an exception caused by a read or write. | ||
36 | * __copy_user assumes that src and dst don't overlap, and that the call is | ||
37 | * implementing one of the following: | ||
38 | * copy_to_user | ||
39 | * - src is readable (no exceptions when reading src) | ||
40 | * copy_from_user | ||
41 | * - dst is writable (no exceptions when writing dst) | ||
42 | * __copy_user uses a non-standard calling convention; see | ||
43 | * arch/mips/include/asm/uaccess.h | ||
44 | * | ||
45 | * When an exception happens on a load, the handler must | ||
46 | # ensure that all of the destination buffer is overwritten to prevent | ||
47 | * leaking information to user mode programs. | ||
48 | */ | ||
49 | |||
50 | /* | ||
51 | * Implementation | ||
52 | */ | ||
53 | |||
54 | /* | ||
55 | * The exception handler for loads requires that: | ||
56 | * 1- AT contain the address of the byte just past the end of the source | ||
57 | * of the copy, | ||
58 | * 2- src_entry <= src < AT, and | ||
59 | * 3- (dst - src) == (dst_entry - src_entry), | ||
60 | * The _entry suffix denotes values when __copy_user was called. | ||
61 | * | ||
62 | * (1) is set up up by uaccess.h and maintained by not writing AT in copy_user | ||
63 | * (2) is met by incrementing src by the number of bytes copied | ||
64 | * (3) is met by not doing loads between a pair of increments of dst and src | ||
65 | * | ||
66 | * The exception handlers for stores adjust len (if necessary) and return. | ||
67 | * These handlers do not need to overwrite any data. | ||
68 | * | ||
69 | * For __rmemcpy and memmove an exception is always a kernel bug, therefore | ||
70 | * they're not protected. | ||
71 | */ | ||
72 | |||
73 | #define EXC(inst_reg,addr,handler) \ | ||
74 | 9: inst_reg, addr; \ | ||
75 | .section __ex_table,"a"; \ | ||
76 | PTR 9b, handler; \ | ||
77 | .previous | ||
78 | |||
79 | /* | ||
80 | * Only on the 64-bit kernel we can made use of 64-bit registers. | ||
81 | */ | ||
82 | #ifdef CONFIG_64BIT | ||
83 | #define USE_DOUBLE | ||
84 | #endif | ||
85 | |||
86 | #ifdef USE_DOUBLE | ||
87 | |||
88 | #define LOAD ld | ||
89 | #define LOADL ldl | ||
90 | #define LOADR ldr | ||
91 | #define STOREL sdl | ||
92 | #define STORER sdr | ||
93 | #define STORE sd | ||
94 | #define ADD daddu | ||
95 | #define SUB dsubu | ||
96 | #define SRL dsrl | ||
97 | #define SRA dsra | ||
98 | #define SLL dsll | ||
99 | #define SLLV dsllv | ||
100 | #define SRLV dsrlv | ||
101 | #define NBYTES 8 | ||
102 | #define LOG_NBYTES 3 | ||
103 | |||
104 | /* | ||
105 | * As we are sharing code base with the mips32 tree (which use the o32 ABI | ||
106 | * register definitions). We need to redefine the register definitions from | ||
107 | * the n64 ABI register naming to the o32 ABI register naming. | ||
108 | */ | ||
109 | #undef t0 | ||
110 | #undef t1 | ||
111 | #undef t2 | ||
112 | #undef t3 | ||
113 | #define t0 $8 | ||
114 | #define t1 $9 | ||
115 | #define t2 $10 | ||
116 | #define t3 $11 | ||
117 | #define t4 $12 | ||
118 | #define t5 $13 | ||
119 | #define t6 $14 | ||
120 | #define t7 $15 | ||
121 | |||
122 | #else | ||
123 | |||
124 | #define LOAD lw | ||
125 | #define LOADL lwl | ||
126 | #define LOADR lwr | ||
127 | #define STOREL swl | ||
128 | #define STORER swr | ||
129 | #define STORE sw | ||
130 | #define ADD addu | ||
131 | #define SUB subu | ||
132 | #define SRL srl | ||
133 | #define SLL sll | ||
134 | #define SRA sra | ||
135 | #define SLLV sllv | ||
136 | #define SRLV srlv | ||
137 | #define NBYTES 4 | ||
138 | #define LOG_NBYTES 2 | ||
139 | |||
140 | #endif /* USE_DOUBLE */ | ||
141 | |||
142 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
143 | #define LDFIRST LOADR | ||
144 | #define LDREST LOADL | ||
145 | #define STFIRST STORER | ||
146 | #define STREST STOREL | ||
147 | #define SHIFT_DISCARD SLLV | ||
148 | #else | ||
149 | #define LDFIRST LOADL | ||
150 | #define LDREST LOADR | ||
151 | #define STFIRST STOREL | ||
152 | #define STREST STORER | ||
153 | #define SHIFT_DISCARD SRLV | ||
154 | #endif | ||
155 | |||
156 | #define FIRST(unit) ((unit)*NBYTES) | ||
157 | #define REST(unit) (FIRST(unit)+NBYTES-1) | ||
158 | #define UNIT(unit) FIRST(unit) | ||
159 | |||
160 | #define ADDRMASK (NBYTES-1) | ||
161 | |||
162 | .text | ||
163 | .set noreorder | ||
164 | .set noat | ||
165 | |||
166 | /* | ||
167 | * A combined memcpy/__copy_user | ||
168 | * __copy_user sets len to 0 for success; else to an upper bound of | ||
169 | * the number of uncopied bytes. | ||
170 | * memcpy sets v0 to dst. | ||
171 | */ | ||
172 | .align 5 | ||
173 | LEAF(memcpy) /* a0=dst a1=src a2=len */ | ||
174 | move v0, dst /* return value */ | ||
175 | __memcpy: | ||
176 | FEXPORT(__copy_user) | ||
177 | /* | ||
178 | * Note: dst & src may be unaligned, len may be 0 | ||
179 | * Temps | ||
180 | */ | ||
181 | # | ||
182 | # Octeon doesn't care if the destination is unaligned. The hardware | ||
183 | # can fix it faster than we can special case the assembly. | ||
184 | # | ||
185 | pref 0, 0(src) | ||
186 | sltu t0, len, NBYTES # Check if < 1 word | ||
187 | bnez t0, copy_bytes_checklen | ||
188 | and t0, src, ADDRMASK # Check if src unaligned | ||
189 | bnez t0, src_unaligned | ||
190 | sltu t0, len, 4*NBYTES # Check if < 4 words | ||
191 | bnez t0, less_than_4units | ||
192 | sltu t0, len, 8*NBYTES # Check if < 8 words | ||
193 | bnez t0, less_than_8units | ||
194 | sltu t0, len, 16*NBYTES # Check if < 16 words | ||
195 | bnez t0, cleanup_both_aligned | ||
196 | sltu t0, len, 128+1 # Check if len < 129 | ||
197 | bnez t0, 1f # Skip prefetch if len is too short | ||
198 | sltu t0, len, 256+1 # Check if len < 257 | ||
199 | bnez t0, 1f # Skip prefetch if len is too short | ||
200 | pref 0, 128(src) # We must not prefetch invalid addresses | ||
201 | # | ||
202 | # This is where we loop if there is more than 128 bytes left | ||
203 | 2: pref 0, 256(src) # We must not prefetch invalid addresses | ||
204 | # | ||
205 | # This is where we loop if we can't prefetch anymore | ||
206 | 1: | ||
207 | EXC( LOAD t0, UNIT(0)(src), l_exc) | ||
208 | EXC( LOAD t1, UNIT(1)(src), l_exc_copy) | ||
209 | EXC( LOAD t2, UNIT(2)(src), l_exc_copy) | ||
210 | EXC( LOAD t3, UNIT(3)(src), l_exc_copy) | ||
211 | SUB len, len, 16*NBYTES | ||
212 | EXC( STORE t0, UNIT(0)(dst), s_exc_p16u) | ||
213 | EXC( STORE t1, UNIT(1)(dst), s_exc_p15u) | ||
214 | EXC( STORE t2, UNIT(2)(dst), s_exc_p14u) | ||
215 | EXC( STORE t3, UNIT(3)(dst), s_exc_p13u) | ||
216 | EXC( LOAD t0, UNIT(4)(src), l_exc_copy) | ||
217 | EXC( LOAD t1, UNIT(5)(src), l_exc_copy) | ||
218 | EXC( LOAD t2, UNIT(6)(src), l_exc_copy) | ||
219 | EXC( LOAD t3, UNIT(7)(src), l_exc_copy) | ||
220 | EXC( STORE t0, UNIT(4)(dst), s_exc_p12u) | ||
221 | EXC( STORE t1, UNIT(5)(dst), s_exc_p11u) | ||
222 | EXC( STORE t2, UNIT(6)(dst), s_exc_p10u) | ||
223 | ADD src, src, 16*NBYTES | ||
224 | EXC( STORE t3, UNIT(7)(dst), s_exc_p9u) | ||
225 | ADD dst, dst, 16*NBYTES | ||
226 | EXC( LOAD t0, UNIT(-8)(src), l_exc_copy) | ||
227 | EXC( LOAD t1, UNIT(-7)(src), l_exc_copy) | ||
228 | EXC( LOAD t2, UNIT(-6)(src), l_exc_copy) | ||
229 | EXC( LOAD t3, UNIT(-5)(src), l_exc_copy) | ||
230 | EXC( STORE t0, UNIT(-8)(dst), s_exc_p8u) | ||
231 | EXC( STORE t1, UNIT(-7)(dst), s_exc_p7u) | ||
232 | EXC( STORE t2, UNIT(-6)(dst), s_exc_p6u) | ||
233 | EXC( STORE t3, UNIT(-5)(dst), s_exc_p5u) | ||
234 | EXC( LOAD t0, UNIT(-4)(src), l_exc_copy) | ||
235 | EXC( LOAD t1, UNIT(-3)(src), l_exc_copy) | ||
236 | EXC( LOAD t2, UNIT(-2)(src), l_exc_copy) | ||
237 | EXC( LOAD t3, UNIT(-1)(src), l_exc_copy) | ||
238 | EXC( STORE t0, UNIT(-4)(dst), s_exc_p4u) | ||
239 | EXC( STORE t1, UNIT(-3)(dst), s_exc_p3u) | ||
240 | EXC( STORE t2, UNIT(-2)(dst), s_exc_p2u) | ||
241 | EXC( STORE t3, UNIT(-1)(dst), s_exc_p1u) | ||
242 | sltu t0, len, 256+1 # See if we can prefetch more | ||
243 | beqz t0, 2b | ||
244 | sltu t0, len, 128 # See if we can loop more time | ||
245 | beqz t0, 1b | ||
246 | nop | ||
247 | # | ||
248 | # Jump here if there are less than 16*NBYTES left. | ||
249 | # | ||
250 | cleanup_both_aligned: | ||
251 | beqz len, done | ||
252 | sltu t0, len, 8*NBYTES | ||
253 | bnez t0, less_than_8units | ||
254 | nop | ||
255 | EXC( LOAD t0, UNIT(0)(src), l_exc) | ||
256 | EXC( LOAD t1, UNIT(1)(src), l_exc_copy) | ||
257 | EXC( LOAD t2, UNIT(2)(src), l_exc_copy) | ||
258 | EXC( LOAD t3, UNIT(3)(src), l_exc_copy) | ||
259 | SUB len, len, 8*NBYTES | ||
260 | EXC( STORE t0, UNIT(0)(dst), s_exc_p8u) | ||
261 | EXC( STORE t1, UNIT(1)(dst), s_exc_p7u) | ||
262 | EXC( STORE t2, UNIT(2)(dst), s_exc_p6u) | ||
263 | EXC( STORE t3, UNIT(3)(dst), s_exc_p5u) | ||
264 | EXC( LOAD t0, UNIT(4)(src), l_exc_copy) | ||
265 | EXC( LOAD t1, UNIT(5)(src), l_exc_copy) | ||
266 | EXC( LOAD t2, UNIT(6)(src), l_exc_copy) | ||
267 | EXC( LOAD t3, UNIT(7)(src), l_exc_copy) | ||
268 | EXC( STORE t0, UNIT(4)(dst), s_exc_p4u) | ||
269 | EXC( STORE t1, UNIT(5)(dst), s_exc_p3u) | ||
270 | EXC( STORE t2, UNIT(6)(dst), s_exc_p2u) | ||
271 | EXC( STORE t3, UNIT(7)(dst), s_exc_p1u) | ||
272 | ADD src, src, 8*NBYTES | ||
273 | beqz len, done | ||
274 | ADD dst, dst, 8*NBYTES | ||
275 | # | ||
276 | # Jump here if there are less than 8*NBYTES left. | ||
277 | # | ||
278 | less_than_8units: | ||
279 | sltu t0, len, 4*NBYTES | ||
280 | bnez t0, less_than_4units | ||
281 | nop | ||
282 | EXC( LOAD t0, UNIT(0)(src), l_exc) | ||
283 | EXC( LOAD t1, UNIT(1)(src), l_exc_copy) | ||
284 | EXC( LOAD t2, UNIT(2)(src), l_exc_copy) | ||
285 | EXC( LOAD t3, UNIT(3)(src), l_exc_copy) | ||
286 | SUB len, len, 4*NBYTES | ||
287 | EXC( STORE t0, UNIT(0)(dst), s_exc_p4u) | ||
288 | EXC( STORE t1, UNIT(1)(dst), s_exc_p3u) | ||
289 | EXC( STORE t2, UNIT(2)(dst), s_exc_p2u) | ||
290 | EXC( STORE t3, UNIT(3)(dst), s_exc_p1u) | ||
291 | ADD src, src, 4*NBYTES | ||
292 | beqz len, done | ||
293 | ADD dst, dst, 4*NBYTES | ||
294 | # | ||
295 | # Jump here if there are less than 4*NBYTES left. This means | ||
296 | # we may need to copy up to 3 NBYTES words. | ||
297 | # | ||
298 | less_than_4units: | ||
299 | sltu t0, len, 1*NBYTES | ||
300 | bnez t0, copy_bytes_checklen | ||
301 | nop | ||
302 | # | ||
303 | # 1) Copy NBYTES, then check length again | ||
304 | # | ||
305 | EXC( LOAD t0, 0(src), l_exc) | ||
306 | SUB len, len, NBYTES | ||
307 | sltu t1, len, 8 | ||
308 | EXC( STORE t0, 0(dst), s_exc_p1u) | ||
309 | ADD src, src, NBYTES | ||
310 | bnez t1, copy_bytes_checklen | ||
311 | ADD dst, dst, NBYTES | ||
312 | # | ||
313 | # 2) Copy NBYTES, then check length again | ||
314 | # | ||
315 | EXC( LOAD t0, 0(src), l_exc) | ||
316 | SUB len, len, NBYTES | ||
317 | sltu t1, len, 8 | ||
318 | EXC( STORE t0, 0(dst), s_exc_p1u) | ||
319 | ADD src, src, NBYTES | ||
320 | bnez t1, copy_bytes_checklen | ||
321 | ADD dst, dst, NBYTES | ||
322 | # | ||
323 | # 3) Copy NBYTES, then check length again | ||
324 | # | ||
325 | EXC( LOAD t0, 0(src), l_exc) | ||
326 | SUB len, len, NBYTES | ||
327 | ADD src, src, NBYTES | ||
328 | ADD dst, dst, NBYTES | ||
329 | b copy_bytes_checklen | ||
330 | EXC( STORE t0, -8(dst), s_exc_p1u) | ||
331 | |||
332 | src_unaligned: | ||
333 | #define rem t8 | ||
334 | SRL t0, len, LOG_NBYTES+2 # +2 for 4 units/iter | ||
335 | beqz t0, cleanup_src_unaligned | ||
336 | and rem, len, (4*NBYTES-1) # rem = len % 4*NBYTES | ||
337 | 1: | ||
338 | /* | ||
339 | * Avoid consecutive LD*'s to the same register since some mips | ||
340 | * implementations can't issue them in the same cycle. | ||
341 | * It's OK to load FIRST(N+1) before REST(N) because the two addresses | ||
342 | * are to the same unit (unless src is aligned, but it's not). | ||
343 | */ | ||
344 | EXC( LDFIRST t0, FIRST(0)(src), l_exc) | ||
345 | EXC( LDFIRST t1, FIRST(1)(src), l_exc_copy) | ||
346 | SUB len, len, 4*NBYTES | ||
347 | EXC( LDREST t0, REST(0)(src), l_exc_copy) | ||
348 | EXC( LDREST t1, REST(1)(src), l_exc_copy) | ||
349 | EXC( LDFIRST t2, FIRST(2)(src), l_exc_copy) | ||
350 | EXC( LDFIRST t3, FIRST(3)(src), l_exc_copy) | ||
351 | EXC( LDREST t2, REST(2)(src), l_exc_copy) | ||
352 | EXC( LDREST t3, REST(3)(src), l_exc_copy) | ||
353 | ADD src, src, 4*NBYTES | ||
354 | EXC( STORE t0, UNIT(0)(dst), s_exc_p4u) | ||
355 | EXC( STORE t1, UNIT(1)(dst), s_exc_p3u) | ||
356 | EXC( STORE t2, UNIT(2)(dst), s_exc_p2u) | ||
357 | EXC( STORE t3, UNIT(3)(dst), s_exc_p1u) | ||
358 | bne len, rem, 1b | ||
359 | ADD dst, dst, 4*NBYTES | ||
360 | |||
361 | cleanup_src_unaligned: | ||
362 | beqz len, done | ||
363 | and rem, len, NBYTES-1 # rem = len % NBYTES | ||
364 | beq rem, len, copy_bytes | ||
365 | nop | ||
366 | 1: | ||
367 | EXC( LDFIRST t0, FIRST(0)(src), l_exc) | ||
368 | EXC( LDREST t0, REST(0)(src), l_exc_copy) | ||
369 | SUB len, len, NBYTES | ||
370 | EXC( STORE t0, 0(dst), s_exc_p1u) | ||
371 | ADD src, src, NBYTES | ||
372 | bne len, rem, 1b | ||
373 | ADD dst, dst, NBYTES | ||
374 | |||
375 | copy_bytes_checklen: | ||
376 | beqz len, done | ||
377 | nop | ||
378 | copy_bytes: | ||
379 | /* 0 < len < NBYTES */ | ||
380 | #define COPY_BYTE(N) \ | ||
381 | EXC( lb t0, N(src), l_exc); \ | ||
382 | SUB len, len, 1; \ | ||
383 | beqz len, done; \ | ||
384 | EXC( sb t0, N(dst), s_exc_p1) | ||
385 | |||
386 | COPY_BYTE(0) | ||
387 | COPY_BYTE(1) | ||
388 | #ifdef USE_DOUBLE | ||
389 | COPY_BYTE(2) | ||
390 | COPY_BYTE(3) | ||
391 | COPY_BYTE(4) | ||
392 | COPY_BYTE(5) | ||
393 | #endif | ||
394 | EXC( lb t0, NBYTES-2(src), l_exc) | ||
395 | SUB len, len, 1 | ||
396 | jr ra | ||
397 | EXC( sb t0, NBYTES-2(dst), s_exc_p1) | ||
398 | done: | ||
399 | jr ra | ||
400 | nop | ||
401 | END(memcpy) | ||
402 | |||
403 | l_exc_copy: | ||
404 | /* | ||
405 | * Copy bytes from src until faulting load address (or until a | ||
406 | * lb faults) | ||
407 | * | ||
408 | * When reached by a faulting LDFIRST/LDREST, THREAD_BUADDR($28) | ||
409 | * may be more than a byte beyond the last address. | ||
410 | * Hence, the lb below may get an exception. | ||
411 | * | ||
412 | * Assumes src < THREAD_BUADDR($28) | ||
413 | */ | ||
414 | LOAD t0, TI_TASK($28) | ||
415 | nop | ||
416 | LOAD t0, THREAD_BUADDR(t0) | ||
417 | 1: | ||
418 | EXC( lb t1, 0(src), l_exc) | ||
419 | ADD src, src, 1 | ||
420 | sb t1, 0(dst) # can't fault -- we're copy_from_user | ||
421 | bne src, t0, 1b | ||
422 | ADD dst, dst, 1 | ||
423 | l_exc: | ||
424 | LOAD t0, TI_TASK($28) | ||
425 | nop | ||
426 | LOAD t0, THREAD_BUADDR(t0) # t0 is just past last good address | ||
427 | nop | ||
428 | SUB len, AT, t0 # len number of uncopied bytes | ||
429 | /* | ||
430 | * Here's where we rely on src and dst being incremented in tandem, | ||
431 | * See (3) above. | ||
432 | * dst += (fault addr - src) to put dst at first byte to clear | ||
433 | */ | ||
434 | ADD dst, t0 # compute start address in a1 | ||
435 | SUB dst, src | ||
436 | /* | ||
437 | * Clear len bytes starting at dst. Can't call __bzero because it | ||
438 | * might modify len. An inefficient loop for these rare times... | ||
439 | */ | ||
440 | beqz len, done | ||
441 | SUB src, len, 1 | ||
442 | 1: sb zero, 0(dst) | ||
443 | ADD dst, dst, 1 | ||
444 | bnez src, 1b | ||
445 | SUB src, src, 1 | ||
446 | jr ra | ||
447 | nop | ||
448 | |||
449 | |||
450 | #define SEXC(n) \ | ||
451 | s_exc_p ## n ## u: \ | ||
452 | jr ra; \ | ||
453 | ADD len, len, n*NBYTES | ||
454 | |||
455 | SEXC(16) | ||
456 | SEXC(15) | ||
457 | SEXC(14) | ||
458 | SEXC(13) | ||
459 | SEXC(12) | ||
460 | SEXC(11) | ||
461 | SEXC(10) | ||
462 | SEXC(9) | ||
463 | SEXC(8) | ||
464 | SEXC(7) | ||
465 | SEXC(6) | ||
466 | SEXC(5) | ||
467 | SEXC(4) | ||
468 | SEXC(3) | ||
469 | SEXC(2) | ||
470 | SEXC(1) | ||
471 | |||
472 | s_exc_p1: | ||
473 | jr ra | ||
474 | ADD len, len, 1 | ||
475 | s_exc: | ||
476 | jr ra | ||
477 | nop | ||
478 | |||
479 | .align 5 | ||
480 | LEAF(memmove) | ||
481 | ADD t0, a0, a2 | ||
482 | ADD t1, a1, a2 | ||
483 | sltu t0, a1, t0 # dst + len <= src -> memcpy | ||
484 | sltu t1, a0, t1 # dst >= src + len -> memcpy | ||
485 | and t0, t1 | ||
486 | beqz t0, __memcpy | ||
487 | move v0, a0 /* return value */ | ||
488 | beqz a2, r_out | ||
489 | END(memmove) | ||
490 | |||
491 | /* fall through to __rmemcpy */ | ||
492 | LEAF(__rmemcpy) /* a0=dst a1=src a2=len */ | ||
493 | sltu t0, a1, a0 | ||
494 | beqz t0, r_end_bytes_up # src >= dst | ||
495 | nop | ||
496 | ADD a0, a2 # dst = dst + len | ||
497 | ADD a1, a2 # src = src + len | ||
498 | |||
499 | r_end_bytes: | ||
500 | lb t0, -1(a1) | ||
501 | SUB a2, a2, 0x1 | ||
502 | sb t0, -1(a0) | ||
503 | SUB a1, a1, 0x1 | ||
504 | bnez a2, r_end_bytes | ||
505 | SUB a0, a0, 0x1 | ||
506 | |||
507 | r_out: | ||
508 | jr ra | ||
509 | move a2, zero | ||
510 | |||
511 | r_end_bytes_up: | ||
512 | lb t0, (a1) | ||
513 | SUB a2, a2, 0x1 | ||
514 | sb t0, (a0) | ||
515 | ADD a1, a1, 0x1 | ||
516 | bnez a2, r_end_bytes_up | ||
517 | ADD a0, a0, 0x1 | ||
518 | |||
519 | jr ra | ||
520 | move a2, zero | ||
521 | END(__rmemcpy) | ||
diff --git a/arch/mips/cavium-octeon/serial.c b/arch/mips/cavium-octeon/serial.c new file mode 100644 index 000000000000..8240728d485a --- /dev/null +++ b/arch/mips/cavium-octeon/serial.c | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004-2007 Cavium Networks | ||
7 | */ | ||
8 | #include <linux/console.h> | ||
9 | #include <linux/module.h> | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/serial.h> | ||
13 | #include <linux/serial_8250.h> | ||
14 | #include <linux/serial_reg.h> | ||
15 | #include <linux/tty.h> | ||
16 | |||
17 | #include <asm/time.h> | ||
18 | |||
19 | #include <asm/octeon/octeon.h> | ||
20 | |||
21 | #ifdef CONFIG_GDB_CONSOLE | ||
22 | #define DEBUG_UART 0 | ||
23 | #else | ||
24 | #define DEBUG_UART 1 | ||
25 | #endif | ||
26 | |||
27 | unsigned int octeon_serial_in(struct uart_port *up, int offset) | ||
28 | { | ||
29 | int rv = cvmx_read_csr((uint64_t)(up->membase + (offset << 3))); | ||
30 | if (offset == UART_IIR && (rv & 0xf) == 7) { | ||
31 | /* Busy interrupt, read the USR (39) and try again. */ | ||
32 | cvmx_read_csr((uint64_t)(up->membase + (39 << 3))); | ||
33 | rv = cvmx_read_csr((uint64_t)(up->membase + (offset << 3))); | ||
34 | } | ||
35 | return rv; | ||
36 | } | ||
37 | |||
38 | void octeon_serial_out(struct uart_port *up, int offset, int value) | ||
39 | { | ||
40 | /* | ||
41 | * If bits 6 or 7 of the OCTEON UART's LCR are set, it quits | ||
42 | * working. | ||
43 | */ | ||
44 | if (offset == UART_LCR) | ||
45 | value &= 0x9f; | ||
46 | cvmx_write_csr((uint64_t)(up->membase + (offset << 3)), (u8)value); | ||
47 | } | ||
48 | |||
49 | /* | ||
50 | * Allocated in .bss, so it is all zeroed. | ||
51 | */ | ||
52 | #define OCTEON_MAX_UARTS 3 | ||
53 | static struct plat_serial8250_port octeon_uart8250_data[OCTEON_MAX_UARTS + 1]; | ||
54 | static struct platform_device octeon_uart8250_device = { | ||
55 | .name = "serial8250", | ||
56 | .id = PLAT8250_DEV_PLATFORM, | ||
57 | .dev = { | ||
58 | .platform_data = octeon_uart8250_data, | ||
59 | }, | ||
60 | }; | ||
61 | |||
62 | static void __init octeon_uart_set_common(struct plat_serial8250_port *p) | ||
63 | { | ||
64 | p->flags = ASYNC_SKIP_TEST | UPF_SHARE_IRQ | UPF_FIXED_TYPE; | ||
65 | p->type = PORT_OCTEON; | ||
66 | p->iotype = UPIO_MEM; | ||
67 | p->regshift = 3; /* I/O addresses are every 8 bytes */ | ||
68 | p->uartclk = mips_hpt_frequency; | ||
69 | p->serial_in = octeon_serial_in; | ||
70 | p->serial_out = octeon_serial_out; | ||
71 | } | ||
72 | |||
73 | static int __init octeon_serial_init(void) | ||
74 | { | ||
75 | int enable_uart0; | ||
76 | int enable_uart1; | ||
77 | int enable_uart2; | ||
78 | struct plat_serial8250_port *p; | ||
79 | |||
80 | #ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL | ||
81 | /* | ||
82 | * If we are configured to run as the second of two kernels, | ||
83 | * disable uart0 and enable uart1. Uart0 is owned by the first | ||
84 | * kernel | ||
85 | */ | ||
86 | enable_uart0 = 0; | ||
87 | enable_uart1 = 1; | ||
88 | #else | ||
89 | /* | ||
90 | * We are configured for the first kernel. We'll enable uart0 | ||
91 | * if the bootloader told us to use 0, otherwise will enable | ||
92 | * uart 1. | ||
93 | */ | ||
94 | enable_uart0 = (octeon_get_boot_uart() == 0); | ||
95 | enable_uart1 = (octeon_get_boot_uart() == 1); | ||
96 | #ifdef CONFIG_KGDB | ||
97 | enable_uart1 = 1; | ||
98 | #endif | ||
99 | #endif | ||
100 | |||
101 | /* Right now CN52XX is the only chip with a third uart */ | ||
102 | enable_uart2 = OCTEON_IS_MODEL(OCTEON_CN52XX); | ||
103 | |||
104 | p = octeon_uart8250_data; | ||
105 | if (enable_uart0) { | ||
106 | /* Add a ttyS device for hardware uart 0 */ | ||
107 | octeon_uart_set_common(p); | ||
108 | p->membase = (void *) CVMX_MIO_UARTX_RBR(0); | ||
109 | p->mapbase = CVMX_MIO_UARTX_RBR(0) & ((1ull << 49) - 1); | ||
110 | p->irq = OCTEON_IRQ_UART0; | ||
111 | p++; | ||
112 | } | ||
113 | |||
114 | if (enable_uart1) { | ||
115 | /* Add a ttyS device for hardware uart 1 */ | ||
116 | octeon_uart_set_common(p); | ||
117 | p->membase = (void *) CVMX_MIO_UARTX_RBR(1); | ||
118 | p->mapbase = CVMX_MIO_UARTX_RBR(1) & ((1ull << 49) - 1); | ||
119 | p->irq = OCTEON_IRQ_UART1; | ||
120 | p++; | ||
121 | } | ||
122 | if (enable_uart2) { | ||
123 | /* Add a ttyS device for hardware uart 2 */ | ||
124 | octeon_uart_set_common(p); | ||
125 | p->membase = (void *) CVMX_MIO_UART2_RBR; | ||
126 | p->mapbase = CVMX_MIO_UART2_RBR & ((1ull << 49) - 1); | ||
127 | p->irq = OCTEON_IRQ_UART2; | ||
128 | p++; | ||
129 | } | ||
130 | |||
131 | BUG_ON(p > &octeon_uart8250_data[OCTEON_MAX_UARTS]); | ||
132 | |||
133 | return platform_device_register(&octeon_uart8250_device); | ||
134 | } | ||
135 | |||
136 | device_initcall(octeon_serial_init); | ||
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c new file mode 100644 index 000000000000..e085feddb4a4 --- /dev/null +++ b/arch/mips/cavium-octeon/setup.c | |||
@@ -0,0 +1,929 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004-2007 Cavium Networks | ||
7 | * Copyright (C) 2008 Wind River Systems | ||
8 | */ | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/console.h> | ||
11 | #include <linux/delay.h> | ||
12 | #include <linux/interrupt.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/irq.h> | ||
15 | #include <linux/serial.h> | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/string.h> /* for memset */ | ||
18 | #include <linux/serial.h> | ||
19 | #include <linux/tty.h> | ||
20 | #include <linux/time.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/serial_core.h> | ||
23 | #include <linux/serial_8250.h> | ||
24 | #include <linux/string.h> | ||
25 | |||
26 | #include <asm/processor.h> | ||
27 | #include <asm/reboot.h> | ||
28 | #include <asm/smp-ops.h> | ||
29 | #include <asm/system.h> | ||
30 | #include <asm/irq_cpu.h> | ||
31 | #include <asm/mipsregs.h> | ||
32 | #include <asm/bootinfo.h> | ||
33 | #include <asm/sections.h> | ||
34 | #include <asm/time.h> | ||
35 | |||
36 | #include <asm/octeon/octeon.h> | ||
37 | |||
38 | #ifdef CONFIG_CAVIUM_DECODE_RSL | ||
39 | extern void cvmx_interrupt_rsl_decode(void); | ||
40 | extern int __cvmx_interrupt_ecc_report_single_bit_errors; | ||
41 | extern void cvmx_interrupt_rsl_enable(void); | ||
42 | #endif | ||
43 | |||
44 | extern struct plat_smp_ops octeon_smp_ops; | ||
45 | |||
46 | #ifdef CONFIG_PCI | ||
47 | extern void pci_console_init(const char *arg); | ||
48 | #endif | ||
49 | |||
50 | #ifdef CONFIG_CAVIUM_RESERVE32 | ||
51 | extern uint64_t octeon_reserve32_memory; | ||
52 | #endif | ||
53 | static unsigned long long MAX_MEMORY = 512ull << 20; | ||
54 | |||
55 | struct octeon_boot_descriptor *octeon_boot_desc_ptr; | ||
56 | |||
57 | struct cvmx_bootinfo *octeon_bootinfo; | ||
58 | EXPORT_SYMBOL(octeon_bootinfo); | ||
59 | |||
60 | #ifdef CONFIG_CAVIUM_RESERVE32 | ||
61 | uint64_t octeon_reserve32_memory; | ||
62 | EXPORT_SYMBOL(octeon_reserve32_memory); | ||
63 | #endif | ||
64 | |||
65 | static int octeon_uart; | ||
66 | |||
67 | extern asmlinkage void handle_int(void); | ||
68 | extern asmlinkage void plat_irq_dispatch(void); | ||
69 | |||
70 | /** | ||
71 | * Return non zero if we are currently running in the Octeon simulator | ||
72 | * | ||
73 | * Returns | ||
74 | */ | ||
75 | int octeon_is_simulation(void) | ||
76 | { | ||
77 | return octeon_bootinfo->board_type == CVMX_BOARD_TYPE_SIM; | ||
78 | } | ||
79 | EXPORT_SYMBOL(octeon_is_simulation); | ||
80 | |||
81 | /** | ||
82 | * Return true if Octeon is in PCI Host mode. This means | ||
83 | * Linux can control the PCI bus. | ||
84 | * | ||
85 | * Returns Non zero if Octeon in host mode. | ||
86 | */ | ||
87 | int octeon_is_pci_host(void) | ||
88 | { | ||
89 | #ifdef CONFIG_PCI | ||
90 | return octeon_bootinfo->config_flags & CVMX_BOOTINFO_CFG_FLAG_PCI_HOST; | ||
91 | #else | ||
92 | return 0; | ||
93 | #endif | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * Get the clock rate of Octeon | ||
98 | * | ||
99 | * Returns Clock rate in HZ | ||
100 | */ | ||
101 | uint64_t octeon_get_clock_rate(void) | ||
102 | { | ||
103 | if (octeon_is_simulation()) | ||
104 | octeon_bootinfo->eclock_hz = 6000000; | ||
105 | return octeon_bootinfo->eclock_hz; | ||
106 | } | ||
107 | EXPORT_SYMBOL(octeon_get_clock_rate); | ||
108 | |||
109 | /** | ||
110 | * Write to the LCD display connected to the bootbus. This display | ||
111 | * exists on most Cavium evaluation boards. If it doesn't exist, then | ||
112 | * this function doesn't do anything. | ||
113 | * | ||
114 | * @s: String to write | ||
115 | */ | ||
116 | void octeon_write_lcd(const char *s) | ||
117 | { | ||
118 | if (octeon_bootinfo->led_display_base_addr) { | ||
119 | void __iomem *lcd_address = | ||
120 | ioremap_nocache(octeon_bootinfo->led_display_base_addr, | ||
121 | 8); | ||
122 | int i; | ||
123 | for (i = 0; i < 8; i++, s++) { | ||
124 | if (*s) | ||
125 | iowrite8(*s, lcd_address + i); | ||
126 | else | ||
127 | iowrite8(' ', lcd_address + i); | ||
128 | } | ||
129 | iounmap(lcd_address); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | /** | ||
134 | * Return the console uart passed by the bootloader | ||
135 | * | ||
136 | * Returns uart (0 or 1) | ||
137 | */ | ||
138 | int octeon_get_boot_uart(void) | ||
139 | { | ||
140 | int uart; | ||
141 | #ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL | ||
142 | uart = 1; | ||
143 | #else | ||
144 | uart = (octeon_boot_desc_ptr->flags & OCTEON_BL_FLAG_CONSOLE_UART1) ? | ||
145 | 1 : 0; | ||
146 | #endif | ||
147 | return uart; | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * Get the coremask Linux was booted on. | ||
152 | * | ||
153 | * Returns Core mask | ||
154 | */ | ||
155 | int octeon_get_boot_coremask(void) | ||
156 | { | ||
157 | return octeon_boot_desc_ptr->core_mask; | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * Check the hardware BIST results for a CPU | ||
162 | */ | ||
163 | void octeon_check_cpu_bist(void) | ||
164 | { | ||
165 | const int coreid = cvmx_get_core_num(); | ||
166 | unsigned long long mask; | ||
167 | unsigned long long bist_val; | ||
168 | |||
169 | /* Check BIST results for COP0 registers */ | ||
170 | mask = 0x1f00000000ull; | ||
171 | bist_val = read_octeon_c0_icacheerr(); | ||
172 | if (bist_val & mask) | ||
173 | pr_err("Core%d BIST Failure: CacheErr(icache) = 0x%llx\n", | ||
174 | coreid, bist_val); | ||
175 | |||
176 | bist_val = read_octeon_c0_dcacheerr(); | ||
177 | if (bist_val & 1) | ||
178 | pr_err("Core%d L1 Dcache parity error: " | ||
179 | "CacheErr(dcache) = 0x%llx\n", | ||
180 | coreid, bist_val); | ||
181 | |||
182 | mask = 0xfc00000000000000ull; | ||
183 | bist_val = read_c0_cvmmemctl(); | ||
184 | if (bist_val & mask) | ||
185 | pr_err("Core%d BIST Failure: COP0_CVM_MEM_CTL = 0x%llx\n", | ||
186 | coreid, bist_val); | ||
187 | |||
188 | write_octeon_c0_dcacheerr(0); | ||
189 | } | ||
190 | |||
191 | #ifdef CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB | ||
192 | /** | ||
193 | * Called on every core to setup the wired tlb entry needed | ||
194 | * if CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB is set. | ||
195 | * | ||
196 | */ | ||
197 | static void octeon_hal_setup_per_cpu_reserved32(void *unused) | ||
198 | { | ||
199 | /* | ||
200 | * The config has selected to wire the reserve32 memory for all | ||
201 | * userspace applications. We need to put a wired TLB entry in for each | ||
202 | * 512MB of reserve32 memory. We only handle double 256MB pages here, | ||
203 | * so reserve32 must be multiple of 512MB. | ||
204 | */ | ||
205 | uint32_t size = CONFIG_CAVIUM_RESERVE32; | ||
206 | uint32_t entrylo0 = | ||
207 | 0x7 | ((octeon_reserve32_memory & ((1ul << 40) - 1)) >> 6); | ||
208 | uint32_t entrylo1 = entrylo0 + (256 << 14); | ||
209 | uint32_t entryhi = (0x80000000UL - (CONFIG_CAVIUM_RESERVE32 << 20)); | ||
210 | while (size >= 512) { | ||
211 | #if 0 | ||
212 | pr_info("CPU%d: Adding double wired TLB entry for 0x%lx\n", | ||
213 | smp_processor_id(), entryhi); | ||
214 | #endif | ||
215 | add_wired_entry(entrylo0, entrylo1, entryhi, PM_256M); | ||
216 | entrylo0 += 512 << 14; | ||
217 | entrylo1 += 512 << 14; | ||
218 | entryhi += 512 << 20; | ||
219 | size -= 512; | ||
220 | } | ||
221 | } | ||
222 | #endif /* CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB */ | ||
223 | |||
224 | /** | ||
225 | * Called to release the named block which was used to made sure | ||
226 | * that nobody used the memory for something else during | ||
227 | * init. Now we'll free it so userspace apps can use this | ||
228 | * memory region with bootmem_alloc. | ||
229 | * | ||
230 | * This function is called only once from prom_free_prom_memory(). | ||
231 | */ | ||
232 | void octeon_hal_setup_reserved32(void) | ||
233 | { | ||
234 | #ifdef CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB | ||
235 | on_each_cpu(octeon_hal_setup_per_cpu_reserved32, NULL, 0, 1); | ||
236 | #endif | ||
237 | } | ||
238 | |||
239 | /** | ||
240 | * Reboot Octeon | ||
241 | * | ||
242 | * @command: Command to pass to the bootloader. Currently ignored. | ||
243 | */ | ||
244 | static void octeon_restart(char *command) | ||
245 | { | ||
246 | /* Disable all watchdogs before soft reset. They don't get cleared */ | ||
247 | #ifdef CONFIG_SMP | ||
248 | int cpu; | ||
249 | for_each_online_cpu(cpu) | ||
250 | cvmx_write_csr(CVMX_CIU_WDOGX(cpu_logical_map(cpu)), 0); | ||
251 | #else | ||
252 | cvmx_write_csr(CVMX_CIU_WDOGX(cvmx_get_core_num()), 0); | ||
253 | #endif | ||
254 | |||
255 | mb(); | ||
256 | while (1) | ||
257 | cvmx_write_csr(CVMX_CIU_SOFT_RST, 1); | ||
258 | } | ||
259 | |||
260 | |||
261 | /** | ||
262 | * Permanently stop a core. | ||
263 | * | ||
264 | * @arg: Ignored. | ||
265 | */ | ||
266 | static void octeon_kill_core(void *arg) | ||
267 | { | ||
268 | mb(); | ||
269 | if (octeon_is_simulation()) { | ||
270 | /* The simulator needs the watchdog to stop for dead cores */ | ||
271 | cvmx_write_csr(CVMX_CIU_WDOGX(cvmx_get_core_num()), 0); | ||
272 | /* A break instruction causes the simulator stop a core */ | ||
273 | asm volatile ("sync\nbreak"); | ||
274 | } | ||
275 | } | ||
276 | |||
277 | |||
278 | /** | ||
279 | * Halt the system | ||
280 | */ | ||
281 | static void octeon_halt(void) | ||
282 | { | ||
283 | smp_call_function(octeon_kill_core, NULL, 0); | ||
284 | |||
285 | switch (octeon_bootinfo->board_type) { | ||
286 | case CVMX_BOARD_TYPE_NAO38: | ||
287 | /* Driving a 1 to GPIO 12 shuts off this board */ | ||
288 | cvmx_write_csr(CVMX_GPIO_BIT_CFGX(12), 1); | ||
289 | cvmx_write_csr(CVMX_GPIO_TX_SET, 0x1000); | ||
290 | break; | ||
291 | default: | ||
292 | octeon_write_lcd("PowerOff"); | ||
293 | break; | ||
294 | } | ||
295 | |||
296 | octeon_kill_core(NULL); | ||
297 | } | ||
298 | |||
299 | #if 0 | ||
300 | /** | ||
301 | * Platform time init specifics. | ||
302 | * Returns | ||
303 | */ | ||
304 | void __init plat_time_init(void) | ||
305 | { | ||
306 | /* Nothing special here, but we are required to have one */ | ||
307 | } | ||
308 | |||
309 | #endif | ||
310 | |||
311 | /** | ||
312 | * Handle all the error condition interrupts that might occur. | ||
313 | * | ||
314 | */ | ||
315 | #ifdef CONFIG_CAVIUM_DECODE_RSL | ||
316 | static irqreturn_t octeon_rlm_interrupt(int cpl, void *dev_id) | ||
317 | { | ||
318 | cvmx_interrupt_rsl_decode(); | ||
319 | return IRQ_HANDLED; | ||
320 | } | ||
321 | #endif | ||
322 | |||
323 | /** | ||
324 | * Return a string representing the system type | ||
325 | * | ||
326 | * Returns | ||
327 | */ | ||
328 | const char *octeon_board_type_string(void) | ||
329 | { | ||
330 | static char name[80]; | ||
331 | sprintf(name, "%s (%s)", | ||
332 | cvmx_board_type_to_string(octeon_bootinfo->board_type), | ||
333 | octeon_model_get_string(read_c0_prid())); | ||
334 | return name; | ||
335 | } | ||
336 | |||
337 | const char *get_system_type(void) | ||
338 | __attribute__ ((alias("octeon_board_type_string"))); | ||
339 | |||
340 | void octeon_user_io_init(void) | ||
341 | { | ||
342 | union octeon_cvmemctl cvmmemctl; | ||
343 | union cvmx_iob_fau_timeout fau_timeout; | ||
344 | union cvmx_pow_nw_tim nm_tim; | ||
345 | uint64_t cvmctl; | ||
346 | |||
347 | /* Get the current settings for CP0_CVMMEMCTL_REG */ | ||
348 | cvmmemctl.u64 = read_c0_cvmmemctl(); | ||
349 | /* R/W If set, marked write-buffer entries time out the same | ||
350 | * as as other entries; if clear, marked write-buffer entries | ||
351 | * use the maximum timeout. */ | ||
352 | cvmmemctl.s.dismarkwblongto = 1; | ||
353 | /* R/W If set, a merged store does not clear the write-buffer | ||
354 | * entry timeout state. */ | ||
355 | cvmmemctl.s.dismrgclrwbto = 0; | ||
356 | /* R/W Two bits that are the MSBs of the resultant CVMSEG LM | ||
357 | * word location for an IOBDMA. The other 8 bits come from the | ||
358 | * SCRADDR field of the IOBDMA. */ | ||
359 | cvmmemctl.s.iobdmascrmsb = 0; | ||
360 | /* R/W If set, SYNCWS and SYNCS only order marked stores; if | ||
361 | * clear, SYNCWS and SYNCS only order unmarked | ||
362 | * stores. SYNCWSMARKED has no effect when DISSYNCWS is | ||
363 | * set. */ | ||
364 | cvmmemctl.s.syncwsmarked = 0; | ||
365 | /* R/W If set, SYNCWS acts as SYNCW and SYNCS acts as SYNC. */ | ||
366 | cvmmemctl.s.dissyncws = 0; | ||
367 | /* R/W If set, no stall happens on write buffer full. */ | ||
368 | if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS2)) | ||
369 | cvmmemctl.s.diswbfst = 1; | ||
370 | else | ||
371 | cvmmemctl.s.diswbfst = 0; | ||
372 | /* R/W If set (and SX set), supervisor-level loads/stores can | ||
373 | * use XKPHYS addresses with <48>==0 */ | ||
374 | cvmmemctl.s.xkmemenas = 0; | ||
375 | |||
376 | /* R/W If set (and UX set), user-level loads/stores can use | ||
377 | * XKPHYS addresses with VA<48>==0 */ | ||
378 | cvmmemctl.s.xkmemenau = 0; | ||
379 | |||
380 | /* R/W If set (and SX set), supervisor-level loads/stores can | ||
381 | * use XKPHYS addresses with VA<48>==1 */ | ||
382 | cvmmemctl.s.xkioenas = 0; | ||
383 | |||
384 | /* R/W If set (and UX set), user-level loads/stores can use | ||
385 | * XKPHYS addresses with VA<48>==1 */ | ||
386 | cvmmemctl.s.xkioenau = 0; | ||
387 | |||
388 | /* R/W If set, all stores act as SYNCW (NOMERGE must be set | ||
389 | * when this is set) RW, reset to 0. */ | ||
390 | cvmmemctl.s.allsyncw = 0; | ||
391 | |||
392 | /* R/W If set, no stores merge, and all stores reach the | ||
393 | * coherent bus in order. */ | ||
394 | cvmmemctl.s.nomerge = 0; | ||
395 | /* R/W Selects the bit in the counter used for DID time-outs 0 | ||
396 | * = 231, 1 = 230, 2 = 229, 3 = 214. Actual time-out is | ||
397 | * between 1x and 2x this interval. For example, with | ||
398 | * DIDTTO=3, expiration interval is between 16K and 32K. */ | ||
399 | cvmmemctl.s.didtto = 0; | ||
400 | /* R/W If set, the (mem) CSR clock never turns off. */ | ||
401 | cvmmemctl.s.csrckalwys = 0; | ||
402 | /* R/W If set, mclk never turns off. */ | ||
403 | cvmmemctl.s.mclkalwys = 0; | ||
404 | /* R/W Selects the bit in the counter used for write buffer | ||
405 | * flush time-outs (WBFLT+11) is the bit position in an | ||
406 | * internal counter used to determine expiration. The write | ||
407 | * buffer expires between 1x and 2x this interval. For | ||
408 | * example, with WBFLT = 0, a write buffer expires between 2K | ||
409 | * and 4K cycles after the write buffer entry is allocated. */ | ||
410 | cvmmemctl.s.wbfltime = 0; | ||
411 | /* R/W If set, do not put Istream in the L2 cache. */ | ||
412 | cvmmemctl.s.istrnol2 = 0; | ||
413 | /* R/W The write buffer threshold. */ | ||
414 | cvmmemctl.s.wbthresh = 10; | ||
415 | /* R/W If set, CVMSEG is available for loads/stores in | ||
416 | * kernel/debug mode. */ | ||
417 | #if CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0 | ||
418 | cvmmemctl.s.cvmsegenak = 1; | ||
419 | #else | ||
420 | cvmmemctl.s.cvmsegenak = 0; | ||
421 | #endif | ||
422 | /* R/W If set, CVMSEG is available for loads/stores in | ||
423 | * supervisor mode. */ | ||
424 | cvmmemctl.s.cvmsegenas = 0; | ||
425 | /* R/W If set, CVMSEG is available for loads/stores in user | ||
426 | * mode. */ | ||
427 | cvmmemctl.s.cvmsegenau = 0; | ||
428 | /* R/W Size of local memory in cache blocks, 54 (6912 bytes) | ||
429 | * is max legal value. */ | ||
430 | cvmmemctl.s.lmemsz = CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE; | ||
431 | |||
432 | |||
433 | if (smp_processor_id() == 0) | ||
434 | pr_notice("CVMSEG size: %d cache lines (%d bytes)\n", | ||
435 | CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE, | ||
436 | CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE * 128); | ||
437 | |||
438 | write_c0_cvmmemctl(cvmmemctl.u64); | ||
439 | |||
440 | /* Move the performance counter interrupts to IRQ 6 */ | ||
441 | cvmctl = read_c0_cvmctl(); | ||
442 | cvmctl &= ~(7 << 7); | ||
443 | cvmctl |= 6 << 7; | ||
444 | write_c0_cvmctl(cvmctl); | ||
445 | |||
446 | /* Set a default for the hardware timeouts */ | ||
447 | fau_timeout.u64 = 0; | ||
448 | fau_timeout.s.tout_val = 0xfff; | ||
449 | /* Disable tagwait FAU timeout */ | ||
450 | fau_timeout.s.tout_enb = 0; | ||
451 | cvmx_write_csr(CVMX_IOB_FAU_TIMEOUT, fau_timeout.u64); | ||
452 | |||
453 | nm_tim.u64 = 0; | ||
454 | /* 4096 cycles */ | ||
455 | nm_tim.s.nw_tim = 3; | ||
456 | cvmx_write_csr(CVMX_POW_NW_TIM, nm_tim.u64); | ||
457 | |||
458 | write_octeon_c0_icacheerr(0); | ||
459 | write_c0_derraddr1(0); | ||
460 | } | ||
461 | |||
462 | /** | ||
463 | * Early entry point for arch setup | ||
464 | */ | ||
465 | void __init prom_init(void) | ||
466 | { | ||
467 | struct cvmx_sysinfo *sysinfo; | ||
468 | const int coreid = cvmx_get_core_num(); | ||
469 | int i; | ||
470 | int argc; | ||
471 | struct uart_port octeon_port; | ||
472 | #ifdef CONFIG_CAVIUM_RESERVE32 | ||
473 | int64_t addr = -1; | ||
474 | #endif | ||
475 | /* | ||
476 | * The bootloader passes a pointer to the boot descriptor in | ||
477 | * $a3, this is available as fw_arg3. | ||
478 | */ | ||
479 | octeon_boot_desc_ptr = (struct octeon_boot_descriptor *)fw_arg3; | ||
480 | octeon_bootinfo = | ||
481 | cvmx_phys_to_ptr(octeon_boot_desc_ptr->cvmx_desc_vaddr); | ||
482 | cvmx_bootmem_init(cvmx_phys_to_ptr(octeon_bootinfo->phy_mem_desc_addr)); | ||
483 | |||
484 | /* | ||
485 | * Only enable the LED controller if we're running on a CN38XX, CN58XX, | ||
486 | * or CN56XX. The CN30XX and CN31XX don't have an LED controller. | ||
487 | */ | ||
488 | if (!octeon_is_simulation() && | ||
489 | octeon_has_feature(OCTEON_FEATURE_LED_CONTROLLER)) { | ||
490 | cvmx_write_csr(CVMX_LED_EN, 0); | ||
491 | cvmx_write_csr(CVMX_LED_PRT, 0); | ||
492 | cvmx_write_csr(CVMX_LED_DBG, 0); | ||
493 | cvmx_write_csr(CVMX_LED_PRT_FMT, 0); | ||
494 | cvmx_write_csr(CVMX_LED_UDD_CNTX(0), 32); | ||
495 | cvmx_write_csr(CVMX_LED_UDD_CNTX(1), 32); | ||
496 | cvmx_write_csr(CVMX_LED_UDD_DATX(0), 0); | ||
497 | cvmx_write_csr(CVMX_LED_UDD_DATX(1), 0); | ||
498 | cvmx_write_csr(CVMX_LED_EN, 1); | ||
499 | } | ||
500 | #ifdef CONFIG_CAVIUM_RESERVE32 | ||
501 | /* | ||
502 | * We need to temporarily allocate all memory in the reserve32 | ||
503 | * region. This makes sure the kernel doesn't allocate this | ||
504 | * memory when it is getting memory from the | ||
505 | * bootloader. Later, after the memory allocations are | ||
506 | * complete, the reserve32 will be freed. | ||
507 | */ | ||
508 | #ifdef CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB | ||
509 | if (CONFIG_CAVIUM_RESERVE32 & 0x1ff) | ||
510 | pr_err("CAVIUM_RESERVE32 isn't a multiple of 512MB. " | ||
511 | "This is required if CAVIUM_RESERVE32_USE_WIRED_TLB " | ||
512 | "is set\n"); | ||
513 | else | ||
514 | addr = cvmx_bootmem_phy_named_block_alloc(CONFIG_CAVIUM_RESERVE32 << 20, | ||
515 | 0, 0, 512 << 20, | ||
516 | "CAVIUM_RESERVE32", 0); | ||
517 | #else | ||
518 | /* | ||
519 | * Allocate memory for RESERVED32 aligned on 2MB boundary. This | ||
520 | * is in case we later use hugetlb entries with it. | ||
521 | */ | ||
522 | addr = cvmx_bootmem_phy_named_block_alloc(CONFIG_CAVIUM_RESERVE32 << 20, | ||
523 | 0, 0, 2 << 20, | ||
524 | "CAVIUM_RESERVE32", 0); | ||
525 | #endif | ||
526 | if (addr < 0) | ||
527 | pr_err("Failed to allocate CAVIUM_RESERVE32 memory area\n"); | ||
528 | else | ||
529 | octeon_reserve32_memory = addr; | ||
530 | #endif | ||
531 | |||
532 | #ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2 | ||
533 | if (cvmx_read_csr(CVMX_L2D_FUS3) & (3ull << 34)) { | ||
534 | pr_info("Skipping L2 locking due to reduced L2 cache size\n"); | ||
535 | } else { | ||
536 | uint32_t ebase = read_c0_ebase() & 0x3ffff000; | ||
537 | #ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB | ||
538 | /* TLB refill */ | ||
539 | cvmx_l2c_lock_mem_region(ebase, 0x100); | ||
540 | #endif | ||
541 | #ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_EXCEPTION | ||
542 | /* General exception */ | ||
543 | cvmx_l2c_lock_mem_region(ebase + 0x180, 0x80); | ||
544 | #endif | ||
545 | #ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT | ||
546 | /* Interrupt handler */ | ||
547 | cvmx_l2c_lock_mem_region(ebase + 0x200, 0x80); | ||
548 | #endif | ||
549 | #ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_INTERRUPT | ||
550 | cvmx_l2c_lock_mem_region(__pa_symbol(handle_int), 0x100); | ||
551 | cvmx_l2c_lock_mem_region(__pa_symbol(plat_irq_dispatch), 0x80); | ||
552 | #endif | ||
553 | #ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_MEMCPY | ||
554 | cvmx_l2c_lock_mem_region(__pa_symbol(memcpy), 0x480); | ||
555 | #endif | ||
556 | } | ||
557 | #endif | ||
558 | |||
559 | sysinfo = cvmx_sysinfo_get(); | ||
560 | memset(sysinfo, 0, sizeof(*sysinfo)); | ||
561 | sysinfo->system_dram_size = octeon_bootinfo->dram_size << 20; | ||
562 | sysinfo->phy_mem_desc_ptr = | ||
563 | cvmx_phys_to_ptr(octeon_bootinfo->phy_mem_desc_addr); | ||
564 | sysinfo->core_mask = octeon_bootinfo->core_mask; | ||
565 | sysinfo->exception_base_addr = octeon_bootinfo->exception_base_addr; | ||
566 | sysinfo->cpu_clock_hz = octeon_bootinfo->eclock_hz; | ||
567 | sysinfo->dram_data_rate_hz = octeon_bootinfo->dclock_hz * 2; | ||
568 | sysinfo->board_type = octeon_bootinfo->board_type; | ||
569 | sysinfo->board_rev_major = octeon_bootinfo->board_rev_major; | ||
570 | sysinfo->board_rev_minor = octeon_bootinfo->board_rev_minor; | ||
571 | memcpy(sysinfo->mac_addr_base, octeon_bootinfo->mac_addr_base, | ||
572 | sizeof(sysinfo->mac_addr_base)); | ||
573 | sysinfo->mac_addr_count = octeon_bootinfo->mac_addr_count; | ||
574 | memcpy(sysinfo->board_serial_number, | ||
575 | octeon_bootinfo->board_serial_number, | ||
576 | sizeof(sysinfo->board_serial_number)); | ||
577 | sysinfo->compact_flash_common_base_addr = | ||
578 | octeon_bootinfo->compact_flash_common_base_addr; | ||
579 | sysinfo->compact_flash_attribute_base_addr = | ||
580 | octeon_bootinfo->compact_flash_attribute_base_addr; | ||
581 | sysinfo->led_display_base_addr = octeon_bootinfo->led_display_base_addr; | ||
582 | sysinfo->dfa_ref_clock_hz = octeon_bootinfo->dfa_ref_clock_hz; | ||
583 | sysinfo->bootloader_config_flags = octeon_bootinfo->config_flags; | ||
584 | |||
585 | |||
586 | octeon_check_cpu_bist(); | ||
587 | |||
588 | octeon_uart = octeon_get_boot_uart(); | ||
589 | |||
590 | /* | ||
591 | * Disable All CIU Interrupts. The ones we need will be | ||
592 | * enabled later. Read the SUM register so we know the write | ||
593 | * completed. | ||
594 | */ | ||
595 | cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2)), 0); | ||
596 | cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2 + 1)), 0); | ||
597 | cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2)), 0); | ||
598 | cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2 + 1)), 0); | ||
599 | cvmx_read_csr(CVMX_CIU_INTX_SUM0((coreid * 2))); | ||
600 | |||
601 | #ifdef CONFIG_SMP | ||
602 | octeon_write_lcd("LinuxSMP"); | ||
603 | #else | ||
604 | octeon_write_lcd("Linux"); | ||
605 | #endif | ||
606 | |||
607 | #ifdef CONFIG_CAVIUM_GDB | ||
608 | /* | ||
609 | * When debugging the linux kernel, force the cores to enter | ||
610 | * the debug exception handler to break in. | ||
611 | */ | ||
612 | if (octeon_get_boot_debug_flag()) { | ||
613 | cvmx_write_csr(CVMX_CIU_DINT, 1 << cvmx_get_core_num()); | ||
614 | cvmx_read_csr(CVMX_CIU_DINT); | ||
615 | } | ||
616 | #endif | ||
617 | |||
618 | /* | ||
619 | * BIST should always be enabled when doing a soft reset. L2 | ||
620 | * Cache locking for instance is not cleared unless BIST is | ||
621 | * enabled. Unfortunately due to a chip errata G-200 for | ||
622 | * Cn38XX and CN31XX, BIST msut be disabled on these parts. | ||
623 | */ | ||
624 | if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS2) || | ||
625 | OCTEON_IS_MODEL(OCTEON_CN31XX)) | ||
626 | cvmx_write_csr(CVMX_CIU_SOFT_BIST, 0); | ||
627 | else | ||
628 | cvmx_write_csr(CVMX_CIU_SOFT_BIST, 1); | ||
629 | |||
630 | /* Default to 64MB in the simulator to speed things up */ | ||
631 | if (octeon_is_simulation()) | ||
632 | MAX_MEMORY = 64ull << 20; | ||
633 | |||
634 | arcs_cmdline[0] = 0; | ||
635 | argc = octeon_boot_desc_ptr->argc; | ||
636 | for (i = 0; i < argc; i++) { | ||
637 | const char *arg = | ||
638 | cvmx_phys_to_ptr(octeon_boot_desc_ptr->argv[i]); | ||
639 | if ((strncmp(arg, "MEM=", 4) == 0) || | ||
640 | (strncmp(arg, "mem=", 4) == 0)) { | ||
641 | sscanf(arg + 4, "%llu", &MAX_MEMORY); | ||
642 | MAX_MEMORY <<= 20; | ||
643 | if (MAX_MEMORY == 0) | ||
644 | MAX_MEMORY = 32ull << 30; | ||
645 | } else if (strcmp(arg, "ecc_verbose") == 0) { | ||
646 | #ifdef CONFIG_CAVIUM_REPORT_SINGLE_BIT_ECC | ||
647 | __cvmx_interrupt_ecc_report_single_bit_errors = 1; | ||
648 | pr_notice("Reporting of single bit ECC errors is " | ||
649 | "turned on\n"); | ||
650 | #endif | ||
651 | } else if (strlen(arcs_cmdline) + strlen(arg) + 1 < | ||
652 | sizeof(arcs_cmdline) - 1) { | ||
653 | strcat(arcs_cmdline, " "); | ||
654 | strcat(arcs_cmdline, arg); | ||
655 | } | ||
656 | } | ||
657 | |||
658 | if (strstr(arcs_cmdline, "console=") == NULL) { | ||
659 | #ifdef CONFIG_GDB_CONSOLE | ||
660 | strcat(arcs_cmdline, " console=gdb"); | ||
661 | #else | ||
662 | #ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL | ||
663 | strcat(arcs_cmdline, " console=ttyS0,115200"); | ||
664 | #else | ||
665 | if (octeon_uart == 1) | ||
666 | strcat(arcs_cmdline, " console=ttyS1,115200"); | ||
667 | else | ||
668 | strcat(arcs_cmdline, " console=ttyS0,115200"); | ||
669 | #endif | ||
670 | #endif | ||
671 | } | ||
672 | |||
673 | if (octeon_is_simulation()) { | ||
674 | /* | ||
675 | * The simulator uses a mtdram device pre filled with | ||
676 | * the filesystem. Also specify the calibration delay | ||
677 | * to avoid calculating it every time. | ||
678 | */ | ||
679 | strcat(arcs_cmdline, " rw root=1f00" | ||
680 | " lpj=60176 slram=root,0x40000000,+1073741824"); | ||
681 | } | ||
682 | |||
683 | mips_hpt_frequency = octeon_get_clock_rate(); | ||
684 | |||
685 | octeon_init_cvmcount(); | ||
686 | |||
687 | _machine_restart = octeon_restart; | ||
688 | _machine_halt = octeon_halt; | ||
689 | |||
690 | memset(&octeon_port, 0, sizeof(octeon_port)); | ||
691 | /* | ||
692 | * For early_serial_setup we don't set the port type or | ||
693 | * UPF_FIXED_TYPE. | ||
694 | */ | ||
695 | octeon_port.flags = ASYNC_SKIP_TEST | UPF_SHARE_IRQ; | ||
696 | octeon_port.iotype = UPIO_MEM; | ||
697 | /* I/O addresses are every 8 bytes */ | ||
698 | octeon_port.regshift = 3; | ||
699 | /* Clock rate of the chip */ | ||
700 | octeon_port.uartclk = mips_hpt_frequency; | ||
701 | octeon_port.fifosize = 64; | ||
702 | octeon_port.mapbase = 0x0001180000000800ull + (1024 * octeon_uart); | ||
703 | octeon_port.membase = cvmx_phys_to_ptr(octeon_port.mapbase); | ||
704 | octeon_port.serial_in = octeon_serial_in; | ||
705 | octeon_port.serial_out = octeon_serial_out; | ||
706 | #ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL | ||
707 | octeon_port.line = 0; | ||
708 | #else | ||
709 | octeon_port.line = octeon_uart; | ||
710 | #endif | ||
711 | octeon_port.irq = 42 + octeon_uart; | ||
712 | early_serial_setup(&octeon_port); | ||
713 | |||
714 | octeon_user_io_init(); | ||
715 | register_smp_ops(&octeon_smp_ops); | ||
716 | } | ||
717 | |||
718 | void __init plat_mem_setup(void) | ||
719 | { | ||
720 | uint64_t mem_alloc_size; | ||
721 | uint64_t total; | ||
722 | int64_t memory; | ||
723 | |||
724 | total = 0; | ||
725 | |||
726 | /* First add the init memory we will be returning. */ | ||
727 | memory = __pa_symbol(&__init_begin) & PAGE_MASK; | ||
728 | mem_alloc_size = (__pa_symbol(&__init_end) & PAGE_MASK) - memory; | ||
729 | if (mem_alloc_size > 0) { | ||
730 | add_memory_region(memory, mem_alloc_size, BOOT_MEM_RAM); | ||
731 | total += mem_alloc_size; | ||
732 | } | ||
733 | |||
734 | /* | ||
735 | * The Mips memory init uses the first memory location for | ||
736 | * some memory vectors. When SPARSEMEM is in use, it doesn't | ||
737 | * verify that the size is big enough for the final | ||
738 | * vectors. Making the smallest chuck 4MB seems to be enough | ||
739 | * to consistantly work. | ||
740 | */ | ||
741 | mem_alloc_size = 4 << 20; | ||
742 | if (mem_alloc_size > MAX_MEMORY) | ||
743 | mem_alloc_size = MAX_MEMORY; | ||
744 | |||
745 | /* | ||
746 | * When allocating memory, we want incrementing addresses from | ||
747 | * bootmem_alloc so the code in add_memory_region can merge | ||
748 | * regions next to each other. | ||
749 | */ | ||
750 | cvmx_bootmem_lock(); | ||
751 | while ((boot_mem_map.nr_map < BOOT_MEM_MAP_MAX) | ||
752 | && (total < MAX_MEMORY)) { | ||
753 | #if defined(CONFIG_64BIT) || defined(CONFIG_64BIT_PHYS_ADDR) | ||
754 | memory = cvmx_bootmem_phy_alloc(mem_alloc_size, | ||
755 | __pa_symbol(&__init_end), -1, | ||
756 | 0x100000, | ||
757 | CVMX_BOOTMEM_FLAG_NO_LOCKING); | ||
758 | #elif defined(CONFIG_HIGHMEM) | ||
759 | memory = cvmx_bootmem_phy_alloc(mem_alloc_size, 0, 1ull << 31, | ||
760 | 0x100000, | ||
761 | CVMX_BOOTMEM_FLAG_NO_LOCKING); | ||
762 | #else | ||
763 | memory = cvmx_bootmem_phy_alloc(mem_alloc_size, 0, 512 << 20, | ||
764 | 0x100000, | ||
765 | CVMX_BOOTMEM_FLAG_NO_LOCKING); | ||
766 | #endif | ||
767 | if (memory >= 0) { | ||
768 | /* | ||
769 | * This function automatically merges address | ||
770 | * regions next to each other if they are | ||
771 | * received in incrementing order. | ||
772 | */ | ||
773 | add_memory_region(memory, mem_alloc_size, BOOT_MEM_RAM); | ||
774 | total += mem_alloc_size; | ||
775 | } else { | ||
776 | break; | ||
777 | } | ||
778 | } | ||
779 | cvmx_bootmem_unlock(); | ||
780 | |||
781 | #ifdef CONFIG_CAVIUM_RESERVE32 | ||
782 | /* | ||
783 | * Now that we've allocated the kernel memory it is safe to | ||
784 | * free the reserved region. We free it here so that builtin | ||
785 | * drivers can use the memory. | ||
786 | */ | ||
787 | if (octeon_reserve32_memory) | ||
788 | cvmx_bootmem_free_named("CAVIUM_RESERVE32"); | ||
789 | #endif /* CONFIG_CAVIUM_RESERVE32 */ | ||
790 | |||
791 | if (total == 0) | ||
792 | panic("Unable to allocate memory from " | ||
793 | "cvmx_bootmem_phy_alloc\n"); | ||
794 | } | ||
795 | |||
796 | |||
797 | int prom_putchar(char c) | ||
798 | { | ||
799 | uint64_t lsrval; | ||
800 | |||
801 | /* Spin until there is room */ | ||
802 | do { | ||
803 | lsrval = cvmx_read_csr(CVMX_MIO_UARTX_LSR(octeon_uart)); | ||
804 | } while ((lsrval & 0x20) == 0); | ||
805 | |||
806 | /* Write the byte */ | ||
807 | cvmx_write_csr(CVMX_MIO_UARTX_THR(octeon_uart), c); | ||
808 | return 1; | ||
809 | } | ||
810 | |||
811 | void prom_free_prom_memory(void) | ||
812 | { | ||
813 | #ifdef CONFIG_CAVIUM_DECODE_RSL | ||
814 | cvmx_interrupt_rsl_enable(); | ||
815 | |||
816 | /* Add an interrupt handler for general failures. */ | ||
817 | if (request_irq(OCTEON_IRQ_RML, octeon_rlm_interrupt, IRQF_SHARED, | ||
818 | "RML/RSL", octeon_rlm_interrupt)) { | ||
819 | panic("Unable to request_irq(OCTEON_IRQ_RML)\n"); | ||
820 | } | ||
821 | #endif | ||
822 | |||
823 | /* This call is here so that it is performed after any TLB | ||
824 | initializations. It needs to be after these in case the | ||
825 | CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB option is set */ | ||
826 | octeon_hal_setup_reserved32(); | ||
827 | } | ||
828 | |||
829 | static struct octeon_cf_data octeon_cf_data; | ||
830 | |||
831 | static int __init octeon_cf_device_init(void) | ||
832 | { | ||
833 | union cvmx_mio_boot_reg_cfgx mio_boot_reg_cfg; | ||
834 | unsigned long base_ptr, region_base, region_size; | ||
835 | struct platform_device *pd; | ||
836 | struct resource cf_resources[3]; | ||
837 | unsigned int num_resources; | ||
838 | int i; | ||
839 | int ret = 0; | ||
840 | |||
841 | /* Setup octeon-cf platform device if present. */ | ||
842 | base_ptr = 0; | ||
843 | if (octeon_bootinfo->major_version == 1 | ||
844 | && octeon_bootinfo->minor_version >= 1) { | ||
845 | if (octeon_bootinfo->compact_flash_common_base_addr) | ||
846 | base_ptr = | ||
847 | octeon_bootinfo->compact_flash_common_base_addr; | ||
848 | } else { | ||
849 | base_ptr = 0x1d000800; | ||
850 | } | ||
851 | |||
852 | if (!base_ptr) | ||
853 | return ret; | ||
854 | |||
855 | /* Find CS0 region. */ | ||
856 | for (i = 0; i < 8; i++) { | ||
857 | mio_boot_reg_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(i)); | ||
858 | region_base = mio_boot_reg_cfg.s.base << 16; | ||
859 | region_size = (mio_boot_reg_cfg.s.size + 1) << 16; | ||
860 | if (mio_boot_reg_cfg.s.en && base_ptr >= region_base | ||
861 | && base_ptr < region_base + region_size) | ||
862 | break; | ||
863 | } | ||
864 | if (i >= 7) { | ||
865 | /* i and i + 1 are CS0 and CS1, both must be less than 8. */ | ||
866 | goto out; | ||
867 | } | ||
868 | octeon_cf_data.base_region = i; | ||
869 | octeon_cf_data.is16bit = mio_boot_reg_cfg.s.width; | ||
870 | octeon_cf_data.base_region_bias = base_ptr - region_base; | ||
871 | memset(cf_resources, 0, sizeof(cf_resources)); | ||
872 | num_resources = 0; | ||
873 | cf_resources[num_resources].flags = IORESOURCE_MEM; | ||
874 | cf_resources[num_resources].start = region_base; | ||
875 | cf_resources[num_resources].end = region_base + region_size - 1; | ||
876 | num_resources++; | ||
877 | |||
878 | |||
879 | if (!(base_ptr & 0xfffful)) { | ||
880 | /* | ||
881 | * Boot loader signals availability of DMA (true_ide | ||
882 | * mode) by setting low order bits of base_ptr to | ||
883 | * zero. | ||
884 | */ | ||
885 | |||
886 | /* Asume that CS1 immediately follows. */ | ||
887 | mio_boot_reg_cfg.u64 = | ||
888 | cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(i + 1)); | ||
889 | region_base = mio_boot_reg_cfg.s.base << 16; | ||
890 | region_size = (mio_boot_reg_cfg.s.size + 1) << 16; | ||
891 | if (!mio_boot_reg_cfg.s.en) | ||
892 | goto out; | ||
893 | |||
894 | cf_resources[num_resources].flags = IORESOURCE_MEM; | ||
895 | cf_resources[num_resources].start = region_base; | ||
896 | cf_resources[num_resources].end = region_base + region_size - 1; | ||
897 | num_resources++; | ||
898 | |||
899 | octeon_cf_data.dma_engine = 0; | ||
900 | cf_resources[num_resources].flags = IORESOURCE_IRQ; | ||
901 | cf_resources[num_resources].start = OCTEON_IRQ_BOOTDMA; | ||
902 | cf_resources[num_resources].end = OCTEON_IRQ_BOOTDMA; | ||
903 | num_resources++; | ||
904 | } else { | ||
905 | octeon_cf_data.dma_engine = -1; | ||
906 | } | ||
907 | |||
908 | pd = platform_device_alloc("pata_octeon_cf", -1); | ||
909 | if (!pd) { | ||
910 | ret = -ENOMEM; | ||
911 | goto out; | ||
912 | } | ||
913 | pd->dev.platform_data = &octeon_cf_data; | ||
914 | |||
915 | ret = platform_device_add_resources(pd, cf_resources, num_resources); | ||
916 | if (ret) | ||
917 | goto fail; | ||
918 | |||
919 | ret = platform_device_add(pd); | ||
920 | if (ret) | ||
921 | goto fail; | ||
922 | |||
923 | return ret; | ||
924 | fail: | ||
925 | platform_device_put(pd); | ||
926 | out: | ||
927 | return ret; | ||
928 | } | ||
929 | device_initcall(octeon_cf_device_init); | ||
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c new file mode 100644 index 000000000000..24e0ad63980a --- /dev/null +++ b/arch/mips/cavium-octeon/smp.c | |||
@@ -0,0 +1,211 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004-2008 Cavium Networks | ||
7 | */ | ||
8 | #include <linux/init.h> | ||
9 | #include <linux/delay.h> | ||
10 | #include <linux/smp.h> | ||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/kernel_stat.h> | ||
13 | #include <linux/sched.h> | ||
14 | #include <linux/module.h> | ||
15 | |||
16 | #include <asm/mmu_context.h> | ||
17 | #include <asm/system.h> | ||
18 | #include <asm/time.h> | ||
19 | |||
20 | #include <asm/octeon/octeon.h> | ||
21 | |||
22 | volatile unsigned long octeon_processor_boot = 0xff; | ||
23 | volatile unsigned long octeon_processor_sp; | ||
24 | volatile unsigned long octeon_processor_gp; | ||
25 | |||
26 | static irqreturn_t mailbox_interrupt(int irq, void *dev_id) | ||
27 | { | ||
28 | const int coreid = cvmx_get_core_num(); | ||
29 | uint64_t action; | ||
30 | |||
31 | /* Load the mailbox register to figure out what we're supposed to do */ | ||
32 | action = cvmx_read_csr(CVMX_CIU_MBOX_CLRX(coreid)); | ||
33 | |||
34 | /* Clear the mailbox to clear the interrupt */ | ||
35 | cvmx_write_csr(CVMX_CIU_MBOX_CLRX(coreid), action); | ||
36 | |||
37 | if (action & SMP_CALL_FUNCTION) | ||
38 | smp_call_function_interrupt(); | ||
39 | |||
40 | /* Check if we've been told to flush the icache */ | ||
41 | if (action & SMP_ICACHE_FLUSH) | ||
42 | asm volatile ("synci 0($0)\n"); | ||
43 | return IRQ_HANDLED; | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * Cause the function described by call_data to be executed on the passed | ||
48 | * cpu. When the function has finished, increment the finished field of | ||
49 | * call_data. | ||
50 | */ | ||
51 | void octeon_send_ipi_single(int cpu, unsigned int action) | ||
52 | { | ||
53 | int coreid = cpu_logical_map(cpu); | ||
54 | /* | ||
55 | pr_info("SMP: Mailbox send cpu=%d, coreid=%d, action=%u\n", cpu, | ||
56 | coreid, action); | ||
57 | */ | ||
58 | cvmx_write_csr(CVMX_CIU_MBOX_SETX(coreid), action); | ||
59 | } | ||
60 | |||
61 | static inline void octeon_send_ipi_mask(cpumask_t mask, unsigned int action) | ||
62 | { | ||
63 | unsigned int i; | ||
64 | |||
65 | for_each_cpu_mask(i, mask) | ||
66 | octeon_send_ipi_single(i, action); | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * Detect available CPUs, populate phys_cpu_present_map | ||
71 | */ | ||
72 | static void octeon_smp_setup(void) | ||
73 | { | ||
74 | const int coreid = cvmx_get_core_num(); | ||
75 | int cpus; | ||
76 | int id; | ||
77 | |||
78 | int core_mask = octeon_get_boot_coremask(); | ||
79 | |||
80 | cpus_clear(cpu_possible_map); | ||
81 | __cpu_number_map[coreid] = 0; | ||
82 | __cpu_logical_map[0] = coreid; | ||
83 | cpu_set(0, cpu_possible_map); | ||
84 | |||
85 | cpus = 1; | ||
86 | for (id = 0; id < 16; id++) { | ||
87 | if ((id != coreid) && (core_mask & (1 << id))) { | ||
88 | cpu_set(cpus, cpu_possible_map); | ||
89 | __cpu_number_map[id] = cpus; | ||
90 | __cpu_logical_map[cpus] = id; | ||
91 | cpus++; | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * Firmware CPU startup hook | ||
98 | * | ||
99 | */ | ||
100 | static void octeon_boot_secondary(int cpu, struct task_struct *idle) | ||
101 | { | ||
102 | int count; | ||
103 | |||
104 | pr_info("SMP: Booting CPU%02d (CoreId %2d)...\n", cpu, | ||
105 | cpu_logical_map(cpu)); | ||
106 | |||
107 | octeon_processor_sp = __KSTK_TOS(idle); | ||
108 | octeon_processor_gp = (unsigned long)(task_thread_info(idle)); | ||
109 | octeon_processor_boot = cpu_logical_map(cpu); | ||
110 | mb(); | ||
111 | |||
112 | count = 10000; | ||
113 | while (octeon_processor_sp && count) { | ||
114 | /* Waiting for processor to get the SP and GP */ | ||
115 | udelay(1); | ||
116 | count--; | ||
117 | } | ||
118 | if (count == 0) | ||
119 | pr_err("Secondary boot timeout\n"); | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * After we've done initial boot, this function is called to allow the | ||
124 | * board code to clean up state, if needed | ||
125 | */ | ||
126 | static void octeon_init_secondary(void) | ||
127 | { | ||
128 | const int coreid = cvmx_get_core_num(); | ||
129 | union cvmx_ciu_intx_sum0 interrupt_enable; | ||
130 | |||
131 | octeon_check_cpu_bist(); | ||
132 | octeon_init_cvmcount(); | ||
133 | /* | ||
134 | pr_info("SMP: CPU%d (CoreId %lu) started\n", cpu, coreid); | ||
135 | */ | ||
136 | /* Enable Mailbox interrupts to this core. These are the only | ||
137 | interrupts allowed on line 3 */ | ||
138 | cvmx_write_csr(CVMX_CIU_MBOX_CLRX(coreid), 0xffffffff); | ||
139 | interrupt_enable.u64 = 0; | ||
140 | interrupt_enable.s.mbox = 0x3; | ||
141 | cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2)), interrupt_enable.u64); | ||
142 | cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2 + 1)), 0); | ||
143 | cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2)), 0); | ||
144 | cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2 + 1)), 0); | ||
145 | /* Enable core interrupt processing for 2,3 and 7 */ | ||
146 | set_c0_status(0x8c01); | ||
147 | } | ||
148 | |||
149 | /** | ||
150 | * Callout to firmware before smp_init | ||
151 | * | ||
152 | */ | ||
153 | void octeon_prepare_cpus(unsigned int max_cpus) | ||
154 | { | ||
155 | cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffffffff); | ||
156 | if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt, IRQF_SHARED, | ||
157 | "mailbox0", mailbox_interrupt)) { | ||
158 | panic("Cannot request_irq(OCTEON_IRQ_MBOX0)\n"); | ||
159 | } | ||
160 | if (request_irq(OCTEON_IRQ_MBOX1, mailbox_interrupt, IRQF_SHARED, | ||
161 | "mailbox1", mailbox_interrupt)) { | ||
162 | panic("Cannot request_irq(OCTEON_IRQ_MBOX1)\n"); | ||
163 | } | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * Last chance for the board code to finish SMP initialization before | ||
168 | * the CPU is "online". | ||
169 | */ | ||
170 | static void octeon_smp_finish(void) | ||
171 | { | ||
172 | #ifdef CONFIG_CAVIUM_GDB | ||
173 | unsigned long tmp; | ||
174 | /* Pulse MCD0 signal on Ctrl-C to stop all the cores. Also set the MCD0 | ||
175 | to be not masked by this core so we know the signal is received by | ||
176 | someone */ | ||
177 | asm volatile ("dmfc0 %0, $22\n" | ||
178 | "ori %0, %0, 0x9100\n" "dmtc0 %0, $22\n" : "=r" (tmp)); | ||
179 | #endif | ||
180 | |||
181 | octeon_user_io_init(); | ||
182 | |||
183 | /* to generate the first CPU timer interrupt */ | ||
184 | write_c0_compare(read_c0_count() + mips_hpt_frequency / HZ); | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * Hook for after all CPUs are online | ||
189 | */ | ||
190 | static void octeon_cpus_done(void) | ||
191 | { | ||
192 | #ifdef CONFIG_CAVIUM_GDB | ||
193 | unsigned long tmp; | ||
194 | /* Pulse MCD0 signal on Ctrl-C to stop all the cores. Also set the MCD0 | ||
195 | to be not masked by this core so we know the signal is received by | ||
196 | someone */ | ||
197 | asm volatile ("dmfc0 %0, $22\n" | ||
198 | "ori %0, %0, 0x9100\n" "dmtc0 %0, $22\n" : "=r" (tmp)); | ||
199 | #endif | ||
200 | } | ||
201 | |||
202 | struct plat_smp_ops octeon_smp_ops = { | ||
203 | .send_ipi_single = octeon_send_ipi_single, | ||
204 | .send_ipi_mask = octeon_send_ipi_mask, | ||
205 | .init_secondary = octeon_init_secondary, | ||
206 | .smp_finish = octeon_smp_finish, | ||
207 | .cpus_done = octeon_cpus_done, | ||
208 | .boot_secondary = octeon_boot_secondary, | ||
209 | .smp_setup = octeon_smp_setup, | ||
210 | .prepare_cpus = octeon_prepare_cpus, | ||
211 | }; | ||
diff --git a/arch/mips/configs/cavium-octeon_defconfig b/arch/mips/configs/cavium-octeon_defconfig new file mode 100644 index 000000000000..7afaa28a3768 --- /dev/null +++ b/arch/mips/configs/cavium-octeon_defconfig | |||
@@ -0,0 +1,943 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.28-rc6 | ||
4 | # Wed Dec 3 11:00:58 2008 | ||
5 | # | ||
6 | CONFIG_MIPS=y | ||
7 | |||
8 | # | ||
9 | # Machine selection | ||
10 | # | ||
11 | # CONFIG_MACH_ALCHEMY is not set | ||
12 | # CONFIG_BASLER_EXCITE is not set | ||
13 | # CONFIG_BCM47XX is not set | ||
14 | # CONFIG_MIPS_COBALT is not set | ||
15 | # CONFIG_MACH_DECSTATION is not set | ||
16 | # CONFIG_MACH_JAZZ is not set | ||
17 | # CONFIG_LASAT is not set | ||
18 | # CONFIG_LEMOTE_FULONG is not set | ||
19 | # CONFIG_MIPS_MALTA is not set | ||
20 | # CONFIG_MIPS_SIM is not set | ||
21 | # CONFIG_MACH_EMMA is not set | ||
22 | # CONFIG_MACH_VR41XX is not set | ||
23 | # CONFIG_NXP_STB220 is not set | ||
24 | # CONFIG_NXP_STB225 is not set | ||
25 | # CONFIG_PNX8550_JBS is not set | ||
26 | # CONFIG_PNX8550_STB810 is not set | ||
27 | # CONFIG_PMC_MSP is not set | ||
28 | # CONFIG_PMC_YOSEMITE is not set | ||
29 | # CONFIG_SGI_IP22 is not set | ||
30 | # CONFIG_SGI_IP27 is not set | ||
31 | # CONFIG_SGI_IP28 is not set | ||
32 | # CONFIG_SGI_IP32 is not set | ||
33 | # CONFIG_SIBYTE_CRHINE is not set | ||
34 | # CONFIG_SIBYTE_CARMEL is not set | ||
35 | # CONFIG_SIBYTE_CRHONE is not set | ||
36 | # CONFIG_SIBYTE_RHONE is not set | ||
37 | # CONFIG_SIBYTE_SWARM is not set | ||
38 | # CONFIG_SIBYTE_LITTLESUR is not set | ||
39 | # CONFIG_SIBYTE_SENTOSA is not set | ||
40 | # CONFIG_SIBYTE_BIGSUR is not set | ||
41 | # CONFIG_SNI_RM is not set | ||
42 | # CONFIG_MACH_TX39XX is not set | ||
43 | # CONFIG_MACH_TX49XX is not set | ||
44 | # CONFIG_MIKROTIK_RB532 is not set | ||
45 | # CONFIG_WR_PPMC is not set | ||
46 | # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set | ||
47 | CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD=y | ||
48 | CONFIG_CAVIUM_OCTEON_SPECIFIC_OPTIONS=y | ||
49 | # CONFIG_CAVIUM_OCTEON_2ND_KERNEL is not set | ||
50 | CONFIG_CAVIUM_OCTEON_HW_FIX_UNALIGNED=y | ||
51 | CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE=2 | ||
52 | CONFIG_CAVIUM_OCTEON_LOCK_L2=y | ||
53 | CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB=y | ||
54 | CONFIG_CAVIUM_OCTEON_LOCK_L2_EXCEPTION=y | ||
55 | CONFIG_CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT=y | ||
56 | CONFIG_CAVIUM_OCTEON_LOCK_L2_INTERRUPT=y | ||
57 | CONFIG_CAVIUM_OCTEON_LOCK_L2_MEMCPY=y | ||
58 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
59 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
60 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | ||
61 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | ||
62 | CONFIG_ARCH_SUPPORTS_OPROFILE=y | ||
63 | CONFIG_GENERIC_FIND_NEXT_BIT=y | ||
64 | CONFIG_GENERIC_HWEIGHT=y | ||
65 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
66 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
67 | CONFIG_GENERIC_TIME=y | ||
68 | CONFIG_GENERIC_CMOS_UPDATE=y | ||
69 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | ||
70 | # CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set | ||
71 | CONFIG_CEVT_R4K=y | ||
72 | CONFIG_CSRC_R4K=y | ||
73 | CONFIG_DMA_COHERENT=y | ||
74 | # CONFIG_EARLY_PRINTK is not set | ||
75 | CONFIG_SYS_HAS_EARLY_PRINTK=y | ||
76 | # CONFIG_HOTPLUG_CPU is not set | ||
77 | # CONFIG_NO_IOPORT is not set | ||
78 | CONFIG_CPU_BIG_ENDIAN=y | ||
79 | # CONFIG_CPU_LITTLE_ENDIAN is not set | ||
80 | CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y | ||
81 | CONFIG_IRQ_CPU=y | ||
82 | CONFIG_IRQ_CPU_OCTEON=y | ||
83 | CONFIG_SWAP_IO_SPACE=y | ||
84 | CONFIG_MIPS_L1_CACHE_SHIFT=7 | ||
85 | |||
86 | # | ||
87 | # CPU selection | ||
88 | # | ||
89 | # CONFIG_CPU_LOONGSON2 is not set | ||
90 | # CONFIG_CPU_MIPS32_R1 is not set | ||
91 | # CONFIG_CPU_MIPS32_R2 is not set | ||
92 | # CONFIG_CPU_MIPS64_R1 is not set | ||
93 | # CONFIG_CPU_MIPS64_R2 is not set | ||
94 | # CONFIG_CPU_R3000 is not set | ||
95 | # CONFIG_CPU_TX39XX is not set | ||
96 | # CONFIG_CPU_VR41XX is not set | ||
97 | # CONFIG_CPU_R4300 is not set | ||
98 | # CONFIG_CPU_R4X00 is not set | ||
99 | # CONFIG_CPU_TX49XX is not set | ||
100 | # CONFIG_CPU_R5000 is not set | ||
101 | # CONFIG_CPU_R5432 is not set | ||
102 | # CONFIG_CPU_R5500 is not set | ||
103 | # CONFIG_CPU_R6000 is not set | ||
104 | # CONFIG_CPU_NEVADA is not set | ||
105 | # CONFIG_CPU_R8000 is not set | ||
106 | # CONFIG_CPU_R10000 is not set | ||
107 | # CONFIG_CPU_RM7000 is not set | ||
108 | # CONFIG_CPU_RM9000 is not set | ||
109 | # CONFIG_CPU_SB1 is not set | ||
110 | CONFIG_CPU_CAVIUM_OCTEON=y | ||
111 | CONFIG_WEAK_ORDERING=y | ||
112 | CONFIG_WEAK_REORDERING_BEYOND_LLSC=y | ||
113 | CONFIG_CPU_MIPSR2=y | ||
114 | CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y | ||
115 | CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y | ||
116 | |||
117 | # | ||
118 | # Kernel type | ||
119 | # | ||
120 | # CONFIG_32BIT is not set | ||
121 | CONFIG_64BIT=y | ||
122 | CONFIG_PAGE_SIZE_4KB=y | ||
123 | # CONFIG_PAGE_SIZE_8KB is not set | ||
124 | # CONFIG_PAGE_SIZE_16KB is not set | ||
125 | # CONFIG_PAGE_SIZE_64KB is not set | ||
126 | CONFIG_CPU_HAS_PREFETCH=y | ||
127 | CONFIG_MIPS_MT_DISABLED=y | ||
128 | # CONFIG_MIPS_MT_SMP is not set | ||
129 | # CONFIG_MIPS_MT_SMTC is not set | ||
130 | CONFIG_64BIT_PHYS_ADDR=y | ||
131 | CONFIG_CPU_HAS_SYNC=y | ||
132 | CONFIG_GENERIC_HARDIRQS=y | ||
133 | CONFIG_GENERIC_IRQ_PROBE=y | ||
134 | CONFIG_IRQ_PER_CPU=y | ||
135 | CONFIG_CPU_SUPPORTS_HIGHMEM=y | ||
136 | CONFIG_SYS_SUPPORTS_HIGHMEM=y | ||
137 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
138 | CONFIG_ARCH_POPULATES_NODE_MAP=y | ||
139 | CONFIG_SELECT_MEMORY_MODEL=y | ||
140 | # CONFIG_FLATMEM_MANUAL is not set | ||
141 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
142 | CONFIG_SPARSEMEM_MANUAL=y | ||
143 | CONFIG_SPARSEMEM=y | ||
144 | CONFIG_HAVE_MEMORY_PRESENT=y | ||
145 | CONFIG_SPARSEMEM_STATIC=y | ||
146 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
147 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
148 | CONFIG_RESOURCES_64BIT=y | ||
149 | CONFIG_PHYS_ADDR_T_64BIT=y | ||
150 | CONFIG_ZONE_DMA_FLAG=0 | ||
151 | CONFIG_VIRT_TO_BUS=y | ||
152 | CONFIG_UNEVICTABLE_LRU=y | ||
153 | CONFIG_SMP=y | ||
154 | CONFIG_SYS_SUPPORTS_SMP=y | ||
155 | CONFIG_NR_CPUS_DEFAULT_16=y | ||
156 | CONFIG_NR_CPUS=16 | ||
157 | # CONFIG_NO_HZ is not set | ||
158 | # CONFIG_HIGH_RES_TIMERS is not set | ||
159 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
160 | # CONFIG_HZ_48 is not set | ||
161 | # CONFIG_HZ_100 is not set | ||
162 | # CONFIG_HZ_128 is not set | ||
163 | CONFIG_HZ_250=y | ||
164 | # CONFIG_HZ_256 is not set | ||
165 | # CONFIG_HZ_1000 is not set | ||
166 | # CONFIG_HZ_1024 is not set | ||
167 | CONFIG_SYS_SUPPORTS_ARBIT_HZ=y | ||
168 | CONFIG_HZ=250 | ||
169 | # CONFIG_PREEMPT_NONE is not set | ||
170 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
171 | CONFIG_PREEMPT=y | ||
172 | # CONFIG_PREEMPT_RCU is not set | ||
173 | # CONFIG_KEXEC is not set | ||
174 | CONFIG_SECCOMP=y | ||
175 | CONFIG_LOCKDEP_SUPPORT=y | ||
176 | CONFIG_STACKTRACE_SUPPORT=y | ||
177 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
178 | |||
179 | # | ||
180 | # General setup | ||
181 | # | ||
182 | CONFIG_EXPERIMENTAL=y | ||
183 | CONFIG_LOCK_KERNEL=y | ||
184 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
185 | CONFIG_LOCALVERSION="" | ||
186 | CONFIG_LOCALVERSION_AUTO=y | ||
187 | CONFIG_SWAP=y | ||
188 | CONFIG_SYSVIPC=y | ||
189 | CONFIG_SYSVIPC_SYSCTL=y | ||
190 | CONFIG_POSIX_MQUEUE=y | ||
191 | CONFIG_BSD_PROCESS_ACCT=y | ||
192 | CONFIG_BSD_PROCESS_ACCT_V3=y | ||
193 | # CONFIG_TASKSTATS is not set | ||
194 | # CONFIG_AUDIT is not set | ||
195 | CONFIG_IKCONFIG=y | ||
196 | CONFIG_IKCONFIG_PROC=y | ||
197 | CONFIG_LOG_BUF_SHIFT=14 | ||
198 | # CONFIG_CGROUPS is not set | ||
199 | CONFIG_GROUP_SCHED=y | ||
200 | CONFIG_FAIR_GROUP_SCHED=y | ||
201 | # CONFIG_RT_GROUP_SCHED is not set | ||
202 | CONFIG_USER_SCHED=y | ||
203 | # CONFIG_CGROUP_SCHED is not set | ||
204 | CONFIG_SYSFS_DEPRECATED=y | ||
205 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
206 | CONFIG_RELAY=y | ||
207 | # CONFIG_NAMESPACES is not set | ||
208 | CONFIG_BLK_DEV_INITRD=y | ||
209 | CONFIG_INITRAMFS_SOURCE="" | ||
210 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
211 | CONFIG_SYSCTL=y | ||
212 | CONFIG_EMBEDDED=y | ||
213 | CONFIG_SYSCTL_SYSCALL=y | ||
214 | CONFIG_KALLSYMS=y | ||
215 | # CONFIG_KALLSYMS_ALL is not set | ||
216 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
217 | CONFIG_HOTPLUG=y | ||
218 | CONFIG_PRINTK=y | ||
219 | CONFIG_BUG=y | ||
220 | CONFIG_ELF_CORE=y | ||
221 | # CONFIG_PCSPKR_PLATFORM is not set | ||
222 | CONFIG_COMPAT_BRK=y | ||
223 | CONFIG_BASE_FULL=y | ||
224 | CONFIG_FUTEX=y | ||
225 | CONFIG_ANON_INODES=y | ||
226 | CONFIG_EPOLL=y | ||
227 | CONFIG_SIGNALFD=y | ||
228 | CONFIG_TIMERFD=y | ||
229 | CONFIG_EVENTFD=y | ||
230 | CONFIG_SHMEM=y | ||
231 | CONFIG_AIO=y | ||
232 | CONFIG_VM_EVENT_COUNTERS=y | ||
233 | CONFIG_SLAB=y | ||
234 | # CONFIG_SLUB is not set | ||
235 | # CONFIG_SLOB is not set | ||
236 | # CONFIG_PROFILING is not set | ||
237 | # CONFIG_MARKERS is not set | ||
238 | CONFIG_HAVE_OPROFILE=y | ||
239 | CONFIG_USE_GENERIC_SMP_HELPERS=y | ||
240 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
241 | CONFIG_SLABINFO=y | ||
242 | CONFIG_RT_MUTEXES=y | ||
243 | # CONFIG_TINY_SHMEM is not set | ||
244 | CONFIG_BASE_SMALL=0 | ||
245 | CONFIG_MODULES=y | ||
246 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
247 | CONFIG_MODULE_UNLOAD=y | ||
248 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
249 | # CONFIG_MODVERSIONS is not set | ||
250 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
251 | CONFIG_KMOD=y | ||
252 | CONFIG_STOP_MACHINE=y | ||
253 | CONFIG_BLOCK=y | ||
254 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
255 | # CONFIG_BLK_DEV_BSG is not set | ||
256 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
257 | CONFIG_BLOCK_COMPAT=y | ||
258 | |||
259 | # | ||
260 | # IO Schedulers | ||
261 | # | ||
262 | CONFIG_IOSCHED_NOOP=y | ||
263 | CONFIG_IOSCHED_AS=y | ||
264 | CONFIG_IOSCHED_DEADLINE=y | ||
265 | CONFIG_IOSCHED_CFQ=y | ||
266 | # CONFIG_DEFAULT_AS is not set | ||
267 | # CONFIG_DEFAULT_DEADLINE is not set | ||
268 | CONFIG_DEFAULT_CFQ=y | ||
269 | # CONFIG_DEFAULT_NOOP is not set | ||
270 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
271 | CONFIG_CLASSIC_RCU=y | ||
272 | # CONFIG_PROBE_INITRD_HEADER is not set | ||
273 | # CONFIG_FREEZER is not set | ||
274 | |||
275 | # | ||
276 | # Bus options (PCI, PCMCIA, EISA, ISA, TC) | ||
277 | # | ||
278 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
279 | CONFIG_MMU=y | ||
280 | # CONFIG_PCCARD is not set | ||
281 | |||
282 | # | ||
283 | # Executable file formats | ||
284 | # | ||
285 | CONFIG_BINFMT_ELF=y | ||
286 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
287 | # CONFIG_HAVE_AOUT is not set | ||
288 | # CONFIG_BINFMT_MISC is not set | ||
289 | CONFIG_MIPS32_COMPAT=y | ||
290 | CONFIG_COMPAT=y | ||
291 | CONFIG_SYSVIPC_COMPAT=y | ||
292 | CONFIG_MIPS32_O32=y | ||
293 | CONFIG_MIPS32_N32=y | ||
294 | CONFIG_BINFMT_ELF32=y | ||
295 | |||
296 | # | ||
297 | # Power management options | ||
298 | # | ||
299 | # CONFIG_PM is not set | ||
300 | CONFIG_NET=y | ||
301 | |||
302 | # | ||
303 | # Networking options | ||
304 | # | ||
305 | CONFIG_PACKET=y | ||
306 | CONFIG_PACKET_MMAP=y | ||
307 | CONFIG_UNIX=y | ||
308 | CONFIG_XFRM=y | ||
309 | # CONFIG_XFRM_USER is not set | ||
310 | # CONFIG_XFRM_SUB_POLICY is not set | ||
311 | # CONFIG_XFRM_MIGRATE is not set | ||
312 | # CONFIG_XFRM_STATISTICS is not set | ||
313 | # CONFIG_NET_KEY is not set | ||
314 | CONFIG_INET=y | ||
315 | CONFIG_IP_MULTICAST=y | ||
316 | CONFIG_IP_ADVANCED_ROUTER=y | ||
317 | CONFIG_ASK_IP_FIB_HASH=y | ||
318 | # CONFIG_IP_FIB_TRIE is not set | ||
319 | CONFIG_IP_FIB_HASH=y | ||
320 | CONFIG_IP_MULTIPLE_TABLES=y | ||
321 | CONFIG_IP_ROUTE_MULTIPATH=y | ||
322 | CONFIG_IP_ROUTE_VERBOSE=y | ||
323 | CONFIG_IP_PNP=y | ||
324 | CONFIG_IP_PNP_DHCP=y | ||
325 | CONFIG_IP_PNP_BOOTP=y | ||
326 | CONFIG_IP_PNP_RARP=y | ||
327 | # CONFIG_NET_IPIP is not set | ||
328 | # CONFIG_NET_IPGRE is not set | ||
329 | CONFIG_IP_MROUTE=y | ||
330 | CONFIG_IP_PIMSM_V1=y | ||
331 | CONFIG_IP_PIMSM_V2=y | ||
332 | # CONFIG_ARPD is not set | ||
333 | CONFIG_SYN_COOKIES=y | ||
334 | # CONFIG_INET_AH is not set | ||
335 | # CONFIG_INET_ESP is not set | ||
336 | # CONFIG_INET_IPCOMP is not set | ||
337 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
338 | # CONFIG_INET_TUNNEL is not set | ||
339 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | ||
340 | CONFIG_INET_XFRM_MODE_TUNNEL=y | ||
341 | CONFIG_INET_XFRM_MODE_BEET=y | ||
342 | # CONFIG_INET_LRO is not set | ||
343 | CONFIG_INET_DIAG=y | ||
344 | CONFIG_INET_TCP_DIAG=y | ||
345 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
346 | CONFIG_TCP_CONG_CUBIC=y | ||
347 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
348 | # CONFIG_TCP_MD5SIG is not set | ||
349 | # CONFIG_IPV6 is not set | ||
350 | # CONFIG_NETLABEL is not set | ||
351 | # CONFIG_NETWORK_SECMARK is not set | ||
352 | # CONFIG_NETFILTER is not set | ||
353 | # CONFIG_IP_DCCP is not set | ||
354 | # CONFIG_IP_SCTP is not set | ||
355 | # CONFIG_TIPC is not set | ||
356 | # CONFIG_ATM is not set | ||
357 | # CONFIG_BRIDGE is not set | ||
358 | # CONFIG_NET_DSA is not set | ||
359 | # CONFIG_VLAN_8021Q is not set | ||
360 | # CONFIG_DECNET is not set | ||
361 | # CONFIG_LLC2 is not set | ||
362 | # CONFIG_IPX is not set | ||
363 | # CONFIG_ATALK is not set | ||
364 | # CONFIG_X25 is not set | ||
365 | # CONFIG_LAPB is not set | ||
366 | # CONFIG_ECONET is not set | ||
367 | # CONFIG_WAN_ROUTER is not set | ||
368 | # CONFIG_NET_SCHED is not set | ||
369 | |||
370 | # | ||
371 | # Network testing | ||
372 | # | ||
373 | # CONFIG_NET_PKTGEN is not set | ||
374 | # CONFIG_HAMRADIO is not set | ||
375 | # CONFIG_CAN is not set | ||
376 | # CONFIG_IRDA is not set | ||
377 | # CONFIG_BT is not set | ||
378 | # CONFIG_AF_RXRPC is not set | ||
379 | # CONFIG_PHONET is not set | ||
380 | CONFIG_FIB_RULES=y | ||
381 | # CONFIG_WIRELESS is not set | ||
382 | # CONFIG_RFKILL is not set | ||
383 | # CONFIG_NET_9P is not set | ||
384 | |||
385 | # | ||
386 | # Device Drivers | ||
387 | # | ||
388 | |||
389 | # | ||
390 | # Generic Driver Options | ||
391 | # | ||
392 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
393 | CONFIG_STANDALONE=y | ||
394 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
395 | # CONFIG_FW_LOADER is not set | ||
396 | # CONFIG_DEBUG_DRIVER is not set | ||
397 | # CONFIG_DEBUG_DEVRES is not set | ||
398 | # CONFIG_SYS_HYPERVISOR is not set | ||
399 | # CONFIG_CONNECTOR is not set | ||
400 | CONFIG_MTD=y | ||
401 | # CONFIG_MTD_DEBUG is not set | ||
402 | # CONFIG_MTD_CONCAT is not set | ||
403 | CONFIG_MTD_PARTITIONS=y | ||
404 | # CONFIG_MTD_REDBOOT_PARTS is not set | ||
405 | # CONFIG_MTD_CMDLINE_PARTS is not set | ||
406 | # CONFIG_MTD_AR7_PARTS is not set | ||
407 | |||
408 | # | ||
409 | # User Modules And Translation Layers | ||
410 | # | ||
411 | CONFIG_MTD_CHAR=y | ||
412 | CONFIG_MTD_BLKDEVS=y | ||
413 | CONFIG_MTD_BLOCK=y | ||
414 | # CONFIG_FTL is not set | ||
415 | # CONFIG_NFTL is not set | ||
416 | # CONFIG_INFTL is not set | ||
417 | # CONFIG_RFD_FTL is not set | ||
418 | # CONFIG_SSFDC is not set | ||
419 | # CONFIG_MTD_OOPS is not set | ||
420 | |||
421 | # | ||
422 | # RAM/ROM/Flash chip drivers | ||
423 | # | ||
424 | CONFIG_MTD_CFI=y | ||
425 | # CONFIG_MTD_JEDECPROBE is not set | ||
426 | CONFIG_MTD_GEN_PROBE=y | ||
427 | # CONFIG_MTD_CFI_ADV_OPTIONS is not set | ||
428 | CONFIG_MTD_MAP_BANK_WIDTH_1=y | ||
429 | CONFIG_MTD_MAP_BANK_WIDTH_2=y | ||
430 | CONFIG_MTD_MAP_BANK_WIDTH_4=y | ||
431 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | ||
432 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | ||
433 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | ||
434 | CONFIG_MTD_CFI_I1=y | ||
435 | CONFIG_MTD_CFI_I2=y | ||
436 | # CONFIG_MTD_CFI_I4 is not set | ||
437 | # CONFIG_MTD_CFI_I8 is not set | ||
438 | # CONFIG_MTD_CFI_INTELEXT is not set | ||
439 | CONFIG_MTD_CFI_AMDSTD=y | ||
440 | # CONFIG_MTD_CFI_STAA is not set | ||
441 | CONFIG_MTD_CFI_UTIL=y | ||
442 | # CONFIG_MTD_RAM is not set | ||
443 | # CONFIG_MTD_ROM is not set | ||
444 | # CONFIG_MTD_ABSENT is not set | ||
445 | |||
446 | # | ||
447 | # Mapping drivers for chip access | ||
448 | # | ||
449 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | ||
450 | CONFIG_MTD_PHYSMAP=y | ||
451 | CONFIG_MTD_PHYSMAP_START=0x8000000 | ||
452 | CONFIG_MTD_PHYSMAP_LEN=0x0 | ||
453 | CONFIG_MTD_PHYSMAP_BANKWIDTH=2 | ||
454 | # CONFIG_MTD_PLATRAM is not set | ||
455 | |||
456 | # | ||
457 | # Self-contained MTD device drivers | ||
458 | # | ||
459 | # CONFIG_MTD_SLRAM is not set | ||
460 | # CONFIG_MTD_PHRAM is not set | ||
461 | # CONFIG_MTD_MTDRAM is not set | ||
462 | # CONFIG_MTD_BLOCK2MTD is not set | ||
463 | |||
464 | # | ||
465 | # Disk-On-Chip Device Drivers | ||
466 | # | ||
467 | # CONFIG_MTD_DOC2000 is not set | ||
468 | # CONFIG_MTD_DOC2001 is not set | ||
469 | # CONFIG_MTD_DOC2001PLUS is not set | ||
470 | # CONFIG_MTD_NAND is not set | ||
471 | # CONFIG_MTD_ONENAND is not set | ||
472 | |||
473 | # | ||
474 | # UBI - Unsorted block images | ||
475 | # | ||
476 | # CONFIG_MTD_UBI is not set | ||
477 | # CONFIG_PARPORT is not set | ||
478 | CONFIG_BLK_DEV=y | ||
479 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
480 | CONFIG_BLK_DEV_LOOP=y | ||
481 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
482 | # CONFIG_BLK_DEV_NBD is not set | ||
483 | # CONFIG_BLK_DEV_RAM is not set | ||
484 | # CONFIG_CDROM_PKTCDVD is not set | ||
485 | # CONFIG_ATA_OVER_ETH is not set | ||
486 | # CONFIG_BLK_DEV_HD is not set | ||
487 | # CONFIG_MISC_DEVICES is not set | ||
488 | CONFIG_HAVE_IDE=y | ||
489 | # CONFIG_IDE is not set | ||
490 | |||
491 | # | ||
492 | # SCSI device support | ||
493 | # | ||
494 | # CONFIG_RAID_ATTRS is not set | ||
495 | # CONFIG_SCSI is not set | ||
496 | # CONFIG_SCSI_DMA is not set | ||
497 | # CONFIG_SCSI_NETLINK is not set | ||
498 | # CONFIG_ATA is not set | ||
499 | # CONFIG_MD is not set | ||
500 | CONFIG_NETDEVICES=y | ||
501 | # CONFIG_DUMMY is not set | ||
502 | # CONFIG_BONDING is not set | ||
503 | # CONFIG_MACVLAN is not set | ||
504 | # CONFIG_EQUALIZER is not set | ||
505 | # CONFIG_TUN is not set | ||
506 | # CONFIG_VETH is not set | ||
507 | # CONFIG_PHYLIB is not set | ||
508 | CONFIG_NET_ETHERNET=y | ||
509 | CONFIG_MII=y | ||
510 | # CONFIG_AX88796 is not set | ||
511 | # CONFIG_SMC91X is not set | ||
512 | # CONFIG_DM9000 is not set | ||
513 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
514 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
515 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
516 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
517 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | ||
518 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | ||
519 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | ||
520 | # CONFIG_B44 is not set | ||
521 | CONFIG_NETDEV_1000=y | ||
522 | # CONFIG_NETDEV_10000 is not set | ||
523 | |||
524 | # | ||
525 | # Wireless LAN | ||
526 | # | ||
527 | # CONFIG_WLAN_PRE80211 is not set | ||
528 | # CONFIG_WLAN_80211 is not set | ||
529 | # CONFIG_IWLWIFI_LEDS is not set | ||
530 | # CONFIG_WAN is not set | ||
531 | # CONFIG_PPP is not set | ||
532 | # CONFIG_SLIP is not set | ||
533 | # CONFIG_NETCONSOLE is not set | ||
534 | # CONFIG_NETPOLL is not set | ||
535 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
536 | # CONFIG_ISDN is not set | ||
537 | # CONFIG_PHONE is not set | ||
538 | |||
539 | # | ||
540 | # Input device support | ||
541 | # | ||
542 | # CONFIG_INPUT is not set | ||
543 | |||
544 | # | ||
545 | # Hardware I/O ports | ||
546 | # | ||
547 | # CONFIG_SERIO is not set | ||
548 | # CONFIG_GAMEPORT is not set | ||
549 | |||
550 | # | ||
551 | # Character devices | ||
552 | # | ||
553 | # CONFIG_VT is not set | ||
554 | CONFIG_DEVKMEM=y | ||
555 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
556 | |||
557 | # | ||
558 | # Serial drivers | ||
559 | # | ||
560 | CONFIG_SERIAL_8250=y | ||
561 | CONFIG_SERIAL_8250_CONSOLE=y | ||
562 | CONFIG_SERIAL_8250_NR_UARTS=2 | ||
563 | CONFIG_SERIAL_8250_RUNTIME_UARTS=2 | ||
564 | # CONFIG_SERIAL_8250_EXTENDED is not set | ||
565 | |||
566 | # | ||
567 | # Non-8250 serial port support | ||
568 | # | ||
569 | CONFIG_SERIAL_CORE=y | ||
570 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
571 | CONFIG_UNIX98_PTYS=y | ||
572 | CONFIG_LEGACY_PTYS=y | ||
573 | CONFIG_LEGACY_PTY_COUNT=256 | ||
574 | # CONFIG_IPMI_HANDLER is not set | ||
575 | # CONFIG_HW_RANDOM is not set | ||
576 | # CONFIG_R3964 is not set | ||
577 | # CONFIG_RAW_DRIVER is not set | ||
578 | # CONFIG_TCG_TPM is not set | ||
579 | # CONFIG_I2C is not set | ||
580 | # CONFIG_SPI is not set | ||
581 | # CONFIG_W1 is not set | ||
582 | # CONFIG_POWER_SUPPLY is not set | ||
583 | # CONFIG_HWMON is not set | ||
584 | # CONFIG_THERMAL is not set | ||
585 | # CONFIG_THERMAL_HWMON is not set | ||
586 | CONFIG_WATCHDOG=y | ||
587 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
588 | |||
589 | # | ||
590 | # Watchdog Device Drivers | ||
591 | # | ||
592 | # CONFIG_SOFT_WATCHDOG is not set | ||
593 | CONFIG_SSB_POSSIBLE=y | ||
594 | |||
595 | # | ||
596 | # Sonics Silicon Backplane | ||
597 | # | ||
598 | # CONFIG_SSB is not set | ||
599 | |||
600 | # | ||
601 | # Multifunction device drivers | ||
602 | # | ||
603 | # CONFIG_MFD_CORE is not set | ||
604 | # CONFIG_MFD_SM501 is not set | ||
605 | # CONFIG_HTC_PASIC3 is not set | ||
606 | # CONFIG_MFD_TMIO is not set | ||
607 | # CONFIG_REGULATOR is not set | ||
608 | |||
609 | # | ||
610 | # Multimedia devices | ||
611 | # | ||
612 | |||
613 | # | ||
614 | # Multimedia core support | ||
615 | # | ||
616 | # CONFIG_VIDEO_DEV is not set | ||
617 | # CONFIG_DVB_CORE is not set | ||
618 | # CONFIG_VIDEO_MEDIA is not set | ||
619 | |||
620 | # | ||
621 | # Multimedia drivers | ||
622 | # | ||
623 | # CONFIG_DAB is not set | ||
624 | |||
625 | # | ||
626 | # Graphics support | ||
627 | # | ||
628 | # CONFIG_VGASTATE is not set | ||
629 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
630 | # CONFIG_FB is not set | ||
631 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
632 | |||
633 | # | ||
634 | # Display device support | ||
635 | # | ||
636 | # CONFIG_DISPLAY_SUPPORT is not set | ||
637 | # CONFIG_SOUND is not set | ||
638 | # CONFIG_USB_SUPPORT is not set | ||
639 | # CONFIG_MMC is not set | ||
640 | # CONFIG_MEMSTICK is not set | ||
641 | # CONFIG_NEW_LEDS is not set | ||
642 | # CONFIG_ACCESSIBILITY is not set | ||
643 | CONFIG_RTC_LIB=y | ||
644 | # CONFIG_RTC_CLASS is not set | ||
645 | # CONFIG_DMADEVICES is not set | ||
646 | # CONFIG_UIO is not set | ||
647 | # CONFIG_STAGING is not set | ||
648 | CONFIG_STAGING_EXCLUDE_BUILD=y | ||
649 | |||
650 | # | ||
651 | # File systems | ||
652 | # | ||
653 | # CONFIG_EXT2_FS is not set | ||
654 | # CONFIG_EXT3_FS is not set | ||
655 | # CONFIG_EXT4_FS is not set | ||
656 | # CONFIG_REISERFS_FS is not set | ||
657 | # CONFIG_JFS_FS is not set | ||
658 | # CONFIG_FS_POSIX_ACL is not set | ||
659 | CONFIG_FILE_LOCKING=y | ||
660 | # CONFIG_XFS_FS is not set | ||
661 | # CONFIG_GFS2_FS is not set | ||
662 | # CONFIG_OCFS2_FS is not set | ||
663 | CONFIG_DNOTIFY=y | ||
664 | CONFIG_INOTIFY=y | ||
665 | CONFIG_INOTIFY_USER=y | ||
666 | # CONFIG_QUOTA is not set | ||
667 | # CONFIG_AUTOFS_FS is not set | ||
668 | # CONFIG_AUTOFS4_FS is not set | ||
669 | # CONFIG_FUSE_FS is not set | ||
670 | |||
671 | # | ||
672 | # CD-ROM/DVD Filesystems | ||
673 | # | ||
674 | # CONFIG_ISO9660_FS is not set | ||
675 | # CONFIG_UDF_FS is not set | ||
676 | |||
677 | # | ||
678 | # DOS/FAT/NT Filesystems | ||
679 | # | ||
680 | # CONFIG_MSDOS_FS is not set | ||
681 | # CONFIG_VFAT_FS is not set | ||
682 | # CONFIG_NTFS_FS is not set | ||
683 | |||
684 | # | ||
685 | # Pseudo filesystems | ||
686 | # | ||
687 | CONFIG_PROC_FS=y | ||
688 | CONFIG_PROC_KCORE=y | ||
689 | CONFIG_PROC_SYSCTL=y | ||
690 | CONFIG_PROC_PAGE_MONITOR=y | ||
691 | CONFIG_SYSFS=y | ||
692 | CONFIG_TMPFS=y | ||
693 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
694 | # CONFIG_HUGETLB_PAGE is not set | ||
695 | # CONFIG_CONFIGFS_FS is not set | ||
696 | |||
697 | # | ||
698 | # Miscellaneous filesystems | ||
699 | # | ||
700 | # CONFIG_ADFS_FS is not set | ||
701 | # CONFIG_AFFS_FS is not set | ||
702 | # CONFIG_HFS_FS is not set | ||
703 | # CONFIG_HFSPLUS_FS is not set | ||
704 | # CONFIG_BEFS_FS is not set | ||
705 | # CONFIG_BFS_FS is not set | ||
706 | # CONFIG_EFS_FS is not set | ||
707 | # CONFIG_JFFS2_FS is not set | ||
708 | # CONFIG_CRAMFS is not set | ||
709 | # CONFIG_VXFS_FS is not set | ||
710 | # CONFIG_MINIX_FS is not set | ||
711 | # CONFIG_OMFS_FS is not set | ||
712 | # CONFIG_HPFS_FS is not set | ||
713 | # CONFIG_QNX4FS_FS is not set | ||
714 | # CONFIG_ROMFS_FS is not set | ||
715 | # CONFIG_SYSV_FS is not set | ||
716 | # CONFIG_UFS_FS is not set | ||
717 | # CONFIG_NETWORK_FILESYSTEMS is not set | ||
718 | |||
719 | # | ||
720 | # Partition Types | ||
721 | # | ||
722 | # CONFIG_PARTITION_ADVANCED is not set | ||
723 | CONFIG_MSDOS_PARTITION=y | ||
724 | CONFIG_NLS=y | ||
725 | CONFIG_NLS_DEFAULT="iso8859-1" | ||
726 | CONFIG_NLS_CODEPAGE_437=y | ||
727 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
728 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
729 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
730 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
731 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
732 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
733 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
734 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
735 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
736 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
737 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
738 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
739 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
740 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
741 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
742 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
743 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
744 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
745 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
746 | # CONFIG_NLS_ISO8859_8 is not set | ||
747 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
748 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
749 | # CONFIG_NLS_ASCII is not set | ||
750 | CONFIG_NLS_ISO8859_1=y | ||
751 | # CONFIG_NLS_ISO8859_2 is not set | ||
752 | # CONFIG_NLS_ISO8859_3 is not set | ||
753 | # CONFIG_NLS_ISO8859_4 is not set | ||
754 | # CONFIG_NLS_ISO8859_5 is not set | ||
755 | # CONFIG_NLS_ISO8859_6 is not set | ||
756 | # CONFIG_NLS_ISO8859_7 is not set | ||
757 | # CONFIG_NLS_ISO8859_9 is not set | ||
758 | # CONFIG_NLS_ISO8859_13 is not set | ||
759 | # CONFIG_NLS_ISO8859_14 is not set | ||
760 | # CONFIG_NLS_ISO8859_15 is not set | ||
761 | # CONFIG_NLS_KOI8_R is not set | ||
762 | # CONFIG_NLS_KOI8_U is not set | ||
763 | # CONFIG_NLS_UTF8 is not set | ||
764 | # CONFIG_DLM is not set | ||
765 | |||
766 | # | ||
767 | # Kernel hacking | ||
768 | # | ||
769 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
770 | # CONFIG_PRINTK_TIME is not set | ||
771 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
772 | CONFIG_ENABLE_MUST_CHECK=y | ||
773 | CONFIG_FRAME_WARN=2048 | ||
774 | CONFIG_MAGIC_SYSRQ=y | ||
775 | # CONFIG_UNUSED_SYMBOLS is not set | ||
776 | CONFIG_DEBUG_FS=y | ||
777 | # CONFIG_HEADERS_CHECK is not set | ||
778 | CONFIG_DEBUG_KERNEL=y | ||
779 | # CONFIG_DEBUG_SHIRQ is not set | ||
780 | CONFIG_DETECT_SOFTLOCKUP=y | ||
781 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
782 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
783 | CONFIG_SCHED_DEBUG=y | ||
784 | # CONFIG_SCHEDSTATS is not set | ||
785 | # CONFIG_TIMER_STATS is not set | ||
786 | # CONFIG_DEBUG_OBJECTS is not set | ||
787 | # CONFIG_DEBUG_SLAB is not set | ||
788 | CONFIG_DEBUG_PREEMPT=y | ||
789 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
790 | # CONFIG_RT_MUTEX_TESTER is not set | ||
791 | CONFIG_DEBUG_SPINLOCK=y | ||
792 | # CONFIG_DEBUG_MUTEXES is not set | ||
793 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
794 | # CONFIG_PROVE_LOCKING is not set | ||
795 | # CONFIG_LOCK_STAT is not set | ||
796 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
797 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
798 | # CONFIG_DEBUG_KOBJECT is not set | ||
799 | CONFIG_DEBUG_INFO=y | ||
800 | # CONFIG_DEBUG_VM is not set | ||
801 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
802 | # CONFIG_DEBUG_MEMORY_INIT is not set | ||
803 | # CONFIG_DEBUG_LIST is not set | ||
804 | # CONFIG_DEBUG_SG is not set | ||
805 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
806 | # CONFIG_RCU_TORTURE_TEST is not set | ||
807 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
808 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
809 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
810 | # CONFIG_FAULT_INJECTION is not set | ||
811 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
812 | |||
813 | # | ||
814 | # Tracers | ||
815 | # | ||
816 | # CONFIG_IRQSOFF_TRACER is not set | ||
817 | # CONFIG_PREEMPT_TRACER is not set | ||
818 | # CONFIG_SCHED_TRACER is not set | ||
819 | # CONFIG_CONTEXT_SWITCH_TRACER is not set | ||
820 | # CONFIG_BOOT_TRACER is not set | ||
821 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | ||
822 | # CONFIG_SAMPLES is not set | ||
823 | CONFIG_HAVE_ARCH_KGDB=y | ||
824 | # CONFIG_KGDB is not set | ||
825 | CONFIG_CMDLINE="" | ||
826 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
827 | # CONFIG_RUNTIME_DEBUG is not set | ||
828 | |||
829 | # | ||
830 | # Security options | ||
831 | # | ||
832 | # CONFIG_KEYS is not set | ||
833 | CONFIG_SECURITY=y | ||
834 | # CONFIG_SECURITYFS is not set | ||
835 | CONFIG_SECURITY_NETWORK=y | ||
836 | # CONFIG_SECURITY_NETWORK_XFRM is not set | ||
837 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
838 | CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0 | ||
839 | CONFIG_CRYPTO=y | ||
840 | |||
841 | # | ||
842 | # Crypto core or helper | ||
843 | # | ||
844 | # CONFIG_CRYPTO_FIPS is not set | ||
845 | CONFIG_CRYPTO_ALGAPI=y | ||
846 | CONFIG_CRYPTO_AEAD=y | ||
847 | CONFIG_CRYPTO_BLKCIPHER=y | ||
848 | CONFIG_CRYPTO_HASH=y | ||
849 | CONFIG_CRYPTO_RNG=y | ||
850 | CONFIG_CRYPTO_MANAGER=y | ||
851 | # CONFIG_CRYPTO_GF128MUL is not set | ||
852 | # CONFIG_CRYPTO_NULL is not set | ||
853 | # CONFIG_CRYPTO_CRYPTD is not set | ||
854 | # CONFIG_CRYPTO_AUTHENC is not set | ||
855 | # CONFIG_CRYPTO_TEST is not set | ||
856 | |||
857 | # | ||
858 | # Authenticated Encryption with Associated Data | ||
859 | # | ||
860 | # CONFIG_CRYPTO_CCM is not set | ||
861 | # CONFIG_CRYPTO_GCM is not set | ||
862 | # CONFIG_CRYPTO_SEQIV is not set | ||
863 | |||
864 | # | ||
865 | # Block modes | ||
866 | # | ||
867 | CONFIG_CRYPTO_CBC=y | ||
868 | # CONFIG_CRYPTO_CTR is not set | ||
869 | # CONFIG_CRYPTO_CTS is not set | ||
870 | # CONFIG_CRYPTO_ECB is not set | ||
871 | # CONFIG_CRYPTO_LRW is not set | ||
872 | # CONFIG_CRYPTO_PCBC is not set | ||
873 | # CONFIG_CRYPTO_XTS is not set | ||
874 | |||
875 | # | ||
876 | # Hash modes | ||
877 | # | ||
878 | CONFIG_CRYPTO_HMAC=y | ||
879 | # CONFIG_CRYPTO_XCBC is not set | ||
880 | |||
881 | # | ||
882 | # Digest | ||
883 | # | ||
884 | # CONFIG_CRYPTO_CRC32C is not set | ||
885 | # CONFIG_CRYPTO_MD4 is not set | ||
886 | CONFIG_CRYPTO_MD5=y | ||
887 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
888 | # CONFIG_CRYPTO_RMD128 is not set | ||
889 | # CONFIG_CRYPTO_RMD160 is not set | ||
890 | # CONFIG_CRYPTO_RMD256 is not set | ||
891 | # CONFIG_CRYPTO_RMD320 is not set | ||
892 | # CONFIG_CRYPTO_SHA1 is not set | ||
893 | # CONFIG_CRYPTO_SHA256 is not set | ||
894 | # CONFIG_CRYPTO_SHA512 is not set | ||
895 | # CONFIG_CRYPTO_TGR192 is not set | ||
896 | # CONFIG_CRYPTO_WP512 is not set | ||
897 | |||
898 | # | ||
899 | # Ciphers | ||
900 | # | ||
901 | # CONFIG_CRYPTO_AES is not set | ||
902 | # CONFIG_CRYPTO_ANUBIS is not set | ||
903 | # CONFIG_CRYPTO_ARC4 is not set | ||
904 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
905 | # CONFIG_CRYPTO_CAMELLIA is not set | ||
906 | # CONFIG_CRYPTO_CAST5 is not set | ||
907 | # CONFIG_CRYPTO_CAST6 is not set | ||
908 | CONFIG_CRYPTO_DES=y | ||
909 | # CONFIG_CRYPTO_FCRYPT is not set | ||
910 | # CONFIG_CRYPTO_KHAZAD is not set | ||
911 | # CONFIG_CRYPTO_SALSA20 is not set | ||
912 | # CONFIG_CRYPTO_SEED is not set | ||
913 | # CONFIG_CRYPTO_SERPENT is not set | ||
914 | # CONFIG_CRYPTO_TEA is not set | ||
915 | # CONFIG_CRYPTO_TWOFISH is not set | ||
916 | |||
917 | # | ||
918 | # Compression | ||
919 | # | ||
920 | # CONFIG_CRYPTO_DEFLATE is not set | ||
921 | # CONFIG_CRYPTO_LZO is not set | ||
922 | |||
923 | # | ||
924 | # Random Number Generation | ||
925 | # | ||
926 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
927 | CONFIG_CRYPTO_HW=y | ||
928 | |||
929 | # | ||
930 | # Library routines | ||
931 | # | ||
932 | CONFIG_BITREVERSE=y | ||
933 | # CONFIG_CRC_CCITT is not set | ||
934 | # CONFIG_CRC16 is not set | ||
935 | # CONFIG_CRC_T10DIF is not set | ||
936 | # CONFIG_CRC_ITU_T is not set | ||
937 | CONFIG_CRC32=y | ||
938 | # CONFIG_CRC7 is not set | ||
939 | # CONFIG_LIBCRC32C is not set | ||
940 | CONFIG_PLIST=y | ||
941 | CONFIG_HAS_IOMEM=y | ||
942 | CONFIG_HAS_IOPORT=y | ||
943 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 023866c0c102..7897f05e3165 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | header-y += cachectl.h sgidefs.h sysmips.h | 3 | header-y += cachectl.h sgidefs.h sysmips.h |
4 | header-y += swab.h | ||
diff --git a/arch/mips/include/asm/byteorder.h b/arch/mips/include/asm/byteorder.h index 607b71830707..9579051ff1c7 100644 --- a/arch/mips/include/asm/byteorder.h +++ b/arch/mips/include/asm/byteorder.h | |||
@@ -8,8 +8,6 @@ | |||
8 | #ifndef _ASM_BYTEORDER_H | 8 | #ifndef _ASM_BYTEORDER_H |
9 | #define _ASM_BYTEORDER_H | 9 | #define _ASM_BYTEORDER_H |
10 | 10 | ||
11 | #include <asm/swab.h> | ||
12 | |||
13 | #if defined(__MIPSEB__) | 11 | #if defined(__MIPSEB__) |
14 | #include <linux/byteorder/big_endian.h> | 12 | #include <linux/byteorder/big_endian.h> |
15 | #elif defined(__MIPSEL__) | 13 | #elif defined(__MIPSEL__) |
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index 12d12dfe73c0..a0d14f85b781 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
@@ -38,6 +38,9 @@ | |||
38 | #ifndef cpu_has_tx39_cache | 38 | #ifndef cpu_has_tx39_cache |
39 | #define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE) | 39 | #define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE) |
40 | #endif | 40 | #endif |
41 | #ifndef cpu_has_octeon_cache | ||
42 | #define cpu_has_octeon_cache 0 | ||
43 | #endif | ||
41 | #ifndef cpu_has_fpu | 44 | #ifndef cpu_has_fpu |
42 | #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) | 45 | #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) |
43 | #define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) | 46 | #define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) |
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h index 229a786101d9..c018727c7ddc 100644 --- a/arch/mips/include/asm/cpu.h +++ b/arch/mips/include/asm/cpu.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #define PRID_COMP_TOSHIBA 0x070000 | 33 | #define PRID_COMP_TOSHIBA 0x070000 |
34 | #define PRID_COMP_LSI 0x080000 | 34 | #define PRID_COMP_LSI 0x080000 |
35 | #define PRID_COMP_LEXRA 0x0b0000 | 35 | #define PRID_COMP_LEXRA 0x0b0000 |
36 | #define PRID_COMP_CAVIUM 0x0d0000 | ||
36 | 37 | ||
37 | 38 | ||
38 | /* | 39 | /* |
@@ -114,6 +115,18 @@ | |||
114 | #define PRID_IMP_BCM3302 0x9000 | 115 | #define PRID_IMP_BCM3302 0x9000 |
115 | 116 | ||
116 | /* | 117 | /* |
118 | * These are the PRID's for when 23:16 == PRID_COMP_CAVIUM | ||
119 | */ | ||
120 | |||
121 | #define PRID_IMP_CAVIUM_CN38XX 0x0000 | ||
122 | #define PRID_IMP_CAVIUM_CN31XX 0x0100 | ||
123 | #define PRID_IMP_CAVIUM_CN30XX 0x0200 | ||
124 | #define PRID_IMP_CAVIUM_CN58XX 0x0300 | ||
125 | #define PRID_IMP_CAVIUM_CN56XX 0x0400 | ||
126 | #define PRID_IMP_CAVIUM_CN50XX 0x0600 | ||
127 | #define PRID_IMP_CAVIUM_CN52XX 0x0700 | ||
128 | |||
129 | /* | ||
117 | * Definitions for 7:0 on legacy processors | 130 | * Definitions for 7:0 on legacy processors |
118 | */ | 131 | */ |
119 | 132 | ||
@@ -203,6 +216,7 @@ enum cpu_type_enum { | |||
203 | * MIPS64 class processors | 216 | * MIPS64 class processors |
204 | */ | 217 | */ |
205 | CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, | 218 | CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, |
219 | CPU_CAVIUM_OCTEON, | ||
206 | 220 | ||
207 | CPU_LAST | 221 | CPU_LAST |
208 | }; | 222 | }; |
diff --git a/arch/mips/include/asm/hazards.h b/arch/mips/include/asm/hazards.h index 2de638f84c86..43baed16a109 100644 --- a/arch/mips/include/asm/hazards.h +++ b/arch/mips/include/asm/hazards.h | |||
@@ -42,7 +42,7 @@ ASMMACRO(_ehb, | |||
42 | /* | 42 | /* |
43 | * TLB hazards | 43 | * TLB hazards |
44 | */ | 44 | */ |
45 | #if defined(CONFIG_CPU_MIPSR2) | 45 | #if defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_CPU_CAVIUM_OCTEON) |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * MIPSR2 defines ehb for hazard avoidance | 48 | * MIPSR2 defines ehb for hazard avoidance |
@@ -138,7 +138,7 @@ do { \ | |||
138 | __instruction_hazard(); \ | 138 | __instruction_hazard(); \ |
139 | } while (0) | 139 | } while (0) |
140 | 140 | ||
141 | #elif defined(CONFIG_CPU_R10000) | 141 | #elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_CAVIUM_OCTEON) |
142 | 142 | ||
143 | /* | 143 | /* |
144 | * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. | 144 | * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. |
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 501a40b9f18d..436878e4e063 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h | |||
@@ -295,6 +295,12 @@ static inline void iounmap(const volatile void __iomem *addr) | |||
295 | #undef __IS_KSEG1 | 295 | #undef __IS_KSEG1 |
296 | } | 296 | } |
297 | 297 | ||
298 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
299 | #define war_octeon_io_reorder_wmb() wmb() | ||
300 | #else | ||
301 | #define war_octeon_io_reorder_wmb() do { } while (0) | ||
302 | #endif | ||
303 | |||
298 | #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ | 304 | #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ |
299 | \ | 305 | \ |
300 | static inline void pfx##write##bwlq(type val, \ | 306 | static inline void pfx##write##bwlq(type val, \ |
@@ -303,6 +309,8 @@ static inline void pfx##write##bwlq(type val, \ | |||
303 | volatile type *__mem; \ | 309 | volatile type *__mem; \ |
304 | type __val; \ | 310 | type __val; \ |
305 | \ | 311 | \ |
312 | war_octeon_io_reorder_wmb(); \ | ||
313 | \ | ||
306 | __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ | 314 | __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ |
307 | \ | 315 | \ |
308 | __val = pfx##ioswab##bwlq(__mem, val); \ | 316 | __val = pfx##ioswab##bwlq(__mem, val); \ |
@@ -370,6 +378,8 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \ | |||
370 | volatile type *__addr; \ | 378 | volatile type *__addr; \ |
371 | type __val; \ | 379 | type __val; \ |
372 | \ | 380 | \ |
381 | war_octeon_io_reorder_wmb(); \ | ||
382 | \ | ||
373 | __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ | 383 | __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ |
374 | \ | 384 | \ |
375 | __val = pfx##ioswab##bwlq(__addr, val); \ | 385 | __val = pfx##ioswab##bwlq(__addr, val); \ |
@@ -504,8 +514,12 @@ BUILDSTRING(q, u64) | |||
504 | #endif | 514 | #endif |
505 | 515 | ||
506 | 516 | ||
517 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
518 | #define mmiowb() wmb() | ||
519 | #else | ||
507 | /* Depends on MIPS II instruction set */ | 520 | /* Depends on MIPS II instruction set */ |
508 | #define mmiowb() asm volatile ("sync" ::: "memory") | 521 | #define mmiowb() asm volatile ("sync" ::: "memory") |
522 | #endif | ||
509 | 523 | ||
510 | static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) | 524 | static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) |
511 | { | 525 | { |
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h index 0d302bad4492..62f91f50b5b5 100644 --- a/arch/mips/include/asm/mach-au1x00/au1000.h +++ b/arch/mips/include/asm/mach-au1x00/au1000.h | |||
@@ -91,14 +91,57 @@ static inline u32 au_readl(unsigned long reg) | |||
91 | return *(volatile u32 *)reg; | 91 | return *(volatile u32 *)reg; |
92 | } | 92 | } |
93 | 93 | ||
94 | /* Early Au1000 have a write-only SYS_CPUPLL register. */ | ||
95 | static inline int au1xxx_cpu_has_pll_wo(void) | ||
96 | { | ||
97 | switch (read_c0_prid()) { | ||
98 | case 0x00030100: /* Au1000 DA */ | ||
99 | case 0x00030201: /* Au1000 HA */ | ||
100 | case 0x00030202: /* Au1000 HB */ | ||
101 | return 1; | ||
102 | } | ||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | /* does CPU need CONFIG[OD] set to fix tons of errata? */ | ||
107 | static inline int au1xxx_cpu_needs_config_od(void) | ||
108 | { | ||
109 | /* | ||
110 | * c0_config.od (bit 19) was write only (and read as 0) on the | ||
111 | * early revisions of Alchemy SOCs. It disables the bus trans- | ||
112 | * action overlapping and needs to be set to fix various errata. | ||
113 | */ | ||
114 | switch (read_c0_prid()) { | ||
115 | case 0x00030100: /* Au1000 DA */ | ||
116 | case 0x00030201: /* Au1000 HA */ | ||
117 | case 0x00030202: /* Au1000 HB */ | ||
118 | case 0x01030200: /* Au1500 AB */ | ||
119 | /* | ||
120 | * Au1100/Au1200 errata actually keep silence about this bit, | ||
121 | * so we set it just in case for those revisions that require | ||
122 | * it to be set according to the (now gone) cpu_table. | ||
123 | */ | ||
124 | case 0x02030200: /* Au1100 AB */ | ||
125 | case 0x02030201: /* Au1100 BA */ | ||
126 | case 0x02030202: /* Au1100 BC */ | ||
127 | case 0x04030201: /* Au1200 AC */ | ||
128 | return 1; | ||
129 | } | ||
130 | return 0; | ||
131 | } | ||
94 | 132 | ||
95 | /* arch/mips/au1000/common/clocks.c */ | 133 | /* arch/mips/au1000/common/clocks.c */ |
96 | extern void set_au1x00_speed(unsigned int new_freq); | 134 | extern void set_au1x00_speed(unsigned int new_freq); |
97 | extern unsigned int get_au1x00_speed(void); | 135 | extern unsigned int get_au1x00_speed(void); |
98 | extern void set_au1x00_uart_baud_base(unsigned long new_baud_base); | 136 | extern void set_au1x00_uart_baud_base(unsigned long new_baud_base); |
99 | extern unsigned long get_au1x00_uart_baud_base(void); | 137 | extern unsigned long get_au1x00_uart_baud_base(void); |
100 | extern void set_au1x00_lcd_clock(void); | 138 | extern unsigned long au1xxx_calc_clock(void); |
101 | extern unsigned int get_au1x00_lcd_clock(void); | 139 | |
140 | /* PM: arch/mips/alchemy/common/sleeper.S, power.c, irq.c */ | ||
141 | void au1xxx_save_and_sleep(void); | ||
142 | void au_sleep(void); | ||
143 | void save_au1xxx_intctl(void); | ||
144 | void restore_au1xxx_intctl(void); | ||
102 | 145 | ||
103 | /* | 146 | /* |
104 | * Every board describes its IRQ mapping with this table. | 147 | * Every board describes its IRQ mapping with this table. |
@@ -109,10 +152,11 @@ struct au1xxx_irqmap { | |||
109 | int im_request; | 152 | int im_request; |
110 | }; | 153 | }; |
111 | 154 | ||
112 | /* | 155 | /* core calls this function to let boards initialize other IRQ sources */ |
113 | * init_IRQ looks for a table with this name. | 156 | void board_init_irq(void); |
114 | */ | 157 | |
115 | extern struct au1xxx_irqmap au1xxx_irq_map[]; | 158 | /* boards call this to register additional (GPIO) interrupts */ |
159 | void au1xxx_setup_irqmap(struct au1xxx_irqmap *map, int count); | ||
116 | 160 | ||
117 | #endif /* !defined (_LANGUAGE_ASSEMBLY) */ | 161 | #endif /* !defined (_LANGUAGE_ASSEMBLY) */ |
118 | 162 | ||
@@ -505,15 +549,6 @@ extern struct au1xxx_irqmap au1xxx_irq_map[]; | |||
505 | 549 | ||
506 | #define IC1_TESTBIT 0xB1800080 | 550 | #define IC1_TESTBIT 0xB1800080 |
507 | 551 | ||
508 | /* Interrupt Configuration Modes */ | ||
509 | #define INTC_INT_DISABLED 0x0 | ||
510 | #define INTC_INT_RISE_EDGE 0x1 | ||
511 | #define INTC_INT_FALL_EDGE 0x2 | ||
512 | #define INTC_INT_RISE_AND_FALL_EDGE 0x3 | ||
513 | #define INTC_INT_HIGH_LEVEL 0x5 | ||
514 | #define INTC_INT_LOW_LEVEL 0x6 | ||
515 | #define INTC_INT_HIGH_AND_LOW_LEVEL 0x7 | ||
516 | |||
517 | /* Interrupt Numbers */ | 552 | /* Interrupt Numbers */ |
518 | /* Au1000 */ | 553 | /* Au1000 */ |
519 | #ifdef CONFIG_SOC_AU1000 | 554 | #ifdef CONFIG_SOC_AU1000 |
@@ -1525,6 +1560,10 @@ enum soc_au1200_ints { | |||
1525 | #define SYS_SLPPWR 0xB1900078 | 1560 | #define SYS_SLPPWR 0xB1900078 |
1526 | #define SYS_SLEEP 0xB190007C | 1561 | #define SYS_SLEEP 0xB190007C |
1527 | 1562 | ||
1563 | #define SYS_WAKEMSK_D2 (1 << 9) | ||
1564 | #define SYS_WAKEMSK_M2 (1 << 8) | ||
1565 | #define SYS_WAKEMSK_GPIO(x) (1 << (x)) | ||
1566 | |||
1528 | /* Clock Controller */ | 1567 | /* Clock Controller */ |
1529 | #define SYS_FREQCTRL0 0xB1900020 | 1568 | #define SYS_FREQCTRL0 0xB1900020 |
1530 | # define SYS_FC_FRDIV2_BIT 22 | 1569 | # define SYS_FC_FRDIV2_BIT 22 |
@@ -1749,24 +1788,4 @@ static AU1X00_SYS * const sys = (AU1X00_SYS *)SYS_BASE; | |||
1749 | 1788 | ||
1750 | #endif | 1789 | #endif |
1751 | 1790 | ||
1752 | /* | ||
1753 | * Processor information based on PRID. | ||
1754 | * Copied from PowerPC. | ||
1755 | */ | ||
1756 | #ifndef _LANGUAGE_ASSEMBLY | ||
1757 | struct cpu_spec { | ||
1758 | /* CPU is matched via (PRID & prid_mask) == prid_value */ | ||
1759 | unsigned int prid_mask; | ||
1760 | unsigned int prid_value; | ||
1761 | |||
1762 | char *cpu_name; | ||
1763 | unsigned char cpu_od; /* Set Config[OD] */ | ||
1764 | unsigned char cpu_bclk; /* Enable BCLK switching */ | ||
1765 | unsigned char cpu_pll_wo; /* sys_cpupll reg. write-only */ | ||
1766 | }; | ||
1767 | |||
1768 | extern struct cpu_spec cpu_specs[]; | ||
1769 | extern struct cpu_spec *cur_cpu_spec[]; | ||
1770 | #endif | ||
1771 | |||
1772 | #endif | 1791 | #endif |
diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h index 44a67bf05dc1..06f68f43800a 100644 --- a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h +++ b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h | |||
@@ -357,6 +357,11 @@ u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr); | |||
357 | u32 au1xxx_ddma_add_device(dbdev_tab_t *dev); | 357 | u32 au1xxx_ddma_add_device(dbdev_tab_t *dev); |
358 | extern void au1xxx_ddma_del_device(u32 devid); | 358 | extern void au1xxx_ddma_del_device(u32 devid); |
359 | void *au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp); | 359 | void *au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp); |
360 | #ifdef CONFIG_PM | ||
361 | void au1xxx_dbdma_suspend(void); | ||
362 | void au1xxx_dbdma_resume(void); | ||
363 | #endif | ||
364 | |||
360 | 365 | ||
361 | /* | 366 | /* |
362 | * Some compatibilty macros -- needed to make changes to API | 367 | * Some compatibilty macros -- needed to make changes to API |
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h new file mode 100644 index 000000000000..04ce6e6569da --- /dev/null +++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004 Cavium Networks | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_CAVIUM_OCTEON_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_MACH_CAVIUM_OCTEON_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <asm/mipsregs.h> | ||
13 | |||
14 | /* | ||
15 | * Cavium Octeons are MIPS64v2 processors | ||
16 | */ | ||
17 | #define cpu_dcache_line_size() 128 | ||
18 | #define cpu_icache_line_size() 128 | ||
19 | |||
20 | |||
21 | #define cpu_has_4kex 1 | ||
22 | #define cpu_has_3k_cache 0 | ||
23 | #define cpu_has_4k_cache 0 | ||
24 | #define cpu_has_tx39_cache 0 | ||
25 | #define cpu_has_fpu 0 | ||
26 | #define cpu_has_counter 1 | ||
27 | #define cpu_has_watch 1 | ||
28 | #define cpu_has_divec 1 | ||
29 | #define cpu_has_vce 0 | ||
30 | #define cpu_has_cache_cdex_p 0 | ||
31 | #define cpu_has_cache_cdex_s 0 | ||
32 | #define cpu_has_prefetch 1 | ||
33 | |||
34 | /* | ||
35 | * We should disable LL/SC on non SMP systems as it is faster to | ||
36 | * disable interrupts for atomic access than a LL/SC. Unfortunatly we | ||
37 | * cannot as this breaks asm/futex.h | ||
38 | */ | ||
39 | #define cpu_has_llsc 1 | ||
40 | #define cpu_has_vtag_icache 1 | ||
41 | #define cpu_has_dc_aliases 0 | ||
42 | #define cpu_has_ic_fills_f_dc 0 | ||
43 | #define cpu_has_64bits 1 | ||
44 | #define cpu_has_octeon_cache 1 | ||
45 | #define cpu_has_saa octeon_has_saa() | ||
46 | #define cpu_has_mips32r1 0 | ||
47 | #define cpu_has_mips32r2 0 | ||
48 | #define cpu_has_mips64r1 0 | ||
49 | #define cpu_has_mips64r2 1 | ||
50 | #define cpu_has_dsp 0 | ||
51 | #define cpu_has_mipsmt 0 | ||
52 | #define cpu_has_userlocal 0 | ||
53 | #define cpu_has_vint 0 | ||
54 | #define cpu_has_veic 0 | ||
55 | #define ARCH_HAS_READ_CURRENT_TIMER 1 | ||
56 | #define ARCH_HAS_IRQ_PER_CPU 1 | ||
57 | #define ARCH_HAS_SPINLOCK_PREFETCH 1 | ||
58 | #define spin_lock_prefetch(x) prefetch(x) | ||
59 | #define PREFETCH_STRIDE 128 | ||
60 | |||
61 | static inline int read_current_timer(unsigned long *result) | ||
62 | { | ||
63 | asm volatile ("rdhwr %0,$31\n" | ||
64 | #ifndef CONFIG_64BIT | ||
65 | "\tsll %0, 0" | ||
66 | #endif | ||
67 | : "=r" (*result)); | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static inline int octeon_has_saa(void) | ||
72 | { | ||
73 | int id; | ||
74 | asm volatile ("mfc0 %0, $15,0" : "=r" (id)); | ||
75 | return id >= 0x000d0300; | ||
76 | } | ||
77 | |||
78 | #endif | ||
diff --git a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h new file mode 100644 index 000000000000..f30fce92aabb --- /dev/null +++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> | ||
7 | * | ||
8 | * | ||
9 | * Similar to mach-generic/dma-coherence.h except | ||
10 | * plat_device_is_coherent hard coded to return 1. | ||
11 | * | ||
12 | */ | ||
13 | #ifndef __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H | ||
14 | #define __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H | ||
15 | |||
16 | struct device; | ||
17 | |||
18 | dma_addr_t octeon_map_dma_mem(struct device *, void *, size_t); | ||
19 | void octeon_unmap_dma_mem(struct device *, dma_addr_t); | ||
20 | |||
21 | static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, | ||
22 | size_t size) | ||
23 | { | ||
24 | return octeon_map_dma_mem(dev, addr, size); | ||
25 | } | ||
26 | |||
27 | static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, | ||
28 | struct page *page) | ||
29 | { | ||
30 | return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE); | ||
31 | } | ||
32 | |||
33 | static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | ||
34 | { | ||
35 | return dma_addr; | ||
36 | } | ||
37 | |||
38 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | ||
39 | { | ||
40 | octeon_unmap_dma_mem(dev, dma_addr); | ||
41 | } | ||
42 | |||
43 | static inline int plat_dma_supported(struct device *dev, u64 mask) | ||
44 | { | ||
45 | return 1; | ||
46 | } | ||
47 | |||
48 | static inline void plat_extra_sync_for_device(struct device *dev) | ||
49 | { | ||
50 | mb(); | ||
51 | } | ||
52 | |||
53 | static inline int plat_device_is_coherent(struct device *dev) | ||
54 | { | ||
55 | return 1; | ||
56 | } | ||
57 | |||
58 | static inline int plat_dma_mapping_error(struct device *dev, | ||
59 | dma_addr_t dma_addr) | ||
60 | { | ||
61 | return dma_addr == -1; | ||
62 | } | ||
63 | |||
64 | #endif /* __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H */ | ||
diff --git a/arch/mips/include/asm/mach-cavium-octeon/irq.h b/arch/mips/include/asm/mach-cavium-octeon/irq.h new file mode 100644 index 000000000000..d32220fbf4f1 --- /dev/null +++ b/arch/mips/include/asm/mach-cavium-octeon/irq.h | |||
@@ -0,0 +1,244 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004-2008 Cavium Networks | ||
7 | */ | ||
8 | #ifndef __OCTEON_IRQ_H__ | ||
9 | #define __OCTEON_IRQ_H__ | ||
10 | |||
11 | #define NR_IRQS OCTEON_IRQ_LAST | ||
12 | #define MIPS_CPU_IRQ_BASE OCTEON_IRQ_SW0 | ||
13 | |||
14 | /* 0 - 7 represent the i8259 master */ | ||
15 | #define OCTEON_IRQ_I8259M0 0 | ||
16 | #define OCTEON_IRQ_I8259M1 1 | ||
17 | #define OCTEON_IRQ_I8259M2 2 | ||
18 | #define OCTEON_IRQ_I8259M3 3 | ||
19 | #define OCTEON_IRQ_I8259M4 4 | ||
20 | #define OCTEON_IRQ_I8259M5 5 | ||
21 | #define OCTEON_IRQ_I8259M6 6 | ||
22 | #define OCTEON_IRQ_I8259M7 7 | ||
23 | /* 8 - 15 represent the i8259 slave */ | ||
24 | #define OCTEON_IRQ_I8259S0 8 | ||
25 | #define OCTEON_IRQ_I8259S1 9 | ||
26 | #define OCTEON_IRQ_I8259S2 10 | ||
27 | #define OCTEON_IRQ_I8259S3 11 | ||
28 | #define OCTEON_IRQ_I8259S4 12 | ||
29 | #define OCTEON_IRQ_I8259S5 13 | ||
30 | #define OCTEON_IRQ_I8259S6 14 | ||
31 | #define OCTEON_IRQ_I8259S7 15 | ||
32 | /* 16 - 23 represent the 8 MIPS standard interrupt sources */ | ||
33 | #define OCTEON_IRQ_SW0 16 | ||
34 | #define OCTEON_IRQ_SW1 17 | ||
35 | #define OCTEON_IRQ_CIU0 18 | ||
36 | #define OCTEON_IRQ_CIU1 19 | ||
37 | #define OCTEON_IRQ_CIU4 20 | ||
38 | #define OCTEON_IRQ_5 21 | ||
39 | #define OCTEON_IRQ_PERF 22 | ||
40 | #define OCTEON_IRQ_TIMER 23 | ||
41 | /* 24 - 87 represent the sources in CIU_INTX_EN0 */ | ||
42 | #define OCTEON_IRQ_WORKQ0 24 | ||
43 | #define OCTEON_IRQ_WORKQ1 25 | ||
44 | #define OCTEON_IRQ_WORKQ2 26 | ||
45 | #define OCTEON_IRQ_WORKQ3 27 | ||
46 | #define OCTEON_IRQ_WORKQ4 28 | ||
47 | #define OCTEON_IRQ_WORKQ5 29 | ||
48 | #define OCTEON_IRQ_WORKQ6 30 | ||
49 | #define OCTEON_IRQ_WORKQ7 31 | ||
50 | #define OCTEON_IRQ_WORKQ8 32 | ||
51 | #define OCTEON_IRQ_WORKQ9 33 | ||
52 | #define OCTEON_IRQ_WORKQ10 34 | ||
53 | #define OCTEON_IRQ_WORKQ11 35 | ||
54 | #define OCTEON_IRQ_WORKQ12 36 | ||
55 | #define OCTEON_IRQ_WORKQ13 37 | ||
56 | #define OCTEON_IRQ_WORKQ14 38 | ||
57 | #define OCTEON_IRQ_WORKQ15 39 | ||
58 | #define OCTEON_IRQ_GPIO0 40 | ||
59 | #define OCTEON_IRQ_GPIO1 41 | ||
60 | #define OCTEON_IRQ_GPIO2 42 | ||
61 | #define OCTEON_IRQ_GPIO3 43 | ||
62 | #define OCTEON_IRQ_GPIO4 44 | ||
63 | #define OCTEON_IRQ_GPIO5 45 | ||
64 | #define OCTEON_IRQ_GPIO6 46 | ||
65 | #define OCTEON_IRQ_GPIO7 47 | ||
66 | #define OCTEON_IRQ_GPIO8 48 | ||
67 | #define OCTEON_IRQ_GPIO9 49 | ||
68 | #define OCTEON_IRQ_GPIO10 50 | ||
69 | #define OCTEON_IRQ_GPIO11 51 | ||
70 | #define OCTEON_IRQ_GPIO12 52 | ||
71 | #define OCTEON_IRQ_GPIO13 53 | ||
72 | #define OCTEON_IRQ_GPIO14 54 | ||
73 | #define OCTEON_IRQ_GPIO15 55 | ||
74 | #define OCTEON_IRQ_MBOX0 56 | ||
75 | #define OCTEON_IRQ_MBOX1 57 | ||
76 | #define OCTEON_IRQ_UART0 58 | ||
77 | #define OCTEON_IRQ_UART1 59 | ||
78 | #define OCTEON_IRQ_PCI_INT0 60 | ||
79 | #define OCTEON_IRQ_PCI_INT1 61 | ||
80 | #define OCTEON_IRQ_PCI_INT2 62 | ||
81 | #define OCTEON_IRQ_PCI_INT3 63 | ||
82 | #define OCTEON_IRQ_PCI_MSI0 64 | ||
83 | #define OCTEON_IRQ_PCI_MSI1 65 | ||
84 | #define OCTEON_IRQ_PCI_MSI2 66 | ||
85 | #define OCTEON_IRQ_PCI_MSI3 67 | ||
86 | #define OCTEON_IRQ_RESERVED68 68 /* Summary of CIU_INT_SUM1 */ | ||
87 | #define OCTEON_IRQ_TWSI 69 | ||
88 | #define OCTEON_IRQ_RML 70 | ||
89 | #define OCTEON_IRQ_TRACE 71 | ||
90 | #define OCTEON_IRQ_GMX_DRP0 72 | ||
91 | #define OCTEON_IRQ_GMX_DRP1 73 | ||
92 | #define OCTEON_IRQ_IPD_DRP 74 | ||
93 | #define OCTEON_IRQ_KEY_ZERO 75 | ||
94 | #define OCTEON_IRQ_TIMER0 76 | ||
95 | #define OCTEON_IRQ_TIMER1 77 | ||
96 | #define OCTEON_IRQ_TIMER2 78 | ||
97 | #define OCTEON_IRQ_TIMER3 79 | ||
98 | #define OCTEON_IRQ_USB0 80 | ||
99 | #define OCTEON_IRQ_PCM 81 | ||
100 | #define OCTEON_IRQ_MPI 82 | ||
101 | #define OCTEON_IRQ_TWSI2 83 | ||
102 | #define OCTEON_IRQ_POWIQ 84 | ||
103 | #define OCTEON_IRQ_IPDPPTHR 85 | ||
104 | #define OCTEON_IRQ_MII0 86 | ||
105 | #define OCTEON_IRQ_BOOTDMA 87 | ||
106 | /* 88 - 151 represent the sources in CIU_INTX_EN1 */ | ||
107 | #define OCTEON_IRQ_WDOG0 88 | ||
108 | #define OCTEON_IRQ_WDOG1 89 | ||
109 | #define OCTEON_IRQ_WDOG2 90 | ||
110 | #define OCTEON_IRQ_WDOG3 91 | ||
111 | #define OCTEON_IRQ_WDOG4 92 | ||
112 | #define OCTEON_IRQ_WDOG5 93 | ||
113 | #define OCTEON_IRQ_WDOG6 94 | ||
114 | #define OCTEON_IRQ_WDOG7 95 | ||
115 | #define OCTEON_IRQ_WDOG8 96 | ||
116 | #define OCTEON_IRQ_WDOG9 97 | ||
117 | #define OCTEON_IRQ_WDOG10 98 | ||
118 | #define OCTEON_IRQ_WDOG11 99 | ||
119 | #define OCTEON_IRQ_WDOG12 100 | ||
120 | #define OCTEON_IRQ_WDOG13 101 | ||
121 | #define OCTEON_IRQ_WDOG14 102 | ||
122 | #define OCTEON_IRQ_WDOG15 103 | ||
123 | #define OCTEON_IRQ_UART2 104 | ||
124 | #define OCTEON_IRQ_USB1 105 | ||
125 | #define OCTEON_IRQ_MII1 106 | ||
126 | #define OCTEON_IRQ_RESERVED107 107 | ||
127 | #define OCTEON_IRQ_RESERVED108 108 | ||
128 | #define OCTEON_IRQ_RESERVED109 109 | ||
129 | #define OCTEON_IRQ_RESERVED110 110 | ||
130 | #define OCTEON_IRQ_RESERVED111 111 | ||
131 | #define OCTEON_IRQ_RESERVED112 112 | ||
132 | #define OCTEON_IRQ_RESERVED113 113 | ||
133 | #define OCTEON_IRQ_RESERVED114 114 | ||
134 | #define OCTEON_IRQ_RESERVED115 115 | ||
135 | #define OCTEON_IRQ_RESERVED116 116 | ||
136 | #define OCTEON_IRQ_RESERVED117 117 | ||
137 | #define OCTEON_IRQ_RESERVED118 118 | ||
138 | #define OCTEON_IRQ_RESERVED119 119 | ||
139 | #define OCTEON_IRQ_RESERVED120 120 | ||
140 | #define OCTEON_IRQ_RESERVED121 121 | ||
141 | #define OCTEON_IRQ_RESERVED122 122 | ||
142 | #define OCTEON_IRQ_RESERVED123 123 | ||
143 | #define OCTEON_IRQ_RESERVED124 124 | ||
144 | #define OCTEON_IRQ_RESERVED125 125 | ||
145 | #define OCTEON_IRQ_RESERVED126 126 | ||
146 | #define OCTEON_IRQ_RESERVED127 127 | ||
147 | #define OCTEON_IRQ_RESERVED128 128 | ||
148 | #define OCTEON_IRQ_RESERVED129 129 | ||
149 | #define OCTEON_IRQ_RESERVED130 130 | ||
150 | #define OCTEON_IRQ_RESERVED131 131 | ||
151 | #define OCTEON_IRQ_RESERVED132 132 | ||
152 | #define OCTEON_IRQ_RESERVED133 133 | ||
153 | #define OCTEON_IRQ_RESERVED134 134 | ||
154 | #define OCTEON_IRQ_RESERVED135 135 | ||
155 | #define OCTEON_IRQ_RESERVED136 136 | ||
156 | #define OCTEON_IRQ_RESERVED137 137 | ||
157 | #define OCTEON_IRQ_RESERVED138 138 | ||
158 | #define OCTEON_IRQ_RESERVED139 139 | ||
159 | #define OCTEON_IRQ_RESERVED140 140 | ||
160 | #define OCTEON_IRQ_RESERVED141 141 | ||
161 | #define OCTEON_IRQ_RESERVED142 142 | ||
162 | #define OCTEON_IRQ_RESERVED143 143 | ||
163 | #define OCTEON_IRQ_RESERVED144 144 | ||
164 | #define OCTEON_IRQ_RESERVED145 145 | ||
165 | #define OCTEON_IRQ_RESERVED146 146 | ||
166 | #define OCTEON_IRQ_RESERVED147 147 | ||
167 | #define OCTEON_IRQ_RESERVED148 148 | ||
168 | #define OCTEON_IRQ_RESERVED149 149 | ||
169 | #define OCTEON_IRQ_RESERVED150 150 | ||
170 | #define OCTEON_IRQ_RESERVED151 151 | ||
171 | |||
172 | #ifdef CONFIG_PCI_MSI | ||
173 | /* 152 - 215 represent the MSI interrupts 0-63 */ | ||
174 | #define OCTEON_IRQ_MSI_BIT0 152 | ||
175 | #define OCTEON_IRQ_MSI_BIT1 153 | ||
176 | #define OCTEON_IRQ_MSI_BIT2 154 | ||
177 | #define OCTEON_IRQ_MSI_BIT3 155 | ||
178 | #define OCTEON_IRQ_MSI_BIT4 156 | ||
179 | #define OCTEON_IRQ_MSI_BIT5 157 | ||
180 | #define OCTEON_IRQ_MSI_BIT6 158 | ||
181 | #define OCTEON_IRQ_MSI_BIT7 159 | ||
182 | #define OCTEON_IRQ_MSI_BIT8 160 | ||
183 | #define OCTEON_IRQ_MSI_BIT9 161 | ||
184 | #define OCTEON_IRQ_MSI_BIT10 162 | ||
185 | #define OCTEON_IRQ_MSI_BIT11 163 | ||
186 | #define OCTEON_IRQ_MSI_BIT12 164 | ||
187 | #define OCTEON_IRQ_MSI_BIT13 165 | ||
188 | #define OCTEON_IRQ_MSI_BIT14 166 | ||
189 | #define OCTEON_IRQ_MSI_BIT15 167 | ||
190 | #define OCTEON_IRQ_MSI_BIT16 168 | ||
191 | #define OCTEON_IRQ_MSI_BIT17 169 | ||
192 | #define OCTEON_IRQ_MSI_BIT18 170 | ||
193 | #define OCTEON_IRQ_MSI_BIT19 171 | ||
194 | #define OCTEON_IRQ_MSI_BIT20 172 | ||
195 | #define OCTEON_IRQ_MSI_BIT21 173 | ||
196 | #define OCTEON_IRQ_MSI_BIT22 174 | ||
197 | #define OCTEON_IRQ_MSI_BIT23 175 | ||
198 | #define OCTEON_IRQ_MSI_BIT24 176 | ||
199 | #define OCTEON_IRQ_MSI_BIT25 177 | ||
200 | #define OCTEON_IRQ_MSI_BIT26 178 | ||
201 | #define OCTEON_IRQ_MSI_BIT27 179 | ||
202 | #define OCTEON_IRQ_MSI_BIT28 180 | ||
203 | #define OCTEON_IRQ_MSI_BIT29 181 | ||
204 | #define OCTEON_IRQ_MSI_BIT30 182 | ||
205 | #define OCTEON_IRQ_MSI_BIT31 183 | ||
206 | #define OCTEON_IRQ_MSI_BIT32 184 | ||
207 | #define OCTEON_IRQ_MSI_BIT33 185 | ||
208 | #define OCTEON_IRQ_MSI_BIT34 186 | ||
209 | #define OCTEON_IRQ_MSI_BIT35 187 | ||
210 | #define OCTEON_IRQ_MSI_BIT36 188 | ||
211 | #define OCTEON_IRQ_MSI_BIT37 189 | ||
212 | #define OCTEON_IRQ_MSI_BIT38 190 | ||
213 | #define OCTEON_IRQ_MSI_BIT39 191 | ||
214 | #define OCTEON_IRQ_MSI_BIT40 192 | ||
215 | #define OCTEON_IRQ_MSI_BIT41 193 | ||
216 | #define OCTEON_IRQ_MSI_BIT42 194 | ||
217 | #define OCTEON_IRQ_MSI_BIT43 195 | ||
218 | #define OCTEON_IRQ_MSI_BIT44 196 | ||
219 | #define OCTEON_IRQ_MSI_BIT45 197 | ||
220 | #define OCTEON_IRQ_MSI_BIT46 198 | ||
221 | #define OCTEON_IRQ_MSI_BIT47 199 | ||
222 | #define OCTEON_IRQ_MSI_BIT48 200 | ||
223 | #define OCTEON_IRQ_MSI_BIT49 201 | ||
224 | #define OCTEON_IRQ_MSI_BIT50 202 | ||
225 | #define OCTEON_IRQ_MSI_BIT51 203 | ||
226 | #define OCTEON_IRQ_MSI_BIT52 204 | ||
227 | #define OCTEON_IRQ_MSI_BIT53 205 | ||
228 | #define OCTEON_IRQ_MSI_BIT54 206 | ||
229 | #define OCTEON_IRQ_MSI_BIT55 207 | ||
230 | #define OCTEON_IRQ_MSI_BIT56 208 | ||
231 | #define OCTEON_IRQ_MSI_BIT57 209 | ||
232 | #define OCTEON_IRQ_MSI_BIT58 210 | ||
233 | #define OCTEON_IRQ_MSI_BIT59 211 | ||
234 | #define OCTEON_IRQ_MSI_BIT60 212 | ||
235 | #define OCTEON_IRQ_MSI_BIT61 213 | ||
236 | #define OCTEON_IRQ_MSI_BIT62 214 | ||
237 | #define OCTEON_IRQ_MSI_BIT63 215 | ||
238 | |||
239 | #define OCTEON_IRQ_LAST 216 | ||
240 | #else | ||
241 | #define OCTEON_IRQ_LAST 152 | ||
242 | #endif | ||
243 | |||
244 | #endif | ||
diff --git a/arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h b/arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h new file mode 100644 index 000000000000..0b2b5eb22e9b --- /dev/null +++ b/arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h | |||
@@ -0,0 +1,131 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005-2008 Cavium Networks, Inc | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_CAVIUM_OCTEON_KERNEL_ENTRY_H | ||
9 | #define __ASM_MACH_CAVIUM_OCTEON_KERNEL_ENTRY_H | ||
10 | |||
11 | |||
12 | #define CP0_CYCLE_COUNTER $9, 6 | ||
13 | #define CP0_CVMCTL_REG $9, 7 | ||
14 | #define CP0_CVMMEMCTL_REG $11,7 | ||
15 | #define CP0_PRID_REG $15, 0 | ||
16 | #define CP0_PRID_OCTEON_PASS1 0x000d0000 | ||
17 | #define CP0_PRID_OCTEON_CN30XX 0x000d0200 | ||
18 | |||
19 | .macro kernel_entry_setup | ||
20 | # Registers set by bootloader: | ||
21 | # (only 32 bits set by bootloader, all addresses are physical | ||
22 | # addresses, and need to have the appropriate memory region set | ||
23 | # by the kernel | ||
24 | # a0 = argc | ||
25 | # a1 = argv (kseg0 compat addr) | ||
26 | # a2 = 1 if init core, zero otherwise | ||
27 | # a3 = address of boot descriptor block | ||
28 | .set push | ||
29 | .set arch=octeon | ||
30 | # Read the cavium mem control register | ||
31 | dmfc0 v0, CP0_CVMMEMCTL_REG | ||
32 | # Clear the lower 6 bits, the CVMSEG size | ||
33 | dins v0, $0, 0, 6 | ||
34 | ori v0, CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE | ||
35 | dmtc0 v0, CP0_CVMMEMCTL_REG # Write the cavium mem control register | ||
36 | dmfc0 v0, CP0_CVMCTL_REG # Read the cavium control register | ||
37 | #ifdef CONFIG_CAVIUM_OCTEON_HW_FIX_UNALIGNED | ||
38 | # Disable unaligned load/store support but leave HW fixup enabled | ||
39 | or v0, v0, 0x5001 | ||
40 | xor v0, v0, 0x1001 | ||
41 | #else | ||
42 | # Disable unaligned load/store and HW fixup support | ||
43 | or v0, v0, 0x5001 | ||
44 | xor v0, v0, 0x5001 | ||
45 | #endif | ||
46 | # Read the processor ID register | ||
47 | mfc0 v1, CP0_PRID_REG | ||
48 | # Disable instruction prefetching (Octeon Pass1 errata) | ||
49 | or v0, v0, 0x2000 | ||
50 | # Skip reenable of prefetching for Octeon Pass1 | ||
51 | beq v1, CP0_PRID_OCTEON_PASS1, skip | ||
52 | nop | ||
53 | # Reenable instruction prefetching, not on Pass1 | ||
54 | xor v0, v0, 0x2000 | ||
55 | # Strip off pass number off of processor id | ||
56 | srl v1, 8 | ||
57 | sll v1, 8 | ||
58 | # CN30XX needs some extra stuff turned off for better performance | ||
59 | bne v1, CP0_PRID_OCTEON_CN30XX, skip | ||
60 | nop | ||
61 | # CN30XX Use random Icache replacement | ||
62 | or v0, v0, 0x400 | ||
63 | # CN30XX Disable instruction prefetching | ||
64 | or v0, v0, 0x2000 | ||
65 | skip: | ||
66 | # Write the cavium control register | ||
67 | dmtc0 v0, CP0_CVMCTL_REG | ||
68 | sync | ||
69 | # Flush dcache after config change | ||
70 | cache 9, 0($0) | ||
71 | # Get my core id | ||
72 | rdhwr v0, $0 | ||
73 | # Jump the master to kernel_entry | ||
74 | bne a2, zero, octeon_main_processor | ||
75 | nop | ||
76 | |||
77 | #ifdef CONFIG_SMP | ||
78 | |||
79 | # | ||
80 | # All cores other than the master need to wait here for SMP bootstrap | ||
81 | # to begin | ||
82 | # | ||
83 | |||
84 | # This is the variable where the next core to boot os stored | ||
85 | PTR_LA t0, octeon_processor_boot | ||
86 | octeon_spin_wait_boot: | ||
87 | # Get the core id of the next to be booted | ||
88 | LONG_L t1, (t0) | ||
89 | # Keep looping if it isn't me | ||
90 | bne t1, v0, octeon_spin_wait_boot | ||
91 | nop | ||
92 | # Get my GP from the global variable | ||
93 | PTR_LA t0, octeon_processor_gp | ||
94 | LONG_L gp, (t0) | ||
95 | # Get my SP from the global variable | ||
96 | PTR_LA t0, octeon_processor_sp | ||
97 | LONG_L sp, (t0) | ||
98 | # Set the SP global variable to zero so the master knows we've started | ||
99 | LONG_S zero, (t0) | ||
100 | #ifdef __OCTEON__ | ||
101 | syncw | ||
102 | syncw | ||
103 | #else | ||
104 | sync | ||
105 | #endif | ||
106 | # Jump to the normal Linux SMP entry point | ||
107 | j smp_bootstrap | ||
108 | nop | ||
109 | #else /* CONFIG_SMP */ | ||
110 | |||
111 | # | ||
112 | # Someone tried to boot SMP with a non SMP kernel. All extra cores | ||
113 | # will halt here. | ||
114 | # | ||
115 | octeon_wait_forever: | ||
116 | wait | ||
117 | b octeon_wait_forever | ||
118 | nop | ||
119 | |||
120 | #endif /* CONFIG_SMP */ | ||
121 | octeon_main_processor: | ||
122 | .set pop | ||
123 | .endm | ||
124 | |||
125 | /* | ||
126 | * Do SMP slave processor setup necessary before we can savely execute C code. | ||
127 | */ | ||
128 | .macro smp_slave_setup | ||
129 | .endm | ||
130 | |||
131 | #endif /* __ASM_MACH_CAVIUM_OCTEON_KERNEL_ENTRY_H */ | ||
diff --git a/arch/mips/include/asm/mach-cavium-octeon/war.h b/arch/mips/include/asm/mach-cavium-octeon/war.h new file mode 100644 index 000000000000..c4712d7cc81d --- /dev/null +++ b/arch/mips/include/asm/mach-cavium-octeon/war.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | * Copyright (C) 2008 Cavium Networks <support@caviumnetworks.com> | ||
8 | */ | ||
9 | #ifndef __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H | ||
10 | #define __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H | ||
11 | |||
12 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
13 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
14 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
15 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
16 | #define BCM1250_M3_WAR 0 | ||
17 | #define SIBYTE_1956_WAR 0 | ||
18 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
19 | #define MIPS_CACHE_SYNC_WAR 0 | ||
20 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
21 | #define RM9000_CDEX_SMP_WAR 0 | ||
22 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
23 | #define R10000_LLSC_WAR 0 | ||
24 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
25 | |||
26 | #endif /* __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H */ | ||
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h index 76e04e7feb84..36c611b6c597 100644 --- a/arch/mips/include/asm/mach-generic/dma-coherence.h +++ b/arch/mips/include/asm/mach-generic/dma-coherence.h | |||
@@ -28,10 +28,34 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | |||
28 | return dma_addr; | 28 | return dma_addr; |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | 31 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) |
32 | { | 32 | { |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline int plat_dma_supported(struct device *dev, u64 mask) | ||
36 | { | ||
37 | /* | ||
38 | * we fall back to GFP_DMA when the mask isn't all 1s, | ||
39 | * so we can't guarantee allocations that must be | ||
40 | * within a tighter range than GFP_DMA.. | ||
41 | */ | ||
42 | if (mask < DMA_BIT_MASK(24)) | ||
43 | return 0; | ||
44 | |||
45 | return 1; | ||
46 | } | ||
47 | |||
48 | static inline void plat_extra_sync_for_device(struct device *dev) | ||
49 | { | ||
50 | return; | ||
51 | } | ||
52 | |||
53 | static inline int plat_dma_mapping_error(struct device *dev, | ||
54 | dma_addr_t dma_addr) | ||
55 | { | ||
56 | return 0; | ||
57 | } | ||
58 | |||
35 | static inline int plat_device_is_coherent(struct device *dev) | 59 | static inline int plat_device_is_coherent(struct device *dev) |
36 | { | 60 | { |
37 | #ifdef CONFIG_DMA_COHERENT | 61 | #ifdef CONFIG_DMA_COHERENT |
diff --git a/arch/mips/include/asm/mach-ip27/dma-coherence.h b/arch/mips/include/asm/mach-ip27/dma-coherence.h index ed7e6222dc15..4c21bfca10c3 100644 --- a/arch/mips/include/asm/mach-ip27/dma-coherence.h +++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h | |||
@@ -38,10 +38,34 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | |||
38 | return dma_addr & ~(0xffUL << 56); | 38 | return dma_addr & ~(0xffUL << 56); |
39 | } | 39 | } |
40 | 40 | ||
41 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | 41 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) |
42 | { | 42 | { |
43 | } | 43 | } |
44 | 44 | ||
45 | static inline int plat_dma_supported(struct device *dev, u64 mask) | ||
46 | { | ||
47 | /* | ||
48 | * we fall back to GFP_DMA when the mask isn't all 1s, | ||
49 | * so we can't guarantee allocations that must be | ||
50 | * within a tighter range than GFP_DMA.. | ||
51 | */ | ||
52 | if (mask < DMA_BIT_MASK(24)) | ||
53 | return 0; | ||
54 | |||
55 | return 1; | ||
56 | } | ||
57 | |||
58 | static inline void plat_extra_sync_for_device(struct device *dev) | ||
59 | { | ||
60 | return; | ||
61 | } | ||
62 | |||
63 | static inline int plat_dma_mapping_error(struct device *dev, | ||
64 | dma_addr_t dma_addr) | ||
65 | { | ||
66 | return 0; | ||
67 | } | ||
68 | |||
45 | static inline int plat_device_is_coherent(struct device *dev) | 69 | static inline int plat_device_is_coherent(struct device *dev) |
46 | { | 70 | { |
47 | return 1; /* IP27 non-cohernet mode is unsupported */ | 71 | return 1; /* IP27 non-cohernet mode is unsupported */ |
diff --git a/arch/mips/include/asm/mach-ip32/dma-coherence.h b/arch/mips/include/asm/mach-ip32/dma-coherence.h index a5511ebb2d53..7ae40f4b1c80 100644 --- a/arch/mips/include/asm/mach-ip32/dma-coherence.h +++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h | |||
@@ -60,10 +60,34 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | |||
60 | return addr; | 60 | return addr; |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | 63 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) |
64 | { | 64 | { |
65 | } | 65 | } |
66 | 66 | ||
67 | static inline int plat_dma_supported(struct device *dev, u64 mask) | ||
68 | { | ||
69 | /* | ||
70 | * we fall back to GFP_DMA when the mask isn't all 1s, | ||
71 | * so we can't guarantee allocations that must be | ||
72 | * within a tighter range than GFP_DMA.. | ||
73 | */ | ||
74 | if (mask < DMA_BIT_MASK(24)) | ||
75 | return 0; | ||
76 | |||
77 | return 1; | ||
78 | } | ||
79 | |||
80 | static inline void plat_extra_sync_for_device(struct device *dev) | ||
81 | { | ||
82 | return; | ||
83 | } | ||
84 | |||
85 | static inline int plat_dma_mapping_error(struct device *dev, | ||
86 | dma_addr_t dma_addr) | ||
87 | { | ||
88 | return 0; | ||
89 | } | ||
90 | |||
67 | static inline int plat_device_is_coherent(struct device *dev) | 91 | static inline int plat_device_is_coherent(struct device *dev) |
68 | { | 92 | { |
69 | return 0; /* IP32 is non-cohernet */ | 93 | return 0; /* IP32 is non-cohernet */ |
diff --git a/arch/mips/include/asm/mach-jazz/dma-coherence.h b/arch/mips/include/asm/mach-jazz/dma-coherence.h index d66979a124a8..1c7cd27efa7b 100644 --- a/arch/mips/include/asm/mach-jazz/dma-coherence.h +++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h | |||
@@ -27,11 +27,35 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | |||
27 | return vdma_log2phys(dma_addr); | 27 | return vdma_log2phys(dma_addr); |
28 | } | 28 | } |
29 | 29 | ||
30 | static void plat_unmap_dma_mem(dma_addr_t dma_addr) | 30 | static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) |
31 | { | 31 | { |
32 | vdma_free(dma_addr); | 32 | vdma_free(dma_addr); |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline int plat_dma_supported(struct device *dev, u64 mask) | ||
36 | { | ||
37 | /* | ||
38 | * we fall back to GFP_DMA when the mask isn't all 1s, | ||
39 | * so we can't guarantee allocations that must be | ||
40 | * within a tighter range than GFP_DMA.. | ||
41 | */ | ||
42 | if (mask < DMA_BIT_MASK(24)) | ||
43 | return 0; | ||
44 | |||
45 | return 1; | ||
46 | } | ||
47 | |||
48 | static inline void plat_extra_sync_for_device(struct device *dev) | ||
49 | { | ||
50 | return; | ||
51 | } | ||
52 | |||
53 | static inline int plat_dma_mapping_error(struct device *dev, | ||
54 | dma_addr_t dma_addr) | ||
55 | { | ||
56 | return 0; | ||
57 | } | ||
58 | |||
35 | static inline int plat_device_is_coherent(struct device *dev) | 59 | static inline int plat_device_is_coherent(struct device *dev) |
36 | { | 60 | { |
37 | return 0; | 61 | return 0; |
diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/include/asm/mach-lemote/dma-coherence.h index 7e914777ebc4..38fad7dfe7da 100644 --- a/arch/mips/include/asm/mach-lemote/dma-coherence.h +++ b/arch/mips/include/asm/mach-lemote/dma-coherence.h | |||
@@ -30,10 +30,34 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | |||
30 | return dma_addr & 0x7fffffff; | 30 | return dma_addr & 0x7fffffff; |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | 33 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) |
34 | { | 34 | { |
35 | } | 35 | } |
36 | 36 | ||
37 | static inline int plat_dma_supported(struct device *dev, u64 mask) | ||
38 | { | ||
39 | /* | ||
40 | * we fall back to GFP_DMA when the mask isn't all 1s, | ||
41 | * so we can't guarantee allocations that must be | ||
42 | * within a tighter range than GFP_DMA.. | ||
43 | */ | ||
44 | if (mask < DMA_BIT_MASK(24)) | ||
45 | return 0; | ||
46 | |||
47 | return 1; | ||
48 | } | ||
49 | |||
50 | static inline void plat_extra_sync_for_device(struct device *dev) | ||
51 | { | ||
52 | return; | ||
53 | } | ||
54 | |||
55 | static inline int plat_dma_mapping_error(struct device *dev, | ||
56 | dma_addr_t dma_addr) | ||
57 | { | ||
58 | return 0; | ||
59 | } | ||
60 | |||
37 | static inline int plat_device_is_coherent(struct device *dev) | 61 | static inline int plat_device_is_coherent(struct device *dev) |
38 | { | 62 | { |
39 | return 0; | 63 | return 0; |
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 9316324d070d..0417516503f6 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
@@ -1000,6 +1000,26 @@ do { \ | |||
1000 | #define read_c0_ebase() __read_32bit_c0_register($15, 1) | 1000 | #define read_c0_ebase() __read_32bit_c0_register($15, 1) |
1001 | #define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val) | 1001 | #define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val) |
1002 | 1002 | ||
1003 | |||
1004 | /* Cavium OCTEON (cnMIPS) */ | ||
1005 | #define read_c0_cvmcount() __read_ulong_c0_register($9, 6) | ||
1006 | #define write_c0_cvmcount(val) __write_ulong_c0_register($9, 6, val) | ||
1007 | |||
1008 | #define read_c0_cvmctl() __read_64bit_c0_register($9, 7) | ||
1009 | #define write_c0_cvmctl(val) __write_64bit_c0_register($9, 7, val) | ||
1010 | |||
1011 | #define read_c0_cvmmemctl() __read_64bit_c0_register($11, 7) | ||
1012 | #define write_c0_cvmmemctl(val) __write_64bit_c0_register($11, 7, val) | ||
1013 | /* | ||
1014 | * The cacheerr registers are not standardized. On OCTEON, they are | ||
1015 | * 64 bits wide. | ||
1016 | */ | ||
1017 | #define read_octeon_c0_icacheerr() __read_64bit_c0_register($27, 0) | ||
1018 | #define write_octeon_c0_icacheerr(val) __write_64bit_c0_register($27, 0, val) | ||
1019 | |||
1020 | #define read_octeon_c0_dcacheerr() __read_64bit_c0_register($27, 1) | ||
1021 | #define write_octeon_c0_dcacheerr(val) __write_64bit_c0_register($27, 1, val) | ||
1022 | |||
1003 | /* | 1023 | /* |
1004 | * Macros to access the floating point coprocessor control registers | 1024 | * Macros to access the floating point coprocessor control registers |
1005 | */ | 1025 | */ |
@@ -1008,6 +1028,8 @@ do { \ | |||
1008 | __asm__ __volatile__( \ | 1028 | __asm__ __volatile__( \ |
1009 | ".set\tpush\n\t" \ | 1029 | ".set\tpush\n\t" \ |
1010 | ".set\treorder\n\t" \ | 1030 | ".set\treorder\n\t" \ |
1031 | /* gas fails to assemble cfc1 for some archs (octeon).*/ \ | ||
1032 | ".set\tmips1\n\t" \ | ||
1011 | "cfc1\t%0,"STR(source)"\n\t" \ | 1033 | "cfc1\t%0,"STR(source)"\n\t" \ |
1012 | ".set\tpop" \ | 1034 | ".set\tpop" \ |
1013 | : "=r" (__res)); \ | 1035 | : "=r" (__res)); \ |
diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h index e2e09b2cd265..d94085a3eafb 100644 --- a/arch/mips/include/asm/module.h +++ b/arch/mips/include/asm/module.h | |||
@@ -116,6 +116,8 @@ search_module_dbetables(unsigned long addr) | |||
116 | #define MODULE_PROC_FAMILY "SB1 " | 116 | #define MODULE_PROC_FAMILY "SB1 " |
117 | #elif defined CONFIG_CPU_LOONGSON2 | 117 | #elif defined CONFIG_CPU_LOONGSON2 |
118 | #define MODULE_PROC_FAMILY "LOONGSON2 " | 118 | #define MODULE_PROC_FAMILY "LOONGSON2 " |
119 | #elif defined CONFIG_CPU_CAVIUM_OCTEON | ||
120 | #define MODULE_PROC_FAMILY "OCTEON " | ||
119 | #else | 121 | #else |
120 | #error MODULE_PROC_FAMILY undefined for your processor configuration | 122 | #error MODULE_PROC_FAMILY undefined for your processor configuration |
121 | #endif | 123 | #endif |
diff --git a/arch/mips/include/asm/octeon/cvmx-asm.h b/arch/mips/include/asm/octeon/cvmx-asm.h new file mode 100644 index 000000000000..b21d3fc1ef91 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-asm.h | |||
@@ -0,0 +1,128 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * | ||
30 | * This is file defines ASM primitives for the executive. | ||
31 | */ | ||
32 | #ifndef __CVMX_ASM_H__ | ||
33 | #define __CVMX_ASM_H__ | ||
34 | |||
35 | #include "octeon-model.h" | ||
36 | |||
37 | /* other useful stuff */ | ||
38 | #define CVMX_SYNC asm volatile ("sync" : : : "memory") | ||
39 | /* String version of SYNCW macro for using in inline asm constructs */ | ||
40 | #define CVMX_SYNCW_STR "syncw\nsyncw\n" | ||
41 | #ifdef __OCTEON__ | ||
42 | |||
43 | /* Deprecated, will be removed in future release */ | ||
44 | #define CVMX_SYNCIO asm volatile ("nop") | ||
45 | |||
46 | #define CVMX_SYNCIOBDMA asm volatile ("synciobdma" : : : "memory") | ||
47 | |||
48 | /* Deprecated, will be removed in future release */ | ||
49 | #define CVMX_SYNCIOALL asm volatile ("nop") | ||
50 | |||
51 | /* | ||
52 | * We actually use two syncw instructions in a row when we need a write | ||
53 | * memory barrier. This is because the CN3XXX series of Octeons have | ||
54 | * errata Core-401. This can cause a single syncw to not enforce | ||
55 | * ordering under very rare conditions. Even if it is rare, better safe | ||
56 | * than sorry. | ||
57 | */ | ||
58 | #define CVMX_SYNCW asm volatile ("syncw\n\tsyncw" : : : "memory") | ||
59 | |||
60 | /* | ||
61 | * Define new sync instructions to be normal SYNC instructions for | ||
62 | * operating systems that use threads. | ||
63 | */ | ||
64 | #define CVMX_SYNCWS CVMX_SYNCW | ||
65 | #define CVMX_SYNCS CVMX_SYNC | ||
66 | #define CVMX_SYNCWS_STR CVMX_SYNCW_STR | ||
67 | #else | ||
68 | /* | ||
69 | * Not using a Cavium compiler, always use the slower sync so the | ||
70 | * assembler stays happy. | ||
71 | */ | ||
72 | /* Deprecated, will be removed in future release */ | ||
73 | #define CVMX_SYNCIO asm volatile ("nop") | ||
74 | |||
75 | #define CVMX_SYNCIOBDMA asm volatile ("sync" : : : "memory") | ||
76 | |||
77 | /* Deprecated, will be removed in future release */ | ||
78 | #define CVMX_SYNCIOALL asm volatile ("nop") | ||
79 | |||
80 | #define CVMX_SYNCW asm volatile ("sync" : : : "memory") | ||
81 | #define CVMX_SYNCWS CVMX_SYNCW | ||
82 | #define CVMX_SYNCS CVMX_SYNC | ||
83 | #define CVMX_SYNCWS_STR CVMX_SYNCW_STR | ||
84 | #endif | ||
85 | |||
86 | /* | ||
87 | * CVMX_PREPARE_FOR_STORE makes each byte of the block unpredictable | ||
88 | * (actually old value or zero) until that byte is stored to (by this or | ||
89 | * another processor. Note that the value of each byte is not only | ||
90 | * unpredictable, but may also change again - up until the point when one | ||
91 | * of the cores stores to the byte. | ||
92 | */ | ||
93 | #define CVMX_PREPARE_FOR_STORE(address, offset) \ | ||
94 | asm volatile ("pref 30, " CVMX_TMP_STR(offset) "(%[rbase])" : : \ | ||
95 | [rbase] "d" (address)) | ||
96 | /* | ||
97 | * This is a command headed to the L2 controller to tell it to clear | ||
98 | * its dirty bit for a block. Basically, SW is telling HW that the | ||
99 | * current version of the block will not be used. | ||
100 | */ | ||
101 | #define CVMX_DONT_WRITE_BACK(address, offset) \ | ||
102 | asm volatile ("pref 29, " CVMX_TMP_STR(offset) "(%[rbase])" : : \ | ||
103 | [rbase] "d" (address)) | ||
104 | |||
105 | /* flush stores, invalidate entire icache */ | ||
106 | #define CVMX_ICACHE_INVALIDATE \ | ||
107 | { CVMX_SYNC; asm volatile ("synci 0($0)" : : ); } | ||
108 | |||
109 | /* flush stores, invalidate entire icache */ | ||
110 | #define CVMX_ICACHE_INVALIDATE2 \ | ||
111 | { CVMX_SYNC; asm volatile ("cache 0, 0($0)" : : ); } | ||
112 | |||
113 | /* complete prefetches, invalidate entire dcache */ | ||
114 | #define CVMX_DCACHE_INVALIDATE \ | ||
115 | { CVMX_SYNC; asm volatile ("cache 9, 0($0)" : : ); } | ||
116 | |||
117 | |||
118 | #define CVMX_POP(result, input) \ | ||
119 | asm ("pop %[rd],%[rs]" : [rd] "=d" (result) : [rs] "d" (input)) | ||
120 | #define CVMX_DPOP(result, input) \ | ||
121 | asm ("dpop %[rd],%[rs]" : [rd] "=d" (result) : [rs] "d" (input)) | ||
122 | |||
123 | /* some new cop0-like stuff */ | ||
124 | #define CVMX_RDHWR(result, regstr) \ | ||
125 | asm volatile ("rdhwr %[rt],$" CVMX_TMP_STR(regstr) : [rt] "=d" (result)) | ||
126 | #define CVMX_RDHWRNV(result, regstr) \ | ||
127 | asm ("rdhwr %[rt],$" CVMX_TMP_STR(regstr) : [rt] "=d" (result)) | ||
128 | #endif /* __CVMX_ASM_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h new file mode 100644 index 000000000000..692989acd8a9 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h | |||
@@ -0,0 +1,262 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * Header file containing the ABI with the bootloader. | ||
30 | */ | ||
31 | |||
32 | #ifndef __CVMX_BOOTINFO_H__ | ||
33 | #define __CVMX_BOOTINFO_H__ | ||
34 | |||
35 | /* | ||
36 | * Current major and minor versions of the CVMX bootinfo block that is | ||
37 | * passed from the bootloader to the application. This is versioned | ||
38 | * so that applications can properly handle multiple bootloader | ||
39 | * versions. | ||
40 | */ | ||
41 | #define CVMX_BOOTINFO_MAJ_VER 1 | ||
42 | #define CVMX_BOOTINFO_MIN_VER 2 | ||
43 | |||
44 | #if (CVMX_BOOTINFO_MAJ_VER == 1) | ||
45 | #define CVMX_BOOTINFO_OCTEON_SERIAL_LEN 20 | ||
46 | /* | ||
47 | * This structure is populated by the bootloader. For binary | ||
48 | * compatibility the only changes that should be made are | ||
49 | * adding members to the end of the structure, and the minor | ||
50 | * version should be incremented at that time. | ||
51 | * If an incompatible change is made, the major version | ||
52 | * must be incremented, and the minor version should be reset | ||
53 | * to 0. | ||
54 | */ | ||
55 | struct cvmx_bootinfo { | ||
56 | uint32_t major_version; | ||
57 | uint32_t minor_version; | ||
58 | |||
59 | uint64_t stack_top; | ||
60 | uint64_t heap_base; | ||
61 | uint64_t heap_end; | ||
62 | uint64_t desc_vaddr; | ||
63 | |||
64 | uint32_t exception_base_addr; | ||
65 | uint32_t stack_size; | ||
66 | uint32_t flags; | ||
67 | uint32_t core_mask; | ||
68 | /* DRAM size in megabytes */ | ||
69 | uint32_t dram_size; | ||
70 | /* physical address of free memory descriptor block*/ | ||
71 | uint32_t phy_mem_desc_addr; | ||
72 | /* used to pass flags from app to debugger */ | ||
73 | uint32_t debugger_flags_base_addr; | ||
74 | |||
75 | /* CPU clock speed, in hz */ | ||
76 | uint32_t eclock_hz; | ||
77 | |||
78 | /* DRAM clock speed, in hz */ | ||
79 | uint32_t dclock_hz; | ||
80 | |||
81 | uint32_t reserved0; | ||
82 | uint16_t board_type; | ||
83 | uint8_t board_rev_major; | ||
84 | uint8_t board_rev_minor; | ||
85 | uint16_t reserved1; | ||
86 | uint8_t reserved2; | ||
87 | uint8_t reserved3; | ||
88 | char board_serial_number[CVMX_BOOTINFO_OCTEON_SERIAL_LEN]; | ||
89 | uint8_t mac_addr_base[6]; | ||
90 | uint8_t mac_addr_count; | ||
91 | #if (CVMX_BOOTINFO_MIN_VER >= 1) | ||
92 | /* | ||
93 | * Several boards support compact flash on the Octeon boot | ||
94 | * bus. The CF memory spaces may be mapped to different | ||
95 | * addresses on different boards. These are the physical | ||
96 | * addresses, so care must be taken to use the correct | ||
97 | * XKPHYS/KSEG0 addressing depending on the application's | ||
98 | * ABI. These values will be 0 if CF is not present. | ||
99 | */ | ||
100 | uint64_t compact_flash_common_base_addr; | ||
101 | uint64_t compact_flash_attribute_base_addr; | ||
102 | /* | ||
103 | * Base address of the LED display (as on EBT3000 board) | ||
104 | * This will be 0 if LED display not present. | ||
105 | */ | ||
106 | uint64_t led_display_base_addr; | ||
107 | #endif | ||
108 | #if (CVMX_BOOTINFO_MIN_VER >= 2) | ||
109 | /* DFA reference clock in hz (if applicable)*/ | ||
110 | uint32_t dfa_ref_clock_hz; | ||
111 | |||
112 | /* | ||
113 | * flags indicating various configuration options. These | ||
114 | * flags supercede the 'flags' variable and should be used | ||
115 | * instead if available. | ||
116 | */ | ||
117 | uint32_t config_flags; | ||
118 | #endif | ||
119 | |||
120 | }; | ||
121 | |||
122 | #define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0) | ||
123 | #define CVMX_BOOTINFO_CFG_FLAG_PCI_TARGET (1ull << 1) | ||
124 | #define CVMX_BOOTINFO_CFG_FLAG_DEBUG (1ull << 2) | ||
125 | #define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3) | ||
126 | /* This flag is set if the TLB mappings are not contained in the | ||
127 | * 0x10000000 - 0x20000000 boot bus region. */ | ||
128 | #define CVMX_BOOTINFO_CFG_FLAG_OVERSIZE_TLB_MAPPING (1ull << 4) | ||
129 | #define CVMX_BOOTINFO_CFG_FLAG_BREAK (1ull << 5) | ||
130 | |||
131 | #endif /* (CVMX_BOOTINFO_MAJ_VER == 1) */ | ||
132 | |||
133 | /* Type defines for board and chip types */ | ||
134 | enum cvmx_board_types_enum { | ||
135 | CVMX_BOARD_TYPE_NULL = 0, | ||
136 | CVMX_BOARD_TYPE_SIM = 1, | ||
137 | CVMX_BOARD_TYPE_EBT3000 = 2, | ||
138 | CVMX_BOARD_TYPE_KODAMA = 3, | ||
139 | CVMX_BOARD_TYPE_NIAGARA = 4, | ||
140 | CVMX_BOARD_TYPE_NAC38 = 5, /* formerly NAO38 */ | ||
141 | CVMX_BOARD_TYPE_THUNDER = 6, | ||
142 | CVMX_BOARD_TYPE_TRANTOR = 7, | ||
143 | CVMX_BOARD_TYPE_EBH3000 = 8, | ||
144 | CVMX_BOARD_TYPE_EBH3100 = 9, | ||
145 | CVMX_BOARD_TYPE_HIKARI = 10, | ||
146 | CVMX_BOARD_TYPE_CN3010_EVB_HS5 = 11, | ||
147 | CVMX_BOARD_TYPE_CN3005_EVB_HS5 = 12, | ||
148 | CVMX_BOARD_TYPE_KBP = 13, | ||
149 | /* Deprecated, CVMX_BOARD_TYPE_CN3010_EVB_HS5 supports the CN3020 */ | ||
150 | CVMX_BOARD_TYPE_CN3020_EVB_HS5 = 14, | ||
151 | CVMX_BOARD_TYPE_EBT5800 = 15, | ||
152 | CVMX_BOARD_TYPE_NICPRO2 = 16, | ||
153 | CVMX_BOARD_TYPE_EBH5600 = 17, | ||
154 | CVMX_BOARD_TYPE_EBH5601 = 18, | ||
155 | CVMX_BOARD_TYPE_EBH5200 = 19, | ||
156 | CVMX_BOARD_TYPE_BBGW_REF = 20, | ||
157 | CVMX_BOARD_TYPE_NIC_XLE_4G = 21, | ||
158 | CVMX_BOARD_TYPE_EBT5600 = 22, | ||
159 | CVMX_BOARD_TYPE_EBH5201 = 23, | ||
160 | CVMX_BOARD_TYPE_MAX, | ||
161 | |||
162 | /* | ||
163 | * The range from CVMX_BOARD_TYPE_MAX to | ||
164 | * CVMX_BOARD_TYPE_CUST_DEFINED_MIN is reserved for future | ||
165 | * SDK use. | ||
166 | */ | ||
167 | |||
168 | /* | ||
169 | * Set aside a range for customer boards. These numbers are managed | ||
170 | * by Cavium. | ||
171 | */ | ||
172 | CVMX_BOARD_TYPE_CUST_DEFINED_MIN = 10000, | ||
173 | CVMX_BOARD_TYPE_CUST_WSX16 = 10001, | ||
174 | CVMX_BOARD_TYPE_CUST_NS0216 = 10002, | ||
175 | CVMX_BOARD_TYPE_CUST_NB5 = 10003, | ||
176 | CVMX_BOARD_TYPE_CUST_WMR500 = 10004, | ||
177 | CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000, | ||
178 | |||
179 | /* | ||
180 | * Set aside a range for customer private use. The SDK won't | ||
181 | * use any numbers in this range. | ||
182 | */ | ||
183 | CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, | ||
184 | CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, | ||
185 | |||
186 | /* The remaining range is reserved for future use. */ | ||
187 | }; | ||
188 | |||
189 | enum cvmx_chip_types_enum { | ||
190 | CVMX_CHIP_TYPE_NULL = 0, | ||
191 | CVMX_CHIP_SIM_TYPE_DEPRECATED = 1, | ||
192 | CVMX_CHIP_TYPE_OCTEON_SAMPLE = 2, | ||
193 | CVMX_CHIP_TYPE_MAX, | ||
194 | }; | ||
195 | |||
196 | /* Compatability alias for NAC38 name change, planned to be removed | ||
197 | * from SDK 1.7 */ | ||
198 | #define CVMX_BOARD_TYPE_NAO38 CVMX_BOARD_TYPE_NAC38 | ||
199 | |||
200 | /* Functions to return string based on type */ | ||
201 | #define ENUM_BRD_TYPE_CASE(x) \ | ||
202 | case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */ | ||
203 | static inline const char *cvmx_board_type_to_string(enum | ||
204 | cvmx_board_types_enum type) | ||
205 | { | ||
206 | switch (type) { | ||
207 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL) | ||
208 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_SIM) | ||
209 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT3000) | ||
210 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KODAMA) | ||
211 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIAGARA) | ||
212 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NAC38) | ||
213 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_THUNDER) | ||
214 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_TRANTOR) | ||
215 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH3000) | ||
216 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH3100) | ||
217 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_HIKARI) | ||
218 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3010_EVB_HS5) | ||
219 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3005_EVB_HS5) | ||
220 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KBP) | ||
221 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3020_EVB_HS5) | ||
222 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5800) | ||
223 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NICPRO2) | ||
224 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5600) | ||
225 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5601) | ||
226 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5200) | ||
227 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_BBGW_REF) | ||
228 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_4G) | ||
229 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5600) | ||
230 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5201) | ||
231 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX) | ||
232 | |||
233 | /* Customer boards listed here */ | ||
234 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MIN) | ||
235 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WSX16) | ||
236 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NS0216) | ||
237 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NB5) | ||
238 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WMR500) | ||
239 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX) | ||
240 | |||
241 | /* Customer private range */ | ||
242 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) | ||
243 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) | ||
244 | } | ||
245 | return "Unsupported Board"; | ||
246 | } | ||
247 | |||
248 | #define ENUM_CHIP_TYPE_CASE(x) \ | ||
249 | case x: return(#x + 15); /* Skip CVMX_CHIP_TYPE */ | ||
250 | static inline const char *cvmx_chip_type_to_string(enum | ||
251 | cvmx_chip_types_enum type) | ||
252 | { | ||
253 | switch (type) { | ||
254 | ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_NULL) | ||
255 | ENUM_CHIP_TYPE_CASE(CVMX_CHIP_SIM_TYPE_DEPRECATED) | ||
256 | ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_OCTEON_SAMPLE) | ||
257 | ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_MAX) | ||
258 | } | ||
259 | return "Unsupported Chip"; | ||
260 | } | ||
261 | |||
262 | #endif /* __CVMX_BOOTINFO_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-bootmem.h b/arch/mips/include/asm/octeon/cvmx-bootmem.h new file mode 100644 index 000000000000..1cbe4b55889d --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-bootmem.h | |||
@@ -0,0 +1,288 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * Simple allocate only memory allocator. Used to allocate memory at | ||
30 | * application start time. | ||
31 | */ | ||
32 | |||
33 | #ifndef __CVMX_BOOTMEM_H__ | ||
34 | #define __CVMX_BOOTMEM_H__ | ||
35 | /* Must be multiple of 8, changing breaks ABI */ | ||
36 | #define CVMX_BOOTMEM_NAME_LEN 128 | ||
37 | |||
38 | /* Can change without breaking ABI */ | ||
39 | #define CVMX_BOOTMEM_NUM_NAMED_BLOCKS 64 | ||
40 | |||
41 | /* minimum alignment of bootmem alloced blocks */ | ||
42 | #define CVMX_BOOTMEM_ALIGNMENT_SIZE (16ull) | ||
43 | |||
44 | /* Flags for cvmx_bootmem_phy_mem* functions */ | ||
45 | /* Allocate from end of block instead of beginning */ | ||
46 | #define CVMX_BOOTMEM_FLAG_END_ALLOC (1 << 0) | ||
47 | |||
48 | /* Don't do any locking. */ | ||
49 | #define CVMX_BOOTMEM_FLAG_NO_LOCKING (1 << 1) | ||
50 | |||
51 | /* First bytes of each free physical block of memory contain this structure, | ||
52 | * which is used to maintain the free memory list. Since the bootloader is | ||
53 | * only 32 bits, there is a union providing 64 and 32 bit versions. The | ||
54 | * application init code converts addresses to 64 bit addresses before the | ||
55 | * application starts. | ||
56 | */ | ||
57 | struct cvmx_bootmem_block_header { | ||
58 | /* | ||
59 | * Note: these are referenced from assembly routines in the | ||
60 | * bootloader, so this structure should not be changed | ||
61 | * without changing those routines as well. | ||
62 | */ | ||
63 | uint64_t next_block_addr; | ||
64 | uint64_t size; | ||
65 | |||
66 | }; | ||
67 | |||
68 | /* | ||
69 | * Structure for named memory blocks. Number of descriptors available | ||
70 | * can be changed without affecting compatiblity, but name length | ||
71 | * changes require a bump in the bootmem descriptor version Note: This | ||
72 | * structure must be naturally 64 bit aligned, as a single memory | ||
73 | * image will be used by both 32 and 64 bit programs. | ||
74 | */ | ||
75 | struct cvmx_bootmem_named_block_desc { | ||
76 | /* Base address of named block */ | ||
77 | uint64_t base_addr; | ||
78 | /* | ||
79 | * Size actually allocated for named block (may differ from | ||
80 | * requested). | ||
81 | */ | ||
82 | uint64_t size; | ||
83 | /* name of named block */ | ||
84 | char name[CVMX_BOOTMEM_NAME_LEN]; | ||
85 | }; | ||
86 | |||
87 | /* Current descriptor versions */ | ||
88 | /* CVMX bootmem descriptor major version */ | ||
89 | #define CVMX_BOOTMEM_DESC_MAJ_VER 3 | ||
90 | |||
91 | /* CVMX bootmem descriptor minor version */ | ||
92 | #define CVMX_BOOTMEM_DESC_MIN_VER 0 | ||
93 | |||
94 | /* First three members of cvmx_bootmem_desc_t are left in original | ||
95 | * positions for backwards compatibility. | ||
96 | */ | ||
97 | struct cvmx_bootmem_desc { | ||
98 | /* spinlock to control access to list */ | ||
99 | uint32_t lock; | ||
100 | /* flags for indicating various conditions */ | ||
101 | uint32_t flags; | ||
102 | uint64_t head_addr; | ||
103 | |||
104 | /* Incremented when incompatible changes made */ | ||
105 | uint32_t major_version; | ||
106 | |||
107 | /* | ||
108 | * Incremented changed when compatible changes made, reset to | ||
109 | * zero when major incremented. | ||
110 | */ | ||
111 | uint32_t minor_version; | ||
112 | |||
113 | uint64_t app_data_addr; | ||
114 | uint64_t app_data_size; | ||
115 | |||
116 | /* number of elements in named blocks array */ | ||
117 | uint32_t named_block_num_blocks; | ||
118 | |||
119 | /* length of name array in bootmem blocks */ | ||
120 | uint32_t named_block_name_len; | ||
121 | /* address of named memory block descriptors */ | ||
122 | uint64_t named_block_array_addr; | ||
123 | |||
124 | }; | ||
125 | |||
126 | /** | ||
127 | * Initialize the boot alloc memory structures. This is | ||
128 | * normally called inside of cvmx_user_app_init() | ||
129 | * | ||
130 | * @mem_desc_ptr: Address of the free memory list | ||
131 | */ | ||
132 | extern int cvmx_bootmem_init(void *mem_desc_ptr); | ||
133 | |||
134 | /** | ||
135 | * Allocate a block of memory from the free list that was passed | ||
136 | * to the application by the bootloader. | ||
137 | * This is an allocate-only algorithm, so freeing memory is not possible. | ||
138 | * | ||
139 | * @size: Size in bytes of block to allocate | ||
140 | * @alignment: Alignment required - must be power of 2 | ||
141 | * | ||
142 | * Returns pointer to block of memory, NULL on error | ||
143 | */ | ||
144 | extern void *cvmx_bootmem_alloc(uint64_t size, uint64_t alignment); | ||
145 | |||
146 | /** | ||
147 | * Allocate a block of memory from the free list that was | ||
148 | * passed to the application by the bootloader at a specific | ||
149 | * address. This is an allocate-only algorithm, so | ||
150 | * freeing memory is not possible. Allocation will fail if | ||
151 | * memory cannot be allocated at the specified address. | ||
152 | * | ||
153 | * @size: Size in bytes of block to allocate | ||
154 | * @address: Physical address to allocate memory at. If this memory is not | ||
155 | * available, the allocation fails. | ||
156 | * @alignment: Alignment required - must be power of 2 | ||
157 | * Returns pointer to block of memory, NULL on error | ||
158 | */ | ||
159 | extern void *cvmx_bootmem_alloc_address(uint64_t size, uint64_t address, | ||
160 | uint64_t alignment); | ||
161 | |||
162 | /** | ||
163 | * Allocate a block of memory from the free list that was | ||
164 | * passed to the application by the bootloader within a specified | ||
165 | * address range. This is an allocate-only algorithm, so | ||
166 | * freeing memory is not possible. Allocation will fail if | ||
167 | * memory cannot be allocated in the requested range. | ||
168 | * | ||
169 | * @size: Size in bytes of block to allocate | ||
170 | * @min_addr: defines the minimum address of the range | ||
171 | * @max_addr: defines the maximum address of the range | ||
172 | * @alignment: Alignment required - must be power of 2 | ||
173 | * Returns pointer to block of memory, NULL on error | ||
174 | */ | ||
175 | extern void *cvmx_bootmem_alloc_range(uint64_t size, uint64_t alignment, | ||
176 | uint64_t min_addr, uint64_t max_addr); | ||
177 | |||
178 | /** | ||
179 | * Frees a previously allocated named bootmem block. | ||
180 | * | ||
181 | * @name: name of block to free | ||
182 | * | ||
183 | * Returns 0 on failure, | ||
184 | * !0 on success | ||
185 | */ | ||
186 | extern int cvmx_bootmem_free_named(char *name); | ||
187 | |||
188 | /** | ||
189 | * Finds a named bootmem block by name. | ||
190 | * | ||
191 | * @name: name of block to free | ||
192 | * | ||
193 | * Returns pointer to named block descriptor on success | ||
194 | * 0 on failure | ||
195 | */ | ||
196 | struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name); | ||
197 | |||
198 | /** | ||
199 | * Allocates a block of physical memory from the free list, at | ||
200 | * (optional) requested address and alignment. | ||
201 | * | ||
202 | * @req_size: size of region to allocate. All requests are rounded up | ||
203 | * to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE bytes size | ||
204 | * | ||
205 | * @address_min: Minimum address that block can occupy. | ||
206 | * | ||
207 | * @address_max: Specifies the maximum address_min (inclusive) that | ||
208 | * the allocation can use. | ||
209 | * | ||
210 | * @alignment: Requested alignment of the block. If this alignment | ||
211 | * cannot be met, the allocation fails. This must be a | ||
212 | * power of 2. (Note: Alignment of | ||
213 | * CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and | ||
214 | * internally enforced. Requested alignments of less than | ||
215 | * CVMX_BOOTMEM_ALIGNMENT_SIZE are set to | ||
216 | * CVMX_BOOTMEM_ALIGNMENT_SIZE.) | ||
217 | * | ||
218 | * @flags: Flags to control options for the allocation. | ||
219 | * | ||
220 | * Returns physical address of block allocated, or -1 on failure | ||
221 | */ | ||
222 | int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min, | ||
223 | uint64_t address_max, uint64_t alignment, | ||
224 | uint32_t flags); | ||
225 | |||
226 | /** | ||
227 | * Finds a named memory block by name. | ||
228 | * Also used for finding an unused entry in the named block table. | ||
229 | * | ||
230 | * @name: Name of memory block to find. If NULL pointer given, then | ||
231 | * finds unused descriptor, if available. | ||
232 | * | ||
233 | * @flags: Flags to control options for the allocation. | ||
234 | * | ||
235 | * Returns Pointer to memory block descriptor, NULL if not found. | ||
236 | * If NULL returned when name parameter is NULL, then no memory | ||
237 | * block descriptors are available. | ||
238 | */ | ||
239 | struct cvmx_bootmem_named_block_desc * | ||
240 | cvmx_bootmem_phy_named_block_find(char *name, uint32_t flags); | ||
241 | |||
242 | /** | ||
243 | * Frees a named block. | ||
244 | * | ||
245 | * @name: name of block to free | ||
246 | * @flags: flags for passing options | ||
247 | * | ||
248 | * Returns 0 on failure | ||
249 | * 1 on success | ||
250 | */ | ||
251 | int cvmx_bootmem_phy_named_block_free(char *name, uint32_t flags); | ||
252 | |||
253 | /** | ||
254 | * Frees a block to the bootmem allocator list. This must | ||
255 | * be used with care, as the size provided must match the size | ||
256 | * of the block that was allocated, or the list will become | ||
257 | * corrupted. | ||
258 | * | ||
259 | * IMPORTANT: This is only intended to be used as part of named block | ||
260 | * frees and initial population of the free memory list. | ||
261 | * * | ||
262 | * | ||
263 | * @phy_addr: physical address of block | ||
264 | * @size: size of block in bytes. | ||
265 | * @flags: flags for passing options | ||
266 | * | ||
267 | * Returns 1 on success, | ||
268 | * 0 on failure | ||
269 | */ | ||
270 | int __cvmx_bootmem_phy_free(uint64_t phy_addr, uint64_t size, uint32_t flags); | ||
271 | |||
272 | /** | ||
273 | * Locks the bootmem allocator. This is useful in certain situations | ||
274 | * where multiple allocations must be made without being interrupted. | ||
275 | * This should be used with the CVMX_BOOTMEM_FLAG_NO_LOCKING flag. | ||
276 | * | ||
277 | */ | ||
278 | void cvmx_bootmem_lock(void); | ||
279 | |||
280 | /** | ||
281 | * Unlocks the bootmem allocator. This is useful in certain situations | ||
282 | * where multiple allocations must be made without being interrupted. | ||
283 | * This should be used with the CVMX_BOOTMEM_FLAG_NO_LOCKING flag. | ||
284 | * | ||
285 | */ | ||
286 | void cvmx_bootmem_unlock(void); | ||
287 | |||
288 | #endif /* __CVMX_BOOTMEM_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-ciu-defs.h b/arch/mips/include/asm/octeon/cvmx-ciu-defs.h new file mode 100644 index 000000000000..f8f05b7764b7 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-ciu-defs.h | |||
@@ -0,0 +1,1616 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_CIU_DEFS_H__ | ||
29 | #define __CVMX_CIU_DEFS_H__ | ||
30 | |||
31 | #define CVMX_CIU_BIST \ | ||
32 | CVMX_ADD_IO_SEG(0x0001070000000730ull) | ||
33 | #define CVMX_CIU_DINT \ | ||
34 | CVMX_ADD_IO_SEG(0x0001070000000720ull) | ||
35 | #define CVMX_CIU_FUSE \ | ||
36 | CVMX_ADD_IO_SEG(0x0001070000000728ull) | ||
37 | #define CVMX_CIU_GSTOP \ | ||
38 | CVMX_ADD_IO_SEG(0x0001070000000710ull) | ||
39 | #define CVMX_CIU_INTX_EN0(offset) \ | ||
40 | CVMX_ADD_IO_SEG(0x0001070000000200ull + (((offset) & 63) * 16)) | ||
41 | #define CVMX_CIU_INTX_EN0_W1C(offset) \ | ||
42 | CVMX_ADD_IO_SEG(0x0001070000002200ull + (((offset) & 63) * 16)) | ||
43 | #define CVMX_CIU_INTX_EN0_W1S(offset) \ | ||
44 | CVMX_ADD_IO_SEG(0x0001070000006200ull + (((offset) & 63) * 16)) | ||
45 | #define CVMX_CIU_INTX_EN1(offset) \ | ||
46 | CVMX_ADD_IO_SEG(0x0001070000000208ull + (((offset) & 63) * 16)) | ||
47 | #define CVMX_CIU_INTX_EN1_W1C(offset) \ | ||
48 | CVMX_ADD_IO_SEG(0x0001070000002208ull + (((offset) & 63) * 16)) | ||
49 | #define CVMX_CIU_INTX_EN1_W1S(offset) \ | ||
50 | CVMX_ADD_IO_SEG(0x0001070000006208ull + (((offset) & 63) * 16)) | ||
51 | #define CVMX_CIU_INTX_EN4_0(offset) \ | ||
52 | CVMX_ADD_IO_SEG(0x0001070000000C80ull + (((offset) & 15) * 16)) | ||
53 | #define CVMX_CIU_INTX_EN4_0_W1C(offset) \ | ||
54 | CVMX_ADD_IO_SEG(0x0001070000002C80ull + (((offset) & 15) * 16)) | ||
55 | #define CVMX_CIU_INTX_EN4_0_W1S(offset) \ | ||
56 | CVMX_ADD_IO_SEG(0x0001070000006C80ull + (((offset) & 15) * 16)) | ||
57 | #define CVMX_CIU_INTX_EN4_1(offset) \ | ||
58 | CVMX_ADD_IO_SEG(0x0001070000000C88ull + (((offset) & 15) * 16)) | ||
59 | #define CVMX_CIU_INTX_EN4_1_W1C(offset) \ | ||
60 | CVMX_ADD_IO_SEG(0x0001070000002C88ull + (((offset) & 15) * 16)) | ||
61 | #define CVMX_CIU_INTX_EN4_1_W1S(offset) \ | ||
62 | CVMX_ADD_IO_SEG(0x0001070000006C88ull + (((offset) & 15) * 16)) | ||
63 | #define CVMX_CIU_INTX_SUM0(offset) \ | ||
64 | CVMX_ADD_IO_SEG(0x0001070000000000ull + (((offset) & 63) * 8)) | ||
65 | #define CVMX_CIU_INTX_SUM4(offset) \ | ||
66 | CVMX_ADD_IO_SEG(0x0001070000000C00ull + (((offset) & 15) * 8)) | ||
67 | #define CVMX_CIU_INT_SUM1 \ | ||
68 | CVMX_ADD_IO_SEG(0x0001070000000108ull) | ||
69 | #define CVMX_CIU_MBOX_CLRX(offset) \ | ||
70 | CVMX_ADD_IO_SEG(0x0001070000000680ull + (((offset) & 15) * 8)) | ||
71 | #define CVMX_CIU_MBOX_SETX(offset) \ | ||
72 | CVMX_ADD_IO_SEG(0x0001070000000600ull + (((offset) & 15) * 8)) | ||
73 | #define CVMX_CIU_NMI \ | ||
74 | CVMX_ADD_IO_SEG(0x0001070000000718ull) | ||
75 | #define CVMX_CIU_PCI_INTA \ | ||
76 | CVMX_ADD_IO_SEG(0x0001070000000750ull) | ||
77 | #define CVMX_CIU_PP_DBG \ | ||
78 | CVMX_ADD_IO_SEG(0x0001070000000708ull) | ||
79 | #define CVMX_CIU_PP_POKEX(offset) \ | ||
80 | CVMX_ADD_IO_SEG(0x0001070000000580ull + (((offset) & 15) * 8)) | ||
81 | #define CVMX_CIU_PP_RST \ | ||
82 | CVMX_ADD_IO_SEG(0x0001070000000700ull) | ||
83 | #define CVMX_CIU_QLM_DCOK \ | ||
84 | CVMX_ADD_IO_SEG(0x0001070000000760ull) | ||
85 | #define CVMX_CIU_QLM_JTGC \ | ||
86 | CVMX_ADD_IO_SEG(0x0001070000000768ull) | ||
87 | #define CVMX_CIU_QLM_JTGD \ | ||
88 | CVMX_ADD_IO_SEG(0x0001070000000770ull) | ||
89 | #define CVMX_CIU_SOFT_BIST \ | ||
90 | CVMX_ADD_IO_SEG(0x0001070000000738ull) | ||
91 | #define CVMX_CIU_SOFT_PRST \ | ||
92 | CVMX_ADD_IO_SEG(0x0001070000000748ull) | ||
93 | #define CVMX_CIU_SOFT_PRST1 \ | ||
94 | CVMX_ADD_IO_SEG(0x0001070000000758ull) | ||
95 | #define CVMX_CIU_SOFT_RST \ | ||
96 | CVMX_ADD_IO_SEG(0x0001070000000740ull) | ||
97 | #define CVMX_CIU_TIMX(offset) \ | ||
98 | CVMX_ADD_IO_SEG(0x0001070000000480ull + (((offset) & 3) * 8)) | ||
99 | #define CVMX_CIU_WDOGX(offset) \ | ||
100 | CVMX_ADD_IO_SEG(0x0001070000000500ull + (((offset) & 15) * 8)) | ||
101 | |||
102 | union cvmx_ciu_bist { | ||
103 | uint64_t u64; | ||
104 | struct cvmx_ciu_bist_s { | ||
105 | uint64_t reserved_4_63:60; | ||
106 | uint64_t bist:4; | ||
107 | } s; | ||
108 | struct cvmx_ciu_bist_s cn30xx; | ||
109 | struct cvmx_ciu_bist_s cn31xx; | ||
110 | struct cvmx_ciu_bist_s cn38xx; | ||
111 | struct cvmx_ciu_bist_s cn38xxp2; | ||
112 | struct cvmx_ciu_bist_cn50xx { | ||
113 | uint64_t reserved_2_63:62; | ||
114 | uint64_t bist:2; | ||
115 | } cn50xx; | ||
116 | struct cvmx_ciu_bist_cn52xx { | ||
117 | uint64_t reserved_3_63:61; | ||
118 | uint64_t bist:3; | ||
119 | } cn52xx; | ||
120 | struct cvmx_ciu_bist_cn52xx cn52xxp1; | ||
121 | struct cvmx_ciu_bist_s cn56xx; | ||
122 | struct cvmx_ciu_bist_s cn56xxp1; | ||
123 | struct cvmx_ciu_bist_s cn58xx; | ||
124 | struct cvmx_ciu_bist_s cn58xxp1; | ||
125 | }; | ||
126 | |||
127 | union cvmx_ciu_dint { | ||
128 | uint64_t u64; | ||
129 | struct cvmx_ciu_dint_s { | ||
130 | uint64_t reserved_16_63:48; | ||
131 | uint64_t dint:16; | ||
132 | } s; | ||
133 | struct cvmx_ciu_dint_cn30xx { | ||
134 | uint64_t reserved_1_63:63; | ||
135 | uint64_t dint:1; | ||
136 | } cn30xx; | ||
137 | struct cvmx_ciu_dint_cn31xx { | ||
138 | uint64_t reserved_2_63:62; | ||
139 | uint64_t dint:2; | ||
140 | } cn31xx; | ||
141 | struct cvmx_ciu_dint_s cn38xx; | ||
142 | struct cvmx_ciu_dint_s cn38xxp2; | ||
143 | struct cvmx_ciu_dint_cn31xx cn50xx; | ||
144 | struct cvmx_ciu_dint_cn52xx { | ||
145 | uint64_t reserved_4_63:60; | ||
146 | uint64_t dint:4; | ||
147 | } cn52xx; | ||
148 | struct cvmx_ciu_dint_cn52xx cn52xxp1; | ||
149 | struct cvmx_ciu_dint_cn56xx { | ||
150 | uint64_t reserved_12_63:52; | ||
151 | uint64_t dint:12; | ||
152 | } cn56xx; | ||
153 | struct cvmx_ciu_dint_cn56xx cn56xxp1; | ||
154 | struct cvmx_ciu_dint_s cn58xx; | ||
155 | struct cvmx_ciu_dint_s cn58xxp1; | ||
156 | }; | ||
157 | |||
158 | union cvmx_ciu_fuse { | ||
159 | uint64_t u64; | ||
160 | struct cvmx_ciu_fuse_s { | ||
161 | uint64_t reserved_16_63:48; | ||
162 | uint64_t fuse:16; | ||
163 | } s; | ||
164 | struct cvmx_ciu_fuse_cn30xx { | ||
165 | uint64_t reserved_1_63:63; | ||
166 | uint64_t fuse:1; | ||
167 | } cn30xx; | ||
168 | struct cvmx_ciu_fuse_cn31xx { | ||
169 | uint64_t reserved_2_63:62; | ||
170 | uint64_t fuse:2; | ||
171 | } cn31xx; | ||
172 | struct cvmx_ciu_fuse_s cn38xx; | ||
173 | struct cvmx_ciu_fuse_s cn38xxp2; | ||
174 | struct cvmx_ciu_fuse_cn31xx cn50xx; | ||
175 | struct cvmx_ciu_fuse_cn52xx { | ||
176 | uint64_t reserved_4_63:60; | ||
177 | uint64_t fuse:4; | ||
178 | } cn52xx; | ||
179 | struct cvmx_ciu_fuse_cn52xx cn52xxp1; | ||
180 | struct cvmx_ciu_fuse_cn56xx { | ||
181 | uint64_t reserved_12_63:52; | ||
182 | uint64_t fuse:12; | ||
183 | } cn56xx; | ||
184 | struct cvmx_ciu_fuse_cn56xx cn56xxp1; | ||
185 | struct cvmx_ciu_fuse_s cn58xx; | ||
186 | struct cvmx_ciu_fuse_s cn58xxp1; | ||
187 | }; | ||
188 | |||
189 | union cvmx_ciu_gstop { | ||
190 | uint64_t u64; | ||
191 | struct cvmx_ciu_gstop_s { | ||
192 | uint64_t reserved_1_63:63; | ||
193 | uint64_t gstop:1; | ||
194 | } s; | ||
195 | struct cvmx_ciu_gstop_s cn30xx; | ||
196 | struct cvmx_ciu_gstop_s cn31xx; | ||
197 | struct cvmx_ciu_gstop_s cn38xx; | ||
198 | struct cvmx_ciu_gstop_s cn38xxp2; | ||
199 | struct cvmx_ciu_gstop_s cn50xx; | ||
200 | struct cvmx_ciu_gstop_s cn52xx; | ||
201 | struct cvmx_ciu_gstop_s cn52xxp1; | ||
202 | struct cvmx_ciu_gstop_s cn56xx; | ||
203 | struct cvmx_ciu_gstop_s cn56xxp1; | ||
204 | struct cvmx_ciu_gstop_s cn58xx; | ||
205 | struct cvmx_ciu_gstop_s cn58xxp1; | ||
206 | }; | ||
207 | |||
208 | union cvmx_ciu_intx_en0 { | ||
209 | uint64_t u64; | ||
210 | struct cvmx_ciu_intx_en0_s { | ||
211 | uint64_t bootdma:1; | ||
212 | uint64_t mii:1; | ||
213 | uint64_t ipdppthr:1; | ||
214 | uint64_t powiq:1; | ||
215 | uint64_t twsi2:1; | ||
216 | uint64_t mpi:1; | ||
217 | uint64_t pcm:1; | ||
218 | uint64_t usb:1; | ||
219 | uint64_t timer:4; | ||
220 | uint64_t key_zero:1; | ||
221 | uint64_t ipd_drp:1; | ||
222 | uint64_t gmx_drp:2; | ||
223 | uint64_t trace:1; | ||
224 | uint64_t rml:1; | ||
225 | uint64_t twsi:1; | ||
226 | uint64_t reserved_44_44:1; | ||
227 | uint64_t pci_msi:4; | ||
228 | uint64_t pci_int:4; | ||
229 | uint64_t uart:2; | ||
230 | uint64_t mbox:2; | ||
231 | uint64_t gpio:16; | ||
232 | uint64_t workq:16; | ||
233 | } s; | ||
234 | struct cvmx_ciu_intx_en0_cn30xx { | ||
235 | uint64_t reserved_59_63:5; | ||
236 | uint64_t mpi:1; | ||
237 | uint64_t pcm:1; | ||
238 | uint64_t usb:1; | ||
239 | uint64_t timer:4; | ||
240 | uint64_t reserved_51_51:1; | ||
241 | uint64_t ipd_drp:1; | ||
242 | uint64_t reserved_49_49:1; | ||
243 | uint64_t gmx_drp:1; | ||
244 | uint64_t reserved_47_47:1; | ||
245 | uint64_t rml:1; | ||
246 | uint64_t twsi:1; | ||
247 | uint64_t reserved_44_44:1; | ||
248 | uint64_t pci_msi:4; | ||
249 | uint64_t pci_int:4; | ||
250 | uint64_t uart:2; | ||
251 | uint64_t mbox:2; | ||
252 | uint64_t gpio:16; | ||
253 | uint64_t workq:16; | ||
254 | } cn30xx; | ||
255 | struct cvmx_ciu_intx_en0_cn31xx { | ||
256 | uint64_t reserved_59_63:5; | ||
257 | uint64_t mpi:1; | ||
258 | uint64_t pcm:1; | ||
259 | uint64_t usb:1; | ||
260 | uint64_t timer:4; | ||
261 | uint64_t reserved_51_51:1; | ||
262 | uint64_t ipd_drp:1; | ||
263 | uint64_t reserved_49_49:1; | ||
264 | uint64_t gmx_drp:1; | ||
265 | uint64_t trace:1; | ||
266 | uint64_t rml:1; | ||
267 | uint64_t twsi:1; | ||
268 | uint64_t reserved_44_44:1; | ||
269 | uint64_t pci_msi:4; | ||
270 | uint64_t pci_int:4; | ||
271 | uint64_t uart:2; | ||
272 | uint64_t mbox:2; | ||
273 | uint64_t gpio:16; | ||
274 | uint64_t workq:16; | ||
275 | } cn31xx; | ||
276 | struct cvmx_ciu_intx_en0_cn38xx { | ||
277 | uint64_t reserved_56_63:8; | ||
278 | uint64_t timer:4; | ||
279 | uint64_t key_zero:1; | ||
280 | uint64_t ipd_drp:1; | ||
281 | uint64_t gmx_drp:2; | ||
282 | uint64_t trace:1; | ||
283 | uint64_t rml:1; | ||
284 | uint64_t twsi:1; | ||
285 | uint64_t reserved_44_44:1; | ||
286 | uint64_t pci_msi:4; | ||
287 | uint64_t pci_int:4; | ||
288 | uint64_t uart:2; | ||
289 | uint64_t mbox:2; | ||
290 | uint64_t gpio:16; | ||
291 | uint64_t workq:16; | ||
292 | } cn38xx; | ||
293 | struct cvmx_ciu_intx_en0_cn38xx cn38xxp2; | ||
294 | struct cvmx_ciu_intx_en0_cn30xx cn50xx; | ||
295 | struct cvmx_ciu_intx_en0_cn52xx { | ||
296 | uint64_t bootdma:1; | ||
297 | uint64_t mii:1; | ||
298 | uint64_t ipdppthr:1; | ||
299 | uint64_t powiq:1; | ||
300 | uint64_t twsi2:1; | ||
301 | uint64_t reserved_57_58:2; | ||
302 | uint64_t usb:1; | ||
303 | uint64_t timer:4; | ||
304 | uint64_t reserved_51_51:1; | ||
305 | uint64_t ipd_drp:1; | ||
306 | uint64_t reserved_49_49:1; | ||
307 | uint64_t gmx_drp:1; | ||
308 | uint64_t trace:1; | ||
309 | uint64_t rml:1; | ||
310 | uint64_t twsi:1; | ||
311 | uint64_t reserved_44_44:1; | ||
312 | uint64_t pci_msi:4; | ||
313 | uint64_t pci_int:4; | ||
314 | uint64_t uart:2; | ||
315 | uint64_t mbox:2; | ||
316 | uint64_t gpio:16; | ||
317 | uint64_t workq:16; | ||
318 | } cn52xx; | ||
319 | struct cvmx_ciu_intx_en0_cn52xx cn52xxp1; | ||
320 | struct cvmx_ciu_intx_en0_cn56xx { | ||
321 | uint64_t bootdma:1; | ||
322 | uint64_t mii:1; | ||
323 | uint64_t ipdppthr:1; | ||
324 | uint64_t powiq:1; | ||
325 | uint64_t twsi2:1; | ||
326 | uint64_t reserved_57_58:2; | ||
327 | uint64_t usb:1; | ||
328 | uint64_t timer:4; | ||
329 | uint64_t key_zero:1; | ||
330 | uint64_t ipd_drp:1; | ||
331 | uint64_t gmx_drp:2; | ||
332 | uint64_t trace:1; | ||
333 | uint64_t rml:1; | ||
334 | uint64_t twsi:1; | ||
335 | uint64_t reserved_44_44:1; | ||
336 | uint64_t pci_msi:4; | ||
337 | uint64_t pci_int:4; | ||
338 | uint64_t uart:2; | ||
339 | uint64_t mbox:2; | ||
340 | uint64_t gpio:16; | ||
341 | uint64_t workq:16; | ||
342 | } cn56xx; | ||
343 | struct cvmx_ciu_intx_en0_cn56xx cn56xxp1; | ||
344 | struct cvmx_ciu_intx_en0_cn38xx cn58xx; | ||
345 | struct cvmx_ciu_intx_en0_cn38xx cn58xxp1; | ||
346 | }; | ||
347 | |||
348 | union cvmx_ciu_intx_en0_w1c { | ||
349 | uint64_t u64; | ||
350 | struct cvmx_ciu_intx_en0_w1c_s { | ||
351 | uint64_t bootdma:1; | ||
352 | uint64_t mii:1; | ||
353 | uint64_t ipdppthr:1; | ||
354 | uint64_t powiq:1; | ||
355 | uint64_t twsi2:1; | ||
356 | uint64_t reserved_57_58:2; | ||
357 | uint64_t usb:1; | ||
358 | uint64_t timer:4; | ||
359 | uint64_t key_zero:1; | ||
360 | uint64_t ipd_drp:1; | ||
361 | uint64_t gmx_drp:2; | ||
362 | uint64_t trace:1; | ||
363 | uint64_t rml:1; | ||
364 | uint64_t twsi:1; | ||
365 | uint64_t reserved_44_44:1; | ||
366 | uint64_t pci_msi:4; | ||
367 | uint64_t pci_int:4; | ||
368 | uint64_t uart:2; | ||
369 | uint64_t mbox:2; | ||
370 | uint64_t gpio:16; | ||
371 | uint64_t workq:16; | ||
372 | } s; | ||
373 | struct cvmx_ciu_intx_en0_w1c_cn52xx { | ||
374 | uint64_t bootdma:1; | ||
375 | uint64_t mii:1; | ||
376 | uint64_t ipdppthr:1; | ||
377 | uint64_t powiq:1; | ||
378 | uint64_t twsi2:1; | ||
379 | uint64_t reserved_57_58:2; | ||
380 | uint64_t usb:1; | ||
381 | uint64_t timer:4; | ||
382 | uint64_t reserved_51_51:1; | ||
383 | uint64_t ipd_drp:1; | ||
384 | uint64_t reserved_49_49:1; | ||
385 | uint64_t gmx_drp:1; | ||
386 | uint64_t trace:1; | ||
387 | uint64_t rml:1; | ||
388 | uint64_t twsi:1; | ||
389 | uint64_t reserved_44_44:1; | ||
390 | uint64_t pci_msi:4; | ||
391 | uint64_t pci_int:4; | ||
392 | uint64_t uart:2; | ||
393 | uint64_t mbox:2; | ||
394 | uint64_t gpio:16; | ||
395 | uint64_t workq:16; | ||
396 | } cn52xx; | ||
397 | struct cvmx_ciu_intx_en0_w1c_s cn56xx; | ||
398 | struct cvmx_ciu_intx_en0_w1c_cn58xx { | ||
399 | uint64_t reserved_56_63:8; | ||
400 | uint64_t timer:4; | ||
401 | uint64_t key_zero:1; | ||
402 | uint64_t ipd_drp:1; | ||
403 | uint64_t gmx_drp:2; | ||
404 | uint64_t trace:1; | ||
405 | uint64_t rml:1; | ||
406 | uint64_t twsi:1; | ||
407 | uint64_t reserved_44_44:1; | ||
408 | uint64_t pci_msi:4; | ||
409 | uint64_t pci_int:4; | ||
410 | uint64_t uart:2; | ||
411 | uint64_t mbox:2; | ||
412 | uint64_t gpio:16; | ||
413 | uint64_t workq:16; | ||
414 | } cn58xx; | ||
415 | }; | ||
416 | |||
417 | union cvmx_ciu_intx_en0_w1s { | ||
418 | uint64_t u64; | ||
419 | struct cvmx_ciu_intx_en0_w1s_s { | ||
420 | uint64_t bootdma:1; | ||
421 | uint64_t mii:1; | ||
422 | uint64_t ipdppthr:1; | ||
423 | uint64_t powiq:1; | ||
424 | uint64_t twsi2:1; | ||
425 | uint64_t reserved_57_58:2; | ||
426 | uint64_t usb:1; | ||
427 | uint64_t timer:4; | ||
428 | uint64_t key_zero:1; | ||
429 | uint64_t ipd_drp:1; | ||
430 | uint64_t gmx_drp:2; | ||
431 | uint64_t trace:1; | ||
432 | uint64_t rml:1; | ||
433 | uint64_t twsi:1; | ||
434 | uint64_t reserved_44_44:1; | ||
435 | uint64_t pci_msi:4; | ||
436 | uint64_t pci_int:4; | ||
437 | uint64_t uart:2; | ||
438 | uint64_t mbox:2; | ||
439 | uint64_t gpio:16; | ||
440 | uint64_t workq:16; | ||
441 | } s; | ||
442 | struct cvmx_ciu_intx_en0_w1s_cn52xx { | ||
443 | uint64_t bootdma:1; | ||
444 | uint64_t mii:1; | ||
445 | uint64_t ipdppthr:1; | ||
446 | uint64_t powiq:1; | ||
447 | uint64_t twsi2:1; | ||
448 | uint64_t reserved_57_58:2; | ||
449 | uint64_t usb:1; | ||
450 | uint64_t timer:4; | ||
451 | uint64_t reserved_51_51:1; | ||
452 | uint64_t ipd_drp:1; | ||
453 | uint64_t reserved_49_49:1; | ||
454 | uint64_t gmx_drp:1; | ||
455 | uint64_t trace:1; | ||
456 | uint64_t rml:1; | ||
457 | uint64_t twsi:1; | ||
458 | uint64_t reserved_44_44:1; | ||
459 | uint64_t pci_msi:4; | ||
460 | uint64_t pci_int:4; | ||
461 | uint64_t uart:2; | ||
462 | uint64_t mbox:2; | ||
463 | uint64_t gpio:16; | ||
464 | uint64_t workq:16; | ||
465 | } cn52xx; | ||
466 | struct cvmx_ciu_intx_en0_w1s_s cn56xx; | ||
467 | struct cvmx_ciu_intx_en0_w1s_cn58xx { | ||
468 | uint64_t reserved_56_63:8; | ||
469 | uint64_t timer:4; | ||
470 | uint64_t key_zero:1; | ||
471 | uint64_t ipd_drp:1; | ||
472 | uint64_t gmx_drp:2; | ||
473 | uint64_t trace:1; | ||
474 | uint64_t rml:1; | ||
475 | uint64_t twsi:1; | ||
476 | uint64_t reserved_44_44:1; | ||
477 | uint64_t pci_msi:4; | ||
478 | uint64_t pci_int:4; | ||
479 | uint64_t uart:2; | ||
480 | uint64_t mbox:2; | ||
481 | uint64_t gpio:16; | ||
482 | uint64_t workq:16; | ||
483 | } cn58xx; | ||
484 | }; | ||
485 | |||
486 | union cvmx_ciu_intx_en1 { | ||
487 | uint64_t u64; | ||
488 | struct cvmx_ciu_intx_en1_s { | ||
489 | uint64_t reserved_20_63:44; | ||
490 | uint64_t nand:1; | ||
491 | uint64_t mii1:1; | ||
492 | uint64_t usb1:1; | ||
493 | uint64_t uart2:1; | ||
494 | uint64_t wdog:16; | ||
495 | } s; | ||
496 | struct cvmx_ciu_intx_en1_cn30xx { | ||
497 | uint64_t reserved_1_63:63; | ||
498 | uint64_t wdog:1; | ||
499 | } cn30xx; | ||
500 | struct cvmx_ciu_intx_en1_cn31xx { | ||
501 | uint64_t reserved_2_63:62; | ||
502 | uint64_t wdog:2; | ||
503 | } cn31xx; | ||
504 | struct cvmx_ciu_intx_en1_cn38xx { | ||
505 | uint64_t reserved_16_63:48; | ||
506 | uint64_t wdog:16; | ||
507 | } cn38xx; | ||
508 | struct cvmx_ciu_intx_en1_cn38xx cn38xxp2; | ||
509 | struct cvmx_ciu_intx_en1_cn31xx cn50xx; | ||
510 | struct cvmx_ciu_intx_en1_cn52xx { | ||
511 | uint64_t reserved_20_63:44; | ||
512 | uint64_t nand:1; | ||
513 | uint64_t mii1:1; | ||
514 | uint64_t usb1:1; | ||
515 | uint64_t uart2:1; | ||
516 | uint64_t reserved_4_15:12; | ||
517 | uint64_t wdog:4; | ||
518 | } cn52xx; | ||
519 | struct cvmx_ciu_intx_en1_cn52xxp1 { | ||
520 | uint64_t reserved_19_63:45; | ||
521 | uint64_t mii1:1; | ||
522 | uint64_t usb1:1; | ||
523 | uint64_t uart2:1; | ||
524 | uint64_t reserved_4_15:12; | ||
525 | uint64_t wdog:4; | ||
526 | } cn52xxp1; | ||
527 | struct cvmx_ciu_intx_en1_cn56xx { | ||
528 | uint64_t reserved_12_63:52; | ||
529 | uint64_t wdog:12; | ||
530 | } cn56xx; | ||
531 | struct cvmx_ciu_intx_en1_cn56xx cn56xxp1; | ||
532 | struct cvmx_ciu_intx_en1_cn38xx cn58xx; | ||
533 | struct cvmx_ciu_intx_en1_cn38xx cn58xxp1; | ||
534 | }; | ||
535 | |||
536 | union cvmx_ciu_intx_en1_w1c { | ||
537 | uint64_t u64; | ||
538 | struct cvmx_ciu_intx_en1_w1c_s { | ||
539 | uint64_t reserved_20_63:44; | ||
540 | uint64_t nand:1; | ||
541 | uint64_t mii1:1; | ||
542 | uint64_t usb1:1; | ||
543 | uint64_t uart2:1; | ||
544 | uint64_t wdog:16; | ||
545 | } s; | ||
546 | struct cvmx_ciu_intx_en1_w1c_cn52xx { | ||
547 | uint64_t reserved_20_63:44; | ||
548 | uint64_t nand:1; | ||
549 | uint64_t mii1:1; | ||
550 | uint64_t usb1:1; | ||
551 | uint64_t uart2:1; | ||
552 | uint64_t reserved_4_15:12; | ||
553 | uint64_t wdog:4; | ||
554 | } cn52xx; | ||
555 | struct cvmx_ciu_intx_en1_w1c_cn56xx { | ||
556 | uint64_t reserved_12_63:52; | ||
557 | uint64_t wdog:12; | ||
558 | } cn56xx; | ||
559 | struct cvmx_ciu_intx_en1_w1c_cn58xx { | ||
560 | uint64_t reserved_16_63:48; | ||
561 | uint64_t wdog:16; | ||
562 | } cn58xx; | ||
563 | }; | ||
564 | |||
565 | union cvmx_ciu_intx_en1_w1s { | ||
566 | uint64_t u64; | ||
567 | struct cvmx_ciu_intx_en1_w1s_s { | ||
568 | uint64_t reserved_20_63:44; | ||
569 | uint64_t nand:1; | ||
570 | uint64_t mii1:1; | ||
571 | uint64_t usb1:1; | ||
572 | uint64_t uart2:1; | ||
573 | uint64_t wdog:16; | ||
574 | } s; | ||
575 | struct cvmx_ciu_intx_en1_w1s_cn52xx { | ||
576 | uint64_t reserved_20_63:44; | ||
577 | uint64_t nand:1; | ||
578 | uint64_t mii1:1; | ||
579 | uint64_t usb1:1; | ||
580 | uint64_t uart2:1; | ||
581 | uint64_t reserved_4_15:12; | ||
582 | uint64_t wdog:4; | ||
583 | } cn52xx; | ||
584 | struct cvmx_ciu_intx_en1_w1s_cn56xx { | ||
585 | uint64_t reserved_12_63:52; | ||
586 | uint64_t wdog:12; | ||
587 | } cn56xx; | ||
588 | struct cvmx_ciu_intx_en1_w1s_cn58xx { | ||
589 | uint64_t reserved_16_63:48; | ||
590 | uint64_t wdog:16; | ||
591 | } cn58xx; | ||
592 | }; | ||
593 | |||
594 | union cvmx_ciu_intx_en4_0 { | ||
595 | uint64_t u64; | ||
596 | struct cvmx_ciu_intx_en4_0_s { | ||
597 | uint64_t bootdma:1; | ||
598 | uint64_t mii:1; | ||
599 | uint64_t ipdppthr:1; | ||
600 | uint64_t powiq:1; | ||
601 | uint64_t twsi2:1; | ||
602 | uint64_t mpi:1; | ||
603 | uint64_t pcm:1; | ||
604 | uint64_t usb:1; | ||
605 | uint64_t timer:4; | ||
606 | uint64_t key_zero:1; | ||
607 | uint64_t ipd_drp:1; | ||
608 | uint64_t gmx_drp:2; | ||
609 | uint64_t trace:1; | ||
610 | uint64_t rml:1; | ||
611 | uint64_t twsi:1; | ||
612 | uint64_t reserved_44_44:1; | ||
613 | uint64_t pci_msi:4; | ||
614 | uint64_t pci_int:4; | ||
615 | uint64_t uart:2; | ||
616 | uint64_t mbox:2; | ||
617 | uint64_t gpio:16; | ||
618 | uint64_t workq:16; | ||
619 | } s; | ||
620 | struct cvmx_ciu_intx_en4_0_cn50xx { | ||
621 | uint64_t reserved_59_63:5; | ||
622 | uint64_t mpi:1; | ||
623 | uint64_t pcm:1; | ||
624 | uint64_t usb:1; | ||
625 | uint64_t timer:4; | ||
626 | uint64_t reserved_51_51:1; | ||
627 | uint64_t ipd_drp:1; | ||
628 | uint64_t reserved_49_49:1; | ||
629 | uint64_t gmx_drp:1; | ||
630 | uint64_t reserved_47_47:1; | ||
631 | uint64_t rml:1; | ||
632 | uint64_t twsi:1; | ||
633 | uint64_t reserved_44_44:1; | ||
634 | uint64_t pci_msi:4; | ||
635 | uint64_t pci_int:4; | ||
636 | uint64_t uart:2; | ||
637 | uint64_t mbox:2; | ||
638 | uint64_t gpio:16; | ||
639 | uint64_t workq:16; | ||
640 | } cn50xx; | ||
641 | struct cvmx_ciu_intx_en4_0_cn52xx { | ||
642 | uint64_t bootdma:1; | ||
643 | uint64_t mii:1; | ||
644 | uint64_t ipdppthr:1; | ||
645 | uint64_t powiq:1; | ||
646 | uint64_t twsi2:1; | ||
647 | uint64_t reserved_57_58:2; | ||
648 | uint64_t usb:1; | ||
649 | uint64_t timer:4; | ||
650 | uint64_t reserved_51_51:1; | ||
651 | uint64_t ipd_drp:1; | ||
652 | uint64_t reserved_49_49:1; | ||
653 | uint64_t gmx_drp:1; | ||
654 | uint64_t trace:1; | ||
655 | uint64_t rml:1; | ||
656 | uint64_t twsi:1; | ||
657 | uint64_t reserved_44_44:1; | ||
658 | uint64_t pci_msi:4; | ||
659 | uint64_t pci_int:4; | ||
660 | uint64_t uart:2; | ||
661 | uint64_t mbox:2; | ||
662 | uint64_t gpio:16; | ||
663 | uint64_t workq:16; | ||
664 | } cn52xx; | ||
665 | struct cvmx_ciu_intx_en4_0_cn52xx cn52xxp1; | ||
666 | struct cvmx_ciu_intx_en4_0_cn56xx { | ||
667 | uint64_t bootdma:1; | ||
668 | uint64_t mii:1; | ||
669 | uint64_t ipdppthr:1; | ||
670 | uint64_t powiq:1; | ||
671 | uint64_t twsi2:1; | ||
672 | uint64_t reserved_57_58:2; | ||
673 | uint64_t usb:1; | ||
674 | uint64_t timer:4; | ||
675 | uint64_t key_zero:1; | ||
676 | uint64_t ipd_drp:1; | ||
677 | uint64_t gmx_drp:2; | ||
678 | uint64_t trace:1; | ||
679 | uint64_t rml:1; | ||
680 | uint64_t twsi:1; | ||
681 | uint64_t reserved_44_44:1; | ||
682 | uint64_t pci_msi:4; | ||
683 | uint64_t pci_int:4; | ||
684 | uint64_t uart:2; | ||
685 | uint64_t mbox:2; | ||
686 | uint64_t gpio:16; | ||
687 | uint64_t workq:16; | ||
688 | } cn56xx; | ||
689 | struct cvmx_ciu_intx_en4_0_cn56xx cn56xxp1; | ||
690 | struct cvmx_ciu_intx_en4_0_cn58xx { | ||
691 | uint64_t reserved_56_63:8; | ||
692 | uint64_t timer:4; | ||
693 | uint64_t key_zero:1; | ||
694 | uint64_t ipd_drp:1; | ||
695 | uint64_t gmx_drp:2; | ||
696 | uint64_t trace:1; | ||
697 | uint64_t rml:1; | ||
698 | uint64_t twsi:1; | ||
699 | uint64_t reserved_44_44:1; | ||
700 | uint64_t pci_msi:4; | ||
701 | uint64_t pci_int:4; | ||
702 | uint64_t uart:2; | ||
703 | uint64_t mbox:2; | ||
704 | uint64_t gpio:16; | ||
705 | uint64_t workq:16; | ||
706 | } cn58xx; | ||
707 | struct cvmx_ciu_intx_en4_0_cn58xx cn58xxp1; | ||
708 | }; | ||
709 | |||
710 | union cvmx_ciu_intx_en4_0_w1c { | ||
711 | uint64_t u64; | ||
712 | struct cvmx_ciu_intx_en4_0_w1c_s { | ||
713 | uint64_t bootdma:1; | ||
714 | uint64_t mii:1; | ||
715 | uint64_t ipdppthr:1; | ||
716 | uint64_t powiq:1; | ||
717 | uint64_t twsi2:1; | ||
718 | uint64_t reserved_57_58:2; | ||
719 | uint64_t usb:1; | ||
720 | uint64_t timer:4; | ||
721 | uint64_t key_zero:1; | ||
722 | uint64_t ipd_drp:1; | ||
723 | uint64_t gmx_drp:2; | ||
724 | uint64_t trace:1; | ||
725 | uint64_t rml:1; | ||
726 | uint64_t twsi:1; | ||
727 | uint64_t reserved_44_44:1; | ||
728 | uint64_t pci_msi:4; | ||
729 | uint64_t pci_int:4; | ||
730 | uint64_t uart:2; | ||
731 | uint64_t mbox:2; | ||
732 | uint64_t gpio:16; | ||
733 | uint64_t workq:16; | ||
734 | } s; | ||
735 | struct cvmx_ciu_intx_en4_0_w1c_cn52xx { | ||
736 | uint64_t bootdma:1; | ||
737 | uint64_t mii:1; | ||
738 | uint64_t ipdppthr:1; | ||
739 | uint64_t powiq:1; | ||
740 | uint64_t twsi2:1; | ||
741 | uint64_t reserved_57_58:2; | ||
742 | uint64_t usb:1; | ||
743 | uint64_t timer:4; | ||
744 | uint64_t reserved_51_51:1; | ||
745 | uint64_t ipd_drp:1; | ||
746 | uint64_t reserved_49_49:1; | ||
747 | uint64_t gmx_drp:1; | ||
748 | uint64_t trace:1; | ||
749 | uint64_t rml:1; | ||
750 | uint64_t twsi:1; | ||
751 | uint64_t reserved_44_44:1; | ||
752 | uint64_t pci_msi:4; | ||
753 | uint64_t pci_int:4; | ||
754 | uint64_t uart:2; | ||
755 | uint64_t mbox:2; | ||
756 | uint64_t gpio:16; | ||
757 | uint64_t workq:16; | ||
758 | } cn52xx; | ||
759 | struct cvmx_ciu_intx_en4_0_w1c_s cn56xx; | ||
760 | struct cvmx_ciu_intx_en4_0_w1c_cn58xx { | ||
761 | uint64_t reserved_56_63:8; | ||
762 | uint64_t timer:4; | ||
763 | uint64_t key_zero:1; | ||
764 | uint64_t ipd_drp:1; | ||
765 | uint64_t gmx_drp:2; | ||
766 | uint64_t trace:1; | ||
767 | uint64_t rml:1; | ||
768 | uint64_t twsi:1; | ||
769 | uint64_t reserved_44_44:1; | ||
770 | uint64_t pci_msi:4; | ||
771 | uint64_t pci_int:4; | ||
772 | uint64_t uart:2; | ||
773 | uint64_t mbox:2; | ||
774 | uint64_t gpio:16; | ||
775 | uint64_t workq:16; | ||
776 | } cn58xx; | ||
777 | }; | ||
778 | |||
779 | union cvmx_ciu_intx_en4_0_w1s { | ||
780 | uint64_t u64; | ||
781 | struct cvmx_ciu_intx_en4_0_w1s_s { | ||
782 | uint64_t bootdma:1; | ||
783 | uint64_t mii:1; | ||
784 | uint64_t ipdppthr:1; | ||
785 | uint64_t powiq:1; | ||
786 | uint64_t twsi2:1; | ||
787 | uint64_t reserved_57_58:2; | ||
788 | uint64_t usb:1; | ||
789 | uint64_t timer:4; | ||
790 | uint64_t key_zero:1; | ||
791 | uint64_t ipd_drp:1; | ||
792 | uint64_t gmx_drp:2; | ||
793 | uint64_t trace:1; | ||
794 | uint64_t rml:1; | ||
795 | uint64_t twsi:1; | ||
796 | uint64_t reserved_44_44:1; | ||
797 | uint64_t pci_msi:4; | ||
798 | uint64_t pci_int:4; | ||
799 | uint64_t uart:2; | ||
800 | uint64_t mbox:2; | ||
801 | uint64_t gpio:16; | ||
802 | uint64_t workq:16; | ||
803 | } s; | ||
804 | struct cvmx_ciu_intx_en4_0_w1s_cn52xx { | ||
805 | uint64_t bootdma:1; | ||
806 | uint64_t mii:1; | ||
807 | uint64_t ipdppthr:1; | ||
808 | uint64_t powiq:1; | ||
809 | uint64_t twsi2:1; | ||
810 | uint64_t reserved_57_58:2; | ||
811 | uint64_t usb:1; | ||
812 | uint64_t timer:4; | ||
813 | uint64_t reserved_51_51:1; | ||
814 | uint64_t ipd_drp:1; | ||
815 | uint64_t reserved_49_49:1; | ||
816 | uint64_t gmx_drp:1; | ||
817 | uint64_t trace:1; | ||
818 | uint64_t rml:1; | ||
819 | uint64_t twsi:1; | ||
820 | uint64_t reserved_44_44:1; | ||
821 | uint64_t pci_msi:4; | ||
822 | uint64_t pci_int:4; | ||
823 | uint64_t uart:2; | ||
824 | uint64_t mbox:2; | ||
825 | uint64_t gpio:16; | ||
826 | uint64_t workq:16; | ||
827 | } cn52xx; | ||
828 | struct cvmx_ciu_intx_en4_0_w1s_s cn56xx; | ||
829 | struct cvmx_ciu_intx_en4_0_w1s_cn58xx { | ||
830 | uint64_t reserved_56_63:8; | ||
831 | uint64_t timer:4; | ||
832 | uint64_t key_zero:1; | ||
833 | uint64_t ipd_drp:1; | ||
834 | uint64_t gmx_drp:2; | ||
835 | uint64_t trace:1; | ||
836 | uint64_t rml:1; | ||
837 | uint64_t twsi:1; | ||
838 | uint64_t reserved_44_44:1; | ||
839 | uint64_t pci_msi:4; | ||
840 | uint64_t pci_int:4; | ||
841 | uint64_t uart:2; | ||
842 | uint64_t mbox:2; | ||
843 | uint64_t gpio:16; | ||
844 | uint64_t workq:16; | ||
845 | } cn58xx; | ||
846 | }; | ||
847 | |||
848 | union cvmx_ciu_intx_en4_1 { | ||
849 | uint64_t u64; | ||
850 | struct cvmx_ciu_intx_en4_1_s { | ||
851 | uint64_t reserved_20_63:44; | ||
852 | uint64_t nand:1; | ||
853 | uint64_t mii1:1; | ||
854 | uint64_t usb1:1; | ||
855 | uint64_t uart2:1; | ||
856 | uint64_t wdog:16; | ||
857 | } s; | ||
858 | struct cvmx_ciu_intx_en4_1_cn50xx { | ||
859 | uint64_t reserved_2_63:62; | ||
860 | uint64_t wdog:2; | ||
861 | } cn50xx; | ||
862 | struct cvmx_ciu_intx_en4_1_cn52xx { | ||
863 | uint64_t reserved_20_63:44; | ||
864 | uint64_t nand:1; | ||
865 | uint64_t mii1:1; | ||
866 | uint64_t usb1:1; | ||
867 | uint64_t uart2:1; | ||
868 | uint64_t reserved_4_15:12; | ||
869 | uint64_t wdog:4; | ||
870 | } cn52xx; | ||
871 | struct cvmx_ciu_intx_en4_1_cn52xxp1 { | ||
872 | uint64_t reserved_19_63:45; | ||
873 | uint64_t mii1:1; | ||
874 | uint64_t usb1:1; | ||
875 | uint64_t uart2:1; | ||
876 | uint64_t reserved_4_15:12; | ||
877 | uint64_t wdog:4; | ||
878 | } cn52xxp1; | ||
879 | struct cvmx_ciu_intx_en4_1_cn56xx { | ||
880 | uint64_t reserved_12_63:52; | ||
881 | uint64_t wdog:12; | ||
882 | } cn56xx; | ||
883 | struct cvmx_ciu_intx_en4_1_cn56xx cn56xxp1; | ||
884 | struct cvmx_ciu_intx_en4_1_cn58xx { | ||
885 | uint64_t reserved_16_63:48; | ||
886 | uint64_t wdog:16; | ||
887 | } cn58xx; | ||
888 | struct cvmx_ciu_intx_en4_1_cn58xx cn58xxp1; | ||
889 | }; | ||
890 | |||
891 | union cvmx_ciu_intx_en4_1_w1c { | ||
892 | uint64_t u64; | ||
893 | struct cvmx_ciu_intx_en4_1_w1c_s { | ||
894 | uint64_t reserved_20_63:44; | ||
895 | uint64_t nand:1; | ||
896 | uint64_t mii1:1; | ||
897 | uint64_t usb1:1; | ||
898 | uint64_t uart2:1; | ||
899 | uint64_t wdog:16; | ||
900 | } s; | ||
901 | struct cvmx_ciu_intx_en4_1_w1c_cn52xx { | ||
902 | uint64_t reserved_20_63:44; | ||
903 | uint64_t nand:1; | ||
904 | uint64_t mii1:1; | ||
905 | uint64_t usb1:1; | ||
906 | uint64_t uart2:1; | ||
907 | uint64_t reserved_4_15:12; | ||
908 | uint64_t wdog:4; | ||
909 | } cn52xx; | ||
910 | struct cvmx_ciu_intx_en4_1_w1c_cn56xx { | ||
911 | uint64_t reserved_12_63:52; | ||
912 | uint64_t wdog:12; | ||
913 | } cn56xx; | ||
914 | struct cvmx_ciu_intx_en4_1_w1c_cn58xx { | ||
915 | uint64_t reserved_16_63:48; | ||
916 | uint64_t wdog:16; | ||
917 | } cn58xx; | ||
918 | }; | ||
919 | |||
920 | union cvmx_ciu_intx_en4_1_w1s { | ||
921 | uint64_t u64; | ||
922 | struct cvmx_ciu_intx_en4_1_w1s_s { | ||
923 | uint64_t reserved_20_63:44; | ||
924 | uint64_t nand:1; | ||
925 | uint64_t mii1:1; | ||
926 | uint64_t usb1:1; | ||
927 | uint64_t uart2:1; | ||
928 | uint64_t wdog:16; | ||
929 | } s; | ||
930 | struct cvmx_ciu_intx_en4_1_w1s_cn52xx { | ||
931 | uint64_t reserved_20_63:44; | ||
932 | uint64_t nand:1; | ||
933 | uint64_t mii1:1; | ||
934 | uint64_t usb1:1; | ||
935 | uint64_t uart2:1; | ||
936 | uint64_t reserved_4_15:12; | ||
937 | uint64_t wdog:4; | ||
938 | } cn52xx; | ||
939 | struct cvmx_ciu_intx_en4_1_w1s_cn56xx { | ||
940 | uint64_t reserved_12_63:52; | ||
941 | uint64_t wdog:12; | ||
942 | } cn56xx; | ||
943 | struct cvmx_ciu_intx_en4_1_w1s_cn58xx { | ||
944 | uint64_t reserved_16_63:48; | ||
945 | uint64_t wdog:16; | ||
946 | } cn58xx; | ||
947 | }; | ||
948 | |||
949 | union cvmx_ciu_intx_sum0 { | ||
950 | uint64_t u64; | ||
951 | struct cvmx_ciu_intx_sum0_s { | ||
952 | uint64_t bootdma:1; | ||
953 | uint64_t mii:1; | ||
954 | uint64_t ipdppthr:1; | ||
955 | uint64_t powiq:1; | ||
956 | uint64_t twsi2:1; | ||
957 | uint64_t mpi:1; | ||
958 | uint64_t pcm:1; | ||
959 | uint64_t usb:1; | ||
960 | uint64_t timer:4; | ||
961 | uint64_t key_zero:1; | ||
962 | uint64_t ipd_drp:1; | ||
963 | uint64_t gmx_drp:2; | ||
964 | uint64_t trace:1; | ||
965 | uint64_t rml:1; | ||
966 | uint64_t twsi:1; | ||
967 | uint64_t wdog_sum:1; | ||
968 | uint64_t pci_msi:4; | ||
969 | uint64_t pci_int:4; | ||
970 | uint64_t uart:2; | ||
971 | uint64_t mbox:2; | ||
972 | uint64_t gpio:16; | ||
973 | uint64_t workq:16; | ||
974 | } s; | ||
975 | struct cvmx_ciu_intx_sum0_cn30xx { | ||
976 | uint64_t reserved_59_63:5; | ||
977 | uint64_t mpi:1; | ||
978 | uint64_t pcm:1; | ||
979 | uint64_t usb:1; | ||
980 | uint64_t timer:4; | ||
981 | uint64_t reserved_51_51:1; | ||
982 | uint64_t ipd_drp:1; | ||
983 | uint64_t reserved_49_49:1; | ||
984 | uint64_t gmx_drp:1; | ||
985 | uint64_t reserved_47_47:1; | ||
986 | uint64_t rml:1; | ||
987 | uint64_t twsi:1; | ||
988 | uint64_t wdog_sum:1; | ||
989 | uint64_t pci_msi:4; | ||
990 | uint64_t pci_int:4; | ||
991 | uint64_t uart:2; | ||
992 | uint64_t mbox:2; | ||
993 | uint64_t gpio:16; | ||
994 | uint64_t workq:16; | ||
995 | } cn30xx; | ||
996 | struct cvmx_ciu_intx_sum0_cn31xx { | ||
997 | uint64_t reserved_59_63:5; | ||
998 | uint64_t mpi:1; | ||
999 | uint64_t pcm:1; | ||
1000 | uint64_t usb:1; | ||
1001 | uint64_t timer:4; | ||
1002 | uint64_t reserved_51_51:1; | ||
1003 | uint64_t ipd_drp:1; | ||
1004 | uint64_t reserved_49_49:1; | ||
1005 | uint64_t gmx_drp:1; | ||
1006 | uint64_t trace:1; | ||
1007 | uint64_t rml:1; | ||
1008 | uint64_t twsi:1; | ||
1009 | uint64_t wdog_sum:1; | ||
1010 | uint64_t pci_msi:4; | ||
1011 | uint64_t pci_int:4; | ||
1012 | uint64_t uart:2; | ||
1013 | uint64_t mbox:2; | ||
1014 | uint64_t gpio:16; | ||
1015 | uint64_t workq:16; | ||
1016 | } cn31xx; | ||
1017 | struct cvmx_ciu_intx_sum0_cn38xx { | ||
1018 | uint64_t reserved_56_63:8; | ||
1019 | uint64_t timer:4; | ||
1020 | uint64_t key_zero:1; | ||
1021 | uint64_t ipd_drp:1; | ||
1022 | uint64_t gmx_drp:2; | ||
1023 | uint64_t trace:1; | ||
1024 | uint64_t rml:1; | ||
1025 | uint64_t twsi:1; | ||
1026 | uint64_t wdog_sum:1; | ||
1027 | uint64_t pci_msi:4; | ||
1028 | uint64_t pci_int:4; | ||
1029 | uint64_t uart:2; | ||
1030 | uint64_t mbox:2; | ||
1031 | uint64_t gpio:16; | ||
1032 | uint64_t workq:16; | ||
1033 | } cn38xx; | ||
1034 | struct cvmx_ciu_intx_sum0_cn38xx cn38xxp2; | ||
1035 | struct cvmx_ciu_intx_sum0_cn30xx cn50xx; | ||
1036 | struct cvmx_ciu_intx_sum0_cn52xx { | ||
1037 | uint64_t bootdma:1; | ||
1038 | uint64_t mii:1; | ||
1039 | uint64_t ipdppthr:1; | ||
1040 | uint64_t powiq:1; | ||
1041 | uint64_t twsi2:1; | ||
1042 | uint64_t reserved_57_58:2; | ||
1043 | uint64_t usb:1; | ||
1044 | uint64_t timer:4; | ||
1045 | uint64_t reserved_51_51:1; | ||
1046 | uint64_t ipd_drp:1; | ||
1047 | uint64_t reserved_49_49:1; | ||
1048 | uint64_t gmx_drp:1; | ||
1049 | uint64_t trace:1; | ||
1050 | uint64_t rml:1; | ||
1051 | uint64_t twsi:1; | ||
1052 | uint64_t wdog_sum:1; | ||
1053 | uint64_t pci_msi:4; | ||
1054 | uint64_t pci_int:4; | ||
1055 | uint64_t uart:2; | ||
1056 | uint64_t mbox:2; | ||
1057 | uint64_t gpio:16; | ||
1058 | uint64_t workq:16; | ||
1059 | } cn52xx; | ||
1060 | struct cvmx_ciu_intx_sum0_cn52xx cn52xxp1; | ||
1061 | struct cvmx_ciu_intx_sum0_cn56xx { | ||
1062 | uint64_t bootdma:1; | ||
1063 | uint64_t mii:1; | ||
1064 | uint64_t ipdppthr:1; | ||
1065 | uint64_t powiq:1; | ||
1066 | uint64_t twsi2:1; | ||
1067 | uint64_t reserved_57_58:2; | ||
1068 | uint64_t usb:1; | ||
1069 | uint64_t timer:4; | ||
1070 | uint64_t key_zero:1; | ||
1071 | uint64_t ipd_drp:1; | ||
1072 | uint64_t gmx_drp:2; | ||
1073 | uint64_t trace:1; | ||
1074 | uint64_t rml:1; | ||
1075 | uint64_t twsi:1; | ||
1076 | uint64_t wdog_sum:1; | ||
1077 | uint64_t pci_msi:4; | ||
1078 | uint64_t pci_int:4; | ||
1079 | uint64_t uart:2; | ||
1080 | uint64_t mbox:2; | ||
1081 | uint64_t gpio:16; | ||
1082 | uint64_t workq:16; | ||
1083 | } cn56xx; | ||
1084 | struct cvmx_ciu_intx_sum0_cn56xx cn56xxp1; | ||
1085 | struct cvmx_ciu_intx_sum0_cn38xx cn58xx; | ||
1086 | struct cvmx_ciu_intx_sum0_cn38xx cn58xxp1; | ||
1087 | }; | ||
1088 | |||
1089 | union cvmx_ciu_intx_sum4 { | ||
1090 | uint64_t u64; | ||
1091 | struct cvmx_ciu_intx_sum4_s { | ||
1092 | uint64_t bootdma:1; | ||
1093 | uint64_t mii:1; | ||
1094 | uint64_t ipdppthr:1; | ||
1095 | uint64_t powiq:1; | ||
1096 | uint64_t twsi2:1; | ||
1097 | uint64_t mpi:1; | ||
1098 | uint64_t pcm:1; | ||
1099 | uint64_t usb:1; | ||
1100 | uint64_t timer:4; | ||
1101 | uint64_t key_zero:1; | ||
1102 | uint64_t ipd_drp:1; | ||
1103 | uint64_t gmx_drp:2; | ||
1104 | uint64_t trace:1; | ||
1105 | uint64_t rml:1; | ||
1106 | uint64_t twsi:1; | ||
1107 | uint64_t wdog_sum:1; | ||
1108 | uint64_t pci_msi:4; | ||
1109 | uint64_t pci_int:4; | ||
1110 | uint64_t uart:2; | ||
1111 | uint64_t mbox:2; | ||
1112 | uint64_t gpio:16; | ||
1113 | uint64_t workq:16; | ||
1114 | } s; | ||
1115 | struct cvmx_ciu_intx_sum4_cn50xx { | ||
1116 | uint64_t reserved_59_63:5; | ||
1117 | uint64_t mpi:1; | ||
1118 | uint64_t pcm:1; | ||
1119 | uint64_t usb:1; | ||
1120 | uint64_t timer:4; | ||
1121 | uint64_t reserved_51_51:1; | ||
1122 | uint64_t ipd_drp:1; | ||
1123 | uint64_t reserved_49_49:1; | ||
1124 | uint64_t gmx_drp:1; | ||
1125 | uint64_t reserved_47_47:1; | ||
1126 | uint64_t rml:1; | ||
1127 | uint64_t twsi:1; | ||
1128 | uint64_t wdog_sum:1; | ||
1129 | uint64_t pci_msi:4; | ||
1130 | uint64_t pci_int:4; | ||
1131 | uint64_t uart:2; | ||
1132 | uint64_t mbox:2; | ||
1133 | uint64_t gpio:16; | ||
1134 | uint64_t workq:16; | ||
1135 | } cn50xx; | ||
1136 | struct cvmx_ciu_intx_sum4_cn52xx { | ||
1137 | uint64_t bootdma:1; | ||
1138 | uint64_t mii:1; | ||
1139 | uint64_t ipdppthr:1; | ||
1140 | uint64_t powiq:1; | ||
1141 | uint64_t twsi2:1; | ||
1142 | uint64_t reserved_57_58:2; | ||
1143 | uint64_t usb:1; | ||
1144 | uint64_t timer:4; | ||
1145 | uint64_t reserved_51_51:1; | ||
1146 | uint64_t ipd_drp:1; | ||
1147 | uint64_t reserved_49_49:1; | ||
1148 | uint64_t gmx_drp:1; | ||
1149 | uint64_t trace:1; | ||
1150 | uint64_t rml:1; | ||
1151 | uint64_t twsi:1; | ||
1152 | uint64_t wdog_sum:1; | ||
1153 | uint64_t pci_msi:4; | ||
1154 | uint64_t pci_int:4; | ||
1155 | uint64_t uart:2; | ||
1156 | uint64_t mbox:2; | ||
1157 | uint64_t gpio:16; | ||
1158 | uint64_t workq:16; | ||
1159 | } cn52xx; | ||
1160 | struct cvmx_ciu_intx_sum4_cn52xx cn52xxp1; | ||
1161 | struct cvmx_ciu_intx_sum4_cn56xx { | ||
1162 | uint64_t bootdma:1; | ||
1163 | uint64_t mii:1; | ||
1164 | uint64_t ipdppthr:1; | ||
1165 | uint64_t powiq:1; | ||
1166 | uint64_t twsi2:1; | ||
1167 | uint64_t reserved_57_58:2; | ||
1168 | uint64_t usb:1; | ||
1169 | uint64_t timer:4; | ||
1170 | uint64_t key_zero:1; | ||
1171 | uint64_t ipd_drp:1; | ||
1172 | uint64_t gmx_drp:2; | ||
1173 | uint64_t trace:1; | ||
1174 | uint64_t rml:1; | ||
1175 | uint64_t twsi:1; | ||
1176 | uint64_t wdog_sum:1; | ||
1177 | uint64_t pci_msi:4; | ||
1178 | uint64_t pci_int:4; | ||
1179 | uint64_t uart:2; | ||
1180 | uint64_t mbox:2; | ||
1181 | uint64_t gpio:16; | ||
1182 | uint64_t workq:16; | ||
1183 | } cn56xx; | ||
1184 | struct cvmx_ciu_intx_sum4_cn56xx cn56xxp1; | ||
1185 | struct cvmx_ciu_intx_sum4_cn58xx { | ||
1186 | uint64_t reserved_56_63:8; | ||
1187 | uint64_t timer:4; | ||
1188 | uint64_t key_zero:1; | ||
1189 | uint64_t ipd_drp:1; | ||
1190 | uint64_t gmx_drp:2; | ||
1191 | uint64_t trace:1; | ||
1192 | uint64_t rml:1; | ||
1193 | uint64_t twsi:1; | ||
1194 | uint64_t wdog_sum:1; | ||
1195 | uint64_t pci_msi:4; | ||
1196 | uint64_t pci_int:4; | ||
1197 | uint64_t uart:2; | ||
1198 | uint64_t mbox:2; | ||
1199 | uint64_t gpio:16; | ||
1200 | uint64_t workq:16; | ||
1201 | } cn58xx; | ||
1202 | struct cvmx_ciu_intx_sum4_cn58xx cn58xxp1; | ||
1203 | }; | ||
1204 | |||
1205 | union cvmx_ciu_int_sum1 { | ||
1206 | uint64_t u64; | ||
1207 | struct cvmx_ciu_int_sum1_s { | ||
1208 | uint64_t reserved_20_63:44; | ||
1209 | uint64_t nand:1; | ||
1210 | uint64_t mii1:1; | ||
1211 | uint64_t usb1:1; | ||
1212 | uint64_t uart2:1; | ||
1213 | uint64_t wdog:16; | ||
1214 | } s; | ||
1215 | struct cvmx_ciu_int_sum1_cn30xx { | ||
1216 | uint64_t reserved_1_63:63; | ||
1217 | uint64_t wdog:1; | ||
1218 | } cn30xx; | ||
1219 | struct cvmx_ciu_int_sum1_cn31xx { | ||
1220 | uint64_t reserved_2_63:62; | ||
1221 | uint64_t wdog:2; | ||
1222 | } cn31xx; | ||
1223 | struct cvmx_ciu_int_sum1_cn38xx { | ||
1224 | uint64_t reserved_16_63:48; | ||
1225 | uint64_t wdog:16; | ||
1226 | } cn38xx; | ||
1227 | struct cvmx_ciu_int_sum1_cn38xx cn38xxp2; | ||
1228 | struct cvmx_ciu_int_sum1_cn31xx cn50xx; | ||
1229 | struct cvmx_ciu_int_sum1_cn52xx { | ||
1230 | uint64_t reserved_20_63:44; | ||
1231 | uint64_t nand:1; | ||
1232 | uint64_t mii1:1; | ||
1233 | uint64_t usb1:1; | ||
1234 | uint64_t uart2:1; | ||
1235 | uint64_t reserved_4_15:12; | ||
1236 | uint64_t wdog:4; | ||
1237 | } cn52xx; | ||
1238 | struct cvmx_ciu_int_sum1_cn52xxp1 { | ||
1239 | uint64_t reserved_19_63:45; | ||
1240 | uint64_t mii1:1; | ||
1241 | uint64_t usb1:1; | ||
1242 | uint64_t uart2:1; | ||
1243 | uint64_t reserved_4_15:12; | ||
1244 | uint64_t wdog:4; | ||
1245 | } cn52xxp1; | ||
1246 | struct cvmx_ciu_int_sum1_cn56xx { | ||
1247 | uint64_t reserved_12_63:52; | ||
1248 | uint64_t wdog:12; | ||
1249 | } cn56xx; | ||
1250 | struct cvmx_ciu_int_sum1_cn56xx cn56xxp1; | ||
1251 | struct cvmx_ciu_int_sum1_cn38xx cn58xx; | ||
1252 | struct cvmx_ciu_int_sum1_cn38xx cn58xxp1; | ||
1253 | }; | ||
1254 | |||
1255 | union cvmx_ciu_mbox_clrx { | ||
1256 | uint64_t u64; | ||
1257 | struct cvmx_ciu_mbox_clrx_s { | ||
1258 | uint64_t reserved_32_63:32; | ||
1259 | uint64_t bits:32; | ||
1260 | } s; | ||
1261 | struct cvmx_ciu_mbox_clrx_s cn30xx; | ||
1262 | struct cvmx_ciu_mbox_clrx_s cn31xx; | ||
1263 | struct cvmx_ciu_mbox_clrx_s cn38xx; | ||
1264 | struct cvmx_ciu_mbox_clrx_s cn38xxp2; | ||
1265 | struct cvmx_ciu_mbox_clrx_s cn50xx; | ||
1266 | struct cvmx_ciu_mbox_clrx_s cn52xx; | ||
1267 | struct cvmx_ciu_mbox_clrx_s cn52xxp1; | ||
1268 | struct cvmx_ciu_mbox_clrx_s cn56xx; | ||
1269 | struct cvmx_ciu_mbox_clrx_s cn56xxp1; | ||
1270 | struct cvmx_ciu_mbox_clrx_s cn58xx; | ||
1271 | struct cvmx_ciu_mbox_clrx_s cn58xxp1; | ||
1272 | }; | ||
1273 | |||
1274 | union cvmx_ciu_mbox_setx { | ||
1275 | uint64_t u64; | ||
1276 | struct cvmx_ciu_mbox_setx_s { | ||
1277 | uint64_t reserved_32_63:32; | ||
1278 | uint64_t bits:32; | ||
1279 | } s; | ||
1280 | struct cvmx_ciu_mbox_setx_s cn30xx; | ||
1281 | struct cvmx_ciu_mbox_setx_s cn31xx; | ||
1282 | struct cvmx_ciu_mbox_setx_s cn38xx; | ||
1283 | struct cvmx_ciu_mbox_setx_s cn38xxp2; | ||
1284 | struct cvmx_ciu_mbox_setx_s cn50xx; | ||
1285 | struct cvmx_ciu_mbox_setx_s cn52xx; | ||
1286 | struct cvmx_ciu_mbox_setx_s cn52xxp1; | ||
1287 | struct cvmx_ciu_mbox_setx_s cn56xx; | ||
1288 | struct cvmx_ciu_mbox_setx_s cn56xxp1; | ||
1289 | struct cvmx_ciu_mbox_setx_s cn58xx; | ||
1290 | struct cvmx_ciu_mbox_setx_s cn58xxp1; | ||
1291 | }; | ||
1292 | |||
1293 | union cvmx_ciu_nmi { | ||
1294 | uint64_t u64; | ||
1295 | struct cvmx_ciu_nmi_s { | ||
1296 | uint64_t reserved_16_63:48; | ||
1297 | uint64_t nmi:16; | ||
1298 | } s; | ||
1299 | struct cvmx_ciu_nmi_cn30xx { | ||
1300 | uint64_t reserved_1_63:63; | ||
1301 | uint64_t nmi:1; | ||
1302 | } cn30xx; | ||
1303 | struct cvmx_ciu_nmi_cn31xx { | ||
1304 | uint64_t reserved_2_63:62; | ||
1305 | uint64_t nmi:2; | ||
1306 | } cn31xx; | ||
1307 | struct cvmx_ciu_nmi_s cn38xx; | ||
1308 | struct cvmx_ciu_nmi_s cn38xxp2; | ||
1309 | struct cvmx_ciu_nmi_cn31xx cn50xx; | ||
1310 | struct cvmx_ciu_nmi_cn52xx { | ||
1311 | uint64_t reserved_4_63:60; | ||
1312 | uint64_t nmi:4; | ||
1313 | } cn52xx; | ||
1314 | struct cvmx_ciu_nmi_cn52xx cn52xxp1; | ||
1315 | struct cvmx_ciu_nmi_cn56xx { | ||
1316 | uint64_t reserved_12_63:52; | ||
1317 | uint64_t nmi:12; | ||
1318 | } cn56xx; | ||
1319 | struct cvmx_ciu_nmi_cn56xx cn56xxp1; | ||
1320 | struct cvmx_ciu_nmi_s cn58xx; | ||
1321 | struct cvmx_ciu_nmi_s cn58xxp1; | ||
1322 | }; | ||
1323 | |||
1324 | union cvmx_ciu_pci_inta { | ||
1325 | uint64_t u64; | ||
1326 | struct cvmx_ciu_pci_inta_s { | ||
1327 | uint64_t reserved_2_63:62; | ||
1328 | uint64_t intr:2; | ||
1329 | } s; | ||
1330 | struct cvmx_ciu_pci_inta_s cn30xx; | ||
1331 | struct cvmx_ciu_pci_inta_s cn31xx; | ||
1332 | struct cvmx_ciu_pci_inta_s cn38xx; | ||
1333 | struct cvmx_ciu_pci_inta_s cn38xxp2; | ||
1334 | struct cvmx_ciu_pci_inta_s cn50xx; | ||
1335 | struct cvmx_ciu_pci_inta_s cn52xx; | ||
1336 | struct cvmx_ciu_pci_inta_s cn52xxp1; | ||
1337 | struct cvmx_ciu_pci_inta_s cn56xx; | ||
1338 | struct cvmx_ciu_pci_inta_s cn56xxp1; | ||
1339 | struct cvmx_ciu_pci_inta_s cn58xx; | ||
1340 | struct cvmx_ciu_pci_inta_s cn58xxp1; | ||
1341 | }; | ||
1342 | |||
1343 | union cvmx_ciu_pp_dbg { | ||
1344 | uint64_t u64; | ||
1345 | struct cvmx_ciu_pp_dbg_s { | ||
1346 | uint64_t reserved_16_63:48; | ||
1347 | uint64_t ppdbg:16; | ||
1348 | } s; | ||
1349 | struct cvmx_ciu_pp_dbg_cn30xx { | ||
1350 | uint64_t reserved_1_63:63; | ||
1351 | uint64_t ppdbg:1; | ||
1352 | } cn30xx; | ||
1353 | struct cvmx_ciu_pp_dbg_cn31xx { | ||
1354 | uint64_t reserved_2_63:62; | ||
1355 | uint64_t ppdbg:2; | ||
1356 | } cn31xx; | ||
1357 | struct cvmx_ciu_pp_dbg_s cn38xx; | ||
1358 | struct cvmx_ciu_pp_dbg_s cn38xxp2; | ||
1359 | struct cvmx_ciu_pp_dbg_cn31xx cn50xx; | ||
1360 | struct cvmx_ciu_pp_dbg_cn52xx { | ||
1361 | uint64_t reserved_4_63:60; | ||
1362 | uint64_t ppdbg:4; | ||
1363 | } cn52xx; | ||
1364 | struct cvmx_ciu_pp_dbg_cn52xx cn52xxp1; | ||
1365 | struct cvmx_ciu_pp_dbg_cn56xx { | ||
1366 | uint64_t reserved_12_63:52; | ||
1367 | uint64_t ppdbg:12; | ||
1368 | } cn56xx; | ||
1369 | struct cvmx_ciu_pp_dbg_cn56xx cn56xxp1; | ||
1370 | struct cvmx_ciu_pp_dbg_s cn58xx; | ||
1371 | struct cvmx_ciu_pp_dbg_s cn58xxp1; | ||
1372 | }; | ||
1373 | |||
1374 | union cvmx_ciu_pp_pokex { | ||
1375 | uint64_t u64; | ||
1376 | struct cvmx_ciu_pp_pokex_s { | ||
1377 | uint64_t reserved_0_63:64; | ||
1378 | } s; | ||
1379 | struct cvmx_ciu_pp_pokex_s cn30xx; | ||
1380 | struct cvmx_ciu_pp_pokex_s cn31xx; | ||
1381 | struct cvmx_ciu_pp_pokex_s cn38xx; | ||
1382 | struct cvmx_ciu_pp_pokex_s cn38xxp2; | ||
1383 | struct cvmx_ciu_pp_pokex_s cn50xx; | ||
1384 | struct cvmx_ciu_pp_pokex_s cn52xx; | ||
1385 | struct cvmx_ciu_pp_pokex_s cn52xxp1; | ||
1386 | struct cvmx_ciu_pp_pokex_s cn56xx; | ||
1387 | struct cvmx_ciu_pp_pokex_s cn56xxp1; | ||
1388 | struct cvmx_ciu_pp_pokex_s cn58xx; | ||
1389 | struct cvmx_ciu_pp_pokex_s cn58xxp1; | ||
1390 | }; | ||
1391 | |||
1392 | union cvmx_ciu_pp_rst { | ||
1393 | uint64_t u64; | ||
1394 | struct cvmx_ciu_pp_rst_s { | ||
1395 | uint64_t reserved_16_63:48; | ||
1396 | uint64_t rst:15; | ||
1397 | uint64_t rst0:1; | ||
1398 | } s; | ||
1399 | struct cvmx_ciu_pp_rst_cn30xx { | ||
1400 | uint64_t reserved_1_63:63; | ||
1401 | uint64_t rst0:1; | ||
1402 | } cn30xx; | ||
1403 | struct cvmx_ciu_pp_rst_cn31xx { | ||
1404 | uint64_t reserved_2_63:62; | ||
1405 | uint64_t rst:1; | ||
1406 | uint64_t rst0:1; | ||
1407 | } cn31xx; | ||
1408 | struct cvmx_ciu_pp_rst_s cn38xx; | ||
1409 | struct cvmx_ciu_pp_rst_s cn38xxp2; | ||
1410 | struct cvmx_ciu_pp_rst_cn31xx cn50xx; | ||
1411 | struct cvmx_ciu_pp_rst_cn52xx { | ||
1412 | uint64_t reserved_4_63:60; | ||
1413 | uint64_t rst:3; | ||
1414 | uint64_t rst0:1; | ||
1415 | } cn52xx; | ||
1416 | struct cvmx_ciu_pp_rst_cn52xx cn52xxp1; | ||
1417 | struct cvmx_ciu_pp_rst_cn56xx { | ||
1418 | uint64_t reserved_12_63:52; | ||
1419 | uint64_t rst:11; | ||
1420 | uint64_t rst0:1; | ||
1421 | } cn56xx; | ||
1422 | struct cvmx_ciu_pp_rst_cn56xx cn56xxp1; | ||
1423 | struct cvmx_ciu_pp_rst_s cn58xx; | ||
1424 | struct cvmx_ciu_pp_rst_s cn58xxp1; | ||
1425 | }; | ||
1426 | |||
1427 | union cvmx_ciu_qlm_dcok { | ||
1428 | uint64_t u64; | ||
1429 | struct cvmx_ciu_qlm_dcok_s { | ||
1430 | uint64_t reserved_4_63:60; | ||
1431 | uint64_t qlm_dcok:4; | ||
1432 | } s; | ||
1433 | struct cvmx_ciu_qlm_dcok_cn52xx { | ||
1434 | uint64_t reserved_2_63:62; | ||
1435 | uint64_t qlm_dcok:2; | ||
1436 | } cn52xx; | ||
1437 | struct cvmx_ciu_qlm_dcok_cn52xx cn52xxp1; | ||
1438 | struct cvmx_ciu_qlm_dcok_s cn56xx; | ||
1439 | struct cvmx_ciu_qlm_dcok_s cn56xxp1; | ||
1440 | }; | ||
1441 | |||
1442 | union cvmx_ciu_qlm_jtgc { | ||
1443 | uint64_t u64; | ||
1444 | struct cvmx_ciu_qlm_jtgc_s { | ||
1445 | uint64_t reserved_11_63:53; | ||
1446 | uint64_t clk_div:3; | ||
1447 | uint64_t reserved_6_7:2; | ||
1448 | uint64_t mux_sel:2; | ||
1449 | uint64_t bypass:4; | ||
1450 | } s; | ||
1451 | struct cvmx_ciu_qlm_jtgc_cn52xx { | ||
1452 | uint64_t reserved_11_63:53; | ||
1453 | uint64_t clk_div:3; | ||
1454 | uint64_t reserved_5_7:3; | ||
1455 | uint64_t mux_sel:1; | ||
1456 | uint64_t reserved_2_3:2; | ||
1457 | uint64_t bypass:2; | ||
1458 | } cn52xx; | ||
1459 | struct cvmx_ciu_qlm_jtgc_cn52xx cn52xxp1; | ||
1460 | struct cvmx_ciu_qlm_jtgc_s cn56xx; | ||
1461 | struct cvmx_ciu_qlm_jtgc_s cn56xxp1; | ||
1462 | }; | ||
1463 | |||
1464 | union cvmx_ciu_qlm_jtgd { | ||
1465 | uint64_t u64; | ||
1466 | struct cvmx_ciu_qlm_jtgd_s { | ||
1467 | uint64_t capture:1; | ||
1468 | uint64_t shift:1; | ||
1469 | uint64_t update:1; | ||
1470 | uint64_t reserved_44_60:17; | ||
1471 | uint64_t select:4; | ||
1472 | uint64_t reserved_37_39:3; | ||
1473 | uint64_t shft_cnt:5; | ||
1474 | uint64_t shft_reg:32; | ||
1475 | } s; | ||
1476 | struct cvmx_ciu_qlm_jtgd_cn52xx { | ||
1477 | uint64_t capture:1; | ||
1478 | uint64_t shift:1; | ||
1479 | uint64_t update:1; | ||
1480 | uint64_t reserved_42_60:19; | ||
1481 | uint64_t select:2; | ||
1482 | uint64_t reserved_37_39:3; | ||
1483 | uint64_t shft_cnt:5; | ||
1484 | uint64_t shft_reg:32; | ||
1485 | } cn52xx; | ||
1486 | struct cvmx_ciu_qlm_jtgd_cn52xx cn52xxp1; | ||
1487 | struct cvmx_ciu_qlm_jtgd_s cn56xx; | ||
1488 | struct cvmx_ciu_qlm_jtgd_cn56xxp1 { | ||
1489 | uint64_t capture:1; | ||
1490 | uint64_t shift:1; | ||
1491 | uint64_t update:1; | ||
1492 | uint64_t reserved_37_60:24; | ||
1493 | uint64_t shft_cnt:5; | ||
1494 | uint64_t shft_reg:32; | ||
1495 | } cn56xxp1; | ||
1496 | }; | ||
1497 | |||
1498 | union cvmx_ciu_soft_bist { | ||
1499 | uint64_t u64; | ||
1500 | struct cvmx_ciu_soft_bist_s { | ||
1501 | uint64_t reserved_1_63:63; | ||
1502 | uint64_t soft_bist:1; | ||
1503 | } s; | ||
1504 | struct cvmx_ciu_soft_bist_s cn30xx; | ||
1505 | struct cvmx_ciu_soft_bist_s cn31xx; | ||
1506 | struct cvmx_ciu_soft_bist_s cn38xx; | ||
1507 | struct cvmx_ciu_soft_bist_s cn38xxp2; | ||
1508 | struct cvmx_ciu_soft_bist_s cn50xx; | ||
1509 | struct cvmx_ciu_soft_bist_s cn52xx; | ||
1510 | struct cvmx_ciu_soft_bist_s cn52xxp1; | ||
1511 | struct cvmx_ciu_soft_bist_s cn56xx; | ||
1512 | struct cvmx_ciu_soft_bist_s cn56xxp1; | ||
1513 | struct cvmx_ciu_soft_bist_s cn58xx; | ||
1514 | struct cvmx_ciu_soft_bist_s cn58xxp1; | ||
1515 | }; | ||
1516 | |||
1517 | union cvmx_ciu_soft_prst { | ||
1518 | uint64_t u64; | ||
1519 | struct cvmx_ciu_soft_prst_s { | ||
1520 | uint64_t reserved_3_63:61; | ||
1521 | uint64_t host64:1; | ||
1522 | uint64_t npi:1; | ||
1523 | uint64_t soft_prst:1; | ||
1524 | } s; | ||
1525 | struct cvmx_ciu_soft_prst_s cn30xx; | ||
1526 | struct cvmx_ciu_soft_prst_s cn31xx; | ||
1527 | struct cvmx_ciu_soft_prst_s cn38xx; | ||
1528 | struct cvmx_ciu_soft_prst_s cn38xxp2; | ||
1529 | struct cvmx_ciu_soft_prst_s cn50xx; | ||
1530 | struct cvmx_ciu_soft_prst_cn52xx { | ||
1531 | uint64_t reserved_1_63:63; | ||
1532 | uint64_t soft_prst:1; | ||
1533 | } cn52xx; | ||
1534 | struct cvmx_ciu_soft_prst_cn52xx cn52xxp1; | ||
1535 | struct cvmx_ciu_soft_prst_cn52xx cn56xx; | ||
1536 | struct cvmx_ciu_soft_prst_cn52xx cn56xxp1; | ||
1537 | struct cvmx_ciu_soft_prst_s cn58xx; | ||
1538 | struct cvmx_ciu_soft_prst_s cn58xxp1; | ||
1539 | }; | ||
1540 | |||
1541 | union cvmx_ciu_soft_prst1 { | ||
1542 | uint64_t u64; | ||
1543 | struct cvmx_ciu_soft_prst1_s { | ||
1544 | uint64_t reserved_1_63:63; | ||
1545 | uint64_t soft_prst:1; | ||
1546 | } s; | ||
1547 | struct cvmx_ciu_soft_prst1_s cn52xx; | ||
1548 | struct cvmx_ciu_soft_prst1_s cn52xxp1; | ||
1549 | struct cvmx_ciu_soft_prst1_s cn56xx; | ||
1550 | struct cvmx_ciu_soft_prst1_s cn56xxp1; | ||
1551 | }; | ||
1552 | |||
1553 | union cvmx_ciu_soft_rst { | ||
1554 | uint64_t u64; | ||
1555 | struct cvmx_ciu_soft_rst_s { | ||
1556 | uint64_t reserved_1_63:63; | ||
1557 | uint64_t soft_rst:1; | ||
1558 | } s; | ||
1559 | struct cvmx_ciu_soft_rst_s cn30xx; | ||
1560 | struct cvmx_ciu_soft_rst_s cn31xx; | ||
1561 | struct cvmx_ciu_soft_rst_s cn38xx; | ||
1562 | struct cvmx_ciu_soft_rst_s cn38xxp2; | ||
1563 | struct cvmx_ciu_soft_rst_s cn50xx; | ||
1564 | struct cvmx_ciu_soft_rst_s cn52xx; | ||
1565 | struct cvmx_ciu_soft_rst_s cn52xxp1; | ||
1566 | struct cvmx_ciu_soft_rst_s cn56xx; | ||
1567 | struct cvmx_ciu_soft_rst_s cn56xxp1; | ||
1568 | struct cvmx_ciu_soft_rst_s cn58xx; | ||
1569 | struct cvmx_ciu_soft_rst_s cn58xxp1; | ||
1570 | }; | ||
1571 | |||
1572 | union cvmx_ciu_timx { | ||
1573 | uint64_t u64; | ||
1574 | struct cvmx_ciu_timx_s { | ||
1575 | uint64_t reserved_37_63:27; | ||
1576 | uint64_t one_shot:1; | ||
1577 | uint64_t len:36; | ||
1578 | } s; | ||
1579 | struct cvmx_ciu_timx_s cn30xx; | ||
1580 | struct cvmx_ciu_timx_s cn31xx; | ||
1581 | struct cvmx_ciu_timx_s cn38xx; | ||
1582 | struct cvmx_ciu_timx_s cn38xxp2; | ||
1583 | struct cvmx_ciu_timx_s cn50xx; | ||
1584 | struct cvmx_ciu_timx_s cn52xx; | ||
1585 | struct cvmx_ciu_timx_s cn52xxp1; | ||
1586 | struct cvmx_ciu_timx_s cn56xx; | ||
1587 | struct cvmx_ciu_timx_s cn56xxp1; | ||
1588 | struct cvmx_ciu_timx_s cn58xx; | ||
1589 | struct cvmx_ciu_timx_s cn58xxp1; | ||
1590 | }; | ||
1591 | |||
1592 | union cvmx_ciu_wdogx { | ||
1593 | uint64_t u64; | ||
1594 | struct cvmx_ciu_wdogx_s { | ||
1595 | uint64_t reserved_46_63:18; | ||
1596 | uint64_t gstopen:1; | ||
1597 | uint64_t dstop:1; | ||
1598 | uint64_t cnt:24; | ||
1599 | uint64_t len:16; | ||
1600 | uint64_t state:2; | ||
1601 | uint64_t mode:2; | ||
1602 | } s; | ||
1603 | struct cvmx_ciu_wdogx_s cn30xx; | ||
1604 | struct cvmx_ciu_wdogx_s cn31xx; | ||
1605 | struct cvmx_ciu_wdogx_s cn38xx; | ||
1606 | struct cvmx_ciu_wdogx_s cn38xxp2; | ||
1607 | struct cvmx_ciu_wdogx_s cn50xx; | ||
1608 | struct cvmx_ciu_wdogx_s cn52xx; | ||
1609 | struct cvmx_ciu_wdogx_s cn52xxp1; | ||
1610 | struct cvmx_ciu_wdogx_s cn56xx; | ||
1611 | struct cvmx_ciu_wdogx_s cn56xxp1; | ||
1612 | struct cvmx_ciu_wdogx_s cn58xx; | ||
1613 | struct cvmx_ciu_wdogx_s cn58xxp1; | ||
1614 | }; | ||
1615 | |||
1616 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-gpio-defs.h b/arch/mips/include/asm/octeon/cvmx-gpio-defs.h new file mode 100644 index 000000000000..5fdd6ba48a05 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-gpio-defs.h | |||
@@ -0,0 +1,219 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_GPIO_DEFS_H__ | ||
29 | #define __CVMX_GPIO_DEFS_H__ | ||
30 | |||
31 | #define CVMX_GPIO_BIT_CFGX(offset) \ | ||
32 | CVMX_ADD_IO_SEG(0x0001070000000800ull + (((offset) & 15) * 8)) | ||
33 | #define CVMX_GPIO_BOOT_ENA \ | ||
34 | CVMX_ADD_IO_SEG(0x00010700000008A8ull) | ||
35 | #define CVMX_GPIO_CLK_GENX(offset) \ | ||
36 | CVMX_ADD_IO_SEG(0x00010700000008C0ull + (((offset) & 3) * 8)) | ||
37 | #define CVMX_GPIO_DBG_ENA \ | ||
38 | CVMX_ADD_IO_SEG(0x00010700000008A0ull) | ||
39 | #define CVMX_GPIO_INT_CLR \ | ||
40 | CVMX_ADD_IO_SEG(0x0001070000000898ull) | ||
41 | #define CVMX_GPIO_RX_DAT \ | ||
42 | CVMX_ADD_IO_SEG(0x0001070000000880ull) | ||
43 | #define CVMX_GPIO_TX_CLR \ | ||
44 | CVMX_ADD_IO_SEG(0x0001070000000890ull) | ||
45 | #define CVMX_GPIO_TX_SET \ | ||
46 | CVMX_ADD_IO_SEG(0x0001070000000888ull) | ||
47 | #define CVMX_GPIO_XBIT_CFGX(offset) \ | ||
48 | CVMX_ADD_IO_SEG(0x0001070000000900ull + (((offset) & 31) * 8) - 8 * 16) | ||
49 | |||
50 | union cvmx_gpio_bit_cfgx { | ||
51 | uint64_t u64; | ||
52 | struct cvmx_gpio_bit_cfgx_s { | ||
53 | uint64_t reserved_15_63:49; | ||
54 | uint64_t clk_gen:1; | ||
55 | uint64_t clk_sel:2; | ||
56 | uint64_t fil_sel:4; | ||
57 | uint64_t fil_cnt:4; | ||
58 | uint64_t int_type:1; | ||
59 | uint64_t int_en:1; | ||
60 | uint64_t rx_xor:1; | ||
61 | uint64_t tx_oe:1; | ||
62 | } s; | ||
63 | struct cvmx_gpio_bit_cfgx_cn30xx { | ||
64 | uint64_t reserved_12_63:52; | ||
65 | uint64_t fil_sel:4; | ||
66 | uint64_t fil_cnt:4; | ||
67 | uint64_t int_type:1; | ||
68 | uint64_t int_en:1; | ||
69 | uint64_t rx_xor:1; | ||
70 | uint64_t tx_oe:1; | ||
71 | } cn30xx; | ||
72 | struct cvmx_gpio_bit_cfgx_cn30xx cn31xx; | ||
73 | struct cvmx_gpio_bit_cfgx_cn30xx cn38xx; | ||
74 | struct cvmx_gpio_bit_cfgx_cn30xx cn38xxp2; | ||
75 | struct cvmx_gpio_bit_cfgx_cn30xx cn50xx; | ||
76 | struct cvmx_gpio_bit_cfgx_s cn52xx; | ||
77 | struct cvmx_gpio_bit_cfgx_s cn52xxp1; | ||
78 | struct cvmx_gpio_bit_cfgx_s cn56xx; | ||
79 | struct cvmx_gpio_bit_cfgx_s cn56xxp1; | ||
80 | struct cvmx_gpio_bit_cfgx_cn30xx cn58xx; | ||
81 | struct cvmx_gpio_bit_cfgx_cn30xx cn58xxp1; | ||
82 | }; | ||
83 | |||
84 | union cvmx_gpio_boot_ena { | ||
85 | uint64_t u64; | ||
86 | struct cvmx_gpio_boot_ena_s { | ||
87 | uint64_t reserved_12_63:52; | ||
88 | uint64_t boot_ena:4; | ||
89 | uint64_t reserved_0_7:8; | ||
90 | } s; | ||
91 | struct cvmx_gpio_boot_ena_s cn30xx; | ||
92 | struct cvmx_gpio_boot_ena_s cn31xx; | ||
93 | struct cvmx_gpio_boot_ena_s cn50xx; | ||
94 | }; | ||
95 | |||
96 | union cvmx_gpio_clk_genx { | ||
97 | uint64_t u64; | ||
98 | struct cvmx_gpio_clk_genx_s { | ||
99 | uint64_t reserved_32_63:32; | ||
100 | uint64_t n:32; | ||
101 | } s; | ||
102 | struct cvmx_gpio_clk_genx_s cn52xx; | ||
103 | struct cvmx_gpio_clk_genx_s cn52xxp1; | ||
104 | struct cvmx_gpio_clk_genx_s cn56xx; | ||
105 | struct cvmx_gpio_clk_genx_s cn56xxp1; | ||
106 | }; | ||
107 | |||
108 | union cvmx_gpio_dbg_ena { | ||
109 | uint64_t u64; | ||
110 | struct cvmx_gpio_dbg_ena_s { | ||
111 | uint64_t reserved_21_63:43; | ||
112 | uint64_t dbg_ena:21; | ||
113 | } s; | ||
114 | struct cvmx_gpio_dbg_ena_s cn30xx; | ||
115 | struct cvmx_gpio_dbg_ena_s cn31xx; | ||
116 | struct cvmx_gpio_dbg_ena_s cn50xx; | ||
117 | }; | ||
118 | |||
119 | union cvmx_gpio_int_clr { | ||
120 | uint64_t u64; | ||
121 | struct cvmx_gpio_int_clr_s { | ||
122 | uint64_t reserved_16_63:48; | ||
123 | uint64_t type:16; | ||
124 | } s; | ||
125 | struct cvmx_gpio_int_clr_s cn30xx; | ||
126 | struct cvmx_gpio_int_clr_s cn31xx; | ||
127 | struct cvmx_gpio_int_clr_s cn38xx; | ||
128 | struct cvmx_gpio_int_clr_s cn38xxp2; | ||
129 | struct cvmx_gpio_int_clr_s cn50xx; | ||
130 | struct cvmx_gpio_int_clr_s cn52xx; | ||
131 | struct cvmx_gpio_int_clr_s cn52xxp1; | ||
132 | struct cvmx_gpio_int_clr_s cn56xx; | ||
133 | struct cvmx_gpio_int_clr_s cn56xxp1; | ||
134 | struct cvmx_gpio_int_clr_s cn58xx; | ||
135 | struct cvmx_gpio_int_clr_s cn58xxp1; | ||
136 | }; | ||
137 | |||
138 | union cvmx_gpio_rx_dat { | ||
139 | uint64_t u64; | ||
140 | struct cvmx_gpio_rx_dat_s { | ||
141 | uint64_t reserved_24_63:40; | ||
142 | uint64_t dat:24; | ||
143 | } s; | ||
144 | struct cvmx_gpio_rx_dat_s cn30xx; | ||
145 | struct cvmx_gpio_rx_dat_s cn31xx; | ||
146 | struct cvmx_gpio_rx_dat_cn38xx { | ||
147 | uint64_t reserved_16_63:48; | ||
148 | uint64_t dat:16; | ||
149 | } cn38xx; | ||
150 | struct cvmx_gpio_rx_dat_cn38xx cn38xxp2; | ||
151 | struct cvmx_gpio_rx_dat_s cn50xx; | ||
152 | struct cvmx_gpio_rx_dat_cn38xx cn52xx; | ||
153 | struct cvmx_gpio_rx_dat_cn38xx cn52xxp1; | ||
154 | struct cvmx_gpio_rx_dat_cn38xx cn56xx; | ||
155 | struct cvmx_gpio_rx_dat_cn38xx cn56xxp1; | ||
156 | struct cvmx_gpio_rx_dat_cn38xx cn58xx; | ||
157 | struct cvmx_gpio_rx_dat_cn38xx cn58xxp1; | ||
158 | }; | ||
159 | |||
160 | union cvmx_gpio_tx_clr { | ||
161 | uint64_t u64; | ||
162 | struct cvmx_gpio_tx_clr_s { | ||
163 | uint64_t reserved_24_63:40; | ||
164 | uint64_t clr:24; | ||
165 | } s; | ||
166 | struct cvmx_gpio_tx_clr_s cn30xx; | ||
167 | struct cvmx_gpio_tx_clr_s cn31xx; | ||
168 | struct cvmx_gpio_tx_clr_cn38xx { | ||
169 | uint64_t reserved_16_63:48; | ||
170 | uint64_t clr:16; | ||
171 | } cn38xx; | ||
172 | struct cvmx_gpio_tx_clr_cn38xx cn38xxp2; | ||
173 | struct cvmx_gpio_tx_clr_s cn50xx; | ||
174 | struct cvmx_gpio_tx_clr_cn38xx cn52xx; | ||
175 | struct cvmx_gpio_tx_clr_cn38xx cn52xxp1; | ||
176 | struct cvmx_gpio_tx_clr_cn38xx cn56xx; | ||
177 | struct cvmx_gpio_tx_clr_cn38xx cn56xxp1; | ||
178 | struct cvmx_gpio_tx_clr_cn38xx cn58xx; | ||
179 | struct cvmx_gpio_tx_clr_cn38xx cn58xxp1; | ||
180 | }; | ||
181 | |||
182 | union cvmx_gpio_tx_set { | ||
183 | uint64_t u64; | ||
184 | struct cvmx_gpio_tx_set_s { | ||
185 | uint64_t reserved_24_63:40; | ||
186 | uint64_t set:24; | ||
187 | } s; | ||
188 | struct cvmx_gpio_tx_set_s cn30xx; | ||
189 | struct cvmx_gpio_tx_set_s cn31xx; | ||
190 | struct cvmx_gpio_tx_set_cn38xx { | ||
191 | uint64_t reserved_16_63:48; | ||
192 | uint64_t set:16; | ||
193 | } cn38xx; | ||
194 | struct cvmx_gpio_tx_set_cn38xx cn38xxp2; | ||
195 | struct cvmx_gpio_tx_set_s cn50xx; | ||
196 | struct cvmx_gpio_tx_set_cn38xx cn52xx; | ||
197 | struct cvmx_gpio_tx_set_cn38xx cn52xxp1; | ||
198 | struct cvmx_gpio_tx_set_cn38xx cn56xx; | ||
199 | struct cvmx_gpio_tx_set_cn38xx cn56xxp1; | ||
200 | struct cvmx_gpio_tx_set_cn38xx cn58xx; | ||
201 | struct cvmx_gpio_tx_set_cn38xx cn58xxp1; | ||
202 | }; | ||
203 | |||
204 | union cvmx_gpio_xbit_cfgx { | ||
205 | uint64_t u64; | ||
206 | struct cvmx_gpio_xbit_cfgx_s { | ||
207 | uint64_t reserved_12_63:52; | ||
208 | uint64_t fil_sel:4; | ||
209 | uint64_t fil_cnt:4; | ||
210 | uint64_t reserved_2_3:2; | ||
211 | uint64_t rx_xor:1; | ||
212 | uint64_t tx_oe:1; | ||
213 | } s; | ||
214 | struct cvmx_gpio_xbit_cfgx_s cn30xx; | ||
215 | struct cvmx_gpio_xbit_cfgx_s cn31xx; | ||
216 | struct cvmx_gpio_xbit_cfgx_s cn50xx; | ||
217 | }; | ||
218 | |||
219 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-iob-defs.h b/arch/mips/include/asm/octeon/cvmx-iob-defs.h new file mode 100644 index 000000000000..0ee36baec500 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-iob-defs.h | |||
@@ -0,0 +1,530 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_IOB_DEFS_H__ | ||
29 | #define __CVMX_IOB_DEFS_H__ | ||
30 | |||
31 | #define CVMX_IOB_BIST_STATUS \ | ||
32 | CVMX_ADD_IO_SEG(0x00011800F00007F8ull) | ||
33 | #define CVMX_IOB_CTL_STATUS \ | ||
34 | CVMX_ADD_IO_SEG(0x00011800F0000050ull) | ||
35 | #define CVMX_IOB_DWB_PRI_CNT \ | ||
36 | CVMX_ADD_IO_SEG(0x00011800F0000028ull) | ||
37 | #define CVMX_IOB_FAU_TIMEOUT \ | ||
38 | CVMX_ADD_IO_SEG(0x00011800F0000000ull) | ||
39 | #define CVMX_IOB_I2C_PRI_CNT \ | ||
40 | CVMX_ADD_IO_SEG(0x00011800F0000010ull) | ||
41 | #define CVMX_IOB_INB_CONTROL_MATCH \ | ||
42 | CVMX_ADD_IO_SEG(0x00011800F0000078ull) | ||
43 | #define CVMX_IOB_INB_CONTROL_MATCH_ENB \ | ||
44 | CVMX_ADD_IO_SEG(0x00011800F0000088ull) | ||
45 | #define CVMX_IOB_INB_DATA_MATCH \ | ||
46 | CVMX_ADD_IO_SEG(0x00011800F0000070ull) | ||
47 | #define CVMX_IOB_INB_DATA_MATCH_ENB \ | ||
48 | CVMX_ADD_IO_SEG(0x00011800F0000080ull) | ||
49 | #define CVMX_IOB_INT_ENB \ | ||
50 | CVMX_ADD_IO_SEG(0x00011800F0000060ull) | ||
51 | #define CVMX_IOB_INT_SUM \ | ||
52 | CVMX_ADD_IO_SEG(0x00011800F0000058ull) | ||
53 | #define CVMX_IOB_N2C_L2C_PRI_CNT \ | ||
54 | CVMX_ADD_IO_SEG(0x00011800F0000020ull) | ||
55 | #define CVMX_IOB_N2C_RSP_PRI_CNT \ | ||
56 | CVMX_ADD_IO_SEG(0x00011800F0000008ull) | ||
57 | #define CVMX_IOB_OUTB_COM_PRI_CNT \ | ||
58 | CVMX_ADD_IO_SEG(0x00011800F0000040ull) | ||
59 | #define CVMX_IOB_OUTB_CONTROL_MATCH \ | ||
60 | CVMX_ADD_IO_SEG(0x00011800F0000098ull) | ||
61 | #define CVMX_IOB_OUTB_CONTROL_MATCH_ENB \ | ||
62 | CVMX_ADD_IO_SEG(0x00011800F00000A8ull) | ||
63 | #define CVMX_IOB_OUTB_DATA_MATCH \ | ||
64 | CVMX_ADD_IO_SEG(0x00011800F0000090ull) | ||
65 | #define CVMX_IOB_OUTB_DATA_MATCH_ENB \ | ||
66 | CVMX_ADD_IO_SEG(0x00011800F00000A0ull) | ||
67 | #define CVMX_IOB_OUTB_FPA_PRI_CNT \ | ||
68 | CVMX_ADD_IO_SEG(0x00011800F0000048ull) | ||
69 | #define CVMX_IOB_OUTB_REQ_PRI_CNT \ | ||
70 | CVMX_ADD_IO_SEG(0x00011800F0000038ull) | ||
71 | #define CVMX_IOB_P2C_REQ_PRI_CNT \ | ||
72 | CVMX_ADD_IO_SEG(0x00011800F0000018ull) | ||
73 | #define CVMX_IOB_PKT_ERR \ | ||
74 | CVMX_ADD_IO_SEG(0x00011800F0000068ull) | ||
75 | |||
76 | union cvmx_iob_bist_status { | ||
77 | uint64_t u64; | ||
78 | struct cvmx_iob_bist_status_s { | ||
79 | uint64_t reserved_18_63:46; | ||
80 | uint64_t icnrcb:1; | ||
81 | uint64_t icr0:1; | ||
82 | uint64_t icr1:1; | ||
83 | uint64_t icnr1:1; | ||
84 | uint64_t icnr0:1; | ||
85 | uint64_t ibdr0:1; | ||
86 | uint64_t ibdr1:1; | ||
87 | uint64_t ibr0:1; | ||
88 | uint64_t ibr1:1; | ||
89 | uint64_t icnrt:1; | ||
90 | uint64_t ibrq0:1; | ||
91 | uint64_t ibrq1:1; | ||
92 | uint64_t icrn0:1; | ||
93 | uint64_t icrn1:1; | ||
94 | uint64_t icrp0:1; | ||
95 | uint64_t icrp1:1; | ||
96 | uint64_t ibd:1; | ||
97 | uint64_t icd:1; | ||
98 | } s; | ||
99 | struct cvmx_iob_bist_status_s cn30xx; | ||
100 | struct cvmx_iob_bist_status_s cn31xx; | ||
101 | struct cvmx_iob_bist_status_s cn38xx; | ||
102 | struct cvmx_iob_bist_status_s cn38xxp2; | ||
103 | struct cvmx_iob_bist_status_s cn50xx; | ||
104 | struct cvmx_iob_bist_status_s cn52xx; | ||
105 | struct cvmx_iob_bist_status_s cn52xxp1; | ||
106 | struct cvmx_iob_bist_status_s cn56xx; | ||
107 | struct cvmx_iob_bist_status_s cn56xxp1; | ||
108 | struct cvmx_iob_bist_status_s cn58xx; | ||
109 | struct cvmx_iob_bist_status_s cn58xxp1; | ||
110 | }; | ||
111 | |||
112 | union cvmx_iob_ctl_status { | ||
113 | uint64_t u64; | ||
114 | struct cvmx_iob_ctl_status_s { | ||
115 | uint64_t reserved_5_63:59; | ||
116 | uint64_t outb_mat:1; | ||
117 | uint64_t inb_mat:1; | ||
118 | uint64_t pko_enb:1; | ||
119 | uint64_t dwb_enb:1; | ||
120 | uint64_t fau_end:1; | ||
121 | } s; | ||
122 | struct cvmx_iob_ctl_status_s cn30xx; | ||
123 | struct cvmx_iob_ctl_status_s cn31xx; | ||
124 | struct cvmx_iob_ctl_status_s cn38xx; | ||
125 | struct cvmx_iob_ctl_status_s cn38xxp2; | ||
126 | struct cvmx_iob_ctl_status_s cn50xx; | ||
127 | struct cvmx_iob_ctl_status_s cn52xx; | ||
128 | struct cvmx_iob_ctl_status_s cn52xxp1; | ||
129 | struct cvmx_iob_ctl_status_s cn56xx; | ||
130 | struct cvmx_iob_ctl_status_s cn56xxp1; | ||
131 | struct cvmx_iob_ctl_status_s cn58xx; | ||
132 | struct cvmx_iob_ctl_status_s cn58xxp1; | ||
133 | }; | ||
134 | |||
135 | union cvmx_iob_dwb_pri_cnt { | ||
136 | uint64_t u64; | ||
137 | struct cvmx_iob_dwb_pri_cnt_s { | ||
138 | uint64_t reserved_16_63:48; | ||
139 | uint64_t cnt_enb:1; | ||
140 | uint64_t cnt_val:15; | ||
141 | } s; | ||
142 | struct cvmx_iob_dwb_pri_cnt_s cn38xx; | ||
143 | struct cvmx_iob_dwb_pri_cnt_s cn38xxp2; | ||
144 | struct cvmx_iob_dwb_pri_cnt_s cn52xx; | ||
145 | struct cvmx_iob_dwb_pri_cnt_s cn52xxp1; | ||
146 | struct cvmx_iob_dwb_pri_cnt_s cn56xx; | ||
147 | struct cvmx_iob_dwb_pri_cnt_s cn56xxp1; | ||
148 | struct cvmx_iob_dwb_pri_cnt_s cn58xx; | ||
149 | struct cvmx_iob_dwb_pri_cnt_s cn58xxp1; | ||
150 | }; | ||
151 | |||
152 | union cvmx_iob_fau_timeout { | ||
153 | uint64_t u64; | ||
154 | struct cvmx_iob_fau_timeout_s { | ||
155 | uint64_t reserved_13_63:51; | ||
156 | uint64_t tout_enb:1; | ||
157 | uint64_t tout_val:12; | ||
158 | } s; | ||
159 | struct cvmx_iob_fau_timeout_s cn30xx; | ||
160 | struct cvmx_iob_fau_timeout_s cn31xx; | ||
161 | struct cvmx_iob_fau_timeout_s cn38xx; | ||
162 | struct cvmx_iob_fau_timeout_s cn38xxp2; | ||
163 | struct cvmx_iob_fau_timeout_s cn50xx; | ||
164 | struct cvmx_iob_fau_timeout_s cn52xx; | ||
165 | struct cvmx_iob_fau_timeout_s cn52xxp1; | ||
166 | struct cvmx_iob_fau_timeout_s cn56xx; | ||
167 | struct cvmx_iob_fau_timeout_s cn56xxp1; | ||
168 | struct cvmx_iob_fau_timeout_s cn58xx; | ||
169 | struct cvmx_iob_fau_timeout_s cn58xxp1; | ||
170 | }; | ||
171 | |||
172 | union cvmx_iob_i2c_pri_cnt { | ||
173 | uint64_t u64; | ||
174 | struct cvmx_iob_i2c_pri_cnt_s { | ||
175 | uint64_t reserved_16_63:48; | ||
176 | uint64_t cnt_enb:1; | ||
177 | uint64_t cnt_val:15; | ||
178 | } s; | ||
179 | struct cvmx_iob_i2c_pri_cnt_s cn38xx; | ||
180 | struct cvmx_iob_i2c_pri_cnt_s cn38xxp2; | ||
181 | struct cvmx_iob_i2c_pri_cnt_s cn52xx; | ||
182 | struct cvmx_iob_i2c_pri_cnt_s cn52xxp1; | ||
183 | struct cvmx_iob_i2c_pri_cnt_s cn56xx; | ||
184 | struct cvmx_iob_i2c_pri_cnt_s cn56xxp1; | ||
185 | struct cvmx_iob_i2c_pri_cnt_s cn58xx; | ||
186 | struct cvmx_iob_i2c_pri_cnt_s cn58xxp1; | ||
187 | }; | ||
188 | |||
189 | union cvmx_iob_inb_control_match { | ||
190 | uint64_t u64; | ||
191 | struct cvmx_iob_inb_control_match_s { | ||
192 | uint64_t reserved_29_63:35; | ||
193 | uint64_t mask:8; | ||
194 | uint64_t opc:4; | ||
195 | uint64_t dst:9; | ||
196 | uint64_t src:8; | ||
197 | } s; | ||
198 | struct cvmx_iob_inb_control_match_s cn30xx; | ||
199 | struct cvmx_iob_inb_control_match_s cn31xx; | ||
200 | struct cvmx_iob_inb_control_match_s cn38xx; | ||
201 | struct cvmx_iob_inb_control_match_s cn38xxp2; | ||
202 | struct cvmx_iob_inb_control_match_s cn50xx; | ||
203 | struct cvmx_iob_inb_control_match_s cn52xx; | ||
204 | struct cvmx_iob_inb_control_match_s cn52xxp1; | ||
205 | struct cvmx_iob_inb_control_match_s cn56xx; | ||
206 | struct cvmx_iob_inb_control_match_s cn56xxp1; | ||
207 | struct cvmx_iob_inb_control_match_s cn58xx; | ||
208 | struct cvmx_iob_inb_control_match_s cn58xxp1; | ||
209 | }; | ||
210 | |||
211 | union cvmx_iob_inb_control_match_enb { | ||
212 | uint64_t u64; | ||
213 | struct cvmx_iob_inb_control_match_enb_s { | ||
214 | uint64_t reserved_29_63:35; | ||
215 | uint64_t mask:8; | ||
216 | uint64_t opc:4; | ||
217 | uint64_t dst:9; | ||
218 | uint64_t src:8; | ||
219 | } s; | ||
220 | struct cvmx_iob_inb_control_match_enb_s cn30xx; | ||
221 | struct cvmx_iob_inb_control_match_enb_s cn31xx; | ||
222 | struct cvmx_iob_inb_control_match_enb_s cn38xx; | ||
223 | struct cvmx_iob_inb_control_match_enb_s cn38xxp2; | ||
224 | struct cvmx_iob_inb_control_match_enb_s cn50xx; | ||
225 | struct cvmx_iob_inb_control_match_enb_s cn52xx; | ||
226 | struct cvmx_iob_inb_control_match_enb_s cn52xxp1; | ||
227 | struct cvmx_iob_inb_control_match_enb_s cn56xx; | ||
228 | struct cvmx_iob_inb_control_match_enb_s cn56xxp1; | ||
229 | struct cvmx_iob_inb_control_match_enb_s cn58xx; | ||
230 | struct cvmx_iob_inb_control_match_enb_s cn58xxp1; | ||
231 | }; | ||
232 | |||
233 | union cvmx_iob_inb_data_match { | ||
234 | uint64_t u64; | ||
235 | struct cvmx_iob_inb_data_match_s { | ||
236 | uint64_t data:64; | ||
237 | } s; | ||
238 | struct cvmx_iob_inb_data_match_s cn30xx; | ||
239 | struct cvmx_iob_inb_data_match_s cn31xx; | ||
240 | struct cvmx_iob_inb_data_match_s cn38xx; | ||
241 | struct cvmx_iob_inb_data_match_s cn38xxp2; | ||
242 | struct cvmx_iob_inb_data_match_s cn50xx; | ||
243 | struct cvmx_iob_inb_data_match_s cn52xx; | ||
244 | struct cvmx_iob_inb_data_match_s cn52xxp1; | ||
245 | struct cvmx_iob_inb_data_match_s cn56xx; | ||
246 | struct cvmx_iob_inb_data_match_s cn56xxp1; | ||
247 | struct cvmx_iob_inb_data_match_s cn58xx; | ||
248 | struct cvmx_iob_inb_data_match_s cn58xxp1; | ||
249 | }; | ||
250 | |||
251 | union cvmx_iob_inb_data_match_enb { | ||
252 | uint64_t u64; | ||
253 | struct cvmx_iob_inb_data_match_enb_s { | ||
254 | uint64_t data:64; | ||
255 | } s; | ||
256 | struct cvmx_iob_inb_data_match_enb_s cn30xx; | ||
257 | struct cvmx_iob_inb_data_match_enb_s cn31xx; | ||
258 | struct cvmx_iob_inb_data_match_enb_s cn38xx; | ||
259 | struct cvmx_iob_inb_data_match_enb_s cn38xxp2; | ||
260 | struct cvmx_iob_inb_data_match_enb_s cn50xx; | ||
261 | struct cvmx_iob_inb_data_match_enb_s cn52xx; | ||
262 | struct cvmx_iob_inb_data_match_enb_s cn52xxp1; | ||
263 | struct cvmx_iob_inb_data_match_enb_s cn56xx; | ||
264 | struct cvmx_iob_inb_data_match_enb_s cn56xxp1; | ||
265 | struct cvmx_iob_inb_data_match_enb_s cn58xx; | ||
266 | struct cvmx_iob_inb_data_match_enb_s cn58xxp1; | ||
267 | }; | ||
268 | |||
269 | union cvmx_iob_int_enb { | ||
270 | uint64_t u64; | ||
271 | struct cvmx_iob_int_enb_s { | ||
272 | uint64_t reserved_6_63:58; | ||
273 | uint64_t p_dat:1; | ||
274 | uint64_t np_dat:1; | ||
275 | uint64_t p_eop:1; | ||
276 | uint64_t p_sop:1; | ||
277 | uint64_t np_eop:1; | ||
278 | uint64_t np_sop:1; | ||
279 | } s; | ||
280 | struct cvmx_iob_int_enb_cn30xx { | ||
281 | uint64_t reserved_4_63:60; | ||
282 | uint64_t p_eop:1; | ||
283 | uint64_t p_sop:1; | ||
284 | uint64_t np_eop:1; | ||
285 | uint64_t np_sop:1; | ||
286 | } cn30xx; | ||
287 | struct cvmx_iob_int_enb_cn30xx cn31xx; | ||
288 | struct cvmx_iob_int_enb_cn30xx cn38xx; | ||
289 | struct cvmx_iob_int_enb_cn30xx cn38xxp2; | ||
290 | struct cvmx_iob_int_enb_s cn50xx; | ||
291 | struct cvmx_iob_int_enb_s cn52xx; | ||
292 | struct cvmx_iob_int_enb_s cn52xxp1; | ||
293 | struct cvmx_iob_int_enb_s cn56xx; | ||
294 | struct cvmx_iob_int_enb_s cn56xxp1; | ||
295 | struct cvmx_iob_int_enb_s cn58xx; | ||
296 | struct cvmx_iob_int_enb_s cn58xxp1; | ||
297 | }; | ||
298 | |||
299 | union cvmx_iob_int_sum { | ||
300 | uint64_t u64; | ||
301 | struct cvmx_iob_int_sum_s { | ||
302 | uint64_t reserved_6_63:58; | ||
303 | uint64_t p_dat:1; | ||
304 | uint64_t np_dat:1; | ||
305 | uint64_t p_eop:1; | ||
306 | uint64_t p_sop:1; | ||
307 | uint64_t np_eop:1; | ||
308 | uint64_t np_sop:1; | ||
309 | } s; | ||
310 | struct cvmx_iob_int_sum_cn30xx { | ||
311 | uint64_t reserved_4_63:60; | ||
312 | uint64_t p_eop:1; | ||
313 | uint64_t p_sop:1; | ||
314 | uint64_t np_eop:1; | ||
315 | uint64_t np_sop:1; | ||
316 | } cn30xx; | ||
317 | struct cvmx_iob_int_sum_cn30xx cn31xx; | ||
318 | struct cvmx_iob_int_sum_cn30xx cn38xx; | ||
319 | struct cvmx_iob_int_sum_cn30xx cn38xxp2; | ||
320 | struct cvmx_iob_int_sum_s cn50xx; | ||
321 | struct cvmx_iob_int_sum_s cn52xx; | ||
322 | struct cvmx_iob_int_sum_s cn52xxp1; | ||
323 | struct cvmx_iob_int_sum_s cn56xx; | ||
324 | struct cvmx_iob_int_sum_s cn56xxp1; | ||
325 | struct cvmx_iob_int_sum_s cn58xx; | ||
326 | struct cvmx_iob_int_sum_s cn58xxp1; | ||
327 | }; | ||
328 | |||
329 | union cvmx_iob_n2c_l2c_pri_cnt { | ||
330 | uint64_t u64; | ||
331 | struct cvmx_iob_n2c_l2c_pri_cnt_s { | ||
332 | uint64_t reserved_16_63:48; | ||
333 | uint64_t cnt_enb:1; | ||
334 | uint64_t cnt_val:15; | ||
335 | } s; | ||
336 | struct cvmx_iob_n2c_l2c_pri_cnt_s cn38xx; | ||
337 | struct cvmx_iob_n2c_l2c_pri_cnt_s cn38xxp2; | ||
338 | struct cvmx_iob_n2c_l2c_pri_cnt_s cn52xx; | ||
339 | struct cvmx_iob_n2c_l2c_pri_cnt_s cn52xxp1; | ||
340 | struct cvmx_iob_n2c_l2c_pri_cnt_s cn56xx; | ||
341 | struct cvmx_iob_n2c_l2c_pri_cnt_s cn56xxp1; | ||
342 | struct cvmx_iob_n2c_l2c_pri_cnt_s cn58xx; | ||
343 | struct cvmx_iob_n2c_l2c_pri_cnt_s cn58xxp1; | ||
344 | }; | ||
345 | |||
346 | union cvmx_iob_n2c_rsp_pri_cnt { | ||
347 | uint64_t u64; | ||
348 | struct cvmx_iob_n2c_rsp_pri_cnt_s { | ||
349 | uint64_t reserved_16_63:48; | ||
350 | uint64_t cnt_enb:1; | ||
351 | uint64_t cnt_val:15; | ||
352 | } s; | ||
353 | struct cvmx_iob_n2c_rsp_pri_cnt_s cn38xx; | ||
354 | struct cvmx_iob_n2c_rsp_pri_cnt_s cn38xxp2; | ||
355 | struct cvmx_iob_n2c_rsp_pri_cnt_s cn52xx; | ||
356 | struct cvmx_iob_n2c_rsp_pri_cnt_s cn52xxp1; | ||
357 | struct cvmx_iob_n2c_rsp_pri_cnt_s cn56xx; | ||
358 | struct cvmx_iob_n2c_rsp_pri_cnt_s cn56xxp1; | ||
359 | struct cvmx_iob_n2c_rsp_pri_cnt_s cn58xx; | ||
360 | struct cvmx_iob_n2c_rsp_pri_cnt_s cn58xxp1; | ||
361 | }; | ||
362 | |||
363 | union cvmx_iob_outb_com_pri_cnt { | ||
364 | uint64_t u64; | ||
365 | struct cvmx_iob_outb_com_pri_cnt_s { | ||
366 | uint64_t reserved_16_63:48; | ||
367 | uint64_t cnt_enb:1; | ||
368 | uint64_t cnt_val:15; | ||
369 | } s; | ||
370 | struct cvmx_iob_outb_com_pri_cnt_s cn38xx; | ||
371 | struct cvmx_iob_outb_com_pri_cnt_s cn38xxp2; | ||
372 | struct cvmx_iob_outb_com_pri_cnt_s cn52xx; | ||
373 | struct cvmx_iob_outb_com_pri_cnt_s cn52xxp1; | ||
374 | struct cvmx_iob_outb_com_pri_cnt_s cn56xx; | ||
375 | struct cvmx_iob_outb_com_pri_cnt_s cn56xxp1; | ||
376 | struct cvmx_iob_outb_com_pri_cnt_s cn58xx; | ||
377 | struct cvmx_iob_outb_com_pri_cnt_s cn58xxp1; | ||
378 | }; | ||
379 | |||
380 | union cvmx_iob_outb_control_match { | ||
381 | uint64_t u64; | ||
382 | struct cvmx_iob_outb_control_match_s { | ||
383 | uint64_t reserved_26_63:38; | ||
384 | uint64_t mask:8; | ||
385 | uint64_t eot:1; | ||
386 | uint64_t dst:8; | ||
387 | uint64_t src:9; | ||
388 | } s; | ||
389 | struct cvmx_iob_outb_control_match_s cn30xx; | ||
390 | struct cvmx_iob_outb_control_match_s cn31xx; | ||
391 | struct cvmx_iob_outb_control_match_s cn38xx; | ||
392 | struct cvmx_iob_outb_control_match_s cn38xxp2; | ||
393 | struct cvmx_iob_outb_control_match_s cn50xx; | ||
394 | struct cvmx_iob_outb_control_match_s cn52xx; | ||
395 | struct cvmx_iob_outb_control_match_s cn52xxp1; | ||
396 | struct cvmx_iob_outb_control_match_s cn56xx; | ||
397 | struct cvmx_iob_outb_control_match_s cn56xxp1; | ||
398 | struct cvmx_iob_outb_control_match_s cn58xx; | ||
399 | struct cvmx_iob_outb_control_match_s cn58xxp1; | ||
400 | }; | ||
401 | |||
402 | union cvmx_iob_outb_control_match_enb { | ||
403 | uint64_t u64; | ||
404 | struct cvmx_iob_outb_control_match_enb_s { | ||
405 | uint64_t reserved_26_63:38; | ||
406 | uint64_t mask:8; | ||
407 | uint64_t eot:1; | ||
408 | uint64_t dst:8; | ||
409 | uint64_t src:9; | ||
410 | } s; | ||
411 | struct cvmx_iob_outb_control_match_enb_s cn30xx; | ||
412 | struct cvmx_iob_outb_control_match_enb_s cn31xx; | ||
413 | struct cvmx_iob_outb_control_match_enb_s cn38xx; | ||
414 | struct cvmx_iob_outb_control_match_enb_s cn38xxp2; | ||
415 | struct cvmx_iob_outb_control_match_enb_s cn50xx; | ||
416 | struct cvmx_iob_outb_control_match_enb_s cn52xx; | ||
417 | struct cvmx_iob_outb_control_match_enb_s cn52xxp1; | ||
418 | struct cvmx_iob_outb_control_match_enb_s cn56xx; | ||
419 | struct cvmx_iob_outb_control_match_enb_s cn56xxp1; | ||
420 | struct cvmx_iob_outb_control_match_enb_s cn58xx; | ||
421 | struct cvmx_iob_outb_control_match_enb_s cn58xxp1; | ||
422 | }; | ||
423 | |||
424 | union cvmx_iob_outb_data_match { | ||
425 | uint64_t u64; | ||
426 | struct cvmx_iob_outb_data_match_s { | ||
427 | uint64_t data:64; | ||
428 | } s; | ||
429 | struct cvmx_iob_outb_data_match_s cn30xx; | ||
430 | struct cvmx_iob_outb_data_match_s cn31xx; | ||
431 | struct cvmx_iob_outb_data_match_s cn38xx; | ||
432 | struct cvmx_iob_outb_data_match_s cn38xxp2; | ||
433 | struct cvmx_iob_outb_data_match_s cn50xx; | ||
434 | struct cvmx_iob_outb_data_match_s cn52xx; | ||
435 | struct cvmx_iob_outb_data_match_s cn52xxp1; | ||
436 | struct cvmx_iob_outb_data_match_s cn56xx; | ||
437 | struct cvmx_iob_outb_data_match_s cn56xxp1; | ||
438 | struct cvmx_iob_outb_data_match_s cn58xx; | ||
439 | struct cvmx_iob_outb_data_match_s cn58xxp1; | ||
440 | }; | ||
441 | |||
442 | union cvmx_iob_outb_data_match_enb { | ||
443 | uint64_t u64; | ||
444 | struct cvmx_iob_outb_data_match_enb_s { | ||
445 | uint64_t data:64; | ||
446 | } s; | ||
447 | struct cvmx_iob_outb_data_match_enb_s cn30xx; | ||
448 | struct cvmx_iob_outb_data_match_enb_s cn31xx; | ||
449 | struct cvmx_iob_outb_data_match_enb_s cn38xx; | ||
450 | struct cvmx_iob_outb_data_match_enb_s cn38xxp2; | ||
451 | struct cvmx_iob_outb_data_match_enb_s cn50xx; | ||
452 | struct cvmx_iob_outb_data_match_enb_s cn52xx; | ||
453 | struct cvmx_iob_outb_data_match_enb_s cn52xxp1; | ||
454 | struct cvmx_iob_outb_data_match_enb_s cn56xx; | ||
455 | struct cvmx_iob_outb_data_match_enb_s cn56xxp1; | ||
456 | struct cvmx_iob_outb_data_match_enb_s cn58xx; | ||
457 | struct cvmx_iob_outb_data_match_enb_s cn58xxp1; | ||
458 | }; | ||
459 | |||
460 | union cvmx_iob_outb_fpa_pri_cnt { | ||
461 | uint64_t u64; | ||
462 | struct cvmx_iob_outb_fpa_pri_cnt_s { | ||
463 | uint64_t reserved_16_63:48; | ||
464 | uint64_t cnt_enb:1; | ||
465 | uint64_t cnt_val:15; | ||
466 | } s; | ||
467 | struct cvmx_iob_outb_fpa_pri_cnt_s cn38xx; | ||
468 | struct cvmx_iob_outb_fpa_pri_cnt_s cn38xxp2; | ||
469 | struct cvmx_iob_outb_fpa_pri_cnt_s cn52xx; | ||
470 | struct cvmx_iob_outb_fpa_pri_cnt_s cn52xxp1; | ||
471 | struct cvmx_iob_outb_fpa_pri_cnt_s cn56xx; | ||
472 | struct cvmx_iob_outb_fpa_pri_cnt_s cn56xxp1; | ||
473 | struct cvmx_iob_outb_fpa_pri_cnt_s cn58xx; | ||
474 | struct cvmx_iob_outb_fpa_pri_cnt_s cn58xxp1; | ||
475 | }; | ||
476 | |||
477 | union cvmx_iob_outb_req_pri_cnt { | ||
478 | uint64_t u64; | ||
479 | struct cvmx_iob_outb_req_pri_cnt_s { | ||
480 | uint64_t reserved_16_63:48; | ||
481 | uint64_t cnt_enb:1; | ||
482 | uint64_t cnt_val:15; | ||
483 | } s; | ||
484 | struct cvmx_iob_outb_req_pri_cnt_s cn38xx; | ||
485 | struct cvmx_iob_outb_req_pri_cnt_s cn38xxp2; | ||
486 | struct cvmx_iob_outb_req_pri_cnt_s cn52xx; | ||
487 | struct cvmx_iob_outb_req_pri_cnt_s cn52xxp1; | ||
488 | struct cvmx_iob_outb_req_pri_cnt_s cn56xx; | ||
489 | struct cvmx_iob_outb_req_pri_cnt_s cn56xxp1; | ||
490 | struct cvmx_iob_outb_req_pri_cnt_s cn58xx; | ||
491 | struct cvmx_iob_outb_req_pri_cnt_s cn58xxp1; | ||
492 | }; | ||
493 | |||
494 | union cvmx_iob_p2c_req_pri_cnt { | ||
495 | uint64_t u64; | ||
496 | struct cvmx_iob_p2c_req_pri_cnt_s { | ||
497 | uint64_t reserved_16_63:48; | ||
498 | uint64_t cnt_enb:1; | ||
499 | uint64_t cnt_val:15; | ||
500 | } s; | ||
501 | struct cvmx_iob_p2c_req_pri_cnt_s cn38xx; | ||
502 | struct cvmx_iob_p2c_req_pri_cnt_s cn38xxp2; | ||
503 | struct cvmx_iob_p2c_req_pri_cnt_s cn52xx; | ||
504 | struct cvmx_iob_p2c_req_pri_cnt_s cn52xxp1; | ||
505 | struct cvmx_iob_p2c_req_pri_cnt_s cn56xx; | ||
506 | struct cvmx_iob_p2c_req_pri_cnt_s cn56xxp1; | ||
507 | struct cvmx_iob_p2c_req_pri_cnt_s cn58xx; | ||
508 | struct cvmx_iob_p2c_req_pri_cnt_s cn58xxp1; | ||
509 | }; | ||
510 | |||
511 | union cvmx_iob_pkt_err { | ||
512 | uint64_t u64; | ||
513 | struct cvmx_iob_pkt_err_s { | ||
514 | uint64_t reserved_6_63:58; | ||
515 | uint64_t port:6; | ||
516 | } s; | ||
517 | struct cvmx_iob_pkt_err_s cn30xx; | ||
518 | struct cvmx_iob_pkt_err_s cn31xx; | ||
519 | struct cvmx_iob_pkt_err_s cn38xx; | ||
520 | struct cvmx_iob_pkt_err_s cn38xxp2; | ||
521 | struct cvmx_iob_pkt_err_s cn50xx; | ||
522 | struct cvmx_iob_pkt_err_s cn52xx; | ||
523 | struct cvmx_iob_pkt_err_s cn52xxp1; | ||
524 | struct cvmx_iob_pkt_err_s cn56xx; | ||
525 | struct cvmx_iob_pkt_err_s cn56xxp1; | ||
526 | struct cvmx_iob_pkt_err_s cn58xx; | ||
527 | struct cvmx_iob_pkt_err_s cn58xxp1; | ||
528 | }; | ||
529 | |||
530 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-ipd-defs.h b/arch/mips/include/asm/octeon/cvmx-ipd-defs.h new file mode 100644 index 000000000000..f8b8fc657d2c --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-ipd-defs.h | |||
@@ -0,0 +1,877 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_IPD_DEFS_H__ | ||
29 | #define __CVMX_IPD_DEFS_H__ | ||
30 | |||
31 | #define CVMX_IPD_1ST_MBUFF_SKIP \ | ||
32 | CVMX_ADD_IO_SEG(0x00014F0000000000ull) | ||
33 | #define CVMX_IPD_1st_NEXT_PTR_BACK \ | ||
34 | CVMX_ADD_IO_SEG(0x00014F0000000150ull) | ||
35 | #define CVMX_IPD_2nd_NEXT_PTR_BACK \ | ||
36 | CVMX_ADD_IO_SEG(0x00014F0000000158ull) | ||
37 | #define CVMX_IPD_BIST_STATUS \ | ||
38 | CVMX_ADD_IO_SEG(0x00014F00000007F8ull) | ||
39 | #define CVMX_IPD_BP_PRT_RED_END \ | ||
40 | CVMX_ADD_IO_SEG(0x00014F0000000328ull) | ||
41 | #define CVMX_IPD_CLK_COUNT \ | ||
42 | CVMX_ADD_IO_SEG(0x00014F0000000338ull) | ||
43 | #define CVMX_IPD_CTL_STATUS \ | ||
44 | CVMX_ADD_IO_SEG(0x00014F0000000018ull) | ||
45 | #define CVMX_IPD_INT_ENB \ | ||
46 | CVMX_ADD_IO_SEG(0x00014F0000000160ull) | ||
47 | #define CVMX_IPD_INT_SUM \ | ||
48 | CVMX_ADD_IO_SEG(0x00014F0000000168ull) | ||
49 | #define CVMX_IPD_NOT_1ST_MBUFF_SKIP \ | ||
50 | CVMX_ADD_IO_SEG(0x00014F0000000008ull) | ||
51 | #define CVMX_IPD_PACKET_MBUFF_SIZE \ | ||
52 | CVMX_ADD_IO_SEG(0x00014F0000000010ull) | ||
53 | #define CVMX_IPD_PKT_PTR_VALID \ | ||
54 | CVMX_ADD_IO_SEG(0x00014F0000000358ull) | ||
55 | #define CVMX_IPD_PORTX_BP_PAGE_CNT(offset) \ | ||
56 | CVMX_ADD_IO_SEG(0x00014F0000000028ull + (((offset) & 63) * 8)) | ||
57 | #define CVMX_IPD_PORTX_BP_PAGE_CNT2(offset) \ | ||
58 | CVMX_ADD_IO_SEG(0x00014F0000000368ull + (((offset) & 63) * 8) - 8 * 36) | ||
59 | #define CVMX_IPD_PORT_BP_COUNTERS2_PAIRX(offset) \ | ||
60 | CVMX_ADD_IO_SEG(0x00014F0000000388ull + (((offset) & 63) * 8) - 8 * 36) | ||
61 | #define CVMX_IPD_PORT_BP_COUNTERS_PAIRX(offset) \ | ||
62 | CVMX_ADD_IO_SEG(0x00014F00000001B8ull + (((offset) & 63) * 8)) | ||
63 | #define CVMX_IPD_PORT_QOS_INTX(offset) \ | ||
64 | CVMX_ADD_IO_SEG(0x00014F0000000808ull + (((offset) & 7) * 8)) | ||
65 | #define CVMX_IPD_PORT_QOS_INT_ENBX(offset) \ | ||
66 | CVMX_ADD_IO_SEG(0x00014F0000000848ull + (((offset) & 7) * 8)) | ||
67 | #define CVMX_IPD_PORT_QOS_X_CNT(offset) \ | ||
68 | CVMX_ADD_IO_SEG(0x00014F0000000888ull + (((offset) & 511) * 8)) | ||
69 | #define CVMX_IPD_PRC_HOLD_PTR_FIFO_CTL \ | ||
70 | CVMX_ADD_IO_SEG(0x00014F0000000348ull) | ||
71 | #define CVMX_IPD_PRC_PORT_PTR_FIFO_CTL \ | ||
72 | CVMX_ADD_IO_SEG(0x00014F0000000350ull) | ||
73 | #define CVMX_IPD_PTR_COUNT \ | ||
74 | CVMX_ADD_IO_SEG(0x00014F0000000320ull) | ||
75 | #define CVMX_IPD_PWP_PTR_FIFO_CTL \ | ||
76 | CVMX_ADD_IO_SEG(0x00014F0000000340ull) | ||
77 | #define CVMX_IPD_QOS0_RED_MARKS \ | ||
78 | CVMX_ADD_IO_SEG(0x00014F0000000178ull) | ||
79 | #define CVMX_IPD_QOS1_RED_MARKS \ | ||
80 | CVMX_ADD_IO_SEG(0x00014F0000000180ull) | ||
81 | #define CVMX_IPD_QOS2_RED_MARKS \ | ||
82 | CVMX_ADD_IO_SEG(0x00014F0000000188ull) | ||
83 | #define CVMX_IPD_QOS3_RED_MARKS \ | ||
84 | CVMX_ADD_IO_SEG(0x00014F0000000190ull) | ||
85 | #define CVMX_IPD_QOS4_RED_MARKS \ | ||
86 | CVMX_ADD_IO_SEG(0x00014F0000000198ull) | ||
87 | #define CVMX_IPD_QOS5_RED_MARKS \ | ||
88 | CVMX_ADD_IO_SEG(0x00014F00000001A0ull) | ||
89 | #define CVMX_IPD_QOS6_RED_MARKS \ | ||
90 | CVMX_ADD_IO_SEG(0x00014F00000001A8ull) | ||
91 | #define CVMX_IPD_QOS7_RED_MARKS \ | ||
92 | CVMX_ADD_IO_SEG(0x00014F00000001B0ull) | ||
93 | #define CVMX_IPD_QOSX_RED_MARKS(offset) \ | ||
94 | CVMX_ADD_IO_SEG(0x00014F0000000178ull + (((offset) & 7) * 8)) | ||
95 | #define CVMX_IPD_QUE0_FREE_PAGE_CNT \ | ||
96 | CVMX_ADD_IO_SEG(0x00014F0000000330ull) | ||
97 | #define CVMX_IPD_RED_PORT_ENABLE \ | ||
98 | CVMX_ADD_IO_SEG(0x00014F00000002D8ull) | ||
99 | #define CVMX_IPD_RED_PORT_ENABLE2 \ | ||
100 | CVMX_ADD_IO_SEG(0x00014F00000003A8ull) | ||
101 | #define CVMX_IPD_RED_QUE0_PARAM \ | ||
102 | CVMX_ADD_IO_SEG(0x00014F00000002E0ull) | ||
103 | #define CVMX_IPD_RED_QUE1_PARAM \ | ||
104 | CVMX_ADD_IO_SEG(0x00014F00000002E8ull) | ||
105 | #define CVMX_IPD_RED_QUE2_PARAM \ | ||
106 | CVMX_ADD_IO_SEG(0x00014F00000002F0ull) | ||
107 | #define CVMX_IPD_RED_QUE3_PARAM \ | ||
108 | CVMX_ADD_IO_SEG(0x00014F00000002F8ull) | ||
109 | #define CVMX_IPD_RED_QUE4_PARAM \ | ||
110 | CVMX_ADD_IO_SEG(0x00014F0000000300ull) | ||
111 | #define CVMX_IPD_RED_QUE5_PARAM \ | ||
112 | CVMX_ADD_IO_SEG(0x00014F0000000308ull) | ||
113 | #define CVMX_IPD_RED_QUE6_PARAM \ | ||
114 | CVMX_ADD_IO_SEG(0x00014F0000000310ull) | ||
115 | #define CVMX_IPD_RED_QUE7_PARAM \ | ||
116 | CVMX_ADD_IO_SEG(0x00014F0000000318ull) | ||
117 | #define CVMX_IPD_RED_QUEX_PARAM(offset) \ | ||
118 | CVMX_ADD_IO_SEG(0x00014F00000002E0ull + (((offset) & 7) * 8)) | ||
119 | #define CVMX_IPD_SUB_PORT_BP_PAGE_CNT \ | ||
120 | CVMX_ADD_IO_SEG(0x00014F0000000148ull) | ||
121 | #define CVMX_IPD_SUB_PORT_FCS \ | ||
122 | CVMX_ADD_IO_SEG(0x00014F0000000170ull) | ||
123 | #define CVMX_IPD_SUB_PORT_QOS_CNT \ | ||
124 | CVMX_ADD_IO_SEG(0x00014F0000000800ull) | ||
125 | #define CVMX_IPD_WQE_FPA_QUEUE \ | ||
126 | CVMX_ADD_IO_SEG(0x00014F0000000020ull) | ||
127 | #define CVMX_IPD_WQE_PTR_VALID \ | ||
128 | CVMX_ADD_IO_SEG(0x00014F0000000360ull) | ||
129 | |||
130 | union cvmx_ipd_1st_mbuff_skip { | ||
131 | uint64_t u64; | ||
132 | struct cvmx_ipd_1st_mbuff_skip_s { | ||
133 | uint64_t reserved_6_63:58; | ||
134 | uint64_t skip_sz:6; | ||
135 | } s; | ||
136 | struct cvmx_ipd_1st_mbuff_skip_s cn30xx; | ||
137 | struct cvmx_ipd_1st_mbuff_skip_s cn31xx; | ||
138 | struct cvmx_ipd_1st_mbuff_skip_s cn38xx; | ||
139 | struct cvmx_ipd_1st_mbuff_skip_s cn38xxp2; | ||
140 | struct cvmx_ipd_1st_mbuff_skip_s cn50xx; | ||
141 | struct cvmx_ipd_1st_mbuff_skip_s cn52xx; | ||
142 | struct cvmx_ipd_1st_mbuff_skip_s cn52xxp1; | ||
143 | struct cvmx_ipd_1st_mbuff_skip_s cn56xx; | ||
144 | struct cvmx_ipd_1st_mbuff_skip_s cn56xxp1; | ||
145 | struct cvmx_ipd_1st_mbuff_skip_s cn58xx; | ||
146 | struct cvmx_ipd_1st_mbuff_skip_s cn58xxp1; | ||
147 | }; | ||
148 | |||
149 | union cvmx_ipd_1st_next_ptr_back { | ||
150 | uint64_t u64; | ||
151 | struct cvmx_ipd_1st_next_ptr_back_s { | ||
152 | uint64_t reserved_4_63:60; | ||
153 | uint64_t back:4; | ||
154 | } s; | ||
155 | struct cvmx_ipd_1st_next_ptr_back_s cn30xx; | ||
156 | struct cvmx_ipd_1st_next_ptr_back_s cn31xx; | ||
157 | struct cvmx_ipd_1st_next_ptr_back_s cn38xx; | ||
158 | struct cvmx_ipd_1st_next_ptr_back_s cn38xxp2; | ||
159 | struct cvmx_ipd_1st_next_ptr_back_s cn50xx; | ||
160 | struct cvmx_ipd_1st_next_ptr_back_s cn52xx; | ||
161 | struct cvmx_ipd_1st_next_ptr_back_s cn52xxp1; | ||
162 | struct cvmx_ipd_1st_next_ptr_back_s cn56xx; | ||
163 | struct cvmx_ipd_1st_next_ptr_back_s cn56xxp1; | ||
164 | struct cvmx_ipd_1st_next_ptr_back_s cn58xx; | ||
165 | struct cvmx_ipd_1st_next_ptr_back_s cn58xxp1; | ||
166 | }; | ||
167 | |||
168 | union cvmx_ipd_2nd_next_ptr_back { | ||
169 | uint64_t u64; | ||
170 | struct cvmx_ipd_2nd_next_ptr_back_s { | ||
171 | uint64_t reserved_4_63:60; | ||
172 | uint64_t back:4; | ||
173 | } s; | ||
174 | struct cvmx_ipd_2nd_next_ptr_back_s cn30xx; | ||
175 | struct cvmx_ipd_2nd_next_ptr_back_s cn31xx; | ||
176 | struct cvmx_ipd_2nd_next_ptr_back_s cn38xx; | ||
177 | struct cvmx_ipd_2nd_next_ptr_back_s cn38xxp2; | ||
178 | struct cvmx_ipd_2nd_next_ptr_back_s cn50xx; | ||
179 | struct cvmx_ipd_2nd_next_ptr_back_s cn52xx; | ||
180 | struct cvmx_ipd_2nd_next_ptr_back_s cn52xxp1; | ||
181 | struct cvmx_ipd_2nd_next_ptr_back_s cn56xx; | ||
182 | struct cvmx_ipd_2nd_next_ptr_back_s cn56xxp1; | ||
183 | struct cvmx_ipd_2nd_next_ptr_back_s cn58xx; | ||
184 | struct cvmx_ipd_2nd_next_ptr_back_s cn58xxp1; | ||
185 | }; | ||
186 | |||
187 | union cvmx_ipd_bist_status { | ||
188 | uint64_t u64; | ||
189 | struct cvmx_ipd_bist_status_s { | ||
190 | uint64_t reserved_18_63:46; | ||
191 | uint64_t csr_mem:1; | ||
192 | uint64_t csr_ncmd:1; | ||
193 | uint64_t pwq_wqed:1; | ||
194 | uint64_t pwq_wp1:1; | ||
195 | uint64_t pwq_pow:1; | ||
196 | uint64_t ipq_pbe1:1; | ||
197 | uint64_t ipq_pbe0:1; | ||
198 | uint64_t pbm3:1; | ||
199 | uint64_t pbm2:1; | ||
200 | uint64_t pbm1:1; | ||
201 | uint64_t pbm0:1; | ||
202 | uint64_t pbm_word:1; | ||
203 | uint64_t pwq1:1; | ||
204 | uint64_t pwq0:1; | ||
205 | uint64_t prc_off:1; | ||
206 | uint64_t ipd_old:1; | ||
207 | uint64_t ipd_new:1; | ||
208 | uint64_t pwp:1; | ||
209 | } s; | ||
210 | struct cvmx_ipd_bist_status_cn30xx { | ||
211 | uint64_t reserved_16_63:48; | ||
212 | uint64_t pwq_wqed:1; | ||
213 | uint64_t pwq_wp1:1; | ||
214 | uint64_t pwq_pow:1; | ||
215 | uint64_t ipq_pbe1:1; | ||
216 | uint64_t ipq_pbe0:1; | ||
217 | uint64_t pbm3:1; | ||
218 | uint64_t pbm2:1; | ||
219 | uint64_t pbm1:1; | ||
220 | uint64_t pbm0:1; | ||
221 | uint64_t pbm_word:1; | ||
222 | uint64_t pwq1:1; | ||
223 | uint64_t pwq0:1; | ||
224 | uint64_t prc_off:1; | ||
225 | uint64_t ipd_old:1; | ||
226 | uint64_t ipd_new:1; | ||
227 | uint64_t pwp:1; | ||
228 | } cn30xx; | ||
229 | struct cvmx_ipd_bist_status_cn30xx cn31xx; | ||
230 | struct cvmx_ipd_bist_status_cn30xx cn38xx; | ||
231 | struct cvmx_ipd_bist_status_cn30xx cn38xxp2; | ||
232 | struct cvmx_ipd_bist_status_cn30xx cn50xx; | ||
233 | struct cvmx_ipd_bist_status_s cn52xx; | ||
234 | struct cvmx_ipd_bist_status_s cn52xxp1; | ||
235 | struct cvmx_ipd_bist_status_s cn56xx; | ||
236 | struct cvmx_ipd_bist_status_s cn56xxp1; | ||
237 | struct cvmx_ipd_bist_status_cn30xx cn58xx; | ||
238 | struct cvmx_ipd_bist_status_cn30xx cn58xxp1; | ||
239 | }; | ||
240 | |||
241 | union cvmx_ipd_bp_prt_red_end { | ||
242 | uint64_t u64; | ||
243 | struct cvmx_ipd_bp_prt_red_end_s { | ||
244 | uint64_t reserved_40_63:24; | ||
245 | uint64_t prt_enb:40; | ||
246 | } s; | ||
247 | struct cvmx_ipd_bp_prt_red_end_cn30xx { | ||
248 | uint64_t reserved_36_63:28; | ||
249 | uint64_t prt_enb:36; | ||
250 | } cn30xx; | ||
251 | struct cvmx_ipd_bp_prt_red_end_cn30xx cn31xx; | ||
252 | struct cvmx_ipd_bp_prt_red_end_cn30xx cn38xx; | ||
253 | struct cvmx_ipd_bp_prt_red_end_cn30xx cn38xxp2; | ||
254 | struct cvmx_ipd_bp_prt_red_end_cn30xx cn50xx; | ||
255 | struct cvmx_ipd_bp_prt_red_end_s cn52xx; | ||
256 | struct cvmx_ipd_bp_prt_red_end_s cn52xxp1; | ||
257 | struct cvmx_ipd_bp_prt_red_end_s cn56xx; | ||
258 | struct cvmx_ipd_bp_prt_red_end_s cn56xxp1; | ||
259 | struct cvmx_ipd_bp_prt_red_end_cn30xx cn58xx; | ||
260 | struct cvmx_ipd_bp_prt_red_end_cn30xx cn58xxp1; | ||
261 | }; | ||
262 | |||
263 | union cvmx_ipd_clk_count { | ||
264 | uint64_t u64; | ||
265 | struct cvmx_ipd_clk_count_s { | ||
266 | uint64_t clk_cnt:64; | ||
267 | } s; | ||
268 | struct cvmx_ipd_clk_count_s cn30xx; | ||
269 | struct cvmx_ipd_clk_count_s cn31xx; | ||
270 | struct cvmx_ipd_clk_count_s cn38xx; | ||
271 | struct cvmx_ipd_clk_count_s cn38xxp2; | ||
272 | struct cvmx_ipd_clk_count_s cn50xx; | ||
273 | struct cvmx_ipd_clk_count_s cn52xx; | ||
274 | struct cvmx_ipd_clk_count_s cn52xxp1; | ||
275 | struct cvmx_ipd_clk_count_s cn56xx; | ||
276 | struct cvmx_ipd_clk_count_s cn56xxp1; | ||
277 | struct cvmx_ipd_clk_count_s cn58xx; | ||
278 | struct cvmx_ipd_clk_count_s cn58xxp1; | ||
279 | }; | ||
280 | |||
281 | union cvmx_ipd_ctl_status { | ||
282 | uint64_t u64; | ||
283 | struct cvmx_ipd_ctl_status_s { | ||
284 | uint64_t reserved_15_63:49; | ||
285 | uint64_t no_wptr:1; | ||
286 | uint64_t pq_apkt:1; | ||
287 | uint64_t pq_nabuf:1; | ||
288 | uint64_t ipd_full:1; | ||
289 | uint64_t pkt_off:1; | ||
290 | uint64_t len_m8:1; | ||
291 | uint64_t reset:1; | ||
292 | uint64_t addpkt:1; | ||
293 | uint64_t naddbuf:1; | ||
294 | uint64_t pkt_lend:1; | ||
295 | uint64_t wqe_lend:1; | ||
296 | uint64_t pbp_en:1; | ||
297 | uint64_t opc_mode:2; | ||
298 | uint64_t ipd_en:1; | ||
299 | } s; | ||
300 | struct cvmx_ipd_ctl_status_cn30xx { | ||
301 | uint64_t reserved_10_63:54; | ||
302 | uint64_t len_m8:1; | ||
303 | uint64_t reset:1; | ||
304 | uint64_t addpkt:1; | ||
305 | uint64_t naddbuf:1; | ||
306 | uint64_t pkt_lend:1; | ||
307 | uint64_t wqe_lend:1; | ||
308 | uint64_t pbp_en:1; | ||
309 | uint64_t opc_mode:2; | ||
310 | uint64_t ipd_en:1; | ||
311 | } cn30xx; | ||
312 | struct cvmx_ipd_ctl_status_cn30xx cn31xx; | ||
313 | struct cvmx_ipd_ctl_status_cn30xx cn38xx; | ||
314 | struct cvmx_ipd_ctl_status_cn38xxp2 { | ||
315 | uint64_t reserved_9_63:55; | ||
316 | uint64_t reset:1; | ||
317 | uint64_t addpkt:1; | ||
318 | uint64_t naddbuf:1; | ||
319 | uint64_t pkt_lend:1; | ||
320 | uint64_t wqe_lend:1; | ||
321 | uint64_t pbp_en:1; | ||
322 | uint64_t opc_mode:2; | ||
323 | uint64_t ipd_en:1; | ||
324 | } cn38xxp2; | ||
325 | struct cvmx_ipd_ctl_status_s cn50xx; | ||
326 | struct cvmx_ipd_ctl_status_s cn52xx; | ||
327 | struct cvmx_ipd_ctl_status_s cn52xxp1; | ||
328 | struct cvmx_ipd_ctl_status_s cn56xx; | ||
329 | struct cvmx_ipd_ctl_status_s cn56xxp1; | ||
330 | struct cvmx_ipd_ctl_status_cn58xx { | ||
331 | uint64_t reserved_12_63:52; | ||
332 | uint64_t ipd_full:1; | ||
333 | uint64_t pkt_off:1; | ||
334 | uint64_t len_m8:1; | ||
335 | uint64_t reset:1; | ||
336 | uint64_t addpkt:1; | ||
337 | uint64_t naddbuf:1; | ||
338 | uint64_t pkt_lend:1; | ||
339 | uint64_t wqe_lend:1; | ||
340 | uint64_t pbp_en:1; | ||
341 | uint64_t opc_mode:2; | ||
342 | uint64_t ipd_en:1; | ||
343 | } cn58xx; | ||
344 | struct cvmx_ipd_ctl_status_cn58xx cn58xxp1; | ||
345 | }; | ||
346 | |||
347 | union cvmx_ipd_int_enb { | ||
348 | uint64_t u64; | ||
349 | struct cvmx_ipd_int_enb_s { | ||
350 | uint64_t reserved_12_63:52; | ||
351 | uint64_t pq_sub:1; | ||
352 | uint64_t pq_add:1; | ||
353 | uint64_t bc_ovr:1; | ||
354 | uint64_t d_coll:1; | ||
355 | uint64_t c_coll:1; | ||
356 | uint64_t cc_ovr:1; | ||
357 | uint64_t dc_ovr:1; | ||
358 | uint64_t bp_sub:1; | ||
359 | uint64_t prc_par3:1; | ||
360 | uint64_t prc_par2:1; | ||
361 | uint64_t prc_par1:1; | ||
362 | uint64_t prc_par0:1; | ||
363 | } s; | ||
364 | struct cvmx_ipd_int_enb_cn30xx { | ||
365 | uint64_t reserved_5_63:59; | ||
366 | uint64_t bp_sub:1; | ||
367 | uint64_t prc_par3:1; | ||
368 | uint64_t prc_par2:1; | ||
369 | uint64_t prc_par1:1; | ||
370 | uint64_t prc_par0:1; | ||
371 | } cn30xx; | ||
372 | struct cvmx_ipd_int_enb_cn30xx cn31xx; | ||
373 | struct cvmx_ipd_int_enb_cn38xx { | ||
374 | uint64_t reserved_10_63:54; | ||
375 | uint64_t bc_ovr:1; | ||
376 | uint64_t d_coll:1; | ||
377 | uint64_t c_coll:1; | ||
378 | uint64_t cc_ovr:1; | ||
379 | uint64_t dc_ovr:1; | ||
380 | uint64_t bp_sub:1; | ||
381 | uint64_t prc_par3:1; | ||
382 | uint64_t prc_par2:1; | ||
383 | uint64_t prc_par1:1; | ||
384 | uint64_t prc_par0:1; | ||
385 | } cn38xx; | ||
386 | struct cvmx_ipd_int_enb_cn30xx cn38xxp2; | ||
387 | struct cvmx_ipd_int_enb_cn38xx cn50xx; | ||
388 | struct cvmx_ipd_int_enb_s cn52xx; | ||
389 | struct cvmx_ipd_int_enb_s cn52xxp1; | ||
390 | struct cvmx_ipd_int_enb_s cn56xx; | ||
391 | struct cvmx_ipd_int_enb_s cn56xxp1; | ||
392 | struct cvmx_ipd_int_enb_cn38xx cn58xx; | ||
393 | struct cvmx_ipd_int_enb_cn38xx cn58xxp1; | ||
394 | }; | ||
395 | |||
396 | union cvmx_ipd_int_sum { | ||
397 | uint64_t u64; | ||
398 | struct cvmx_ipd_int_sum_s { | ||
399 | uint64_t reserved_12_63:52; | ||
400 | uint64_t pq_sub:1; | ||
401 | uint64_t pq_add:1; | ||
402 | uint64_t bc_ovr:1; | ||
403 | uint64_t d_coll:1; | ||
404 | uint64_t c_coll:1; | ||
405 | uint64_t cc_ovr:1; | ||
406 | uint64_t dc_ovr:1; | ||
407 | uint64_t bp_sub:1; | ||
408 | uint64_t prc_par3:1; | ||
409 | uint64_t prc_par2:1; | ||
410 | uint64_t prc_par1:1; | ||
411 | uint64_t prc_par0:1; | ||
412 | } s; | ||
413 | struct cvmx_ipd_int_sum_cn30xx { | ||
414 | uint64_t reserved_5_63:59; | ||
415 | uint64_t bp_sub:1; | ||
416 | uint64_t prc_par3:1; | ||
417 | uint64_t prc_par2:1; | ||
418 | uint64_t prc_par1:1; | ||
419 | uint64_t prc_par0:1; | ||
420 | } cn30xx; | ||
421 | struct cvmx_ipd_int_sum_cn30xx cn31xx; | ||
422 | struct cvmx_ipd_int_sum_cn38xx { | ||
423 | uint64_t reserved_10_63:54; | ||
424 | uint64_t bc_ovr:1; | ||
425 | uint64_t d_coll:1; | ||
426 | uint64_t c_coll:1; | ||
427 | uint64_t cc_ovr:1; | ||
428 | uint64_t dc_ovr:1; | ||
429 | uint64_t bp_sub:1; | ||
430 | uint64_t prc_par3:1; | ||
431 | uint64_t prc_par2:1; | ||
432 | uint64_t prc_par1:1; | ||
433 | uint64_t prc_par0:1; | ||
434 | } cn38xx; | ||
435 | struct cvmx_ipd_int_sum_cn30xx cn38xxp2; | ||
436 | struct cvmx_ipd_int_sum_cn38xx cn50xx; | ||
437 | struct cvmx_ipd_int_sum_s cn52xx; | ||
438 | struct cvmx_ipd_int_sum_s cn52xxp1; | ||
439 | struct cvmx_ipd_int_sum_s cn56xx; | ||
440 | struct cvmx_ipd_int_sum_s cn56xxp1; | ||
441 | struct cvmx_ipd_int_sum_cn38xx cn58xx; | ||
442 | struct cvmx_ipd_int_sum_cn38xx cn58xxp1; | ||
443 | }; | ||
444 | |||
445 | union cvmx_ipd_not_1st_mbuff_skip { | ||
446 | uint64_t u64; | ||
447 | struct cvmx_ipd_not_1st_mbuff_skip_s { | ||
448 | uint64_t reserved_6_63:58; | ||
449 | uint64_t skip_sz:6; | ||
450 | } s; | ||
451 | struct cvmx_ipd_not_1st_mbuff_skip_s cn30xx; | ||
452 | struct cvmx_ipd_not_1st_mbuff_skip_s cn31xx; | ||
453 | struct cvmx_ipd_not_1st_mbuff_skip_s cn38xx; | ||
454 | struct cvmx_ipd_not_1st_mbuff_skip_s cn38xxp2; | ||
455 | struct cvmx_ipd_not_1st_mbuff_skip_s cn50xx; | ||
456 | struct cvmx_ipd_not_1st_mbuff_skip_s cn52xx; | ||
457 | struct cvmx_ipd_not_1st_mbuff_skip_s cn52xxp1; | ||
458 | struct cvmx_ipd_not_1st_mbuff_skip_s cn56xx; | ||
459 | struct cvmx_ipd_not_1st_mbuff_skip_s cn56xxp1; | ||
460 | struct cvmx_ipd_not_1st_mbuff_skip_s cn58xx; | ||
461 | struct cvmx_ipd_not_1st_mbuff_skip_s cn58xxp1; | ||
462 | }; | ||
463 | |||
464 | union cvmx_ipd_packet_mbuff_size { | ||
465 | uint64_t u64; | ||
466 | struct cvmx_ipd_packet_mbuff_size_s { | ||
467 | uint64_t reserved_12_63:52; | ||
468 | uint64_t mb_size:12; | ||
469 | } s; | ||
470 | struct cvmx_ipd_packet_mbuff_size_s cn30xx; | ||
471 | struct cvmx_ipd_packet_mbuff_size_s cn31xx; | ||
472 | struct cvmx_ipd_packet_mbuff_size_s cn38xx; | ||
473 | struct cvmx_ipd_packet_mbuff_size_s cn38xxp2; | ||
474 | struct cvmx_ipd_packet_mbuff_size_s cn50xx; | ||
475 | struct cvmx_ipd_packet_mbuff_size_s cn52xx; | ||
476 | struct cvmx_ipd_packet_mbuff_size_s cn52xxp1; | ||
477 | struct cvmx_ipd_packet_mbuff_size_s cn56xx; | ||
478 | struct cvmx_ipd_packet_mbuff_size_s cn56xxp1; | ||
479 | struct cvmx_ipd_packet_mbuff_size_s cn58xx; | ||
480 | struct cvmx_ipd_packet_mbuff_size_s cn58xxp1; | ||
481 | }; | ||
482 | |||
483 | union cvmx_ipd_pkt_ptr_valid { | ||
484 | uint64_t u64; | ||
485 | struct cvmx_ipd_pkt_ptr_valid_s { | ||
486 | uint64_t reserved_29_63:35; | ||
487 | uint64_t ptr:29; | ||
488 | } s; | ||
489 | struct cvmx_ipd_pkt_ptr_valid_s cn30xx; | ||
490 | struct cvmx_ipd_pkt_ptr_valid_s cn31xx; | ||
491 | struct cvmx_ipd_pkt_ptr_valid_s cn38xx; | ||
492 | struct cvmx_ipd_pkt_ptr_valid_s cn50xx; | ||
493 | struct cvmx_ipd_pkt_ptr_valid_s cn52xx; | ||
494 | struct cvmx_ipd_pkt_ptr_valid_s cn52xxp1; | ||
495 | struct cvmx_ipd_pkt_ptr_valid_s cn56xx; | ||
496 | struct cvmx_ipd_pkt_ptr_valid_s cn56xxp1; | ||
497 | struct cvmx_ipd_pkt_ptr_valid_s cn58xx; | ||
498 | struct cvmx_ipd_pkt_ptr_valid_s cn58xxp1; | ||
499 | }; | ||
500 | |||
501 | union cvmx_ipd_portx_bp_page_cnt { | ||
502 | uint64_t u64; | ||
503 | struct cvmx_ipd_portx_bp_page_cnt_s { | ||
504 | uint64_t reserved_18_63:46; | ||
505 | uint64_t bp_enb:1; | ||
506 | uint64_t page_cnt:17; | ||
507 | } s; | ||
508 | struct cvmx_ipd_portx_bp_page_cnt_s cn30xx; | ||
509 | struct cvmx_ipd_portx_bp_page_cnt_s cn31xx; | ||
510 | struct cvmx_ipd_portx_bp_page_cnt_s cn38xx; | ||
511 | struct cvmx_ipd_portx_bp_page_cnt_s cn38xxp2; | ||
512 | struct cvmx_ipd_portx_bp_page_cnt_s cn50xx; | ||
513 | struct cvmx_ipd_portx_bp_page_cnt_s cn52xx; | ||
514 | struct cvmx_ipd_portx_bp_page_cnt_s cn52xxp1; | ||
515 | struct cvmx_ipd_portx_bp_page_cnt_s cn56xx; | ||
516 | struct cvmx_ipd_portx_bp_page_cnt_s cn56xxp1; | ||
517 | struct cvmx_ipd_portx_bp_page_cnt_s cn58xx; | ||
518 | struct cvmx_ipd_portx_bp_page_cnt_s cn58xxp1; | ||
519 | }; | ||
520 | |||
521 | union cvmx_ipd_portx_bp_page_cnt2 { | ||
522 | uint64_t u64; | ||
523 | struct cvmx_ipd_portx_bp_page_cnt2_s { | ||
524 | uint64_t reserved_18_63:46; | ||
525 | uint64_t bp_enb:1; | ||
526 | uint64_t page_cnt:17; | ||
527 | } s; | ||
528 | struct cvmx_ipd_portx_bp_page_cnt2_s cn52xx; | ||
529 | struct cvmx_ipd_portx_bp_page_cnt2_s cn52xxp1; | ||
530 | struct cvmx_ipd_portx_bp_page_cnt2_s cn56xx; | ||
531 | struct cvmx_ipd_portx_bp_page_cnt2_s cn56xxp1; | ||
532 | }; | ||
533 | |||
534 | union cvmx_ipd_port_bp_counters2_pairx { | ||
535 | uint64_t u64; | ||
536 | struct cvmx_ipd_port_bp_counters2_pairx_s { | ||
537 | uint64_t reserved_25_63:39; | ||
538 | uint64_t cnt_val:25; | ||
539 | } s; | ||
540 | struct cvmx_ipd_port_bp_counters2_pairx_s cn52xx; | ||
541 | struct cvmx_ipd_port_bp_counters2_pairx_s cn52xxp1; | ||
542 | struct cvmx_ipd_port_bp_counters2_pairx_s cn56xx; | ||
543 | struct cvmx_ipd_port_bp_counters2_pairx_s cn56xxp1; | ||
544 | }; | ||
545 | |||
546 | union cvmx_ipd_port_bp_counters_pairx { | ||
547 | uint64_t u64; | ||
548 | struct cvmx_ipd_port_bp_counters_pairx_s { | ||
549 | uint64_t reserved_25_63:39; | ||
550 | uint64_t cnt_val:25; | ||
551 | } s; | ||
552 | struct cvmx_ipd_port_bp_counters_pairx_s cn30xx; | ||
553 | struct cvmx_ipd_port_bp_counters_pairx_s cn31xx; | ||
554 | struct cvmx_ipd_port_bp_counters_pairx_s cn38xx; | ||
555 | struct cvmx_ipd_port_bp_counters_pairx_s cn38xxp2; | ||
556 | struct cvmx_ipd_port_bp_counters_pairx_s cn50xx; | ||
557 | struct cvmx_ipd_port_bp_counters_pairx_s cn52xx; | ||
558 | struct cvmx_ipd_port_bp_counters_pairx_s cn52xxp1; | ||
559 | struct cvmx_ipd_port_bp_counters_pairx_s cn56xx; | ||
560 | struct cvmx_ipd_port_bp_counters_pairx_s cn56xxp1; | ||
561 | struct cvmx_ipd_port_bp_counters_pairx_s cn58xx; | ||
562 | struct cvmx_ipd_port_bp_counters_pairx_s cn58xxp1; | ||
563 | }; | ||
564 | |||
565 | union cvmx_ipd_port_qos_x_cnt { | ||
566 | uint64_t u64; | ||
567 | struct cvmx_ipd_port_qos_x_cnt_s { | ||
568 | uint64_t wmark:32; | ||
569 | uint64_t cnt:32; | ||
570 | } s; | ||
571 | struct cvmx_ipd_port_qos_x_cnt_s cn52xx; | ||
572 | struct cvmx_ipd_port_qos_x_cnt_s cn52xxp1; | ||
573 | struct cvmx_ipd_port_qos_x_cnt_s cn56xx; | ||
574 | struct cvmx_ipd_port_qos_x_cnt_s cn56xxp1; | ||
575 | }; | ||
576 | |||
577 | union cvmx_ipd_port_qos_intx { | ||
578 | uint64_t u64; | ||
579 | struct cvmx_ipd_port_qos_intx_s { | ||
580 | uint64_t intr:64; | ||
581 | } s; | ||
582 | struct cvmx_ipd_port_qos_intx_s cn52xx; | ||
583 | struct cvmx_ipd_port_qos_intx_s cn52xxp1; | ||
584 | struct cvmx_ipd_port_qos_intx_s cn56xx; | ||
585 | struct cvmx_ipd_port_qos_intx_s cn56xxp1; | ||
586 | }; | ||
587 | |||
588 | union cvmx_ipd_port_qos_int_enbx { | ||
589 | uint64_t u64; | ||
590 | struct cvmx_ipd_port_qos_int_enbx_s { | ||
591 | uint64_t enb:64; | ||
592 | } s; | ||
593 | struct cvmx_ipd_port_qos_int_enbx_s cn52xx; | ||
594 | struct cvmx_ipd_port_qos_int_enbx_s cn52xxp1; | ||
595 | struct cvmx_ipd_port_qos_int_enbx_s cn56xx; | ||
596 | struct cvmx_ipd_port_qos_int_enbx_s cn56xxp1; | ||
597 | }; | ||
598 | |||
599 | union cvmx_ipd_prc_hold_ptr_fifo_ctl { | ||
600 | uint64_t u64; | ||
601 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s { | ||
602 | uint64_t reserved_39_63:25; | ||
603 | uint64_t max_pkt:3; | ||
604 | uint64_t praddr:3; | ||
605 | uint64_t ptr:29; | ||
606 | uint64_t cena:1; | ||
607 | uint64_t raddr:3; | ||
608 | } s; | ||
609 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn30xx; | ||
610 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn31xx; | ||
611 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn38xx; | ||
612 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn50xx; | ||
613 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn52xx; | ||
614 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn52xxp1; | ||
615 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn56xx; | ||
616 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn56xxp1; | ||
617 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn58xx; | ||
618 | struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn58xxp1; | ||
619 | }; | ||
620 | |||
621 | union cvmx_ipd_prc_port_ptr_fifo_ctl { | ||
622 | uint64_t u64; | ||
623 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s { | ||
624 | uint64_t reserved_44_63:20; | ||
625 | uint64_t max_pkt:7; | ||
626 | uint64_t ptr:29; | ||
627 | uint64_t cena:1; | ||
628 | uint64_t raddr:7; | ||
629 | } s; | ||
630 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn30xx; | ||
631 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn31xx; | ||
632 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn38xx; | ||
633 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn50xx; | ||
634 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn52xx; | ||
635 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn52xxp1; | ||
636 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn56xx; | ||
637 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn56xxp1; | ||
638 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn58xx; | ||
639 | struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn58xxp1; | ||
640 | }; | ||
641 | |||
642 | union cvmx_ipd_ptr_count { | ||
643 | uint64_t u64; | ||
644 | struct cvmx_ipd_ptr_count_s { | ||
645 | uint64_t reserved_19_63:45; | ||
646 | uint64_t pktv_cnt:1; | ||
647 | uint64_t wqev_cnt:1; | ||
648 | uint64_t pfif_cnt:3; | ||
649 | uint64_t pkt_pcnt:7; | ||
650 | uint64_t wqe_pcnt:7; | ||
651 | } s; | ||
652 | struct cvmx_ipd_ptr_count_s cn30xx; | ||
653 | struct cvmx_ipd_ptr_count_s cn31xx; | ||
654 | struct cvmx_ipd_ptr_count_s cn38xx; | ||
655 | struct cvmx_ipd_ptr_count_s cn38xxp2; | ||
656 | struct cvmx_ipd_ptr_count_s cn50xx; | ||
657 | struct cvmx_ipd_ptr_count_s cn52xx; | ||
658 | struct cvmx_ipd_ptr_count_s cn52xxp1; | ||
659 | struct cvmx_ipd_ptr_count_s cn56xx; | ||
660 | struct cvmx_ipd_ptr_count_s cn56xxp1; | ||
661 | struct cvmx_ipd_ptr_count_s cn58xx; | ||
662 | struct cvmx_ipd_ptr_count_s cn58xxp1; | ||
663 | }; | ||
664 | |||
665 | union cvmx_ipd_pwp_ptr_fifo_ctl { | ||
666 | uint64_t u64; | ||
667 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s { | ||
668 | uint64_t reserved_61_63:3; | ||
669 | uint64_t max_cnts:7; | ||
670 | uint64_t wraddr:8; | ||
671 | uint64_t praddr:8; | ||
672 | uint64_t ptr:29; | ||
673 | uint64_t cena:1; | ||
674 | uint64_t raddr:8; | ||
675 | } s; | ||
676 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn30xx; | ||
677 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn31xx; | ||
678 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn38xx; | ||
679 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn50xx; | ||
680 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn52xx; | ||
681 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn52xxp1; | ||
682 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn56xx; | ||
683 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn56xxp1; | ||
684 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn58xx; | ||
685 | struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn58xxp1; | ||
686 | }; | ||
687 | |||
688 | union cvmx_ipd_qosx_red_marks { | ||
689 | uint64_t u64; | ||
690 | struct cvmx_ipd_qosx_red_marks_s { | ||
691 | uint64_t drop:32; | ||
692 | uint64_t pass:32; | ||
693 | } s; | ||
694 | struct cvmx_ipd_qosx_red_marks_s cn30xx; | ||
695 | struct cvmx_ipd_qosx_red_marks_s cn31xx; | ||
696 | struct cvmx_ipd_qosx_red_marks_s cn38xx; | ||
697 | struct cvmx_ipd_qosx_red_marks_s cn38xxp2; | ||
698 | struct cvmx_ipd_qosx_red_marks_s cn50xx; | ||
699 | struct cvmx_ipd_qosx_red_marks_s cn52xx; | ||
700 | struct cvmx_ipd_qosx_red_marks_s cn52xxp1; | ||
701 | struct cvmx_ipd_qosx_red_marks_s cn56xx; | ||
702 | struct cvmx_ipd_qosx_red_marks_s cn56xxp1; | ||
703 | struct cvmx_ipd_qosx_red_marks_s cn58xx; | ||
704 | struct cvmx_ipd_qosx_red_marks_s cn58xxp1; | ||
705 | }; | ||
706 | |||
707 | union cvmx_ipd_que0_free_page_cnt { | ||
708 | uint64_t u64; | ||
709 | struct cvmx_ipd_que0_free_page_cnt_s { | ||
710 | uint64_t reserved_32_63:32; | ||
711 | uint64_t q0_pcnt:32; | ||
712 | } s; | ||
713 | struct cvmx_ipd_que0_free_page_cnt_s cn30xx; | ||
714 | struct cvmx_ipd_que0_free_page_cnt_s cn31xx; | ||
715 | struct cvmx_ipd_que0_free_page_cnt_s cn38xx; | ||
716 | struct cvmx_ipd_que0_free_page_cnt_s cn38xxp2; | ||
717 | struct cvmx_ipd_que0_free_page_cnt_s cn50xx; | ||
718 | struct cvmx_ipd_que0_free_page_cnt_s cn52xx; | ||
719 | struct cvmx_ipd_que0_free_page_cnt_s cn52xxp1; | ||
720 | struct cvmx_ipd_que0_free_page_cnt_s cn56xx; | ||
721 | struct cvmx_ipd_que0_free_page_cnt_s cn56xxp1; | ||
722 | struct cvmx_ipd_que0_free_page_cnt_s cn58xx; | ||
723 | struct cvmx_ipd_que0_free_page_cnt_s cn58xxp1; | ||
724 | }; | ||
725 | |||
726 | union cvmx_ipd_red_port_enable { | ||
727 | uint64_t u64; | ||
728 | struct cvmx_ipd_red_port_enable_s { | ||
729 | uint64_t prb_dly:14; | ||
730 | uint64_t avg_dly:14; | ||
731 | uint64_t prt_enb:36; | ||
732 | } s; | ||
733 | struct cvmx_ipd_red_port_enable_s cn30xx; | ||
734 | struct cvmx_ipd_red_port_enable_s cn31xx; | ||
735 | struct cvmx_ipd_red_port_enable_s cn38xx; | ||
736 | struct cvmx_ipd_red_port_enable_s cn38xxp2; | ||
737 | struct cvmx_ipd_red_port_enable_s cn50xx; | ||
738 | struct cvmx_ipd_red_port_enable_s cn52xx; | ||
739 | struct cvmx_ipd_red_port_enable_s cn52xxp1; | ||
740 | struct cvmx_ipd_red_port_enable_s cn56xx; | ||
741 | struct cvmx_ipd_red_port_enable_s cn56xxp1; | ||
742 | struct cvmx_ipd_red_port_enable_s cn58xx; | ||
743 | struct cvmx_ipd_red_port_enable_s cn58xxp1; | ||
744 | }; | ||
745 | |||
746 | union cvmx_ipd_red_port_enable2 { | ||
747 | uint64_t u64; | ||
748 | struct cvmx_ipd_red_port_enable2_s { | ||
749 | uint64_t reserved_4_63:60; | ||
750 | uint64_t prt_enb:4; | ||
751 | } s; | ||
752 | struct cvmx_ipd_red_port_enable2_s cn52xx; | ||
753 | struct cvmx_ipd_red_port_enable2_s cn52xxp1; | ||
754 | struct cvmx_ipd_red_port_enable2_s cn56xx; | ||
755 | struct cvmx_ipd_red_port_enable2_s cn56xxp1; | ||
756 | }; | ||
757 | |||
758 | union cvmx_ipd_red_quex_param { | ||
759 | uint64_t u64; | ||
760 | struct cvmx_ipd_red_quex_param_s { | ||
761 | uint64_t reserved_49_63:15; | ||
762 | uint64_t use_pcnt:1; | ||
763 | uint64_t new_con:8; | ||
764 | uint64_t avg_con:8; | ||
765 | uint64_t prb_con:32; | ||
766 | } s; | ||
767 | struct cvmx_ipd_red_quex_param_s cn30xx; | ||
768 | struct cvmx_ipd_red_quex_param_s cn31xx; | ||
769 | struct cvmx_ipd_red_quex_param_s cn38xx; | ||
770 | struct cvmx_ipd_red_quex_param_s cn38xxp2; | ||
771 | struct cvmx_ipd_red_quex_param_s cn50xx; | ||
772 | struct cvmx_ipd_red_quex_param_s cn52xx; | ||
773 | struct cvmx_ipd_red_quex_param_s cn52xxp1; | ||
774 | struct cvmx_ipd_red_quex_param_s cn56xx; | ||
775 | struct cvmx_ipd_red_quex_param_s cn56xxp1; | ||
776 | struct cvmx_ipd_red_quex_param_s cn58xx; | ||
777 | struct cvmx_ipd_red_quex_param_s cn58xxp1; | ||
778 | }; | ||
779 | |||
780 | union cvmx_ipd_sub_port_bp_page_cnt { | ||
781 | uint64_t u64; | ||
782 | struct cvmx_ipd_sub_port_bp_page_cnt_s { | ||
783 | uint64_t reserved_31_63:33; | ||
784 | uint64_t port:6; | ||
785 | uint64_t page_cnt:25; | ||
786 | } s; | ||
787 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn30xx; | ||
788 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn31xx; | ||
789 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn38xx; | ||
790 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn38xxp2; | ||
791 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn50xx; | ||
792 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn52xx; | ||
793 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn52xxp1; | ||
794 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn56xx; | ||
795 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn56xxp1; | ||
796 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn58xx; | ||
797 | struct cvmx_ipd_sub_port_bp_page_cnt_s cn58xxp1; | ||
798 | }; | ||
799 | |||
800 | union cvmx_ipd_sub_port_fcs { | ||
801 | uint64_t u64; | ||
802 | struct cvmx_ipd_sub_port_fcs_s { | ||
803 | uint64_t reserved_40_63:24; | ||
804 | uint64_t port_bit2:4; | ||
805 | uint64_t reserved_32_35:4; | ||
806 | uint64_t port_bit:32; | ||
807 | } s; | ||
808 | struct cvmx_ipd_sub_port_fcs_cn30xx { | ||
809 | uint64_t reserved_3_63:61; | ||
810 | uint64_t port_bit:3; | ||
811 | } cn30xx; | ||
812 | struct cvmx_ipd_sub_port_fcs_cn30xx cn31xx; | ||
813 | struct cvmx_ipd_sub_port_fcs_cn38xx { | ||
814 | uint64_t reserved_32_63:32; | ||
815 | uint64_t port_bit:32; | ||
816 | } cn38xx; | ||
817 | struct cvmx_ipd_sub_port_fcs_cn38xx cn38xxp2; | ||
818 | struct cvmx_ipd_sub_port_fcs_cn30xx cn50xx; | ||
819 | struct cvmx_ipd_sub_port_fcs_s cn52xx; | ||
820 | struct cvmx_ipd_sub_port_fcs_s cn52xxp1; | ||
821 | struct cvmx_ipd_sub_port_fcs_s cn56xx; | ||
822 | struct cvmx_ipd_sub_port_fcs_s cn56xxp1; | ||
823 | struct cvmx_ipd_sub_port_fcs_cn38xx cn58xx; | ||
824 | struct cvmx_ipd_sub_port_fcs_cn38xx cn58xxp1; | ||
825 | }; | ||
826 | |||
827 | union cvmx_ipd_sub_port_qos_cnt { | ||
828 | uint64_t u64; | ||
829 | struct cvmx_ipd_sub_port_qos_cnt_s { | ||
830 | uint64_t reserved_41_63:23; | ||
831 | uint64_t port_qos:9; | ||
832 | uint64_t cnt:32; | ||
833 | } s; | ||
834 | struct cvmx_ipd_sub_port_qos_cnt_s cn52xx; | ||
835 | struct cvmx_ipd_sub_port_qos_cnt_s cn52xxp1; | ||
836 | struct cvmx_ipd_sub_port_qos_cnt_s cn56xx; | ||
837 | struct cvmx_ipd_sub_port_qos_cnt_s cn56xxp1; | ||
838 | }; | ||
839 | |||
840 | union cvmx_ipd_wqe_fpa_queue { | ||
841 | uint64_t u64; | ||
842 | struct cvmx_ipd_wqe_fpa_queue_s { | ||
843 | uint64_t reserved_3_63:61; | ||
844 | uint64_t wqe_pool:3; | ||
845 | } s; | ||
846 | struct cvmx_ipd_wqe_fpa_queue_s cn30xx; | ||
847 | struct cvmx_ipd_wqe_fpa_queue_s cn31xx; | ||
848 | struct cvmx_ipd_wqe_fpa_queue_s cn38xx; | ||
849 | struct cvmx_ipd_wqe_fpa_queue_s cn38xxp2; | ||
850 | struct cvmx_ipd_wqe_fpa_queue_s cn50xx; | ||
851 | struct cvmx_ipd_wqe_fpa_queue_s cn52xx; | ||
852 | struct cvmx_ipd_wqe_fpa_queue_s cn52xxp1; | ||
853 | struct cvmx_ipd_wqe_fpa_queue_s cn56xx; | ||
854 | struct cvmx_ipd_wqe_fpa_queue_s cn56xxp1; | ||
855 | struct cvmx_ipd_wqe_fpa_queue_s cn58xx; | ||
856 | struct cvmx_ipd_wqe_fpa_queue_s cn58xxp1; | ||
857 | }; | ||
858 | |||
859 | union cvmx_ipd_wqe_ptr_valid { | ||
860 | uint64_t u64; | ||
861 | struct cvmx_ipd_wqe_ptr_valid_s { | ||
862 | uint64_t reserved_29_63:35; | ||
863 | uint64_t ptr:29; | ||
864 | } s; | ||
865 | struct cvmx_ipd_wqe_ptr_valid_s cn30xx; | ||
866 | struct cvmx_ipd_wqe_ptr_valid_s cn31xx; | ||
867 | struct cvmx_ipd_wqe_ptr_valid_s cn38xx; | ||
868 | struct cvmx_ipd_wqe_ptr_valid_s cn50xx; | ||
869 | struct cvmx_ipd_wqe_ptr_valid_s cn52xx; | ||
870 | struct cvmx_ipd_wqe_ptr_valid_s cn52xxp1; | ||
871 | struct cvmx_ipd_wqe_ptr_valid_s cn56xx; | ||
872 | struct cvmx_ipd_wqe_ptr_valid_s cn56xxp1; | ||
873 | struct cvmx_ipd_wqe_ptr_valid_s cn58xx; | ||
874 | struct cvmx_ipd_wqe_ptr_valid_s cn58xxp1; | ||
875 | }; | ||
876 | |||
877 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-l2c-defs.h b/arch/mips/include/asm/octeon/cvmx-l2c-defs.h new file mode 100644 index 000000000000..337583842b51 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-l2c-defs.h | |||
@@ -0,0 +1,963 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_L2C_DEFS_H__ | ||
29 | #define __CVMX_L2C_DEFS_H__ | ||
30 | |||
31 | #define CVMX_L2C_BST0 \ | ||
32 | CVMX_ADD_IO_SEG(0x00011800800007F8ull) | ||
33 | #define CVMX_L2C_BST1 \ | ||
34 | CVMX_ADD_IO_SEG(0x00011800800007F0ull) | ||
35 | #define CVMX_L2C_BST2 \ | ||
36 | CVMX_ADD_IO_SEG(0x00011800800007E8ull) | ||
37 | #define CVMX_L2C_CFG \ | ||
38 | CVMX_ADD_IO_SEG(0x0001180080000000ull) | ||
39 | #define CVMX_L2C_DBG \ | ||
40 | CVMX_ADD_IO_SEG(0x0001180080000030ull) | ||
41 | #define CVMX_L2C_DUT \ | ||
42 | CVMX_ADD_IO_SEG(0x0001180080000050ull) | ||
43 | #define CVMX_L2C_GRPWRR0 \ | ||
44 | CVMX_ADD_IO_SEG(0x00011800800000C8ull) | ||
45 | #define CVMX_L2C_GRPWRR1 \ | ||
46 | CVMX_ADD_IO_SEG(0x00011800800000D0ull) | ||
47 | #define CVMX_L2C_INT_EN \ | ||
48 | CVMX_ADD_IO_SEG(0x0001180080000100ull) | ||
49 | #define CVMX_L2C_INT_STAT \ | ||
50 | CVMX_ADD_IO_SEG(0x00011800800000F8ull) | ||
51 | #define CVMX_L2C_LCKBASE \ | ||
52 | CVMX_ADD_IO_SEG(0x0001180080000058ull) | ||
53 | #define CVMX_L2C_LCKOFF \ | ||
54 | CVMX_ADD_IO_SEG(0x0001180080000060ull) | ||
55 | #define CVMX_L2C_LFB0 \ | ||
56 | CVMX_ADD_IO_SEG(0x0001180080000038ull) | ||
57 | #define CVMX_L2C_LFB1 \ | ||
58 | CVMX_ADD_IO_SEG(0x0001180080000040ull) | ||
59 | #define CVMX_L2C_LFB2 \ | ||
60 | CVMX_ADD_IO_SEG(0x0001180080000048ull) | ||
61 | #define CVMX_L2C_LFB3 \ | ||
62 | CVMX_ADD_IO_SEG(0x00011800800000B8ull) | ||
63 | #define CVMX_L2C_OOB \ | ||
64 | CVMX_ADD_IO_SEG(0x00011800800000D8ull) | ||
65 | #define CVMX_L2C_OOB1 \ | ||
66 | CVMX_ADD_IO_SEG(0x00011800800000E0ull) | ||
67 | #define CVMX_L2C_OOB2 \ | ||
68 | CVMX_ADD_IO_SEG(0x00011800800000E8ull) | ||
69 | #define CVMX_L2C_OOB3 \ | ||
70 | CVMX_ADD_IO_SEG(0x00011800800000F0ull) | ||
71 | #define CVMX_L2C_PFC0 \ | ||
72 | CVMX_ADD_IO_SEG(0x0001180080000098ull) | ||
73 | #define CVMX_L2C_PFC1 \ | ||
74 | CVMX_ADD_IO_SEG(0x00011800800000A0ull) | ||
75 | #define CVMX_L2C_PFC2 \ | ||
76 | CVMX_ADD_IO_SEG(0x00011800800000A8ull) | ||
77 | #define CVMX_L2C_PFC3 \ | ||
78 | CVMX_ADD_IO_SEG(0x00011800800000B0ull) | ||
79 | #define CVMX_L2C_PFCTL \ | ||
80 | CVMX_ADD_IO_SEG(0x0001180080000090ull) | ||
81 | #define CVMX_L2C_PFCX(offset) \ | ||
82 | CVMX_ADD_IO_SEG(0x0001180080000098ull + (((offset) & 3) * 8)) | ||
83 | #define CVMX_L2C_PPGRP \ | ||
84 | CVMX_ADD_IO_SEG(0x00011800800000C0ull) | ||
85 | #define CVMX_L2C_SPAR0 \ | ||
86 | CVMX_ADD_IO_SEG(0x0001180080000068ull) | ||
87 | #define CVMX_L2C_SPAR1 \ | ||
88 | CVMX_ADD_IO_SEG(0x0001180080000070ull) | ||
89 | #define CVMX_L2C_SPAR2 \ | ||
90 | CVMX_ADD_IO_SEG(0x0001180080000078ull) | ||
91 | #define CVMX_L2C_SPAR3 \ | ||
92 | CVMX_ADD_IO_SEG(0x0001180080000080ull) | ||
93 | #define CVMX_L2C_SPAR4 \ | ||
94 | CVMX_ADD_IO_SEG(0x0001180080000088ull) | ||
95 | |||
96 | union cvmx_l2c_bst0 { | ||
97 | uint64_t u64; | ||
98 | struct cvmx_l2c_bst0_s { | ||
99 | uint64_t reserved_24_63:40; | ||
100 | uint64_t dtbnk:1; | ||
101 | uint64_t wlb_msk:4; | ||
102 | uint64_t dtcnt:13; | ||
103 | uint64_t dt:1; | ||
104 | uint64_t stin_msk:1; | ||
105 | uint64_t wlb_dat:4; | ||
106 | } s; | ||
107 | struct cvmx_l2c_bst0_cn30xx { | ||
108 | uint64_t reserved_23_63:41; | ||
109 | uint64_t wlb_msk:4; | ||
110 | uint64_t reserved_15_18:4; | ||
111 | uint64_t dtcnt:9; | ||
112 | uint64_t dt:1; | ||
113 | uint64_t reserved_4_4:1; | ||
114 | uint64_t wlb_dat:4; | ||
115 | } cn30xx; | ||
116 | struct cvmx_l2c_bst0_cn31xx { | ||
117 | uint64_t reserved_23_63:41; | ||
118 | uint64_t wlb_msk:4; | ||
119 | uint64_t reserved_16_18:3; | ||
120 | uint64_t dtcnt:10; | ||
121 | uint64_t dt:1; | ||
122 | uint64_t stin_msk:1; | ||
123 | uint64_t wlb_dat:4; | ||
124 | } cn31xx; | ||
125 | struct cvmx_l2c_bst0_cn38xx { | ||
126 | uint64_t reserved_19_63:45; | ||
127 | uint64_t dtcnt:13; | ||
128 | uint64_t dt:1; | ||
129 | uint64_t stin_msk:1; | ||
130 | uint64_t wlb_dat:4; | ||
131 | } cn38xx; | ||
132 | struct cvmx_l2c_bst0_cn38xx cn38xxp2; | ||
133 | struct cvmx_l2c_bst0_cn50xx { | ||
134 | uint64_t reserved_24_63:40; | ||
135 | uint64_t dtbnk:1; | ||
136 | uint64_t wlb_msk:4; | ||
137 | uint64_t reserved_16_18:3; | ||
138 | uint64_t dtcnt:10; | ||
139 | uint64_t dt:1; | ||
140 | uint64_t stin_msk:1; | ||
141 | uint64_t wlb_dat:4; | ||
142 | } cn50xx; | ||
143 | struct cvmx_l2c_bst0_cn50xx cn52xx; | ||
144 | struct cvmx_l2c_bst0_cn50xx cn52xxp1; | ||
145 | struct cvmx_l2c_bst0_s cn56xx; | ||
146 | struct cvmx_l2c_bst0_s cn56xxp1; | ||
147 | struct cvmx_l2c_bst0_s cn58xx; | ||
148 | struct cvmx_l2c_bst0_s cn58xxp1; | ||
149 | }; | ||
150 | |||
151 | union cvmx_l2c_bst1 { | ||
152 | uint64_t u64; | ||
153 | struct cvmx_l2c_bst1_s { | ||
154 | uint64_t reserved_9_63:55; | ||
155 | uint64_t l2t:9; | ||
156 | } s; | ||
157 | struct cvmx_l2c_bst1_cn30xx { | ||
158 | uint64_t reserved_16_63:48; | ||
159 | uint64_t vwdf:4; | ||
160 | uint64_t lrf:2; | ||
161 | uint64_t vab_vwcf:1; | ||
162 | uint64_t reserved_5_8:4; | ||
163 | uint64_t l2t:5; | ||
164 | } cn30xx; | ||
165 | struct cvmx_l2c_bst1_cn30xx cn31xx; | ||
166 | struct cvmx_l2c_bst1_cn38xx { | ||
167 | uint64_t reserved_16_63:48; | ||
168 | uint64_t vwdf:4; | ||
169 | uint64_t lrf:2; | ||
170 | uint64_t vab_vwcf:1; | ||
171 | uint64_t l2t:9; | ||
172 | } cn38xx; | ||
173 | struct cvmx_l2c_bst1_cn38xx cn38xxp2; | ||
174 | struct cvmx_l2c_bst1_cn38xx cn50xx; | ||
175 | struct cvmx_l2c_bst1_cn52xx { | ||
176 | uint64_t reserved_19_63:45; | ||
177 | uint64_t plc2:1; | ||
178 | uint64_t plc1:1; | ||
179 | uint64_t plc0:1; | ||
180 | uint64_t vwdf:4; | ||
181 | uint64_t reserved_11_11:1; | ||
182 | uint64_t ilc:1; | ||
183 | uint64_t vab_vwcf:1; | ||
184 | uint64_t l2t:9; | ||
185 | } cn52xx; | ||
186 | struct cvmx_l2c_bst1_cn52xx cn52xxp1; | ||
187 | struct cvmx_l2c_bst1_cn56xx { | ||
188 | uint64_t reserved_24_63:40; | ||
189 | uint64_t plc2:1; | ||
190 | uint64_t plc1:1; | ||
191 | uint64_t plc0:1; | ||
192 | uint64_t ilc:1; | ||
193 | uint64_t vwdf1:4; | ||
194 | uint64_t vwdf0:4; | ||
195 | uint64_t vab_vwcf1:1; | ||
196 | uint64_t reserved_10_10:1; | ||
197 | uint64_t vab_vwcf0:1; | ||
198 | uint64_t l2t:9; | ||
199 | } cn56xx; | ||
200 | struct cvmx_l2c_bst1_cn56xx cn56xxp1; | ||
201 | struct cvmx_l2c_bst1_cn38xx cn58xx; | ||
202 | struct cvmx_l2c_bst1_cn38xx cn58xxp1; | ||
203 | }; | ||
204 | |||
205 | union cvmx_l2c_bst2 { | ||
206 | uint64_t u64; | ||
207 | struct cvmx_l2c_bst2_s { | ||
208 | uint64_t reserved_16_63:48; | ||
209 | uint64_t mrb:4; | ||
210 | uint64_t reserved_4_11:8; | ||
211 | uint64_t ipcbst:1; | ||
212 | uint64_t picbst:1; | ||
213 | uint64_t xrdmsk:1; | ||
214 | uint64_t xrddat:1; | ||
215 | } s; | ||
216 | struct cvmx_l2c_bst2_cn30xx { | ||
217 | uint64_t reserved_16_63:48; | ||
218 | uint64_t mrb:4; | ||
219 | uint64_t rmdf:4; | ||
220 | uint64_t reserved_4_7:4; | ||
221 | uint64_t ipcbst:1; | ||
222 | uint64_t reserved_2_2:1; | ||
223 | uint64_t xrdmsk:1; | ||
224 | uint64_t xrddat:1; | ||
225 | } cn30xx; | ||
226 | struct cvmx_l2c_bst2_cn30xx cn31xx; | ||
227 | struct cvmx_l2c_bst2_cn38xx { | ||
228 | uint64_t reserved_16_63:48; | ||
229 | uint64_t mrb:4; | ||
230 | uint64_t rmdf:4; | ||
231 | uint64_t rhdf:4; | ||
232 | uint64_t ipcbst:1; | ||
233 | uint64_t picbst:1; | ||
234 | uint64_t xrdmsk:1; | ||
235 | uint64_t xrddat:1; | ||
236 | } cn38xx; | ||
237 | struct cvmx_l2c_bst2_cn38xx cn38xxp2; | ||
238 | struct cvmx_l2c_bst2_cn30xx cn50xx; | ||
239 | struct cvmx_l2c_bst2_cn30xx cn52xx; | ||
240 | struct cvmx_l2c_bst2_cn30xx cn52xxp1; | ||
241 | struct cvmx_l2c_bst2_cn56xx { | ||
242 | uint64_t reserved_16_63:48; | ||
243 | uint64_t mrb:4; | ||
244 | uint64_t rmdb:4; | ||
245 | uint64_t rhdb:4; | ||
246 | uint64_t ipcbst:1; | ||
247 | uint64_t picbst:1; | ||
248 | uint64_t xrdmsk:1; | ||
249 | uint64_t xrddat:1; | ||
250 | } cn56xx; | ||
251 | struct cvmx_l2c_bst2_cn56xx cn56xxp1; | ||
252 | struct cvmx_l2c_bst2_cn56xx cn58xx; | ||
253 | struct cvmx_l2c_bst2_cn56xx cn58xxp1; | ||
254 | }; | ||
255 | |||
256 | union cvmx_l2c_cfg { | ||
257 | uint64_t u64; | ||
258 | struct cvmx_l2c_cfg_s { | ||
259 | uint64_t reserved_20_63:44; | ||
260 | uint64_t bstrun:1; | ||
261 | uint64_t lbist:1; | ||
262 | uint64_t xor_bank:1; | ||
263 | uint64_t dpres1:1; | ||
264 | uint64_t dpres0:1; | ||
265 | uint64_t dfill_dis:1; | ||
266 | uint64_t fpexp:4; | ||
267 | uint64_t fpempty:1; | ||
268 | uint64_t fpen:1; | ||
269 | uint64_t idxalias:1; | ||
270 | uint64_t mwf_crd:4; | ||
271 | uint64_t rsp_arb_mode:1; | ||
272 | uint64_t rfb_arb_mode:1; | ||
273 | uint64_t lrf_arb_mode:1; | ||
274 | } s; | ||
275 | struct cvmx_l2c_cfg_cn30xx { | ||
276 | uint64_t reserved_14_63:50; | ||
277 | uint64_t fpexp:4; | ||
278 | uint64_t fpempty:1; | ||
279 | uint64_t fpen:1; | ||
280 | uint64_t idxalias:1; | ||
281 | uint64_t mwf_crd:4; | ||
282 | uint64_t rsp_arb_mode:1; | ||
283 | uint64_t rfb_arb_mode:1; | ||
284 | uint64_t lrf_arb_mode:1; | ||
285 | } cn30xx; | ||
286 | struct cvmx_l2c_cfg_cn30xx cn31xx; | ||
287 | struct cvmx_l2c_cfg_cn30xx cn38xx; | ||
288 | struct cvmx_l2c_cfg_cn30xx cn38xxp2; | ||
289 | struct cvmx_l2c_cfg_cn50xx { | ||
290 | uint64_t reserved_20_63:44; | ||
291 | uint64_t bstrun:1; | ||
292 | uint64_t lbist:1; | ||
293 | uint64_t reserved_14_17:4; | ||
294 | uint64_t fpexp:4; | ||
295 | uint64_t fpempty:1; | ||
296 | uint64_t fpen:1; | ||
297 | uint64_t idxalias:1; | ||
298 | uint64_t mwf_crd:4; | ||
299 | uint64_t rsp_arb_mode:1; | ||
300 | uint64_t rfb_arb_mode:1; | ||
301 | uint64_t lrf_arb_mode:1; | ||
302 | } cn50xx; | ||
303 | struct cvmx_l2c_cfg_cn50xx cn52xx; | ||
304 | struct cvmx_l2c_cfg_cn50xx cn52xxp1; | ||
305 | struct cvmx_l2c_cfg_s cn56xx; | ||
306 | struct cvmx_l2c_cfg_s cn56xxp1; | ||
307 | struct cvmx_l2c_cfg_cn58xx { | ||
308 | uint64_t reserved_20_63:44; | ||
309 | uint64_t bstrun:1; | ||
310 | uint64_t lbist:1; | ||
311 | uint64_t reserved_15_17:3; | ||
312 | uint64_t dfill_dis:1; | ||
313 | uint64_t fpexp:4; | ||
314 | uint64_t fpempty:1; | ||
315 | uint64_t fpen:1; | ||
316 | uint64_t idxalias:1; | ||
317 | uint64_t mwf_crd:4; | ||
318 | uint64_t rsp_arb_mode:1; | ||
319 | uint64_t rfb_arb_mode:1; | ||
320 | uint64_t lrf_arb_mode:1; | ||
321 | } cn58xx; | ||
322 | struct cvmx_l2c_cfg_cn58xxp1 { | ||
323 | uint64_t reserved_15_63:49; | ||
324 | uint64_t dfill_dis:1; | ||
325 | uint64_t fpexp:4; | ||
326 | uint64_t fpempty:1; | ||
327 | uint64_t fpen:1; | ||
328 | uint64_t idxalias:1; | ||
329 | uint64_t mwf_crd:4; | ||
330 | uint64_t rsp_arb_mode:1; | ||
331 | uint64_t rfb_arb_mode:1; | ||
332 | uint64_t lrf_arb_mode:1; | ||
333 | } cn58xxp1; | ||
334 | }; | ||
335 | |||
336 | union cvmx_l2c_dbg { | ||
337 | uint64_t u64; | ||
338 | struct cvmx_l2c_dbg_s { | ||
339 | uint64_t reserved_15_63:49; | ||
340 | uint64_t lfb_enum:4; | ||
341 | uint64_t lfb_dmp:1; | ||
342 | uint64_t ppnum:4; | ||
343 | uint64_t set:3; | ||
344 | uint64_t finv:1; | ||
345 | uint64_t l2d:1; | ||
346 | uint64_t l2t:1; | ||
347 | } s; | ||
348 | struct cvmx_l2c_dbg_cn30xx { | ||
349 | uint64_t reserved_13_63:51; | ||
350 | uint64_t lfb_enum:2; | ||
351 | uint64_t lfb_dmp:1; | ||
352 | uint64_t reserved_5_9:5; | ||
353 | uint64_t set:2; | ||
354 | uint64_t finv:1; | ||
355 | uint64_t l2d:1; | ||
356 | uint64_t l2t:1; | ||
357 | } cn30xx; | ||
358 | struct cvmx_l2c_dbg_cn31xx { | ||
359 | uint64_t reserved_14_63:50; | ||
360 | uint64_t lfb_enum:3; | ||
361 | uint64_t lfb_dmp:1; | ||
362 | uint64_t reserved_7_9:3; | ||
363 | uint64_t ppnum:1; | ||
364 | uint64_t reserved_5_5:1; | ||
365 | uint64_t set:2; | ||
366 | uint64_t finv:1; | ||
367 | uint64_t l2d:1; | ||
368 | uint64_t l2t:1; | ||
369 | } cn31xx; | ||
370 | struct cvmx_l2c_dbg_s cn38xx; | ||
371 | struct cvmx_l2c_dbg_s cn38xxp2; | ||
372 | struct cvmx_l2c_dbg_cn50xx { | ||
373 | uint64_t reserved_14_63:50; | ||
374 | uint64_t lfb_enum:3; | ||
375 | uint64_t lfb_dmp:1; | ||
376 | uint64_t reserved_7_9:3; | ||
377 | uint64_t ppnum:1; | ||
378 | uint64_t set:3; | ||
379 | uint64_t finv:1; | ||
380 | uint64_t l2d:1; | ||
381 | uint64_t l2t:1; | ||
382 | } cn50xx; | ||
383 | struct cvmx_l2c_dbg_cn52xx { | ||
384 | uint64_t reserved_14_63:50; | ||
385 | uint64_t lfb_enum:3; | ||
386 | uint64_t lfb_dmp:1; | ||
387 | uint64_t reserved_8_9:2; | ||
388 | uint64_t ppnum:2; | ||
389 | uint64_t set:3; | ||
390 | uint64_t finv:1; | ||
391 | uint64_t l2d:1; | ||
392 | uint64_t l2t:1; | ||
393 | } cn52xx; | ||
394 | struct cvmx_l2c_dbg_cn52xx cn52xxp1; | ||
395 | struct cvmx_l2c_dbg_s cn56xx; | ||
396 | struct cvmx_l2c_dbg_s cn56xxp1; | ||
397 | struct cvmx_l2c_dbg_s cn58xx; | ||
398 | struct cvmx_l2c_dbg_s cn58xxp1; | ||
399 | }; | ||
400 | |||
401 | union cvmx_l2c_dut { | ||
402 | uint64_t u64; | ||
403 | struct cvmx_l2c_dut_s { | ||
404 | uint64_t reserved_32_63:32; | ||
405 | uint64_t dtena:1; | ||
406 | uint64_t reserved_30_30:1; | ||
407 | uint64_t dt_vld:1; | ||
408 | uint64_t dt_tag:29; | ||
409 | } s; | ||
410 | struct cvmx_l2c_dut_s cn30xx; | ||
411 | struct cvmx_l2c_dut_s cn31xx; | ||
412 | struct cvmx_l2c_dut_s cn38xx; | ||
413 | struct cvmx_l2c_dut_s cn38xxp2; | ||
414 | struct cvmx_l2c_dut_s cn50xx; | ||
415 | struct cvmx_l2c_dut_s cn52xx; | ||
416 | struct cvmx_l2c_dut_s cn52xxp1; | ||
417 | struct cvmx_l2c_dut_s cn56xx; | ||
418 | struct cvmx_l2c_dut_s cn56xxp1; | ||
419 | struct cvmx_l2c_dut_s cn58xx; | ||
420 | struct cvmx_l2c_dut_s cn58xxp1; | ||
421 | }; | ||
422 | |||
423 | union cvmx_l2c_grpwrr0 { | ||
424 | uint64_t u64; | ||
425 | struct cvmx_l2c_grpwrr0_s { | ||
426 | uint64_t plc1rmsk:32; | ||
427 | uint64_t plc0rmsk:32; | ||
428 | } s; | ||
429 | struct cvmx_l2c_grpwrr0_s cn52xx; | ||
430 | struct cvmx_l2c_grpwrr0_s cn52xxp1; | ||
431 | struct cvmx_l2c_grpwrr0_s cn56xx; | ||
432 | struct cvmx_l2c_grpwrr0_s cn56xxp1; | ||
433 | }; | ||
434 | |||
435 | union cvmx_l2c_grpwrr1 { | ||
436 | uint64_t u64; | ||
437 | struct cvmx_l2c_grpwrr1_s { | ||
438 | uint64_t ilcrmsk:32; | ||
439 | uint64_t plc2rmsk:32; | ||
440 | } s; | ||
441 | struct cvmx_l2c_grpwrr1_s cn52xx; | ||
442 | struct cvmx_l2c_grpwrr1_s cn52xxp1; | ||
443 | struct cvmx_l2c_grpwrr1_s cn56xx; | ||
444 | struct cvmx_l2c_grpwrr1_s cn56xxp1; | ||
445 | }; | ||
446 | |||
447 | union cvmx_l2c_int_en { | ||
448 | uint64_t u64; | ||
449 | struct cvmx_l2c_int_en_s { | ||
450 | uint64_t reserved_9_63:55; | ||
451 | uint64_t lck2ena:1; | ||
452 | uint64_t lckena:1; | ||
453 | uint64_t l2ddeden:1; | ||
454 | uint64_t l2dsecen:1; | ||
455 | uint64_t l2tdeden:1; | ||
456 | uint64_t l2tsecen:1; | ||
457 | uint64_t oob3en:1; | ||
458 | uint64_t oob2en:1; | ||
459 | uint64_t oob1en:1; | ||
460 | } s; | ||
461 | struct cvmx_l2c_int_en_s cn52xx; | ||
462 | struct cvmx_l2c_int_en_s cn52xxp1; | ||
463 | struct cvmx_l2c_int_en_s cn56xx; | ||
464 | struct cvmx_l2c_int_en_s cn56xxp1; | ||
465 | }; | ||
466 | |||
467 | union cvmx_l2c_int_stat { | ||
468 | uint64_t u64; | ||
469 | struct cvmx_l2c_int_stat_s { | ||
470 | uint64_t reserved_9_63:55; | ||
471 | uint64_t lck2:1; | ||
472 | uint64_t lck:1; | ||
473 | uint64_t l2dded:1; | ||
474 | uint64_t l2dsec:1; | ||
475 | uint64_t l2tded:1; | ||
476 | uint64_t l2tsec:1; | ||
477 | uint64_t oob3:1; | ||
478 | uint64_t oob2:1; | ||
479 | uint64_t oob1:1; | ||
480 | } s; | ||
481 | struct cvmx_l2c_int_stat_s cn52xx; | ||
482 | struct cvmx_l2c_int_stat_s cn52xxp1; | ||
483 | struct cvmx_l2c_int_stat_s cn56xx; | ||
484 | struct cvmx_l2c_int_stat_s cn56xxp1; | ||
485 | }; | ||
486 | |||
487 | union cvmx_l2c_lckbase { | ||
488 | uint64_t u64; | ||
489 | struct cvmx_l2c_lckbase_s { | ||
490 | uint64_t reserved_31_63:33; | ||
491 | uint64_t lck_base:27; | ||
492 | uint64_t reserved_1_3:3; | ||
493 | uint64_t lck_ena:1; | ||
494 | } s; | ||
495 | struct cvmx_l2c_lckbase_s cn30xx; | ||
496 | struct cvmx_l2c_lckbase_s cn31xx; | ||
497 | struct cvmx_l2c_lckbase_s cn38xx; | ||
498 | struct cvmx_l2c_lckbase_s cn38xxp2; | ||
499 | struct cvmx_l2c_lckbase_s cn50xx; | ||
500 | struct cvmx_l2c_lckbase_s cn52xx; | ||
501 | struct cvmx_l2c_lckbase_s cn52xxp1; | ||
502 | struct cvmx_l2c_lckbase_s cn56xx; | ||
503 | struct cvmx_l2c_lckbase_s cn56xxp1; | ||
504 | struct cvmx_l2c_lckbase_s cn58xx; | ||
505 | struct cvmx_l2c_lckbase_s cn58xxp1; | ||
506 | }; | ||
507 | |||
508 | union cvmx_l2c_lckoff { | ||
509 | uint64_t u64; | ||
510 | struct cvmx_l2c_lckoff_s { | ||
511 | uint64_t reserved_10_63:54; | ||
512 | uint64_t lck_offset:10; | ||
513 | } s; | ||
514 | struct cvmx_l2c_lckoff_s cn30xx; | ||
515 | struct cvmx_l2c_lckoff_s cn31xx; | ||
516 | struct cvmx_l2c_lckoff_s cn38xx; | ||
517 | struct cvmx_l2c_lckoff_s cn38xxp2; | ||
518 | struct cvmx_l2c_lckoff_s cn50xx; | ||
519 | struct cvmx_l2c_lckoff_s cn52xx; | ||
520 | struct cvmx_l2c_lckoff_s cn52xxp1; | ||
521 | struct cvmx_l2c_lckoff_s cn56xx; | ||
522 | struct cvmx_l2c_lckoff_s cn56xxp1; | ||
523 | struct cvmx_l2c_lckoff_s cn58xx; | ||
524 | struct cvmx_l2c_lckoff_s cn58xxp1; | ||
525 | }; | ||
526 | |||
527 | union cvmx_l2c_lfb0 { | ||
528 | uint64_t u64; | ||
529 | struct cvmx_l2c_lfb0_s { | ||
530 | uint64_t reserved_32_63:32; | ||
531 | uint64_t stcpnd:1; | ||
532 | uint64_t stpnd:1; | ||
533 | uint64_t stinv:1; | ||
534 | uint64_t stcfl:1; | ||
535 | uint64_t vam:1; | ||
536 | uint64_t inxt:4; | ||
537 | uint64_t itl:1; | ||
538 | uint64_t ihd:1; | ||
539 | uint64_t set:3; | ||
540 | uint64_t vabnum:4; | ||
541 | uint64_t sid:9; | ||
542 | uint64_t cmd:4; | ||
543 | uint64_t vld:1; | ||
544 | } s; | ||
545 | struct cvmx_l2c_lfb0_cn30xx { | ||
546 | uint64_t reserved_32_63:32; | ||
547 | uint64_t stcpnd:1; | ||
548 | uint64_t stpnd:1; | ||
549 | uint64_t stinv:1; | ||
550 | uint64_t stcfl:1; | ||
551 | uint64_t vam:1; | ||
552 | uint64_t reserved_25_26:2; | ||
553 | uint64_t inxt:2; | ||
554 | uint64_t itl:1; | ||
555 | uint64_t ihd:1; | ||
556 | uint64_t reserved_20_20:1; | ||
557 | uint64_t set:2; | ||
558 | uint64_t reserved_16_17:2; | ||
559 | uint64_t vabnum:2; | ||
560 | uint64_t sid:9; | ||
561 | uint64_t cmd:4; | ||
562 | uint64_t vld:1; | ||
563 | } cn30xx; | ||
564 | struct cvmx_l2c_lfb0_cn31xx { | ||
565 | uint64_t reserved_32_63:32; | ||
566 | uint64_t stcpnd:1; | ||
567 | uint64_t stpnd:1; | ||
568 | uint64_t stinv:1; | ||
569 | uint64_t stcfl:1; | ||
570 | uint64_t vam:1; | ||
571 | uint64_t reserved_26_26:1; | ||
572 | uint64_t inxt:3; | ||
573 | uint64_t itl:1; | ||
574 | uint64_t ihd:1; | ||
575 | uint64_t reserved_20_20:1; | ||
576 | uint64_t set:2; | ||
577 | uint64_t reserved_17_17:1; | ||
578 | uint64_t vabnum:3; | ||
579 | uint64_t sid:9; | ||
580 | uint64_t cmd:4; | ||
581 | uint64_t vld:1; | ||
582 | } cn31xx; | ||
583 | struct cvmx_l2c_lfb0_s cn38xx; | ||
584 | struct cvmx_l2c_lfb0_s cn38xxp2; | ||
585 | struct cvmx_l2c_lfb0_cn50xx { | ||
586 | uint64_t reserved_32_63:32; | ||
587 | uint64_t stcpnd:1; | ||
588 | uint64_t stpnd:1; | ||
589 | uint64_t stinv:1; | ||
590 | uint64_t stcfl:1; | ||
591 | uint64_t vam:1; | ||
592 | uint64_t reserved_26_26:1; | ||
593 | uint64_t inxt:3; | ||
594 | uint64_t itl:1; | ||
595 | uint64_t ihd:1; | ||
596 | uint64_t set:3; | ||
597 | uint64_t reserved_17_17:1; | ||
598 | uint64_t vabnum:3; | ||
599 | uint64_t sid:9; | ||
600 | uint64_t cmd:4; | ||
601 | uint64_t vld:1; | ||
602 | } cn50xx; | ||
603 | struct cvmx_l2c_lfb0_cn50xx cn52xx; | ||
604 | struct cvmx_l2c_lfb0_cn50xx cn52xxp1; | ||
605 | struct cvmx_l2c_lfb0_s cn56xx; | ||
606 | struct cvmx_l2c_lfb0_s cn56xxp1; | ||
607 | struct cvmx_l2c_lfb0_s cn58xx; | ||
608 | struct cvmx_l2c_lfb0_s cn58xxp1; | ||
609 | }; | ||
610 | |||
611 | union cvmx_l2c_lfb1 { | ||
612 | uint64_t u64; | ||
613 | struct cvmx_l2c_lfb1_s { | ||
614 | uint64_t reserved_19_63:45; | ||
615 | uint64_t dsgoing:1; | ||
616 | uint64_t bid:2; | ||
617 | uint64_t wtrsp:1; | ||
618 | uint64_t wtdw:1; | ||
619 | uint64_t wtdq:1; | ||
620 | uint64_t wtwhp:1; | ||
621 | uint64_t wtwhf:1; | ||
622 | uint64_t wtwrm:1; | ||
623 | uint64_t wtstm:1; | ||
624 | uint64_t wtrda:1; | ||
625 | uint64_t wtstdt:1; | ||
626 | uint64_t wtstrsp:1; | ||
627 | uint64_t wtstrsc:1; | ||
628 | uint64_t wtvtm:1; | ||
629 | uint64_t wtmfl:1; | ||
630 | uint64_t prbrty:1; | ||
631 | uint64_t wtprb:1; | ||
632 | uint64_t vld:1; | ||
633 | } s; | ||
634 | struct cvmx_l2c_lfb1_s cn30xx; | ||
635 | struct cvmx_l2c_lfb1_s cn31xx; | ||
636 | struct cvmx_l2c_lfb1_s cn38xx; | ||
637 | struct cvmx_l2c_lfb1_s cn38xxp2; | ||
638 | struct cvmx_l2c_lfb1_s cn50xx; | ||
639 | struct cvmx_l2c_lfb1_s cn52xx; | ||
640 | struct cvmx_l2c_lfb1_s cn52xxp1; | ||
641 | struct cvmx_l2c_lfb1_s cn56xx; | ||
642 | struct cvmx_l2c_lfb1_s cn56xxp1; | ||
643 | struct cvmx_l2c_lfb1_s cn58xx; | ||
644 | struct cvmx_l2c_lfb1_s cn58xxp1; | ||
645 | }; | ||
646 | |||
647 | union cvmx_l2c_lfb2 { | ||
648 | uint64_t u64; | ||
649 | struct cvmx_l2c_lfb2_s { | ||
650 | uint64_t reserved_0_63:64; | ||
651 | } s; | ||
652 | struct cvmx_l2c_lfb2_cn30xx { | ||
653 | uint64_t reserved_27_63:37; | ||
654 | uint64_t lfb_tag:19; | ||
655 | uint64_t lfb_idx:8; | ||
656 | } cn30xx; | ||
657 | struct cvmx_l2c_lfb2_cn31xx { | ||
658 | uint64_t reserved_27_63:37; | ||
659 | uint64_t lfb_tag:17; | ||
660 | uint64_t lfb_idx:10; | ||
661 | } cn31xx; | ||
662 | struct cvmx_l2c_lfb2_cn31xx cn38xx; | ||
663 | struct cvmx_l2c_lfb2_cn31xx cn38xxp2; | ||
664 | struct cvmx_l2c_lfb2_cn50xx { | ||
665 | uint64_t reserved_27_63:37; | ||
666 | uint64_t lfb_tag:20; | ||
667 | uint64_t lfb_idx:7; | ||
668 | } cn50xx; | ||
669 | struct cvmx_l2c_lfb2_cn52xx { | ||
670 | uint64_t reserved_27_63:37; | ||
671 | uint64_t lfb_tag:18; | ||
672 | uint64_t lfb_idx:9; | ||
673 | } cn52xx; | ||
674 | struct cvmx_l2c_lfb2_cn52xx cn52xxp1; | ||
675 | struct cvmx_l2c_lfb2_cn56xx { | ||
676 | uint64_t reserved_27_63:37; | ||
677 | uint64_t lfb_tag:16; | ||
678 | uint64_t lfb_idx:11; | ||
679 | } cn56xx; | ||
680 | struct cvmx_l2c_lfb2_cn56xx cn56xxp1; | ||
681 | struct cvmx_l2c_lfb2_cn56xx cn58xx; | ||
682 | struct cvmx_l2c_lfb2_cn56xx cn58xxp1; | ||
683 | }; | ||
684 | |||
685 | union cvmx_l2c_lfb3 { | ||
686 | uint64_t u64; | ||
687 | struct cvmx_l2c_lfb3_s { | ||
688 | uint64_t reserved_5_63:59; | ||
689 | uint64_t stpartdis:1; | ||
690 | uint64_t lfb_hwm:4; | ||
691 | } s; | ||
692 | struct cvmx_l2c_lfb3_cn30xx { | ||
693 | uint64_t reserved_5_63:59; | ||
694 | uint64_t stpartdis:1; | ||
695 | uint64_t reserved_2_3:2; | ||
696 | uint64_t lfb_hwm:2; | ||
697 | } cn30xx; | ||
698 | struct cvmx_l2c_lfb3_cn31xx { | ||
699 | uint64_t reserved_5_63:59; | ||
700 | uint64_t stpartdis:1; | ||
701 | uint64_t reserved_3_3:1; | ||
702 | uint64_t lfb_hwm:3; | ||
703 | } cn31xx; | ||
704 | struct cvmx_l2c_lfb3_s cn38xx; | ||
705 | struct cvmx_l2c_lfb3_s cn38xxp2; | ||
706 | struct cvmx_l2c_lfb3_cn31xx cn50xx; | ||
707 | struct cvmx_l2c_lfb3_cn31xx cn52xx; | ||
708 | struct cvmx_l2c_lfb3_cn31xx cn52xxp1; | ||
709 | struct cvmx_l2c_lfb3_s cn56xx; | ||
710 | struct cvmx_l2c_lfb3_s cn56xxp1; | ||
711 | struct cvmx_l2c_lfb3_s cn58xx; | ||
712 | struct cvmx_l2c_lfb3_s cn58xxp1; | ||
713 | }; | ||
714 | |||
715 | union cvmx_l2c_oob { | ||
716 | uint64_t u64; | ||
717 | struct cvmx_l2c_oob_s { | ||
718 | uint64_t reserved_2_63:62; | ||
719 | uint64_t dwbena:1; | ||
720 | uint64_t stena:1; | ||
721 | } s; | ||
722 | struct cvmx_l2c_oob_s cn52xx; | ||
723 | struct cvmx_l2c_oob_s cn52xxp1; | ||
724 | struct cvmx_l2c_oob_s cn56xx; | ||
725 | struct cvmx_l2c_oob_s cn56xxp1; | ||
726 | }; | ||
727 | |||
728 | union cvmx_l2c_oob1 { | ||
729 | uint64_t u64; | ||
730 | struct cvmx_l2c_oob1_s { | ||
731 | uint64_t fadr:27; | ||
732 | uint64_t fsrc:1; | ||
733 | uint64_t reserved_34_35:2; | ||
734 | uint64_t sadr:14; | ||
735 | uint64_t reserved_14_19:6; | ||
736 | uint64_t size:14; | ||
737 | } s; | ||
738 | struct cvmx_l2c_oob1_s cn52xx; | ||
739 | struct cvmx_l2c_oob1_s cn52xxp1; | ||
740 | struct cvmx_l2c_oob1_s cn56xx; | ||
741 | struct cvmx_l2c_oob1_s cn56xxp1; | ||
742 | }; | ||
743 | |||
744 | union cvmx_l2c_oob2 { | ||
745 | uint64_t u64; | ||
746 | struct cvmx_l2c_oob2_s { | ||
747 | uint64_t fadr:27; | ||
748 | uint64_t fsrc:1; | ||
749 | uint64_t reserved_34_35:2; | ||
750 | uint64_t sadr:14; | ||
751 | uint64_t reserved_14_19:6; | ||
752 | uint64_t size:14; | ||
753 | } s; | ||
754 | struct cvmx_l2c_oob2_s cn52xx; | ||
755 | struct cvmx_l2c_oob2_s cn52xxp1; | ||
756 | struct cvmx_l2c_oob2_s cn56xx; | ||
757 | struct cvmx_l2c_oob2_s cn56xxp1; | ||
758 | }; | ||
759 | |||
760 | union cvmx_l2c_oob3 { | ||
761 | uint64_t u64; | ||
762 | struct cvmx_l2c_oob3_s { | ||
763 | uint64_t fadr:27; | ||
764 | uint64_t fsrc:1; | ||
765 | uint64_t reserved_34_35:2; | ||
766 | uint64_t sadr:14; | ||
767 | uint64_t reserved_14_19:6; | ||
768 | uint64_t size:14; | ||
769 | } s; | ||
770 | struct cvmx_l2c_oob3_s cn52xx; | ||
771 | struct cvmx_l2c_oob3_s cn52xxp1; | ||
772 | struct cvmx_l2c_oob3_s cn56xx; | ||
773 | struct cvmx_l2c_oob3_s cn56xxp1; | ||
774 | }; | ||
775 | |||
776 | union cvmx_l2c_pfcx { | ||
777 | uint64_t u64; | ||
778 | struct cvmx_l2c_pfcx_s { | ||
779 | uint64_t reserved_36_63:28; | ||
780 | uint64_t pfcnt0:36; | ||
781 | } s; | ||
782 | struct cvmx_l2c_pfcx_s cn30xx; | ||
783 | struct cvmx_l2c_pfcx_s cn31xx; | ||
784 | struct cvmx_l2c_pfcx_s cn38xx; | ||
785 | struct cvmx_l2c_pfcx_s cn38xxp2; | ||
786 | struct cvmx_l2c_pfcx_s cn50xx; | ||
787 | struct cvmx_l2c_pfcx_s cn52xx; | ||
788 | struct cvmx_l2c_pfcx_s cn52xxp1; | ||
789 | struct cvmx_l2c_pfcx_s cn56xx; | ||
790 | struct cvmx_l2c_pfcx_s cn56xxp1; | ||
791 | struct cvmx_l2c_pfcx_s cn58xx; | ||
792 | struct cvmx_l2c_pfcx_s cn58xxp1; | ||
793 | }; | ||
794 | |||
795 | union cvmx_l2c_pfctl { | ||
796 | uint64_t u64; | ||
797 | struct cvmx_l2c_pfctl_s { | ||
798 | uint64_t reserved_36_63:28; | ||
799 | uint64_t cnt3rdclr:1; | ||
800 | uint64_t cnt2rdclr:1; | ||
801 | uint64_t cnt1rdclr:1; | ||
802 | uint64_t cnt0rdclr:1; | ||
803 | uint64_t cnt3ena:1; | ||
804 | uint64_t cnt3clr:1; | ||
805 | uint64_t cnt3sel:6; | ||
806 | uint64_t cnt2ena:1; | ||
807 | uint64_t cnt2clr:1; | ||
808 | uint64_t cnt2sel:6; | ||
809 | uint64_t cnt1ena:1; | ||
810 | uint64_t cnt1clr:1; | ||
811 | uint64_t cnt1sel:6; | ||
812 | uint64_t cnt0ena:1; | ||
813 | uint64_t cnt0clr:1; | ||
814 | uint64_t cnt0sel:6; | ||
815 | } s; | ||
816 | struct cvmx_l2c_pfctl_s cn30xx; | ||
817 | struct cvmx_l2c_pfctl_s cn31xx; | ||
818 | struct cvmx_l2c_pfctl_s cn38xx; | ||
819 | struct cvmx_l2c_pfctl_s cn38xxp2; | ||
820 | struct cvmx_l2c_pfctl_s cn50xx; | ||
821 | struct cvmx_l2c_pfctl_s cn52xx; | ||
822 | struct cvmx_l2c_pfctl_s cn52xxp1; | ||
823 | struct cvmx_l2c_pfctl_s cn56xx; | ||
824 | struct cvmx_l2c_pfctl_s cn56xxp1; | ||
825 | struct cvmx_l2c_pfctl_s cn58xx; | ||
826 | struct cvmx_l2c_pfctl_s cn58xxp1; | ||
827 | }; | ||
828 | |||
829 | union cvmx_l2c_ppgrp { | ||
830 | uint64_t u64; | ||
831 | struct cvmx_l2c_ppgrp_s { | ||
832 | uint64_t reserved_24_63:40; | ||
833 | uint64_t pp11grp:2; | ||
834 | uint64_t pp10grp:2; | ||
835 | uint64_t pp9grp:2; | ||
836 | uint64_t pp8grp:2; | ||
837 | uint64_t pp7grp:2; | ||
838 | uint64_t pp6grp:2; | ||
839 | uint64_t pp5grp:2; | ||
840 | uint64_t pp4grp:2; | ||
841 | uint64_t pp3grp:2; | ||
842 | uint64_t pp2grp:2; | ||
843 | uint64_t pp1grp:2; | ||
844 | uint64_t pp0grp:2; | ||
845 | } s; | ||
846 | struct cvmx_l2c_ppgrp_cn52xx { | ||
847 | uint64_t reserved_8_63:56; | ||
848 | uint64_t pp3grp:2; | ||
849 | uint64_t pp2grp:2; | ||
850 | uint64_t pp1grp:2; | ||
851 | uint64_t pp0grp:2; | ||
852 | } cn52xx; | ||
853 | struct cvmx_l2c_ppgrp_cn52xx cn52xxp1; | ||
854 | struct cvmx_l2c_ppgrp_s cn56xx; | ||
855 | struct cvmx_l2c_ppgrp_s cn56xxp1; | ||
856 | }; | ||
857 | |||
858 | union cvmx_l2c_spar0 { | ||
859 | uint64_t u64; | ||
860 | struct cvmx_l2c_spar0_s { | ||
861 | uint64_t reserved_32_63:32; | ||
862 | uint64_t umsk3:8; | ||
863 | uint64_t umsk2:8; | ||
864 | uint64_t umsk1:8; | ||
865 | uint64_t umsk0:8; | ||
866 | } s; | ||
867 | struct cvmx_l2c_spar0_cn30xx { | ||
868 | uint64_t reserved_4_63:60; | ||
869 | uint64_t umsk0:4; | ||
870 | } cn30xx; | ||
871 | struct cvmx_l2c_spar0_cn31xx { | ||
872 | uint64_t reserved_12_63:52; | ||
873 | uint64_t umsk1:4; | ||
874 | uint64_t reserved_4_7:4; | ||
875 | uint64_t umsk0:4; | ||
876 | } cn31xx; | ||
877 | struct cvmx_l2c_spar0_s cn38xx; | ||
878 | struct cvmx_l2c_spar0_s cn38xxp2; | ||
879 | struct cvmx_l2c_spar0_cn50xx { | ||
880 | uint64_t reserved_16_63:48; | ||
881 | uint64_t umsk1:8; | ||
882 | uint64_t umsk0:8; | ||
883 | } cn50xx; | ||
884 | struct cvmx_l2c_spar0_s cn52xx; | ||
885 | struct cvmx_l2c_spar0_s cn52xxp1; | ||
886 | struct cvmx_l2c_spar0_s cn56xx; | ||
887 | struct cvmx_l2c_spar0_s cn56xxp1; | ||
888 | struct cvmx_l2c_spar0_s cn58xx; | ||
889 | struct cvmx_l2c_spar0_s cn58xxp1; | ||
890 | }; | ||
891 | |||
892 | union cvmx_l2c_spar1 { | ||
893 | uint64_t u64; | ||
894 | struct cvmx_l2c_spar1_s { | ||
895 | uint64_t reserved_32_63:32; | ||
896 | uint64_t umsk7:8; | ||
897 | uint64_t umsk6:8; | ||
898 | uint64_t umsk5:8; | ||
899 | uint64_t umsk4:8; | ||
900 | } s; | ||
901 | struct cvmx_l2c_spar1_s cn38xx; | ||
902 | struct cvmx_l2c_spar1_s cn38xxp2; | ||
903 | struct cvmx_l2c_spar1_s cn56xx; | ||
904 | struct cvmx_l2c_spar1_s cn56xxp1; | ||
905 | struct cvmx_l2c_spar1_s cn58xx; | ||
906 | struct cvmx_l2c_spar1_s cn58xxp1; | ||
907 | }; | ||
908 | |||
909 | union cvmx_l2c_spar2 { | ||
910 | uint64_t u64; | ||
911 | struct cvmx_l2c_spar2_s { | ||
912 | uint64_t reserved_32_63:32; | ||
913 | uint64_t umsk11:8; | ||
914 | uint64_t umsk10:8; | ||
915 | uint64_t umsk9:8; | ||
916 | uint64_t umsk8:8; | ||
917 | } s; | ||
918 | struct cvmx_l2c_spar2_s cn38xx; | ||
919 | struct cvmx_l2c_spar2_s cn38xxp2; | ||
920 | struct cvmx_l2c_spar2_s cn56xx; | ||
921 | struct cvmx_l2c_spar2_s cn56xxp1; | ||
922 | struct cvmx_l2c_spar2_s cn58xx; | ||
923 | struct cvmx_l2c_spar2_s cn58xxp1; | ||
924 | }; | ||
925 | |||
926 | union cvmx_l2c_spar3 { | ||
927 | uint64_t u64; | ||
928 | struct cvmx_l2c_spar3_s { | ||
929 | uint64_t reserved_32_63:32; | ||
930 | uint64_t umsk15:8; | ||
931 | uint64_t umsk14:8; | ||
932 | uint64_t umsk13:8; | ||
933 | uint64_t umsk12:8; | ||
934 | } s; | ||
935 | struct cvmx_l2c_spar3_s cn38xx; | ||
936 | struct cvmx_l2c_spar3_s cn38xxp2; | ||
937 | struct cvmx_l2c_spar3_s cn58xx; | ||
938 | struct cvmx_l2c_spar3_s cn58xxp1; | ||
939 | }; | ||
940 | |||
941 | union cvmx_l2c_spar4 { | ||
942 | uint64_t u64; | ||
943 | struct cvmx_l2c_spar4_s { | ||
944 | uint64_t reserved_8_63:56; | ||
945 | uint64_t umskiob:8; | ||
946 | } s; | ||
947 | struct cvmx_l2c_spar4_cn30xx { | ||
948 | uint64_t reserved_4_63:60; | ||
949 | uint64_t umskiob:4; | ||
950 | } cn30xx; | ||
951 | struct cvmx_l2c_spar4_cn30xx cn31xx; | ||
952 | struct cvmx_l2c_spar4_s cn38xx; | ||
953 | struct cvmx_l2c_spar4_s cn38xxp2; | ||
954 | struct cvmx_l2c_spar4_s cn50xx; | ||
955 | struct cvmx_l2c_spar4_s cn52xx; | ||
956 | struct cvmx_l2c_spar4_s cn52xxp1; | ||
957 | struct cvmx_l2c_spar4_s cn56xx; | ||
958 | struct cvmx_l2c_spar4_s cn56xxp1; | ||
959 | struct cvmx_l2c_spar4_s cn58xx; | ||
960 | struct cvmx_l2c_spar4_s cn58xxp1; | ||
961 | }; | ||
962 | |||
963 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-l2c.h b/arch/mips/include/asm/octeon/cvmx-l2c.h new file mode 100644 index 000000000000..2a8c0902ea50 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-l2c.h | |||
@@ -0,0 +1,325 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * | ||
30 | * Interface to the Level 2 Cache (L2C) control, measurement, and debugging | ||
31 | * facilities. | ||
32 | */ | ||
33 | |||
34 | #ifndef __CVMX_L2C_H__ | ||
35 | #define __CVMX_L2C_H__ | ||
36 | |||
37 | /* Deprecated macro, use function */ | ||
38 | #define CVMX_L2_ASSOC cvmx_l2c_get_num_assoc() | ||
39 | |||
40 | /* Deprecated macro, use function */ | ||
41 | #define CVMX_L2_SET_BITS cvmx_l2c_get_set_bits() | ||
42 | |||
43 | /* Deprecated macro, use function */ | ||
44 | #define CVMX_L2_SETS cvmx_l2c_get_num_sets() | ||
45 | |||
46 | #define CVMX_L2C_IDX_ADDR_SHIFT 7 /* based on 128 byte cache line size */ | ||
47 | #define CVMX_L2C_IDX_MASK (cvmx_l2c_get_num_sets() - 1) | ||
48 | |||
49 | /* Defines for index aliasing computations */ | ||
50 | #define CVMX_L2C_TAG_ADDR_ALIAS_SHIFT \ | ||
51 | (CVMX_L2C_IDX_ADDR_SHIFT + cvmx_l2c_get_set_bits()) | ||
52 | |||
53 | #define CVMX_L2C_ALIAS_MASK \ | ||
54 | (CVMX_L2C_IDX_MASK << CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) | ||
55 | |||
56 | union cvmx_l2c_tag { | ||
57 | uint64_t u64; | ||
58 | struct { | ||
59 | uint64_t reserved:28; | ||
60 | uint64_t V:1; /* Line valid */ | ||
61 | uint64_t D:1; /* Line dirty */ | ||
62 | uint64_t L:1; /* Line locked */ | ||
63 | uint64_t U:1; /* Use, LRU eviction */ | ||
64 | uint64_t addr:32; /* Phys mem (not all bits valid) */ | ||
65 | } s; | ||
66 | }; | ||
67 | |||
68 | /* L2C Performance Counter events. */ | ||
69 | enum cvmx_l2c_event { | ||
70 | CVMX_L2C_EVENT_CYCLES = 0, | ||
71 | CVMX_L2C_EVENT_INSTRUCTION_MISS = 1, | ||
72 | CVMX_L2C_EVENT_INSTRUCTION_HIT = 2, | ||
73 | CVMX_L2C_EVENT_DATA_MISS = 3, | ||
74 | CVMX_L2C_EVENT_DATA_HIT = 4, | ||
75 | CVMX_L2C_EVENT_MISS = 5, | ||
76 | CVMX_L2C_EVENT_HIT = 6, | ||
77 | CVMX_L2C_EVENT_VICTIM_HIT = 7, | ||
78 | CVMX_L2C_EVENT_INDEX_CONFLICT = 8, | ||
79 | CVMX_L2C_EVENT_TAG_PROBE = 9, | ||
80 | CVMX_L2C_EVENT_TAG_UPDATE = 10, | ||
81 | CVMX_L2C_EVENT_TAG_COMPLETE = 11, | ||
82 | CVMX_L2C_EVENT_TAG_DIRTY = 12, | ||
83 | CVMX_L2C_EVENT_DATA_STORE_NOP = 13, | ||
84 | CVMX_L2C_EVENT_DATA_STORE_READ = 14, | ||
85 | CVMX_L2C_EVENT_DATA_STORE_WRITE = 15, | ||
86 | CVMX_L2C_EVENT_FILL_DATA_VALID = 16, | ||
87 | CVMX_L2C_EVENT_WRITE_REQUEST = 17, | ||
88 | CVMX_L2C_EVENT_READ_REQUEST = 18, | ||
89 | CVMX_L2C_EVENT_WRITE_DATA_VALID = 19, | ||
90 | CVMX_L2C_EVENT_XMC_NOP = 20, | ||
91 | CVMX_L2C_EVENT_XMC_LDT = 21, | ||
92 | CVMX_L2C_EVENT_XMC_LDI = 22, | ||
93 | CVMX_L2C_EVENT_XMC_LDD = 23, | ||
94 | CVMX_L2C_EVENT_XMC_STF = 24, | ||
95 | CVMX_L2C_EVENT_XMC_STT = 25, | ||
96 | CVMX_L2C_EVENT_XMC_STP = 26, | ||
97 | CVMX_L2C_EVENT_XMC_STC = 27, | ||
98 | CVMX_L2C_EVENT_XMC_DWB = 28, | ||
99 | CVMX_L2C_EVENT_XMC_PL2 = 29, | ||
100 | CVMX_L2C_EVENT_XMC_PSL1 = 30, | ||
101 | CVMX_L2C_EVENT_XMC_IOBLD = 31, | ||
102 | CVMX_L2C_EVENT_XMC_IOBST = 32, | ||
103 | CVMX_L2C_EVENT_XMC_IOBDMA = 33, | ||
104 | CVMX_L2C_EVENT_XMC_IOBRSP = 34, | ||
105 | CVMX_L2C_EVENT_XMC_BUS_VALID = 35, | ||
106 | CVMX_L2C_EVENT_XMC_MEM_DATA = 36, | ||
107 | CVMX_L2C_EVENT_XMC_REFL_DATA = 37, | ||
108 | CVMX_L2C_EVENT_XMC_IOBRSP_DATA = 38, | ||
109 | CVMX_L2C_EVENT_RSC_NOP = 39, | ||
110 | CVMX_L2C_EVENT_RSC_STDN = 40, | ||
111 | CVMX_L2C_EVENT_RSC_FILL = 41, | ||
112 | CVMX_L2C_EVENT_RSC_REFL = 42, | ||
113 | CVMX_L2C_EVENT_RSC_STIN = 43, | ||
114 | CVMX_L2C_EVENT_RSC_SCIN = 44, | ||
115 | CVMX_L2C_EVENT_RSC_SCFL = 45, | ||
116 | CVMX_L2C_EVENT_RSC_SCDN = 46, | ||
117 | CVMX_L2C_EVENT_RSC_DATA_VALID = 47, | ||
118 | CVMX_L2C_EVENT_RSC_VALID_FILL = 48, | ||
119 | CVMX_L2C_EVENT_RSC_VALID_STRSP = 49, | ||
120 | CVMX_L2C_EVENT_RSC_VALID_REFL = 50, | ||
121 | CVMX_L2C_EVENT_LRF_REQ = 51, | ||
122 | CVMX_L2C_EVENT_DT_RD_ALLOC = 52, | ||
123 | CVMX_L2C_EVENT_DT_WR_INVAL = 53 | ||
124 | }; | ||
125 | |||
126 | /** | ||
127 | * Configure one of the four L2 Cache performance counters to capture event | ||
128 | * occurences. | ||
129 | * | ||
130 | * @counter: The counter to configure. Range 0..3. | ||
131 | * @event: The type of L2 Cache event occurrence to count. | ||
132 | * @clear_on_read: When asserted, any read of the performance counter | ||
133 | * clears the counter. | ||
134 | * | ||
135 | * The routine does not clear the counter. | ||
136 | */ | ||
137 | void cvmx_l2c_config_perf(uint32_t counter, | ||
138 | enum cvmx_l2c_event event, uint32_t clear_on_read); | ||
139 | /** | ||
140 | * Read the given L2 Cache performance counter. The counter must be configured | ||
141 | * before reading, but this routine does not enforce this requirement. | ||
142 | * | ||
143 | * @counter: The counter to configure. Range 0..3. | ||
144 | * | ||
145 | * Returns The current counter value. | ||
146 | */ | ||
147 | uint64_t cvmx_l2c_read_perf(uint32_t counter); | ||
148 | |||
149 | /** | ||
150 | * Return the L2 Cache way partitioning for a given core. | ||
151 | * | ||
152 | * @core: The core processor of interest. | ||
153 | * | ||
154 | * Returns The mask specifying the partitioning. 0 bits in mask indicates | ||
155 | * the cache 'ways' that a core can evict from. | ||
156 | * -1 on error | ||
157 | */ | ||
158 | int cvmx_l2c_get_core_way_partition(uint32_t core); | ||
159 | |||
160 | /** | ||
161 | * Partitions the L2 cache for a core | ||
162 | * | ||
163 | * @core: The core that the partitioning applies to. | ||
164 | * | ||
165 | * @mask: The partitioning of the ways expressed as a binary mask. A 0 | ||
166 | * bit allows the core to evict cache lines from a way, while a | ||
167 | * 1 bit blocks the core from evicting any lines from that | ||
168 | * way. There must be at least one allowed way (0 bit) in the | ||
169 | * mask. | ||
170 | * | ||
171 | * If any ways are blocked for all cores and the HW blocks, then those | ||
172 | * ways will never have any cache lines evicted from them. All cores | ||
173 | * and the hardware blocks are free to read from all ways regardless | ||
174 | * of the partitioning. | ||
175 | */ | ||
176 | int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask); | ||
177 | |||
178 | /** | ||
179 | * Return the L2 Cache way partitioning for the hw blocks. | ||
180 | * | ||
181 | * Returns The mask specifying the reserved way. 0 bits in mask indicates | ||
182 | * the cache 'ways' that a core can evict from. | ||
183 | * -1 on error | ||
184 | */ | ||
185 | int cvmx_l2c_get_hw_way_partition(void); | ||
186 | |||
187 | /** | ||
188 | * Partitions the L2 cache for the hardware blocks. | ||
189 | * | ||
190 | * @mask: The partitioning of the ways expressed as a binary mask. A 0 | ||
191 | * bit allows the core to evict cache lines from a way, while a | ||
192 | * 1 bit blocks the core from evicting any lines from that | ||
193 | * way. There must be at least one allowed way (0 bit) in the | ||
194 | * mask. | ||
195 | * | ||
196 | * If any ways are blocked for all cores and the HW blocks, then those | ||
197 | * ways will never have any cache lines evicted from them. All cores | ||
198 | * and the hardware blocks are free to read from all ways regardless | ||
199 | * of the partitioning. | ||
200 | */ | ||
201 | int cvmx_l2c_set_hw_way_partition(uint32_t mask); | ||
202 | |||
203 | /** | ||
204 | * Locks a line in the L2 cache at the specified physical address | ||
205 | * | ||
206 | * @addr: physical address of line to lock | ||
207 | * | ||
208 | * Returns 0 on success, | ||
209 | * 1 if line not locked. | ||
210 | */ | ||
211 | int cvmx_l2c_lock_line(uint64_t addr); | ||
212 | |||
213 | /** | ||
214 | * Locks a specified memory region in the L2 cache. | ||
215 | * | ||
216 | * Note that if not all lines can be locked, that means that all | ||
217 | * but one of the ways (associations) available to the locking | ||
218 | * core are locked. Having only 1 association available for | ||
219 | * normal caching may have a significant adverse affect on performance. | ||
220 | * Care should be taken to ensure that enough of the L2 cache is left | ||
221 | * unlocked to allow for normal caching of DRAM. | ||
222 | * | ||
223 | * @start: Physical address of the start of the region to lock | ||
224 | * @len: Length (in bytes) of region to lock | ||
225 | * | ||
226 | * Returns Number of requested lines that where not locked. | ||
227 | * 0 on success (all locked) | ||
228 | */ | ||
229 | int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len); | ||
230 | |||
231 | /** | ||
232 | * Unlock and flush a cache line from the L2 cache. | ||
233 | * IMPORTANT: Must only be run by one core at a time due to use | ||
234 | * of L2C debug features. | ||
235 | * Note that this function will flush a matching but unlocked cache line. | ||
236 | * (If address is not in L2, no lines are flushed.) | ||
237 | * | ||
238 | * @address: Physical address to unlock | ||
239 | * | ||
240 | * Returns 0: line not unlocked | ||
241 | * 1: line unlocked | ||
242 | */ | ||
243 | int cvmx_l2c_unlock_line(uint64_t address); | ||
244 | |||
245 | /** | ||
246 | * Unlocks a region of memory that is locked in the L2 cache | ||
247 | * | ||
248 | * @start: start physical address | ||
249 | * @len: length (in bytes) to unlock | ||
250 | * | ||
251 | * Returns Number of locked lines that the call unlocked | ||
252 | */ | ||
253 | int cvmx_l2c_unlock_mem_region(uint64_t start, uint64_t len); | ||
254 | |||
255 | /** | ||
256 | * Read the L2 controller tag for a given location in L2 | ||
257 | * | ||
258 | * @association: | ||
259 | * Which association to read line from | ||
260 | * @index: Which way to read from. | ||
261 | * | ||
262 | * Returns l2c tag structure for line requested. | ||
263 | */ | ||
264 | union cvmx_l2c_tag cvmx_l2c_get_tag(uint32_t association, uint32_t index); | ||
265 | |||
266 | /* Wrapper around deprecated old function name */ | ||
267 | static inline union cvmx_l2c_tag cvmx_get_l2c_tag(uint32_t association, | ||
268 | uint32_t index) | ||
269 | { | ||
270 | return cvmx_l2c_get_tag(association, index); | ||
271 | } | ||
272 | |||
273 | /** | ||
274 | * Returns the cache index for a given physical address | ||
275 | * | ||
276 | * @addr: physical address | ||
277 | * | ||
278 | * Returns L2 cache index | ||
279 | */ | ||
280 | uint32_t cvmx_l2c_address_to_index(uint64_t addr); | ||
281 | |||
282 | /** | ||
283 | * Flushes (and unlocks) the entire L2 cache. | ||
284 | * IMPORTANT: Must only be run by one core at a time due to use | ||
285 | * of L2C debug features. | ||
286 | */ | ||
287 | void cvmx_l2c_flush(void); | ||
288 | |||
289 | /** | ||
290 | * | ||
291 | * Returns Returns the size of the L2 cache in bytes, | ||
292 | * -1 on error (unrecognized model) | ||
293 | */ | ||
294 | int cvmx_l2c_get_cache_size_bytes(void); | ||
295 | |||
296 | /** | ||
297 | * Return the number of sets in the L2 Cache | ||
298 | * | ||
299 | * Returns | ||
300 | */ | ||
301 | int cvmx_l2c_get_num_sets(void); | ||
302 | |||
303 | /** | ||
304 | * Return log base 2 of the number of sets in the L2 cache | ||
305 | * Returns | ||
306 | */ | ||
307 | int cvmx_l2c_get_set_bits(void); | ||
308 | /** | ||
309 | * Return the number of associations in the L2 Cache | ||
310 | * | ||
311 | * Returns | ||
312 | */ | ||
313 | int cvmx_l2c_get_num_assoc(void); | ||
314 | |||
315 | /** | ||
316 | * Flush a line from the L2 cache | ||
317 | * This should only be called from one core at a time, as this routine | ||
318 | * sets the core to the 'debug' core in order to flush the line. | ||
319 | * | ||
320 | * @assoc: Association (or way) to flush | ||
321 | * @index: Index to flush | ||
322 | */ | ||
323 | void cvmx_l2c_flush_line(uint32_t assoc, uint32_t index); | ||
324 | |||
325 | #endif /* __CVMX_L2C_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-l2d-defs.h b/arch/mips/include/asm/octeon/cvmx-l2d-defs.h new file mode 100644 index 000000000000..d7102d455e1b --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-l2d-defs.h | |||
@@ -0,0 +1,369 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_L2D_DEFS_H__ | ||
29 | #define __CVMX_L2D_DEFS_H__ | ||
30 | |||
31 | #define CVMX_L2D_BST0 \ | ||
32 | CVMX_ADD_IO_SEG(0x0001180080000780ull) | ||
33 | #define CVMX_L2D_BST1 \ | ||
34 | CVMX_ADD_IO_SEG(0x0001180080000788ull) | ||
35 | #define CVMX_L2D_BST2 \ | ||
36 | CVMX_ADD_IO_SEG(0x0001180080000790ull) | ||
37 | #define CVMX_L2D_BST3 \ | ||
38 | CVMX_ADD_IO_SEG(0x0001180080000798ull) | ||
39 | #define CVMX_L2D_ERR \ | ||
40 | CVMX_ADD_IO_SEG(0x0001180080000010ull) | ||
41 | #define CVMX_L2D_FADR \ | ||
42 | CVMX_ADD_IO_SEG(0x0001180080000018ull) | ||
43 | #define CVMX_L2D_FSYN0 \ | ||
44 | CVMX_ADD_IO_SEG(0x0001180080000020ull) | ||
45 | #define CVMX_L2D_FSYN1 \ | ||
46 | CVMX_ADD_IO_SEG(0x0001180080000028ull) | ||
47 | #define CVMX_L2D_FUS0 \ | ||
48 | CVMX_ADD_IO_SEG(0x00011800800007A0ull) | ||
49 | #define CVMX_L2D_FUS1 \ | ||
50 | CVMX_ADD_IO_SEG(0x00011800800007A8ull) | ||
51 | #define CVMX_L2D_FUS2 \ | ||
52 | CVMX_ADD_IO_SEG(0x00011800800007B0ull) | ||
53 | #define CVMX_L2D_FUS3 \ | ||
54 | CVMX_ADD_IO_SEG(0x00011800800007B8ull) | ||
55 | |||
56 | union cvmx_l2d_bst0 { | ||
57 | uint64_t u64; | ||
58 | struct cvmx_l2d_bst0_s { | ||
59 | uint64_t reserved_35_63:29; | ||
60 | uint64_t ftl:1; | ||
61 | uint64_t q0stat:34; | ||
62 | } s; | ||
63 | struct cvmx_l2d_bst0_s cn30xx; | ||
64 | struct cvmx_l2d_bst0_s cn31xx; | ||
65 | struct cvmx_l2d_bst0_s cn38xx; | ||
66 | struct cvmx_l2d_bst0_s cn38xxp2; | ||
67 | struct cvmx_l2d_bst0_s cn50xx; | ||
68 | struct cvmx_l2d_bst0_s cn52xx; | ||
69 | struct cvmx_l2d_bst0_s cn52xxp1; | ||
70 | struct cvmx_l2d_bst0_s cn56xx; | ||
71 | struct cvmx_l2d_bst0_s cn56xxp1; | ||
72 | struct cvmx_l2d_bst0_s cn58xx; | ||
73 | struct cvmx_l2d_bst0_s cn58xxp1; | ||
74 | }; | ||
75 | |||
76 | union cvmx_l2d_bst1 { | ||
77 | uint64_t u64; | ||
78 | struct cvmx_l2d_bst1_s { | ||
79 | uint64_t reserved_34_63:30; | ||
80 | uint64_t q1stat:34; | ||
81 | } s; | ||
82 | struct cvmx_l2d_bst1_s cn30xx; | ||
83 | struct cvmx_l2d_bst1_s cn31xx; | ||
84 | struct cvmx_l2d_bst1_s cn38xx; | ||
85 | struct cvmx_l2d_bst1_s cn38xxp2; | ||
86 | struct cvmx_l2d_bst1_s cn50xx; | ||
87 | struct cvmx_l2d_bst1_s cn52xx; | ||
88 | struct cvmx_l2d_bst1_s cn52xxp1; | ||
89 | struct cvmx_l2d_bst1_s cn56xx; | ||
90 | struct cvmx_l2d_bst1_s cn56xxp1; | ||
91 | struct cvmx_l2d_bst1_s cn58xx; | ||
92 | struct cvmx_l2d_bst1_s cn58xxp1; | ||
93 | }; | ||
94 | |||
95 | union cvmx_l2d_bst2 { | ||
96 | uint64_t u64; | ||
97 | struct cvmx_l2d_bst2_s { | ||
98 | uint64_t reserved_34_63:30; | ||
99 | uint64_t q2stat:34; | ||
100 | } s; | ||
101 | struct cvmx_l2d_bst2_s cn30xx; | ||
102 | struct cvmx_l2d_bst2_s cn31xx; | ||
103 | struct cvmx_l2d_bst2_s cn38xx; | ||
104 | struct cvmx_l2d_bst2_s cn38xxp2; | ||
105 | struct cvmx_l2d_bst2_s cn50xx; | ||
106 | struct cvmx_l2d_bst2_s cn52xx; | ||
107 | struct cvmx_l2d_bst2_s cn52xxp1; | ||
108 | struct cvmx_l2d_bst2_s cn56xx; | ||
109 | struct cvmx_l2d_bst2_s cn56xxp1; | ||
110 | struct cvmx_l2d_bst2_s cn58xx; | ||
111 | struct cvmx_l2d_bst2_s cn58xxp1; | ||
112 | }; | ||
113 | |||
114 | union cvmx_l2d_bst3 { | ||
115 | uint64_t u64; | ||
116 | struct cvmx_l2d_bst3_s { | ||
117 | uint64_t reserved_34_63:30; | ||
118 | uint64_t q3stat:34; | ||
119 | } s; | ||
120 | struct cvmx_l2d_bst3_s cn30xx; | ||
121 | struct cvmx_l2d_bst3_s cn31xx; | ||
122 | struct cvmx_l2d_bst3_s cn38xx; | ||
123 | struct cvmx_l2d_bst3_s cn38xxp2; | ||
124 | struct cvmx_l2d_bst3_s cn50xx; | ||
125 | struct cvmx_l2d_bst3_s cn52xx; | ||
126 | struct cvmx_l2d_bst3_s cn52xxp1; | ||
127 | struct cvmx_l2d_bst3_s cn56xx; | ||
128 | struct cvmx_l2d_bst3_s cn56xxp1; | ||
129 | struct cvmx_l2d_bst3_s cn58xx; | ||
130 | struct cvmx_l2d_bst3_s cn58xxp1; | ||
131 | }; | ||
132 | |||
133 | union cvmx_l2d_err { | ||
134 | uint64_t u64; | ||
135 | struct cvmx_l2d_err_s { | ||
136 | uint64_t reserved_6_63:58; | ||
137 | uint64_t bmhclsel:1; | ||
138 | uint64_t ded_err:1; | ||
139 | uint64_t sec_err:1; | ||
140 | uint64_t ded_intena:1; | ||
141 | uint64_t sec_intena:1; | ||
142 | uint64_t ecc_ena:1; | ||
143 | } s; | ||
144 | struct cvmx_l2d_err_s cn30xx; | ||
145 | struct cvmx_l2d_err_s cn31xx; | ||
146 | struct cvmx_l2d_err_s cn38xx; | ||
147 | struct cvmx_l2d_err_s cn38xxp2; | ||
148 | struct cvmx_l2d_err_s cn50xx; | ||
149 | struct cvmx_l2d_err_s cn52xx; | ||
150 | struct cvmx_l2d_err_s cn52xxp1; | ||
151 | struct cvmx_l2d_err_s cn56xx; | ||
152 | struct cvmx_l2d_err_s cn56xxp1; | ||
153 | struct cvmx_l2d_err_s cn58xx; | ||
154 | struct cvmx_l2d_err_s cn58xxp1; | ||
155 | }; | ||
156 | |||
157 | union cvmx_l2d_fadr { | ||
158 | uint64_t u64; | ||
159 | struct cvmx_l2d_fadr_s { | ||
160 | uint64_t reserved_19_63:45; | ||
161 | uint64_t fadru:1; | ||
162 | uint64_t fowmsk:4; | ||
163 | uint64_t fset:3; | ||
164 | uint64_t fadr:11; | ||
165 | } s; | ||
166 | struct cvmx_l2d_fadr_cn30xx { | ||
167 | uint64_t reserved_18_63:46; | ||
168 | uint64_t fowmsk:4; | ||
169 | uint64_t reserved_13_13:1; | ||
170 | uint64_t fset:2; | ||
171 | uint64_t reserved_9_10:2; | ||
172 | uint64_t fadr:9; | ||
173 | } cn30xx; | ||
174 | struct cvmx_l2d_fadr_cn31xx { | ||
175 | uint64_t reserved_18_63:46; | ||
176 | uint64_t fowmsk:4; | ||
177 | uint64_t reserved_13_13:1; | ||
178 | uint64_t fset:2; | ||
179 | uint64_t reserved_10_10:1; | ||
180 | uint64_t fadr:10; | ||
181 | } cn31xx; | ||
182 | struct cvmx_l2d_fadr_cn38xx { | ||
183 | uint64_t reserved_18_63:46; | ||
184 | uint64_t fowmsk:4; | ||
185 | uint64_t fset:3; | ||
186 | uint64_t fadr:11; | ||
187 | } cn38xx; | ||
188 | struct cvmx_l2d_fadr_cn38xx cn38xxp2; | ||
189 | struct cvmx_l2d_fadr_cn50xx { | ||
190 | uint64_t reserved_18_63:46; | ||
191 | uint64_t fowmsk:4; | ||
192 | uint64_t fset:3; | ||
193 | uint64_t reserved_8_10:3; | ||
194 | uint64_t fadr:8; | ||
195 | } cn50xx; | ||
196 | struct cvmx_l2d_fadr_cn52xx { | ||
197 | uint64_t reserved_18_63:46; | ||
198 | uint64_t fowmsk:4; | ||
199 | uint64_t fset:3; | ||
200 | uint64_t reserved_10_10:1; | ||
201 | uint64_t fadr:10; | ||
202 | } cn52xx; | ||
203 | struct cvmx_l2d_fadr_cn52xx cn52xxp1; | ||
204 | struct cvmx_l2d_fadr_s cn56xx; | ||
205 | struct cvmx_l2d_fadr_s cn56xxp1; | ||
206 | struct cvmx_l2d_fadr_s cn58xx; | ||
207 | struct cvmx_l2d_fadr_s cn58xxp1; | ||
208 | }; | ||
209 | |||
210 | union cvmx_l2d_fsyn0 { | ||
211 | uint64_t u64; | ||
212 | struct cvmx_l2d_fsyn0_s { | ||
213 | uint64_t reserved_20_63:44; | ||
214 | uint64_t fsyn_ow1:10; | ||
215 | uint64_t fsyn_ow0:10; | ||
216 | } s; | ||
217 | struct cvmx_l2d_fsyn0_s cn30xx; | ||
218 | struct cvmx_l2d_fsyn0_s cn31xx; | ||
219 | struct cvmx_l2d_fsyn0_s cn38xx; | ||
220 | struct cvmx_l2d_fsyn0_s cn38xxp2; | ||
221 | struct cvmx_l2d_fsyn0_s cn50xx; | ||
222 | struct cvmx_l2d_fsyn0_s cn52xx; | ||
223 | struct cvmx_l2d_fsyn0_s cn52xxp1; | ||
224 | struct cvmx_l2d_fsyn0_s cn56xx; | ||
225 | struct cvmx_l2d_fsyn0_s cn56xxp1; | ||
226 | struct cvmx_l2d_fsyn0_s cn58xx; | ||
227 | struct cvmx_l2d_fsyn0_s cn58xxp1; | ||
228 | }; | ||
229 | |||
230 | union cvmx_l2d_fsyn1 { | ||
231 | uint64_t u64; | ||
232 | struct cvmx_l2d_fsyn1_s { | ||
233 | uint64_t reserved_20_63:44; | ||
234 | uint64_t fsyn_ow3:10; | ||
235 | uint64_t fsyn_ow2:10; | ||
236 | } s; | ||
237 | struct cvmx_l2d_fsyn1_s cn30xx; | ||
238 | struct cvmx_l2d_fsyn1_s cn31xx; | ||
239 | struct cvmx_l2d_fsyn1_s cn38xx; | ||
240 | struct cvmx_l2d_fsyn1_s cn38xxp2; | ||
241 | struct cvmx_l2d_fsyn1_s cn50xx; | ||
242 | struct cvmx_l2d_fsyn1_s cn52xx; | ||
243 | struct cvmx_l2d_fsyn1_s cn52xxp1; | ||
244 | struct cvmx_l2d_fsyn1_s cn56xx; | ||
245 | struct cvmx_l2d_fsyn1_s cn56xxp1; | ||
246 | struct cvmx_l2d_fsyn1_s cn58xx; | ||
247 | struct cvmx_l2d_fsyn1_s cn58xxp1; | ||
248 | }; | ||
249 | |||
250 | union cvmx_l2d_fus0 { | ||
251 | uint64_t u64; | ||
252 | struct cvmx_l2d_fus0_s { | ||
253 | uint64_t reserved_34_63:30; | ||
254 | uint64_t q0fus:34; | ||
255 | } s; | ||
256 | struct cvmx_l2d_fus0_s cn30xx; | ||
257 | struct cvmx_l2d_fus0_s cn31xx; | ||
258 | struct cvmx_l2d_fus0_s cn38xx; | ||
259 | struct cvmx_l2d_fus0_s cn38xxp2; | ||
260 | struct cvmx_l2d_fus0_s cn50xx; | ||
261 | struct cvmx_l2d_fus0_s cn52xx; | ||
262 | struct cvmx_l2d_fus0_s cn52xxp1; | ||
263 | struct cvmx_l2d_fus0_s cn56xx; | ||
264 | struct cvmx_l2d_fus0_s cn56xxp1; | ||
265 | struct cvmx_l2d_fus0_s cn58xx; | ||
266 | struct cvmx_l2d_fus0_s cn58xxp1; | ||
267 | }; | ||
268 | |||
269 | union cvmx_l2d_fus1 { | ||
270 | uint64_t u64; | ||
271 | struct cvmx_l2d_fus1_s { | ||
272 | uint64_t reserved_34_63:30; | ||
273 | uint64_t q1fus:34; | ||
274 | } s; | ||
275 | struct cvmx_l2d_fus1_s cn30xx; | ||
276 | struct cvmx_l2d_fus1_s cn31xx; | ||
277 | struct cvmx_l2d_fus1_s cn38xx; | ||
278 | struct cvmx_l2d_fus1_s cn38xxp2; | ||
279 | struct cvmx_l2d_fus1_s cn50xx; | ||
280 | struct cvmx_l2d_fus1_s cn52xx; | ||
281 | struct cvmx_l2d_fus1_s cn52xxp1; | ||
282 | struct cvmx_l2d_fus1_s cn56xx; | ||
283 | struct cvmx_l2d_fus1_s cn56xxp1; | ||
284 | struct cvmx_l2d_fus1_s cn58xx; | ||
285 | struct cvmx_l2d_fus1_s cn58xxp1; | ||
286 | }; | ||
287 | |||
288 | union cvmx_l2d_fus2 { | ||
289 | uint64_t u64; | ||
290 | struct cvmx_l2d_fus2_s { | ||
291 | uint64_t reserved_34_63:30; | ||
292 | uint64_t q2fus:34; | ||
293 | } s; | ||
294 | struct cvmx_l2d_fus2_s cn30xx; | ||
295 | struct cvmx_l2d_fus2_s cn31xx; | ||
296 | struct cvmx_l2d_fus2_s cn38xx; | ||
297 | struct cvmx_l2d_fus2_s cn38xxp2; | ||
298 | struct cvmx_l2d_fus2_s cn50xx; | ||
299 | struct cvmx_l2d_fus2_s cn52xx; | ||
300 | struct cvmx_l2d_fus2_s cn52xxp1; | ||
301 | struct cvmx_l2d_fus2_s cn56xx; | ||
302 | struct cvmx_l2d_fus2_s cn56xxp1; | ||
303 | struct cvmx_l2d_fus2_s cn58xx; | ||
304 | struct cvmx_l2d_fus2_s cn58xxp1; | ||
305 | }; | ||
306 | |||
307 | union cvmx_l2d_fus3 { | ||
308 | uint64_t u64; | ||
309 | struct cvmx_l2d_fus3_s { | ||
310 | uint64_t reserved_40_63:24; | ||
311 | uint64_t ema_ctl:3; | ||
312 | uint64_t reserved_34_36:3; | ||
313 | uint64_t q3fus:34; | ||
314 | } s; | ||
315 | struct cvmx_l2d_fus3_cn30xx { | ||
316 | uint64_t reserved_35_63:29; | ||
317 | uint64_t crip_64k:1; | ||
318 | uint64_t q3fus:34; | ||
319 | } cn30xx; | ||
320 | struct cvmx_l2d_fus3_cn31xx { | ||
321 | uint64_t reserved_35_63:29; | ||
322 | uint64_t crip_128k:1; | ||
323 | uint64_t q3fus:34; | ||
324 | } cn31xx; | ||
325 | struct cvmx_l2d_fus3_cn38xx { | ||
326 | uint64_t reserved_36_63:28; | ||
327 | uint64_t crip_256k:1; | ||
328 | uint64_t crip_512k:1; | ||
329 | uint64_t q3fus:34; | ||
330 | } cn38xx; | ||
331 | struct cvmx_l2d_fus3_cn38xx cn38xxp2; | ||
332 | struct cvmx_l2d_fus3_cn50xx { | ||
333 | uint64_t reserved_40_63:24; | ||
334 | uint64_t ema_ctl:3; | ||
335 | uint64_t reserved_36_36:1; | ||
336 | uint64_t crip_32k:1; | ||
337 | uint64_t crip_64k:1; | ||
338 | uint64_t q3fus:34; | ||
339 | } cn50xx; | ||
340 | struct cvmx_l2d_fus3_cn52xx { | ||
341 | uint64_t reserved_40_63:24; | ||
342 | uint64_t ema_ctl:3; | ||
343 | uint64_t reserved_36_36:1; | ||
344 | uint64_t crip_128k:1; | ||
345 | uint64_t crip_256k:1; | ||
346 | uint64_t q3fus:34; | ||
347 | } cn52xx; | ||
348 | struct cvmx_l2d_fus3_cn52xx cn52xxp1; | ||
349 | struct cvmx_l2d_fus3_cn56xx { | ||
350 | uint64_t reserved_40_63:24; | ||
351 | uint64_t ema_ctl:3; | ||
352 | uint64_t reserved_36_36:1; | ||
353 | uint64_t crip_512k:1; | ||
354 | uint64_t crip_1024k:1; | ||
355 | uint64_t q3fus:34; | ||
356 | } cn56xx; | ||
357 | struct cvmx_l2d_fus3_cn56xx cn56xxp1; | ||
358 | struct cvmx_l2d_fus3_cn58xx { | ||
359 | uint64_t reserved_39_63:25; | ||
360 | uint64_t ema_ctl:2; | ||
361 | uint64_t reserved_36_36:1; | ||
362 | uint64_t crip_512k:1; | ||
363 | uint64_t crip_1024k:1; | ||
364 | uint64_t q3fus:34; | ||
365 | } cn58xx; | ||
366 | struct cvmx_l2d_fus3_cn58xx cn58xxp1; | ||
367 | }; | ||
368 | |||
369 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-l2t-defs.h b/arch/mips/include/asm/octeon/cvmx-l2t-defs.h new file mode 100644 index 000000000000..2639a3f5ffc2 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-l2t-defs.h | |||
@@ -0,0 +1,141 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_L2T_DEFS_H__ | ||
29 | #define __CVMX_L2T_DEFS_H__ | ||
30 | |||
31 | #define CVMX_L2T_ERR \ | ||
32 | CVMX_ADD_IO_SEG(0x0001180080000008ull) | ||
33 | |||
34 | union cvmx_l2t_err { | ||
35 | uint64_t u64; | ||
36 | struct cvmx_l2t_err_s { | ||
37 | uint64_t reserved_29_63:35; | ||
38 | uint64_t fadru:1; | ||
39 | uint64_t lck_intena2:1; | ||
40 | uint64_t lckerr2:1; | ||
41 | uint64_t lck_intena:1; | ||
42 | uint64_t lckerr:1; | ||
43 | uint64_t fset:3; | ||
44 | uint64_t fadr:10; | ||
45 | uint64_t fsyn:6; | ||
46 | uint64_t ded_err:1; | ||
47 | uint64_t sec_err:1; | ||
48 | uint64_t ded_intena:1; | ||
49 | uint64_t sec_intena:1; | ||
50 | uint64_t ecc_ena:1; | ||
51 | } s; | ||
52 | struct cvmx_l2t_err_cn30xx { | ||
53 | uint64_t reserved_28_63:36; | ||
54 | uint64_t lck_intena2:1; | ||
55 | uint64_t lckerr2:1; | ||
56 | uint64_t lck_intena:1; | ||
57 | uint64_t lckerr:1; | ||
58 | uint64_t reserved_23_23:1; | ||
59 | uint64_t fset:2; | ||
60 | uint64_t reserved_19_20:2; | ||
61 | uint64_t fadr:8; | ||
62 | uint64_t fsyn:6; | ||
63 | uint64_t ded_err:1; | ||
64 | uint64_t sec_err:1; | ||
65 | uint64_t ded_intena:1; | ||
66 | uint64_t sec_intena:1; | ||
67 | uint64_t ecc_ena:1; | ||
68 | } cn30xx; | ||
69 | struct cvmx_l2t_err_cn31xx { | ||
70 | uint64_t reserved_28_63:36; | ||
71 | uint64_t lck_intena2:1; | ||
72 | uint64_t lckerr2:1; | ||
73 | uint64_t lck_intena:1; | ||
74 | uint64_t lckerr:1; | ||
75 | uint64_t reserved_23_23:1; | ||
76 | uint64_t fset:2; | ||
77 | uint64_t reserved_20_20:1; | ||
78 | uint64_t fadr:9; | ||
79 | uint64_t fsyn:6; | ||
80 | uint64_t ded_err:1; | ||
81 | uint64_t sec_err:1; | ||
82 | uint64_t ded_intena:1; | ||
83 | uint64_t sec_intena:1; | ||
84 | uint64_t ecc_ena:1; | ||
85 | } cn31xx; | ||
86 | struct cvmx_l2t_err_cn38xx { | ||
87 | uint64_t reserved_28_63:36; | ||
88 | uint64_t lck_intena2:1; | ||
89 | uint64_t lckerr2:1; | ||
90 | uint64_t lck_intena:1; | ||
91 | uint64_t lckerr:1; | ||
92 | uint64_t fset:3; | ||
93 | uint64_t fadr:10; | ||
94 | uint64_t fsyn:6; | ||
95 | uint64_t ded_err:1; | ||
96 | uint64_t sec_err:1; | ||
97 | uint64_t ded_intena:1; | ||
98 | uint64_t sec_intena:1; | ||
99 | uint64_t ecc_ena:1; | ||
100 | } cn38xx; | ||
101 | struct cvmx_l2t_err_cn38xx cn38xxp2; | ||
102 | struct cvmx_l2t_err_cn50xx { | ||
103 | uint64_t reserved_28_63:36; | ||
104 | uint64_t lck_intena2:1; | ||
105 | uint64_t lckerr2:1; | ||
106 | uint64_t lck_intena:1; | ||
107 | uint64_t lckerr:1; | ||
108 | uint64_t fset:3; | ||
109 | uint64_t reserved_18_20:3; | ||
110 | uint64_t fadr:7; | ||
111 | uint64_t fsyn:6; | ||
112 | uint64_t ded_err:1; | ||
113 | uint64_t sec_err:1; | ||
114 | uint64_t ded_intena:1; | ||
115 | uint64_t sec_intena:1; | ||
116 | uint64_t ecc_ena:1; | ||
117 | } cn50xx; | ||
118 | struct cvmx_l2t_err_cn52xx { | ||
119 | uint64_t reserved_28_63:36; | ||
120 | uint64_t lck_intena2:1; | ||
121 | uint64_t lckerr2:1; | ||
122 | uint64_t lck_intena:1; | ||
123 | uint64_t lckerr:1; | ||
124 | uint64_t fset:3; | ||
125 | uint64_t reserved_20_20:1; | ||
126 | uint64_t fadr:9; | ||
127 | uint64_t fsyn:6; | ||
128 | uint64_t ded_err:1; | ||
129 | uint64_t sec_err:1; | ||
130 | uint64_t ded_intena:1; | ||
131 | uint64_t sec_intena:1; | ||
132 | uint64_t ecc_ena:1; | ||
133 | } cn52xx; | ||
134 | struct cvmx_l2t_err_cn52xx cn52xxp1; | ||
135 | struct cvmx_l2t_err_s cn56xx; | ||
136 | struct cvmx_l2t_err_s cn56xxp1; | ||
137 | struct cvmx_l2t_err_s cn58xx; | ||
138 | struct cvmx_l2t_err_s cn58xxp1; | ||
139 | }; | ||
140 | |||
141 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-led-defs.h b/arch/mips/include/asm/octeon/cvmx-led-defs.h new file mode 100644 index 000000000000..16f174a4dadf --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-led-defs.h | |||
@@ -0,0 +1,240 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_LED_DEFS_H__ | ||
29 | #define __CVMX_LED_DEFS_H__ | ||
30 | |||
31 | #define CVMX_LED_BLINK \ | ||
32 | CVMX_ADD_IO_SEG(0x0001180000001A48ull) | ||
33 | #define CVMX_LED_CLK_PHASE \ | ||
34 | CVMX_ADD_IO_SEG(0x0001180000001A08ull) | ||
35 | #define CVMX_LED_CYLON \ | ||
36 | CVMX_ADD_IO_SEG(0x0001180000001AF8ull) | ||
37 | #define CVMX_LED_DBG \ | ||
38 | CVMX_ADD_IO_SEG(0x0001180000001A18ull) | ||
39 | #define CVMX_LED_EN \ | ||
40 | CVMX_ADD_IO_SEG(0x0001180000001A00ull) | ||
41 | #define CVMX_LED_POLARITY \ | ||
42 | CVMX_ADD_IO_SEG(0x0001180000001A50ull) | ||
43 | #define CVMX_LED_PRT \ | ||
44 | CVMX_ADD_IO_SEG(0x0001180000001A10ull) | ||
45 | #define CVMX_LED_PRT_FMT \ | ||
46 | CVMX_ADD_IO_SEG(0x0001180000001A30ull) | ||
47 | #define CVMX_LED_PRT_STATUSX(offset) \ | ||
48 | CVMX_ADD_IO_SEG(0x0001180000001A80ull + (((offset) & 7) * 8)) | ||
49 | #define CVMX_LED_UDD_CNTX(offset) \ | ||
50 | CVMX_ADD_IO_SEG(0x0001180000001A20ull + (((offset) & 1) * 8)) | ||
51 | #define CVMX_LED_UDD_DATX(offset) \ | ||
52 | CVMX_ADD_IO_SEG(0x0001180000001A38ull + (((offset) & 1) * 8)) | ||
53 | #define CVMX_LED_UDD_DAT_CLRX(offset) \ | ||
54 | CVMX_ADD_IO_SEG(0x0001180000001AC8ull + (((offset) & 1) * 16)) | ||
55 | #define CVMX_LED_UDD_DAT_SETX(offset) \ | ||
56 | CVMX_ADD_IO_SEG(0x0001180000001AC0ull + (((offset) & 1) * 16)) | ||
57 | |||
58 | union cvmx_led_blink { | ||
59 | uint64_t u64; | ||
60 | struct cvmx_led_blink_s { | ||
61 | uint64_t reserved_8_63:56; | ||
62 | uint64_t rate:8; | ||
63 | } s; | ||
64 | struct cvmx_led_blink_s cn38xx; | ||
65 | struct cvmx_led_blink_s cn38xxp2; | ||
66 | struct cvmx_led_blink_s cn56xx; | ||
67 | struct cvmx_led_blink_s cn56xxp1; | ||
68 | struct cvmx_led_blink_s cn58xx; | ||
69 | struct cvmx_led_blink_s cn58xxp1; | ||
70 | }; | ||
71 | |||
72 | union cvmx_led_clk_phase { | ||
73 | uint64_t u64; | ||
74 | struct cvmx_led_clk_phase_s { | ||
75 | uint64_t reserved_7_63:57; | ||
76 | uint64_t phase:7; | ||
77 | } s; | ||
78 | struct cvmx_led_clk_phase_s cn38xx; | ||
79 | struct cvmx_led_clk_phase_s cn38xxp2; | ||
80 | struct cvmx_led_clk_phase_s cn56xx; | ||
81 | struct cvmx_led_clk_phase_s cn56xxp1; | ||
82 | struct cvmx_led_clk_phase_s cn58xx; | ||
83 | struct cvmx_led_clk_phase_s cn58xxp1; | ||
84 | }; | ||
85 | |||
86 | union cvmx_led_cylon { | ||
87 | uint64_t u64; | ||
88 | struct cvmx_led_cylon_s { | ||
89 | uint64_t reserved_16_63:48; | ||
90 | uint64_t rate:16; | ||
91 | } s; | ||
92 | struct cvmx_led_cylon_s cn38xx; | ||
93 | struct cvmx_led_cylon_s cn38xxp2; | ||
94 | struct cvmx_led_cylon_s cn56xx; | ||
95 | struct cvmx_led_cylon_s cn56xxp1; | ||
96 | struct cvmx_led_cylon_s cn58xx; | ||
97 | struct cvmx_led_cylon_s cn58xxp1; | ||
98 | }; | ||
99 | |||
100 | union cvmx_led_dbg { | ||
101 | uint64_t u64; | ||
102 | struct cvmx_led_dbg_s { | ||
103 | uint64_t reserved_1_63:63; | ||
104 | uint64_t dbg_en:1; | ||
105 | } s; | ||
106 | struct cvmx_led_dbg_s cn38xx; | ||
107 | struct cvmx_led_dbg_s cn38xxp2; | ||
108 | struct cvmx_led_dbg_s cn56xx; | ||
109 | struct cvmx_led_dbg_s cn56xxp1; | ||
110 | struct cvmx_led_dbg_s cn58xx; | ||
111 | struct cvmx_led_dbg_s cn58xxp1; | ||
112 | }; | ||
113 | |||
114 | union cvmx_led_en { | ||
115 | uint64_t u64; | ||
116 | struct cvmx_led_en_s { | ||
117 | uint64_t reserved_1_63:63; | ||
118 | uint64_t en:1; | ||
119 | } s; | ||
120 | struct cvmx_led_en_s cn38xx; | ||
121 | struct cvmx_led_en_s cn38xxp2; | ||
122 | struct cvmx_led_en_s cn56xx; | ||
123 | struct cvmx_led_en_s cn56xxp1; | ||
124 | struct cvmx_led_en_s cn58xx; | ||
125 | struct cvmx_led_en_s cn58xxp1; | ||
126 | }; | ||
127 | |||
128 | union cvmx_led_polarity { | ||
129 | uint64_t u64; | ||
130 | struct cvmx_led_polarity_s { | ||
131 | uint64_t reserved_1_63:63; | ||
132 | uint64_t polarity:1; | ||
133 | } s; | ||
134 | struct cvmx_led_polarity_s cn38xx; | ||
135 | struct cvmx_led_polarity_s cn38xxp2; | ||
136 | struct cvmx_led_polarity_s cn56xx; | ||
137 | struct cvmx_led_polarity_s cn56xxp1; | ||
138 | struct cvmx_led_polarity_s cn58xx; | ||
139 | struct cvmx_led_polarity_s cn58xxp1; | ||
140 | }; | ||
141 | |||
142 | union cvmx_led_prt { | ||
143 | uint64_t u64; | ||
144 | struct cvmx_led_prt_s { | ||
145 | uint64_t reserved_8_63:56; | ||
146 | uint64_t prt_en:8; | ||
147 | } s; | ||
148 | struct cvmx_led_prt_s cn38xx; | ||
149 | struct cvmx_led_prt_s cn38xxp2; | ||
150 | struct cvmx_led_prt_s cn56xx; | ||
151 | struct cvmx_led_prt_s cn56xxp1; | ||
152 | struct cvmx_led_prt_s cn58xx; | ||
153 | struct cvmx_led_prt_s cn58xxp1; | ||
154 | }; | ||
155 | |||
156 | union cvmx_led_prt_fmt { | ||
157 | uint64_t u64; | ||
158 | struct cvmx_led_prt_fmt_s { | ||
159 | uint64_t reserved_4_63:60; | ||
160 | uint64_t format:4; | ||
161 | } s; | ||
162 | struct cvmx_led_prt_fmt_s cn38xx; | ||
163 | struct cvmx_led_prt_fmt_s cn38xxp2; | ||
164 | struct cvmx_led_prt_fmt_s cn56xx; | ||
165 | struct cvmx_led_prt_fmt_s cn56xxp1; | ||
166 | struct cvmx_led_prt_fmt_s cn58xx; | ||
167 | struct cvmx_led_prt_fmt_s cn58xxp1; | ||
168 | }; | ||
169 | |||
170 | union cvmx_led_prt_statusx { | ||
171 | uint64_t u64; | ||
172 | struct cvmx_led_prt_statusx_s { | ||
173 | uint64_t reserved_6_63:58; | ||
174 | uint64_t status:6; | ||
175 | } s; | ||
176 | struct cvmx_led_prt_statusx_s cn38xx; | ||
177 | struct cvmx_led_prt_statusx_s cn38xxp2; | ||
178 | struct cvmx_led_prt_statusx_s cn56xx; | ||
179 | struct cvmx_led_prt_statusx_s cn56xxp1; | ||
180 | struct cvmx_led_prt_statusx_s cn58xx; | ||
181 | struct cvmx_led_prt_statusx_s cn58xxp1; | ||
182 | }; | ||
183 | |||
184 | union cvmx_led_udd_cntx { | ||
185 | uint64_t u64; | ||
186 | struct cvmx_led_udd_cntx_s { | ||
187 | uint64_t reserved_6_63:58; | ||
188 | uint64_t cnt:6; | ||
189 | } s; | ||
190 | struct cvmx_led_udd_cntx_s cn38xx; | ||
191 | struct cvmx_led_udd_cntx_s cn38xxp2; | ||
192 | struct cvmx_led_udd_cntx_s cn56xx; | ||
193 | struct cvmx_led_udd_cntx_s cn56xxp1; | ||
194 | struct cvmx_led_udd_cntx_s cn58xx; | ||
195 | struct cvmx_led_udd_cntx_s cn58xxp1; | ||
196 | }; | ||
197 | |||
198 | union cvmx_led_udd_datx { | ||
199 | uint64_t u64; | ||
200 | struct cvmx_led_udd_datx_s { | ||
201 | uint64_t reserved_32_63:32; | ||
202 | uint64_t dat:32; | ||
203 | } s; | ||
204 | struct cvmx_led_udd_datx_s cn38xx; | ||
205 | struct cvmx_led_udd_datx_s cn38xxp2; | ||
206 | struct cvmx_led_udd_datx_s cn56xx; | ||
207 | struct cvmx_led_udd_datx_s cn56xxp1; | ||
208 | struct cvmx_led_udd_datx_s cn58xx; | ||
209 | struct cvmx_led_udd_datx_s cn58xxp1; | ||
210 | }; | ||
211 | |||
212 | union cvmx_led_udd_dat_clrx { | ||
213 | uint64_t u64; | ||
214 | struct cvmx_led_udd_dat_clrx_s { | ||
215 | uint64_t reserved_32_63:32; | ||
216 | uint64_t clr:32; | ||
217 | } s; | ||
218 | struct cvmx_led_udd_dat_clrx_s cn38xx; | ||
219 | struct cvmx_led_udd_dat_clrx_s cn38xxp2; | ||
220 | struct cvmx_led_udd_dat_clrx_s cn56xx; | ||
221 | struct cvmx_led_udd_dat_clrx_s cn56xxp1; | ||
222 | struct cvmx_led_udd_dat_clrx_s cn58xx; | ||
223 | struct cvmx_led_udd_dat_clrx_s cn58xxp1; | ||
224 | }; | ||
225 | |||
226 | union cvmx_led_udd_dat_setx { | ||
227 | uint64_t u64; | ||
228 | struct cvmx_led_udd_dat_setx_s { | ||
229 | uint64_t reserved_32_63:32; | ||
230 | uint64_t set:32; | ||
231 | } s; | ||
232 | struct cvmx_led_udd_dat_setx_s cn38xx; | ||
233 | struct cvmx_led_udd_dat_setx_s cn38xxp2; | ||
234 | struct cvmx_led_udd_dat_setx_s cn56xx; | ||
235 | struct cvmx_led_udd_dat_setx_s cn56xxp1; | ||
236 | struct cvmx_led_udd_dat_setx_s cn58xx; | ||
237 | struct cvmx_led_udd_dat_setx_s cn58xxp1; | ||
238 | }; | ||
239 | |||
240 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-mio-defs.h b/arch/mips/include/asm/octeon/cvmx-mio-defs.h new file mode 100644 index 000000000000..6555f0530988 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-mio-defs.h | |||
@@ -0,0 +1,2004 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_MIO_DEFS_H__ | ||
29 | #define __CVMX_MIO_DEFS_H__ | ||
30 | |||
31 | #define CVMX_MIO_BOOT_BIST_STAT \ | ||
32 | CVMX_ADD_IO_SEG(0x00011800000000F8ull) | ||
33 | #define CVMX_MIO_BOOT_COMP \ | ||
34 | CVMX_ADD_IO_SEG(0x00011800000000B8ull) | ||
35 | #define CVMX_MIO_BOOT_DMA_CFGX(offset) \ | ||
36 | CVMX_ADD_IO_SEG(0x0001180000000100ull + (((offset) & 3) * 8)) | ||
37 | #define CVMX_MIO_BOOT_DMA_INTX(offset) \ | ||
38 | CVMX_ADD_IO_SEG(0x0001180000000138ull + (((offset) & 3) * 8)) | ||
39 | #define CVMX_MIO_BOOT_DMA_INT_ENX(offset) \ | ||
40 | CVMX_ADD_IO_SEG(0x0001180000000150ull + (((offset) & 3) * 8)) | ||
41 | #define CVMX_MIO_BOOT_DMA_TIMX(offset) \ | ||
42 | CVMX_ADD_IO_SEG(0x0001180000000120ull + (((offset) & 3) * 8)) | ||
43 | #define CVMX_MIO_BOOT_ERR \ | ||
44 | CVMX_ADD_IO_SEG(0x00011800000000A0ull) | ||
45 | #define CVMX_MIO_BOOT_INT \ | ||
46 | CVMX_ADD_IO_SEG(0x00011800000000A8ull) | ||
47 | #define CVMX_MIO_BOOT_LOC_ADR \ | ||
48 | CVMX_ADD_IO_SEG(0x0001180000000090ull) | ||
49 | #define CVMX_MIO_BOOT_LOC_CFGX(offset) \ | ||
50 | CVMX_ADD_IO_SEG(0x0001180000000080ull + (((offset) & 1) * 8)) | ||
51 | #define CVMX_MIO_BOOT_LOC_DAT \ | ||
52 | CVMX_ADD_IO_SEG(0x0001180000000098ull) | ||
53 | #define CVMX_MIO_BOOT_PIN_DEFS \ | ||
54 | CVMX_ADD_IO_SEG(0x00011800000000C0ull) | ||
55 | #define CVMX_MIO_BOOT_REG_CFGX(offset) \ | ||
56 | CVMX_ADD_IO_SEG(0x0001180000000000ull + (((offset) & 7) * 8)) | ||
57 | #define CVMX_MIO_BOOT_REG_TIMX(offset) \ | ||
58 | CVMX_ADD_IO_SEG(0x0001180000000040ull + (((offset) & 7) * 8)) | ||
59 | #define CVMX_MIO_BOOT_THR \ | ||
60 | CVMX_ADD_IO_SEG(0x00011800000000B0ull) | ||
61 | #define CVMX_MIO_FUS_BNK_DATX(offset) \ | ||
62 | CVMX_ADD_IO_SEG(0x0001180000001520ull + (((offset) & 3) * 8)) | ||
63 | #define CVMX_MIO_FUS_DAT0 \ | ||
64 | CVMX_ADD_IO_SEG(0x0001180000001400ull) | ||
65 | #define CVMX_MIO_FUS_DAT1 \ | ||
66 | CVMX_ADD_IO_SEG(0x0001180000001408ull) | ||
67 | #define CVMX_MIO_FUS_DAT2 \ | ||
68 | CVMX_ADD_IO_SEG(0x0001180000001410ull) | ||
69 | #define CVMX_MIO_FUS_DAT3 \ | ||
70 | CVMX_ADD_IO_SEG(0x0001180000001418ull) | ||
71 | #define CVMX_MIO_FUS_EMA \ | ||
72 | CVMX_ADD_IO_SEG(0x0001180000001550ull) | ||
73 | #define CVMX_MIO_FUS_PDF \ | ||
74 | CVMX_ADD_IO_SEG(0x0001180000001420ull) | ||
75 | #define CVMX_MIO_FUS_PLL \ | ||
76 | CVMX_ADD_IO_SEG(0x0001180000001580ull) | ||
77 | #define CVMX_MIO_FUS_PROG \ | ||
78 | CVMX_ADD_IO_SEG(0x0001180000001510ull) | ||
79 | #define CVMX_MIO_FUS_PROG_TIMES \ | ||
80 | CVMX_ADD_IO_SEG(0x0001180000001518ull) | ||
81 | #define CVMX_MIO_FUS_RCMD \ | ||
82 | CVMX_ADD_IO_SEG(0x0001180000001500ull) | ||
83 | #define CVMX_MIO_FUS_SPR_REPAIR_RES \ | ||
84 | CVMX_ADD_IO_SEG(0x0001180000001548ull) | ||
85 | #define CVMX_MIO_FUS_SPR_REPAIR_SUM \ | ||
86 | CVMX_ADD_IO_SEG(0x0001180000001540ull) | ||
87 | #define CVMX_MIO_FUS_UNLOCK \ | ||
88 | CVMX_ADD_IO_SEG(0x0001180000001578ull) | ||
89 | #define CVMX_MIO_FUS_WADR \ | ||
90 | CVMX_ADD_IO_SEG(0x0001180000001508ull) | ||
91 | #define CVMX_MIO_NDF_DMA_CFG \ | ||
92 | CVMX_ADD_IO_SEG(0x0001180000000168ull) | ||
93 | #define CVMX_MIO_NDF_DMA_INT \ | ||
94 | CVMX_ADD_IO_SEG(0x0001180000000170ull) | ||
95 | #define CVMX_MIO_NDF_DMA_INT_EN \ | ||
96 | CVMX_ADD_IO_SEG(0x0001180000000178ull) | ||
97 | #define CVMX_MIO_PLL_CTL \ | ||
98 | CVMX_ADD_IO_SEG(0x0001180000001448ull) | ||
99 | #define CVMX_MIO_PLL_SETTING \ | ||
100 | CVMX_ADD_IO_SEG(0x0001180000001440ull) | ||
101 | #define CVMX_MIO_TWSX_INT(offset) \ | ||
102 | CVMX_ADD_IO_SEG(0x0001180000001010ull + (((offset) & 1) * 512)) | ||
103 | #define CVMX_MIO_TWSX_SW_TWSI(offset) \ | ||
104 | CVMX_ADD_IO_SEG(0x0001180000001000ull + (((offset) & 1) * 512)) | ||
105 | #define CVMX_MIO_TWSX_SW_TWSI_EXT(offset) \ | ||
106 | CVMX_ADD_IO_SEG(0x0001180000001018ull + (((offset) & 1) * 512)) | ||
107 | #define CVMX_MIO_TWSX_TWSI_SW(offset) \ | ||
108 | CVMX_ADD_IO_SEG(0x0001180000001008ull + (((offset) & 1) * 512)) | ||
109 | #define CVMX_MIO_UART2_DLH \ | ||
110 | CVMX_ADD_IO_SEG(0x0001180000000488ull) | ||
111 | #define CVMX_MIO_UART2_DLL \ | ||
112 | CVMX_ADD_IO_SEG(0x0001180000000480ull) | ||
113 | #define CVMX_MIO_UART2_FAR \ | ||
114 | CVMX_ADD_IO_SEG(0x0001180000000520ull) | ||
115 | #define CVMX_MIO_UART2_FCR \ | ||
116 | CVMX_ADD_IO_SEG(0x0001180000000450ull) | ||
117 | #define CVMX_MIO_UART2_HTX \ | ||
118 | CVMX_ADD_IO_SEG(0x0001180000000708ull) | ||
119 | #define CVMX_MIO_UART2_IER \ | ||
120 | CVMX_ADD_IO_SEG(0x0001180000000408ull) | ||
121 | #define CVMX_MIO_UART2_IIR \ | ||
122 | CVMX_ADD_IO_SEG(0x0001180000000410ull) | ||
123 | #define CVMX_MIO_UART2_LCR \ | ||
124 | CVMX_ADD_IO_SEG(0x0001180000000418ull) | ||
125 | #define CVMX_MIO_UART2_LSR \ | ||
126 | CVMX_ADD_IO_SEG(0x0001180000000428ull) | ||
127 | #define CVMX_MIO_UART2_MCR \ | ||
128 | CVMX_ADD_IO_SEG(0x0001180000000420ull) | ||
129 | #define CVMX_MIO_UART2_MSR \ | ||
130 | CVMX_ADD_IO_SEG(0x0001180000000430ull) | ||
131 | #define CVMX_MIO_UART2_RBR \ | ||
132 | CVMX_ADD_IO_SEG(0x0001180000000400ull) | ||
133 | #define CVMX_MIO_UART2_RFL \ | ||
134 | CVMX_ADD_IO_SEG(0x0001180000000608ull) | ||
135 | #define CVMX_MIO_UART2_RFW \ | ||
136 | CVMX_ADD_IO_SEG(0x0001180000000530ull) | ||
137 | #define CVMX_MIO_UART2_SBCR \ | ||
138 | CVMX_ADD_IO_SEG(0x0001180000000620ull) | ||
139 | #define CVMX_MIO_UART2_SCR \ | ||
140 | CVMX_ADD_IO_SEG(0x0001180000000438ull) | ||
141 | #define CVMX_MIO_UART2_SFE \ | ||
142 | CVMX_ADD_IO_SEG(0x0001180000000630ull) | ||
143 | #define CVMX_MIO_UART2_SRR \ | ||
144 | CVMX_ADD_IO_SEG(0x0001180000000610ull) | ||
145 | #define CVMX_MIO_UART2_SRT \ | ||
146 | CVMX_ADD_IO_SEG(0x0001180000000638ull) | ||
147 | #define CVMX_MIO_UART2_SRTS \ | ||
148 | CVMX_ADD_IO_SEG(0x0001180000000618ull) | ||
149 | #define CVMX_MIO_UART2_STT \ | ||
150 | CVMX_ADD_IO_SEG(0x0001180000000700ull) | ||
151 | #define CVMX_MIO_UART2_TFL \ | ||
152 | CVMX_ADD_IO_SEG(0x0001180000000600ull) | ||
153 | #define CVMX_MIO_UART2_TFR \ | ||
154 | CVMX_ADD_IO_SEG(0x0001180000000528ull) | ||
155 | #define CVMX_MIO_UART2_THR \ | ||
156 | CVMX_ADD_IO_SEG(0x0001180000000440ull) | ||
157 | #define CVMX_MIO_UART2_USR \ | ||
158 | CVMX_ADD_IO_SEG(0x0001180000000538ull) | ||
159 | #define CVMX_MIO_UARTX_DLH(offset) \ | ||
160 | CVMX_ADD_IO_SEG(0x0001180000000888ull + (((offset) & 1) * 1024)) | ||
161 | #define CVMX_MIO_UARTX_DLL(offset) \ | ||
162 | CVMX_ADD_IO_SEG(0x0001180000000880ull + (((offset) & 1) * 1024)) | ||
163 | #define CVMX_MIO_UARTX_FAR(offset) \ | ||
164 | CVMX_ADD_IO_SEG(0x0001180000000920ull + (((offset) & 1) * 1024)) | ||
165 | #define CVMX_MIO_UARTX_FCR(offset) \ | ||
166 | CVMX_ADD_IO_SEG(0x0001180000000850ull + (((offset) & 1) * 1024)) | ||
167 | #define CVMX_MIO_UARTX_HTX(offset) \ | ||
168 | CVMX_ADD_IO_SEG(0x0001180000000B08ull + (((offset) & 1) * 1024)) | ||
169 | #define CVMX_MIO_UARTX_IER(offset) \ | ||
170 | CVMX_ADD_IO_SEG(0x0001180000000808ull + (((offset) & 1) * 1024)) | ||
171 | #define CVMX_MIO_UARTX_IIR(offset) \ | ||
172 | CVMX_ADD_IO_SEG(0x0001180000000810ull + (((offset) & 1) * 1024)) | ||
173 | #define CVMX_MIO_UARTX_LCR(offset) \ | ||
174 | CVMX_ADD_IO_SEG(0x0001180000000818ull + (((offset) & 1) * 1024)) | ||
175 | #define CVMX_MIO_UARTX_LSR(offset) \ | ||
176 | CVMX_ADD_IO_SEG(0x0001180000000828ull + (((offset) & 1) * 1024)) | ||
177 | #define CVMX_MIO_UARTX_MCR(offset) \ | ||
178 | CVMX_ADD_IO_SEG(0x0001180000000820ull + (((offset) & 1) * 1024)) | ||
179 | #define CVMX_MIO_UARTX_MSR(offset) \ | ||
180 | CVMX_ADD_IO_SEG(0x0001180000000830ull + (((offset) & 1) * 1024)) | ||
181 | #define CVMX_MIO_UARTX_RBR(offset) \ | ||
182 | CVMX_ADD_IO_SEG(0x0001180000000800ull + (((offset) & 1) * 1024)) | ||
183 | #define CVMX_MIO_UARTX_RFL(offset) \ | ||
184 | CVMX_ADD_IO_SEG(0x0001180000000A08ull + (((offset) & 1) * 1024)) | ||
185 | #define CVMX_MIO_UARTX_RFW(offset) \ | ||
186 | CVMX_ADD_IO_SEG(0x0001180000000930ull + (((offset) & 1) * 1024)) | ||
187 | #define CVMX_MIO_UARTX_SBCR(offset) \ | ||
188 | CVMX_ADD_IO_SEG(0x0001180000000A20ull + (((offset) & 1) * 1024)) | ||
189 | #define CVMX_MIO_UARTX_SCR(offset) \ | ||
190 | CVMX_ADD_IO_SEG(0x0001180000000838ull + (((offset) & 1) * 1024)) | ||
191 | #define CVMX_MIO_UARTX_SFE(offset) \ | ||
192 | CVMX_ADD_IO_SEG(0x0001180000000A30ull + (((offset) & 1) * 1024)) | ||
193 | #define CVMX_MIO_UARTX_SRR(offset) \ | ||
194 | CVMX_ADD_IO_SEG(0x0001180000000A10ull + (((offset) & 1) * 1024)) | ||
195 | #define CVMX_MIO_UARTX_SRT(offset) \ | ||
196 | CVMX_ADD_IO_SEG(0x0001180000000A38ull + (((offset) & 1) * 1024)) | ||
197 | #define CVMX_MIO_UARTX_SRTS(offset) \ | ||
198 | CVMX_ADD_IO_SEG(0x0001180000000A18ull + (((offset) & 1) * 1024)) | ||
199 | #define CVMX_MIO_UARTX_STT(offset) \ | ||
200 | CVMX_ADD_IO_SEG(0x0001180000000B00ull + (((offset) & 1) * 1024)) | ||
201 | #define CVMX_MIO_UARTX_TFL(offset) \ | ||
202 | CVMX_ADD_IO_SEG(0x0001180000000A00ull + (((offset) & 1) * 1024)) | ||
203 | #define CVMX_MIO_UARTX_TFR(offset) \ | ||
204 | CVMX_ADD_IO_SEG(0x0001180000000928ull + (((offset) & 1) * 1024)) | ||
205 | #define CVMX_MIO_UARTX_THR(offset) \ | ||
206 | CVMX_ADD_IO_SEG(0x0001180000000840ull + (((offset) & 1) * 1024)) | ||
207 | #define CVMX_MIO_UARTX_USR(offset) \ | ||
208 | CVMX_ADD_IO_SEG(0x0001180000000938ull + (((offset) & 1) * 1024)) | ||
209 | |||
210 | union cvmx_mio_boot_bist_stat { | ||
211 | uint64_t u64; | ||
212 | struct cvmx_mio_boot_bist_stat_s { | ||
213 | uint64_t reserved_2_63:62; | ||
214 | uint64_t loc:1; | ||
215 | uint64_t ncbi:1; | ||
216 | } s; | ||
217 | struct cvmx_mio_boot_bist_stat_cn30xx { | ||
218 | uint64_t reserved_4_63:60; | ||
219 | uint64_t ncbo_1:1; | ||
220 | uint64_t ncbo_0:1; | ||
221 | uint64_t loc:1; | ||
222 | uint64_t ncbi:1; | ||
223 | } cn30xx; | ||
224 | struct cvmx_mio_boot_bist_stat_cn30xx cn31xx; | ||
225 | struct cvmx_mio_boot_bist_stat_cn38xx { | ||
226 | uint64_t reserved_3_63:61; | ||
227 | uint64_t ncbo_0:1; | ||
228 | uint64_t loc:1; | ||
229 | uint64_t ncbi:1; | ||
230 | } cn38xx; | ||
231 | struct cvmx_mio_boot_bist_stat_cn38xx cn38xxp2; | ||
232 | struct cvmx_mio_boot_bist_stat_cn50xx { | ||
233 | uint64_t reserved_6_63:58; | ||
234 | uint64_t pcm_1:1; | ||
235 | uint64_t pcm_0:1; | ||
236 | uint64_t ncbo_1:1; | ||
237 | uint64_t ncbo_0:1; | ||
238 | uint64_t loc:1; | ||
239 | uint64_t ncbi:1; | ||
240 | } cn50xx; | ||
241 | struct cvmx_mio_boot_bist_stat_cn52xx { | ||
242 | uint64_t reserved_6_63:58; | ||
243 | uint64_t ndf:2; | ||
244 | uint64_t ncbo_0:1; | ||
245 | uint64_t dma:1; | ||
246 | uint64_t loc:1; | ||
247 | uint64_t ncbi:1; | ||
248 | } cn52xx; | ||
249 | struct cvmx_mio_boot_bist_stat_cn52xxp1 { | ||
250 | uint64_t reserved_4_63:60; | ||
251 | uint64_t ncbo_0:1; | ||
252 | uint64_t dma:1; | ||
253 | uint64_t loc:1; | ||
254 | uint64_t ncbi:1; | ||
255 | } cn52xxp1; | ||
256 | struct cvmx_mio_boot_bist_stat_cn52xxp1 cn56xx; | ||
257 | struct cvmx_mio_boot_bist_stat_cn52xxp1 cn56xxp1; | ||
258 | struct cvmx_mio_boot_bist_stat_cn38xx cn58xx; | ||
259 | struct cvmx_mio_boot_bist_stat_cn38xx cn58xxp1; | ||
260 | }; | ||
261 | |||
262 | union cvmx_mio_boot_comp { | ||
263 | uint64_t u64; | ||
264 | struct cvmx_mio_boot_comp_s { | ||
265 | uint64_t reserved_10_63:54; | ||
266 | uint64_t pctl:5; | ||
267 | uint64_t nctl:5; | ||
268 | } s; | ||
269 | struct cvmx_mio_boot_comp_s cn50xx; | ||
270 | struct cvmx_mio_boot_comp_s cn52xx; | ||
271 | struct cvmx_mio_boot_comp_s cn52xxp1; | ||
272 | struct cvmx_mio_boot_comp_s cn56xx; | ||
273 | struct cvmx_mio_boot_comp_s cn56xxp1; | ||
274 | }; | ||
275 | |||
276 | union cvmx_mio_boot_dma_cfgx { | ||
277 | uint64_t u64; | ||
278 | struct cvmx_mio_boot_dma_cfgx_s { | ||
279 | uint64_t en:1; | ||
280 | uint64_t rw:1; | ||
281 | uint64_t clr:1; | ||
282 | uint64_t reserved_60_60:1; | ||
283 | uint64_t swap32:1; | ||
284 | uint64_t swap16:1; | ||
285 | uint64_t swap8:1; | ||
286 | uint64_t endian:1; | ||
287 | uint64_t size:20; | ||
288 | uint64_t adr:36; | ||
289 | } s; | ||
290 | struct cvmx_mio_boot_dma_cfgx_s cn52xx; | ||
291 | struct cvmx_mio_boot_dma_cfgx_s cn52xxp1; | ||
292 | struct cvmx_mio_boot_dma_cfgx_s cn56xx; | ||
293 | struct cvmx_mio_boot_dma_cfgx_s cn56xxp1; | ||
294 | }; | ||
295 | |||
296 | union cvmx_mio_boot_dma_intx { | ||
297 | uint64_t u64; | ||
298 | struct cvmx_mio_boot_dma_intx_s { | ||
299 | uint64_t reserved_2_63:62; | ||
300 | uint64_t dmarq:1; | ||
301 | uint64_t done:1; | ||
302 | } s; | ||
303 | struct cvmx_mio_boot_dma_intx_s cn52xx; | ||
304 | struct cvmx_mio_boot_dma_intx_s cn52xxp1; | ||
305 | struct cvmx_mio_boot_dma_intx_s cn56xx; | ||
306 | struct cvmx_mio_boot_dma_intx_s cn56xxp1; | ||
307 | }; | ||
308 | |||
309 | union cvmx_mio_boot_dma_int_enx { | ||
310 | uint64_t u64; | ||
311 | struct cvmx_mio_boot_dma_int_enx_s { | ||
312 | uint64_t reserved_2_63:62; | ||
313 | uint64_t dmarq:1; | ||
314 | uint64_t done:1; | ||
315 | } s; | ||
316 | struct cvmx_mio_boot_dma_int_enx_s cn52xx; | ||
317 | struct cvmx_mio_boot_dma_int_enx_s cn52xxp1; | ||
318 | struct cvmx_mio_boot_dma_int_enx_s cn56xx; | ||
319 | struct cvmx_mio_boot_dma_int_enx_s cn56xxp1; | ||
320 | }; | ||
321 | |||
322 | union cvmx_mio_boot_dma_timx { | ||
323 | uint64_t u64; | ||
324 | struct cvmx_mio_boot_dma_timx_s { | ||
325 | uint64_t dmack_pi:1; | ||
326 | uint64_t dmarq_pi:1; | ||
327 | uint64_t tim_mult:2; | ||
328 | uint64_t rd_dly:3; | ||
329 | uint64_t ddr:1; | ||
330 | uint64_t width:1; | ||
331 | uint64_t reserved_48_54:7; | ||
332 | uint64_t pause:6; | ||
333 | uint64_t dmack_h:6; | ||
334 | uint64_t we_n:6; | ||
335 | uint64_t we_a:6; | ||
336 | uint64_t oe_n:6; | ||
337 | uint64_t oe_a:6; | ||
338 | uint64_t dmack_s:6; | ||
339 | uint64_t dmarq:6; | ||
340 | } s; | ||
341 | struct cvmx_mio_boot_dma_timx_s cn52xx; | ||
342 | struct cvmx_mio_boot_dma_timx_s cn52xxp1; | ||
343 | struct cvmx_mio_boot_dma_timx_s cn56xx; | ||
344 | struct cvmx_mio_boot_dma_timx_s cn56xxp1; | ||
345 | }; | ||
346 | |||
347 | union cvmx_mio_boot_err { | ||
348 | uint64_t u64; | ||
349 | struct cvmx_mio_boot_err_s { | ||
350 | uint64_t reserved_2_63:62; | ||
351 | uint64_t wait_err:1; | ||
352 | uint64_t adr_err:1; | ||
353 | } s; | ||
354 | struct cvmx_mio_boot_err_s cn30xx; | ||
355 | struct cvmx_mio_boot_err_s cn31xx; | ||
356 | struct cvmx_mio_boot_err_s cn38xx; | ||
357 | struct cvmx_mio_boot_err_s cn38xxp2; | ||
358 | struct cvmx_mio_boot_err_s cn50xx; | ||
359 | struct cvmx_mio_boot_err_s cn52xx; | ||
360 | struct cvmx_mio_boot_err_s cn52xxp1; | ||
361 | struct cvmx_mio_boot_err_s cn56xx; | ||
362 | struct cvmx_mio_boot_err_s cn56xxp1; | ||
363 | struct cvmx_mio_boot_err_s cn58xx; | ||
364 | struct cvmx_mio_boot_err_s cn58xxp1; | ||
365 | }; | ||
366 | |||
367 | union cvmx_mio_boot_int { | ||
368 | uint64_t u64; | ||
369 | struct cvmx_mio_boot_int_s { | ||
370 | uint64_t reserved_2_63:62; | ||
371 | uint64_t wait_int:1; | ||
372 | uint64_t adr_int:1; | ||
373 | } s; | ||
374 | struct cvmx_mio_boot_int_s cn30xx; | ||
375 | struct cvmx_mio_boot_int_s cn31xx; | ||
376 | struct cvmx_mio_boot_int_s cn38xx; | ||
377 | struct cvmx_mio_boot_int_s cn38xxp2; | ||
378 | struct cvmx_mio_boot_int_s cn50xx; | ||
379 | struct cvmx_mio_boot_int_s cn52xx; | ||
380 | struct cvmx_mio_boot_int_s cn52xxp1; | ||
381 | struct cvmx_mio_boot_int_s cn56xx; | ||
382 | struct cvmx_mio_boot_int_s cn56xxp1; | ||
383 | struct cvmx_mio_boot_int_s cn58xx; | ||
384 | struct cvmx_mio_boot_int_s cn58xxp1; | ||
385 | }; | ||
386 | |||
387 | union cvmx_mio_boot_loc_adr { | ||
388 | uint64_t u64; | ||
389 | struct cvmx_mio_boot_loc_adr_s { | ||
390 | uint64_t reserved_8_63:56; | ||
391 | uint64_t adr:5; | ||
392 | uint64_t reserved_0_2:3; | ||
393 | } s; | ||
394 | struct cvmx_mio_boot_loc_adr_s cn30xx; | ||
395 | struct cvmx_mio_boot_loc_adr_s cn31xx; | ||
396 | struct cvmx_mio_boot_loc_adr_s cn38xx; | ||
397 | struct cvmx_mio_boot_loc_adr_s cn38xxp2; | ||
398 | struct cvmx_mio_boot_loc_adr_s cn50xx; | ||
399 | struct cvmx_mio_boot_loc_adr_s cn52xx; | ||
400 | struct cvmx_mio_boot_loc_adr_s cn52xxp1; | ||
401 | struct cvmx_mio_boot_loc_adr_s cn56xx; | ||
402 | struct cvmx_mio_boot_loc_adr_s cn56xxp1; | ||
403 | struct cvmx_mio_boot_loc_adr_s cn58xx; | ||
404 | struct cvmx_mio_boot_loc_adr_s cn58xxp1; | ||
405 | }; | ||
406 | |||
407 | union cvmx_mio_boot_loc_cfgx { | ||
408 | uint64_t u64; | ||
409 | struct cvmx_mio_boot_loc_cfgx_s { | ||
410 | uint64_t reserved_32_63:32; | ||
411 | uint64_t en:1; | ||
412 | uint64_t reserved_28_30:3; | ||
413 | uint64_t base:25; | ||
414 | uint64_t reserved_0_2:3; | ||
415 | } s; | ||
416 | struct cvmx_mio_boot_loc_cfgx_s cn30xx; | ||
417 | struct cvmx_mio_boot_loc_cfgx_s cn31xx; | ||
418 | struct cvmx_mio_boot_loc_cfgx_s cn38xx; | ||
419 | struct cvmx_mio_boot_loc_cfgx_s cn38xxp2; | ||
420 | struct cvmx_mio_boot_loc_cfgx_s cn50xx; | ||
421 | struct cvmx_mio_boot_loc_cfgx_s cn52xx; | ||
422 | struct cvmx_mio_boot_loc_cfgx_s cn52xxp1; | ||
423 | struct cvmx_mio_boot_loc_cfgx_s cn56xx; | ||
424 | struct cvmx_mio_boot_loc_cfgx_s cn56xxp1; | ||
425 | struct cvmx_mio_boot_loc_cfgx_s cn58xx; | ||
426 | struct cvmx_mio_boot_loc_cfgx_s cn58xxp1; | ||
427 | }; | ||
428 | |||
429 | union cvmx_mio_boot_loc_dat { | ||
430 | uint64_t u64; | ||
431 | struct cvmx_mio_boot_loc_dat_s { | ||
432 | uint64_t data:64; | ||
433 | } s; | ||
434 | struct cvmx_mio_boot_loc_dat_s cn30xx; | ||
435 | struct cvmx_mio_boot_loc_dat_s cn31xx; | ||
436 | struct cvmx_mio_boot_loc_dat_s cn38xx; | ||
437 | struct cvmx_mio_boot_loc_dat_s cn38xxp2; | ||
438 | struct cvmx_mio_boot_loc_dat_s cn50xx; | ||
439 | struct cvmx_mio_boot_loc_dat_s cn52xx; | ||
440 | struct cvmx_mio_boot_loc_dat_s cn52xxp1; | ||
441 | struct cvmx_mio_boot_loc_dat_s cn56xx; | ||
442 | struct cvmx_mio_boot_loc_dat_s cn56xxp1; | ||
443 | struct cvmx_mio_boot_loc_dat_s cn58xx; | ||
444 | struct cvmx_mio_boot_loc_dat_s cn58xxp1; | ||
445 | }; | ||
446 | |||
447 | union cvmx_mio_boot_pin_defs { | ||
448 | uint64_t u64; | ||
449 | struct cvmx_mio_boot_pin_defs_s { | ||
450 | uint64_t reserved_16_63:48; | ||
451 | uint64_t ale:1; | ||
452 | uint64_t width:1; | ||
453 | uint64_t dmack_p2:1; | ||
454 | uint64_t dmack_p1:1; | ||
455 | uint64_t dmack_p0:1; | ||
456 | uint64_t term:2; | ||
457 | uint64_t nand:1; | ||
458 | uint64_t reserved_0_7:8; | ||
459 | } s; | ||
460 | struct cvmx_mio_boot_pin_defs_cn52xx { | ||
461 | uint64_t reserved_16_63:48; | ||
462 | uint64_t ale:1; | ||
463 | uint64_t width:1; | ||
464 | uint64_t reserved_13_13:1; | ||
465 | uint64_t dmack_p1:1; | ||
466 | uint64_t dmack_p0:1; | ||
467 | uint64_t term:2; | ||
468 | uint64_t nand:1; | ||
469 | uint64_t reserved_0_7:8; | ||
470 | } cn52xx; | ||
471 | struct cvmx_mio_boot_pin_defs_cn56xx { | ||
472 | uint64_t reserved_16_63:48; | ||
473 | uint64_t ale:1; | ||
474 | uint64_t width:1; | ||
475 | uint64_t dmack_p2:1; | ||
476 | uint64_t dmack_p1:1; | ||
477 | uint64_t dmack_p0:1; | ||
478 | uint64_t term:2; | ||
479 | uint64_t reserved_0_8:9; | ||
480 | } cn56xx; | ||
481 | }; | ||
482 | |||
483 | union cvmx_mio_boot_reg_cfgx { | ||
484 | uint64_t u64; | ||
485 | struct cvmx_mio_boot_reg_cfgx_s { | ||
486 | uint64_t reserved_44_63:20; | ||
487 | uint64_t dmack:2; | ||
488 | uint64_t tim_mult:2; | ||
489 | uint64_t rd_dly:3; | ||
490 | uint64_t sam:1; | ||
491 | uint64_t we_ext:2; | ||
492 | uint64_t oe_ext:2; | ||
493 | uint64_t en:1; | ||
494 | uint64_t orbit:1; | ||
495 | uint64_t ale:1; | ||
496 | uint64_t width:1; | ||
497 | uint64_t size:12; | ||
498 | uint64_t base:16; | ||
499 | } s; | ||
500 | struct cvmx_mio_boot_reg_cfgx_cn30xx { | ||
501 | uint64_t reserved_37_63:27; | ||
502 | uint64_t sam:1; | ||
503 | uint64_t we_ext:2; | ||
504 | uint64_t oe_ext:2; | ||
505 | uint64_t en:1; | ||
506 | uint64_t orbit:1; | ||
507 | uint64_t ale:1; | ||
508 | uint64_t width:1; | ||
509 | uint64_t size:12; | ||
510 | uint64_t base:16; | ||
511 | } cn30xx; | ||
512 | struct cvmx_mio_boot_reg_cfgx_cn30xx cn31xx; | ||
513 | struct cvmx_mio_boot_reg_cfgx_cn38xx { | ||
514 | uint64_t reserved_32_63:32; | ||
515 | uint64_t en:1; | ||
516 | uint64_t orbit:1; | ||
517 | uint64_t reserved_28_29:2; | ||
518 | uint64_t size:12; | ||
519 | uint64_t base:16; | ||
520 | } cn38xx; | ||
521 | struct cvmx_mio_boot_reg_cfgx_cn38xx cn38xxp2; | ||
522 | struct cvmx_mio_boot_reg_cfgx_cn50xx { | ||
523 | uint64_t reserved_42_63:22; | ||
524 | uint64_t tim_mult:2; | ||
525 | uint64_t rd_dly:3; | ||
526 | uint64_t sam:1; | ||
527 | uint64_t we_ext:2; | ||
528 | uint64_t oe_ext:2; | ||
529 | uint64_t en:1; | ||
530 | uint64_t orbit:1; | ||
531 | uint64_t ale:1; | ||
532 | uint64_t width:1; | ||
533 | uint64_t size:12; | ||
534 | uint64_t base:16; | ||
535 | } cn50xx; | ||
536 | struct cvmx_mio_boot_reg_cfgx_s cn52xx; | ||
537 | struct cvmx_mio_boot_reg_cfgx_s cn52xxp1; | ||
538 | struct cvmx_mio_boot_reg_cfgx_s cn56xx; | ||
539 | struct cvmx_mio_boot_reg_cfgx_s cn56xxp1; | ||
540 | struct cvmx_mio_boot_reg_cfgx_cn30xx cn58xx; | ||
541 | struct cvmx_mio_boot_reg_cfgx_cn30xx cn58xxp1; | ||
542 | }; | ||
543 | |||
544 | union cvmx_mio_boot_reg_timx { | ||
545 | uint64_t u64; | ||
546 | struct cvmx_mio_boot_reg_timx_s { | ||
547 | uint64_t pagem:1; | ||
548 | uint64_t waitm:1; | ||
549 | uint64_t pages:2; | ||
550 | uint64_t ale:6; | ||
551 | uint64_t page:6; | ||
552 | uint64_t wait:6; | ||
553 | uint64_t pause:6; | ||
554 | uint64_t wr_hld:6; | ||
555 | uint64_t rd_hld:6; | ||
556 | uint64_t we:6; | ||
557 | uint64_t oe:6; | ||
558 | uint64_t ce:6; | ||
559 | uint64_t adr:6; | ||
560 | } s; | ||
561 | struct cvmx_mio_boot_reg_timx_s cn30xx; | ||
562 | struct cvmx_mio_boot_reg_timx_s cn31xx; | ||
563 | struct cvmx_mio_boot_reg_timx_cn38xx { | ||
564 | uint64_t pagem:1; | ||
565 | uint64_t waitm:1; | ||
566 | uint64_t pages:2; | ||
567 | uint64_t reserved_54_59:6; | ||
568 | uint64_t page:6; | ||
569 | uint64_t wait:6; | ||
570 | uint64_t pause:6; | ||
571 | uint64_t wr_hld:6; | ||
572 | uint64_t rd_hld:6; | ||
573 | uint64_t we:6; | ||
574 | uint64_t oe:6; | ||
575 | uint64_t ce:6; | ||
576 | uint64_t adr:6; | ||
577 | } cn38xx; | ||
578 | struct cvmx_mio_boot_reg_timx_cn38xx cn38xxp2; | ||
579 | struct cvmx_mio_boot_reg_timx_s cn50xx; | ||
580 | struct cvmx_mio_boot_reg_timx_s cn52xx; | ||
581 | struct cvmx_mio_boot_reg_timx_s cn52xxp1; | ||
582 | struct cvmx_mio_boot_reg_timx_s cn56xx; | ||
583 | struct cvmx_mio_boot_reg_timx_s cn56xxp1; | ||
584 | struct cvmx_mio_boot_reg_timx_s cn58xx; | ||
585 | struct cvmx_mio_boot_reg_timx_s cn58xxp1; | ||
586 | }; | ||
587 | |||
588 | union cvmx_mio_boot_thr { | ||
589 | uint64_t u64; | ||
590 | struct cvmx_mio_boot_thr_s { | ||
591 | uint64_t reserved_22_63:42; | ||
592 | uint64_t dma_thr:6; | ||
593 | uint64_t reserved_14_15:2; | ||
594 | uint64_t fif_cnt:6; | ||
595 | uint64_t reserved_6_7:2; | ||
596 | uint64_t fif_thr:6; | ||
597 | } s; | ||
598 | struct cvmx_mio_boot_thr_cn30xx { | ||
599 | uint64_t reserved_14_63:50; | ||
600 | uint64_t fif_cnt:6; | ||
601 | uint64_t reserved_6_7:2; | ||
602 | uint64_t fif_thr:6; | ||
603 | } cn30xx; | ||
604 | struct cvmx_mio_boot_thr_cn30xx cn31xx; | ||
605 | struct cvmx_mio_boot_thr_cn30xx cn38xx; | ||
606 | struct cvmx_mio_boot_thr_cn30xx cn38xxp2; | ||
607 | struct cvmx_mio_boot_thr_cn30xx cn50xx; | ||
608 | struct cvmx_mio_boot_thr_s cn52xx; | ||
609 | struct cvmx_mio_boot_thr_s cn52xxp1; | ||
610 | struct cvmx_mio_boot_thr_s cn56xx; | ||
611 | struct cvmx_mio_boot_thr_s cn56xxp1; | ||
612 | struct cvmx_mio_boot_thr_cn30xx cn58xx; | ||
613 | struct cvmx_mio_boot_thr_cn30xx cn58xxp1; | ||
614 | }; | ||
615 | |||
616 | union cvmx_mio_fus_bnk_datx { | ||
617 | uint64_t u64; | ||
618 | struct cvmx_mio_fus_bnk_datx_s { | ||
619 | uint64_t dat:64; | ||
620 | } s; | ||
621 | struct cvmx_mio_fus_bnk_datx_s cn50xx; | ||
622 | struct cvmx_mio_fus_bnk_datx_s cn52xx; | ||
623 | struct cvmx_mio_fus_bnk_datx_s cn52xxp1; | ||
624 | struct cvmx_mio_fus_bnk_datx_s cn56xx; | ||
625 | struct cvmx_mio_fus_bnk_datx_s cn56xxp1; | ||
626 | struct cvmx_mio_fus_bnk_datx_s cn58xx; | ||
627 | struct cvmx_mio_fus_bnk_datx_s cn58xxp1; | ||
628 | }; | ||
629 | |||
630 | union cvmx_mio_fus_dat0 { | ||
631 | uint64_t u64; | ||
632 | struct cvmx_mio_fus_dat0_s { | ||
633 | uint64_t reserved_32_63:32; | ||
634 | uint64_t man_info:32; | ||
635 | } s; | ||
636 | struct cvmx_mio_fus_dat0_s cn30xx; | ||
637 | struct cvmx_mio_fus_dat0_s cn31xx; | ||
638 | struct cvmx_mio_fus_dat0_s cn38xx; | ||
639 | struct cvmx_mio_fus_dat0_s cn38xxp2; | ||
640 | struct cvmx_mio_fus_dat0_s cn50xx; | ||
641 | struct cvmx_mio_fus_dat0_s cn52xx; | ||
642 | struct cvmx_mio_fus_dat0_s cn52xxp1; | ||
643 | struct cvmx_mio_fus_dat0_s cn56xx; | ||
644 | struct cvmx_mio_fus_dat0_s cn56xxp1; | ||
645 | struct cvmx_mio_fus_dat0_s cn58xx; | ||
646 | struct cvmx_mio_fus_dat0_s cn58xxp1; | ||
647 | }; | ||
648 | |||
649 | union cvmx_mio_fus_dat1 { | ||
650 | uint64_t u64; | ||
651 | struct cvmx_mio_fus_dat1_s { | ||
652 | uint64_t reserved_32_63:32; | ||
653 | uint64_t man_info:32; | ||
654 | } s; | ||
655 | struct cvmx_mio_fus_dat1_s cn30xx; | ||
656 | struct cvmx_mio_fus_dat1_s cn31xx; | ||
657 | struct cvmx_mio_fus_dat1_s cn38xx; | ||
658 | struct cvmx_mio_fus_dat1_s cn38xxp2; | ||
659 | struct cvmx_mio_fus_dat1_s cn50xx; | ||
660 | struct cvmx_mio_fus_dat1_s cn52xx; | ||
661 | struct cvmx_mio_fus_dat1_s cn52xxp1; | ||
662 | struct cvmx_mio_fus_dat1_s cn56xx; | ||
663 | struct cvmx_mio_fus_dat1_s cn56xxp1; | ||
664 | struct cvmx_mio_fus_dat1_s cn58xx; | ||
665 | struct cvmx_mio_fus_dat1_s cn58xxp1; | ||
666 | }; | ||
667 | |||
668 | union cvmx_mio_fus_dat2 { | ||
669 | uint64_t u64; | ||
670 | struct cvmx_mio_fus_dat2_s { | ||
671 | uint64_t reserved_34_63:30; | ||
672 | uint64_t fus318:1; | ||
673 | uint64_t raid_en:1; | ||
674 | uint64_t reserved_30_31:2; | ||
675 | uint64_t nokasu:1; | ||
676 | uint64_t nodfa_cp2:1; | ||
677 | uint64_t nomul:1; | ||
678 | uint64_t nocrypto:1; | ||
679 | uint64_t rst_sht:1; | ||
680 | uint64_t bist_dis:1; | ||
681 | uint64_t chip_id:8; | ||
682 | uint64_t reserved_0_15:16; | ||
683 | } s; | ||
684 | struct cvmx_mio_fus_dat2_cn30xx { | ||
685 | uint64_t reserved_29_63:35; | ||
686 | uint64_t nodfa_cp2:1; | ||
687 | uint64_t nomul:1; | ||
688 | uint64_t nocrypto:1; | ||
689 | uint64_t rst_sht:1; | ||
690 | uint64_t bist_dis:1; | ||
691 | uint64_t chip_id:8; | ||
692 | uint64_t pll_off:4; | ||
693 | uint64_t reserved_1_11:11; | ||
694 | uint64_t pp_dis:1; | ||
695 | } cn30xx; | ||
696 | struct cvmx_mio_fus_dat2_cn31xx { | ||
697 | uint64_t reserved_29_63:35; | ||
698 | uint64_t nodfa_cp2:1; | ||
699 | uint64_t nomul:1; | ||
700 | uint64_t nocrypto:1; | ||
701 | uint64_t rst_sht:1; | ||
702 | uint64_t bist_dis:1; | ||
703 | uint64_t chip_id:8; | ||
704 | uint64_t pll_off:4; | ||
705 | uint64_t reserved_2_11:10; | ||
706 | uint64_t pp_dis:2; | ||
707 | } cn31xx; | ||
708 | struct cvmx_mio_fus_dat2_cn38xx { | ||
709 | uint64_t reserved_29_63:35; | ||
710 | uint64_t nodfa_cp2:1; | ||
711 | uint64_t nomul:1; | ||
712 | uint64_t nocrypto:1; | ||
713 | uint64_t rst_sht:1; | ||
714 | uint64_t bist_dis:1; | ||
715 | uint64_t chip_id:8; | ||
716 | uint64_t pp_dis:16; | ||
717 | } cn38xx; | ||
718 | struct cvmx_mio_fus_dat2_cn38xx cn38xxp2; | ||
719 | struct cvmx_mio_fus_dat2_cn50xx { | ||
720 | uint64_t reserved_34_63:30; | ||
721 | uint64_t fus318:1; | ||
722 | uint64_t raid_en:1; | ||
723 | uint64_t reserved_30_31:2; | ||
724 | uint64_t nokasu:1; | ||
725 | uint64_t nodfa_cp2:1; | ||
726 | uint64_t nomul:1; | ||
727 | uint64_t nocrypto:1; | ||
728 | uint64_t rst_sht:1; | ||
729 | uint64_t bist_dis:1; | ||
730 | uint64_t chip_id:8; | ||
731 | uint64_t reserved_2_15:14; | ||
732 | uint64_t pp_dis:2; | ||
733 | } cn50xx; | ||
734 | struct cvmx_mio_fus_dat2_cn52xx { | ||
735 | uint64_t reserved_34_63:30; | ||
736 | uint64_t fus318:1; | ||
737 | uint64_t raid_en:1; | ||
738 | uint64_t reserved_30_31:2; | ||
739 | uint64_t nokasu:1; | ||
740 | uint64_t nodfa_cp2:1; | ||
741 | uint64_t nomul:1; | ||
742 | uint64_t nocrypto:1; | ||
743 | uint64_t rst_sht:1; | ||
744 | uint64_t bist_dis:1; | ||
745 | uint64_t chip_id:8; | ||
746 | uint64_t reserved_4_15:12; | ||
747 | uint64_t pp_dis:4; | ||
748 | } cn52xx; | ||
749 | struct cvmx_mio_fus_dat2_cn52xx cn52xxp1; | ||
750 | struct cvmx_mio_fus_dat2_cn56xx { | ||
751 | uint64_t reserved_34_63:30; | ||
752 | uint64_t fus318:1; | ||
753 | uint64_t raid_en:1; | ||
754 | uint64_t reserved_30_31:2; | ||
755 | uint64_t nokasu:1; | ||
756 | uint64_t nodfa_cp2:1; | ||
757 | uint64_t nomul:1; | ||
758 | uint64_t nocrypto:1; | ||
759 | uint64_t rst_sht:1; | ||
760 | uint64_t bist_dis:1; | ||
761 | uint64_t chip_id:8; | ||
762 | uint64_t reserved_12_15:4; | ||
763 | uint64_t pp_dis:12; | ||
764 | } cn56xx; | ||
765 | struct cvmx_mio_fus_dat2_cn56xx cn56xxp1; | ||
766 | struct cvmx_mio_fus_dat2_cn58xx { | ||
767 | uint64_t reserved_30_63:34; | ||
768 | uint64_t nokasu:1; | ||
769 | uint64_t nodfa_cp2:1; | ||
770 | uint64_t nomul:1; | ||
771 | uint64_t nocrypto:1; | ||
772 | uint64_t rst_sht:1; | ||
773 | uint64_t bist_dis:1; | ||
774 | uint64_t chip_id:8; | ||
775 | uint64_t pp_dis:16; | ||
776 | } cn58xx; | ||
777 | struct cvmx_mio_fus_dat2_cn58xx cn58xxp1; | ||
778 | }; | ||
779 | |||
780 | union cvmx_mio_fus_dat3 { | ||
781 | uint64_t u64; | ||
782 | struct cvmx_mio_fus_dat3_s { | ||
783 | uint64_t reserved_32_63:32; | ||
784 | uint64_t pll_div4:1; | ||
785 | uint64_t zip_crip:2; | ||
786 | uint64_t bar2_en:1; | ||
787 | uint64_t efus_lck:1; | ||
788 | uint64_t efus_ign:1; | ||
789 | uint64_t nozip:1; | ||
790 | uint64_t nodfa_dte:1; | ||
791 | uint64_t icache:24; | ||
792 | } s; | ||
793 | struct cvmx_mio_fus_dat3_cn30xx { | ||
794 | uint64_t reserved_32_63:32; | ||
795 | uint64_t pll_div4:1; | ||
796 | uint64_t reserved_29_30:2; | ||
797 | uint64_t bar2_en:1; | ||
798 | uint64_t efus_lck:1; | ||
799 | uint64_t efus_ign:1; | ||
800 | uint64_t nozip:1; | ||
801 | uint64_t nodfa_dte:1; | ||
802 | uint64_t icache:24; | ||
803 | } cn30xx; | ||
804 | struct cvmx_mio_fus_dat3_s cn31xx; | ||
805 | struct cvmx_mio_fus_dat3_cn38xx { | ||
806 | uint64_t reserved_31_63:33; | ||
807 | uint64_t zip_crip:2; | ||
808 | uint64_t bar2_en:1; | ||
809 | uint64_t efus_lck:1; | ||
810 | uint64_t efus_ign:1; | ||
811 | uint64_t nozip:1; | ||
812 | uint64_t nodfa_dte:1; | ||
813 | uint64_t icache:24; | ||
814 | } cn38xx; | ||
815 | struct cvmx_mio_fus_dat3_cn38xxp2 { | ||
816 | uint64_t reserved_29_63:35; | ||
817 | uint64_t bar2_en:1; | ||
818 | uint64_t efus_lck:1; | ||
819 | uint64_t efus_ign:1; | ||
820 | uint64_t nozip:1; | ||
821 | uint64_t nodfa_dte:1; | ||
822 | uint64_t icache:24; | ||
823 | } cn38xxp2; | ||
824 | struct cvmx_mio_fus_dat3_cn38xx cn50xx; | ||
825 | struct cvmx_mio_fus_dat3_cn38xx cn52xx; | ||
826 | struct cvmx_mio_fus_dat3_cn38xx cn52xxp1; | ||
827 | struct cvmx_mio_fus_dat3_cn38xx cn56xx; | ||
828 | struct cvmx_mio_fus_dat3_cn38xx cn56xxp1; | ||
829 | struct cvmx_mio_fus_dat3_cn38xx cn58xx; | ||
830 | struct cvmx_mio_fus_dat3_cn38xx cn58xxp1; | ||
831 | }; | ||
832 | |||
833 | union cvmx_mio_fus_ema { | ||
834 | uint64_t u64; | ||
835 | struct cvmx_mio_fus_ema_s { | ||
836 | uint64_t reserved_7_63:57; | ||
837 | uint64_t eff_ema:3; | ||
838 | uint64_t reserved_3_3:1; | ||
839 | uint64_t ema:3; | ||
840 | } s; | ||
841 | struct cvmx_mio_fus_ema_s cn50xx; | ||
842 | struct cvmx_mio_fus_ema_s cn52xx; | ||
843 | struct cvmx_mio_fus_ema_s cn52xxp1; | ||
844 | struct cvmx_mio_fus_ema_s cn56xx; | ||
845 | struct cvmx_mio_fus_ema_s cn56xxp1; | ||
846 | struct cvmx_mio_fus_ema_cn58xx { | ||
847 | uint64_t reserved_2_63:62; | ||
848 | uint64_t ema:2; | ||
849 | } cn58xx; | ||
850 | struct cvmx_mio_fus_ema_cn58xx cn58xxp1; | ||
851 | }; | ||
852 | |||
853 | union cvmx_mio_fus_pdf { | ||
854 | uint64_t u64; | ||
855 | struct cvmx_mio_fus_pdf_s { | ||
856 | uint64_t pdf:64; | ||
857 | } s; | ||
858 | struct cvmx_mio_fus_pdf_s cn50xx; | ||
859 | struct cvmx_mio_fus_pdf_s cn52xx; | ||
860 | struct cvmx_mio_fus_pdf_s cn52xxp1; | ||
861 | struct cvmx_mio_fus_pdf_s cn56xx; | ||
862 | struct cvmx_mio_fus_pdf_s cn56xxp1; | ||
863 | struct cvmx_mio_fus_pdf_s cn58xx; | ||
864 | }; | ||
865 | |||
866 | union cvmx_mio_fus_pll { | ||
867 | uint64_t u64; | ||
868 | struct cvmx_mio_fus_pll_s { | ||
869 | uint64_t reserved_2_63:62; | ||
870 | uint64_t rfslip:1; | ||
871 | uint64_t fbslip:1; | ||
872 | } s; | ||
873 | struct cvmx_mio_fus_pll_s cn50xx; | ||
874 | struct cvmx_mio_fus_pll_s cn52xx; | ||
875 | struct cvmx_mio_fus_pll_s cn52xxp1; | ||
876 | struct cvmx_mio_fus_pll_s cn56xx; | ||
877 | struct cvmx_mio_fus_pll_s cn56xxp1; | ||
878 | struct cvmx_mio_fus_pll_s cn58xx; | ||
879 | struct cvmx_mio_fus_pll_s cn58xxp1; | ||
880 | }; | ||
881 | |||
882 | union cvmx_mio_fus_prog { | ||
883 | uint64_t u64; | ||
884 | struct cvmx_mio_fus_prog_s { | ||
885 | uint64_t reserved_1_63:63; | ||
886 | uint64_t prog:1; | ||
887 | } s; | ||
888 | struct cvmx_mio_fus_prog_s cn30xx; | ||
889 | struct cvmx_mio_fus_prog_s cn31xx; | ||
890 | struct cvmx_mio_fus_prog_s cn38xx; | ||
891 | struct cvmx_mio_fus_prog_s cn38xxp2; | ||
892 | struct cvmx_mio_fus_prog_s cn50xx; | ||
893 | struct cvmx_mio_fus_prog_s cn52xx; | ||
894 | struct cvmx_mio_fus_prog_s cn52xxp1; | ||
895 | struct cvmx_mio_fus_prog_s cn56xx; | ||
896 | struct cvmx_mio_fus_prog_s cn56xxp1; | ||
897 | struct cvmx_mio_fus_prog_s cn58xx; | ||
898 | struct cvmx_mio_fus_prog_s cn58xxp1; | ||
899 | }; | ||
900 | |||
901 | union cvmx_mio_fus_prog_times { | ||
902 | uint64_t u64; | ||
903 | struct cvmx_mio_fus_prog_times_s { | ||
904 | uint64_t reserved_33_63:31; | ||
905 | uint64_t prog_pin:1; | ||
906 | uint64_t out:8; | ||
907 | uint64_t sclk_lo:4; | ||
908 | uint64_t sclk_hi:12; | ||
909 | uint64_t setup:8; | ||
910 | } s; | ||
911 | struct cvmx_mio_fus_prog_times_s cn50xx; | ||
912 | struct cvmx_mio_fus_prog_times_s cn52xx; | ||
913 | struct cvmx_mio_fus_prog_times_s cn52xxp1; | ||
914 | struct cvmx_mio_fus_prog_times_s cn56xx; | ||
915 | struct cvmx_mio_fus_prog_times_s cn56xxp1; | ||
916 | struct cvmx_mio_fus_prog_times_s cn58xx; | ||
917 | struct cvmx_mio_fus_prog_times_s cn58xxp1; | ||
918 | }; | ||
919 | |||
920 | union cvmx_mio_fus_rcmd { | ||
921 | uint64_t u64; | ||
922 | struct cvmx_mio_fus_rcmd_s { | ||
923 | uint64_t reserved_24_63:40; | ||
924 | uint64_t dat:8; | ||
925 | uint64_t reserved_13_15:3; | ||
926 | uint64_t pend:1; | ||
927 | uint64_t reserved_9_11:3; | ||
928 | uint64_t efuse:1; | ||
929 | uint64_t addr:8; | ||
930 | } s; | ||
931 | struct cvmx_mio_fus_rcmd_cn30xx { | ||
932 | uint64_t reserved_24_63:40; | ||
933 | uint64_t dat:8; | ||
934 | uint64_t reserved_13_15:3; | ||
935 | uint64_t pend:1; | ||
936 | uint64_t reserved_9_11:3; | ||
937 | uint64_t efuse:1; | ||
938 | uint64_t reserved_7_7:1; | ||
939 | uint64_t addr:7; | ||
940 | } cn30xx; | ||
941 | struct cvmx_mio_fus_rcmd_cn30xx cn31xx; | ||
942 | struct cvmx_mio_fus_rcmd_cn30xx cn38xx; | ||
943 | struct cvmx_mio_fus_rcmd_cn30xx cn38xxp2; | ||
944 | struct cvmx_mio_fus_rcmd_cn30xx cn50xx; | ||
945 | struct cvmx_mio_fus_rcmd_s cn52xx; | ||
946 | struct cvmx_mio_fus_rcmd_s cn52xxp1; | ||
947 | struct cvmx_mio_fus_rcmd_s cn56xx; | ||
948 | struct cvmx_mio_fus_rcmd_s cn56xxp1; | ||
949 | struct cvmx_mio_fus_rcmd_cn30xx cn58xx; | ||
950 | struct cvmx_mio_fus_rcmd_cn30xx cn58xxp1; | ||
951 | }; | ||
952 | |||
953 | union cvmx_mio_fus_spr_repair_res { | ||
954 | uint64_t u64; | ||
955 | struct cvmx_mio_fus_spr_repair_res_s { | ||
956 | uint64_t reserved_42_63:22; | ||
957 | uint64_t repair2:14; | ||
958 | uint64_t repair1:14; | ||
959 | uint64_t repair0:14; | ||
960 | } s; | ||
961 | struct cvmx_mio_fus_spr_repair_res_s cn30xx; | ||
962 | struct cvmx_mio_fus_spr_repair_res_s cn31xx; | ||
963 | struct cvmx_mio_fus_spr_repair_res_s cn38xx; | ||
964 | struct cvmx_mio_fus_spr_repair_res_s cn50xx; | ||
965 | struct cvmx_mio_fus_spr_repair_res_s cn52xx; | ||
966 | struct cvmx_mio_fus_spr_repair_res_s cn52xxp1; | ||
967 | struct cvmx_mio_fus_spr_repair_res_s cn56xx; | ||
968 | struct cvmx_mio_fus_spr_repair_res_s cn56xxp1; | ||
969 | struct cvmx_mio_fus_spr_repair_res_s cn58xx; | ||
970 | struct cvmx_mio_fus_spr_repair_res_s cn58xxp1; | ||
971 | }; | ||
972 | |||
973 | union cvmx_mio_fus_spr_repair_sum { | ||
974 | uint64_t u64; | ||
975 | struct cvmx_mio_fus_spr_repair_sum_s { | ||
976 | uint64_t reserved_1_63:63; | ||
977 | uint64_t too_many:1; | ||
978 | } s; | ||
979 | struct cvmx_mio_fus_spr_repair_sum_s cn30xx; | ||
980 | struct cvmx_mio_fus_spr_repair_sum_s cn31xx; | ||
981 | struct cvmx_mio_fus_spr_repair_sum_s cn38xx; | ||
982 | struct cvmx_mio_fus_spr_repair_sum_s cn50xx; | ||
983 | struct cvmx_mio_fus_spr_repair_sum_s cn52xx; | ||
984 | struct cvmx_mio_fus_spr_repair_sum_s cn52xxp1; | ||
985 | struct cvmx_mio_fus_spr_repair_sum_s cn56xx; | ||
986 | struct cvmx_mio_fus_spr_repair_sum_s cn56xxp1; | ||
987 | struct cvmx_mio_fus_spr_repair_sum_s cn58xx; | ||
988 | struct cvmx_mio_fus_spr_repair_sum_s cn58xxp1; | ||
989 | }; | ||
990 | |||
991 | union cvmx_mio_fus_unlock { | ||
992 | uint64_t u64; | ||
993 | struct cvmx_mio_fus_unlock_s { | ||
994 | uint64_t reserved_24_63:40; | ||
995 | uint64_t key:24; | ||
996 | } s; | ||
997 | struct cvmx_mio_fus_unlock_s cn30xx; | ||
998 | struct cvmx_mio_fus_unlock_s cn31xx; | ||
999 | }; | ||
1000 | |||
1001 | union cvmx_mio_fus_wadr { | ||
1002 | uint64_t u64; | ||
1003 | struct cvmx_mio_fus_wadr_s { | ||
1004 | uint64_t reserved_10_63:54; | ||
1005 | uint64_t addr:10; | ||
1006 | } s; | ||
1007 | struct cvmx_mio_fus_wadr_s cn30xx; | ||
1008 | struct cvmx_mio_fus_wadr_s cn31xx; | ||
1009 | struct cvmx_mio_fus_wadr_s cn38xx; | ||
1010 | struct cvmx_mio_fus_wadr_s cn38xxp2; | ||
1011 | struct cvmx_mio_fus_wadr_cn50xx { | ||
1012 | uint64_t reserved_2_63:62; | ||
1013 | uint64_t addr:2; | ||
1014 | } cn50xx; | ||
1015 | struct cvmx_mio_fus_wadr_cn52xx { | ||
1016 | uint64_t reserved_3_63:61; | ||
1017 | uint64_t addr:3; | ||
1018 | } cn52xx; | ||
1019 | struct cvmx_mio_fus_wadr_cn52xx cn52xxp1; | ||
1020 | struct cvmx_mio_fus_wadr_cn52xx cn56xx; | ||
1021 | struct cvmx_mio_fus_wadr_cn52xx cn56xxp1; | ||
1022 | struct cvmx_mio_fus_wadr_cn50xx cn58xx; | ||
1023 | struct cvmx_mio_fus_wadr_cn50xx cn58xxp1; | ||
1024 | }; | ||
1025 | |||
1026 | union cvmx_mio_ndf_dma_cfg { | ||
1027 | uint64_t u64; | ||
1028 | struct cvmx_mio_ndf_dma_cfg_s { | ||
1029 | uint64_t en:1; | ||
1030 | uint64_t rw:1; | ||
1031 | uint64_t clr:1; | ||
1032 | uint64_t reserved_60_60:1; | ||
1033 | uint64_t swap32:1; | ||
1034 | uint64_t swap16:1; | ||
1035 | uint64_t swap8:1; | ||
1036 | uint64_t endian:1; | ||
1037 | uint64_t size:20; | ||
1038 | uint64_t adr:36; | ||
1039 | } s; | ||
1040 | struct cvmx_mio_ndf_dma_cfg_s cn52xx; | ||
1041 | }; | ||
1042 | |||
1043 | union cvmx_mio_ndf_dma_int { | ||
1044 | uint64_t u64; | ||
1045 | struct cvmx_mio_ndf_dma_int_s { | ||
1046 | uint64_t reserved_1_63:63; | ||
1047 | uint64_t done:1; | ||
1048 | } s; | ||
1049 | struct cvmx_mio_ndf_dma_int_s cn52xx; | ||
1050 | }; | ||
1051 | |||
1052 | union cvmx_mio_ndf_dma_int_en { | ||
1053 | uint64_t u64; | ||
1054 | struct cvmx_mio_ndf_dma_int_en_s { | ||
1055 | uint64_t reserved_1_63:63; | ||
1056 | uint64_t done:1; | ||
1057 | } s; | ||
1058 | struct cvmx_mio_ndf_dma_int_en_s cn52xx; | ||
1059 | }; | ||
1060 | |||
1061 | union cvmx_mio_pll_ctl { | ||
1062 | uint64_t u64; | ||
1063 | struct cvmx_mio_pll_ctl_s { | ||
1064 | uint64_t reserved_5_63:59; | ||
1065 | uint64_t bw_ctl:5; | ||
1066 | } s; | ||
1067 | struct cvmx_mio_pll_ctl_s cn30xx; | ||
1068 | struct cvmx_mio_pll_ctl_s cn31xx; | ||
1069 | }; | ||
1070 | |||
1071 | union cvmx_mio_pll_setting { | ||
1072 | uint64_t u64; | ||
1073 | struct cvmx_mio_pll_setting_s { | ||
1074 | uint64_t reserved_17_63:47; | ||
1075 | uint64_t setting:17; | ||
1076 | } s; | ||
1077 | struct cvmx_mio_pll_setting_s cn30xx; | ||
1078 | struct cvmx_mio_pll_setting_s cn31xx; | ||
1079 | }; | ||
1080 | |||
1081 | union cvmx_mio_twsx_int { | ||
1082 | uint64_t u64; | ||
1083 | struct cvmx_mio_twsx_int_s { | ||
1084 | uint64_t reserved_12_63:52; | ||
1085 | uint64_t scl:1; | ||
1086 | uint64_t sda:1; | ||
1087 | uint64_t scl_ovr:1; | ||
1088 | uint64_t sda_ovr:1; | ||
1089 | uint64_t reserved_7_7:1; | ||
1090 | uint64_t core_en:1; | ||
1091 | uint64_t ts_en:1; | ||
1092 | uint64_t st_en:1; | ||
1093 | uint64_t reserved_3_3:1; | ||
1094 | uint64_t core_int:1; | ||
1095 | uint64_t ts_int:1; | ||
1096 | uint64_t st_int:1; | ||
1097 | } s; | ||
1098 | struct cvmx_mio_twsx_int_s cn30xx; | ||
1099 | struct cvmx_mio_twsx_int_s cn31xx; | ||
1100 | struct cvmx_mio_twsx_int_s cn38xx; | ||
1101 | struct cvmx_mio_twsx_int_cn38xxp2 { | ||
1102 | uint64_t reserved_7_63:57; | ||
1103 | uint64_t core_en:1; | ||
1104 | uint64_t ts_en:1; | ||
1105 | uint64_t st_en:1; | ||
1106 | uint64_t reserved_3_3:1; | ||
1107 | uint64_t core_int:1; | ||
1108 | uint64_t ts_int:1; | ||
1109 | uint64_t st_int:1; | ||
1110 | } cn38xxp2; | ||
1111 | struct cvmx_mio_twsx_int_s cn50xx; | ||
1112 | struct cvmx_mio_twsx_int_s cn52xx; | ||
1113 | struct cvmx_mio_twsx_int_s cn52xxp1; | ||
1114 | struct cvmx_mio_twsx_int_s cn56xx; | ||
1115 | struct cvmx_mio_twsx_int_s cn56xxp1; | ||
1116 | struct cvmx_mio_twsx_int_s cn58xx; | ||
1117 | struct cvmx_mio_twsx_int_s cn58xxp1; | ||
1118 | }; | ||
1119 | |||
1120 | union cvmx_mio_twsx_sw_twsi { | ||
1121 | uint64_t u64; | ||
1122 | struct cvmx_mio_twsx_sw_twsi_s { | ||
1123 | uint64_t v:1; | ||
1124 | uint64_t slonly:1; | ||
1125 | uint64_t eia:1; | ||
1126 | uint64_t op:4; | ||
1127 | uint64_t r:1; | ||
1128 | uint64_t sovr:1; | ||
1129 | uint64_t size:3; | ||
1130 | uint64_t scr:2; | ||
1131 | uint64_t a:10; | ||
1132 | uint64_t ia:5; | ||
1133 | uint64_t eop_ia:3; | ||
1134 | uint64_t d:32; | ||
1135 | } s; | ||
1136 | struct cvmx_mio_twsx_sw_twsi_s cn30xx; | ||
1137 | struct cvmx_mio_twsx_sw_twsi_s cn31xx; | ||
1138 | struct cvmx_mio_twsx_sw_twsi_s cn38xx; | ||
1139 | struct cvmx_mio_twsx_sw_twsi_s cn38xxp2; | ||
1140 | struct cvmx_mio_twsx_sw_twsi_s cn50xx; | ||
1141 | struct cvmx_mio_twsx_sw_twsi_s cn52xx; | ||
1142 | struct cvmx_mio_twsx_sw_twsi_s cn52xxp1; | ||
1143 | struct cvmx_mio_twsx_sw_twsi_s cn56xx; | ||
1144 | struct cvmx_mio_twsx_sw_twsi_s cn56xxp1; | ||
1145 | struct cvmx_mio_twsx_sw_twsi_s cn58xx; | ||
1146 | struct cvmx_mio_twsx_sw_twsi_s cn58xxp1; | ||
1147 | }; | ||
1148 | |||
1149 | union cvmx_mio_twsx_sw_twsi_ext { | ||
1150 | uint64_t u64; | ||
1151 | struct cvmx_mio_twsx_sw_twsi_ext_s { | ||
1152 | uint64_t reserved_40_63:24; | ||
1153 | uint64_t ia:8; | ||
1154 | uint64_t d:32; | ||
1155 | } s; | ||
1156 | struct cvmx_mio_twsx_sw_twsi_ext_s cn30xx; | ||
1157 | struct cvmx_mio_twsx_sw_twsi_ext_s cn31xx; | ||
1158 | struct cvmx_mio_twsx_sw_twsi_ext_s cn38xx; | ||
1159 | struct cvmx_mio_twsx_sw_twsi_ext_s cn38xxp2; | ||
1160 | struct cvmx_mio_twsx_sw_twsi_ext_s cn50xx; | ||
1161 | struct cvmx_mio_twsx_sw_twsi_ext_s cn52xx; | ||
1162 | struct cvmx_mio_twsx_sw_twsi_ext_s cn52xxp1; | ||
1163 | struct cvmx_mio_twsx_sw_twsi_ext_s cn56xx; | ||
1164 | struct cvmx_mio_twsx_sw_twsi_ext_s cn56xxp1; | ||
1165 | struct cvmx_mio_twsx_sw_twsi_ext_s cn58xx; | ||
1166 | struct cvmx_mio_twsx_sw_twsi_ext_s cn58xxp1; | ||
1167 | }; | ||
1168 | |||
1169 | union cvmx_mio_twsx_twsi_sw { | ||
1170 | uint64_t u64; | ||
1171 | struct cvmx_mio_twsx_twsi_sw_s { | ||
1172 | uint64_t v:2; | ||
1173 | uint64_t reserved_32_61:30; | ||
1174 | uint64_t d:32; | ||
1175 | } s; | ||
1176 | struct cvmx_mio_twsx_twsi_sw_s cn30xx; | ||
1177 | struct cvmx_mio_twsx_twsi_sw_s cn31xx; | ||
1178 | struct cvmx_mio_twsx_twsi_sw_s cn38xx; | ||
1179 | struct cvmx_mio_twsx_twsi_sw_s cn38xxp2; | ||
1180 | struct cvmx_mio_twsx_twsi_sw_s cn50xx; | ||
1181 | struct cvmx_mio_twsx_twsi_sw_s cn52xx; | ||
1182 | struct cvmx_mio_twsx_twsi_sw_s cn52xxp1; | ||
1183 | struct cvmx_mio_twsx_twsi_sw_s cn56xx; | ||
1184 | struct cvmx_mio_twsx_twsi_sw_s cn56xxp1; | ||
1185 | struct cvmx_mio_twsx_twsi_sw_s cn58xx; | ||
1186 | struct cvmx_mio_twsx_twsi_sw_s cn58xxp1; | ||
1187 | }; | ||
1188 | |||
1189 | union cvmx_mio_uartx_dlh { | ||
1190 | uint64_t u64; | ||
1191 | struct cvmx_mio_uartx_dlh_s { | ||
1192 | uint64_t reserved_8_63:56; | ||
1193 | uint64_t dlh:8; | ||
1194 | } s; | ||
1195 | struct cvmx_mio_uartx_dlh_s cn30xx; | ||
1196 | struct cvmx_mio_uartx_dlh_s cn31xx; | ||
1197 | struct cvmx_mio_uartx_dlh_s cn38xx; | ||
1198 | struct cvmx_mio_uartx_dlh_s cn38xxp2; | ||
1199 | struct cvmx_mio_uartx_dlh_s cn50xx; | ||
1200 | struct cvmx_mio_uartx_dlh_s cn52xx; | ||
1201 | struct cvmx_mio_uartx_dlh_s cn52xxp1; | ||
1202 | struct cvmx_mio_uartx_dlh_s cn56xx; | ||
1203 | struct cvmx_mio_uartx_dlh_s cn56xxp1; | ||
1204 | struct cvmx_mio_uartx_dlh_s cn58xx; | ||
1205 | struct cvmx_mio_uartx_dlh_s cn58xxp1; | ||
1206 | }; | ||
1207 | |||
1208 | union cvmx_mio_uartx_dll { | ||
1209 | uint64_t u64; | ||
1210 | struct cvmx_mio_uartx_dll_s { | ||
1211 | uint64_t reserved_8_63:56; | ||
1212 | uint64_t dll:8; | ||
1213 | } s; | ||
1214 | struct cvmx_mio_uartx_dll_s cn30xx; | ||
1215 | struct cvmx_mio_uartx_dll_s cn31xx; | ||
1216 | struct cvmx_mio_uartx_dll_s cn38xx; | ||
1217 | struct cvmx_mio_uartx_dll_s cn38xxp2; | ||
1218 | struct cvmx_mio_uartx_dll_s cn50xx; | ||
1219 | struct cvmx_mio_uartx_dll_s cn52xx; | ||
1220 | struct cvmx_mio_uartx_dll_s cn52xxp1; | ||
1221 | struct cvmx_mio_uartx_dll_s cn56xx; | ||
1222 | struct cvmx_mio_uartx_dll_s cn56xxp1; | ||
1223 | struct cvmx_mio_uartx_dll_s cn58xx; | ||
1224 | struct cvmx_mio_uartx_dll_s cn58xxp1; | ||
1225 | }; | ||
1226 | |||
1227 | union cvmx_mio_uartx_far { | ||
1228 | uint64_t u64; | ||
1229 | struct cvmx_mio_uartx_far_s { | ||
1230 | uint64_t reserved_1_63:63; | ||
1231 | uint64_t far:1; | ||
1232 | } s; | ||
1233 | struct cvmx_mio_uartx_far_s cn30xx; | ||
1234 | struct cvmx_mio_uartx_far_s cn31xx; | ||
1235 | struct cvmx_mio_uartx_far_s cn38xx; | ||
1236 | struct cvmx_mio_uartx_far_s cn38xxp2; | ||
1237 | struct cvmx_mio_uartx_far_s cn50xx; | ||
1238 | struct cvmx_mio_uartx_far_s cn52xx; | ||
1239 | struct cvmx_mio_uartx_far_s cn52xxp1; | ||
1240 | struct cvmx_mio_uartx_far_s cn56xx; | ||
1241 | struct cvmx_mio_uartx_far_s cn56xxp1; | ||
1242 | struct cvmx_mio_uartx_far_s cn58xx; | ||
1243 | struct cvmx_mio_uartx_far_s cn58xxp1; | ||
1244 | }; | ||
1245 | |||
1246 | union cvmx_mio_uartx_fcr { | ||
1247 | uint64_t u64; | ||
1248 | struct cvmx_mio_uartx_fcr_s { | ||
1249 | uint64_t reserved_8_63:56; | ||
1250 | uint64_t rxtrig:2; | ||
1251 | uint64_t txtrig:2; | ||
1252 | uint64_t reserved_3_3:1; | ||
1253 | uint64_t txfr:1; | ||
1254 | uint64_t rxfr:1; | ||
1255 | uint64_t en:1; | ||
1256 | } s; | ||
1257 | struct cvmx_mio_uartx_fcr_s cn30xx; | ||
1258 | struct cvmx_mio_uartx_fcr_s cn31xx; | ||
1259 | struct cvmx_mio_uartx_fcr_s cn38xx; | ||
1260 | struct cvmx_mio_uartx_fcr_s cn38xxp2; | ||
1261 | struct cvmx_mio_uartx_fcr_s cn50xx; | ||
1262 | struct cvmx_mio_uartx_fcr_s cn52xx; | ||
1263 | struct cvmx_mio_uartx_fcr_s cn52xxp1; | ||
1264 | struct cvmx_mio_uartx_fcr_s cn56xx; | ||
1265 | struct cvmx_mio_uartx_fcr_s cn56xxp1; | ||
1266 | struct cvmx_mio_uartx_fcr_s cn58xx; | ||
1267 | struct cvmx_mio_uartx_fcr_s cn58xxp1; | ||
1268 | }; | ||
1269 | |||
1270 | union cvmx_mio_uartx_htx { | ||
1271 | uint64_t u64; | ||
1272 | struct cvmx_mio_uartx_htx_s { | ||
1273 | uint64_t reserved_1_63:63; | ||
1274 | uint64_t htx:1; | ||
1275 | } s; | ||
1276 | struct cvmx_mio_uartx_htx_s cn30xx; | ||
1277 | struct cvmx_mio_uartx_htx_s cn31xx; | ||
1278 | struct cvmx_mio_uartx_htx_s cn38xx; | ||
1279 | struct cvmx_mio_uartx_htx_s cn38xxp2; | ||
1280 | struct cvmx_mio_uartx_htx_s cn50xx; | ||
1281 | struct cvmx_mio_uartx_htx_s cn52xx; | ||
1282 | struct cvmx_mio_uartx_htx_s cn52xxp1; | ||
1283 | struct cvmx_mio_uartx_htx_s cn56xx; | ||
1284 | struct cvmx_mio_uartx_htx_s cn56xxp1; | ||
1285 | struct cvmx_mio_uartx_htx_s cn58xx; | ||
1286 | struct cvmx_mio_uartx_htx_s cn58xxp1; | ||
1287 | }; | ||
1288 | |||
1289 | union cvmx_mio_uartx_ier { | ||
1290 | uint64_t u64; | ||
1291 | struct cvmx_mio_uartx_ier_s { | ||
1292 | uint64_t reserved_8_63:56; | ||
1293 | uint64_t ptime:1; | ||
1294 | uint64_t reserved_4_6:3; | ||
1295 | uint64_t edssi:1; | ||
1296 | uint64_t elsi:1; | ||
1297 | uint64_t etbei:1; | ||
1298 | uint64_t erbfi:1; | ||
1299 | } s; | ||
1300 | struct cvmx_mio_uartx_ier_s cn30xx; | ||
1301 | struct cvmx_mio_uartx_ier_s cn31xx; | ||
1302 | struct cvmx_mio_uartx_ier_s cn38xx; | ||
1303 | struct cvmx_mio_uartx_ier_s cn38xxp2; | ||
1304 | struct cvmx_mio_uartx_ier_s cn50xx; | ||
1305 | struct cvmx_mio_uartx_ier_s cn52xx; | ||
1306 | struct cvmx_mio_uartx_ier_s cn52xxp1; | ||
1307 | struct cvmx_mio_uartx_ier_s cn56xx; | ||
1308 | struct cvmx_mio_uartx_ier_s cn56xxp1; | ||
1309 | struct cvmx_mio_uartx_ier_s cn58xx; | ||
1310 | struct cvmx_mio_uartx_ier_s cn58xxp1; | ||
1311 | }; | ||
1312 | |||
1313 | union cvmx_mio_uartx_iir { | ||
1314 | uint64_t u64; | ||
1315 | struct cvmx_mio_uartx_iir_s { | ||
1316 | uint64_t reserved_8_63:56; | ||
1317 | uint64_t fen:2; | ||
1318 | uint64_t reserved_4_5:2; | ||
1319 | uint64_t iid:4; | ||
1320 | } s; | ||
1321 | struct cvmx_mio_uartx_iir_s cn30xx; | ||
1322 | struct cvmx_mio_uartx_iir_s cn31xx; | ||
1323 | struct cvmx_mio_uartx_iir_s cn38xx; | ||
1324 | struct cvmx_mio_uartx_iir_s cn38xxp2; | ||
1325 | struct cvmx_mio_uartx_iir_s cn50xx; | ||
1326 | struct cvmx_mio_uartx_iir_s cn52xx; | ||
1327 | struct cvmx_mio_uartx_iir_s cn52xxp1; | ||
1328 | struct cvmx_mio_uartx_iir_s cn56xx; | ||
1329 | struct cvmx_mio_uartx_iir_s cn56xxp1; | ||
1330 | struct cvmx_mio_uartx_iir_s cn58xx; | ||
1331 | struct cvmx_mio_uartx_iir_s cn58xxp1; | ||
1332 | }; | ||
1333 | |||
1334 | union cvmx_mio_uartx_lcr { | ||
1335 | uint64_t u64; | ||
1336 | struct cvmx_mio_uartx_lcr_s { | ||
1337 | uint64_t reserved_8_63:56; | ||
1338 | uint64_t dlab:1; | ||
1339 | uint64_t brk:1; | ||
1340 | uint64_t reserved_5_5:1; | ||
1341 | uint64_t eps:1; | ||
1342 | uint64_t pen:1; | ||
1343 | uint64_t stop:1; | ||
1344 | uint64_t cls:2; | ||
1345 | } s; | ||
1346 | struct cvmx_mio_uartx_lcr_s cn30xx; | ||
1347 | struct cvmx_mio_uartx_lcr_s cn31xx; | ||
1348 | struct cvmx_mio_uartx_lcr_s cn38xx; | ||
1349 | struct cvmx_mio_uartx_lcr_s cn38xxp2; | ||
1350 | struct cvmx_mio_uartx_lcr_s cn50xx; | ||
1351 | struct cvmx_mio_uartx_lcr_s cn52xx; | ||
1352 | struct cvmx_mio_uartx_lcr_s cn52xxp1; | ||
1353 | struct cvmx_mio_uartx_lcr_s cn56xx; | ||
1354 | struct cvmx_mio_uartx_lcr_s cn56xxp1; | ||
1355 | struct cvmx_mio_uartx_lcr_s cn58xx; | ||
1356 | struct cvmx_mio_uartx_lcr_s cn58xxp1; | ||
1357 | }; | ||
1358 | |||
1359 | union cvmx_mio_uartx_lsr { | ||
1360 | uint64_t u64; | ||
1361 | struct cvmx_mio_uartx_lsr_s { | ||
1362 | uint64_t reserved_8_63:56; | ||
1363 | uint64_t ferr:1; | ||
1364 | uint64_t temt:1; | ||
1365 | uint64_t thre:1; | ||
1366 | uint64_t bi:1; | ||
1367 | uint64_t fe:1; | ||
1368 | uint64_t pe:1; | ||
1369 | uint64_t oe:1; | ||
1370 | uint64_t dr:1; | ||
1371 | } s; | ||
1372 | struct cvmx_mio_uartx_lsr_s cn30xx; | ||
1373 | struct cvmx_mio_uartx_lsr_s cn31xx; | ||
1374 | struct cvmx_mio_uartx_lsr_s cn38xx; | ||
1375 | struct cvmx_mio_uartx_lsr_s cn38xxp2; | ||
1376 | struct cvmx_mio_uartx_lsr_s cn50xx; | ||
1377 | struct cvmx_mio_uartx_lsr_s cn52xx; | ||
1378 | struct cvmx_mio_uartx_lsr_s cn52xxp1; | ||
1379 | struct cvmx_mio_uartx_lsr_s cn56xx; | ||
1380 | struct cvmx_mio_uartx_lsr_s cn56xxp1; | ||
1381 | struct cvmx_mio_uartx_lsr_s cn58xx; | ||
1382 | struct cvmx_mio_uartx_lsr_s cn58xxp1; | ||
1383 | }; | ||
1384 | |||
1385 | union cvmx_mio_uartx_mcr { | ||
1386 | uint64_t u64; | ||
1387 | struct cvmx_mio_uartx_mcr_s { | ||
1388 | uint64_t reserved_6_63:58; | ||
1389 | uint64_t afce:1; | ||
1390 | uint64_t loop:1; | ||
1391 | uint64_t out2:1; | ||
1392 | uint64_t out1:1; | ||
1393 | uint64_t rts:1; | ||
1394 | uint64_t dtr:1; | ||
1395 | } s; | ||
1396 | struct cvmx_mio_uartx_mcr_s cn30xx; | ||
1397 | struct cvmx_mio_uartx_mcr_s cn31xx; | ||
1398 | struct cvmx_mio_uartx_mcr_s cn38xx; | ||
1399 | struct cvmx_mio_uartx_mcr_s cn38xxp2; | ||
1400 | struct cvmx_mio_uartx_mcr_s cn50xx; | ||
1401 | struct cvmx_mio_uartx_mcr_s cn52xx; | ||
1402 | struct cvmx_mio_uartx_mcr_s cn52xxp1; | ||
1403 | struct cvmx_mio_uartx_mcr_s cn56xx; | ||
1404 | struct cvmx_mio_uartx_mcr_s cn56xxp1; | ||
1405 | struct cvmx_mio_uartx_mcr_s cn58xx; | ||
1406 | struct cvmx_mio_uartx_mcr_s cn58xxp1; | ||
1407 | }; | ||
1408 | |||
1409 | union cvmx_mio_uartx_msr { | ||
1410 | uint64_t u64; | ||
1411 | struct cvmx_mio_uartx_msr_s { | ||
1412 | uint64_t reserved_8_63:56; | ||
1413 | uint64_t dcd:1; | ||
1414 | uint64_t ri:1; | ||
1415 | uint64_t dsr:1; | ||
1416 | uint64_t cts:1; | ||
1417 | uint64_t ddcd:1; | ||
1418 | uint64_t teri:1; | ||
1419 | uint64_t ddsr:1; | ||
1420 | uint64_t dcts:1; | ||
1421 | } s; | ||
1422 | struct cvmx_mio_uartx_msr_s cn30xx; | ||
1423 | struct cvmx_mio_uartx_msr_s cn31xx; | ||
1424 | struct cvmx_mio_uartx_msr_s cn38xx; | ||
1425 | struct cvmx_mio_uartx_msr_s cn38xxp2; | ||
1426 | struct cvmx_mio_uartx_msr_s cn50xx; | ||
1427 | struct cvmx_mio_uartx_msr_s cn52xx; | ||
1428 | struct cvmx_mio_uartx_msr_s cn52xxp1; | ||
1429 | struct cvmx_mio_uartx_msr_s cn56xx; | ||
1430 | struct cvmx_mio_uartx_msr_s cn56xxp1; | ||
1431 | struct cvmx_mio_uartx_msr_s cn58xx; | ||
1432 | struct cvmx_mio_uartx_msr_s cn58xxp1; | ||
1433 | }; | ||
1434 | |||
1435 | union cvmx_mio_uartx_rbr { | ||
1436 | uint64_t u64; | ||
1437 | struct cvmx_mio_uartx_rbr_s { | ||
1438 | uint64_t reserved_8_63:56; | ||
1439 | uint64_t rbr:8; | ||
1440 | } s; | ||
1441 | struct cvmx_mio_uartx_rbr_s cn30xx; | ||
1442 | struct cvmx_mio_uartx_rbr_s cn31xx; | ||
1443 | struct cvmx_mio_uartx_rbr_s cn38xx; | ||
1444 | struct cvmx_mio_uartx_rbr_s cn38xxp2; | ||
1445 | struct cvmx_mio_uartx_rbr_s cn50xx; | ||
1446 | struct cvmx_mio_uartx_rbr_s cn52xx; | ||
1447 | struct cvmx_mio_uartx_rbr_s cn52xxp1; | ||
1448 | struct cvmx_mio_uartx_rbr_s cn56xx; | ||
1449 | struct cvmx_mio_uartx_rbr_s cn56xxp1; | ||
1450 | struct cvmx_mio_uartx_rbr_s cn58xx; | ||
1451 | struct cvmx_mio_uartx_rbr_s cn58xxp1; | ||
1452 | }; | ||
1453 | |||
1454 | union cvmx_mio_uartx_rfl { | ||
1455 | uint64_t u64; | ||
1456 | struct cvmx_mio_uartx_rfl_s { | ||
1457 | uint64_t reserved_7_63:57; | ||
1458 | uint64_t rfl:7; | ||
1459 | } s; | ||
1460 | struct cvmx_mio_uartx_rfl_s cn30xx; | ||
1461 | struct cvmx_mio_uartx_rfl_s cn31xx; | ||
1462 | struct cvmx_mio_uartx_rfl_s cn38xx; | ||
1463 | struct cvmx_mio_uartx_rfl_s cn38xxp2; | ||
1464 | struct cvmx_mio_uartx_rfl_s cn50xx; | ||
1465 | struct cvmx_mio_uartx_rfl_s cn52xx; | ||
1466 | struct cvmx_mio_uartx_rfl_s cn52xxp1; | ||
1467 | struct cvmx_mio_uartx_rfl_s cn56xx; | ||
1468 | struct cvmx_mio_uartx_rfl_s cn56xxp1; | ||
1469 | struct cvmx_mio_uartx_rfl_s cn58xx; | ||
1470 | struct cvmx_mio_uartx_rfl_s cn58xxp1; | ||
1471 | }; | ||
1472 | |||
1473 | union cvmx_mio_uartx_rfw { | ||
1474 | uint64_t u64; | ||
1475 | struct cvmx_mio_uartx_rfw_s { | ||
1476 | uint64_t reserved_10_63:54; | ||
1477 | uint64_t rffe:1; | ||
1478 | uint64_t rfpe:1; | ||
1479 | uint64_t rfwd:8; | ||
1480 | } s; | ||
1481 | struct cvmx_mio_uartx_rfw_s cn30xx; | ||
1482 | struct cvmx_mio_uartx_rfw_s cn31xx; | ||
1483 | struct cvmx_mio_uartx_rfw_s cn38xx; | ||
1484 | struct cvmx_mio_uartx_rfw_s cn38xxp2; | ||
1485 | struct cvmx_mio_uartx_rfw_s cn50xx; | ||
1486 | struct cvmx_mio_uartx_rfw_s cn52xx; | ||
1487 | struct cvmx_mio_uartx_rfw_s cn52xxp1; | ||
1488 | struct cvmx_mio_uartx_rfw_s cn56xx; | ||
1489 | struct cvmx_mio_uartx_rfw_s cn56xxp1; | ||
1490 | struct cvmx_mio_uartx_rfw_s cn58xx; | ||
1491 | struct cvmx_mio_uartx_rfw_s cn58xxp1; | ||
1492 | }; | ||
1493 | |||
1494 | union cvmx_mio_uartx_sbcr { | ||
1495 | uint64_t u64; | ||
1496 | struct cvmx_mio_uartx_sbcr_s { | ||
1497 | uint64_t reserved_1_63:63; | ||
1498 | uint64_t sbcr:1; | ||
1499 | } s; | ||
1500 | struct cvmx_mio_uartx_sbcr_s cn30xx; | ||
1501 | struct cvmx_mio_uartx_sbcr_s cn31xx; | ||
1502 | struct cvmx_mio_uartx_sbcr_s cn38xx; | ||
1503 | struct cvmx_mio_uartx_sbcr_s cn38xxp2; | ||
1504 | struct cvmx_mio_uartx_sbcr_s cn50xx; | ||
1505 | struct cvmx_mio_uartx_sbcr_s cn52xx; | ||
1506 | struct cvmx_mio_uartx_sbcr_s cn52xxp1; | ||
1507 | struct cvmx_mio_uartx_sbcr_s cn56xx; | ||
1508 | struct cvmx_mio_uartx_sbcr_s cn56xxp1; | ||
1509 | struct cvmx_mio_uartx_sbcr_s cn58xx; | ||
1510 | struct cvmx_mio_uartx_sbcr_s cn58xxp1; | ||
1511 | }; | ||
1512 | |||
1513 | union cvmx_mio_uartx_scr { | ||
1514 | uint64_t u64; | ||
1515 | struct cvmx_mio_uartx_scr_s { | ||
1516 | uint64_t reserved_8_63:56; | ||
1517 | uint64_t scr:8; | ||
1518 | } s; | ||
1519 | struct cvmx_mio_uartx_scr_s cn30xx; | ||
1520 | struct cvmx_mio_uartx_scr_s cn31xx; | ||
1521 | struct cvmx_mio_uartx_scr_s cn38xx; | ||
1522 | struct cvmx_mio_uartx_scr_s cn38xxp2; | ||
1523 | struct cvmx_mio_uartx_scr_s cn50xx; | ||
1524 | struct cvmx_mio_uartx_scr_s cn52xx; | ||
1525 | struct cvmx_mio_uartx_scr_s cn52xxp1; | ||
1526 | struct cvmx_mio_uartx_scr_s cn56xx; | ||
1527 | struct cvmx_mio_uartx_scr_s cn56xxp1; | ||
1528 | struct cvmx_mio_uartx_scr_s cn58xx; | ||
1529 | struct cvmx_mio_uartx_scr_s cn58xxp1; | ||
1530 | }; | ||
1531 | |||
1532 | union cvmx_mio_uartx_sfe { | ||
1533 | uint64_t u64; | ||
1534 | struct cvmx_mio_uartx_sfe_s { | ||
1535 | uint64_t reserved_1_63:63; | ||
1536 | uint64_t sfe:1; | ||
1537 | } s; | ||
1538 | struct cvmx_mio_uartx_sfe_s cn30xx; | ||
1539 | struct cvmx_mio_uartx_sfe_s cn31xx; | ||
1540 | struct cvmx_mio_uartx_sfe_s cn38xx; | ||
1541 | struct cvmx_mio_uartx_sfe_s cn38xxp2; | ||
1542 | struct cvmx_mio_uartx_sfe_s cn50xx; | ||
1543 | struct cvmx_mio_uartx_sfe_s cn52xx; | ||
1544 | struct cvmx_mio_uartx_sfe_s cn52xxp1; | ||
1545 | struct cvmx_mio_uartx_sfe_s cn56xx; | ||
1546 | struct cvmx_mio_uartx_sfe_s cn56xxp1; | ||
1547 | struct cvmx_mio_uartx_sfe_s cn58xx; | ||
1548 | struct cvmx_mio_uartx_sfe_s cn58xxp1; | ||
1549 | }; | ||
1550 | |||
1551 | union cvmx_mio_uartx_srr { | ||
1552 | uint64_t u64; | ||
1553 | struct cvmx_mio_uartx_srr_s { | ||
1554 | uint64_t reserved_3_63:61; | ||
1555 | uint64_t stfr:1; | ||
1556 | uint64_t srfr:1; | ||
1557 | uint64_t usr:1; | ||
1558 | } s; | ||
1559 | struct cvmx_mio_uartx_srr_s cn30xx; | ||
1560 | struct cvmx_mio_uartx_srr_s cn31xx; | ||
1561 | struct cvmx_mio_uartx_srr_s cn38xx; | ||
1562 | struct cvmx_mio_uartx_srr_s cn38xxp2; | ||
1563 | struct cvmx_mio_uartx_srr_s cn50xx; | ||
1564 | struct cvmx_mio_uartx_srr_s cn52xx; | ||
1565 | struct cvmx_mio_uartx_srr_s cn52xxp1; | ||
1566 | struct cvmx_mio_uartx_srr_s cn56xx; | ||
1567 | struct cvmx_mio_uartx_srr_s cn56xxp1; | ||
1568 | struct cvmx_mio_uartx_srr_s cn58xx; | ||
1569 | struct cvmx_mio_uartx_srr_s cn58xxp1; | ||
1570 | }; | ||
1571 | |||
1572 | union cvmx_mio_uartx_srt { | ||
1573 | uint64_t u64; | ||
1574 | struct cvmx_mio_uartx_srt_s { | ||
1575 | uint64_t reserved_2_63:62; | ||
1576 | uint64_t srt:2; | ||
1577 | } s; | ||
1578 | struct cvmx_mio_uartx_srt_s cn30xx; | ||
1579 | struct cvmx_mio_uartx_srt_s cn31xx; | ||
1580 | struct cvmx_mio_uartx_srt_s cn38xx; | ||
1581 | struct cvmx_mio_uartx_srt_s cn38xxp2; | ||
1582 | struct cvmx_mio_uartx_srt_s cn50xx; | ||
1583 | struct cvmx_mio_uartx_srt_s cn52xx; | ||
1584 | struct cvmx_mio_uartx_srt_s cn52xxp1; | ||
1585 | struct cvmx_mio_uartx_srt_s cn56xx; | ||
1586 | struct cvmx_mio_uartx_srt_s cn56xxp1; | ||
1587 | struct cvmx_mio_uartx_srt_s cn58xx; | ||
1588 | struct cvmx_mio_uartx_srt_s cn58xxp1; | ||
1589 | }; | ||
1590 | |||
1591 | union cvmx_mio_uartx_srts { | ||
1592 | uint64_t u64; | ||
1593 | struct cvmx_mio_uartx_srts_s { | ||
1594 | uint64_t reserved_1_63:63; | ||
1595 | uint64_t srts:1; | ||
1596 | } s; | ||
1597 | struct cvmx_mio_uartx_srts_s cn30xx; | ||
1598 | struct cvmx_mio_uartx_srts_s cn31xx; | ||
1599 | struct cvmx_mio_uartx_srts_s cn38xx; | ||
1600 | struct cvmx_mio_uartx_srts_s cn38xxp2; | ||
1601 | struct cvmx_mio_uartx_srts_s cn50xx; | ||
1602 | struct cvmx_mio_uartx_srts_s cn52xx; | ||
1603 | struct cvmx_mio_uartx_srts_s cn52xxp1; | ||
1604 | struct cvmx_mio_uartx_srts_s cn56xx; | ||
1605 | struct cvmx_mio_uartx_srts_s cn56xxp1; | ||
1606 | struct cvmx_mio_uartx_srts_s cn58xx; | ||
1607 | struct cvmx_mio_uartx_srts_s cn58xxp1; | ||
1608 | }; | ||
1609 | |||
1610 | union cvmx_mio_uartx_stt { | ||
1611 | uint64_t u64; | ||
1612 | struct cvmx_mio_uartx_stt_s { | ||
1613 | uint64_t reserved_2_63:62; | ||
1614 | uint64_t stt:2; | ||
1615 | } s; | ||
1616 | struct cvmx_mio_uartx_stt_s cn30xx; | ||
1617 | struct cvmx_mio_uartx_stt_s cn31xx; | ||
1618 | struct cvmx_mio_uartx_stt_s cn38xx; | ||
1619 | struct cvmx_mio_uartx_stt_s cn38xxp2; | ||
1620 | struct cvmx_mio_uartx_stt_s cn50xx; | ||
1621 | struct cvmx_mio_uartx_stt_s cn52xx; | ||
1622 | struct cvmx_mio_uartx_stt_s cn52xxp1; | ||
1623 | struct cvmx_mio_uartx_stt_s cn56xx; | ||
1624 | struct cvmx_mio_uartx_stt_s cn56xxp1; | ||
1625 | struct cvmx_mio_uartx_stt_s cn58xx; | ||
1626 | struct cvmx_mio_uartx_stt_s cn58xxp1; | ||
1627 | }; | ||
1628 | |||
1629 | union cvmx_mio_uartx_tfl { | ||
1630 | uint64_t u64; | ||
1631 | struct cvmx_mio_uartx_tfl_s { | ||
1632 | uint64_t reserved_7_63:57; | ||
1633 | uint64_t tfl:7; | ||
1634 | } s; | ||
1635 | struct cvmx_mio_uartx_tfl_s cn30xx; | ||
1636 | struct cvmx_mio_uartx_tfl_s cn31xx; | ||
1637 | struct cvmx_mio_uartx_tfl_s cn38xx; | ||
1638 | struct cvmx_mio_uartx_tfl_s cn38xxp2; | ||
1639 | struct cvmx_mio_uartx_tfl_s cn50xx; | ||
1640 | struct cvmx_mio_uartx_tfl_s cn52xx; | ||
1641 | struct cvmx_mio_uartx_tfl_s cn52xxp1; | ||
1642 | struct cvmx_mio_uartx_tfl_s cn56xx; | ||
1643 | struct cvmx_mio_uartx_tfl_s cn56xxp1; | ||
1644 | struct cvmx_mio_uartx_tfl_s cn58xx; | ||
1645 | struct cvmx_mio_uartx_tfl_s cn58xxp1; | ||
1646 | }; | ||
1647 | |||
1648 | union cvmx_mio_uartx_tfr { | ||
1649 | uint64_t u64; | ||
1650 | struct cvmx_mio_uartx_tfr_s { | ||
1651 | uint64_t reserved_8_63:56; | ||
1652 | uint64_t tfr:8; | ||
1653 | } s; | ||
1654 | struct cvmx_mio_uartx_tfr_s cn30xx; | ||
1655 | struct cvmx_mio_uartx_tfr_s cn31xx; | ||
1656 | struct cvmx_mio_uartx_tfr_s cn38xx; | ||
1657 | struct cvmx_mio_uartx_tfr_s cn38xxp2; | ||
1658 | struct cvmx_mio_uartx_tfr_s cn50xx; | ||
1659 | struct cvmx_mio_uartx_tfr_s cn52xx; | ||
1660 | struct cvmx_mio_uartx_tfr_s cn52xxp1; | ||
1661 | struct cvmx_mio_uartx_tfr_s cn56xx; | ||
1662 | struct cvmx_mio_uartx_tfr_s cn56xxp1; | ||
1663 | struct cvmx_mio_uartx_tfr_s cn58xx; | ||
1664 | struct cvmx_mio_uartx_tfr_s cn58xxp1; | ||
1665 | }; | ||
1666 | |||
1667 | union cvmx_mio_uartx_thr { | ||
1668 | uint64_t u64; | ||
1669 | struct cvmx_mio_uartx_thr_s { | ||
1670 | uint64_t reserved_8_63:56; | ||
1671 | uint64_t thr:8; | ||
1672 | } s; | ||
1673 | struct cvmx_mio_uartx_thr_s cn30xx; | ||
1674 | struct cvmx_mio_uartx_thr_s cn31xx; | ||
1675 | struct cvmx_mio_uartx_thr_s cn38xx; | ||
1676 | struct cvmx_mio_uartx_thr_s cn38xxp2; | ||
1677 | struct cvmx_mio_uartx_thr_s cn50xx; | ||
1678 | struct cvmx_mio_uartx_thr_s cn52xx; | ||
1679 | struct cvmx_mio_uartx_thr_s cn52xxp1; | ||
1680 | struct cvmx_mio_uartx_thr_s cn56xx; | ||
1681 | struct cvmx_mio_uartx_thr_s cn56xxp1; | ||
1682 | struct cvmx_mio_uartx_thr_s cn58xx; | ||
1683 | struct cvmx_mio_uartx_thr_s cn58xxp1; | ||
1684 | }; | ||
1685 | |||
1686 | union cvmx_mio_uartx_usr { | ||
1687 | uint64_t u64; | ||
1688 | struct cvmx_mio_uartx_usr_s { | ||
1689 | uint64_t reserved_5_63:59; | ||
1690 | uint64_t rff:1; | ||
1691 | uint64_t rfne:1; | ||
1692 | uint64_t tfe:1; | ||
1693 | uint64_t tfnf:1; | ||
1694 | uint64_t busy:1; | ||
1695 | } s; | ||
1696 | struct cvmx_mio_uartx_usr_s cn30xx; | ||
1697 | struct cvmx_mio_uartx_usr_s cn31xx; | ||
1698 | struct cvmx_mio_uartx_usr_s cn38xx; | ||
1699 | struct cvmx_mio_uartx_usr_s cn38xxp2; | ||
1700 | struct cvmx_mio_uartx_usr_s cn50xx; | ||
1701 | struct cvmx_mio_uartx_usr_s cn52xx; | ||
1702 | struct cvmx_mio_uartx_usr_s cn52xxp1; | ||
1703 | struct cvmx_mio_uartx_usr_s cn56xx; | ||
1704 | struct cvmx_mio_uartx_usr_s cn56xxp1; | ||
1705 | struct cvmx_mio_uartx_usr_s cn58xx; | ||
1706 | struct cvmx_mio_uartx_usr_s cn58xxp1; | ||
1707 | }; | ||
1708 | |||
1709 | union cvmx_mio_uart2_dlh { | ||
1710 | uint64_t u64; | ||
1711 | struct cvmx_mio_uart2_dlh_s { | ||
1712 | uint64_t reserved_8_63:56; | ||
1713 | uint64_t dlh:8; | ||
1714 | } s; | ||
1715 | struct cvmx_mio_uart2_dlh_s cn52xx; | ||
1716 | struct cvmx_mio_uart2_dlh_s cn52xxp1; | ||
1717 | }; | ||
1718 | |||
1719 | union cvmx_mio_uart2_dll { | ||
1720 | uint64_t u64; | ||
1721 | struct cvmx_mio_uart2_dll_s { | ||
1722 | uint64_t reserved_8_63:56; | ||
1723 | uint64_t dll:8; | ||
1724 | } s; | ||
1725 | struct cvmx_mio_uart2_dll_s cn52xx; | ||
1726 | struct cvmx_mio_uart2_dll_s cn52xxp1; | ||
1727 | }; | ||
1728 | |||
1729 | union cvmx_mio_uart2_far { | ||
1730 | uint64_t u64; | ||
1731 | struct cvmx_mio_uart2_far_s { | ||
1732 | uint64_t reserved_1_63:63; | ||
1733 | uint64_t far:1; | ||
1734 | } s; | ||
1735 | struct cvmx_mio_uart2_far_s cn52xx; | ||
1736 | struct cvmx_mio_uart2_far_s cn52xxp1; | ||
1737 | }; | ||
1738 | |||
1739 | union cvmx_mio_uart2_fcr { | ||
1740 | uint64_t u64; | ||
1741 | struct cvmx_mio_uart2_fcr_s { | ||
1742 | uint64_t reserved_8_63:56; | ||
1743 | uint64_t rxtrig:2; | ||
1744 | uint64_t txtrig:2; | ||
1745 | uint64_t reserved_3_3:1; | ||
1746 | uint64_t txfr:1; | ||
1747 | uint64_t rxfr:1; | ||
1748 | uint64_t en:1; | ||
1749 | } s; | ||
1750 | struct cvmx_mio_uart2_fcr_s cn52xx; | ||
1751 | struct cvmx_mio_uart2_fcr_s cn52xxp1; | ||
1752 | }; | ||
1753 | |||
1754 | union cvmx_mio_uart2_htx { | ||
1755 | uint64_t u64; | ||
1756 | struct cvmx_mio_uart2_htx_s { | ||
1757 | uint64_t reserved_1_63:63; | ||
1758 | uint64_t htx:1; | ||
1759 | } s; | ||
1760 | struct cvmx_mio_uart2_htx_s cn52xx; | ||
1761 | struct cvmx_mio_uart2_htx_s cn52xxp1; | ||
1762 | }; | ||
1763 | |||
1764 | union cvmx_mio_uart2_ier { | ||
1765 | uint64_t u64; | ||
1766 | struct cvmx_mio_uart2_ier_s { | ||
1767 | uint64_t reserved_8_63:56; | ||
1768 | uint64_t ptime:1; | ||
1769 | uint64_t reserved_4_6:3; | ||
1770 | uint64_t edssi:1; | ||
1771 | uint64_t elsi:1; | ||
1772 | uint64_t etbei:1; | ||
1773 | uint64_t erbfi:1; | ||
1774 | } s; | ||
1775 | struct cvmx_mio_uart2_ier_s cn52xx; | ||
1776 | struct cvmx_mio_uart2_ier_s cn52xxp1; | ||
1777 | }; | ||
1778 | |||
1779 | union cvmx_mio_uart2_iir { | ||
1780 | uint64_t u64; | ||
1781 | struct cvmx_mio_uart2_iir_s { | ||
1782 | uint64_t reserved_8_63:56; | ||
1783 | uint64_t fen:2; | ||
1784 | uint64_t reserved_4_5:2; | ||
1785 | uint64_t iid:4; | ||
1786 | } s; | ||
1787 | struct cvmx_mio_uart2_iir_s cn52xx; | ||
1788 | struct cvmx_mio_uart2_iir_s cn52xxp1; | ||
1789 | }; | ||
1790 | |||
1791 | union cvmx_mio_uart2_lcr { | ||
1792 | uint64_t u64; | ||
1793 | struct cvmx_mio_uart2_lcr_s { | ||
1794 | uint64_t reserved_8_63:56; | ||
1795 | uint64_t dlab:1; | ||
1796 | uint64_t brk:1; | ||
1797 | uint64_t reserved_5_5:1; | ||
1798 | uint64_t eps:1; | ||
1799 | uint64_t pen:1; | ||
1800 | uint64_t stop:1; | ||
1801 | uint64_t cls:2; | ||
1802 | } s; | ||
1803 | struct cvmx_mio_uart2_lcr_s cn52xx; | ||
1804 | struct cvmx_mio_uart2_lcr_s cn52xxp1; | ||
1805 | }; | ||
1806 | |||
1807 | union cvmx_mio_uart2_lsr { | ||
1808 | uint64_t u64; | ||
1809 | struct cvmx_mio_uart2_lsr_s { | ||
1810 | uint64_t reserved_8_63:56; | ||
1811 | uint64_t ferr:1; | ||
1812 | uint64_t temt:1; | ||
1813 | uint64_t thre:1; | ||
1814 | uint64_t bi:1; | ||
1815 | uint64_t fe:1; | ||
1816 | uint64_t pe:1; | ||
1817 | uint64_t oe:1; | ||
1818 | uint64_t dr:1; | ||
1819 | } s; | ||
1820 | struct cvmx_mio_uart2_lsr_s cn52xx; | ||
1821 | struct cvmx_mio_uart2_lsr_s cn52xxp1; | ||
1822 | }; | ||
1823 | |||
1824 | union cvmx_mio_uart2_mcr { | ||
1825 | uint64_t u64; | ||
1826 | struct cvmx_mio_uart2_mcr_s { | ||
1827 | uint64_t reserved_6_63:58; | ||
1828 | uint64_t afce:1; | ||
1829 | uint64_t loop:1; | ||
1830 | uint64_t out2:1; | ||
1831 | uint64_t out1:1; | ||
1832 | uint64_t rts:1; | ||
1833 | uint64_t dtr:1; | ||
1834 | } s; | ||
1835 | struct cvmx_mio_uart2_mcr_s cn52xx; | ||
1836 | struct cvmx_mio_uart2_mcr_s cn52xxp1; | ||
1837 | }; | ||
1838 | |||
1839 | union cvmx_mio_uart2_msr { | ||
1840 | uint64_t u64; | ||
1841 | struct cvmx_mio_uart2_msr_s { | ||
1842 | uint64_t reserved_8_63:56; | ||
1843 | uint64_t dcd:1; | ||
1844 | uint64_t ri:1; | ||
1845 | uint64_t dsr:1; | ||
1846 | uint64_t cts:1; | ||
1847 | uint64_t ddcd:1; | ||
1848 | uint64_t teri:1; | ||
1849 | uint64_t ddsr:1; | ||
1850 | uint64_t dcts:1; | ||
1851 | } s; | ||
1852 | struct cvmx_mio_uart2_msr_s cn52xx; | ||
1853 | struct cvmx_mio_uart2_msr_s cn52xxp1; | ||
1854 | }; | ||
1855 | |||
1856 | union cvmx_mio_uart2_rbr { | ||
1857 | uint64_t u64; | ||
1858 | struct cvmx_mio_uart2_rbr_s { | ||
1859 | uint64_t reserved_8_63:56; | ||
1860 | uint64_t rbr:8; | ||
1861 | } s; | ||
1862 | struct cvmx_mio_uart2_rbr_s cn52xx; | ||
1863 | struct cvmx_mio_uart2_rbr_s cn52xxp1; | ||
1864 | }; | ||
1865 | |||
1866 | union cvmx_mio_uart2_rfl { | ||
1867 | uint64_t u64; | ||
1868 | struct cvmx_mio_uart2_rfl_s { | ||
1869 | uint64_t reserved_7_63:57; | ||
1870 | uint64_t rfl:7; | ||
1871 | } s; | ||
1872 | struct cvmx_mio_uart2_rfl_s cn52xx; | ||
1873 | struct cvmx_mio_uart2_rfl_s cn52xxp1; | ||
1874 | }; | ||
1875 | |||
1876 | union cvmx_mio_uart2_rfw { | ||
1877 | uint64_t u64; | ||
1878 | struct cvmx_mio_uart2_rfw_s { | ||
1879 | uint64_t reserved_10_63:54; | ||
1880 | uint64_t rffe:1; | ||
1881 | uint64_t rfpe:1; | ||
1882 | uint64_t rfwd:8; | ||
1883 | } s; | ||
1884 | struct cvmx_mio_uart2_rfw_s cn52xx; | ||
1885 | struct cvmx_mio_uart2_rfw_s cn52xxp1; | ||
1886 | }; | ||
1887 | |||
1888 | union cvmx_mio_uart2_sbcr { | ||
1889 | uint64_t u64; | ||
1890 | struct cvmx_mio_uart2_sbcr_s { | ||
1891 | uint64_t reserved_1_63:63; | ||
1892 | uint64_t sbcr:1; | ||
1893 | } s; | ||
1894 | struct cvmx_mio_uart2_sbcr_s cn52xx; | ||
1895 | struct cvmx_mio_uart2_sbcr_s cn52xxp1; | ||
1896 | }; | ||
1897 | |||
1898 | union cvmx_mio_uart2_scr { | ||
1899 | uint64_t u64; | ||
1900 | struct cvmx_mio_uart2_scr_s { | ||
1901 | uint64_t reserved_8_63:56; | ||
1902 | uint64_t scr:8; | ||
1903 | } s; | ||
1904 | struct cvmx_mio_uart2_scr_s cn52xx; | ||
1905 | struct cvmx_mio_uart2_scr_s cn52xxp1; | ||
1906 | }; | ||
1907 | |||
1908 | union cvmx_mio_uart2_sfe { | ||
1909 | uint64_t u64; | ||
1910 | struct cvmx_mio_uart2_sfe_s { | ||
1911 | uint64_t reserved_1_63:63; | ||
1912 | uint64_t sfe:1; | ||
1913 | } s; | ||
1914 | struct cvmx_mio_uart2_sfe_s cn52xx; | ||
1915 | struct cvmx_mio_uart2_sfe_s cn52xxp1; | ||
1916 | }; | ||
1917 | |||
1918 | union cvmx_mio_uart2_srr { | ||
1919 | uint64_t u64; | ||
1920 | struct cvmx_mio_uart2_srr_s { | ||
1921 | uint64_t reserved_3_63:61; | ||
1922 | uint64_t stfr:1; | ||
1923 | uint64_t srfr:1; | ||
1924 | uint64_t usr:1; | ||
1925 | } s; | ||
1926 | struct cvmx_mio_uart2_srr_s cn52xx; | ||
1927 | struct cvmx_mio_uart2_srr_s cn52xxp1; | ||
1928 | }; | ||
1929 | |||
1930 | union cvmx_mio_uart2_srt { | ||
1931 | uint64_t u64; | ||
1932 | struct cvmx_mio_uart2_srt_s { | ||
1933 | uint64_t reserved_2_63:62; | ||
1934 | uint64_t srt:2; | ||
1935 | } s; | ||
1936 | struct cvmx_mio_uart2_srt_s cn52xx; | ||
1937 | struct cvmx_mio_uart2_srt_s cn52xxp1; | ||
1938 | }; | ||
1939 | |||
1940 | union cvmx_mio_uart2_srts { | ||
1941 | uint64_t u64; | ||
1942 | struct cvmx_mio_uart2_srts_s { | ||
1943 | uint64_t reserved_1_63:63; | ||
1944 | uint64_t srts:1; | ||
1945 | } s; | ||
1946 | struct cvmx_mio_uart2_srts_s cn52xx; | ||
1947 | struct cvmx_mio_uart2_srts_s cn52xxp1; | ||
1948 | }; | ||
1949 | |||
1950 | union cvmx_mio_uart2_stt { | ||
1951 | uint64_t u64; | ||
1952 | struct cvmx_mio_uart2_stt_s { | ||
1953 | uint64_t reserved_2_63:62; | ||
1954 | uint64_t stt:2; | ||
1955 | } s; | ||
1956 | struct cvmx_mio_uart2_stt_s cn52xx; | ||
1957 | struct cvmx_mio_uart2_stt_s cn52xxp1; | ||
1958 | }; | ||
1959 | |||
1960 | union cvmx_mio_uart2_tfl { | ||
1961 | uint64_t u64; | ||
1962 | struct cvmx_mio_uart2_tfl_s { | ||
1963 | uint64_t reserved_7_63:57; | ||
1964 | uint64_t tfl:7; | ||
1965 | } s; | ||
1966 | struct cvmx_mio_uart2_tfl_s cn52xx; | ||
1967 | struct cvmx_mio_uart2_tfl_s cn52xxp1; | ||
1968 | }; | ||
1969 | |||
1970 | union cvmx_mio_uart2_tfr { | ||
1971 | uint64_t u64; | ||
1972 | struct cvmx_mio_uart2_tfr_s { | ||
1973 | uint64_t reserved_8_63:56; | ||
1974 | uint64_t tfr:8; | ||
1975 | } s; | ||
1976 | struct cvmx_mio_uart2_tfr_s cn52xx; | ||
1977 | struct cvmx_mio_uart2_tfr_s cn52xxp1; | ||
1978 | }; | ||
1979 | |||
1980 | union cvmx_mio_uart2_thr { | ||
1981 | uint64_t u64; | ||
1982 | struct cvmx_mio_uart2_thr_s { | ||
1983 | uint64_t reserved_8_63:56; | ||
1984 | uint64_t thr:8; | ||
1985 | } s; | ||
1986 | struct cvmx_mio_uart2_thr_s cn52xx; | ||
1987 | struct cvmx_mio_uart2_thr_s cn52xxp1; | ||
1988 | }; | ||
1989 | |||
1990 | union cvmx_mio_uart2_usr { | ||
1991 | uint64_t u64; | ||
1992 | struct cvmx_mio_uart2_usr_s { | ||
1993 | uint64_t reserved_5_63:59; | ||
1994 | uint64_t rff:1; | ||
1995 | uint64_t rfne:1; | ||
1996 | uint64_t tfe:1; | ||
1997 | uint64_t tfnf:1; | ||
1998 | uint64_t busy:1; | ||
1999 | } s; | ||
2000 | struct cvmx_mio_uart2_usr_s cn52xx; | ||
2001 | struct cvmx_mio_uart2_usr_s cn52xxp1; | ||
2002 | }; | ||
2003 | |||
2004 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-packet.h b/arch/mips/include/asm/octeon/cvmx-packet.h new file mode 100644 index 000000000000..38aefa1bab9d --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-packet.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * Packet buffer defines. | ||
30 | */ | ||
31 | |||
32 | #ifndef __CVMX_PACKET_H__ | ||
33 | #define __CVMX_PACKET_H__ | ||
34 | |||
35 | /** | ||
36 | * This structure defines a buffer pointer on Octeon | ||
37 | */ | ||
38 | union cvmx_buf_ptr { | ||
39 | void *ptr; | ||
40 | uint64_t u64; | ||
41 | struct { | ||
42 | /* if set, invert the "free" pick of the overall | ||
43 | * packet. HW always sets this bit to 0 on inbound | ||
44 | * packet */ | ||
45 | uint64_t i:1; | ||
46 | |||
47 | /* Indicates the amount to back up to get to the | ||
48 | * buffer start in cache lines. In most cases this is | ||
49 | * less than one complete cache line, so the value is | ||
50 | * zero */ | ||
51 | uint64_t back:4; | ||
52 | /* The pool that the buffer came from / goes to */ | ||
53 | uint64_t pool:3; | ||
54 | /* The size of the segment pointed to by addr (in bytes) */ | ||
55 | uint64_t size:16; | ||
56 | /* Pointer to the first byte of the data, NOT buffer */ | ||
57 | uint64_t addr:40; | ||
58 | } s; | ||
59 | }; | ||
60 | |||
61 | #endif /* __CVMX_PACKET_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-pow-defs.h b/arch/mips/include/asm/octeon/cvmx-pow-defs.h new file mode 100644 index 000000000000..2d82e24be51c --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-pow-defs.h | |||
@@ -0,0 +1,698 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_POW_DEFS_H__ | ||
29 | #define __CVMX_POW_DEFS_H__ | ||
30 | |||
31 | #define CVMX_POW_BIST_STAT \ | ||
32 | CVMX_ADD_IO_SEG(0x00016700000003F8ull) | ||
33 | #define CVMX_POW_DS_PC \ | ||
34 | CVMX_ADD_IO_SEG(0x0001670000000398ull) | ||
35 | #define CVMX_POW_ECC_ERR \ | ||
36 | CVMX_ADD_IO_SEG(0x0001670000000218ull) | ||
37 | #define CVMX_POW_INT_CTL \ | ||
38 | CVMX_ADD_IO_SEG(0x0001670000000220ull) | ||
39 | #define CVMX_POW_IQ_CNTX(offset) \ | ||
40 | CVMX_ADD_IO_SEG(0x0001670000000340ull + (((offset) & 7) * 8)) | ||
41 | #define CVMX_POW_IQ_COM_CNT \ | ||
42 | CVMX_ADD_IO_SEG(0x0001670000000388ull) | ||
43 | #define CVMX_POW_IQ_INT \ | ||
44 | CVMX_ADD_IO_SEG(0x0001670000000238ull) | ||
45 | #define CVMX_POW_IQ_INT_EN \ | ||
46 | CVMX_ADD_IO_SEG(0x0001670000000240ull) | ||
47 | #define CVMX_POW_IQ_THRX(offset) \ | ||
48 | CVMX_ADD_IO_SEG(0x00016700000003A0ull + (((offset) & 7) * 8)) | ||
49 | #define CVMX_POW_NOS_CNT \ | ||
50 | CVMX_ADD_IO_SEG(0x0001670000000228ull) | ||
51 | #define CVMX_POW_NW_TIM \ | ||
52 | CVMX_ADD_IO_SEG(0x0001670000000210ull) | ||
53 | #define CVMX_POW_PF_RST_MSK \ | ||
54 | CVMX_ADD_IO_SEG(0x0001670000000230ull) | ||
55 | #define CVMX_POW_PP_GRP_MSKX(offset) \ | ||
56 | CVMX_ADD_IO_SEG(0x0001670000000000ull + (((offset) & 15) * 8)) | ||
57 | #define CVMX_POW_QOS_RNDX(offset) \ | ||
58 | CVMX_ADD_IO_SEG(0x00016700000001C0ull + (((offset) & 7) * 8)) | ||
59 | #define CVMX_POW_QOS_THRX(offset) \ | ||
60 | CVMX_ADD_IO_SEG(0x0001670000000180ull + (((offset) & 7) * 8)) | ||
61 | #define CVMX_POW_TS_PC \ | ||
62 | CVMX_ADD_IO_SEG(0x0001670000000390ull) | ||
63 | #define CVMX_POW_WA_COM_PC \ | ||
64 | CVMX_ADD_IO_SEG(0x0001670000000380ull) | ||
65 | #define CVMX_POW_WA_PCX(offset) \ | ||
66 | CVMX_ADD_IO_SEG(0x0001670000000300ull + (((offset) & 7) * 8)) | ||
67 | #define CVMX_POW_WQ_INT \ | ||
68 | CVMX_ADD_IO_SEG(0x0001670000000200ull) | ||
69 | #define CVMX_POW_WQ_INT_CNTX(offset) \ | ||
70 | CVMX_ADD_IO_SEG(0x0001670000000100ull + (((offset) & 15) * 8)) | ||
71 | #define CVMX_POW_WQ_INT_PC \ | ||
72 | CVMX_ADD_IO_SEG(0x0001670000000208ull) | ||
73 | #define CVMX_POW_WQ_INT_THRX(offset) \ | ||
74 | CVMX_ADD_IO_SEG(0x0001670000000080ull + (((offset) & 15) * 8)) | ||
75 | #define CVMX_POW_WS_PCX(offset) \ | ||
76 | CVMX_ADD_IO_SEG(0x0001670000000280ull + (((offset) & 15) * 8)) | ||
77 | |||
78 | union cvmx_pow_bist_stat { | ||
79 | uint64_t u64; | ||
80 | struct cvmx_pow_bist_stat_s { | ||
81 | uint64_t reserved_32_63:32; | ||
82 | uint64_t pp:16; | ||
83 | uint64_t reserved_0_15:16; | ||
84 | } s; | ||
85 | struct cvmx_pow_bist_stat_cn30xx { | ||
86 | uint64_t reserved_17_63:47; | ||
87 | uint64_t pp:1; | ||
88 | uint64_t reserved_9_15:7; | ||
89 | uint64_t cam:1; | ||
90 | uint64_t nbt1:1; | ||
91 | uint64_t nbt0:1; | ||
92 | uint64_t index:1; | ||
93 | uint64_t fidx:1; | ||
94 | uint64_t nbr1:1; | ||
95 | uint64_t nbr0:1; | ||
96 | uint64_t pend:1; | ||
97 | uint64_t adr:1; | ||
98 | } cn30xx; | ||
99 | struct cvmx_pow_bist_stat_cn31xx { | ||
100 | uint64_t reserved_18_63:46; | ||
101 | uint64_t pp:2; | ||
102 | uint64_t reserved_9_15:7; | ||
103 | uint64_t cam:1; | ||
104 | uint64_t nbt1:1; | ||
105 | uint64_t nbt0:1; | ||
106 | uint64_t index:1; | ||
107 | uint64_t fidx:1; | ||
108 | uint64_t nbr1:1; | ||
109 | uint64_t nbr0:1; | ||
110 | uint64_t pend:1; | ||
111 | uint64_t adr:1; | ||
112 | } cn31xx; | ||
113 | struct cvmx_pow_bist_stat_cn38xx { | ||
114 | uint64_t reserved_32_63:32; | ||
115 | uint64_t pp:16; | ||
116 | uint64_t reserved_10_15:6; | ||
117 | uint64_t cam:1; | ||
118 | uint64_t nbt:1; | ||
119 | uint64_t index:1; | ||
120 | uint64_t fidx:1; | ||
121 | uint64_t nbr1:1; | ||
122 | uint64_t nbr0:1; | ||
123 | uint64_t pend1:1; | ||
124 | uint64_t pend0:1; | ||
125 | uint64_t adr1:1; | ||
126 | uint64_t adr0:1; | ||
127 | } cn38xx; | ||
128 | struct cvmx_pow_bist_stat_cn38xx cn38xxp2; | ||
129 | struct cvmx_pow_bist_stat_cn31xx cn50xx; | ||
130 | struct cvmx_pow_bist_stat_cn52xx { | ||
131 | uint64_t reserved_20_63:44; | ||
132 | uint64_t pp:4; | ||
133 | uint64_t reserved_9_15:7; | ||
134 | uint64_t cam:1; | ||
135 | uint64_t nbt1:1; | ||
136 | uint64_t nbt0:1; | ||
137 | uint64_t index:1; | ||
138 | uint64_t fidx:1; | ||
139 | uint64_t nbr1:1; | ||
140 | uint64_t nbr0:1; | ||
141 | uint64_t pend:1; | ||
142 | uint64_t adr:1; | ||
143 | } cn52xx; | ||
144 | struct cvmx_pow_bist_stat_cn52xx cn52xxp1; | ||
145 | struct cvmx_pow_bist_stat_cn56xx { | ||
146 | uint64_t reserved_28_63:36; | ||
147 | uint64_t pp:12; | ||
148 | uint64_t reserved_10_15:6; | ||
149 | uint64_t cam:1; | ||
150 | uint64_t nbt:1; | ||
151 | uint64_t index:1; | ||
152 | uint64_t fidx:1; | ||
153 | uint64_t nbr1:1; | ||
154 | uint64_t nbr0:1; | ||
155 | uint64_t pend1:1; | ||
156 | uint64_t pend0:1; | ||
157 | uint64_t adr1:1; | ||
158 | uint64_t adr0:1; | ||
159 | } cn56xx; | ||
160 | struct cvmx_pow_bist_stat_cn56xx cn56xxp1; | ||
161 | struct cvmx_pow_bist_stat_cn38xx cn58xx; | ||
162 | struct cvmx_pow_bist_stat_cn38xx cn58xxp1; | ||
163 | }; | ||
164 | |||
165 | union cvmx_pow_ds_pc { | ||
166 | uint64_t u64; | ||
167 | struct cvmx_pow_ds_pc_s { | ||
168 | uint64_t reserved_32_63:32; | ||
169 | uint64_t ds_pc:32; | ||
170 | } s; | ||
171 | struct cvmx_pow_ds_pc_s cn30xx; | ||
172 | struct cvmx_pow_ds_pc_s cn31xx; | ||
173 | struct cvmx_pow_ds_pc_s cn38xx; | ||
174 | struct cvmx_pow_ds_pc_s cn38xxp2; | ||
175 | struct cvmx_pow_ds_pc_s cn50xx; | ||
176 | struct cvmx_pow_ds_pc_s cn52xx; | ||
177 | struct cvmx_pow_ds_pc_s cn52xxp1; | ||
178 | struct cvmx_pow_ds_pc_s cn56xx; | ||
179 | struct cvmx_pow_ds_pc_s cn56xxp1; | ||
180 | struct cvmx_pow_ds_pc_s cn58xx; | ||
181 | struct cvmx_pow_ds_pc_s cn58xxp1; | ||
182 | }; | ||
183 | |||
184 | union cvmx_pow_ecc_err { | ||
185 | uint64_t u64; | ||
186 | struct cvmx_pow_ecc_err_s { | ||
187 | uint64_t reserved_45_63:19; | ||
188 | uint64_t iop_ie:13; | ||
189 | uint64_t reserved_29_31:3; | ||
190 | uint64_t iop:13; | ||
191 | uint64_t reserved_14_15:2; | ||
192 | uint64_t rpe_ie:1; | ||
193 | uint64_t rpe:1; | ||
194 | uint64_t reserved_9_11:3; | ||
195 | uint64_t syn:5; | ||
196 | uint64_t dbe_ie:1; | ||
197 | uint64_t sbe_ie:1; | ||
198 | uint64_t dbe:1; | ||
199 | uint64_t sbe:1; | ||
200 | } s; | ||
201 | struct cvmx_pow_ecc_err_s cn30xx; | ||
202 | struct cvmx_pow_ecc_err_cn31xx { | ||
203 | uint64_t reserved_14_63:50; | ||
204 | uint64_t rpe_ie:1; | ||
205 | uint64_t rpe:1; | ||
206 | uint64_t reserved_9_11:3; | ||
207 | uint64_t syn:5; | ||
208 | uint64_t dbe_ie:1; | ||
209 | uint64_t sbe_ie:1; | ||
210 | uint64_t dbe:1; | ||
211 | uint64_t sbe:1; | ||
212 | } cn31xx; | ||
213 | struct cvmx_pow_ecc_err_s cn38xx; | ||
214 | struct cvmx_pow_ecc_err_cn31xx cn38xxp2; | ||
215 | struct cvmx_pow_ecc_err_s cn50xx; | ||
216 | struct cvmx_pow_ecc_err_s cn52xx; | ||
217 | struct cvmx_pow_ecc_err_s cn52xxp1; | ||
218 | struct cvmx_pow_ecc_err_s cn56xx; | ||
219 | struct cvmx_pow_ecc_err_s cn56xxp1; | ||
220 | struct cvmx_pow_ecc_err_s cn58xx; | ||
221 | struct cvmx_pow_ecc_err_s cn58xxp1; | ||
222 | }; | ||
223 | |||
224 | union cvmx_pow_int_ctl { | ||
225 | uint64_t u64; | ||
226 | struct cvmx_pow_int_ctl_s { | ||
227 | uint64_t reserved_6_63:58; | ||
228 | uint64_t pfr_dis:1; | ||
229 | uint64_t nbr_thr:5; | ||
230 | } s; | ||
231 | struct cvmx_pow_int_ctl_s cn30xx; | ||
232 | struct cvmx_pow_int_ctl_s cn31xx; | ||
233 | struct cvmx_pow_int_ctl_s cn38xx; | ||
234 | struct cvmx_pow_int_ctl_s cn38xxp2; | ||
235 | struct cvmx_pow_int_ctl_s cn50xx; | ||
236 | struct cvmx_pow_int_ctl_s cn52xx; | ||
237 | struct cvmx_pow_int_ctl_s cn52xxp1; | ||
238 | struct cvmx_pow_int_ctl_s cn56xx; | ||
239 | struct cvmx_pow_int_ctl_s cn56xxp1; | ||
240 | struct cvmx_pow_int_ctl_s cn58xx; | ||
241 | struct cvmx_pow_int_ctl_s cn58xxp1; | ||
242 | }; | ||
243 | |||
244 | union cvmx_pow_iq_cntx { | ||
245 | uint64_t u64; | ||
246 | struct cvmx_pow_iq_cntx_s { | ||
247 | uint64_t reserved_32_63:32; | ||
248 | uint64_t iq_cnt:32; | ||
249 | } s; | ||
250 | struct cvmx_pow_iq_cntx_s cn30xx; | ||
251 | struct cvmx_pow_iq_cntx_s cn31xx; | ||
252 | struct cvmx_pow_iq_cntx_s cn38xx; | ||
253 | struct cvmx_pow_iq_cntx_s cn38xxp2; | ||
254 | struct cvmx_pow_iq_cntx_s cn50xx; | ||
255 | struct cvmx_pow_iq_cntx_s cn52xx; | ||
256 | struct cvmx_pow_iq_cntx_s cn52xxp1; | ||
257 | struct cvmx_pow_iq_cntx_s cn56xx; | ||
258 | struct cvmx_pow_iq_cntx_s cn56xxp1; | ||
259 | struct cvmx_pow_iq_cntx_s cn58xx; | ||
260 | struct cvmx_pow_iq_cntx_s cn58xxp1; | ||
261 | }; | ||
262 | |||
263 | union cvmx_pow_iq_com_cnt { | ||
264 | uint64_t u64; | ||
265 | struct cvmx_pow_iq_com_cnt_s { | ||
266 | uint64_t reserved_32_63:32; | ||
267 | uint64_t iq_cnt:32; | ||
268 | } s; | ||
269 | struct cvmx_pow_iq_com_cnt_s cn30xx; | ||
270 | struct cvmx_pow_iq_com_cnt_s cn31xx; | ||
271 | struct cvmx_pow_iq_com_cnt_s cn38xx; | ||
272 | struct cvmx_pow_iq_com_cnt_s cn38xxp2; | ||
273 | struct cvmx_pow_iq_com_cnt_s cn50xx; | ||
274 | struct cvmx_pow_iq_com_cnt_s cn52xx; | ||
275 | struct cvmx_pow_iq_com_cnt_s cn52xxp1; | ||
276 | struct cvmx_pow_iq_com_cnt_s cn56xx; | ||
277 | struct cvmx_pow_iq_com_cnt_s cn56xxp1; | ||
278 | struct cvmx_pow_iq_com_cnt_s cn58xx; | ||
279 | struct cvmx_pow_iq_com_cnt_s cn58xxp1; | ||
280 | }; | ||
281 | |||
282 | union cvmx_pow_iq_int { | ||
283 | uint64_t u64; | ||
284 | struct cvmx_pow_iq_int_s { | ||
285 | uint64_t reserved_8_63:56; | ||
286 | uint64_t iq_int:8; | ||
287 | } s; | ||
288 | struct cvmx_pow_iq_int_s cn52xx; | ||
289 | struct cvmx_pow_iq_int_s cn52xxp1; | ||
290 | struct cvmx_pow_iq_int_s cn56xx; | ||
291 | struct cvmx_pow_iq_int_s cn56xxp1; | ||
292 | }; | ||
293 | |||
294 | union cvmx_pow_iq_int_en { | ||
295 | uint64_t u64; | ||
296 | struct cvmx_pow_iq_int_en_s { | ||
297 | uint64_t reserved_8_63:56; | ||
298 | uint64_t int_en:8; | ||
299 | } s; | ||
300 | struct cvmx_pow_iq_int_en_s cn52xx; | ||
301 | struct cvmx_pow_iq_int_en_s cn52xxp1; | ||
302 | struct cvmx_pow_iq_int_en_s cn56xx; | ||
303 | struct cvmx_pow_iq_int_en_s cn56xxp1; | ||
304 | }; | ||
305 | |||
306 | union cvmx_pow_iq_thrx { | ||
307 | uint64_t u64; | ||
308 | struct cvmx_pow_iq_thrx_s { | ||
309 | uint64_t reserved_32_63:32; | ||
310 | uint64_t iq_thr:32; | ||
311 | } s; | ||
312 | struct cvmx_pow_iq_thrx_s cn52xx; | ||
313 | struct cvmx_pow_iq_thrx_s cn52xxp1; | ||
314 | struct cvmx_pow_iq_thrx_s cn56xx; | ||
315 | struct cvmx_pow_iq_thrx_s cn56xxp1; | ||
316 | }; | ||
317 | |||
318 | union cvmx_pow_nos_cnt { | ||
319 | uint64_t u64; | ||
320 | struct cvmx_pow_nos_cnt_s { | ||
321 | uint64_t reserved_12_63:52; | ||
322 | uint64_t nos_cnt:12; | ||
323 | } s; | ||
324 | struct cvmx_pow_nos_cnt_cn30xx { | ||
325 | uint64_t reserved_7_63:57; | ||
326 | uint64_t nos_cnt:7; | ||
327 | } cn30xx; | ||
328 | struct cvmx_pow_nos_cnt_cn31xx { | ||
329 | uint64_t reserved_9_63:55; | ||
330 | uint64_t nos_cnt:9; | ||
331 | } cn31xx; | ||
332 | struct cvmx_pow_nos_cnt_s cn38xx; | ||
333 | struct cvmx_pow_nos_cnt_s cn38xxp2; | ||
334 | struct cvmx_pow_nos_cnt_cn31xx cn50xx; | ||
335 | struct cvmx_pow_nos_cnt_cn52xx { | ||
336 | uint64_t reserved_10_63:54; | ||
337 | uint64_t nos_cnt:10; | ||
338 | } cn52xx; | ||
339 | struct cvmx_pow_nos_cnt_cn52xx cn52xxp1; | ||
340 | struct cvmx_pow_nos_cnt_s cn56xx; | ||
341 | struct cvmx_pow_nos_cnt_s cn56xxp1; | ||
342 | struct cvmx_pow_nos_cnt_s cn58xx; | ||
343 | struct cvmx_pow_nos_cnt_s cn58xxp1; | ||
344 | }; | ||
345 | |||
346 | union cvmx_pow_nw_tim { | ||
347 | uint64_t u64; | ||
348 | struct cvmx_pow_nw_tim_s { | ||
349 | uint64_t reserved_10_63:54; | ||
350 | uint64_t nw_tim:10; | ||
351 | } s; | ||
352 | struct cvmx_pow_nw_tim_s cn30xx; | ||
353 | struct cvmx_pow_nw_tim_s cn31xx; | ||
354 | struct cvmx_pow_nw_tim_s cn38xx; | ||
355 | struct cvmx_pow_nw_tim_s cn38xxp2; | ||
356 | struct cvmx_pow_nw_tim_s cn50xx; | ||
357 | struct cvmx_pow_nw_tim_s cn52xx; | ||
358 | struct cvmx_pow_nw_tim_s cn52xxp1; | ||
359 | struct cvmx_pow_nw_tim_s cn56xx; | ||
360 | struct cvmx_pow_nw_tim_s cn56xxp1; | ||
361 | struct cvmx_pow_nw_tim_s cn58xx; | ||
362 | struct cvmx_pow_nw_tim_s cn58xxp1; | ||
363 | }; | ||
364 | |||
365 | union cvmx_pow_pf_rst_msk { | ||
366 | uint64_t u64; | ||
367 | struct cvmx_pow_pf_rst_msk_s { | ||
368 | uint64_t reserved_8_63:56; | ||
369 | uint64_t rst_msk:8; | ||
370 | } s; | ||
371 | struct cvmx_pow_pf_rst_msk_s cn50xx; | ||
372 | struct cvmx_pow_pf_rst_msk_s cn52xx; | ||
373 | struct cvmx_pow_pf_rst_msk_s cn52xxp1; | ||
374 | struct cvmx_pow_pf_rst_msk_s cn56xx; | ||
375 | struct cvmx_pow_pf_rst_msk_s cn56xxp1; | ||
376 | struct cvmx_pow_pf_rst_msk_s cn58xx; | ||
377 | struct cvmx_pow_pf_rst_msk_s cn58xxp1; | ||
378 | }; | ||
379 | |||
380 | union cvmx_pow_pp_grp_mskx { | ||
381 | uint64_t u64; | ||
382 | struct cvmx_pow_pp_grp_mskx_s { | ||
383 | uint64_t reserved_48_63:16; | ||
384 | uint64_t qos7_pri:4; | ||
385 | uint64_t qos6_pri:4; | ||
386 | uint64_t qos5_pri:4; | ||
387 | uint64_t qos4_pri:4; | ||
388 | uint64_t qos3_pri:4; | ||
389 | uint64_t qos2_pri:4; | ||
390 | uint64_t qos1_pri:4; | ||
391 | uint64_t qos0_pri:4; | ||
392 | uint64_t grp_msk:16; | ||
393 | } s; | ||
394 | struct cvmx_pow_pp_grp_mskx_cn30xx { | ||
395 | uint64_t reserved_16_63:48; | ||
396 | uint64_t grp_msk:16; | ||
397 | } cn30xx; | ||
398 | struct cvmx_pow_pp_grp_mskx_cn30xx cn31xx; | ||
399 | struct cvmx_pow_pp_grp_mskx_cn30xx cn38xx; | ||
400 | struct cvmx_pow_pp_grp_mskx_cn30xx cn38xxp2; | ||
401 | struct cvmx_pow_pp_grp_mskx_s cn50xx; | ||
402 | struct cvmx_pow_pp_grp_mskx_s cn52xx; | ||
403 | struct cvmx_pow_pp_grp_mskx_s cn52xxp1; | ||
404 | struct cvmx_pow_pp_grp_mskx_s cn56xx; | ||
405 | struct cvmx_pow_pp_grp_mskx_s cn56xxp1; | ||
406 | struct cvmx_pow_pp_grp_mskx_s cn58xx; | ||
407 | struct cvmx_pow_pp_grp_mskx_s cn58xxp1; | ||
408 | }; | ||
409 | |||
410 | union cvmx_pow_qos_rndx { | ||
411 | uint64_t u64; | ||
412 | struct cvmx_pow_qos_rndx_s { | ||
413 | uint64_t reserved_32_63:32; | ||
414 | uint64_t rnd_p3:8; | ||
415 | uint64_t rnd_p2:8; | ||
416 | uint64_t rnd_p1:8; | ||
417 | uint64_t rnd:8; | ||
418 | } s; | ||
419 | struct cvmx_pow_qos_rndx_s cn30xx; | ||
420 | struct cvmx_pow_qos_rndx_s cn31xx; | ||
421 | struct cvmx_pow_qos_rndx_s cn38xx; | ||
422 | struct cvmx_pow_qos_rndx_s cn38xxp2; | ||
423 | struct cvmx_pow_qos_rndx_s cn50xx; | ||
424 | struct cvmx_pow_qos_rndx_s cn52xx; | ||
425 | struct cvmx_pow_qos_rndx_s cn52xxp1; | ||
426 | struct cvmx_pow_qos_rndx_s cn56xx; | ||
427 | struct cvmx_pow_qos_rndx_s cn56xxp1; | ||
428 | struct cvmx_pow_qos_rndx_s cn58xx; | ||
429 | struct cvmx_pow_qos_rndx_s cn58xxp1; | ||
430 | }; | ||
431 | |||
432 | union cvmx_pow_qos_thrx { | ||
433 | uint64_t u64; | ||
434 | struct cvmx_pow_qos_thrx_s { | ||
435 | uint64_t reserved_60_63:4; | ||
436 | uint64_t des_cnt:12; | ||
437 | uint64_t buf_cnt:12; | ||
438 | uint64_t free_cnt:12; | ||
439 | uint64_t reserved_23_23:1; | ||
440 | uint64_t max_thr:11; | ||
441 | uint64_t reserved_11_11:1; | ||
442 | uint64_t min_thr:11; | ||
443 | } s; | ||
444 | struct cvmx_pow_qos_thrx_cn30xx { | ||
445 | uint64_t reserved_55_63:9; | ||
446 | uint64_t des_cnt:7; | ||
447 | uint64_t reserved_43_47:5; | ||
448 | uint64_t buf_cnt:7; | ||
449 | uint64_t reserved_31_35:5; | ||
450 | uint64_t free_cnt:7; | ||
451 | uint64_t reserved_18_23:6; | ||
452 | uint64_t max_thr:6; | ||
453 | uint64_t reserved_6_11:6; | ||
454 | uint64_t min_thr:6; | ||
455 | } cn30xx; | ||
456 | struct cvmx_pow_qos_thrx_cn31xx { | ||
457 | uint64_t reserved_57_63:7; | ||
458 | uint64_t des_cnt:9; | ||
459 | uint64_t reserved_45_47:3; | ||
460 | uint64_t buf_cnt:9; | ||
461 | uint64_t reserved_33_35:3; | ||
462 | uint64_t free_cnt:9; | ||
463 | uint64_t reserved_20_23:4; | ||
464 | uint64_t max_thr:8; | ||
465 | uint64_t reserved_8_11:4; | ||
466 | uint64_t min_thr:8; | ||
467 | } cn31xx; | ||
468 | struct cvmx_pow_qos_thrx_s cn38xx; | ||
469 | struct cvmx_pow_qos_thrx_s cn38xxp2; | ||
470 | struct cvmx_pow_qos_thrx_cn31xx cn50xx; | ||
471 | struct cvmx_pow_qos_thrx_cn52xx { | ||
472 | uint64_t reserved_58_63:6; | ||
473 | uint64_t des_cnt:10; | ||
474 | uint64_t reserved_46_47:2; | ||
475 | uint64_t buf_cnt:10; | ||
476 | uint64_t reserved_34_35:2; | ||
477 | uint64_t free_cnt:10; | ||
478 | uint64_t reserved_21_23:3; | ||
479 | uint64_t max_thr:9; | ||
480 | uint64_t reserved_9_11:3; | ||
481 | uint64_t min_thr:9; | ||
482 | } cn52xx; | ||
483 | struct cvmx_pow_qos_thrx_cn52xx cn52xxp1; | ||
484 | struct cvmx_pow_qos_thrx_s cn56xx; | ||
485 | struct cvmx_pow_qos_thrx_s cn56xxp1; | ||
486 | struct cvmx_pow_qos_thrx_s cn58xx; | ||
487 | struct cvmx_pow_qos_thrx_s cn58xxp1; | ||
488 | }; | ||
489 | |||
490 | union cvmx_pow_ts_pc { | ||
491 | uint64_t u64; | ||
492 | struct cvmx_pow_ts_pc_s { | ||
493 | uint64_t reserved_32_63:32; | ||
494 | uint64_t ts_pc:32; | ||
495 | } s; | ||
496 | struct cvmx_pow_ts_pc_s cn30xx; | ||
497 | struct cvmx_pow_ts_pc_s cn31xx; | ||
498 | struct cvmx_pow_ts_pc_s cn38xx; | ||
499 | struct cvmx_pow_ts_pc_s cn38xxp2; | ||
500 | struct cvmx_pow_ts_pc_s cn50xx; | ||
501 | struct cvmx_pow_ts_pc_s cn52xx; | ||
502 | struct cvmx_pow_ts_pc_s cn52xxp1; | ||
503 | struct cvmx_pow_ts_pc_s cn56xx; | ||
504 | struct cvmx_pow_ts_pc_s cn56xxp1; | ||
505 | struct cvmx_pow_ts_pc_s cn58xx; | ||
506 | struct cvmx_pow_ts_pc_s cn58xxp1; | ||
507 | }; | ||
508 | |||
509 | union cvmx_pow_wa_com_pc { | ||
510 | uint64_t u64; | ||
511 | struct cvmx_pow_wa_com_pc_s { | ||
512 | uint64_t reserved_32_63:32; | ||
513 | uint64_t wa_pc:32; | ||
514 | } s; | ||
515 | struct cvmx_pow_wa_com_pc_s cn30xx; | ||
516 | struct cvmx_pow_wa_com_pc_s cn31xx; | ||
517 | struct cvmx_pow_wa_com_pc_s cn38xx; | ||
518 | struct cvmx_pow_wa_com_pc_s cn38xxp2; | ||
519 | struct cvmx_pow_wa_com_pc_s cn50xx; | ||
520 | struct cvmx_pow_wa_com_pc_s cn52xx; | ||
521 | struct cvmx_pow_wa_com_pc_s cn52xxp1; | ||
522 | struct cvmx_pow_wa_com_pc_s cn56xx; | ||
523 | struct cvmx_pow_wa_com_pc_s cn56xxp1; | ||
524 | struct cvmx_pow_wa_com_pc_s cn58xx; | ||
525 | struct cvmx_pow_wa_com_pc_s cn58xxp1; | ||
526 | }; | ||
527 | |||
528 | union cvmx_pow_wa_pcx { | ||
529 | uint64_t u64; | ||
530 | struct cvmx_pow_wa_pcx_s { | ||
531 | uint64_t reserved_32_63:32; | ||
532 | uint64_t wa_pc:32; | ||
533 | } s; | ||
534 | struct cvmx_pow_wa_pcx_s cn30xx; | ||
535 | struct cvmx_pow_wa_pcx_s cn31xx; | ||
536 | struct cvmx_pow_wa_pcx_s cn38xx; | ||
537 | struct cvmx_pow_wa_pcx_s cn38xxp2; | ||
538 | struct cvmx_pow_wa_pcx_s cn50xx; | ||
539 | struct cvmx_pow_wa_pcx_s cn52xx; | ||
540 | struct cvmx_pow_wa_pcx_s cn52xxp1; | ||
541 | struct cvmx_pow_wa_pcx_s cn56xx; | ||
542 | struct cvmx_pow_wa_pcx_s cn56xxp1; | ||
543 | struct cvmx_pow_wa_pcx_s cn58xx; | ||
544 | struct cvmx_pow_wa_pcx_s cn58xxp1; | ||
545 | }; | ||
546 | |||
547 | union cvmx_pow_wq_int { | ||
548 | uint64_t u64; | ||
549 | struct cvmx_pow_wq_int_s { | ||
550 | uint64_t reserved_32_63:32; | ||
551 | uint64_t iq_dis:16; | ||
552 | uint64_t wq_int:16; | ||
553 | } s; | ||
554 | struct cvmx_pow_wq_int_s cn30xx; | ||
555 | struct cvmx_pow_wq_int_s cn31xx; | ||
556 | struct cvmx_pow_wq_int_s cn38xx; | ||
557 | struct cvmx_pow_wq_int_s cn38xxp2; | ||
558 | struct cvmx_pow_wq_int_s cn50xx; | ||
559 | struct cvmx_pow_wq_int_s cn52xx; | ||
560 | struct cvmx_pow_wq_int_s cn52xxp1; | ||
561 | struct cvmx_pow_wq_int_s cn56xx; | ||
562 | struct cvmx_pow_wq_int_s cn56xxp1; | ||
563 | struct cvmx_pow_wq_int_s cn58xx; | ||
564 | struct cvmx_pow_wq_int_s cn58xxp1; | ||
565 | }; | ||
566 | |||
567 | union cvmx_pow_wq_int_cntx { | ||
568 | uint64_t u64; | ||
569 | struct cvmx_pow_wq_int_cntx_s { | ||
570 | uint64_t reserved_28_63:36; | ||
571 | uint64_t tc_cnt:4; | ||
572 | uint64_t ds_cnt:12; | ||
573 | uint64_t iq_cnt:12; | ||
574 | } s; | ||
575 | struct cvmx_pow_wq_int_cntx_cn30xx { | ||
576 | uint64_t reserved_28_63:36; | ||
577 | uint64_t tc_cnt:4; | ||
578 | uint64_t reserved_19_23:5; | ||
579 | uint64_t ds_cnt:7; | ||
580 | uint64_t reserved_7_11:5; | ||
581 | uint64_t iq_cnt:7; | ||
582 | } cn30xx; | ||
583 | struct cvmx_pow_wq_int_cntx_cn31xx { | ||
584 | uint64_t reserved_28_63:36; | ||
585 | uint64_t tc_cnt:4; | ||
586 | uint64_t reserved_21_23:3; | ||
587 | uint64_t ds_cnt:9; | ||
588 | uint64_t reserved_9_11:3; | ||
589 | uint64_t iq_cnt:9; | ||
590 | } cn31xx; | ||
591 | struct cvmx_pow_wq_int_cntx_s cn38xx; | ||
592 | struct cvmx_pow_wq_int_cntx_s cn38xxp2; | ||
593 | struct cvmx_pow_wq_int_cntx_cn31xx cn50xx; | ||
594 | struct cvmx_pow_wq_int_cntx_cn52xx { | ||
595 | uint64_t reserved_28_63:36; | ||
596 | uint64_t tc_cnt:4; | ||
597 | uint64_t reserved_22_23:2; | ||
598 | uint64_t ds_cnt:10; | ||
599 | uint64_t reserved_10_11:2; | ||
600 | uint64_t iq_cnt:10; | ||
601 | } cn52xx; | ||
602 | struct cvmx_pow_wq_int_cntx_cn52xx cn52xxp1; | ||
603 | struct cvmx_pow_wq_int_cntx_s cn56xx; | ||
604 | struct cvmx_pow_wq_int_cntx_s cn56xxp1; | ||
605 | struct cvmx_pow_wq_int_cntx_s cn58xx; | ||
606 | struct cvmx_pow_wq_int_cntx_s cn58xxp1; | ||
607 | }; | ||
608 | |||
609 | union cvmx_pow_wq_int_pc { | ||
610 | uint64_t u64; | ||
611 | struct cvmx_pow_wq_int_pc_s { | ||
612 | uint64_t reserved_60_63:4; | ||
613 | uint64_t pc:28; | ||
614 | uint64_t reserved_28_31:4; | ||
615 | uint64_t pc_thr:20; | ||
616 | uint64_t reserved_0_7:8; | ||
617 | } s; | ||
618 | struct cvmx_pow_wq_int_pc_s cn30xx; | ||
619 | struct cvmx_pow_wq_int_pc_s cn31xx; | ||
620 | struct cvmx_pow_wq_int_pc_s cn38xx; | ||
621 | struct cvmx_pow_wq_int_pc_s cn38xxp2; | ||
622 | struct cvmx_pow_wq_int_pc_s cn50xx; | ||
623 | struct cvmx_pow_wq_int_pc_s cn52xx; | ||
624 | struct cvmx_pow_wq_int_pc_s cn52xxp1; | ||
625 | struct cvmx_pow_wq_int_pc_s cn56xx; | ||
626 | struct cvmx_pow_wq_int_pc_s cn56xxp1; | ||
627 | struct cvmx_pow_wq_int_pc_s cn58xx; | ||
628 | struct cvmx_pow_wq_int_pc_s cn58xxp1; | ||
629 | }; | ||
630 | |||
631 | union cvmx_pow_wq_int_thrx { | ||
632 | uint64_t u64; | ||
633 | struct cvmx_pow_wq_int_thrx_s { | ||
634 | uint64_t reserved_29_63:35; | ||
635 | uint64_t tc_en:1; | ||
636 | uint64_t tc_thr:4; | ||
637 | uint64_t reserved_23_23:1; | ||
638 | uint64_t ds_thr:11; | ||
639 | uint64_t reserved_11_11:1; | ||
640 | uint64_t iq_thr:11; | ||
641 | } s; | ||
642 | struct cvmx_pow_wq_int_thrx_cn30xx { | ||
643 | uint64_t reserved_29_63:35; | ||
644 | uint64_t tc_en:1; | ||
645 | uint64_t tc_thr:4; | ||
646 | uint64_t reserved_18_23:6; | ||
647 | uint64_t ds_thr:6; | ||
648 | uint64_t reserved_6_11:6; | ||
649 | uint64_t iq_thr:6; | ||
650 | } cn30xx; | ||
651 | struct cvmx_pow_wq_int_thrx_cn31xx { | ||
652 | uint64_t reserved_29_63:35; | ||
653 | uint64_t tc_en:1; | ||
654 | uint64_t tc_thr:4; | ||
655 | uint64_t reserved_20_23:4; | ||
656 | uint64_t ds_thr:8; | ||
657 | uint64_t reserved_8_11:4; | ||
658 | uint64_t iq_thr:8; | ||
659 | } cn31xx; | ||
660 | struct cvmx_pow_wq_int_thrx_s cn38xx; | ||
661 | struct cvmx_pow_wq_int_thrx_s cn38xxp2; | ||
662 | struct cvmx_pow_wq_int_thrx_cn31xx cn50xx; | ||
663 | struct cvmx_pow_wq_int_thrx_cn52xx { | ||
664 | uint64_t reserved_29_63:35; | ||
665 | uint64_t tc_en:1; | ||
666 | uint64_t tc_thr:4; | ||
667 | uint64_t reserved_21_23:3; | ||
668 | uint64_t ds_thr:9; | ||
669 | uint64_t reserved_9_11:3; | ||
670 | uint64_t iq_thr:9; | ||
671 | } cn52xx; | ||
672 | struct cvmx_pow_wq_int_thrx_cn52xx cn52xxp1; | ||
673 | struct cvmx_pow_wq_int_thrx_s cn56xx; | ||
674 | struct cvmx_pow_wq_int_thrx_s cn56xxp1; | ||
675 | struct cvmx_pow_wq_int_thrx_s cn58xx; | ||
676 | struct cvmx_pow_wq_int_thrx_s cn58xxp1; | ||
677 | }; | ||
678 | |||
679 | union cvmx_pow_ws_pcx { | ||
680 | uint64_t u64; | ||
681 | struct cvmx_pow_ws_pcx_s { | ||
682 | uint64_t reserved_32_63:32; | ||
683 | uint64_t ws_pc:32; | ||
684 | } s; | ||
685 | struct cvmx_pow_ws_pcx_s cn30xx; | ||
686 | struct cvmx_pow_ws_pcx_s cn31xx; | ||
687 | struct cvmx_pow_ws_pcx_s cn38xx; | ||
688 | struct cvmx_pow_ws_pcx_s cn38xxp2; | ||
689 | struct cvmx_pow_ws_pcx_s cn50xx; | ||
690 | struct cvmx_pow_ws_pcx_s cn52xx; | ||
691 | struct cvmx_pow_ws_pcx_s cn52xxp1; | ||
692 | struct cvmx_pow_ws_pcx_s cn56xx; | ||
693 | struct cvmx_pow_ws_pcx_s cn56xxp1; | ||
694 | struct cvmx_pow_ws_pcx_s cn58xx; | ||
695 | struct cvmx_pow_ws_pcx_s cn58xxp1; | ||
696 | }; | ||
697 | |||
698 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-spinlock.h b/arch/mips/include/asm/octeon/cvmx-spinlock.h new file mode 100644 index 000000000000..2fbf0871df11 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-spinlock.h | |||
@@ -0,0 +1,232 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /** | ||
29 | * Implementation of spinlocks for Octeon CVMX. Although similar in | ||
30 | * function to Linux kernel spinlocks, they are not compatible. | ||
31 | * Octeon CVMX spinlocks are only used to synchronize with the boot | ||
32 | * monitor and other non-Linux programs running in the system. | ||
33 | */ | ||
34 | |||
35 | #ifndef __CVMX_SPINLOCK_H__ | ||
36 | #define __CVMX_SPINLOCK_H__ | ||
37 | |||
38 | #include "cvmx-asm.h" | ||
39 | |||
40 | /* Spinlocks for Octeon */ | ||
41 | |||
42 | /* define these to enable recursive spinlock debugging */ | ||
43 | /*#define CVMX_SPINLOCK_DEBUG */ | ||
44 | |||
45 | /** | ||
46 | * Spinlocks for Octeon CVMX | ||
47 | */ | ||
48 | typedef struct { | ||
49 | volatile uint32_t value; | ||
50 | } cvmx_spinlock_t; | ||
51 | |||
52 | /* note - macros not expanded in inline ASM, so values hardcoded */ | ||
53 | #define CVMX_SPINLOCK_UNLOCKED_VAL 0 | ||
54 | #define CVMX_SPINLOCK_LOCKED_VAL 1 | ||
55 | |||
56 | #define CVMX_SPINLOCK_UNLOCKED_INITIALIZER {CVMX_SPINLOCK_UNLOCKED_VAL} | ||
57 | |||
58 | /** | ||
59 | * Initialize a spinlock | ||
60 | * | ||
61 | * @lock: Lock to initialize | ||
62 | */ | ||
63 | static inline void cvmx_spinlock_init(cvmx_spinlock_t *lock) | ||
64 | { | ||
65 | lock->value = CVMX_SPINLOCK_UNLOCKED_VAL; | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * Return non-zero if the spinlock is currently locked | ||
70 | * | ||
71 | * @lock: Lock to check | ||
72 | * Returns Non-zero if locked | ||
73 | */ | ||
74 | static inline int cvmx_spinlock_locked(cvmx_spinlock_t *lock) | ||
75 | { | ||
76 | return lock->value != CVMX_SPINLOCK_UNLOCKED_VAL; | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * Releases lock | ||
81 | * | ||
82 | * @lock: pointer to lock structure | ||
83 | */ | ||
84 | static inline void cvmx_spinlock_unlock(cvmx_spinlock_t *lock) | ||
85 | { | ||
86 | CVMX_SYNCWS; | ||
87 | lock->value = 0; | ||
88 | CVMX_SYNCWS; | ||
89 | } | ||
90 | |||
91 | /** | ||
92 | * Attempts to take the lock, but does not spin if lock is not available. | ||
93 | * May take some time to acquire the lock even if it is available | ||
94 | * due to the ll/sc not succeeding. | ||
95 | * | ||
96 | * @lock: pointer to lock structure | ||
97 | * | ||
98 | * Returns 0: lock successfully taken | ||
99 | * 1: lock not taken, held by someone else | ||
100 | * These return values match the Linux semantics. | ||
101 | */ | ||
102 | |||
103 | static inline unsigned int cvmx_spinlock_trylock(cvmx_spinlock_t *lock) | ||
104 | { | ||
105 | unsigned int tmp; | ||
106 | |||
107 | __asm__ __volatile__(".set noreorder \n" | ||
108 | "1: ll %[tmp], %[val] \n" | ||
109 | /* if lock held, fail immediately */ | ||
110 | " bnez %[tmp], 2f \n" | ||
111 | " li %[tmp], 1 \n" | ||
112 | " sc %[tmp], %[val] \n" | ||
113 | " beqz %[tmp], 1b \n" | ||
114 | " li %[tmp], 0 \n" | ||
115 | "2: \n" | ||
116 | ".set reorder \n" : | ||
117 | [val] "+m"(lock->value), [tmp] "=&r"(tmp) | ||
118 | : : "memory"); | ||
119 | |||
120 | return tmp != 0; /* normalize to 0 or 1 */ | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * Gets lock, spins until lock is taken | ||
125 | * | ||
126 | * @lock: pointer to lock structure | ||
127 | */ | ||
128 | static inline void cvmx_spinlock_lock(cvmx_spinlock_t *lock) | ||
129 | { | ||
130 | unsigned int tmp; | ||
131 | |||
132 | __asm__ __volatile__(".set noreorder \n" | ||
133 | "1: ll %[tmp], %[val] \n" | ||
134 | " bnez %[tmp], 1b \n" | ||
135 | " li %[tmp], 1 \n" | ||
136 | " sc %[tmp], %[val] \n" | ||
137 | " beqz %[tmp], 1b \n" | ||
138 | " nop \n" | ||
139 | ".set reorder \n" : | ||
140 | [val] "+m"(lock->value), [tmp] "=&r"(tmp) | ||
141 | : : "memory"); | ||
142 | |||
143 | } | ||
144 | |||
145 | /** ******************************************************************** | ||
146 | * Bit spinlocks | ||
147 | * These spinlocks use a single bit (bit 31) of a 32 bit word for locking. | ||
148 | * The rest of the bits in the word are left undisturbed. This enables more | ||
149 | * compact data structures as only 1 bit is consumed for the lock. | ||
150 | * | ||
151 | */ | ||
152 | |||
153 | /** | ||
154 | * Gets lock, spins until lock is taken | ||
155 | * Preserves the low 31 bits of the 32 bit | ||
156 | * word used for the lock. | ||
157 | * | ||
158 | * | ||
159 | * @word: word to lock bit 31 of | ||
160 | */ | ||
161 | static inline void cvmx_spinlock_bit_lock(uint32_t *word) | ||
162 | { | ||
163 | unsigned int tmp; | ||
164 | unsigned int sav; | ||
165 | |||
166 | __asm__ __volatile__(".set noreorder \n" | ||
167 | ".set noat \n" | ||
168 | "1: ll %[tmp], %[val] \n" | ||
169 | " bbit1 %[tmp], 31, 1b \n" | ||
170 | " li $at, 1 \n" | ||
171 | " ins %[tmp], $at, 31, 1 \n" | ||
172 | " sc %[tmp], %[val] \n" | ||
173 | " beqz %[tmp], 1b \n" | ||
174 | " nop \n" | ||
175 | ".set at \n" | ||
176 | ".set reorder \n" : | ||
177 | [val] "+m"(*word), [tmp] "=&r"(tmp), [sav] "=&r"(sav) | ||
178 | : : "memory"); | ||
179 | |||
180 | } | ||
181 | |||
182 | /** | ||
183 | * Attempts to get lock, returns immediately with success/failure | ||
184 | * Preserves the low 31 bits of the 32 bit | ||
185 | * word used for the lock. | ||
186 | * | ||
187 | * | ||
188 | * @word: word to lock bit 31 of | ||
189 | * Returns 0: lock successfully taken | ||
190 | * 1: lock not taken, held by someone else | ||
191 | * These return values match the Linux semantics. | ||
192 | */ | ||
193 | static inline unsigned int cvmx_spinlock_bit_trylock(uint32_t *word) | ||
194 | { | ||
195 | unsigned int tmp; | ||
196 | |||
197 | __asm__ __volatile__(".set noreorder\n\t" | ||
198 | ".set noat\n" | ||
199 | "1: ll %[tmp], %[val] \n" | ||
200 | /* if lock held, fail immediately */ | ||
201 | " bbit1 %[tmp], 31, 2f \n" | ||
202 | " li $at, 1 \n" | ||
203 | " ins %[tmp], $at, 31, 1 \n" | ||
204 | " sc %[tmp], %[val] \n" | ||
205 | " beqz %[tmp], 1b \n" | ||
206 | " li %[tmp], 0 \n" | ||
207 | "2: \n" | ||
208 | ".set at \n" | ||
209 | ".set reorder \n" : | ||
210 | [val] "+m"(*word), [tmp] "=&r"(tmp) | ||
211 | : : "memory"); | ||
212 | |||
213 | return tmp != 0; /* normalize to 0 or 1 */ | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * Releases bit lock | ||
218 | * | ||
219 | * Unconditionally clears bit 31 of the lock word. Note that this is | ||
220 | * done non-atomically, as this implementation assumes that the rest | ||
221 | * of the bits in the word are protected by the lock. | ||
222 | * | ||
223 | * @word: word to unlock bit 31 in | ||
224 | */ | ||
225 | static inline void cvmx_spinlock_bit_unlock(uint32_t *word) | ||
226 | { | ||
227 | CVMX_SYNCWS; | ||
228 | *word &= ~(1UL << 31); | ||
229 | CVMX_SYNCWS; | ||
230 | } | ||
231 | |||
232 | #endif /* __CVMX_SPINLOCK_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-sysinfo.h b/arch/mips/include/asm/octeon/cvmx-sysinfo.h new file mode 100644 index 000000000000..61dd5741afe4 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-sysinfo.h | |||
@@ -0,0 +1,152 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * This module provides system/board information obtained by the bootloader. | ||
30 | */ | ||
31 | |||
32 | #ifndef __CVMX_SYSINFO_H__ | ||
33 | #define __CVMX_SYSINFO_H__ | ||
34 | |||
35 | #define OCTEON_SERIAL_LEN 20 | ||
36 | /** | ||
37 | * Structure describing application specific information. | ||
38 | * __cvmx_app_init() populates this from the cvmx boot descriptor. | ||
39 | * This structure is private to simple executive applications, so | ||
40 | * no versioning is required. | ||
41 | * | ||
42 | * This structure must be provided with some fields set in order to | ||
43 | * use simple executive functions in other applications (Linux kernel, | ||
44 | * u-boot, etc.) The cvmx_sysinfo_minimal_initialize() function is | ||
45 | * provided to set the required values in these cases. | ||
46 | */ | ||
47 | struct cvmx_sysinfo { | ||
48 | /* System wide variables */ | ||
49 | /* installed DRAM in system, in bytes */ | ||
50 | uint64_t system_dram_size; | ||
51 | |||
52 | /* ptr to memory descriptor block */ | ||
53 | void *phy_mem_desc_ptr; | ||
54 | |||
55 | |||
56 | /* Application image specific variables */ | ||
57 | /* stack top address (virtual) */ | ||
58 | uint64_t stack_top; | ||
59 | /* heap base address (virtual) */ | ||
60 | uint64_t heap_base; | ||
61 | /* stack size in bytes */ | ||
62 | uint32_t stack_size; | ||
63 | /* heap size in bytes */ | ||
64 | uint32_t heap_size; | ||
65 | /* coremask defining cores running application */ | ||
66 | uint32_t core_mask; | ||
67 | /* Deprecated, use cvmx_coremask_first_core() to select init core */ | ||
68 | uint32_t init_core; | ||
69 | |||
70 | /* exception base address, as set by bootloader */ | ||
71 | uint64_t exception_base_addr; | ||
72 | |||
73 | /* cpu clock speed in hz */ | ||
74 | uint32_t cpu_clock_hz; | ||
75 | |||
76 | /* dram data rate in hz (data rate = 2 * clock rate */ | ||
77 | uint32_t dram_data_rate_hz; | ||
78 | |||
79 | |||
80 | uint16_t board_type; | ||
81 | uint8_t board_rev_major; | ||
82 | uint8_t board_rev_minor; | ||
83 | uint8_t mac_addr_base[6]; | ||
84 | uint8_t mac_addr_count; | ||
85 | char board_serial_number[OCTEON_SERIAL_LEN]; | ||
86 | /* | ||
87 | * Several boards support compact flash on the Octeon boot | ||
88 | * bus. The CF memory spaces may be mapped to different | ||
89 | * addresses on different boards. These values will be 0 if | ||
90 | * CF is not present. Note that these addresses are physical | ||
91 | * addresses, and it is up to the application to use the | ||
92 | * proper addressing mode (XKPHYS, KSEG0, etc.) | ||
93 | */ | ||
94 | uint64_t compact_flash_common_base_addr; | ||
95 | uint64_t compact_flash_attribute_base_addr; | ||
96 | /* | ||
97 | * Base address of the LED display (as on EBT3000 board) This | ||
98 | * will be 0 if LED display not present. Note that this | ||
99 | * address is a physical address, and it is up to the | ||
100 | * application to use the proper addressing mode (XKPHYS, | ||
101 | * KSEG0, etc.) | ||
102 | */ | ||
103 | uint64_t led_display_base_addr; | ||
104 | /* DFA reference clock in hz (if applicable)*/ | ||
105 | uint32_t dfa_ref_clock_hz; | ||
106 | /* configuration flags from bootloader */ | ||
107 | uint32_t bootloader_config_flags; | ||
108 | |||
109 | /* Uart number used for console */ | ||
110 | uint8_t console_uart_num; | ||
111 | }; | ||
112 | |||
113 | /** | ||
114 | * This function returns the system/board information as obtained | ||
115 | * by the bootloader. | ||
116 | * | ||
117 | * | ||
118 | * Returns Pointer to the boot information structure | ||
119 | * | ||
120 | */ | ||
121 | |||
122 | extern struct cvmx_sysinfo *cvmx_sysinfo_get(void); | ||
123 | |||
124 | /** | ||
125 | * This function is used in non-simple executive environments (such as | ||
126 | * Linux kernel, u-boot, etc.) to configure the minimal fields that | ||
127 | * are required to use simple executive files directly. | ||
128 | * | ||
129 | * Locking (if required) must be handled outside of this | ||
130 | * function | ||
131 | * | ||
132 | * @phy_mem_desc_ptr: Pointer to global physical memory descriptor | ||
133 | * (bootmem descriptor) @board_type: Octeon board | ||
134 | * type enumeration | ||
135 | * | ||
136 | * @board_rev_major: | ||
137 | * Board major revision | ||
138 | * @board_rev_minor: | ||
139 | * Board minor revision | ||
140 | * @cpu_clock_hz: | ||
141 | * CPU clock freqency in hertz | ||
142 | * | ||
143 | * Returns 0: Failure | ||
144 | * 1: success | ||
145 | */ | ||
146 | extern int cvmx_sysinfo_minimal_initialize(void *phy_mem_desc_ptr, | ||
147 | uint16_t board_type, | ||
148 | uint8_t board_rev_major, | ||
149 | uint8_t board_rev_minor, | ||
150 | uint32_t cpu_clock_hz); | ||
151 | |||
152 | #endif /* __CVMX_SYSINFO_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h new file mode 100644 index 000000000000..03fddfa3e928 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx.h | |||
@@ -0,0 +1,505 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_H__ | ||
29 | #define __CVMX_H__ | ||
30 | |||
31 | #include <linux/kernel.h> | ||
32 | #include <linux/string.h> | ||
33 | |||
34 | #include "cvmx-asm.h" | ||
35 | #include "cvmx-packet.h" | ||
36 | #include "cvmx-sysinfo.h" | ||
37 | |||
38 | #include "cvmx-ciu-defs.h" | ||
39 | #include "cvmx-gpio-defs.h" | ||
40 | #include "cvmx-iob-defs.h" | ||
41 | #include "cvmx-ipd-defs.h" | ||
42 | #include "cvmx-l2c-defs.h" | ||
43 | #include "cvmx-l2d-defs.h" | ||
44 | #include "cvmx-l2t-defs.h" | ||
45 | #include "cvmx-led-defs.h" | ||
46 | #include "cvmx-mio-defs.h" | ||
47 | #include "cvmx-pow-defs.h" | ||
48 | |||
49 | #include "cvmx-bootinfo.h" | ||
50 | #include "cvmx-bootmem.h" | ||
51 | #include "cvmx-l2c.h" | ||
52 | |||
53 | #ifndef CVMX_ENABLE_DEBUG_PRINTS | ||
54 | #define CVMX_ENABLE_DEBUG_PRINTS 1 | ||
55 | #endif | ||
56 | |||
57 | #if CVMX_ENABLE_DEBUG_PRINTS | ||
58 | #define cvmx_dprintf printk | ||
59 | #else | ||
60 | #define cvmx_dprintf(...) {} | ||
61 | #endif | ||
62 | |||
63 | #define CVMX_MAX_CORES (16) | ||
64 | #define CVMX_CACHE_LINE_SIZE (128) /* In bytes */ | ||
65 | #define CVMX_CACHE_LINE_MASK (CVMX_CACHE_LINE_SIZE - 1) /* In bytes */ | ||
66 | #define CVMX_CACHE_LINE_ALIGNED __attribute__ ((aligned(CVMX_CACHE_LINE_SIZE))) | ||
67 | #define CAST64(v) ((long long)(long)(v)) | ||
68 | #define CASTPTR(type, v) ((type *)(long)(v)) | ||
69 | |||
70 | /* | ||
71 | * Returns processor ID, different Linux and simple exec versions | ||
72 | * provided in the cvmx-app-init*.c files. | ||
73 | */ | ||
74 | static inline uint32_t cvmx_get_proc_id(void) __attribute__ ((pure)); | ||
75 | static inline uint32_t cvmx_get_proc_id(void) | ||
76 | { | ||
77 | uint32_t id; | ||
78 | asm("mfc0 %0, $15,0" : "=r"(id)); | ||
79 | return id; | ||
80 | } | ||
81 | |||
82 | /* turn the variable name into a string */ | ||
83 | #define CVMX_TMP_STR(x) CVMX_TMP_STR2(x) | ||
84 | #define CVMX_TMP_STR2(x) #x | ||
85 | |||
86 | /** | ||
87 | * Builds a bit mask given the required size in bits. | ||
88 | * | ||
89 | * @bits: Number of bits in the mask | ||
90 | * Returns The mask | ||
91 | */ static inline uint64_t cvmx_build_mask(uint64_t bits) | ||
92 | { | ||
93 | return ~((~0x0ull) << bits); | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * Builds a memory address for I/O based on the Major and Sub DID. | ||
98 | * | ||
99 | * @major_did: 5 bit major did | ||
100 | * @sub_did: 3 bit sub did | ||
101 | * Returns I/O base address | ||
102 | */ | ||
103 | static inline uint64_t cvmx_build_io_address(uint64_t major_did, | ||
104 | uint64_t sub_did) | ||
105 | { | ||
106 | return (0x1ull << 48) | (major_did << 43) | (sub_did << 40); | ||
107 | } | ||
108 | |||
109 | /** | ||
110 | * Perform mask and shift to place the supplied value into | ||
111 | * the supplied bit rage. | ||
112 | * | ||
113 | * Example: cvmx_build_bits(39,24,value) | ||
114 | * <pre> | ||
115 | * 6 5 4 3 3 2 1 | ||
116 | * 3 5 7 9 1 3 5 7 0 | ||
117 | * +-------+-------+-------+-------+-------+-------+-------+------+ | ||
118 | * 000000000000000000000000___________value000000000000000000000000 | ||
119 | * </pre> | ||
120 | * | ||
121 | * @high_bit: Highest bit value can occupy (inclusive) 0-63 | ||
122 | * @low_bit: Lowest bit value can occupy inclusive 0-high_bit | ||
123 | * @value: Value to use | ||
124 | * Returns Value masked and shifted | ||
125 | */ | ||
126 | static inline uint64_t cvmx_build_bits(uint64_t high_bit, | ||
127 | uint64_t low_bit, uint64_t value) | ||
128 | { | ||
129 | return (value & cvmx_build_mask(high_bit - low_bit + 1)) << low_bit; | ||
130 | } | ||
131 | |||
132 | enum cvmx_mips_space { | ||
133 | CVMX_MIPS_SPACE_XKSEG = 3LL, | ||
134 | CVMX_MIPS_SPACE_XKPHYS = 2LL, | ||
135 | CVMX_MIPS_SPACE_XSSEG = 1LL, | ||
136 | CVMX_MIPS_SPACE_XUSEG = 0LL | ||
137 | }; | ||
138 | |||
139 | /* These macros for use when using 32 bit pointers. */ | ||
140 | #define CVMX_MIPS32_SPACE_KSEG0 1l | ||
141 | #define CVMX_ADD_SEG32(segment, add) \ | ||
142 | (((int32_t)segment << 31) | (int32_t)(add)) | ||
143 | |||
144 | #define CVMX_IO_SEG CVMX_MIPS_SPACE_XKPHYS | ||
145 | |||
146 | /* These macros simplify the process of creating common IO addresses */ | ||
147 | #define CVMX_ADD_SEG(segment, add) \ | ||
148 | ((((uint64_t)segment) << 62) | (add)) | ||
149 | #ifndef CVMX_ADD_IO_SEG | ||
150 | #define CVMX_ADD_IO_SEG(add) CVMX_ADD_SEG(CVMX_IO_SEG, (add)) | ||
151 | #endif | ||
152 | |||
153 | /** | ||
154 | * Convert a memory pointer (void*) into a hardware compatable | ||
155 | * memory address (uint64_t). Octeon hardware widgets don't | ||
156 | * understand logical addresses. | ||
157 | * | ||
158 | * @ptr: C style memory pointer | ||
159 | * Returns Hardware physical address | ||
160 | */ | ||
161 | static inline uint64_t cvmx_ptr_to_phys(void *ptr) | ||
162 | { | ||
163 | if (sizeof(void *) == 8) { | ||
164 | /* | ||
165 | * We're running in 64 bit mode. Normally this means | ||
166 | * that we can use 40 bits of address space (the | ||
167 | * hardware limit). Unfortunately there is one case | ||
168 | * were we need to limit this to 30 bits, sign | ||
169 | * extended 32 bit. Although these are 64 bits wide, | ||
170 | * only 30 bits can be used. | ||
171 | */ | ||
172 | if ((CAST64(ptr) >> 62) == 3) | ||
173 | return CAST64(ptr) & cvmx_build_mask(30); | ||
174 | else | ||
175 | return CAST64(ptr) & cvmx_build_mask(40); | ||
176 | } else { | ||
177 | return (long)(ptr) & 0x1fffffff; | ||
178 | } | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * Convert a hardware physical address (uint64_t) into a | ||
183 | * memory pointer (void *). | ||
184 | * | ||
185 | * @physical_address: | ||
186 | * Hardware physical address to memory | ||
187 | * Returns Pointer to memory | ||
188 | */ | ||
189 | static inline void *cvmx_phys_to_ptr(uint64_t physical_address) | ||
190 | { | ||
191 | if (sizeof(void *) == 8) { | ||
192 | /* Just set the top bit, avoiding any TLB uglyness */ | ||
193 | return CASTPTR(void, | ||
194 | CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
195 | physical_address)); | ||
196 | } else { | ||
197 | return CASTPTR(void, | ||
198 | CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, | ||
199 | physical_address)); | ||
200 | } | ||
201 | } | ||
202 | |||
203 | /* The following #if controls the definition of the macro | ||
204 | CVMX_BUILD_WRITE64. This macro is used to build a store operation to | ||
205 | a full 64bit address. With a 64bit ABI, this can be done with a simple | ||
206 | pointer access. 32bit ABIs require more complicated assembly */ | ||
207 | |||
208 | /* We have a full 64bit ABI. Writing to a 64bit address can be done with | ||
209 | a simple volatile pointer */ | ||
210 | #define CVMX_BUILD_WRITE64(TYPE, ST) \ | ||
211 | static inline void cvmx_write64_##TYPE(uint64_t addr, TYPE##_t val) \ | ||
212 | { \ | ||
213 | *CASTPTR(volatile TYPE##_t, addr) = val; \ | ||
214 | } | ||
215 | |||
216 | |||
217 | /* The following #if controls the definition of the macro | ||
218 | CVMX_BUILD_READ64. This macro is used to build a load operation from | ||
219 | a full 64bit address. With a 64bit ABI, this can be done with a simple | ||
220 | pointer access. 32bit ABIs require more complicated assembly */ | ||
221 | |||
222 | /* We have a full 64bit ABI. Writing to a 64bit address can be done with | ||
223 | a simple volatile pointer */ | ||
224 | #define CVMX_BUILD_READ64(TYPE, LT) \ | ||
225 | static inline TYPE##_t cvmx_read64_##TYPE(uint64_t addr) \ | ||
226 | { \ | ||
227 | return *CASTPTR(volatile TYPE##_t, addr); \ | ||
228 | } | ||
229 | |||
230 | |||
231 | /* The following defines 8 functions for writing to a 64bit address. Each | ||
232 | takes two arguments, the address and the value to write. | ||
233 | cvmx_write64_int64 cvmx_write64_uint64 | ||
234 | cvmx_write64_int32 cvmx_write64_uint32 | ||
235 | cvmx_write64_int16 cvmx_write64_uint16 | ||
236 | cvmx_write64_int8 cvmx_write64_uint8 */ | ||
237 | CVMX_BUILD_WRITE64(int64, "sd"); | ||
238 | CVMX_BUILD_WRITE64(int32, "sw"); | ||
239 | CVMX_BUILD_WRITE64(int16, "sh"); | ||
240 | CVMX_BUILD_WRITE64(int8, "sb"); | ||
241 | CVMX_BUILD_WRITE64(uint64, "sd"); | ||
242 | CVMX_BUILD_WRITE64(uint32, "sw"); | ||
243 | CVMX_BUILD_WRITE64(uint16, "sh"); | ||
244 | CVMX_BUILD_WRITE64(uint8, "sb"); | ||
245 | #define cvmx_write64 cvmx_write64_uint64 | ||
246 | |||
247 | /* The following defines 8 functions for reading from a 64bit address. Each | ||
248 | takes the address as the only argument | ||
249 | cvmx_read64_int64 cvmx_read64_uint64 | ||
250 | cvmx_read64_int32 cvmx_read64_uint32 | ||
251 | cvmx_read64_int16 cvmx_read64_uint16 | ||
252 | cvmx_read64_int8 cvmx_read64_uint8 */ | ||
253 | CVMX_BUILD_READ64(int64, "ld"); | ||
254 | CVMX_BUILD_READ64(int32, "lw"); | ||
255 | CVMX_BUILD_READ64(int16, "lh"); | ||
256 | CVMX_BUILD_READ64(int8, "lb"); | ||
257 | CVMX_BUILD_READ64(uint64, "ld"); | ||
258 | CVMX_BUILD_READ64(uint32, "lw"); | ||
259 | CVMX_BUILD_READ64(uint16, "lhu"); | ||
260 | CVMX_BUILD_READ64(uint8, "lbu"); | ||
261 | #define cvmx_read64 cvmx_read64_uint64 | ||
262 | |||
263 | |||
264 | static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val) | ||
265 | { | ||
266 | cvmx_write64(csr_addr, val); | ||
267 | |||
268 | /* | ||
269 | * Perform an immediate read after every write to an RSL | ||
270 | * register to force the write to complete. It doesn't matter | ||
271 | * what RSL read we do, so we choose CVMX_MIO_BOOT_BIST_STAT | ||
272 | * because it is fast and harmless. | ||
273 | */ | ||
274 | if ((csr_addr >> 40) == (0x800118)) | ||
275 | cvmx_read64(CVMX_MIO_BOOT_BIST_STAT); | ||
276 | } | ||
277 | |||
278 | static inline void cvmx_write_io(uint64_t io_addr, uint64_t val) | ||
279 | { | ||
280 | cvmx_write64(io_addr, val); | ||
281 | |||
282 | } | ||
283 | |||
284 | static inline uint64_t cvmx_read_csr(uint64_t csr_addr) | ||
285 | { | ||
286 | uint64_t val = cvmx_read64(csr_addr); | ||
287 | return val; | ||
288 | } | ||
289 | |||
290 | |||
291 | static inline void cvmx_send_single(uint64_t data) | ||
292 | { | ||
293 | const uint64_t CVMX_IOBDMA_SENDSINGLE = 0xffffffffffffa200ull; | ||
294 | cvmx_write64(CVMX_IOBDMA_SENDSINGLE, data); | ||
295 | } | ||
296 | |||
297 | static inline void cvmx_read_csr_async(uint64_t scraddr, uint64_t csr_addr) | ||
298 | { | ||
299 | union { | ||
300 | uint64_t u64; | ||
301 | struct { | ||
302 | uint64_t scraddr:8; | ||
303 | uint64_t len:8; | ||
304 | uint64_t addr:48; | ||
305 | } s; | ||
306 | } addr; | ||
307 | addr.u64 = csr_addr; | ||
308 | addr.s.scraddr = scraddr >> 3; | ||
309 | addr.s.len = 1; | ||
310 | cvmx_send_single(addr.u64); | ||
311 | } | ||
312 | |||
313 | /* Return true if Octeon is CN38XX pass 1 */ | ||
314 | static inline int cvmx_octeon_is_pass1(void) | ||
315 | { | ||
316 | #if OCTEON_IS_COMMON_BINARY() | ||
317 | return 0; /* Pass 1 isn't supported for common binaries */ | ||
318 | #else | ||
319 | /* Now that we know we're built for a specific model, only check CN38XX */ | ||
320 | #if OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
321 | return cvmx_get_proc_id() == OCTEON_CN38XX_PASS1; | ||
322 | #else | ||
323 | return 0; /* Built for non CN38XX chip, we're not CN38XX pass1 */ | ||
324 | #endif | ||
325 | #endif | ||
326 | } | ||
327 | |||
328 | static inline unsigned int cvmx_get_core_num(void) | ||
329 | { | ||
330 | unsigned int core_num; | ||
331 | CVMX_RDHWRNV(core_num, 0); | ||
332 | return core_num; | ||
333 | } | ||
334 | |||
335 | /** | ||
336 | * Returns the number of bits set in the provided value. | ||
337 | * Simple wrapper for POP instruction. | ||
338 | * | ||
339 | * @val: 32 bit value to count set bits in | ||
340 | * | ||
341 | * Returns Number of bits set | ||
342 | */ | ||
343 | static inline uint32_t cvmx_pop(uint32_t val) | ||
344 | { | ||
345 | uint32_t pop; | ||
346 | CVMX_POP(pop, val); | ||
347 | return pop; | ||
348 | } | ||
349 | |||
350 | /** | ||
351 | * Returns the number of bits set in the provided value. | ||
352 | * Simple wrapper for DPOP instruction. | ||
353 | * | ||
354 | * @val: 64 bit value to count set bits in | ||
355 | * | ||
356 | * Returns Number of bits set | ||
357 | */ | ||
358 | static inline int cvmx_dpop(uint64_t val) | ||
359 | { | ||
360 | int pop; | ||
361 | CVMX_DPOP(pop, val); | ||
362 | return pop; | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * Provide current cycle counter as a return value | ||
367 | * | ||
368 | * Returns current cycle counter | ||
369 | */ | ||
370 | |||
371 | static inline uint64_t cvmx_get_cycle(void) | ||
372 | { | ||
373 | uint64_t cycle; | ||
374 | CVMX_RDHWR(cycle, 31); | ||
375 | return cycle; | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * Reads a chip global cycle counter. This counts CPU cycles since | ||
380 | * chip reset. The counter is 64 bit. | ||
381 | * This register does not exist on CN38XX pass 1 silicion | ||
382 | * | ||
383 | * Returns Global chip cycle count since chip reset. | ||
384 | */ | ||
385 | static inline uint64_t cvmx_get_cycle_global(void) | ||
386 | { | ||
387 | if (cvmx_octeon_is_pass1()) | ||
388 | return 0; | ||
389 | else | ||
390 | return cvmx_read64(CVMX_IPD_CLK_COUNT); | ||
391 | } | ||
392 | |||
393 | /** | ||
394 | * This macro spins on a field waiting for it to reach a value. It | ||
395 | * is common in code to need to wait for a specific field in a CSR | ||
396 | * to match a specific value. Conceptually this macro expands to: | ||
397 | * | ||
398 | * 1) read csr at "address" with a csr typedef of "type" | ||
399 | * 2) Check if ("type".s."field" "op" "value") | ||
400 | * 3) If #2 isn't true loop to #1 unless too much time has passed. | ||
401 | */ | ||
402 | #define CVMX_WAIT_FOR_FIELD64(address, type, field, op, value, timeout_usec)\ | ||
403 | ( \ | ||
404 | { \ | ||
405 | int result; \ | ||
406 | do { \ | ||
407 | uint64_t done = cvmx_get_cycle() + (uint64_t)timeout_usec * \ | ||
408 | cvmx_sysinfo_get()->cpu_clock_hz / 1000000; \ | ||
409 | type c; \ | ||
410 | while (1) { \ | ||
411 | c.u64 = cvmx_read_csr(address); \ | ||
412 | if ((c.s.field) op(value)) { \ | ||
413 | result = 0; \ | ||
414 | break; \ | ||
415 | } else if (cvmx_get_cycle() > done) { \ | ||
416 | result = -1; \ | ||
417 | break; \ | ||
418 | } else \ | ||
419 | cvmx_wait(100); \ | ||
420 | } \ | ||
421 | } while (0); \ | ||
422 | result; \ | ||
423 | }) | ||
424 | |||
425 | /***************************************************************************/ | ||
426 | |||
427 | static inline void cvmx_reset_octeon(void) | ||
428 | { | ||
429 | union cvmx_ciu_soft_rst ciu_soft_rst; | ||
430 | ciu_soft_rst.u64 = 0; | ||
431 | ciu_soft_rst.s.soft_rst = 1; | ||
432 | cvmx_write_csr(CVMX_CIU_SOFT_RST, ciu_soft_rst.u64); | ||
433 | } | ||
434 | |||
435 | /* Return the number of cores available in the chip */ | ||
436 | static inline uint32_t cvmx_octeon_num_cores(void) | ||
437 | { | ||
438 | uint32_t ciu_fuse = (uint32_t) cvmx_read_csr(CVMX_CIU_FUSE) & 0xffff; | ||
439 | return cvmx_pop(ciu_fuse); | ||
440 | } | ||
441 | |||
442 | /** | ||
443 | * Read a byte of fuse data | ||
444 | * @byte_addr: address to read | ||
445 | * | ||
446 | * Returns fuse value: 0 or 1 | ||
447 | */ | ||
448 | static uint8_t cvmx_fuse_read_byte(int byte_addr) | ||
449 | { | ||
450 | union cvmx_mio_fus_rcmd read_cmd; | ||
451 | |||
452 | read_cmd.u64 = 0; | ||
453 | read_cmd.s.addr = byte_addr; | ||
454 | read_cmd.s.pend = 1; | ||
455 | cvmx_write_csr(CVMX_MIO_FUS_RCMD, read_cmd.u64); | ||
456 | while ((read_cmd.u64 = cvmx_read_csr(CVMX_MIO_FUS_RCMD)) | ||
457 | && read_cmd.s.pend) | ||
458 | ; | ||
459 | return read_cmd.s.dat; | ||
460 | } | ||
461 | |||
462 | /** | ||
463 | * Read a single fuse bit | ||
464 | * | ||
465 | * @fuse: Fuse number (0-1024) | ||
466 | * | ||
467 | * Returns fuse value: 0 or 1 | ||
468 | */ | ||
469 | static inline int cvmx_fuse_read(int fuse) | ||
470 | { | ||
471 | return (cvmx_fuse_read_byte(fuse >> 3) >> (fuse & 0x7)) & 1; | ||
472 | } | ||
473 | |||
474 | static inline int cvmx_octeon_model_CN36XX(void) | ||
475 | { | ||
476 | return OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
477 | && !cvmx_octeon_is_pass1() | ||
478 | && cvmx_fuse_read(264); | ||
479 | } | ||
480 | |||
481 | static inline int cvmx_octeon_zip_present(void) | ||
482 | { | ||
483 | return octeon_has_feature(OCTEON_FEATURE_ZIP); | ||
484 | } | ||
485 | |||
486 | static inline int cvmx_octeon_dfa_present(void) | ||
487 | { | ||
488 | if (!OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
489 | && !OCTEON_IS_MODEL(OCTEON_CN31XX) | ||
490 | && !OCTEON_IS_MODEL(OCTEON_CN58XX)) | ||
491 | return 0; | ||
492 | else if (OCTEON_IS_MODEL(OCTEON_CN3020)) | ||
493 | return 0; | ||
494 | else if (cvmx_octeon_is_pass1()) | ||
495 | return 1; | ||
496 | else | ||
497 | return !cvmx_fuse_read(120); | ||
498 | } | ||
499 | |||
500 | static inline int cvmx_octeon_crypto_present(void) | ||
501 | { | ||
502 | return octeon_has_feature(OCTEON_FEATURE_CRYPTO); | ||
503 | } | ||
504 | |||
505 | #endif /* __CVMX_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h new file mode 100644 index 000000000000..04fac684069c --- /dev/null +++ b/arch/mips/include/asm/octeon/octeon-feature.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * File defining checks for different Octeon features. | ||
30 | */ | ||
31 | |||
32 | #ifndef __OCTEON_FEATURE_H__ | ||
33 | #define __OCTEON_FEATURE_H__ | ||
34 | |||
35 | enum octeon_feature { | ||
36 | /* | ||
37 | * Octeon models in the CN5XXX family and higher support | ||
38 | * atomic add instructions to memory (saa/saad). | ||
39 | */ | ||
40 | OCTEON_FEATURE_SAAD, | ||
41 | /* Does this Octeon support the ZIP offload engine? */ | ||
42 | OCTEON_FEATURE_ZIP, | ||
43 | /* Does this Octeon support crypto acceleration using COP2? */ | ||
44 | OCTEON_FEATURE_CRYPTO, | ||
45 | /* Does this Octeon support PCI express? */ | ||
46 | OCTEON_FEATURE_PCIE, | ||
47 | /* Some Octeon models support internal memory for storing | ||
48 | * cryptographic keys */ | ||
49 | OCTEON_FEATURE_KEY_MEMORY, | ||
50 | /* Octeon has a LED controller for banks of external LEDs */ | ||
51 | OCTEON_FEATURE_LED_CONTROLLER, | ||
52 | /* Octeon has a trace buffer */ | ||
53 | OCTEON_FEATURE_TRA, | ||
54 | /* Octeon has a management port */ | ||
55 | OCTEON_FEATURE_MGMT_PORT, | ||
56 | /* Octeon has a raid unit */ | ||
57 | OCTEON_FEATURE_RAID, | ||
58 | /* Octeon has a builtin USB */ | ||
59 | OCTEON_FEATURE_USB, | ||
60 | }; | ||
61 | |||
62 | static inline int cvmx_fuse_read(int fuse); | ||
63 | |||
64 | /** | ||
65 | * Determine if the current Octeon supports a specific feature. These | ||
66 | * checks have been optimized to be fairly quick, but they should still | ||
67 | * be kept out of fast path code. | ||
68 | * | ||
69 | * @feature: Feature to check for. This should always be a constant so the | ||
70 | * compiler can remove the switch statement through optimization. | ||
71 | * | ||
72 | * Returns Non zero if the feature exists. Zero if the feature does not | ||
73 | * exist. | ||
74 | */ | ||
75 | static inline int octeon_has_feature(enum octeon_feature feature) | ||
76 | { | ||
77 | switch (feature) { | ||
78 | case OCTEON_FEATURE_SAAD: | ||
79 | return !OCTEON_IS_MODEL(OCTEON_CN3XXX); | ||
80 | |||
81 | case OCTEON_FEATURE_ZIP: | ||
82 | if (OCTEON_IS_MODEL(OCTEON_CN30XX) | ||
83 | || OCTEON_IS_MODEL(OCTEON_CN50XX) | ||
84 | || OCTEON_IS_MODEL(OCTEON_CN52XX)) | ||
85 | return 0; | ||
86 | else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1)) | ||
87 | return 1; | ||
88 | else | ||
89 | return !cvmx_fuse_read(121); | ||
90 | |||
91 | case OCTEON_FEATURE_CRYPTO: | ||
92 | return !cvmx_fuse_read(90); | ||
93 | |||
94 | case OCTEON_FEATURE_PCIE: | ||
95 | return OCTEON_IS_MODEL(OCTEON_CN56XX) | ||
96 | || OCTEON_IS_MODEL(OCTEON_CN52XX); | ||
97 | |||
98 | case OCTEON_FEATURE_KEY_MEMORY: | ||
99 | case OCTEON_FEATURE_LED_CONTROLLER: | ||
100 | return OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
101 | || OCTEON_IS_MODEL(OCTEON_CN58XX) | ||
102 | || OCTEON_IS_MODEL(OCTEON_CN56XX); | ||
103 | case OCTEON_FEATURE_TRA: | ||
104 | return !(OCTEON_IS_MODEL(OCTEON_CN30XX) | ||
105 | || OCTEON_IS_MODEL(OCTEON_CN50XX)); | ||
106 | case OCTEON_FEATURE_MGMT_PORT: | ||
107 | return OCTEON_IS_MODEL(OCTEON_CN56XX) | ||
108 | || OCTEON_IS_MODEL(OCTEON_CN52XX); | ||
109 | case OCTEON_FEATURE_RAID: | ||
110 | return OCTEON_IS_MODEL(OCTEON_CN56XX) | ||
111 | || OCTEON_IS_MODEL(OCTEON_CN52XX); | ||
112 | case OCTEON_FEATURE_USB: | ||
113 | return !(OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
114 | || OCTEON_IS_MODEL(OCTEON_CN58XX)); | ||
115 | } | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | #endif /* __OCTEON_FEATURE_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/octeon-model.h b/arch/mips/include/asm/octeon/octeon-model.h new file mode 100644 index 000000000000..cf50336eca2e --- /dev/null +++ b/arch/mips/include/asm/octeon/octeon-model.h | |||
@@ -0,0 +1,321 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /* | ||
29 | * | ||
30 | * File defining different Octeon model IDs and macros to | ||
31 | * compare them. | ||
32 | * | ||
33 | */ | ||
34 | |||
35 | #ifndef __OCTEON_MODEL_H__ | ||
36 | #define __OCTEON_MODEL_H__ | ||
37 | |||
38 | /* NOTE: These must match what is checked in common-config.mk */ | ||
39 | /* Defines to represent the different versions of Octeon. */ | ||
40 | |||
41 | /* | ||
42 | * IMPORTANT: When the default pass is updated for an Octeon Model, | ||
43 | * the corresponding change must also be made in the oct-sim script. | ||
44 | */ | ||
45 | |||
46 | /* | ||
47 | * The defines below should be used with the OCTEON_IS_MODEL() macro | ||
48 | * to determine what model of chip the software is running on. Models | ||
49 | * ending in 'XX' match multiple models (families), while specific | ||
50 | * models match only that model. If a pass (revision) is specified, | ||
51 | * then only that revision will be matched. Care should be taken when | ||
52 | * checking for both specific models and families that the specific | ||
53 | * models are checked for first. While these defines are similar to | ||
54 | * the processor ID, they are not intended to be used by anything | ||
55 | * other that the OCTEON_IS_MODEL framework, and the values are | ||
56 | * subject to change at anytime without notice. | ||
57 | * | ||
58 | * NOTE: only the OCTEON_IS_MODEL() macro/function and the OCTEON_CN* | ||
59 | * macros should be used outside of this file. All other macros are | ||
60 | * for internal use only, and may change without notice. | ||
61 | */ | ||
62 | |||
63 | /* Flag bits in top byte */ | ||
64 | /* Ignores revision in model checks */ | ||
65 | #define OM_IGNORE_REVISION 0x01000000 | ||
66 | /* Check submodels */ | ||
67 | #define OM_CHECK_SUBMODEL 0x02000000 | ||
68 | /* Match all models previous than the one specified */ | ||
69 | #define OM_MATCH_PREVIOUS_MODELS 0x04000000 | ||
70 | /* Ignores the minor revison on newer parts */ | ||
71 | #define OM_IGNORE_MINOR_REVISION 0x08000000 | ||
72 | #define OM_FLAG_MASK 0xff000000 | ||
73 | |||
74 | /* | ||
75 | * CN5XXX models with new revision encoding | ||
76 | */ | ||
77 | #define OCTEON_CN58XX_PASS1_0 0x000d0300 | ||
78 | #define OCTEON_CN58XX_PASS1_1 0x000d0301 | ||
79 | #define OCTEON_CN58XX_PASS1_2 0x000d0303 | ||
80 | #define OCTEON_CN58XX_PASS2_0 0x000d0308 | ||
81 | #define OCTEON_CN58XX_PASS2_1 0x000d0309 | ||
82 | #define OCTEON_CN58XX_PASS2_2 0x000d030a | ||
83 | #define OCTEON_CN58XX_PASS2_3 0x000d030b | ||
84 | |||
85 | #define OCTEON_CN58XX (OCTEON_CN58XX_PASS1_0 | OM_IGNORE_REVISION) | ||
86 | #define OCTEON_CN58XX_PASS1_X (OCTEON_CN58XX_PASS1_0 \ | ||
87 | | OM_IGNORE_MINOR_REVISION) | ||
88 | #define OCTEON_CN58XX_PASS2_X (OCTEON_CN58XX_PASS2_0 \ | ||
89 | | OM_IGNORE_MINOR_REVISION) | ||
90 | #define OCTEON_CN58XX_PASS1 OCTEON_CN58XX_PASS1_X | ||
91 | #define OCTEON_CN58XX_PASS2 OCTEON_CN58XX_PASS2_X | ||
92 | |||
93 | #define OCTEON_CN56XX_PASS1_0 0x000d0400 | ||
94 | #define OCTEON_CN56XX_PASS1_1 0x000d0401 | ||
95 | #define OCTEON_CN56XX_PASS2_0 0x000d0408 | ||
96 | #define OCTEON_CN56XX_PASS2_1 0x000d0409 | ||
97 | |||
98 | #define OCTEON_CN56XX (OCTEON_CN56XX_PASS2_0 | OM_IGNORE_REVISION) | ||
99 | #define OCTEON_CN56XX_PASS1_X (OCTEON_CN56XX_PASS1_0 \ | ||
100 | | OM_IGNORE_MINOR_REVISION) | ||
101 | #define OCTEON_CN56XX_PASS2_X (OCTEON_CN56XX_PASS2_0 \ | ||
102 | | OM_IGNORE_MINOR_REVISION) | ||
103 | #define OCTEON_CN56XX_PASS1 OCTEON_CN56XX_PASS1_X | ||
104 | #define OCTEON_CN56XX_PASS2 OCTEON_CN56XX_PASS2_X | ||
105 | |||
106 | #define OCTEON_CN57XX OCTEON_CN56XX | ||
107 | #define OCTEON_CN57XX_PASS1 OCTEON_CN56XX_PASS1 | ||
108 | #define OCTEON_CN57XX_PASS2 OCTEON_CN56XX_PASS2 | ||
109 | |||
110 | #define OCTEON_CN55XX OCTEON_CN56XX | ||
111 | #define OCTEON_CN55XX_PASS1 OCTEON_CN56XX_PASS1 | ||
112 | #define OCTEON_CN55XX_PASS2 OCTEON_CN56XX_PASS2 | ||
113 | |||
114 | #define OCTEON_CN54XX OCTEON_CN56XX | ||
115 | #define OCTEON_CN54XX_PASS1 OCTEON_CN56XX_PASS1 | ||
116 | #define OCTEON_CN54XX_PASS2 OCTEON_CN56XX_PASS2 | ||
117 | |||
118 | #define OCTEON_CN50XX_PASS1_0 0x000d0600 | ||
119 | |||
120 | #define OCTEON_CN50XX (OCTEON_CN50XX_PASS1_0 | OM_IGNORE_REVISION) | ||
121 | #define OCTEON_CN50XX_PASS1_X (OCTEON_CN50XX_PASS1_0 \ | ||
122 | | OM_IGNORE_MINOR_REVISION) | ||
123 | #define OCTEON_CN50XX_PASS1 OCTEON_CN50XX_PASS1_X | ||
124 | |||
125 | /* | ||
126 | * NOTE: Octeon CN5000F model is not identifiable using the | ||
127 | * OCTEON_IS_MODEL() functions, but are treated as CN50XX. | ||
128 | */ | ||
129 | |||
130 | #define OCTEON_CN52XX_PASS1_0 0x000d0700 | ||
131 | #define OCTEON_CN52XX_PASS2_0 0x000d0708 | ||
132 | |||
133 | #define OCTEON_CN52XX (OCTEON_CN52XX_PASS2_0 | OM_IGNORE_REVISION) | ||
134 | #define OCTEON_CN52XX_PASS1_X (OCTEON_CN52XX_PASS1_0 \ | ||
135 | | OM_IGNORE_MINOR_REVISION) | ||
136 | #define OCTEON_CN52XX_PASS2_X (OCTEON_CN52XX_PASS2_0 \ | ||
137 | | OM_IGNORE_MINOR_REVISION) | ||
138 | #define OCTEON_CN52XX_PASS1 OCTEON_CN52XX_PASS1_X | ||
139 | #define OCTEON_CN52XX_PASS2 OCTEON_CN52XX_PASS2_X | ||
140 | |||
141 | /* | ||
142 | * CN3XXX models with old revision enconding | ||
143 | */ | ||
144 | #define OCTEON_CN38XX_PASS1 0x000d0000 | ||
145 | #define OCTEON_CN38XX_PASS2 0x000d0001 | ||
146 | #define OCTEON_CN38XX_PASS3 0x000d0003 | ||
147 | #define OCTEON_CN38XX (OCTEON_CN38XX_PASS3 | OM_IGNORE_REVISION) | ||
148 | |||
149 | #define OCTEON_CN36XX OCTEON_CN38XX | ||
150 | #define OCTEON_CN36XX_PASS2 OCTEON_CN38XX_PASS2 | ||
151 | #define OCTEON_CN36XX_PASS3 OCTEON_CN38XX_PASS3 | ||
152 | |||
153 | /* The OCTEON_CN31XX matches CN31XX models and the CN3020 */ | ||
154 | #define OCTEON_CN31XX_PASS1 0x000d0100 | ||
155 | #define OCTEON_CN31XX_PASS1_1 0x000d0102 | ||
156 | #define OCTEON_CN31XX (OCTEON_CN31XX_PASS1 | OM_IGNORE_REVISION) | ||
157 | |||
158 | /* | ||
159 | * This model is only used for internal checks, it is not a valid | ||
160 | * model for the OCTEON_MODEL environment variable. This matches the | ||
161 | * CN3010 and CN3005 but NOT the CN3020. | ||
162 | */ | ||
163 | #define OCTEON_CN30XX_PASS1 0x000d0200 | ||
164 | #define OCTEON_CN30XX_PASS1_1 0x000d0202 | ||
165 | #define OCTEON_CN30XX (OCTEON_CN30XX_PASS1 | OM_IGNORE_REVISION) | ||
166 | |||
167 | #define OCTEON_CN3005_PASS1 (0x000d0210 | OM_CHECK_SUBMODEL) | ||
168 | #define OCTEON_CN3005_PASS1_0 (0x000d0210 | OM_CHECK_SUBMODEL) | ||
169 | #define OCTEON_CN3005_PASS1_1 (0x000d0212 | OM_CHECK_SUBMODEL) | ||
170 | #define OCTEON_CN3005 (OCTEON_CN3005_PASS1 | OM_IGNORE_REVISION \ | ||
171 | | OM_CHECK_SUBMODEL) | ||
172 | |||
173 | #define OCTEON_CN3010_PASS1 (0x000d0200 | OM_CHECK_SUBMODEL) | ||
174 | #define OCTEON_CN3010_PASS1_0 (0x000d0200 | OM_CHECK_SUBMODEL) | ||
175 | #define OCTEON_CN3010_PASS1_1 (0x000d0202 | OM_CHECK_SUBMODEL) | ||
176 | #define OCTEON_CN3010 (OCTEON_CN3010_PASS1 | OM_IGNORE_REVISION \ | ||
177 | | OM_CHECK_SUBMODEL) | ||
178 | |||
179 | #define OCTEON_CN3020_PASS1 (0x000d0110 | OM_CHECK_SUBMODEL) | ||
180 | #define OCTEON_CN3020_PASS1_0 (0x000d0110 | OM_CHECK_SUBMODEL) | ||
181 | #define OCTEON_CN3020_PASS1_1 (0x000d0112 | OM_CHECK_SUBMODEL) | ||
182 | #define OCTEON_CN3020 (OCTEON_CN3020_PASS1 | OM_IGNORE_REVISION \ | ||
183 | | OM_CHECK_SUBMODEL) | ||
184 | |||
185 | |||
186 | |||
187 | /* This matches the complete family of CN3xxx CPUs, and not subsequent models */ | ||
188 | #define OCTEON_CN3XXX (OCTEON_CN58XX_PASS1_0 \ | ||
189 | | OM_MATCH_PREVIOUS_MODELS \ | ||
190 | | OM_IGNORE_REVISION) | ||
191 | |||
192 | /* The revision byte (low byte) has two different encodings. | ||
193 | * CN3XXX: | ||
194 | * | ||
195 | * bits | ||
196 | * <7:5>: reserved (0) | ||
197 | * <4>: alternate package | ||
198 | * <3:0>: revision | ||
199 | * | ||
200 | * CN5XXX: | ||
201 | * | ||
202 | * bits | ||
203 | * <7>: reserved (0) | ||
204 | * <6>: alternate package | ||
205 | * <5:3>: major revision | ||
206 | * <2:0>: minor revision | ||
207 | * | ||
208 | */ | ||
209 | |||
210 | /* Masks used for the various types of model/family/revision matching */ | ||
211 | #define OCTEON_38XX_FAMILY_MASK 0x00ffff00 | ||
212 | #define OCTEON_38XX_FAMILY_REV_MASK 0x00ffff0f | ||
213 | #define OCTEON_38XX_MODEL_MASK 0x00ffff10 | ||
214 | #define OCTEON_38XX_MODEL_REV_MASK (OCTEON_38XX_FAMILY_REV_MASK \ | ||
215 | | OCTEON_38XX_MODEL_MASK) | ||
216 | |||
217 | /* CN5XXX and later use different layout of bits in the revision ID field */ | ||
218 | #define OCTEON_58XX_FAMILY_MASK OCTEON_38XX_FAMILY_MASK | ||
219 | #define OCTEON_58XX_FAMILY_REV_MASK 0x00ffff3f | ||
220 | #define OCTEON_58XX_MODEL_MASK 0x00ffffc0 | ||
221 | #define OCTEON_58XX_MODEL_REV_MASK (OCTEON_58XX_FAMILY_REV_MASK \ | ||
222 | | OCTEON_58XX_MODEL_MASK) | ||
223 | #define OCTEON_58XX_MODEL_MINOR_REV_MASK (OCTEON_58XX_MODEL_REV_MASK \ | ||
224 | & 0x00fffff8) | ||
225 | |||
226 | #define __OCTEON_MATCH_MASK__(x, y, z) (((x) & (z)) == ((y) & (z))) | ||
227 | |||
228 | /* NOTE: This is for internal (to this file) use only. */ | ||
229 | static inline int __OCTEON_IS_MODEL_COMPILE__(uint32_t arg_model, | ||
230 | uint32_t chip_model) | ||
231 | { | ||
232 | uint32_t rev_and_sub = OM_IGNORE_REVISION | OM_CHECK_SUBMODEL; | ||
233 | |||
234 | if ((arg_model & OCTEON_38XX_FAMILY_MASK) < OCTEON_CN58XX_PASS1_0) { | ||
235 | if (((arg_model & OM_FLAG_MASK) == rev_and_sub) && | ||
236 | __OCTEON_MATCH_MASK__(chip_model, arg_model, | ||
237 | OCTEON_38XX_MODEL_MASK)) | ||
238 | return 1; | ||
239 | if (((arg_model & OM_FLAG_MASK) == 0) && | ||
240 | __OCTEON_MATCH_MASK__(chip_model, arg_model, | ||
241 | OCTEON_38XX_FAMILY_REV_MASK)) | ||
242 | return 1; | ||
243 | if (((arg_model & OM_FLAG_MASK) == OM_IGNORE_REVISION) && | ||
244 | __OCTEON_MATCH_MASK__(chip_model, arg_model, | ||
245 | OCTEON_38XX_FAMILY_MASK)) | ||
246 | return 1; | ||
247 | if (((arg_model & OM_FLAG_MASK) == OM_CHECK_SUBMODEL) && | ||
248 | __OCTEON_MATCH_MASK__((chip_model), (arg_model), | ||
249 | OCTEON_38XX_MODEL_REV_MASK)) | ||
250 | return 1; | ||
251 | if ((arg_model & OM_MATCH_PREVIOUS_MODELS) && | ||
252 | ((chip_model & OCTEON_38XX_MODEL_MASK) < | ||
253 | (arg_model & OCTEON_38XX_MODEL_MASK))) | ||
254 | return 1; | ||
255 | } else { | ||
256 | if (((arg_model & OM_FLAG_MASK) == rev_and_sub) && | ||
257 | __OCTEON_MATCH_MASK__((chip_model), (arg_model), | ||
258 | OCTEON_58XX_MODEL_MASK)) | ||
259 | return 1; | ||
260 | if (((arg_model & OM_FLAG_MASK) == 0) && | ||
261 | __OCTEON_MATCH_MASK__((chip_model), (arg_model), | ||
262 | OCTEON_58XX_FAMILY_REV_MASK)) | ||
263 | return 1; | ||
264 | if (((arg_model & OM_FLAG_MASK) == OM_IGNORE_MINOR_REVISION) && | ||
265 | __OCTEON_MATCH_MASK__((chip_model), (arg_model), | ||
266 | OCTEON_58XX_MODEL_MINOR_REV_MASK)) | ||
267 | return 1; | ||
268 | if (((arg_model & OM_FLAG_MASK) == OM_IGNORE_REVISION) && | ||
269 | __OCTEON_MATCH_MASK__((chip_model), (arg_model), | ||
270 | OCTEON_58XX_FAMILY_MASK)) | ||
271 | return 1; | ||
272 | if (((arg_model & OM_FLAG_MASK) == OM_CHECK_SUBMODEL) && | ||
273 | __OCTEON_MATCH_MASK__((chip_model), (arg_model), | ||
274 | OCTEON_58XX_MODEL_REV_MASK)) | ||
275 | return 1; | ||
276 | if ((arg_model & OM_MATCH_PREVIOUS_MODELS) && | ||
277 | ((chip_model & OCTEON_58XX_MODEL_MASK) < | ||
278 | (arg_model & OCTEON_58XX_MODEL_MASK))) | ||
279 | return 1; | ||
280 | } | ||
281 | return 0; | ||
282 | } | ||
283 | |||
284 | /* forward declarations */ | ||
285 | static inline uint32_t cvmx_get_proc_id(void) __attribute__ ((pure)); | ||
286 | static inline uint64_t cvmx_read_csr(uint64_t csr_addr); | ||
287 | |||
288 | /* NOTE: This for internal use only!!!!! */ | ||
289 | static inline int __octeon_is_model_runtime__(uint32_t model) | ||
290 | { | ||
291 | uint32_t cpuid = cvmx_get_proc_id(); | ||
292 | |||
293 | /* | ||
294 | * Check for special case of mismarked 3005 samples. We only | ||
295 | * need to check if the sub model isn't being ignored. | ||
296 | */ | ||
297 | if ((model & OM_CHECK_SUBMODEL) == OM_CHECK_SUBMODEL) { | ||
298 | if (cpuid == OCTEON_CN3010_PASS1 \ | ||
299 | && (cvmx_read_csr(0x80011800800007B8ull) & (1ull << 34))) | ||
300 | cpuid |= 0x10; | ||
301 | } | ||
302 | return __OCTEON_IS_MODEL_COMPILE__(model, cpuid); | ||
303 | } | ||
304 | |||
305 | /* | ||
306 | * The OCTEON_IS_MODEL macro should be used for all Octeon model | ||
307 | * checking done in a program. This should be kept runtime if at all | ||
308 | * possible. Any compile time (#if OCTEON_IS_MODEL) usage must be | ||
309 | * condtionalized with OCTEON_IS_COMMON_BINARY() if runtime checking | ||
310 | * support is required. | ||
311 | */ | ||
312 | #define OCTEON_IS_MODEL(x) __octeon_is_model_runtime__(x) | ||
313 | #define OCTEON_IS_COMMON_BINARY() 1 | ||
314 | #undef OCTEON_MODEL | ||
315 | |||
316 | const char *octeon_model_get_string(uint32_t chip_id); | ||
317 | const char *octeon_model_get_string_buffer(uint32_t chip_id, char *buffer); | ||
318 | |||
319 | #include "octeon-feature.h" | ||
320 | |||
321 | #endif /* __OCTEON_MODEL_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h new file mode 100644 index 000000000000..edc676084cda --- /dev/null +++ b/arch/mips/include/asm/octeon/octeon.h | |||
@@ -0,0 +1,248 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004-2008 Cavium Networks | ||
7 | */ | ||
8 | #ifndef __ASM_OCTEON_OCTEON_H | ||
9 | #define __ASM_OCTEON_OCTEON_H | ||
10 | |||
11 | #include "cvmx.h" | ||
12 | |||
13 | extern uint64_t octeon_bootmem_alloc_range_phys(uint64_t size, | ||
14 | uint64_t alignment, | ||
15 | uint64_t min_addr, | ||
16 | uint64_t max_addr, | ||
17 | int do_locking); | ||
18 | extern void *octeon_bootmem_alloc(uint64_t size, uint64_t alignment, | ||
19 | int do_locking); | ||
20 | extern void *octeon_bootmem_alloc_range(uint64_t size, uint64_t alignment, | ||
21 | uint64_t min_addr, uint64_t max_addr, | ||
22 | int do_locking); | ||
23 | extern void *octeon_bootmem_alloc_named(uint64_t size, uint64_t alignment, | ||
24 | char *name); | ||
25 | extern void *octeon_bootmem_alloc_named_range(uint64_t size, uint64_t min_addr, | ||
26 | uint64_t max_addr, uint64_t align, | ||
27 | char *name); | ||
28 | extern void *octeon_bootmem_alloc_named_address(uint64_t size, uint64_t address, | ||
29 | char *name); | ||
30 | extern int octeon_bootmem_free_named(char *name); | ||
31 | extern void octeon_bootmem_lock(void); | ||
32 | extern void octeon_bootmem_unlock(void); | ||
33 | |||
34 | extern int octeon_is_simulation(void); | ||
35 | extern int octeon_is_pci_host(void); | ||
36 | extern int octeon_usb_is_ref_clk(void); | ||
37 | extern uint64_t octeon_get_clock_rate(void); | ||
38 | extern const char *octeon_board_type_string(void); | ||
39 | extern const char *octeon_get_pci_interrupts(void); | ||
40 | extern int octeon_get_southbridge_interrupt(void); | ||
41 | extern int octeon_get_boot_coremask(void); | ||
42 | extern int octeon_get_boot_num_arguments(void); | ||
43 | extern const char *octeon_get_boot_argument(int arg); | ||
44 | extern void octeon_hal_setup_reserved32(void); | ||
45 | extern void octeon_user_io_init(void); | ||
46 | struct octeon_cop2_state; | ||
47 | extern unsigned long octeon_crypto_enable(struct octeon_cop2_state *state); | ||
48 | extern void octeon_crypto_disable(struct octeon_cop2_state *state, | ||
49 | unsigned long flags); | ||
50 | |||
51 | extern void octeon_init_cvmcount(void); | ||
52 | |||
53 | #define OCTEON_ARGV_MAX_ARGS 64 | ||
54 | #define OCTOEN_SERIAL_LEN 20 | ||
55 | |||
56 | struct octeon_boot_descriptor { | ||
57 | /* Start of block referenced by assembly code - do not change! */ | ||
58 | uint32_t desc_version; | ||
59 | uint32_t desc_size; | ||
60 | uint64_t stack_top; | ||
61 | uint64_t heap_base; | ||
62 | uint64_t heap_end; | ||
63 | /* Only used by bootloader */ | ||
64 | uint64_t entry_point; | ||
65 | uint64_t desc_vaddr; | ||
66 | /* End of This block referenced by assembly code - do not change! */ | ||
67 | uint32_t exception_base_addr; | ||
68 | uint32_t stack_size; | ||
69 | uint32_t heap_size; | ||
70 | /* Argc count for application. */ | ||
71 | uint32_t argc; | ||
72 | uint32_t argv[OCTEON_ARGV_MAX_ARGS]; | ||
73 | |||
74 | #define BOOT_FLAG_INIT_CORE (1 << 0) | ||
75 | #define OCTEON_BL_FLAG_DEBUG (1 << 1) | ||
76 | #define OCTEON_BL_FLAG_NO_MAGIC (1 << 2) | ||
77 | /* If set, use uart1 for console */ | ||
78 | #define OCTEON_BL_FLAG_CONSOLE_UART1 (1 << 3) | ||
79 | /* If set, use PCI console */ | ||
80 | #define OCTEON_BL_FLAG_CONSOLE_PCI (1 << 4) | ||
81 | /* Call exit on break on serial port */ | ||
82 | #define OCTEON_BL_FLAG_BREAK (1 << 5) | ||
83 | |||
84 | uint32_t flags; | ||
85 | uint32_t core_mask; | ||
86 | /* DRAM size in megabyes. */ | ||
87 | uint32_t dram_size; | ||
88 | /* physical address of free memory descriptor block. */ | ||
89 | uint32_t phy_mem_desc_addr; | ||
90 | /* used to pass flags from app to debugger. */ | ||
91 | uint32_t debugger_flags_base_addr; | ||
92 | /* CPU clock speed, in hz. */ | ||
93 | uint32_t eclock_hz; | ||
94 | /* DRAM clock speed, in hz. */ | ||
95 | uint32_t dclock_hz; | ||
96 | /* SPI4 clock in hz. */ | ||
97 | uint32_t spi_clock_hz; | ||
98 | uint16_t board_type; | ||
99 | uint8_t board_rev_major; | ||
100 | uint8_t board_rev_minor; | ||
101 | uint16_t chip_type; | ||
102 | uint8_t chip_rev_major; | ||
103 | uint8_t chip_rev_minor; | ||
104 | char board_serial_number[OCTOEN_SERIAL_LEN]; | ||
105 | uint8_t mac_addr_base[6]; | ||
106 | uint8_t mac_addr_count; | ||
107 | uint64_t cvmx_desc_vaddr; | ||
108 | }; | ||
109 | |||
110 | union octeon_cvmemctl { | ||
111 | uint64_t u64; | ||
112 | struct { | ||
113 | /* RO 1 = BIST fail, 0 = BIST pass */ | ||
114 | uint64_t tlbbist:1; | ||
115 | /* RO 1 = BIST fail, 0 = BIST pass */ | ||
116 | uint64_t l1cbist:1; | ||
117 | /* RO 1 = BIST fail, 0 = BIST pass */ | ||
118 | uint64_t l1dbist:1; | ||
119 | /* RO 1 = BIST fail, 0 = BIST pass */ | ||
120 | uint64_t dcmbist:1; | ||
121 | /* RO 1 = BIST fail, 0 = BIST pass */ | ||
122 | uint64_t ptgbist:1; | ||
123 | /* RO 1 = BIST fail, 0 = BIST pass */ | ||
124 | uint64_t wbfbist:1; | ||
125 | /* Reserved */ | ||
126 | uint64_t reserved:22; | ||
127 | /* R/W If set, marked write-buffer entries time out | ||
128 | * the same as as other entries; if clear, marked | ||
129 | * write-buffer entries use the maximum timeout. */ | ||
130 | uint64_t dismarkwblongto:1; | ||
131 | /* R/W If set, a merged store does not clear the | ||
132 | * write-buffer entry timeout state. */ | ||
133 | uint64_t dismrgclrwbto:1; | ||
134 | /* R/W Two bits that are the MSBs of the resultant | ||
135 | * CVMSEG LM word location for an IOBDMA. The other 8 | ||
136 | * bits come from the SCRADDR field of the IOBDMA. */ | ||
137 | uint64_t iobdmascrmsb:2; | ||
138 | /* R/W If set, SYNCWS and SYNCS only order marked | ||
139 | * stores; if clear, SYNCWS and SYNCS only order | ||
140 | * unmarked stores. SYNCWSMARKED has no effect when | ||
141 | * DISSYNCWS is set. */ | ||
142 | uint64_t syncwsmarked:1; | ||
143 | /* R/W If set, SYNCWS acts as SYNCW and SYNCS acts as | ||
144 | * SYNC. */ | ||
145 | uint64_t dissyncws:1; | ||
146 | /* R/W If set, no stall happens on write buffer | ||
147 | * full. */ | ||
148 | uint64_t diswbfst:1; | ||
149 | /* R/W If set (and SX set), supervisor-level | ||
150 | * loads/stores can use XKPHYS addresses with | ||
151 | * VA<48>==0 */ | ||
152 | uint64_t xkmemenas:1; | ||
153 | /* R/W If set (and UX set), user-level loads/stores | ||
154 | * can use XKPHYS addresses with VA<48>==0 */ | ||
155 | uint64_t xkmemenau:1; | ||
156 | /* R/W If set (and SX set), supervisor-level | ||
157 | * loads/stores can use XKPHYS addresses with | ||
158 | * VA<48>==1 */ | ||
159 | uint64_t xkioenas:1; | ||
160 | /* R/W If set (and UX set), user-level loads/stores | ||
161 | * can use XKPHYS addresses with VA<48>==1 */ | ||
162 | uint64_t xkioenau:1; | ||
163 | /* R/W If set, all stores act as SYNCW (NOMERGE must | ||
164 | * be set when this is set) RW, reset to 0. */ | ||
165 | uint64_t allsyncw:1; | ||
166 | /* R/W If set, no stores merge, and all stores reach | ||
167 | * the coherent bus in order. */ | ||
168 | uint64_t nomerge:1; | ||
169 | /* R/W Selects the bit in the counter used for DID | ||
170 | * time-outs 0 = 231, 1 = 230, 2 = 229, 3 = | ||
171 | * 214. Actual time-out is between 1x and 2x this | ||
172 | * interval. For example, with DIDTTO=3, expiration | ||
173 | * interval is between 16K and 32K. */ | ||
174 | uint64_t didtto:2; | ||
175 | /* R/W If set, the (mem) CSR clock never turns off. */ | ||
176 | uint64_t csrckalwys:1; | ||
177 | /* R/W If set, mclk never turns off. */ | ||
178 | uint64_t mclkalwys:1; | ||
179 | /* R/W Selects the bit in the counter used for write | ||
180 | * buffer flush time-outs (WBFLT+11) is the bit | ||
181 | * position in an internal counter used to determine | ||
182 | * expiration. The write buffer expires between 1x and | ||
183 | * 2x this interval. For example, with WBFLT = 0, a | ||
184 | * write buffer expires between 2K and 4K cycles after | ||
185 | * the write buffer entry is allocated. */ | ||
186 | uint64_t wbfltime:3; | ||
187 | /* R/W If set, do not put Istream in the L2 cache. */ | ||
188 | uint64_t istrnol2:1; | ||
189 | /* R/W The write buffer threshold. */ | ||
190 | uint64_t wbthresh:4; | ||
191 | /* Reserved */ | ||
192 | uint64_t reserved2:2; | ||
193 | /* R/W If set, CVMSEG is available for loads/stores in | ||
194 | * kernel/debug mode. */ | ||
195 | uint64_t cvmsegenak:1; | ||
196 | /* R/W If set, CVMSEG is available for loads/stores in | ||
197 | * supervisor mode. */ | ||
198 | uint64_t cvmsegenas:1; | ||
199 | /* R/W If set, CVMSEG is available for loads/stores in | ||
200 | * user mode. */ | ||
201 | uint64_t cvmsegenau:1; | ||
202 | /* R/W Size of local memory in cache blocks, 54 (6912 | ||
203 | * bytes) is max legal value. */ | ||
204 | uint64_t lmemsz:6; | ||
205 | } s; | ||
206 | }; | ||
207 | |||
208 | struct octeon_cf_data { | ||
209 | unsigned long base_region_bias; | ||
210 | unsigned int base_region; /* The chip select region used by CF */ | ||
211 | int is16bit; /* 0 - 8bit, !0 - 16bit */ | ||
212 | int dma_engine; /* -1 for no DMA */ | ||
213 | }; | ||
214 | |||
215 | extern void octeon_write_lcd(const char *s); | ||
216 | extern void octeon_check_cpu_bist(void); | ||
217 | extern int octeon_get_boot_debug_flag(void); | ||
218 | extern int octeon_get_boot_uart(void); | ||
219 | |||
220 | struct uart_port; | ||
221 | extern unsigned int octeon_serial_in(struct uart_port *, int); | ||
222 | extern void octeon_serial_out(struct uart_port *, int, int); | ||
223 | |||
224 | /** | ||
225 | * Write a 32bit value to the Octeon NPI register space | ||
226 | * | ||
227 | * @address: Address to write to | ||
228 | * @val: Value to write | ||
229 | */ | ||
230 | static inline void octeon_npi_write32(uint64_t address, uint32_t val) | ||
231 | { | ||
232 | cvmx_write64_uint32(address ^ 4, val); | ||
233 | cvmx_read64_uint32(address ^ 4); | ||
234 | } | ||
235 | |||
236 | |||
237 | /** | ||
238 | * Read a 32bit value from the Octeon NPI register space | ||
239 | * | ||
240 | * @address: Address to read | ||
241 | * Returns The result | ||
242 | */ | ||
243 | static inline uint32_t octeon_npi_read32(uint64_t address) | ||
244 | { | ||
245 | return cvmx_read64_uint32(address ^ 4); | ||
246 | } | ||
247 | |||
248 | #endif /* __ASM_OCTEON_OCTEON_H */ | ||
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h index 18ee58e39445..0f926aa0cb47 100644 --- a/arch/mips/include/asm/processor.h +++ b/arch/mips/include/asm/processor.h | |||
@@ -118,6 +118,60 @@ union mips_watch_reg_state { | |||
118 | struct mips3264_watch_reg_state mips3264; | 118 | struct mips3264_watch_reg_state mips3264; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
122 | |||
123 | struct octeon_cop2_state { | ||
124 | /* DMFC2 rt, 0x0201 */ | ||
125 | unsigned long cop2_crc_iv; | ||
126 | /* DMFC2 rt, 0x0202 (Set with DMTC2 rt, 0x1202) */ | ||
127 | unsigned long cop2_crc_length; | ||
128 | /* DMFC2 rt, 0x0200 (set with DMTC2 rt, 0x4200) */ | ||
129 | unsigned long cop2_crc_poly; | ||
130 | /* DMFC2 rt, 0x0402; DMFC2 rt, 0x040A */ | ||
131 | unsigned long cop2_llm_dat[2]; | ||
132 | /* DMFC2 rt, 0x0084 */ | ||
133 | unsigned long cop2_3des_iv; | ||
134 | /* DMFC2 rt, 0x0080; DMFC2 rt, 0x0081; DMFC2 rt, 0x0082 */ | ||
135 | unsigned long cop2_3des_key[3]; | ||
136 | /* DMFC2 rt, 0x0088 (Set with DMTC2 rt, 0x0098) */ | ||
137 | unsigned long cop2_3des_result; | ||
138 | /* DMFC2 rt, 0x0111 (FIXME: Read Pass1 Errata) */ | ||
139 | unsigned long cop2_aes_inp0; | ||
140 | /* DMFC2 rt, 0x0102; DMFC2 rt, 0x0103 */ | ||
141 | unsigned long cop2_aes_iv[2]; | ||
142 | /* DMFC2 rt, 0x0104; DMFC2 rt, 0x0105; DMFC2 rt, 0x0106; DMFC2 | ||
143 | * rt, 0x0107 */ | ||
144 | unsigned long cop2_aes_key[4]; | ||
145 | /* DMFC2 rt, 0x0110 */ | ||
146 | unsigned long cop2_aes_keylen; | ||
147 | /* DMFC2 rt, 0x0100; DMFC2 rt, 0x0101 */ | ||
148 | unsigned long cop2_aes_result[2]; | ||
149 | /* DMFC2 rt, 0x0240; DMFC2 rt, 0x0241; DMFC2 rt, 0x0242; DMFC2 | ||
150 | * rt, 0x0243; DMFC2 rt, 0x0244; DMFC2 rt, 0x0245; DMFC2 rt, | ||
151 | * 0x0246; DMFC2 rt, 0x0247; DMFC2 rt, 0x0248; DMFC2 rt, | ||
152 | * 0x0249; DMFC2 rt, 0x024A; DMFC2 rt, 0x024B; DMFC2 rt, | ||
153 | * 0x024C; DMFC2 rt, 0x024D; DMFC2 rt, 0x024E - Pass2 */ | ||
154 | unsigned long cop2_hsh_datw[15]; | ||
155 | /* DMFC2 rt, 0x0250; DMFC2 rt, 0x0251; DMFC2 rt, 0x0252; DMFC2 | ||
156 | * rt, 0x0253; DMFC2 rt, 0x0254; DMFC2 rt, 0x0255; DMFC2 rt, | ||
157 | * 0x0256; DMFC2 rt, 0x0257 - Pass2 */ | ||
158 | unsigned long cop2_hsh_ivw[8]; | ||
159 | /* DMFC2 rt, 0x0258; DMFC2 rt, 0x0259 - Pass2 */ | ||
160 | unsigned long cop2_gfm_mult[2]; | ||
161 | /* DMFC2 rt, 0x025E - Pass2 */ | ||
162 | unsigned long cop2_gfm_poly; | ||
163 | /* DMFC2 rt, 0x025A; DMFC2 rt, 0x025B - Pass2 */ | ||
164 | unsigned long cop2_gfm_result[2]; | ||
165 | }; | ||
166 | #define INIT_OCTEON_COP2 {0,} | ||
167 | |||
168 | struct octeon_cvmseg_state { | ||
169 | unsigned long cvmseg[CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE] | ||
170 | [cpu_dcache_line_size() / sizeof(unsigned long)]; | ||
171 | }; | ||
172 | |||
173 | #endif | ||
174 | |||
121 | typedef struct { | 175 | typedef struct { |
122 | unsigned long seg; | 176 | unsigned long seg; |
123 | } mm_segment_t; | 177 | } mm_segment_t; |
@@ -160,6 +214,10 @@ struct thread_struct { | |||
160 | unsigned long trap_no; | 214 | unsigned long trap_no; |
161 | unsigned long irix_trampoline; /* Wheee... */ | 215 | unsigned long irix_trampoline; /* Wheee... */ |
162 | unsigned long irix_oldctx; | 216 | unsigned long irix_oldctx; |
217 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
218 | struct octeon_cop2_state cp2 __attribute__ ((__aligned__(128))); | ||
219 | struct octeon_cvmseg_state cvmseg __attribute__ ((__aligned__(128))); | ||
220 | #endif | ||
163 | struct mips_abi *abi; | 221 | struct mips_abi *abi; |
164 | }; | 222 | }; |
165 | 223 | ||
@@ -171,6 +229,13 @@ struct thread_struct { | |||
171 | #define FPAFF_INIT | 229 | #define FPAFF_INIT |
172 | #endif /* CONFIG_MIPS_MT_FPAFF */ | 230 | #endif /* CONFIG_MIPS_MT_FPAFF */ |
173 | 231 | ||
232 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
233 | #define OCTEON_INIT \ | ||
234 | .cp2 = INIT_OCTEON_COP2, | ||
235 | #else | ||
236 | #define OCTEON_INIT | ||
237 | #endif /* CONFIG_CPU_CAVIUM_OCTEON */ | ||
238 | |||
174 | #define INIT_THREAD { \ | 239 | #define INIT_THREAD { \ |
175 | /* \ | 240 | /* \ |
176 | * Saved main processor registers \ | 241 | * Saved main processor registers \ |
@@ -221,6 +286,10 @@ struct thread_struct { | |||
221 | .trap_no = 0, \ | 286 | .trap_no = 0, \ |
222 | .irix_trampoline = 0, \ | 287 | .irix_trampoline = 0, \ |
223 | .irix_oldctx = 0, \ | 288 | .irix_oldctx = 0, \ |
289 | /* \ | ||
290 | * Cavium Octeon specifics (null if not Octeon) \ | ||
291 | */ \ | ||
292 | OCTEON_INIT \ | ||
224 | } | 293 | } |
225 | 294 | ||
226 | struct task_struct; | 295 | struct task_struct; |
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h index c2c8bac43307..1f30d16d4669 100644 --- a/arch/mips/include/asm/ptrace.h +++ b/arch/mips/include/asm/ptrace.h | |||
@@ -48,6 +48,10 @@ struct pt_regs { | |||
48 | #ifdef CONFIG_MIPS_MT_SMTC | 48 | #ifdef CONFIG_MIPS_MT_SMTC |
49 | unsigned long cp0_tcstatus; | 49 | unsigned long cp0_tcstatus; |
50 | #endif /* CONFIG_MIPS_MT_SMTC */ | 50 | #endif /* CONFIG_MIPS_MT_SMTC */ |
51 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
52 | unsigned long long mpl[3]; /* MTM{0,1,2} */ | ||
53 | unsigned long long mtp[3]; /* MTP{0,1,2} */ | ||
54 | #endif | ||
51 | } __attribute__ ((aligned (8))); | 55 | } __attribute__ ((aligned (8))); |
52 | 56 | ||
53 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | 57 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h index 86557b5d1b3f..40e5ef1d4d26 100644 --- a/arch/mips/include/asm/smp.h +++ b/arch/mips/include/asm/smp.h | |||
@@ -37,6 +37,9 @@ extern int __cpu_logical_map[NR_CPUS]; | |||
37 | 37 | ||
38 | #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ | 38 | #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ |
39 | #define SMP_CALL_FUNCTION 0x2 | 39 | #define SMP_CALL_FUNCTION 0x2 |
40 | /* Octeon - Tell another core to flush its icache */ | ||
41 | #define SMP_ICACHE_FLUSH 0x4 | ||
42 | |||
40 | 43 | ||
41 | extern void asmlinkage smp_bootstrap(void); | 44 | extern void asmlinkage smp_bootstrap(void); |
42 | 45 | ||
diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h index 4c37c4e5f72e..db0fa7b5aeaf 100644 --- a/arch/mips/include/asm/stackframe.h +++ b/arch/mips/include/asm/stackframe.h | |||
@@ -194,6 +194,19 @@ | |||
194 | LONG_S $31, PT_R31(sp) | 194 | LONG_S $31, PT_R31(sp) |
195 | ori $28, sp, _THREAD_MASK | 195 | ori $28, sp, _THREAD_MASK |
196 | xori $28, _THREAD_MASK | 196 | xori $28, _THREAD_MASK |
197 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
198 | .set mips64 | ||
199 | pref 0, 0($28) /* Prefetch the current pointer */ | ||
200 | pref 0, PT_R31(sp) /* Prefetch the $31(ra) */ | ||
201 | /* The Octeon multiplier state is affected by general multiply | ||
202 | instructions. It must be saved before and kernel code might | ||
203 | corrupt it */ | ||
204 | jal octeon_mult_save | ||
205 | LONG_L v1, 0($28) /* Load the current pointer */ | ||
206 | /* Restore $31(ra) that was changed by the jal */ | ||
207 | LONG_L ra, PT_R31(sp) | ||
208 | pref 0, 0(v1) /* Prefetch the current thread */ | ||
209 | #endif | ||
197 | .set pop | 210 | .set pop |
198 | .endm | 211 | .endm |
199 | 212 | ||
@@ -324,6 +337,10 @@ | |||
324 | DVPE 5 # dvpe a1 | 337 | DVPE 5 # dvpe a1 |
325 | jal mips_ihb | 338 | jal mips_ihb |
326 | #endif /* CONFIG_MIPS_MT_SMTC */ | 339 | #endif /* CONFIG_MIPS_MT_SMTC */ |
340 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
341 | /* Restore the Octeon multiplier state */ | ||
342 | jal octeon_mult_restore | ||
343 | #endif | ||
327 | mfc0 a0, CP0_STATUS | 344 | mfc0 a0, CP0_STATUS |
328 | ori a0, STATMASK | 345 | ori a0, STATMASK |
329 | xori a0, STATMASK | 346 | xori a0, STATMASK |
diff --git a/arch/mips/include/asm/time.h b/arch/mips/include/asm/time.h index 9601ea950542..38a30d2ee959 100644 --- a/arch/mips/include/asm/time.h +++ b/arch/mips/include/asm/time.h | |||
@@ -50,27 +50,35 @@ extern int (*perf_irq)(void); | |||
50 | /* | 50 | /* |
51 | * Initialize the calling CPU's compare interrupt as clockevent device | 51 | * Initialize the calling CPU's compare interrupt as clockevent device |
52 | */ | 52 | */ |
53 | #ifdef CONFIG_CEVT_R4K | 53 | #ifdef CONFIG_CEVT_R4K_LIB |
54 | extern int mips_clockevent_init(void); | ||
55 | extern unsigned int __weak get_c0_compare_int(void); | 54 | extern unsigned int __weak get_c0_compare_int(void); |
56 | #else | 55 | extern int r4k_clockevent_init(void); |
56 | #endif | ||
57 | |||
57 | static inline int mips_clockevent_init(void) | 58 | static inline int mips_clockevent_init(void) |
58 | { | 59 | { |
60 | #ifdef CONFIG_CEVT_R4K | ||
61 | return r4k_clockevent_init(); | ||
62 | #else | ||
59 | return -ENXIO; | 63 | return -ENXIO; |
60 | } | ||
61 | #endif | 64 | #endif |
65 | } | ||
62 | 66 | ||
63 | /* | 67 | /* |
64 | * Initialize the count register as a clocksource | 68 | * Initialize the count register as a clocksource |
65 | */ | 69 | */ |
66 | #ifdef CONFIG_CSRC_R4K | 70 | #ifdef CONFIG_CSRC_R4K_LIB |
67 | extern int init_mips_clocksource(void); | 71 | extern int init_r4k_clocksource(void); |
68 | #else | 72 | #endif |
73 | |||
69 | static inline int init_mips_clocksource(void) | 74 | static inline int init_mips_clocksource(void) |
70 | { | 75 | { |
76 | #ifdef CONFIG_CSRC_R4K | ||
77 | return init_r4k_clocksource(); | ||
78 | #else | ||
71 | return 0; | 79 | return 0; |
72 | } | ||
73 | #endif | 80 | #endif |
81 | } | ||
74 | 82 | ||
75 | extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock); | 83 | extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock); |
76 | extern void clockevent_set_clock(struct clock_event_device *cd, | 84 | extern void clockevent_set_clock(struct clock_event_device *cd, |
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index b1372c27f136..e96122159928 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile | |||
@@ -9,7 +9,7 @@ obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ | |||
9 | time.o topology.o traps.o unaligned.o watch.o | 9 | time.o topology.o traps.o unaligned.o watch.o |
10 | 10 | ||
11 | obj-$(CONFIG_CEVT_BCM1480) += cevt-bcm1480.o | 11 | obj-$(CONFIG_CEVT_BCM1480) += cevt-bcm1480.o |
12 | obj-$(CONFIG_CEVT_R4K) += cevt-r4k.o | 12 | obj-$(CONFIG_CEVT_R4K_LIB) += cevt-r4k.o |
13 | obj-$(CONFIG_MIPS_MT_SMTC) += cevt-smtc.o | 13 | obj-$(CONFIG_MIPS_MT_SMTC) += cevt-smtc.o |
14 | obj-$(CONFIG_CEVT_DS1287) += cevt-ds1287.o | 14 | obj-$(CONFIG_CEVT_DS1287) += cevt-ds1287.o |
15 | obj-$(CONFIG_CEVT_GT641XX) += cevt-gt641xx.o | 15 | obj-$(CONFIG_CEVT_GT641XX) += cevt-gt641xx.o |
@@ -17,7 +17,7 @@ obj-$(CONFIG_CEVT_SB1250) += cevt-sb1250.o | |||
17 | obj-$(CONFIG_CEVT_TXX9) += cevt-txx9.o | 17 | obj-$(CONFIG_CEVT_TXX9) += cevt-txx9.o |
18 | obj-$(CONFIG_CSRC_BCM1480) += csrc-bcm1480.o | 18 | obj-$(CONFIG_CSRC_BCM1480) += csrc-bcm1480.o |
19 | obj-$(CONFIG_CSRC_IOASIC) += csrc-ioasic.o | 19 | obj-$(CONFIG_CSRC_IOASIC) += csrc-ioasic.o |
20 | obj-$(CONFIG_CSRC_R4K) += csrc-r4k.o | 20 | obj-$(CONFIG_CSRC_R4K_LIB) += csrc-r4k.o |
21 | obj-$(CONFIG_CSRC_SB1250) += csrc-sb1250.o | 21 | obj-$(CONFIG_CSRC_SB1250) += csrc-sb1250.o |
22 | obj-$(CONFIG_SYNC_R4K) += sync-r4k.o | 22 | obj-$(CONFIG_SYNC_R4K) += sync-r4k.o |
23 | 23 | ||
@@ -43,6 +43,7 @@ obj-$(CONFIG_CPU_SB1) += r4k_fpu.o r4k_switch.o | |||
43 | obj-$(CONFIG_CPU_TX39XX) += r2300_fpu.o r2300_switch.o | 43 | obj-$(CONFIG_CPU_TX39XX) += r2300_fpu.o r2300_switch.o |
44 | obj-$(CONFIG_CPU_TX49XX) += r4k_fpu.o r4k_switch.o | 44 | obj-$(CONFIG_CPU_TX49XX) += r4k_fpu.o r4k_switch.o |
45 | obj-$(CONFIG_CPU_VR41XX) += r4k_fpu.o r4k_switch.o | 45 | obj-$(CONFIG_CPU_VR41XX) += r4k_fpu.o r4k_switch.o |
46 | obj-$(CONFIG_CPU_CAVIUM_OCTEON) += octeon_switch.o | ||
46 | 47 | ||
47 | obj-$(CONFIG_SMP) += smp.o | 48 | obj-$(CONFIG_SMP) += smp.o |
48 | obj-$(CONFIG_SMP_UP) += smp-up.o | 49 | obj-$(CONFIG_SMP_UP) += smp-up.o |
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index 72942226fcdd..c901c22d7ad0 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b/arch/mips/kernel/asm-offsets.c | |||
@@ -64,6 +64,10 @@ void output_ptreg_defines(void) | |||
64 | #ifdef CONFIG_MIPS_MT_SMTC | 64 | #ifdef CONFIG_MIPS_MT_SMTC |
65 | OFFSET(PT_TCSTATUS, pt_regs, cp0_tcstatus); | 65 | OFFSET(PT_TCSTATUS, pt_regs, cp0_tcstatus); |
66 | #endif /* CONFIG_MIPS_MT_SMTC */ | 66 | #endif /* CONFIG_MIPS_MT_SMTC */ |
67 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
68 | OFFSET(PT_MPL, pt_regs, mpl); | ||
69 | OFFSET(PT_MTP, pt_regs, mtp); | ||
70 | #endif /* CONFIG_CPU_CAVIUM_OCTEON */ | ||
67 | DEFINE(PT_SIZE, sizeof(struct pt_regs)); | 71 | DEFINE(PT_SIZE, sizeof(struct pt_regs)); |
68 | BLANK(); | 72 | BLANK(); |
69 | } | 73 | } |
@@ -295,3 +299,30 @@ void output_irq_cpustat_t_defines(void) | |||
295 | DEFINE(IC_IRQ_CPUSTAT_T, sizeof(irq_cpustat_t)); | 299 | DEFINE(IC_IRQ_CPUSTAT_T, sizeof(irq_cpustat_t)); |
296 | BLANK(); | 300 | BLANK(); |
297 | } | 301 | } |
302 | |||
303 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
304 | void output_octeon_cop2_state_defines(void) | ||
305 | { | ||
306 | COMMENT("Octeon specific octeon_cop2_state offsets."); | ||
307 | OFFSET(OCTEON_CP2_CRC_IV, octeon_cop2_state, cop2_crc_iv); | ||
308 | OFFSET(OCTEON_CP2_CRC_LENGTH, octeon_cop2_state, cop2_crc_length); | ||
309 | OFFSET(OCTEON_CP2_CRC_POLY, octeon_cop2_state, cop2_crc_poly); | ||
310 | OFFSET(OCTEON_CP2_LLM_DAT, octeon_cop2_state, cop2_llm_dat); | ||
311 | OFFSET(OCTEON_CP2_3DES_IV, octeon_cop2_state, cop2_3des_iv); | ||
312 | OFFSET(OCTEON_CP2_3DES_KEY, octeon_cop2_state, cop2_3des_key); | ||
313 | OFFSET(OCTEON_CP2_3DES_RESULT, octeon_cop2_state, cop2_3des_result); | ||
314 | OFFSET(OCTEON_CP2_AES_INP0, octeon_cop2_state, cop2_aes_inp0); | ||
315 | OFFSET(OCTEON_CP2_AES_IV, octeon_cop2_state, cop2_aes_iv); | ||
316 | OFFSET(OCTEON_CP2_AES_KEY, octeon_cop2_state, cop2_aes_key); | ||
317 | OFFSET(OCTEON_CP2_AES_KEYLEN, octeon_cop2_state, cop2_aes_keylen); | ||
318 | OFFSET(OCTEON_CP2_AES_RESULT, octeon_cop2_state, cop2_aes_result); | ||
319 | OFFSET(OCTEON_CP2_GFM_MULT, octeon_cop2_state, cop2_gfm_mult); | ||
320 | OFFSET(OCTEON_CP2_GFM_POLY, octeon_cop2_state, cop2_gfm_poly); | ||
321 | OFFSET(OCTEON_CP2_GFM_RESULT, octeon_cop2_state, cop2_gfm_result); | ||
322 | OFFSET(OCTEON_CP2_HSH_DATW, octeon_cop2_state, cop2_hsh_datw); | ||
323 | OFFSET(OCTEON_CP2_HSH_IVW, octeon_cop2_state, cop2_hsh_ivw); | ||
324 | OFFSET(THREAD_CP2, task_struct, thread.cp2); | ||
325 | OFFSET(THREAD_CVMSEG, task_struct, thread.cvmseg.cvmseg); | ||
326 | BLANK(); | ||
327 | } | ||
328 | #endif | ||
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c index 6b5df8bfab85..0176ed015c89 100644 --- a/arch/mips/kernel/branch.c +++ b/arch/mips/kernel/branch.c | |||
@@ -205,6 +205,39 @@ int __compute_return_epc(struct pt_regs *regs) | |||
205 | break; | 205 | break; |
206 | } | 206 | } |
207 | break; | 207 | break; |
208 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
209 | case lwc2_op: /* This is bbit0 on Octeon */ | ||
210 | if ((regs->regs[insn.i_format.rs] & (1ull<<insn.i_format.rt)) | ||
211 | == 0) | ||
212 | epc = epc + 4 + (insn.i_format.simmediate << 2); | ||
213 | else | ||
214 | epc += 8; | ||
215 | regs->cp0_epc = epc; | ||
216 | break; | ||
217 | case ldc2_op: /* This is bbit032 on Octeon */ | ||
218 | if ((regs->regs[insn.i_format.rs] & | ||
219 | (1ull<<(insn.i_format.rt+32))) == 0) | ||
220 | epc = epc + 4 + (insn.i_format.simmediate << 2); | ||
221 | else | ||
222 | epc += 8; | ||
223 | regs->cp0_epc = epc; | ||
224 | break; | ||
225 | case swc2_op: /* This is bbit1 on Octeon */ | ||
226 | if (regs->regs[insn.i_format.rs] & (1ull<<insn.i_format.rt)) | ||
227 | epc = epc + 4 + (insn.i_format.simmediate << 2); | ||
228 | else | ||
229 | epc += 8; | ||
230 | regs->cp0_epc = epc; | ||
231 | break; | ||
232 | case sdc2_op: /* This is bbit132 on Octeon */ | ||
233 | if (regs->regs[insn.i_format.rs] & | ||
234 | (1ull<<(insn.i_format.rt+32))) | ||
235 | epc = epc + 4 + (insn.i_format.simmediate << 2); | ||
236 | else | ||
237 | epc += 8; | ||
238 | regs->cp0_epc = epc; | ||
239 | break; | ||
240 | #endif | ||
208 | } | 241 | } |
209 | 242 | ||
210 | return 0; | 243 | return 0; |
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index e1ec83b68031..0015e442572b 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c | |||
@@ -160,7 +160,7 @@ int c0_compare_int_usable(void) | |||
160 | 160 | ||
161 | #ifndef CONFIG_MIPS_MT_SMTC | 161 | #ifndef CONFIG_MIPS_MT_SMTC |
162 | 162 | ||
163 | int __cpuinit mips_clockevent_init(void) | 163 | int __cpuinit r4k_clockevent_init(void) |
164 | { | 164 | { |
165 | uint64_t mips_freq = mips_hpt_frequency; | 165 | uint64_t mips_freq = mips_hpt_frequency; |
166 | unsigned int cpu = smp_processor_id(); | 166 | unsigned int cpu = smp_processor_id(); |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index c9207b5fd923..a7162a4484cf 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -96,6 +96,9 @@ int allow_au1k_wait; | |||
96 | 96 | ||
97 | static void au1k_wait(void) | 97 | static void au1k_wait(void) |
98 | { | 98 | { |
99 | if (!allow_au1k_wait) | ||
100 | return; | ||
101 | |||
99 | /* using the wait instruction makes CP0 counter unusable */ | 102 | /* using the wait instruction makes CP0 counter unusable */ |
100 | __asm__(" .set mips3 \n" | 103 | __asm__(" .set mips3 \n" |
101 | " cache 0x14, 0(%0) \n" | 104 | " cache 0x14, 0(%0) \n" |
@@ -154,6 +157,7 @@ void __init check_wait(void) | |||
154 | case CPU_25KF: | 157 | case CPU_25KF: |
155 | case CPU_PR4450: | 158 | case CPU_PR4450: |
156 | case CPU_BCM3302: | 159 | case CPU_BCM3302: |
160 | case CPU_CAVIUM_OCTEON: | ||
157 | cpu_wait = r4k_wait; | 161 | cpu_wait = r4k_wait; |
158 | break; | 162 | break; |
159 | 163 | ||
@@ -185,8 +189,7 @@ void __init check_wait(void) | |||
185 | case CPU_AU1200: | 189 | case CPU_AU1200: |
186 | case CPU_AU1210: | 190 | case CPU_AU1210: |
187 | case CPU_AU1250: | 191 | case CPU_AU1250: |
188 | if (allow_au1k_wait) | 192 | cpu_wait = au1k_wait; |
189 | cpu_wait = au1k_wait; | ||
190 | break; | 193 | break; |
191 | case CPU_20KC: | 194 | case CPU_20KC: |
192 | /* | 195 | /* |
@@ -875,6 +878,27 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) | |||
875 | } | 878 | } |
876 | } | 879 | } |
877 | 880 | ||
881 | static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu) | ||
882 | { | ||
883 | decode_configs(c); | ||
884 | switch (c->processor_id & 0xff00) { | ||
885 | case PRID_IMP_CAVIUM_CN38XX: | ||
886 | case PRID_IMP_CAVIUM_CN31XX: | ||
887 | case PRID_IMP_CAVIUM_CN30XX: | ||
888 | case PRID_IMP_CAVIUM_CN58XX: | ||
889 | case PRID_IMP_CAVIUM_CN56XX: | ||
890 | case PRID_IMP_CAVIUM_CN50XX: | ||
891 | case PRID_IMP_CAVIUM_CN52XX: | ||
892 | c->cputype = CPU_CAVIUM_OCTEON; | ||
893 | __cpu_name[cpu] = "Cavium Octeon"; | ||
894 | break; | ||
895 | default: | ||
896 | printk(KERN_INFO "Unknown Octeon chip!\n"); | ||
897 | c->cputype = CPU_UNKNOWN; | ||
898 | break; | ||
899 | } | ||
900 | } | ||
901 | |||
878 | const char *__cpu_name[NR_CPUS]; | 902 | const char *__cpu_name[NR_CPUS]; |
879 | 903 | ||
880 | __cpuinit void cpu_probe(void) | 904 | __cpuinit void cpu_probe(void) |
@@ -909,6 +933,9 @@ __cpuinit void cpu_probe(void) | |||
909 | case PRID_COMP_NXP: | 933 | case PRID_COMP_NXP: |
910 | cpu_probe_nxp(c, cpu); | 934 | cpu_probe_nxp(c, cpu); |
911 | break; | 935 | break; |
936 | case PRID_COMP_CAVIUM: | ||
937 | cpu_probe_cavium(c, cpu); | ||
938 | break; | ||
912 | } | 939 | } |
913 | 940 | ||
914 | BUG_ON(!__cpu_name[cpu]); | 941 | BUG_ON(!__cpu_name[cpu]); |
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c index 74fb74583b4e..f1a2893931ed 100644 --- a/arch/mips/kernel/csrc-r4k.c +++ b/arch/mips/kernel/csrc-r4k.c | |||
@@ -22,7 +22,7 @@ static struct clocksource clocksource_mips = { | |||
22 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 22 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
23 | }; | 23 | }; |
24 | 24 | ||
25 | int __init init_mips_clocksource(void) | 25 | int __init init_r4k_clocksource(void) |
26 | { | 26 | { |
27 | if (!cpu_has_counter || !mips_hpt_frequency) | 27 | if (!cpu_has_counter || !mips_hpt_frequency) |
28 | return -ENXIO; | 28 | return -ENXIO; |
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 757d48f0d80f..fb6f73148df2 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S | |||
@@ -385,10 +385,14 @@ NESTED(nmi_handler, PT_SIZE, sp) | |||
385 | .endm | 385 | .endm |
386 | 386 | ||
387 | .macro __build_clear_fpe | 387 | .macro __build_clear_fpe |
388 | .set push | ||
389 | /* gas fails to assemble cfc1 for some archs (octeon).*/ \ | ||
390 | .set mips1 | ||
388 | cfc1 a1, fcr31 | 391 | cfc1 a1, fcr31 |
389 | li a2, ~(0x3f << 12) | 392 | li a2, ~(0x3f << 12) |
390 | and a2, a1 | 393 | and a2, a1 |
391 | ctc1 a2, fcr31 | 394 | ctc1 a2, fcr31 |
395 | .set pop | ||
392 | TRACE_IRQS_ON | 396 | TRACE_IRQS_ON |
393 | STI | 397 | STI |
394 | .endm | 398 | .endm |
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index 4b4007b3083a..a0ff2b66e22b 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c | |||
@@ -111,6 +111,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
111 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); | 111 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); |
112 | #endif | 112 | #endif |
113 | seq_printf(p, " %14s", irq_desc[i].chip->name); | 113 | seq_printf(p, " %14s", irq_desc[i].chip->name); |
114 | seq_printf(p, "-%-8s", irq_desc[i].name); | ||
114 | seq_printf(p, " %s", action->name); | 115 | seq_printf(p, " %s", action->name); |
115 | 116 | ||
116 | for (action=action->next; action; action = action->next) | 117 | for (action=action->next; action; action = action->next) |
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S new file mode 100644 index 000000000000..d52389672b06 --- /dev/null +++ b/arch/mips/kernel/octeon_switch.S | |||
@@ -0,0 +1,506 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 1995, 1996, 1998, 1999, 2002, 2003 Ralf Baechle | ||
7 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | ||
8 | * Copyright (C) 1994, 1995, 1996, by Andreas Busse | ||
9 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
10 | * Copyright (C) 2000 MIPS Technologies, Inc. | ||
11 | * written by Carsten Langgaard, carstenl@mips.com | ||
12 | */ | ||
13 | #include <asm/asm.h> | ||
14 | #include <asm/cachectl.h> | ||
15 | #include <asm/fpregdef.h> | ||
16 | #include <asm/mipsregs.h> | ||
17 | #include <asm/asm-offsets.h> | ||
18 | #include <asm/page.h> | ||
19 | #include <asm/pgtable-bits.h> | ||
20 | #include <asm/regdef.h> | ||
21 | #include <asm/stackframe.h> | ||
22 | #include <asm/thread_info.h> | ||
23 | |||
24 | #include <asm/asmmacro.h> | ||
25 | |||
26 | /* | ||
27 | * Offset to the current process status flags, the first 32 bytes of the | ||
28 | * stack are not used. | ||
29 | */ | ||
30 | #define ST_OFF (_THREAD_SIZE - 32 - PT_SIZE + PT_STATUS) | ||
31 | |||
32 | /* | ||
33 | * task_struct *resume(task_struct *prev, task_struct *next, | ||
34 | * struct thread_info *next_ti) | ||
35 | */ | ||
36 | .align 7 | ||
37 | LEAF(resume) | ||
38 | .set arch=octeon | ||
39 | #ifndef CONFIG_CPU_HAS_LLSC | ||
40 | sw zero, ll_bit | ||
41 | #endif | ||
42 | mfc0 t1, CP0_STATUS | ||
43 | LONG_S t1, THREAD_STATUS(a0) | ||
44 | cpu_save_nonscratch a0 | ||
45 | LONG_S ra, THREAD_REG31(a0) | ||
46 | |||
47 | /* check if we need to save COP2 registers */ | ||
48 | PTR_L t2, TASK_THREAD_INFO(a0) | ||
49 | LONG_L t0, ST_OFF(t2) | ||
50 | bbit0 t0, 30, 1f | ||
51 | |||
52 | /* Disable COP2 in the stored process state */ | ||
53 | li t1, ST0_CU2 | ||
54 | xor t0, t1 | ||
55 | LONG_S t0, ST_OFF(t2) | ||
56 | |||
57 | /* Enable COP2 so we can save it */ | ||
58 | mfc0 t0, CP0_STATUS | ||
59 | or t0, t1 | ||
60 | mtc0 t0, CP0_STATUS | ||
61 | |||
62 | /* Save COP2 */ | ||
63 | daddu a0, THREAD_CP2 | ||
64 | jal octeon_cop2_save | ||
65 | dsubu a0, THREAD_CP2 | ||
66 | |||
67 | /* Disable COP2 now that we are done */ | ||
68 | mfc0 t0, CP0_STATUS | ||
69 | li t1, ST0_CU2 | ||
70 | xor t0, t1 | ||
71 | mtc0 t0, CP0_STATUS | ||
72 | |||
73 | 1: | ||
74 | #if CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0 | ||
75 | /* Check if we need to store CVMSEG state */ | ||
76 | mfc0 t0, $11,7 /* CvmMemCtl */ | ||
77 | bbit0 t0, 6, 3f /* Is user access enabled? */ | ||
78 | |||
79 | /* Store the CVMSEG state */ | ||
80 | /* Extract the size of CVMSEG */ | ||
81 | andi t0, 0x3f | ||
82 | /* Multiply * (cache line size/sizeof(long)/2) */ | ||
83 | sll t0, 7-LONGLOG-1 | ||
84 | li t1, -32768 /* Base address of CVMSEG */ | ||
85 | LONG_ADDI t2, a0, THREAD_CVMSEG /* Where to store CVMSEG to */ | ||
86 | synciobdma | ||
87 | 2: | ||
88 | .set noreorder | ||
89 | LONG_L t8, 0(t1) /* Load from CVMSEG */ | ||
90 | subu t0, 1 /* Decrement loop var */ | ||
91 | LONG_L t9, LONGSIZE(t1)/* Load from CVMSEG */ | ||
92 | LONG_ADDU t1, LONGSIZE*2 /* Increment loc in CVMSEG */ | ||
93 | LONG_S t8, 0(t2) /* Store CVMSEG to thread storage */ | ||
94 | LONG_ADDU t2, LONGSIZE*2 /* Increment loc in thread storage */ | ||
95 | bnez t0, 2b /* Loop until we've copied it all */ | ||
96 | LONG_S t9, -LONGSIZE(t2)/* Store CVMSEG to thread storage */ | ||
97 | .set reorder | ||
98 | |||
99 | /* Disable access to CVMSEG */ | ||
100 | mfc0 t0, $11,7 /* CvmMemCtl */ | ||
101 | xori t0, t0, 0x40 /* Bit 6 is CVMSEG user enable */ | ||
102 | mtc0 t0, $11,7 /* CvmMemCtl */ | ||
103 | #endif | ||
104 | 3: | ||
105 | /* | ||
106 | * The order of restoring the registers takes care of the race | ||
107 | * updating $28, $29 and kernelsp without disabling ints. | ||
108 | */ | ||
109 | move $28, a2 | ||
110 | cpu_restore_nonscratch a1 | ||
111 | |||
112 | #if (_THREAD_SIZE - 32) < 0x8000 | ||
113 | PTR_ADDIU t0, $28, _THREAD_SIZE - 32 | ||
114 | #else | ||
115 | PTR_LI t0, _THREAD_SIZE - 32 | ||
116 | PTR_ADDU t0, $28 | ||
117 | #endif | ||
118 | set_saved_sp t0, t1, t2 | ||
119 | |||
120 | mfc0 t1, CP0_STATUS /* Do we really need this? */ | ||
121 | li a3, 0xff01 | ||
122 | and t1, a3 | ||
123 | LONG_L a2, THREAD_STATUS(a1) | ||
124 | nor a3, $0, a3 | ||
125 | and a2, a3 | ||
126 | or a2, t1 | ||
127 | mtc0 a2, CP0_STATUS | ||
128 | move v0, a0 | ||
129 | jr ra | ||
130 | END(resume) | ||
131 | |||
132 | /* | ||
133 | * void octeon_cop2_save(struct octeon_cop2_state *a0) | ||
134 | */ | ||
135 | .align 7 | ||
136 | LEAF(octeon_cop2_save) | ||
137 | |||
138 | dmfc0 t9, $9,7 /* CvmCtl register. */ | ||
139 | |||
140 | /* Save the COP2 CRC state */ | ||
141 | dmfc2 t0, 0x0201 | ||
142 | dmfc2 t1, 0x0202 | ||
143 | dmfc2 t2, 0x0200 | ||
144 | sd t0, OCTEON_CP2_CRC_IV(a0) | ||
145 | sd t1, OCTEON_CP2_CRC_LENGTH(a0) | ||
146 | sd t2, OCTEON_CP2_CRC_POLY(a0) | ||
147 | /* Skip next instructions if CvmCtl[NODFA_CP2] set */ | ||
148 | bbit1 t9, 28, 1f | ||
149 | |||
150 | /* Save the LLM state */ | ||
151 | dmfc2 t0, 0x0402 | ||
152 | dmfc2 t1, 0x040A | ||
153 | sd t0, OCTEON_CP2_LLM_DAT(a0) | ||
154 | sd t1, OCTEON_CP2_LLM_DAT+8(a0) | ||
155 | |||
156 | 1: bbit1 t9, 26, 3f /* done if CvmCtl[NOCRYPTO] set */ | ||
157 | |||
158 | /* Save the COP2 crypto state */ | ||
159 | /* this part is mostly common to both pass 1 and later revisions */ | ||
160 | dmfc2 t0, 0x0084 | ||
161 | dmfc2 t1, 0x0080 | ||
162 | dmfc2 t2, 0x0081 | ||
163 | dmfc2 t3, 0x0082 | ||
164 | sd t0, OCTEON_CP2_3DES_IV(a0) | ||
165 | dmfc2 t0, 0x0088 | ||
166 | sd t1, OCTEON_CP2_3DES_KEY(a0) | ||
167 | dmfc2 t1, 0x0111 /* only necessary for pass 1 */ | ||
168 | sd t2, OCTEON_CP2_3DES_KEY+8(a0) | ||
169 | dmfc2 t2, 0x0102 | ||
170 | sd t3, OCTEON_CP2_3DES_KEY+16(a0) | ||
171 | dmfc2 t3, 0x0103 | ||
172 | sd t0, OCTEON_CP2_3DES_RESULT(a0) | ||
173 | dmfc2 t0, 0x0104 | ||
174 | sd t1, OCTEON_CP2_AES_INP0(a0) /* only necessary for pass 1 */ | ||
175 | dmfc2 t1, 0x0105 | ||
176 | sd t2, OCTEON_CP2_AES_IV(a0) | ||
177 | dmfc2 t2, 0x0106 | ||
178 | sd t3, OCTEON_CP2_AES_IV+8(a0) | ||
179 | dmfc2 t3, 0x0107 | ||
180 | sd t0, OCTEON_CP2_AES_KEY(a0) | ||
181 | dmfc2 t0, 0x0110 | ||
182 | sd t1, OCTEON_CP2_AES_KEY+8(a0) | ||
183 | dmfc2 t1, 0x0100 | ||
184 | sd t2, OCTEON_CP2_AES_KEY+16(a0) | ||
185 | dmfc2 t2, 0x0101 | ||
186 | sd t3, OCTEON_CP2_AES_KEY+24(a0) | ||
187 | mfc0 t3, $15,0 /* Get the processor ID register */ | ||
188 | sd t0, OCTEON_CP2_AES_KEYLEN(a0) | ||
189 | li t0, 0x000d0000 /* This is the processor ID of Octeon Pass1 */ | ||
190 | sd t1, OCTEON_CP2_AES_RESULT(a0) | ||
191 | sd t2, OCTEON_CP2_AES_RESULT+8(a0) | ||
192 | /* Skip to the Pass1 version of the remainder of the COP2 state */ | ||
193 | beq t3, t0, 2f | ||
194 | |||
195 | /* the non-pass1 state when !CvmCtl[NOCRYPTO] */ | ||
196 | dmfc2 t1, 0x0240 | ||
197 | dmfc2 t2, 0x0241 | ||
198 | dmfc2 t3, 0x0242 | ||
199 | dmfc2 t0, 0x0243 | ||
200 | sd t1, OCTEON_CP2_HSH_DATW(a0) | ||
201 | dmfc2 t1, 0x0244 | ||
202 | sd t2, OCTEON_CP2_HSH_DATW+8(a0) | ||
203 | dmfc2 t2, 0x0245 | ||
204 | sd t3, OCTEON_CP2_HSH_DATW+16(a0) | ||
205 | dmfc2 t3, 0x0246 | ||
206 | sd t0, OCTEON_CP2_HSH_DATW+24(a0) | ||
207 | dmfc2 t0, 0x0247 | ||
208 | sd t1, OCTEON_CP2_HSH_DATW+32(a0) | ||
209 | dmfc2 t1, 0x0248 | ||
210 | sd t2, OCTEON_CP2_HSH_DATW+40(a0) | ||
211 | dmfc2 t2, 0x0249 | ||
212 | sd t3, OCTEON_CP2_HSH_DATW+48(a0) | ||
213 | dmfc2 t3, 0x024A | ||
214 | sd t0, OCTEON_CP2_HSH_DATW+56(a0) | ||
215 | dmfc2 t0, 0x024B | ||
216 | sd t1, OCTEON_CP2_HSH_DATW+64(a0) | ||
217 | dmfc2 t1, 0x024C | ||
218 | sd t2, OCTEON_CP2_HSH_DATW+72(a0) | ||
219 | dmfc2 t2, 0x024D | ||
220 | sd t3, OCTEON_CP2_HSH_DATW+80(a0) | ||
221 | dmfc2 t3, 0x024E | ||
222 | sd t0, OCTEON_CP2_HSH_DATW+88(a0) | ||
223 | dmfc2 t0, 0x0250 | ||
224 | sd t1, OCTEON_CP2_HSH_DATW+96(a0) | ||
225 | dmfc2 t1, 0x0251 | ||
226 | sd t2, OCTEON_CP2_HSH_DATW+104(a0) | ||
227 | dmfc2 t2, 0x0252 | ||
228 | sd t3, OCTEON_CP2_HSH_DATW+112(a0) | ||
229 | dmfc2 t3, 0x0253 | ||
230 | sd t0, OCTEON_CP2_HSH_IVW(a0) | ||
231 | dmfc2 t0, 0x0254 | ||
232 | sd t1, OCTEON_CP2_HSH_IVW+8(a0) | ||
233 | dmfc2 t1, 0x0255 | ||
234 | sd t2, OCTEON_CP2_HSH_IVW+16(a0) | ||
235 | dmfc2 t2, 0x0256 | ||
236 | sd t3, OCTEON_CP2_HSH_IVW+24(a0) | ||
237 | dmfc2 t3, 0x0257 | ||
238 | sd t0, OCTEON_CP2_HSH_IVW+32(a0) | ||
239 | dmfc2 t0, 0x0258 | ||
240 | sd t1, OCTEON_CP2_HSH_IVW+40(a0) | ||
241 | dmfc2 t1, 0x0259 | ||
242 | sd t2, OCTEON_CP2_HSH_IVW+48(a0) | ||
243 | dmfc2 t2, 0x025E | ||
244 | sd t3, OCTEON_CP2_HSH_IVW+56(a0) | ||
245 | dmfc2 t3, 0x025A | ||
246 | sd t0, OCTEON_CP2_GFM_MULT(a0) | ||
247 | dmfc2 t0, 0x025B | ||
248 | sd t1, OCTEON_CP2_GFM_MULT+8(a0) | ||
249 | sd t2, OCTEON_CP2_GFM_POLY(a0) | ||
250 | sd t3, OCTEON_CP2_GFM_RESULT(a0) | ||
251 | sd t0, OCTEON_CP2_GFM_RESULT+8(a0) | ||
252 | jr ra | ||
253 | |||
254 | 2: /* pass 1 special stuff when !CvmCtl[NOCRYPTO] */ | ||
255 | dmfc2 t3, 0x0040 | ||
256 | dmfc2 t0, 0x0041 | ||
257 | dmfc2 t1, 0x0042 | ||
258 | dmfc2 t2, 0x0043 | ||
259 | sd t3, OCTEON_CP2_HSH_DATW(a0) | ||
260 | dmfc2 t3, 0x0044 | ||
261 | sd t0, OCTEON_CP2_HSH_DATW+8(a0) | ||
262 | dmfc2 t0, 0x0045 | ||
263 | sd t1, OCTEON_CP2_HSH_DATW+16(a0) | ||
264 | dmfc2 t1, 0x0046 | ||
265 | sd t2, OCTEON_CP2_HSH_DATW+24(a0) | ||
266 | dmfc2 t2, 0x0048 | ||
267 | sd t3, OCTEON_CP2_HSH_DATW+32(a0) | ||
268 | dmfc2 t3, 0x0049 | ||
269 | sd t0, OCTEON_CP2_HSH_DATW+40(a0) | ||
270 | dmfc2 t0, 0x004A | ||
271 | sd t1, OCTEON_CP2_HSH_DATW+48(a0) | ||
272 | sd t2, OCTEON_CP2_HSH_IVW(a0) | ||
273 | sd t3, OCTEON_CP2_HSH_IVW+8(a0) | ||
274 | sd t0, OCTEON_CP2_HSH_IVW+16(a0) | ||
275 | |||
276 | 3: /* pass 1 or CvmCtl[NOCRYPTO] set */ | ||
277 | jr ra | ||
278 | END(octeon_cop2_save) | ||
279 | |||
280 | /* | ||
281 | * void octeon_cop2_restore(struct octeon_cop2_state *a0) | ||
282 | */ | ||
283 | .align 7 | ||
284 | .set push | ||
285 | .set noreorder | ||
286 | LEAF(octeon_cop2_restore) | ||
287 | /* First cache line was prefetched before the call */ | ||
288 | pref 4, 128(a0) | ||
289 | dmfc0 t9, $9,7 /* CvmCtl register. */ | ||
290 | |||
291 | pref 4, 256(a0) | ||
292 | ld t0, OCTEON_CP2_CRC_IV(a0) | ||
293 | pref 4, 384(a0) | ||
294 | ld t1, OCTEON_CP2_CRC_LENGTH(a0) | ||
295 | ld t2, OCTEON_CP2_CRC_POLY(a0) | ||
296 | |||
297 | /* Restore the COP2 CRC state */ | ||
298 | dmtc2 t0, 0x0201 | ||
299 | dmtc2 t1, 0x1202 | ||
300 | bbit1 t9, 28, 2f /* Skip LLM if CvmCtl[NODFA_CP2] is set */ | ||
301 | dmtc2 t2, 0x4200 | ||
302 | |||
303 | /* Restore the LLM state */ | ||
304 | ld t0, OCTEON_CP2_LLM_DAT(a0) | ||
305 | ld t1, OCTEON_CP2_LLM_DAT+8(a0) | ||
306 | dmtc2 t0, 0x0402 | ||
307 | dmtc2 t1, 0x040A | ||
308 | |||
309 | 2: | ||
310 | bbit1 t9, 26, done_restore /* done if CvmCtl[NOCRYPTO] set */ | ||
311 | nop | ||
312 | |||
313 | /* Restore the COP2 crypto state common to pass 1 and pass 2 */ | ||
314 | ld t0, OCTEON_CP2_3DES_IV(a0) | ||
315 | ld t1, OCTEON_CP2_3DES_KEY(a0) | ||
316 | ld t2, OCTEON_CP2_3DES_KEY+8(a0) | ||
317 | dmtc2 t0, 0x0084 | ||
318 | ld t0, OCTEON_CP2_3DES_KEY+16(a0) | ||
319 | dmtc2 t1, 0x0080 | ||
320 | ld t1, OCTEON_CP2_3DES_RESULT(a0) | ||
321 | dmtc2 t2, 0x0081 | ||
322 | ld t2, OCTEON_CP2_AES_INP0(a0) /* only really needed for pass 1 */ | ||
323 | dmtc2 t0, 0x0082 | ||
324 | ld t0, OCTEON_CP2_AES_IV(a0) | ||
325 | dmtc2 t1, 0x0098 | ||
326 | ld t1, OCTEON_CP2_AES_IV+8(a0) | ||
327 | dmtc2 t2, 0x010A /* only really needed for pass 1 */ | ||
328 | ld t2, OCTEON_CP2_AES_KEY(a0) | ||
329 | dmtc2 t0, 0x0102 | ||
330 | ld t0, OCTEON_CP2_AES_KEY+8(a0) | ||
331 | dmtc2 t1, 0x0103 | ||
332 | ld t1, OCTEON_CP2_AES_KEY+16(a0) | ||
333 | dmtc2 t2, 0x0104 | ||
334 | ld t2, OCTEON_CP2_AES_KEY+24(a0) | ||
335 | dmtc2 t0, 0x0105 | ||
336 | ld t0, OCTEON_CP2_AES_KEYLEN(a0) | ||
337 | dmtc2 t1, 0x0106 | ||
338 | ld t1, OCTEON_CP2_AES_RESULT(a0) | ||
339 | dmtc2 t2, 0x0107 | ||
340 | ld t2, OCTEON_CP2_AES_RESULT+8(a0) | ||
341 | mfc0 t3, $15,0 /* Get the processor ID register */ | ||
342 | dmtc2 t0, 0x0110 | ||
343 | li t0, 0x000d0000 /* This is the processor ID of Octeon Pass1 */ | ||
344 | dmtc2 t1, 0x0100 | ||
345 | bne t0, t3, 3f /* Skip the next stuff for non-pass1 */ | ||
346 | dmtc2 t2, 0x0101 | ||
347 | |||
348 | /* this code is specific for pass 1 */ | ||
349 | ld t0, OCTEON_CP2_HSH_DATW(a0) | ||
350 | ld t1, OCTEON_CP2_HSH_DATW+8(a0) | ||
351 | ld t2, OCTEON_CP2_HSH_DATW+16(a0) | ||
352 | dmtc2 t0, 0x0040 | ||
353 | ld t0, OCTEON_CP2_HSH_DATW+24(a0) | ||
354 | dmtc2 t1, 0x0041 | ||
355 | ld t1, OCTEON_CP2_HSH_DATW+32(a0) | ||
356 | dmtc2 t2, 0x0042 | ||
357 | ld t2, OCTEON_CP2_HSH_DATW+40(a0) | ||
358 | dmtc2 t0, 0x0043 | ||
359 | ld t0, OCTEON_CP2_HSH_DATW+48(a0) | ||
360 | dmtc2 t1, 0x0044 | ||
361 | ld t1, OCTEON_CP2_HSH_IVW(a0) | ||
362 | dmtc2 t2, 0x0045 | ||
363 | ld t2, OCTEON_CP2_HSH_IVW+8(a0) | ||
364 | dmtc2 t0, 0x0046 | ||
365 | ld t0, OCTEON_CP2_HSH_IVW+16(a0) | ||
366 | dmtc2 t1, 0x0048 | ||
367 | dmtc2 t2, 0x0049 | ||
368 | b done_restore /* unconditional branch */ | ||
369 | dmtc2 t0, 0x004A | ||
370 | |||
371 | 3: /* this is post-pass1 code */ | ||
372 | ld t2, OCTEON_CP2_HSH_DATW(a0) | ||
373 | ld t0, OCTEON_CP2_HSH_DATW+8(a0) | ||
374 | ld t1, OCTEON_CP2_HSH_DATW+16(a0) | ||
375 | dmtc2 t2, 0x0240 | ||
376 | ld t2, OCTEON_CP2_HSH_DATW+24(a0) | ||
377 | dmtc2 t0, 0x0241 | ||
378 | ld t0, OCTEON_CP2_HSH_DATW+32(a0) | ||
379 | dmtc2 t1, 0x0242 | ||
380 | ld t1, OCTEON_CP2_HSH_DATW+40(a0) | ||
381 | dmtc2 t2, 0x0243 | ||
382 | ld t2, OCTEON_CP2_HSH_DATW+48(a0) | ||
383 | dmtc2 t0, 0x0244 | ||
384 | ld t0, OCTEON_CP2_HSH_DATW+56(a0) | ||
385 | dmtc2 t1, 0x0245 | ||
386 | ld t1, OCTEON_CP2_HSH_DATW+64(a0) | ||
387 | dmtc2 t2, 0x0246 | ||
388 | ld t2, OCTEON_CP2_HSH_DATW+72(a0) | ||
389 | dmtc2 t0, 0x0247 | ||
390 | ld t0, OCTEON_CP2_HSH_DATW+80(a0) | ||
391 | dmtc2 t1, 0x0248 | ||
392 | ld t1, OCTEON_CP2_HSH_DATW+88(a0) | ||
393 | dmtc2 t2, 0x0249 | ||
394 | ld t2, OCTEON_CP2_HSH_DATW+96(a0) | ||
395 | dmtc2 t0, 0x024A | ||
396 | ld t0, OCTEON_CP2_HSH_DATW+104(a0) | ||
397 | dmtc2 t1, 0x024B | ||
398 | ld t1, OCTEON_CP2_HSH_DATW+112(a0) | ||
399 | dmtc2 t2, 0x024C | ||
400 | ld t2, OCTEON_CP2_HSH_IVW(a0) | ||
401 | dmtc2 t0, 0x024D | ||
402 | ld t0, OCTEON_CP2_HSH_IVW+8(a0) | ||
403 | dmtc2 t1, 0x024E | ||
404 | ld t1, OCTEON_CP2_HSH_IVW+16(a0) | ||
405 | dmtc2 t2, 0x0250 | ||
406 | ld t2, OCTEON_CP2_HSH_IVW+24(a0) | ||
407 | dmtc2 t0, 0x0251 | ||
408 | ld t0, OCTEON_CP2_HSH_IVW+32(a0) | ||
409 | dmtc2 t1, 0x0252 | ||
410 | ld t1, OCTEON_CP2_HSH_IVW+40(a0) | ||
411 | dmtc2 t2, 0x0253 | ||
412 | ld t2, OCTEON_CP2_HSH_IVW+48(a0) | ||
413 | dmtc2 t0, 0x0254 | ||
414 | ld t0, OCTEON_CP2_HSH_IVW+56(a0) | ||
415 | dmtc2 t1, 0x0255 | ||
416 | ld t1, OCTEON_CP2_GFM_MULT(a0) | ||
417 | dmtc2 t2, 0x0256 | ||
418 | ld t2, OCTEON_CP2_GFM_MULT+8(a0) | ||
419 | dmtc2 t0, 0x0257 | ||
420 | ld t0, OCTEON_CP2_GFM_POLY(a0) | ||
421 | dmtc2 t1, 0x0258 | ||
422 | ld t1, OCTEON_CP2_GFM_RESULT(a0) | ||
423 | dmtc2 t2, 0x0259 | ||
424 | ld t2, OCTEON_CP2_GFM_RESULT+8(a0) | ||
425 | dmtc2 t0, 0x025E | ||
426 | dmtc2 t1, 0x025A | ||
427 | dmtc2 t2, 0x025B | ||
428 | |||
429 | done_restore: | ||
430 | jr ra | ||
431 | nop | ||
432 | END(octeon_cop2_restore) | ||
433 | .set pop | ||
434 | |||
435 | /* | ||
436 | * void octeon_mult_save() | ||
437 | * sp is assumed to point to a struct pt_regs | ||
438 | * | ||
439 | * NOTE: This is called in SAVE_SOME in stackframe.h. It can only | ||
440 | * safely modify k0 and k1. | ||
441 | */ | ||
442 | .align 7 | ||
443 | .set push | ||
444 | .set noreorder | ||
445 | LEAF(octeon_mult_save) | ||
446 | dmfc0 k0, $9,7 /* CvmCtl register. */ | ||
447 | bbit1 k0, 27, 1f /* Skip CvmCtl[NOMUL] */ | ||
448 | nop | ||
449 | |||
450 | /* Save the multiplier state */ | ||
451 | v3mulu k0, $0, $0 | ||
452 | v3mulu k1, $0, $0 | ||
453 | sd k0, PT_MTP(sp) /* PT_MTP has P0 */ | ||
454 | v3mulu k0, $0, $0 | ||
455 | sd k1, PT_MTP+8(sp) /* PT_MTP+8 has P1 */ | ||
456 | ori k1, $0, 1 | ||
457 | v3mulu k1, k1, $0 | ||
458 | sd k0, PT_MTP+16(sp) /* PT_MTP+16 has P2 */ | ||
459 | v3mulu k0, $0, $0 | ||
460 | sd k1, PT_MPL(sp) /* PT_MPL has MPL0 */ | ||
461 | v3mulu k1, $0, $0 | ||
462 | sd k0, PT_MPL+8(sp) /* PT_MPL+8 has MPL1 */ | ||
463 | jr ra | ||
464 | sd k1, PT_MPL+16(sp) /* PT_MPL+16 has MPL2 */ | ||
465 | |||
466 | 1: /* Resume here if CvmCtl[NOMUL] */ | ||
467 | jr ra | ||
468 | END(octeon_mult_save) | ||
469 | .set pop | ||
470 | |||
471 | /* | ||
472 | * void octeon_mult_restore() | ||
473 | * sp is assumed to point to a struct pt_regs | ||
474 | * | ||
475 | * NOTE: This is called in RESTORE_SOME in stackframe.h. | ||
476 | */ | ||
477 | .align 7 | ||
478 | .set push | ||
479 | .set noreorder | ||
480 | LEAF(octeon_mult_restore) | ||
481 | dmfc0 k1, $9,7 /* CvmCtl register. */ | ||
482 | ld v0, PT_MPL(sp) /* MPL0 */ | ||
483 | ld v1, PT_MPL+8(sp) /* MPL1 */ | ||
484 | ld k0, PT_MPL+16(sp) /* MPL2 */ | ||
485 | bbit1 k1, 27, 1f /* Skip CvmCtl[NOMUL] */ | ||
486 | /* Normally falls through, so no time wasted here */ | ||
487 | nop | ||
488 | |||
489 | /* Restore the multiplier state */ | ||
490 | ld k1, PT_MTP+16(sp) /* P2 */ | ||
491 | MTM0 v0 /* MPL0 */ | ||
492 | ld v0, PT_MTP+8(sp) /* P1 */ | ||
493 | MTM1 v1 /* MPL1 */ | ||
494 | ld v1, PT_MTP(sp) /* P0 */ | ||
495 | MTM2 k0 /* MPL2 */ | ||
496 | MTP2 k1 /* P2 */ | ||
497 | MTP1 v0 /* P1 */ | ||
498 | jr ra | ||
499 | MTP0 v1 /* P0 */ | ||
500 | |||
501 | 1: /* Resume here if CvmCtl[NOMUL] */ | ||
502 | jr ra | ||
503 | nop | ||
504 | END(octeon_mult_restore) | ||
505 | .set pop | ||
506 | |||
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c index 1ca34104e593..c4f9ac17474a 100644 --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c | |||
@@ -49,19 +49,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
49 | int ret; | 49 | int ret; |
50 | 50 | ||
51 | switch (request) { | 51 | switch (request) { |
52 | /* when I and D space are separate, these will need to be fixed. */ | ||
53 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | ||
54 | case PTRACE_PEEKDATA: { | ||
55 | unsigned int tmp; | ||
56 | int copied; | ||
57 | |||
58 | copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); | ||
59 | ret = -EIO; | ||
60 | if (copied != sizeof(tmp)) | ||
61 | break; | ||
62 | ret = put_user(tmp, (unsigned int __user *) (unsigned long) data); | ||
63 | break; | ||
64 | } | ||
65 | 52 | ||
66 | /* | 53 | /* |
67 | * Read 4 bytes of the other process' storage | 54 | * Read 4 bytes of the other process' storage |
@@ -208,16 +195,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
208 | break; | 195 | break; |
209 | } | 196 | } |
210 | 197 | ||
211 | /* when I and D space are separate, this will have to be fixed. */ | ||
212 | case PTRACE_POKETEXT: /* write the word at location addr. */ | ||
213 | case PTRACE_POKEDATA: | ||
214 | ret = 0; | ||
215 | if (access_process_vm(child, addr, &data, sizeof(data), 1) | ||
216 | == sizeof(data)) | ||
217 | break; | ||
218 | ret = -EIO; | ||
219 | break; | ||
220 | |||
221 | /* | 198 | /* |
222 | * Write 4 bytes into the other process' storage | 199 | * Write 4 bytes into the other process' storage |
223 | * data is the 4 bytes that the user wants written | 200 | * data is the 4 bytes that the user wants written |
@@ -332,50 +309,11 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
332 | ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data); | 309 | ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data); |
333 | break; | 310 | break; |
334 | 311 | ||
335 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | ||
336 | case PTRACE_CONT: { /* restart after signal. */ | ||
337 | ret = -EIO; | ||
338 | if (!valid_signal(data)) | ||
339 | break; | ||
340 | if (request == PTRACE_SYSCALL) { | ||
341 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
342 | } | ||
343 | else { | ||
344 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
345 | } | ||
346 | child->exit_code = data; | ||
347 | wake_up_process(child); | ||
348 | ret = 0; | ||
349 | break; | ||
350 | } | ||
351 | |||
352 | /* | ||
353 | * make the child exit. Best I can do is send it a sigkill. | ||
354 | * perhaps it should be put in the status that it wants to | ||
355 | * exit. | ||
356 | */ | ||
357 | case PTRACE_KILL: | ||
358 | ret = 0; | ||
359 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | ||
360 | break; | ||
361 | child->exit_code = SIGKILL; | ||
362 | wake_up_process(child); | ||
363 | break; | ||
364 | |||
365 | case PTRACE_GET_THREAD_AREA: | 312 | case PTRACE_GET_THREAD_AREA: |
366 | ret = put_user(task_thread_info(child)->tp_value, | 313 | ret = put_user(task_thread_info(child)->tp_value, |
367 | (unsigned int __user *) (unsigned long) data); | 314 | (unsigned int __user *) (unsigned long) data); |
368 | break; | 315 | break; |
369 | 316 | ||
370 | case PTRACE_DETACH: /* detach a process that was attached. */ | ||
371 | ret = ptrace_detach(child, data); | ||
372 | break; | ||
373 | |||
374 | case PTRACE_GETEVENTMSG: | ||
375 | ret = put_user(child->ptrace_message, | ||
376 | (unsigned int __user *) (unsigned long) data); | ||
377 | break; | ||
378 | |||
379 | case PTRACE_GET_THREAD_AREA_3264: | 317 | case PTRACE_GET_THREAD_AREA_3264: |
380 | ret = put_user(task_thread_info(child)->tp_value, | 318 | ret = put_user(task_thread_info(child)->tp_value, |
381 | (unsigned long __user *) (unsigned long) data); | 319 | (unsigned long __user *) (unsigned long) data); |
@@ -392,7 +330,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
392 | break; | 330 | break; |
393 | 331 | ||
394 | default: | 332 | default: |
395 | ret = ptrace_request(child, request, addr, data); | 333 | ret = compat_ptrace_request(child, request, addr, data); |
396 | break; | 334 | break; |
397 | } | 335 | } |
398 | out: | 336 | out: |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index d0916a55cd77..51d1ba415b90 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -398,7 +398,7 @@ einval: li v0, -ENOSYS | |||
398 | sys sys_uselib 1 | 398 | sys sys_uselib 1 |
399 | sys sys_swapon 2 | 399 | sys sys_swapon 2 |
400 | sys sys_reboot 3 | 400 | sys sys_reboot 3 |
401 | sys old_readdir 3 | 401 | sys sys_old_readdir 3 |
402 | sys old_mmap 6 /* 4090 */ | 402 | sys old_mmap 6 /* 4090 */ |
403 | sys sys_munmap 2 | 403 | sys sys_munmap 2 |
404 | sys sys_truncate 2 | 404 | sys sys_truncate 2 |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 353056110f2b..f6083c6bfaa4 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <asm/mmu_context.h> | 47 | #include <asm/mmu_context.h> |
48 | #include <asm/types.h> | 48 | #include <asm/types.h> |
49 | #include <asm/stacktrace.h> | 49 | #include <asm/stacktrace.h> |
50 | #include <asm/irq.h> | ||
50 | 51 | ||
51 | extern void check_wait(void); | 52 | extern void check_wait(void); |
52 | extern asmlinkage void r4k_wait(void); | 53 | extern asmlinkage void r4k_wait(void); |
@@ -78,6 +79,10 @@ extern asmlinkage void handle_reserved(void); | |||
78 | extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, | 79 | extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, |
79 | struct mips_fpu_struct *ctx, int has_fpu); | 80 | struct mips_fpu_struct *ctx, int has_fpu); |
80 | 81 | ||
82 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
83 | extern asmlinkage void octeon_cop2_restore(struct octeon_cop2_state *task); | ||
84 | #endif | ||
85 | |||
81 | void (*board_be_init)(void); | 86 | void (*board_be_init)(void); |
82 | int (*board_be_handler)(struct pt_regs *regs, int is_fixup); | 87 | int (*board_be_handler)(struct pt_regs *regs, int is_fixup); |
83 | void (*board_nmi_handler_setup)(void); | 88 | void (*board_nmi_handler_setup)(void); |
@@ -860,6 +865,7 @@ asmlinkage void do_cpu(struct pt_regs *regs) | |||
860 | unsigned int opcode; | 865 | unsigned int opcode; |
861 | unsigned int cpid; | 866 | unsigned int cpid; |
862 | int status; | 867 | int status; |
868 | unsigned long __maybe_unused flags; | ||
863 | 869 | ||
864 | die_if_kernel("do_cpu invoked from kernel context!", regs); | 870 | die_if_kernel("do_cpu invoked from kernel context!", regs); |
865 | 871 | ||
@@ -915,6 +921,17 @@ asmlinkage void do_cpu(struct pt_regs *regs) | |||
915 | return; | 921 | return; |
916 | 922 | ||
917 | case 2: | 923 | case 2: |
924 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
925 | prefetch(¤t->thread.cp2); | ||
926 | local_irq_save(flags); | ||
927 | KSTK_STATUS(current) |= ST0_CU2; | ||
928 | status = read_c0_status(); | ||
929 | write_c0_status(status | ST0_CU2); | ||
930 | octeon_cop2_restore(&(current->thread.cp2)); | ||
931 | write_c0_status(status & ~ST0_CU2); | ||
932 | local_irq_restore(flags); | ||
933 | return; | ||
934 | #endif | ||
918 | case 3: | 935 | case 3: |
919 | break; | 936 | break; |
920 | } | 937 | } |
@@ -1488,6 +1505,10 @@ void __cpuinit per_cpu_trap_init(void) | |||
1488 | write_c0_hwrena(enable); | 1505 | write_c0_hwrena(enable); |
1489 | } | 1506 | } |
1490 | 1507 | ||
1508 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
1509 | write_c0_hwrena(0xc000000f); /* Octeon has register 30 and 31 */ | ||
1510 | #endif | ||
1511 | |||
1491 | #ifdef CONFIG_MIPS_MT_SMTC | 1512 | #ifdef CONFIG_MIPS_MT_SMTC |
1492 | if (!secondaryTC) { | 1513 | if (!secondaryTC) { |
1493 | #endif /* CONFIG_MIPS_MT_SMTC */ | 1514 | #endif /* CONFIG_MIPS_MT_SMTC */ |
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index dbcf6511b74e..c13c7ad2cdae 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile | |||
@@ -27,6 +27,7 @@ obj-$(CONFIG_CPU_SB1) += dump_tlb.o | |||
27 | obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o | 27 | obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o |
28 | obj-$(CONFIG_CPU_TX49XX) += dump_tlb.o | 28 | obj-$(CONFIG_CPU_TX49XX) += dump_tlb.o |
29 | obj-$(CONFIG_CPU_VR41XX) += dump_tlb.o | 29 | obj-$(CONFIG_CPU_VR41XX) += dump_tlb.o |
30 | obj-$(CONFIG_CPU_CAVIUM_OCTEON) += dump_tlb.o | ||
30 | 31 | ||
31 | # libgcc-style stuff needed in the kernel | 32 | # libgcc-style stuff needed in the kernel |
32 | obj-y += ashldi3.o ashrdi3.o cmpdi2.o lshrdi3.o ucmpdi2.o | 33 | obj-y += ashldi3.o ashrdi3.o cmpdi2.o lshrdi3.o ucmpdi2.o |
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile index 95ba32b5b720..d7ec95522292 100644 --- a/arch/mips/mm/Makefile +++ b/arch/mips/mm/Makefile | |||
@@ -27,6 +27,7 @@ obj-$(CONFIG_CPU_SB1) += c-r4k.o cerr-sb1.o cex-sb1.o tlb-r4k.o | |||
27 | obj-$(CONFIG_CPU_TX39XX) += c-tx39.o tlb-r3k.o | 27 | obj-$(CONFIG_CPU_TX39XX) += c-tx39.o tlb-r3k.o |
28 | obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o tlb-r4k.o | 28 | obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o tlb-r4k.o |
29 | obj-$(CONFIG_CPU_VR41XX) += c-r4k.o cex-gen.o tlb-r4k.o | 29 | obj-$(CONFIG_CPU_VR41XX) += c-r4k.o cex-gen.o tlb-r4k.o |
30 | obj-$(CONFIG_CPU_CAVIUM_OCTEON) += c-octeon.o cex-oct.o tlb-r4k.o | ||
30 | 31 | ||
31 | obj-$(CONFIG_IP22_CPU_SCACHE) += sc-ip22.o | 32 | obj-$(CONFIG_IP22_CPU_SCACHE) += sc-ip22.o |
32 | obj-$(CONFIG_R5000_CPU_SCACHE) += sc-r5k.o | 33 | obj-$(CONFIG_R5000_CPU_SCACHE) += sc-r5k.o |
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c new file mode 100644 index 000000000000..44d01a0a8490 --- /dev/null +++ b/arch/mips/mm/c-octeon.c | |||
@@ -0,0 +1,307 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005-2007 Cavium Networks | ||
7 | */ | ||
8 | #include <linux/init.h> | ||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/sched.h> | ||
11 | #include <linux/mm.h> | ||
12 | #include <linux/bitops.h> | ||
13 | #include <linux/cpu.h> | ||
14 | #include <linux/io.h> | ||
15 | |||
16 | #include <asm/bcache.h> | ||
17 | #include <asm/bootinfo.h> | ||
18 | #include <asm/cacheops.h> | ||
19 | #include <asm/cpu-features.h> | ||
20 | #include <asm/page.h> | ||
21 | #include <asm/pgtable.h> | ||
22 | #include <asm/r4kcache.h> | ||
23 | #include <asm/system.h> | ||
24 | #include <asm/mmu_context.h> | ||
25 | #include <asm/war.h> | ||
26 | |||
27 | #include <asm/octeon/octeon.h> | ||
28 | |||
29 | unsigned long long cache_err_dcache[NR_CPUS]; | ||
30 | |||
31 | /** | ||
32 | * Octeon automatically flushes the dcache on tlb changes, so | ||
33 | * from Linux's viewpoint it acts much like a physically | ||
34 | * tagged cache. No flushing is needed | ||
35 | * | ||
36 | */ | ||
37 | static void octeon_flush_data_cache_page(unsigned long addr) | ||
38 | { | ||
39 | /* Nothing to do */ | ||
40 | } | ||
41 | |||
42 | static inline void octeon_local_flush_icache(void) | ||
43 | { | ||
44 | asm volatile ("synci 0($0)"); | ||
45 | } | ||
46 | |||
47 | /* | ||
48 | * Flush local I-cache for the specified range. | ||
49 | */ | ||
50 | static void local_octeon_flush_icache_range(unsigned long start, | ||
51 | unsigned long end) | ||
52 | { | ||
53 | octeon_local_flush_icache(); | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * Flush caches as necessary for all cores affected by a | ||
58 | * vma. If no vma is supplied, all cores are flushed. | ||
59 | * | ||
60 | * @vma: VMA to flush or NULL to flush all icaches. | ||
61 | */ | ||
62 | static void octeon_flush_icache_all_cores(struct vm_area_struct *vma) | ||
63 | { | ||
64 | extern void octeon_send_ipi_single(int cpu, unsigned int action); | ||
65 | #ifdef CONFIG_SMP | ||
66 | int cpu; | ||
67 | cpumask_t mask; | ||
68 | #endif | ||
69 | |||
70 | mb(); | ||
71 | octeon_local_flush_icache(); | ||
72 | #ifdef CONFIG_SMP | ||
73 | preempt_disable(); | ||
74 | cpu = smp_processor_id(); | ||
75 | |||
76 | /* | ||
77 | * If we have a vma structure, we only need to worry about | ||
78 | * cores it has been used on | ||
79 | */ | ||
80 | if (vma) | ||
81 | mask = vma->vm_mm->cpu_vm_mask; | ||
82 | else | ||
83 | mask = cpu_online_map; | ||
84 | cpu_clear(cpu, mask); | ||
85 | for_each_cpu_mask(cpu, mask) | ||
86 | octeon_send_ipi_single(cpu, SMP_ICACHE_FLUSH); | ||
87 | |||
88 | preempt_enable(); | ||
89 | #endif | ||
90 | } | ||
91 | |||
92 | |||
93 | /** | ||
94 | * Called to flush the icache on all cores | ||
95 | */ | ||
96 | static void octeon_flush_icache_all(void) | ||
97 | { | ||
98 | octeon_flush_icache_all_cores(NULL); | ||
99 | } | ||
100 | |||
101 | |||
102 | /** | ||
103 | * Called to flush all memory associated with a memory | ||
104 | * context. | ||
105 | * | ||
106 | * @mm: Memory context to flush | ||
107 | */ | ||
108 | static void octeon_flush_cache_mm(struct mm_struct *mm) | ||
109 | { | ||
110 | /* | ||
111 | * According to the R4K version of this file, CPUs without | ||
112 | * dcache aliases don't need to do anything here | ||
113 | */ | ||
114 | } | ||
115 | |||
116 | |||
117 | /** | ||
118 | * Flush a range of kernel addresses out of the icache | ||
119 | * | ||
120 | */ | ||
121 | static void octeon_flush_icache_range(unsigned long start, unsigned long end) | ||
122 | { | ||
123 | octeon_flush_icache_all_cores(NULL); | ||
124 | } | ||
125 | |||
126 | |||
127 | /** | ||
128 | * Flush the icache for a trampoline. These are used for interrupt | ||
129 | * and exception hooking. | ||
130 | * | ||
131 | * @addr: Address to flush | ||
132 | */ | ||
133 | static void octeon_flush_cache_sigtramp(unsigned long addr) | ||
134 | { | ||
135 | struct vm_area_struct *vma; | ||
136 | |||
137 | vma = find_vma(current->mm, addr); | ||
138 | octeon_flush_icache_all_cores(vma); | ||
139 | } | ||
140 | |||
141 | |||
142 | /** | ||
143 | * Flush a range out of a vma | ||
144 | * | ||
145 | * @vma: VMA to flush | ||
146 | * @start: | ||
147 | * @end: | ||
148 | */ | ||
149 | static void octeon_flush_cache_range(struct vm_area_struct *vma, | ||
150 | unsigned long start, unsigned long end) | ||
151 | { | ||
152 | if (vma->vm_flags & VM_EXEC) | ||
153 | octeon_flush_icache_all_cores(vma); | ||
154 | } | ||
155 | |||
156 | |||
157 | /** | ||
158 | * Flush a specific page of a vma | ||
159 | * | ||
160 | * @vma: VMA to flush page for | ||
161 | * @page: Page to flush | ||
162 | * @pfn: | ||
163 | */ | ||
164 | static void octeon_flush_cache_page(struct vm_area_struct *vma, | ||
165 | unsigned long page, unsigned long pfn) | ||
166 | { | ||
167 | if (vma->vm_flags & VM_EXEC) | ||
168 | octeon_flush_icache_all_cores(vma); | ||
169 | } | ||
170 | |||
171 | |||
172 | /** | ||
173 | * Probe Octeon's caches | ||
174 | * | ||
175 | */ | ||
176 | static void __devinit probe_octeon(void) | ||
177 | { | ||
178 | unsigned long icache_size; | ||
179 | unsigned long dcache_size; | ||
180 | unsigned int config1; | ||
181 | struct cpuinfo_mips *c = ¤t_cpu_data; | ||
182 | |||
183 | switch (c->cputype) { | ||
184 | case CPU_CAVIUM_OCTEON: | ||
185 | config1 = read_c0_config1(); | ||
186 | c->icache.linesz = 2 << ((config1 >> 19) & 7); | ||
187 | c->icache.sets = 64 << ((config1 >> 22) & 7); | ||
188 | c->icache.ways = 1 + ((config1 >> 16) & 7); | ||
189 | c->icache.flags |= MIPS_CACHE_VTAG; | ||
190 | icache_size = | ||
191 | c->icache.sets * c->icache.ways * c->icache.linesz; | ||
192 | c->icache.waybit = ffs(icache_size / c->icache.ways) - 1; | ||
193 | c->dcache.linesz = 128; | ||
194 | if (OCTEON_IS_MODEL(OCTEON_CN3XXX)) | ||
195 | c->dcache.sets = 1; /* CN3XXX has one Dcache set */ | ||
196 | else | ||
197 | c->dcache.sets = 2; /* CN5XXX has two Dcache sets */ | ||
198 | c->dcache.ways = 64; | ||
199 | dcache_size = | ||
200 | c->dcache.sets * c->dcache.ways * c->dcache.linesz; | ||
201 | c->dcache.waybit = ffs(dcache_size / c->dcache.ways) - 1; | ||
202 | c->options |= MIPS_CPU_PREFETCH; | ||
203 | break; | ||
204 | |||
205 | default: | ||
206 | panic("Unsupported Cavium Networks CPU type\n"); | ||
207 | break; | ||
208 | } | ||
209 | |||
210 | /* compute a couple of other cache variables */ | ||
211 | c->icache.waysize = icache_size / c->icache.ways; | ||
212 | c->dcache.waysize = dcache_size / c->dcache.ways; | ||
213 | |||
214 | c->icache.sets = icache_size / (c->icache.linesz * c->icache.ways); | ||
215 | c->dcache.sets = dcache_size / (c->dcache.linesz * c->dcache.ways); | ||
216 | |||
217 | if (smp_processor_id() == 0) { | ||
218 | pr_notice("Primary instruction cache %ldkB, %s, %d way, " | ||
219 | "%d sets, linesize %d bytes.\n", | ||
220 | icache_size >> 10, | ||
221 | cpu_has_vtag_icache ? | ||
222 | "virtually tagged" : "physically tagged", | ||
223 | c->icache.ways, c->icache.sets, c->icache.linesz); | ||
224 | |||
225 | pr_notice("Primary data cache %ldkB, %d-way, %d sets, " | ||
226 | "linesize %d bytes.\n", | ||
227 | dcache_size >> 10, c->dcache.ways, | ||
228 | c->dcache.sets, c->dcache.linesz); | ||
229 | } | ||
230 | } | ||
231 | |||
232 | |||
233 | /** | ||
234 | * Setup the Octeon cache flush routines | ||
235 | * | ||
236 | */ | ||
237 | void __devinit octeon_cache_init(void) | ||
238 | { | ||
239 | extern unsigned long ebase; | ||
240 | extern char except_vec2_octeon; | ||
241 | |||
242 | memcpy((void *)(ebase + 0x100), &except_vec2_octeon, 0x80); | ||
243 | octeon_flush_cache_sigtramp(ebase + 0x100); | ||
244 | |||
245 | probe_octeon(); | ||
246 | |||
247 | shm_align_mask = PAGE_SIZE - 1; | ||
248 | |||
249 | flush_cache_all = octeon_flush_icache_all; | ||
250 | __flush_cache_all = octeon_flush_icache_all; | ||
251 | flush_cache_mm = octeon_flush_cache_mm; | ||
252 | flush_cache_page = octeon_flush_cache_page; | ||
253 | flush_cache_range = octeon_flush_cache_range; | ||
254 | flush_cache_sigtramp = octeon_flush_cache_sigtramp; | ||
255 | flush_icache_all = octeon_flush_icache_all; | ||
256 | flush_data_cache_page = octeon_flush_data_cache_page; | ||
257 | flush_icache_range = octeon_flush_icache_range; | ||
258 | local_flush_icache_range = local_octeon_flush_icache_range; | ||
259 | |||
260 | build_clear_page(); | ||
261 | build_copy_page(); | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * Handle a cache error exception | ||
266 | */ | ||
267 | |||
268 | static void cache_parity_error_octeon(int non_recoverable) | ||
269 | { | ||
270 | unsigned long coreid = cvmx_get_core_num(); | ||
271 | uint64_t icache_err = read_octeon_c0_icacheerr(); | ||
272 | |||
273 | pr_err("Cache error exception:\n"); | ||
274 | pr_err("cp0_errorepc == %lx\n", read_c0_errorepc()); | ||
275 | if (icache_err & 1) { | ||
276 | pr_err("CacheErr (Icache) == %llx\n", | ||
277 | (unsigned long long)icache_err); | ||
278 | write_octeon_c0_icacheerr(0); | ||
279 | } | ||
280 | if (cache_err_dcache[coreid] & 1) { | ||
281 | pr_err("CacheErr (Dcache) == %llx\n", | ||
282 | (unsigned long long)cache_err_dcache[coreid]); | ||
283 | cache_err_dcache[coreid] = 0; | ||
284 | } | ||
285 | |||
286 | if (non_recoverable) | ||
287 | panic("Can't handle cache error: nested exception"); | ||
288 | } | ||
289 | |||
290 | /** | ||
291 | * Called when the the exception is not recoverable | ||
292 | */ | ||
293 | |||
294 | asmlinkage void cache_parity_error_octeon_recoverable(void) | ||
295 | { | ||
296 | cache_parity_error_octeon(0); | ||
297 | } | ||
298 | |||
299 | /** | ||
300 | * Called when the the exception is recoverable | ||
301 | */ | ||
302 | |||
303 | asmlinkage void cache_parity_error_octeon_non_recoverable(void) | ||
304 | { | ||
305 | cache_parity_error_octeon(1); | ||
306 | } | ||
307 | |||
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 1eb7c71e3d6a..98ad0a82c29e 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c | |||
@@ -182,6 +182,12 @@ void __devinit cpu_cache_init(void) | |||
182 | tx39_cache_init(); | 182 | tx39_cache_init(); |
183 | } | 183 | } |
184 | 184 | ||
185 | if (cpu_has_octeon_cache) { | ||
186 | extern void __weak octeon_cache_init(void); | ||
187 | |||
188 | octeon_cache_init(); | ||
189 | } | ||
190 | |||
185 | setup_protection_map(); | 191 | setup_protection_map(); |
186 | } | 192 | } |
187 | 193 | ||
diff --git a/arch/mips/mm/cex-oct.S b/arch/mips/mm/cex-oct.S new file mode 100644 index 000000000000..3db8553fcd34 --- /dev/null +++ b/arch/mips/mm/cex-oct.S | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 Cavium Networks | ||
7 | * Cache error handler | ||
8 | */ | ||
9 | |||
10 | #include <asm/asm.h> | ||
11 | #include <asm/regdef.h> | ||
12 | #include <asm/mipsregs.h> | ||
13 | #include <asm/stackframe.h> | ||
14 | |||
15 | /* | ||
16 | * Handle cache error. Indicate to the second level handler whether | ||
17 | * the exception is recoverable. | ||
18 | */ | ||
19 | LEAF(except_vec2_octeon) | ||
20 | |||
21 | .set push | ||
22 | .set mips64r2 | ||
23 | .set noreorder | ||
24 | .set noat | ||
25 | |||
26 | |||
27 | /* due to an errata we need to read the COP0 CacheErr (Dcache) | ||
28 | * before any cache/DRAM access */ | ||
29 | |||
30 | rdhwr k0, $0 /* get core_id */ | ||
31 | PTR_LA k1, cache_err_dcache | ||
32 | sll k0, k0, 3 | ||
33 | PTR_ADDU k1, k0, k1 /* k1 = &cache_err_dcache[core_id] */ | ||
34 | |||
35 | dmfc0 k0, CP0_CACHEERR, 1 | ||
36 | sd k0, (k1) | ||
37 | dmtc0 $0, CP0_CACHEERR, 1 | ||
38 | |||
39 | /* check whether this is a nested exception */ | ||
40 | mfc0 k1, CP0_STATUS | ||
41 | andi k1, k1, ST0_EXL | ||
42 | beqz k1, 1f | ||
43 | nop | ||
44 | j cache_parity_error_octeon_non_recoverable | ||
45 | nop | ||
46 | |||
47 | /* exception is recoverable */ | ||
48 | 1: j handle_cache_err | ||
49 | nop | ||
50 | |||
51 | .set pop | ||
52 | END(except_vec2_octeon) | ||
53 | |||
54 | /* We need to jump to handle_cache_err so that the previous handler | ||
55 | * can fit within 0x80 bytes. We also move from 0xFFFFFFFFAXXXXXXX | ||
56 | * space (uncached) to the 0xFFFFFFFF8XXXXXXX space (cached). */ | ||
57 | LEAF(handle_cache_err) | ||
58 | .set push | ||
59 | .set noreorder | ||
60 | .set noat | ||
61 | |||
62 | SAVE_ALL | ||
63 | KMODE | ||
64 | jal cache_parity_error_octeon_recoverable | ||
65 | nop | ||
66 | j ret_from_exception | ||
67 | nop | ||
68 | |||
69 | .set pop | ||
70 | END(handle_cache_err) | ||
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index e6708b3ad343..546e6977d4ff 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c | |||
@@ -111,7 +111,7 @@ EXPORT_SYMBOL(dma_alloc_coherent); | |||
111 | void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, | 111 | void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, |
112 | dma_addr_t dma_handle) | 112 | dma_addr_t dma_handle) |
113 | { | 113 | { |
114 | plat_unmap_dma_mem(dma_handle); | 114 | plat_unmap_dma_mem(dev, dma_handle); |
115 | free_pages((unsigned long) vaddr, get_order(size)); | 115 | free_pages((unsigned long) vaddr, get_order(size)); |
116 | } | 116 | } |
117 | 117 | ||
@@ -122,7 +122,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | |||
122 | { | 122 | { |
123 | unsigned long addr = (unsigned long) vaddr; | 123 | unsigned long addr = (unsigned long) vaddr; |
124 | 124 | ||
125 | plat_unmap_dma_mem(dma_handle); | 125 | plat_unmap_dma_mem(dev, dma_handle); |
126 | 126 | ||
127 | if (!plat_device_is_coherent(dev)) | 127 | if (!plat_device_is_coherent(dev)) |
128 | addr = CAC_ADDR(addr); | 128 | addr = CAC_ADDR(addr); |
@@ -173,7 +173,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
173 | __dma_sync(dma_addr_to_virt(dma_addr), size, | 173 | __dma_sync(dma_addr_to_virt(dma_addr), size, |
174 | direction); | 174 | direction); |
175 | 175 | ||
176 | plat_unmap_dma_mem(dma_addr); | 176 | plat_unmap_dma_mem(dev, dma_addr); |
177 | } | 177 | } |
178 | 178 | ||
179 | EXPORT_SYMBOL(dma_unmap_single); | 179 | EXPORT_SYMBOL(dma_unmap_single); |
@@ -229,7 +229,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, | |||
229 | dma_cache_wback_inv(addr, size); | 229 | dma_cache_wback_inv(addr, size); |
230 | } | 230 | } |
231 | 231 | ||
232 | plat_unmap_dma_mem(dma_address); | 232 | plat_unmap_dma_mem(dev, dma_address); |
233 | } | 233 | } |
234 | 234 | ||
235 | EXPORT_SYMBOL(dma_unmap_page); | 235 | EXPORT_SYMBOL(dma_unmap_page); |
@@ -249,7 +249,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, | |||
249 | if (addr) | 249 | if (addr) |
250 | __dma_sync(addr, sg->length, direction); | 250 | __dma_sync(addr, sg->length, direction); |
251 | } | 251 | } |
252 | plat_unmap_dma_mem(sg->dma_address); | 252 | plat_unmap_dma_mem(dev, sg->dma_address); |
253 | } | 253 | } |
254 | } | 254 | } |
255 | 255 | ||
@@ -275,6 +275,7 @@ void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, | |||
275 | { | 275 | { |
276 | BUG_ON(direction == DMA_NONE); | 276 | BUG_ON(direction == DMA_NONE); |
277 | 277 | ||
278 | plat_extra_sync_for_device(dev); | ||
278 | if (!plat_device_is_coherent(dev)) { | 279 | if (!plat_device_is_coherent(dev)) { |
279 | unsigned long addr; | 280 | unsigned long addr; |
280 | 281 | ||
@@ -305,6 +306,7 @@ void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, | |||
305 | { | 306 | { |
306 | BUG_ON(direction == DMA_NONE); | 307 | BUG_ON(direction == DMA_NONE); |
307 | 308 | ||
309 | plat_extra_sync_for_device(dev); | ||
308 | if (!plat_device_is_coherent(dev)) { | 310 | if (!plat_device_is_coherent(dev)) { |
309 | unsigned long addr; | 311 | unsigned long addr; |
310 | 312 | ||
@@ -351,22 +353,14 @@ EXPORT_SYMBOL(dma_sync_sg_for_device); | |||
351 | 353 | ||
352 | int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 354 | int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
353 | { | 355 | { |
354 | return 0; | 356 | return plat_dma_mapping_error(dev, dma_addr); |
355 | } | 357 | } |
356 | 358 | ||
357 | EXPORT_SYMBOL(dma_mapping_error); | 359 | EXPORT_SYMBOL(dma_mapping_error); |
358 | 360 | ||
359 | int dma_supported(struct device *dev, u64 mask) | 361 | int dma_supported(struct device *dev, u64 mask) |
360 | { | 362 | { |
361 | /* | 363 | return plat_dma_supported(dev, mask); |
362 | * we fall back to GFP_DMA when the mask isn't all 1s, | ||
363 | * so we can't guarantee allocations that must be | ||
364 | * within a tighter range than GFP_DMA.. | ||
365 | */ | ||
366 | if (mask < DMA_BIT_MASK(24)) | ||
367 | return 0; | ||
368 | |||
369 | return 1; | ||
370 | } | 364 | } |
371 | 365 | ||
372 | EXPORT_SYMBOL(dma_supported); | 366 | EXPORT_SYMBOL(dma_supported); |
@@ -383,6 +377,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | |||
383 | { | 377 | { |
384 | BUG_ON(direction == DMA_NONE); | 378 | BUG_ON(direction == DMA_NONE); |
385 | 379 | ||
380 | plat_extra_sync_for_device(dev); | ||
386 | if (!plat_device_is_coherent(dev)) | 381 | if (!plat_device_is_coherent(dev)) |
387 | __dma_sync((unsigned long)vaddr, size, direction); | 382 | __dma_sync((unsigned long)vaddr, size, direction); |
388 | } | 383 | } |
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index 5ce2fa745626..9619f66e531e 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c | |||
@@ -478,7 +478,10 @@ void __cpuinit tlb_init(void) | |||
478 | probe_tlb(config); | 478 | probe_tlb(config); |
479 | write_c0_pagemask(PM_DEFAULT_MASK); | 479 | write_c0_pagemask(PM_DEFAULT_MASK); |
480 | write_c0_wired(0); | 480 | write_c0_wired(0); |
481 | write_c0_framemask(0); | 481 | if (current_cpu_type() == CPU_R10000 || |
482 | current_cpu_type() == CPU_R12000 || | ||
483 | current_cpu_type() == CPU_R14000) | ||
484 | write_c0_framemask(0); | ||
482 | temp_tlb_entry = current_cpu_data.tlbsize - 1; | 485 | temp_tlb_entry = current_cpu_data.tlbsize - 1; |
483 | 486 | ||
484 | /* From this point on the ARC firmware is dead. */ | 487 | /* From this point on the ARC firmware is dead. */ |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 979cf9197282..42942038d0fd 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -317,6 +317,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, | |||
317 | case CPU_BCM3302: | 317 | case CPU_BCM3302: |
318 | case CPU_BCM4710: | 318 | case CPU_BCM4710: |
319 | case CPU_LOONGSON2: | 319 | case CPU_LOONGSON2: |
320 | case CPU_CAVIUM_OCTEON: | ||
320 | if (m4kc_tlbp_war()) | 321 | if (m4kc_tlbp_war()) |
321 | uasm_i_nop(p); | 322 | uasm_i_nop(p); |
322 | tlbw(p); | 323 | tlbw(p); |
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S index 62fba8aa9b6e..ceeaaaa359e2 100644 --- a/arch/mn10300/kernel/entry.S +++ b/arch/mn10300/kernel/entry.S | |||
@@ -478,7 +478,7 @@ ENTRY(sys_call_table) | |||
478 | .long sys_uselib | 478 | .long sys_uselib |
479 | .long sys_swapon | 479 | .long sys_swapon |
480 | .long sys_reboot | 480 | .long sys_reboot |
481 | .long old_readdir | 481 | .long sys_old_readdir |
482 | .long old_mmap /* 90 */ | 482 | .long old_mmap /* 90 */ |
483 | .long sys_munmap | 483 | .long sys_munmap |
484 | .long sys_truncate | 484 | .long sys_truncate |
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index 2121d99f8364..f88b252e419c 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | unifdef-y += pdc.h | 3 | unifdef-y += pdc.h |
4 | unifdef-y += swab.h | ||
diff --git a/arch/parisc/include/asm/byteorder.h b/arch/parisc/include/asm/byteorder.h index da66029c4cb2..58af2c5f5d61 100644 --- a/arch/parisc/include/asm/byteorder.h +++ b/arch/parisc/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _PARISC_BYTEORDER_H | 1 | #ifndef _PARISC_BYTEORDER_H |
2 | #define _PARISC_BYTEORDER_H | 2 | #define _PARISC_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _PARISC_BYTEORDER_H */ | 6 | #endif /* _PARISC_BYTEORDER_H */ |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 84b861316ce7..e39b73bc0ff8 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -123,6 +123,7 @@ config PPC | |||
123 | select HAVE_DMA_ATTRS if PPC64 | 123 | select HAVE_DMA_ATTRS if PPC64 |
124 | select USE_GENERIC_SMP_HELPERS if SMP | 124 | select USE_GENERIC_SMP_HELPERS if SMP |
125 | select HAVE_OPROFILE | 125 | select HAVE_OPROFILE |
126 | select HAVE_SYSCALL_WRAPPERS if PPC64 | ||
126 | 127 | ||
127 | config EARLY_PRINTK | 128 | config EARLY_PRINTK |
128 | bool | 129 | bool |
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts index 9708b3423bbd..e78c355c7bac 100644 --- a/arch/powerpc/boot/dts/gef_sbc610.dts +++ b/arch/powerpc/boot/dts/gef_sbc610.dts | |||
@@ -88,6 +88,21 @@ | |||
88 | compatible = "gef,fpga-regs"; | 88 | compatible = "gef,fpga-regs"; |
89 | reg = <0x4 0x0 0x40>; | 89 | reg = <0x4 0x0 0x40>; |
90 | }; | 90 | }; |
91 | |||
92 | wdt@4,2000 { | ||
93 | compatible = "gef,fpga-wdt"; | ||
94 | reg = <0x4 0x2000 0x8>; | ||
95 | interrupts = <0x1a 0x4>; | ||
96 | interrupt-parent = <&gef_pic>; | ||
97 | }; | ||
98 | /* Second watchdog available, driver currently supports one. | ||
99 | wdt@4,2010 { | ||
100 | compatible = "gef,fpga-wdt"; | ||
101 | reg = <0x4 0x2010 0x8>; | ||
102 | interrupts = <0x1b 0x4>; | ||
103 | interrupt-parent = <&gef_pic>; | ||
104 | }; | ||
105 | */ | ||
91 | gef_pic: pic@4,4000 { | 106 | gef_pic: pic@4,4000 { |
92 | #interrupt-cells = <1>; | 107 | #interrupt-cells = <1>; |
93 | interrupt-controller; | 108 | interrupt-controller; |
diff --git a/arch/powerpc/boot/dts/mpc8315erdb.dts b/arch/powerpc/boot/dts/mpc8315erdb.dts index 072c9b0f8c8e..71784165b77e 100644 --- a/arch/powerpc/boot/dts/mpc8315erdb.dts +++ b/arch/powerpc/boot/dts/mpc8315erdb.dts | |||
@@ -255,7 +255,7 @@ | |||
255 | device_type = "serial"; | 255 | device_type = "serial"; |
256 | compatible = "ns16550"; | 256 | compatible = "ns16550"; |
257 | reg = <0x4500 0x100>; | 257 | reg = <0x4500 0x100>; |
258 | clock-frequency = <0>; | 258 | clock-frequency = <133333333>; |
259 | interrupts = <9 0x8>; | 259 | interrupts = <9 0x8>; |
260 | interrupt-parent = <&ipic>; | 260 | interrupt-parent = <&ipic>; |
261 | }; | 261 | }; |
@@ -265,7 +265,7 @@ | |||
265 | device_type = "serial"; | 265 | device_type = "serial"; |
266 | compatible = "ns16550"; | 266 | compatible = "ns16550"; |
267 | reg = <0x4600 0x100>; | 267 | reg = <0x4600 0x100>; |
268 | clock-frequency = <0>; | 268 | clock-frequency = <133333333>; |
269 | interrupts = <10 0x8>; | 269 | interrupts = <10 0x8>; |
270 | interrupt-parent = <&ipic>; | 270 | interrupt-parent = <&ipic>; |
271 | }; | 271 | }; |
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts index b9da42105066..0668d1048779 100644 --- a/arch/powerpc/boot/dts/mpc8544ds.dts +++ b/arch/powerpc/boot/dts/mpc8544ds.dts | |||
@@ -313,7 +313,7 @@ | |||
313 | 0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>; | 313 | 0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>; |
314 | clock-frequency = <33333333>; | 314 | clock-frequency = <33333333>; |
315 | interrupt-parent = <&mpic>; | 315 | interrupt-parent = <&mpic>; |
316 | interrupts = <26 2>; | 316 | interrupts = <25 2>; |
317 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; | 317 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; |
318 | interrupt-map = < | 318 | interrupt-map = < |
319 | /* IDSEL 0x0 */ | 319 | /* IDSEL 0x0 */ |
@@ -350,7 +350,7 @@ | |||
350 | 0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>; | 350 | 0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>; |
351 | clock-frequency = <33333333>; | 351 | clock-frequency = <33333333>; |
352 | interrupt-parent = <&mpic>; | 352 | interrupt-parent = <&mpic>; |
353 | interrupts = <25 2>; | 353 | interrupts = <26 2>; |
354 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; | 354 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; |
355 | interrupt-map = < | 355 | interrupt-map = < |
356 | /* IDSEL 0x0 */ | 356 | /* IDSEL 0x0 */ |
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts index 21459e161d02..3dcc001b8ed3 100644 --- a/arch/powerpc/boot/dts/mpc8572ds.dts +++ b/arch/powerpc/boot/dts/mpc8572ds.dts | |||
@@ -724,7 +724,7 @@ | |||
724 | 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>; | 724 | 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>; |
725 | clock-frequency = <33333333>; | 725 | clock-frequency = <33333333>; |
726 | interrupt-parent = <&mpic>; | 726 | interrupt-parent = <&mpic>; |
727 | interrupts = <26 2>; | 727 | interrupts = <25 2>; |
728 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; | 728 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; |
729 | interrupt-map = < | 729 | interrupt-map = < |
730 | /* IDSEL 0x0 */ | 730 | /* IDSEL 0x0 */ |
@@ -761,7 +761,7 @@ | |||
761 | 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>; | 761 | 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>; |
762 | clock-frequency = <33333333>; | 762 | clock-frequency = <33333333>; |
763 | interrupt-parent = <&mpic>; | 763 | interrupt-parent = <&mpic>; |
764 | interrupts = <27 2>; | 764 | interrupts = <26 2>; |
765 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; | 765 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; |
766 | interrupt-map = < | 766 | interrupt-map = < |
767 | /* IDSEL 0x0 */ | 767 | /* IDSEL 0x0 */ |
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts index c114c4ee9931..fd462efa9e61 100644 --- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts +++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts | |||
@@ -457,7 +457,7 @@ | |||
457 | 0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>; | 457 | 0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>; |
458 | clock-frequency = <33333333>; | 458 | clock-frequency = <33333333>; |
459 | interrupt-parent = <&mpic>; | 459 | interrupt-parent = <&mpic>; |
460 | interrupts = <26 2>; | 460 | interrupts = <25 2>; |
461 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; | 461 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; |
462 | interrupt-map = < | 462 | interrupt-map = < |
463 | /* IDSEL 0x0 */ | 463 | /* IDSEL 0x0 */ |
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts index 04ecda18d206..e35230f2ac93 100644 --- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts +++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts | |||
@@ -208,7 +208,7 @@ | |||
208 | 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>; | 208 | 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>; |
209 | clock-frequency = <33333333>; | 209 | clock-frequency = <33333333>; |
210 | interrupt-parent = <&mpic>; | 210 | interrupt-parent = <&mpic>; |
211 | interrupts = <27 2>; | 211 | interrupts = <26 2>; |
212 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; | 212 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; |
213 | interrupt-map = < | 213 | interrupt-map = < |
214 | /* IDSEL 0x0 */ | 214 | /* IDSEL 0x0 */ |
diff --git a/arch/powerpc/configs/86xx/gef_sbc610_defconfig b/arch/powerpc/configs/86xx/gef_sbc610_defconfig index cd1ffa449327..391874c7b436 100644 --- a/arch/powerpc/configs/86xx/gef_sbc610_defconfig +++ b/arch/powerpc/configs/86xx/gef_sbc610_defconfig | |||
@@ -1164,6 +1164,7 @@ CONFIG_WATCHDOG=y | |||
1164 | # CONFIG_SOFT_WATCHDOG is not set | 1164 | # CONFIG_SOFT_WATCHDOG is not set |
1165 | # CONFIG_ALIM7101_WDT is not set | 1165 | # CONFIG_ALIM7101_WDT is not set |
1166 | # CONFIG_8xxx_WDT is not set | 1166 | # CONFIG_8xxx_WDT is not set |
1167 | CONFIG_GEF_WDT=y | ||
1167 | 1168 | ||
1168 | # | 1169 | # |
1169 | # PCI-based Watchdog Cards | 1170 | # PCI-based Watchdog Cards |
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig index 069ae1bbac29..d4685d1c0be8 100644 --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs/ppc64_defconfig | |||
@@ -211,11 +211,28 @@ CONFIG_PPC_PASEMI=y | |||
211 | CONFIG_PPC_PASEMI_IOMMU=y | 211 | CONFIG_PPC_PASEMI_IOMMU=y |
212 | # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set | 212 | # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set |
213 | CONFIG_PPC_PASEMI_MDIO=y | 213 | CONFIG_PPC_PASEMI_MDIO=y |
214 | # CONFIG_PPC_PS3 is not set | 214 | CONFIG_PPC_PS3=y |
215 | |||
216 | # | ||
217 | # PS3 Platform Options | ||
218 | # | ||
219 | # CONFIG_PS3_ADVANCED is not set | ||
220 | CONFIG_PS3_HTAB_SIZE=20 | ||
221 | # CONFIG_PS3_DYNAMIC_DMA is not set | ||
222 | CONFIG_PS3_VUART=y | ||
223 | CONFIG_PS3_PS3AV=y | ||
224 | CONFIG_PS3_SYS_MANAGER=y | ||
225 | CONFIG_PS3_STORAGE=m | ||
226 | CONFIG_PS3_DISK=m | ||
227 | CONFIG_PS3_ROM=m | ||
228 | CONFIG_PS3_FLASH=m | ||
229 | CONFIG_PS3_LPM=m | ||
215 | CONFIG_PPC_CELL=y | 230 | CONFIG_PPC_CELL=y |
231 | CONFIG_PPC_CELL_COMMON=y | ||
216 | CONFIG_PPC_CELL_NATIVE=y | 232 | CONFIG_PPC_CELL_NATIVE=y |
217 | CONFIG_PPC_IBM_CELL_BLADE=y | 233 | CONFIG_PPC_IBM_CELL_BLADE=y |
218 | CONFIG_PPC_CELLEB=y | 234 | CONFIG_PPC_CELLEB=y |
235 | CONFIG_PPC_CELL_QPACE=y | ||
219 | 236 | ||
220 | # | 237 | # |
221 | # Cell Broadband Engine options | 238 | # Cell Broadband Engine options |
@@ -981,6 +998,9 @@ CONFIG_E1000=y | |||
981 | CONFIG_TIGON3=y | 998 | CONFIG_TIGON3=y |
982 | # CONFIG_BNX2 is not set | 999 | # CONFIG_BNX2 is not set |
983 | CONFIG_SPIDER_NET=m | 1000 | CONFIG_SPIDER_NET=m |
1001 | CONFIG_GELIC_NET=m | ||
1002 | CONFIG_GELIC_WIRELESS=y | ||
1003 | # CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set | ||
984 | # CONFIG_QLA3XXX is not set | 1004 | # CONFIG_QLA3XXX is not set |
985 | # CONFIG_ATL1 is not set | 1005 | # CONFIG_ATL1 is not set |
986 | # CONFIG_ATL1E is not set | 1006 | # CONFIG_ATL1E is not set |
@@ -1370,6 +1390,8 @@ CONFIG_FB_RADEON_BACKLIGHT=y | |||
1370 | # CONFIG_FB_PM3 is not set | 1390 | # CONFIG_FB_PM3 is not set |
1371 | # CONFIG_FB_CARMINE is not set | 1391 | # CONFIG_FB_CARMINE is not set |
1372 | CONFIG_FB_IBM_GXT4500=y | 1392 | CONFIG_FB_IBM_GXT4500=y |
1393 | CONFIG_FB_PS3=m | ||
1394 | CONFIG_FB_PS3_DEFAULT_SIZE_M=9 | ||
1373 | # CONFIG_FB_VIRTUAL is not set | 1395 | # CONFIG_FB_VIRTUAL is not set |
1374 | # CONFIG_FB_METRONOME is not set | 1396 | # CONFIG_FB_METRONOME is not set |
1375 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | 1397 | CONFIG_BACKLIGHT_LCD_SUPPORT=y |
@@ -1492,6 +1514,8 @@ CONFIG_SND_PCI=y | |||
1492 | CONFIG_SND_PPC=y | 1514 | CONFIG_SND_PPC=y |
1493 | CONFIG_SND_POWERMAC=m | 1515 | CONFIG_SND_POWERMAC=m |
1494 | CONFIG_SND_POWERMAC_AUTO_DRC=y | 1516 | CONFIG_SND_POWERMAC_AUTO_DRC=y |
1517 | CONFIG_SND_PS3=m | ||
1518 | CONFIG_SND_PS3_DEFAULT_START_DELAY=2000 | ||
1495 | CONFIG_SND_AOA=m | 1519 | CONFIG_SND_AOA=m |
1496 | CONFIG_SND_AOA_FABRIC_LAYOUT=m | 1520 | CONFIG_SND_AOA_FABRIC_LAYOUT=m |
1497 | CONFIG_SND_AOA_ONYX=m | 1521 | CONFIG_SND_AOA_ONYX=m |
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild index 9268602de5d0..5ab7d7fe198c 100644 --- a/arch/powerpc/include/asm/Kbuild +++ b/arch/powerpc/include/asm/Kbuild | |||
@@ -35,4 +35,3 @@ unifdef-y += spu_info.h | |||
35 | unifdef-y += termios.h | 35 | unifdef-y += termios.h |
36 | unifdef-y += types.h | 36 | unifdef-y += types.h |
37 | unifdef-y += unistd.h | 37 | unifdef-y += unistd.h |
38 | unifdef-y += swab.h | ||
diff --git a/arch/powerpc/include/asm/byteorder.h b/arch/powerpc/include/asm/byteorder.h index 5cca27a41532..aa6cc4fac965 100644 --- a/arch/powerpc/include/asm/byteorder.h +++ b/arch/powerpc/include/asm/byteorder.h | |||
@@ -7,8 +7,6 @@ | |||
7 | * as published by the Free Software Foundation; either version | 7 | * as published by the Free Software Foundation; either version |
8 | * 2 of the License, or (at your option) any later version. | 8 | * 2 of the License, or (at your option) any later version. |
9 | */ | 9 | */ |
10 | |||
11 | #include <asm/swab.h> | ||
12 | #include <linux/byteorder/big_endian.h> | 10 | #include <linux/byteorder/big_endian.h> |
13 | 11 | ||
14 | #endif /* _ASM_POWERPC_BYTEORDER_H */ | 12 | #endif /* _ASM_POWERPC_BYTEORDER_H */ |
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h index a0a15311d0d8..2701753d9937 100644 --- a/arch/powerpc/include/asm/qe.h +++ b/arch/powerpc/include/asm/qe.h | |||
@@ -624,7 +624,7 @@ struct ucc_slow_pram { | |||
624 | #define UCC_GETH_UCCE_RXF1 0x00000002 | 624 | #define UCC_GETH_UCCE_RXF1 0x00000002 |
625 | #define UCC_GETH_UCCE_RXF0 0x00000001 | 625 | #define UCC_GETH_UCCE_RXF0 0x00000001 |
626 | 626 | ||
627 | /* UPSMR, when used as a UART */ | 627 | /* UCC Protocol Specific Mode Register (UPSMR), when used for UART */ |
628 | #define UCC_UART_UPSMR_FLC 0x8000 | 628 | #define UCC_UART_UPSMR_FLC 0x8000 |
629 | #define UCC_UART_UPSMR_SL 0x4000 | 629 | #define UCC_UART_UPSMR_SL 0x4000 |
630 | #define UCC_UART_UPSMR_CL_MASK 0x3000 | 630 | #define UCC_UART_UPSMR_CL_MASK 0x3000 |
@@ -652,6 +652,23 @@ struct ucc_slow_pram { | |||
652 | #define UCC_UART_UPSMR_TPM_EVEN 0x0002 | 652 | #define UCC_UART_UPSMR_TPM_EVEN 0x0002 |
653 | #define UCC_UART_UPSMR_TPM_HIGH 0x0003 | 653 | #define UCC_UART_UPSMR_TPM_HIGH 0x0003 |
654 | 654 | ||
655 | /* UCC Protocol Specific Mode Register (UPSMR), when used for Ethernet */ | ||
656 | #define UCC_GETH_UPSMR_FTFE 0x80000000 | ||
657 | #define UCC_GETH_UPSMR_PTPE 0x40000000 | ||
658 | #define UCC_GETH_UPSMR_ECM 0x04000000 | ||
659 | #define UCC_GETH_UPSMR_HSE 0x02000000 | ||
660 | #define UCC_GETH_UPSMR_PRO 0x00400000 | ||
661 | #define UCC_GETH_UPSMR_CAP 0x00200000 | ||
662 | #define UCC_GETH_UPSMR_RSH 0x00100000 | ||
663 | #define UCC_GETH_UPSMR_RPM 0x00080000 | ||
664 | #define UCC_GETH_UPSMR_R10M 0x00040000 | ||
665 | #define UCC_GETH_UPSMR_RLPB 0x00020000 | ||
666 | #define UCC_GETH_UPSMR_TBIM 0x00010000 | ||
667 | #define UCC_GETH_UPSMR_RES1 0x00002000 | ||
668 | #define UCC_GETH_UPSMR_RMM 0x00001000 | ||
669 | #define UCC_GETH_UPSMR_CAM 0x00000400 | ||
670 | #define UCC_GETH_UPSMR_BRO 0x00000200 | ||
671 | |||
655 | /* UCC Transmit On Demand Register (UTODR) */ | 672 | /* UCC Transmit On Demand Register (UTODR) */ |
656 | #define UCC_SLOW_TOD 0x8000 | 673 | #define UCC_SLOW_TOD 0x8000 |
657 | #define UCC_FAST_TOD 0x8000 | 674 | #define UCC_FAST_TOD 0x8000 |
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index e0175beb4462..0aa0315fb7e8 100644 --- a/arch/powerpc/include/asm/rtas.h +++ b/arch/powerpc/include/asm/rtas.h | |||
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define RTAS_UNKNOWN_SERVICE (-1) | 20 | #define RTAS_UNKNOWN_SERVICE (-1) |
21 | #define RTAS_INSTANTIATE_MAX (1UL<<30) /* Don't instantiate rtas at/above this value */ | 21 | #define RTAS_INSTANTIATE_MAX (1ULL<<30) /* Don't instantiate rtas at/above this value */ |
22 | 22 | ||
23 | /* Buffer size for ppc_rtas system call. */ | 23 | /* Buffer size for ppc_rtas system call. */ |
24 | #define RTAS_RMOBUF_MAX (64 * 1024) | 24 | #define RTAS_RMOBUF_MAX (64 * 1024) |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index 803def236654..72353f6070a4 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -92,7 +92,7 @@ COMPAT_SYS_SPU(readlink) | |||
92 | SYSCALL(uselib) | 92 | SYSCALL(uselib) |
93 | SYSCALL(swapon) | 93 | SYSCALL(swapon) |
94 | SYSCALL(reboot) | 94 | SYSCALL(reboot) |
95 | SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir) | 95 | SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir) |
96 | SYSCALL_SPU(mmap) | 96 | SYSCALL_SPU(mmap) |
97 | SYSCALL_SPU(munmap) | 97 | SYSCALL_SPU(munmap) |
98 | SYSCALL_SPU(truncate) | 98 | SYSCALL_SPU(truncate) |
diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index c004c13f291e..7ce27a52bb34 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h | |||
@@ -1,7 +1,12 @@ | |||
1 | #ifndef _ASM_POWERPC_TYPES_H | 1 | #ifndef _ASM_POWERPC_TYPES_H |
2 | #define _ASM_POWERPC_TYPES_H | 2 | #define _ASM_POWERPC_TYPES_H |
3 | 3 | ||
4 | #ifdef __powerpc64__ | 4 | /* |
5 | * This is here because we used to use l64 for 64bit powerpc | ||
6 | * and we don't want to impact user mode with our change to ll64 | ||
7 | * in the kernel. | ||
8 | */ | ||
9 | #if defined(__powerpc64__) && !defined(__KERNEL__) | ||
5 | # include <asm-generic/int-l64.h> | 10 | # include <asm-generic/int-l64.h> |
6 | #else | 11 | #else |
7 | # include <asm-generic/int-ll64.h> | 12 | # include <asm-generic/int-ll64.h> |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 9937fe44555f..19ee491e9e23 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -56,6 +56,10 @@ | |||
56 | #include "head_booke.h" | 56 | #include "head_booke.h" |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #if defined(CONFIG_FSL_BOOKE) | ||
60 | #include "../mm/mmu_decl.h" | ||
61 | #endif | ||
62 | |||
59 | int main(void) | 63 | int main(void) |
60 | { | 64 | { |
61 | DEFINE(THREAD, offsetof(struct task_struct, thread)); | 65 | DEFINE(THREAD, offsetof(struct task_struct, thread)); |
@@ -382,6 +386,9 @@ int main(void) | |||
382 | DEFINE(PGD_T_LOG2, PGD_T_LOG2); | 386 | DEFINE(PGD_T_LOG2, PGD_T_LOG2); |
383 | DEFINE(PTE_T_LOG2, PTE_T_LOG2); | 387 | DEFINE(PTE_T_LOG2, PTE_T_LOG2); |
384 | #endif | 388 | #endif |
389 | #ifdef CONFIG_FSL_BOOKE | ||
390 | DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam)); | ||
391 | #endif | ||
385 | 392 | ||
386 | #ifdef CONFIG_KVM_EXIT_TIMING | 393 | #ifdef CONFIG_KVM_EXIT_TIMING |
387 | DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu, | 394 | DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu, |
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index b33f0417a4bf..bb37b1d19a58 100644 --- a/arch/powerpc/kernel/cacheinfo.c +++ b/arch/powerpc/kernel/cacheinfo.c | |||
@@ -113,7 +113,7 @@ struct cache { | |||
113 | struct cache *next_local; /* next cache of >= level */ | 113 | struct cache *next_local; /* next cache of >= level */ |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static DEFINE_PER_CPU(struct cache_dir *, cache_dir); | 116 | static DEFINE_PER_CPU(struct cache_dir *, cache_dir_pcpu); |
117 | 117 | ||
118 | /* traversal/modification of this list occurs only at cpu hotplug time; | 118 | /* traversal/modification of this list occurs only at cpu hotplug time; |
119 | * access is serialized by cpu hotplug locking | 119 | * access is serialized by cpu hotplug locking |
@@ -468,9 +468,9 @@ static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_i | |||
468 | 468 | ||
469 | cache_dir->kobj = kobj; | 469 | cache_dir->kobj = kobj; |
470 | 470 | ||
471 | WARN_ON_ONCE(per_cpu(cache_dir, cpu_id) != NULL); | 471 | WARN_ON_ONCE(per_cpu(cache_dir_pcpu, cpu_id) != NULL); |
472 | 472 | ||
473 | per_cpu(cache_dir, cpu_id) = cache_dir; | 473 | per_cpu(cache_dir_pcpu, cpu_id) = cache_dir; |
474 | 474 | ||
475 | return cache_dir; | 475 | return cache_dir; |
476 | err: | 476 | err: |
@@ -820,13 +820,13 @@ void cacheinfo_cpu_offline(unsigned int cpu_id) | |||
820 | 820 | ||
821 | /* Prevent userspace from seeing inconsistent state - remove | 821 | /* Prevent userspace from seeing inconsistent state - remove |
822 | * the sysfs hierarchy first */ | 822 | * the sysfs hierarchy first */ |
823 | cache_dir = per_cpu(cache_dir, cpu_id); | 823 | cache_dir = per_cpu(cache_dir_pcpu, cpu_id); |
824 | 824 | ||
825 | /* careful, sysfs population may have failed */ | 825 | /* careful, sysfs population may have failed */ |
826 | if (cache_dir) | 826 | if (cache_dir) |
827 | remove_cache_dir(cache_dir); | 827 | remove_cache_dir(cache_dir); |
828 | 828 | ||
829 | per_cpu(cache_dir, cpu_id) = NULL; | 829 | per_cpu(cache_dir_pcpu, cpu_id) = NULL; |
830 | 830 | ||
831 | /* clear the CPU's bit in its cache chain, possibly freeing | 831 | /* clear the CPU's bit in its cache chain, possibly freeing |
832 | * cache objects */ | 832 | * cache objects */ |
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index 14183af1b3fb..2983adac8cc3 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c | |||
@@ -79,10 +79,10 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask) | |||
79 | "Warning: IOMMU offset too big for device mask\n"); | 79 | "Warning: IOMMU offset too big for device mask\n"); |
80 | if (tbl) | 80 | if (tbl) |
81 | printk(KERN_INFO | 81 | printk(KERN_INFO |
82 | "mask: 0x%08lx, table offset: 0x%08lx\n", | 82 | "mask: 0x%08llx, table offset: 0x%08lx\n", |
83 | mask, tbl->it_offset); | 83 | mask, tbl->it_offset); |
84 | else | 84 | else |
85 | printk(KERN_INFO "mask: 0x%08lx, table unavailable\n", | 85 | printk(KERN_INFO "mask: 0x%08llx, table unavailable\n", |
86 | mask); | 86 | mask); |
87 | return 0; | 87 | return 0; |
88 | } else | 88 | } else |
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index b4bcf5a930fa..ebaedafc8e67 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -1518,6 +1518,15 @@ _GLOBAL(pmac_secondary_start) | |||
1518 | /* turn on 64-bit mode */ | 1518 | /* turn on 64-bit mode */ |
1519 | bl .enable_64b_mode | 1519 | bl .enable_64b_mode |
1520 | 1520 | ||
1521 | li r0,0 | ||
1522 | mfspr r3,SPRN_HID4 | ||
1523 | rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */ | ||
1524 | sync | ||
1525 | mtspr SPRN_HID4,r3 | ||
1526 | isync | ||
1527 | sync | ||
1528 | slbia | ||
1529 | |||
1521 | /* get TOC pointer (real address) */ | 1530 | /* get TOC pointer (real address) */ |
1522 | bl .relative_toc | 1531 | bl .relative_toc |
1523 | 1532 | ||
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S index 11b549acc034..36ffb3504a4f 100644 --- a/arch/powerpc/kernel/head_fsl_booke.S +++ b/arch/powerpc/kernel/head_fsl_booke.S | |||
@@ -389,10 +389,6 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
389 | #endif | 389 | #endif |
390 | #endif | 390 | #endif |
391 | 391 | ||
392 | mfspr r3,SPRN_TLB1CFG | ||
393 | andi. r3,r3,0xfff | ||
394 | lis r4,num_tlbcam_entries@ha | ||
395 | stw r3,num_tlbcam_entries@l(r4) | ||
396 | /* | 392 | /* |
397 | * Decide what sort of machine this is and initialize the MMU. | 393 | * Decide what sort of machine this is and initialize the MMU. |
398 | */ | 394 | */ |
@@ -711,7 +707,7 @@ interrupt_base: | |||
711 | EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD) | 707 | EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD) |
712 | 708 | ||
713 | #ifdef CONFIG_PPC_E500MC | 709 | #ifdef CONFIG_PPC_E500MC |
714 | EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_EE) | 710 | EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_STD) |
715 | #endif | 711 | #endif |
716 | 712 | ||
717 | /* Debug Interrupt */ | 713 | /* Debug Interrupt */ |
@@ -909,7 +905,7 @@ KernelSPE: | |||
909 | _GLOBAL(loadcam_entry) | 905 | _GLOBAL(loadcam_entry) |
910 | lis r4,TLBCAM@ha | 906 | lis r4,TLBCAM@ha |
911 | addi r4,r4,TLBCAM@l | 907 | addi r4,r4,TLBCAM@l |
912 | mulli r5,r3,20 | 908 | mulli r5,r3,TLBCAM_SIZE |
913 | add r3,r5,r4 | 909 | add r3,r5,r4 |
914 | lwz r4,0(r3) | 910 | lwz r4,0(r3) |
915 | mtspr SPRN_MAS0,r4 | 911 | mtspr SPRN_MAS0,r4 |
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 1bfa706b96e7..fd51578e29dd 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -239,12 +239,12 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, | |||
239 | if (printk_ratelimit()) { | 239 | if (printk_ratelimit()) { |
240 | printk(KERN_INFO "iommu_free: invalid entry\n"); | 240 | printk(KERN_INFO "iommu_free: invalid entry\n"); |
241 | printk(KERN_INFO "\tentry = 0x%lx\n", entry); | 241 | printk(KERN_INFO "\tentry = 0x%lx\n", entry); |
242 | printk(KERN_INFO "\tdma_addr = 0x%lx\n", (u64)dma_addr); | 242 | printk(KERN_INFO "\tdma_addr = 0x%llx\n", (u64)dma_addr); |
243 | printk(KERN_INFO "\tTable = 0x%lx\n", (u64)tbl); | 243 | printk(KERN_INFO "\tTable = 0x%llx\n", (u64)tbl); |
244 | printk(KERN_INFO "\tbus# = 0x%lx\n", (u64)tbl->it_busno); | 244 | printk(KERN_INFO "\tbus# = 0x%llx\n", (u64)tbl->it_busno); |
245 | printk(KERN_INFO "\tsize = 0x%lx\n", (u64)tbl->it_size); | 245 | printk(KERN_INFO "\tsize = 0x%llx\n", (u64)tbl->it_size); |
246 | printk(KERN_INFO "\tstartOff = 0x%lx\n", (u64)tbl->it_offset); | 246 | printk(KERN_INFO "\tstartOff = 0x%llx\n", (u64)tbl->it_offset); |
247 | printk(KERN_INFO "\tindex = 0x%lx\n", (u64)tbl->it_index); | 247 | printk(KERN_INFO "\tindex = 0x%llx\n", (u64)tbl->it_index); |
248 | WARN_ON(1); | 248 | WARN_ON(1); |
249 | } | 249 | } |
250 | return; | 250 | return; |
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index d051e8cbcd03..182e0f642f36 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -240,7 +240,7 @@ static void parse_ppp_data(struct seq_file *m) | |||
240 | if (rc) | 240 | if (rc) |
241 | return; | 241 | return; |
242 | 242 | ||
243 | seq_printf(m, "partition_entitled_capacity=%ld\n", | 243 | seq_printf(m, "partition_entitled_capacity=%lld\n", |
244 | ppp_data.entitlement); | 244 | ppp_data.entitlement); |
245 | seq_printf(m, "group=%d\n", ppp_data.group_num); | 245 | seq_printf(m, "group=%d\n", ppp_data.group_num); |
246 | seq_printf(m, "system_active_processors=%d\n", | 246 | seq_printf(m, "system_active_processors=%d\n", |
@@ -265,7 +265,7 @@ static void parse_ppp_data(struct seq_file *m) | |||
265 | ppp_data.unallocated_weight); | 265 | ppp_data.unallocated_weight); |
266 | seq_printf(m, "capacity_weight=%d\n", ppp_data.weight); | 266 | seq_printf(m, "capacity_weight=%d\n", ppp_data.weight); |
267 | seq_printf(m, "capped=%d\n", ppp_data.capped); | 267 | seq_printf(m, "capped=%d\n", ppp_data.capped); |
268 | seq_printf(m, "unallocated_capacity=%ld\n", | 268 | seq_printf(m, "unallocated_capacity=%lld\n", |
269 | ppp_data.unallocated_entitlement); | 269 | ppp_data.unallocated_entitlement); |
270 | } | 270 | } |
271 | 271 | ||
@@ -509,10 +509,10 @@ static ssize_t update_ppp(u64 *entitlement, u8 *weight) | |||
509 | } else | 509 | } else |
510 | return -EINVAL; | 510 | return -EINVAL; |
511 | 511 | ||
512 | pr_debug("%s: current_entitled = %lu, current_weight = %u\n", | 512 | pr_debug("%s: current_entitled = %llu, current_weight = %u\n", |
513 | __func__, ppp_data.entitlement, ppp_data.weight); | 513 | __func__, ppp_data.entitlement, ppp_data.weight); |
514 | 514 | ||
515 | pr_debug("%s: new_entitled = %lu, new_weight = %u\n", | 515 | pr_debug("%s: new_entitled = %llu, new_weight = %u\n", |
516 | __func__, new_entitled, new_weight); | 516 | __func__, new_entitled, new_weight); |
517 | 517 | ||
518 | retval = plpar_hcall_norets(H_SET_PPP, new_entitled, new_weight); | 518 | retval = plpar_hcall_norets(H_SET_PPP, new_entitled, new_weight); |
@@ -558,7 +558,7 @@ static ssize_t update_mpp(u64 *entitlement, u8 *weight) | |||
558 | pr_debug("%s: current_entitled = %lu, current_weight = %u\n", | 558 | pr_debug("%s: current_entitled = %lu, current_weight = %u\n", |
559 | __func__, mpp_data.entitled_mem, mpp_data.mem_weight); | 559 | __func__, mpp_data.entitled_mem, mpp_data.mem_weight); |
560 | 560 | ||
561 | pr_debug("%s: new_entitled = %lu, new_weight = %u\n", | 561 | pr_debug("%s: new_entitled = %llu, new_weight = %u\n", |
562 | __func__, new_entitled, new_weight); | 562 | __func__, new_entitled, new_weight); |
563 | 563 | ||
564 | rc = plpar_hcall_norets(H_SET_MPP, new_entitled, new_weight); | 564 | rc = plpar_hcall_norets(H_SET_MPP, new_entitled, new_weight); |
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index b3abebb7ee64..d59e2b1bdcba 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -93,10 +93,35 @@ void __init reserve_crashkernel(void) | |||
93 | KDUMP_KERNELBASE); | 93 | KDUMP_KERNELBASE); |
94 | 94 | ||
95 | crashk_res.start = KDUMP_KERNELBASE; | 95 | crashk_res.start = KDUMP_KERNELBASE; |
96 | #else | ||
97 | if (!crashk_res.start) { | ||
98 | /* | ||
99 | * unspecified address, choose a region of specified size | ||
100 | * can overlap with initrd (ignoring corruption when retained) | ||
101 | * ppc64 requires kernel and some stacks to be in first segemnt | ||
102 | */ | ||
103 | crashk_res.start = KDUMP_KERNELBASE; | ||
104 | } | ||
105 | |||
106 | crash_base = PAGE_ALIGN(crashk_res.start); | ||
107 | if (crash_base != crashk_res.start) { | ||
108 | printk("Crash kernel base must be aligned to 0x%lx\n", | ||
109 | PAGE_SIZE); | ||
110 | crashk_res.start = crash_base; | ||
111 | } | ||
112 | |||
96 | #endif | 113 | #endif |
97 | crash_size = PAGE_ALIGN(crash_size); | 114 | crash_size = PAGE_ALIGN(crash_size); |
98 | crashk_res.end = crashk_res.start + crash_size - 1; | 115 | crashk_res.end = crashk_res.start + crash_size - 1; |
99 | 116 | ||
117 | /* The crash region must not overlap the current kernel */ | ||
118 | if (overlaps_crashkernel(__pa(_stext), _end - _stext)) { | ||
119 | printk(KERN_WARNING | ||
120 | "Crash kernel can not overlap current kernel\n"); | ||
121 | crashk_res.start = crashk_res.end = 0; | ||
122 | return; | ||
123 | } | ||
124 | |||
100 | /* Crash kernel trumps memory limit */ | 125 | /* Crash kernel trumps memory limit */ |
101 | if (memory_limit && memory_limit <= crashk_res.end) { | 126 | if (memory_limit && memory_limit <= crashk_res.end) { |
102 | memory_limit = crashk_res.end + 1; | 127 | memory_limit = crashk_res.end + 1; |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 586962f65c2a..ea8eda8c87cf 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -470,7 +470,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus) | |||
470 | if (bus->self) { | 470 | if (bus->self) { |
471 | pr_debug("IO mapping for PCI-PCI bridge %s\n", | 471 | pr_debug("IO mapping for PCI-PCI bridge %s\n", |
472 | pci_name(bus->self)); | 472 | pci_name(bus->self)); |
473 | pr_debug(" virt=0x%016lx...0x%016lx\n", | 473 | pr_debug(" virt=0x%016llx...0x%016llx\n", |
474 | bus->resource[0]->start + _IO_BASE, | 474 | bus->resource[0]->start + _IO_BASE, |
475 | bus->resource[0]->end + _IO_BASE); | 475 | bus->resource[0]->end + _IO_BASE); |
476 | return 0; | 476 | return 0; |
@@ -502,7 +502,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus) | |||
502 | hose->io_base_phys - phys_page); | 502 | hose->io_base_phys - phys_page); |
503 | 503 | ||
504 | pr_debug("IO mapping for PHB %s\n", hose->dn->full_name); | 504 | pr_debug("IO mapping for PHB %s\n", hose->dn->full_name); |
505 | pr_debug(" phys=0x%016lx, virt=0x%p (alloc=0x%p)\n", | 505 | pr_debug(" phys=0x%016llx, virt=0x%p (alloc=0x%p)\n", |
506 | hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc); | 506 | hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc); |
507 | pr_debug(" size=0x%016lx (alloc=0x%016lx)\n", | 507 | pr_debug(" size=0x%016lx (alloc=0x%016lx)\n", |
508 | hose->pci_io_size, size_page); | 508 | hose->pci_io_size, size_page); |
@@ -517,7 +517,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus) | |||
517 | hose->io_resource.start += io_virt_offset; | 517 | hose->io_resource.start += io_virt_offset; |
518 | hose->io_resource.end += io_virt_offset; | 518 | hose->io_resource.end += io_virt_offset; |
519 | 519 | ||
520 | pr_debug(" hose->io_resource=0x%016lx...0x%016lx\n", | 520 | pr_debug(" hose->io_resource=0x%016llx...0x%016llx\n", |
521 | hose->io_resource.start, hose->io_resource.end); | 521 | hose->io_resource.start, hose->io_resource.end); |
522 | 522 | ||
523 | return 0; | 523 | return 0; |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index d8bd2161e738..2d34196bba8c 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -434,8 +434,8 @@ void __init setup_system(void) | |||
434 | printk("Starting Linux PPC64 %s\n", init_utsname()->version); | 434 | printk("Starting Linux PPC64 %s\n", init_utsname()->version); |
435 | 435 | ||
436 | printk("-----------------------------------------------------\n"); | 436 | printk("-----------------------------------------------------\n"); |
437 | printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); | 437 | printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size); |
438 | printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); | 438 | printk("physicalMemorySize = 0x%llx\n", lmb_phys_mem_size()); |
439 | if (ppc64_caches.dline_size != 0x80) | 439 | if (ppc64_caches.dline_size != 0x80) |
440 | printk("ppc64_caches.dcache_line_size = 0x%x\n", | 440 | printk("ppc64_caches.dcache_line_size = 0x%x\n", |
441 | ppc64_caches.dline_size); | 441 | ppc64_caches.dline_size); |
@@ -493,7 +493,7 @@ static void __init emergency_stack_init(void) | |||
493 | * bringup, we need to get at them in real mode. This means they | 493 | * bringup, we need to get at them in real mode. This means they |
494 | * must also be within the RMO region. | 494 | * must also be within the RMO region. |
495 | */ | 495 | */ |
496 | limit = min(0x10000000UL, lmb.rmo_size); | 496 | limit = min(0x10000000ULL, lmb.rmo_size); |
497 | 497 | ||
498 | for_each_possible_cpu(i) { | 498 | for_each_possible_cpu(i) { |
499 | unsigned long sp; | 499 | unsigned long sp; |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 47bf15cd2c9e..161b9b9691f0 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -87,7 +87,9 @@ SECTIONS | |||
87 | /* The dummy segment contents for the bug workaround mentioned above | 87 | /* The dummy segment contents for the bug workaround mentioned above |
88 | near PHDRS. */ | 88 | near PHDRS. */ |
89 | .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) { | 89 | .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) { |
90 | LONG(0xf177) | 90 | LONG(0) |
91 | LONG(0) | ||
92 | LONG(0) | ||
91 | } :kernel :dummy | 93 | } :kernel :dummy |
92 | 94 | ||
93 | /* | 95 | /* |
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c index 23cee39534fd..1971e4ee3d6e 100644 --- a/arch/powerpc/mm/fsl_booke_mmu.c +++ b/arch/powerpc/mm/fsl_booke_mmu.c | |||
@@ -56,18 +56,11 @@ | |||
56 | 56 | ||
57 | extern void loadcam_entry(unsigned int index); | 57 | extern void loadcam_entry(unsigned int index); |
58 | unsigned int tlbcam_index; | 58 | unsigned int tlbcam_index; |
59 | unsigned int num_tlbcam_entries; | ||
60 | static unsigned long __cam0, __cam1, __cam2; | 59 | static unsigned long __cam0, __cam1, __cam2; |
61 | 60 | ||
62 | #define NUM_TLBCAMS (16) | 61 | #define NUM_TLBCAMS (16) |
63 | 62 | ||
64 | struct tlbcam { | 63 | struct tlbcam TLBCAM[NUM_TLBCAMS]; |
65 | u32 MAS0; | ||
66 | u32 MAS1; | ||
67 | u32 MAS2; | ||
68 | u32 MAS3; | ||
69 | u32 MAS7; | ||
70 | } TLBCAM[NUM_TLBCAMS]; | ||
71 | 64 | ||
72 | struct tlbcamrange { | 65 | struct tlbcamrange { |
73 | unsigned long start; | 66 | unsigned long start; |
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index ad123bced404..d1f9c62dc177 100644 --- a/arch/powerpc/mm/mmu_decl.h +++ b/arch/powerpc/mm/mmu_decl.h | |||
@@ -75,6 +75,15 @@ extern void _tlbia(void); | |||
75 | #endif /* CONFIG_PPC_MMU_NOHASH */ | 75 | #endif /* CONFIG_PPC_MMU_NOHASH */ |
76 | 76 | ||
77 | #ifdef CONFIG_PPC32 | 77 | #ifdef CONFIG_PPC32 |
78 | |||
79 | struct tlbcam { | ||
80 | u32 MAS0; | ||
81 | u32 MAS1; | ||
82 | u32 MAS2; | ||
83 | u32 MAS3; | ||
84 | u32 MAS7; | ||
85 | }; | ||
86 | |||
78 | extern void mapin_ram(void); | 87 | extern void mapin_ram(void); |
79 | extern int map_page(unsigned long va, phys_addr_t pa, int flags); | 88 | extern int map_page(unsigned long va, phys_addr_t pa, int flags); |
80 | extern void setbat(int index, unsigned long virt, phys_addr_t phys, | 89 | extern void setbat(int index, unsigned long virt, phys_addr_t phys, |
@@ -90,8 +99,6 @@ extern unsigned int rtas_data, rtas_size; | |||
90 | struct hash_pte; | 99 | struct hash_pte; |
91 | extern struct hash_pte *Hash, *Hash_end; | 100 | extern struct hash_pte *Hash, *Hash_end; |
92 | extern unsigned long Hash_size, Hash_mask; | 101 | extern unsigned long Hash_size, Hash_mask; |
93 | |||
94 | extern unsigned int num_tlbcam_entries; | ||
95 | #endif | 102 | #endif |
96 | 103 | ||
97 | extern unsigned long ioremap_bot; | 104 | extern unsigned long ioremap_bot; |
diff --git a/arch/powerpc/mm/stab.c b/arch/powerpc/mm/stab.c index 60e6032a8088..98cd1dc2ae75 100644 --- a/arch/powerpc/mm/stab.c +++ b/arch/powerpc/mm/stab.c | |||
@@ -251,8 +251,8 @@ void __init stabs_alloc(void) | |||
251 | 251 | ||
252 | paca[cpu].stab_addr = newstab; | 252 | paca[cpu].stab_addr = newstab; |
253 | paca[cpu].stab_real = virt_to_abs(newstab); | 253 | paca[cpu].stab_real = virt_to_abs(newstab); |
254 | printk(KERN_INFO "Segment table for CPU %d at 0x%lx " | 254 | printk(KERN_INFO "Segment table for CPU %d at 0x%llx " |
255 | "virtual, 0x%lx absolute\n", | 255 | "virtual, 0x%llx absolute\n", |
256 | cpu, paca[cpu].stab_addr, paca[cpu].stab_real); | 256 | cpu, paca[cpu].stab_addr, paca[cpu].stab_real); |
257 | } | 257 | } |
258 | } | 258 | } |
diff --git a/arch/powerpc/oprofile/op_model_pa6t.c b/arch/powerpc/oprofile/op_model_pa6t.c index c40de461fd4e..42f778dff919 100644 --- a/arch/powerpc/oprofile/op_model_pa6t.c +++ b/arch/powerpc/oprofile/op_model_pa6t.c | |||
@@ -132,7 +132,7 @@ static int pa6t_reg_setup(struct op_counter_config *ctr, | |||
132 | for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) { | 132 | for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) { |
133 | /* counters are 40 bit. Move to cputable at some point? */ | 133 | /* counters are 40 bit. Move to cputable at some point? */ |
134 | reset_value[pmc] = (0x1UL << 39) - ctr[pmc].count; | 134 | reset_value[pmc] = (0x1UL << 39) - ctr[pmc].count; |
135 | pr_debug("reset_value for pmc%u inited to 0x%lx\n", | 135 | pr_debug("reset_value for pmc%u inited to 0x%llx\n", |
136 | pmc, reset_value[pmc]); | 136 | pmc, reset_value[pmc]); |
137 | } | 137 | } |
138 | 138 | ||
@@ -177,7 +177,7 @@ static int pa6t_start(struct op_counter_config *ctr) | |||
177 | 177 | ||
178 | oprofile_running = 1; | 178 | oprofile_running = 1; |
179 | 179 | ||
180 | pr_debug("start on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0); | 180 | pr_debug("start on cpu %d, mmcr0 %llx\n", smp_processor_id(), mmcr0); |
181 | 181 | ||
182 | return 0; | 182 | return 0; |
183 | } | 183 | } |
@@ -193,7 +193,7 @@ static void pa6t_stop(void) | |||
193 | 193 | ||
194 | oprofile_running = 0; | 194 | oprofile_running = 0; |
195 | 195 | ||
196 | pr_debug("stop on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0); | 196 | pr_debug("stop on cpu %d, mmcr0 %llx\n", smp_processor_id(), mmcr0); |
197 | } | 197 | } |
198 | 198 | ||
199 | /* handle the perfmon overflow vector */ | 199 | /* handle the perfmon overflow vector */ |
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c index f416014ee727..1bcff94eb924 100644 --- a/arch/powerpc/platforms/512x/clock.c +++ b/arch/powerpc/platforms/512x/clock.c | |||
@@ -56,12 +56,12 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id) | |||
56 | int dev_match = 0; | 56 | int dev_match = 0; |
57 | int id_match = 0; | 57 | int id_match = 0; |
58 | 58 | ||
59 | if (dev == NULL && id == NULL) | 59 | if (dev == NULL || id == NULL) |
60 | return NULL; | 60 | return NULL; |
61 | 61 | ||
62 | mutex_lock(&clocks_mutex); | 62 | mutex_lock(&clocks_mutex); |
63 | list_for_each_entry(p, &clocks, node) { | 63 | list_for_each_entry(p, &clocks, node) { |
64 | if (dev && dev == p->dev) | 64 | if (dev == p->dev) |
65 | dev_match++; | 65 | dev_match++; |
66 | if (strcmp(id, p->name) == 0) | 66 | if (strcmp(id, p->name) == 0) |
67 | id_match++; | 67 | id_match++; |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c index 8a455ebce98d..07f89ae46d04 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c | |||
@@ -363,11 +363,8 @@ static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio) | |||
363 | { | 363 | { |
364 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | 364 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); |
365 | struct mpc52xx_gpt __iomem *regs = mm_gc->regs; | 365 | struct mpc52xx_gpt __iomem *regs = mm_gc->regs; |
366 | unsigned int ret; | ||
367 | 366 | ||
368 | return (in_be32(®s->status) & (1 << (31 - 23))) ? 1 : 0; | 367 | return (in_be32(®s->status) & (1 << (31 - 23))) ? 1 : 0; |
369 | |||
370 | return ret; | ||
371 | } | 368 | } |
372 | 369 | ||
373 | static void | 370 | static void |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c index 72865e8e4b51..0a093f03c758 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c | |||
@@ -196,6 +196,7 @@ static void mpc52xx_extirq_ack(unsigned int virq) | |||
196 | 196 | ||
197 | static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) | 197 | static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) |
198 | { | 198 | { |
199 | struct irq_desc *desc = get_irq_desc(virq); | ||
199 | u32 ctrl_reg, type; | 200 | u32 ctrl_reg, type; |
200 | int irq; | 201 | int irq; |
201 | int l2irq; | 202 | int l2irq; |
@@ -222,6 +223,11 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) | |||
222 | type = 0; | 223 | type = 0; |
223 | } | 224 | } |
224 | 225 | ||
226 | desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); | ||
227 | desc->status |= flow_type & IRQ_TYPE_SENSE_MASK; | ||
228 | if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) | ||
229 | desc->status |= IRQ_LEVEL; | ||
230 | |||
225 | ctrl_reg = in_be32(&intr->ctrl); | 231 | ctrl_reg = in_be32(&intr->ctrl); |
226 | ctrl_reg &= ~(0x3 << (22 - (l2irq * 2))); | 232 | ctrl_reg &= ~(0x3 << (22 - (l2irq * 2))); |
227 | ctrl_reg |= (type << (22 - (l2irq * 2))); | 233 | ctrl_reg |= (type << (22 - (l2irq * 2))); |
@@ -231,7 +237,7 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) | |||
231 | } | 237 | } |
232 | 238 | ||
233 | static struct irq_chip mpc52xx_extirq_irqchip = { | 239 | static struct irq_chip mpc52xx_extirq_irqchip = { |
234 | .typename = " MPC52xx IRQ[0-3] ", | 240 | .typename = "MPC52xx External", |
235 | .mask = mpc52xx_extirq_mask, | 241 | .mask = mpc52xx_extirq_mask, |
236 | .unmask = mpc52xx_extirq_unmask, | 242 | .unmask = mpc52xx_extirq_unmask, |
237 | .ack = mpc52xx_extirq_ack, | 243 | .ack = mpc52xx_extirq_ack, |
diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile index ba5028e29890..051777c542c7 100644 --- a/arch/powerpc/platforms/83xx/Makefile +++ b/arch/powerpc/platforms/83xx/Makefile | |||
@@ -3,6 +3,7 @@ | |||
3 | # | 3 | # |
4 | obj-y := misc.o usb.o | 4 | obj-y := misc.o usb.o |
5 | obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o | 5 | obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o |
6 | obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o | ||
6 | obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o | 7 | obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o |
7 | obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o | 8 | obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o |
8 | obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o | 9 | obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o |
diff --git a/drivers/i2c/chips/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c index 82a9bcb858b6..82a9bcb858b6 100644 --- a/drivers/i2c/chips/mcu_mpc8349emitx.c +++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | |||
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 47fe2bea9865..200b9cb900ea 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig | |||
@@ -323,4 +323,15 @@ config SIMPLE_GPIO | |||
323 | chip-selects, Ethernet/USB PHY's power and various other small | 323 | chip-selects, Ethernet/USB PHY's power and various other small |
324 | on-board peripherals. | 324 | on-board peripherals. |
325 | 325 | ||
326 | config MCU_MPC8349EMITX | ||
327 | tristate "MPC8349E-mITX MCU driver" | ||
328 | depends on I2C && PPC_83xx | ||
329 | select GENERIC_GPIO | ||
330 | select ARCH_REQUIRE_GPIOLIB | ||
331 | help | ||
332 | Say Y here to enable soft power-off functionality on the Freescale | ||
333 | boards with the MPC8349E-mITX-compatible MCU chips. This driver will | ||
334 | also register MCU GPIOs with the generic GPIO API, so you'll able | ||
335 | to use MCU pins as GPIOs. | ||
336 | |||
326 | endmenu | 337 | endmenu |
diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c index 192a93509372..72254848a228 100644 --- a/arch/powerpc/platforms/cell/beat_interrupt.c +++ b/arch/powerpc/platforms/cell/beat_interrupt.c | |||
@@ -99,7 +99,7 @@ static void beatic_end_irq(unsigned int irq_plug) | |||
99 | err = beat_downcount_of_interrupt(irq_plug); | 99 | err = beat_downcount_of_interrupt(irq_plug); |
100 | if (err != 0) { | 100 | if (err != 0) { |
101 | if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ | 101 | if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ |
102 | panic("Failed to downcount IRQ! Error = %16lx", err); | 102 | panic("Failed to downcount IRQ! Error = %16llx", err); |
103 | 103 | ||
104 | printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug); | 104 | printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug); |
105 | } | 105 | } |
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c index ec7c8f45a215..e6506cd0ff94 100644 --- a/arch/powerpc/platforms/cell/cbe_cpufreq.c +++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c | |||
@@ -118,7 +118,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
118 | policy->cur = cbe_freqs[cur_pmode].frequency; | 118 | policy->cur = cbe_freqs[cur_pmode].frequency; |
119 | 119 | ||
120 | #ifdef CONFIG_SMP | 120 | #ifdef CONFIG_SMP |
121 | policy->cpus = per_cpu(cpu_sibling_map, policy->cpu); | 121 | cpumask_copy(policy->cpus, &per_cpu(cpu_sibling_map, policy->cpu)); |
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); | 124 | cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); |
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c index 08c285b10e30..48ec88a38a12 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_epci.c +++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c | |||
@@ -405,7 +405,7 @@ static int __init celleb_setup_epci(struct device_node *node, | |||
405 | hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1)); | 405 | hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1)); |
406 | if (!hose->cfg_addr) | 406 | if (!hose->cfg_addr) |
407 | goto error; | 407 | goto error; |
408 | pr_debug("EPCI: cfg_addr map 0x%016lx->0x%016lx + 0x%016lx\n", | 408 | pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n", |
409 | r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1)); | 409 | r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1)); |
410 | 410 | ||
411 | if (of_address_to_resource(node, 2, &r)) | 411 | if (of_address_to_resource(node, 2, &r)) |
@@ -413,7 +413,7 @@ static int __init celleb_setup_epci(struct device_node *node, | |||
413 | hose->cfg_data = ioremap(r.start, (r.end - r.start + 1)); | 413 | hose->cfg_data = ioremap(r.start, (r.end - r.start + 1)); |
414 | if (!hose->cfg_data) | 414 | if (!hose->cfg_data) |
415 | goto error; | 415 | goto error; |
416 | pr_debug("EPCI: cfg_data map 0x%016lx->0x%016lx + 0x%016lx\n", | 416 | pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n", |
417 | r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1)); | 417 | r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1)); |
418 | 418 | ||
419 | hose->ops = &celleb_epci_ops; | 419 | hose->ops = &celleb_epci_ops; |
diff --git a/arch/powerpc/platforms/cell/cpufreq_spudemand.c b/arch/powerpc/platforms/cell/cpufreq_spudemand.c index a3c6c01bd6db..968c1c0b4d5b 100644 --- a/arch/powerpc/platforms/cell/cpufreq_spudemand.c +++ b/arch/powerpc/platforms/cell/cpufreq_spudemand.c | |||
@@ -110,7 +110,7 @@ static int spu_gov_govern(struct cpufreq_policy *policy, unsigned int event) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | /* initialize spu_gov_info for all affected cpus */ | 112 | /* initialize spu_gov_info for all affected cpus */ |
113 | for_each_cpu_mask(i, policy->cpus) { | 113 | for_each_cpu(i, policy->cpus) { |
114 | affected_info = &per_cpu(spu_gov_info, i); | 114 | affected_info = &per_cpu(spu_gov_info, i); |
115 | affected_info->policy = policy; | 115 | affected_info->policy = policy; |
116 | } | 116 | } |
@@ -127,7 +127,7 @@ static int spu_gov_govern(struct cpufreq_policy *policy, unsigned int event) | |||
127 | spu_gov_cancel_work(info); | 127 | spu_gov_cancel_work(info); |
128 | 128 | ||
129 | /* clean spu_gov_info for all affected cpus */ | 129 | /* clean spu_gov_info for all affected cpus */ |
130 | for_each_cpu_mask (i, policy->cpus) { | 130 | for_each_cpu (i, policy->cpus) { |
131 | info = &per_cpu(spu_gov_info, i); | 131 | info = &per_cpu(spu_gov_info, i); |
132 | info->policy = NULL; | 132 | info->policy = NULL; |
133 | } | 133 | } |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 88d94b59a7cb..ee5033eddf01 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -855,7 +855,7 @@ static int __init cell_iommu_init_disabled(void) | |||
855 | */ | 855 | */ |
856 | if (np && size < lmb_end_of_DRAM()) { | 856 | if (np && size < lmb_end_of_DRAM()) { |
857 | printk(KERN_WARNING "iommu: force-enabled, dma window" | 857 | printk(KERN_WARNING "iommu: force-enabled, dma window" |
858 | " (%ldMB) smaller than total memory (%ldMB)\n", | 858 | " (%ldMB) smaller than total memory (%lldMB)\n", |
859 | size >> 20, lmb_end_of_DRAM() >> 20); | 859 | size >> 20, lmb_end_of_DRAM() >> 20); |
860 | return -ENODEV; | 860 | return -ENODEV; |
861 | } | 861 | } |
@@ -985,7 +985,7 @@ static void cell_dma_dev_setup_fixed(struct device *dev) | |||
985 | addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base; | 985 | addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base; |
986 | archdata->dma_data = (void *)addr; | 986 | archdata->dma_data = (void *)addr; |
987 | 987 | ||
988 | dev_dbg(dev, "iommu: fixed addr = %lx\n", addr); | 988 | dev_dbg(dev, "iommu: fixed addr = %llx\n", addr); |
989 | } | 989 | } |
990 | 990 | ||
991 | static void insert_16M_pte(unsigned long addr, unsigned long *ptab, | 991 | static void insert_16M_pte(unsigned long addr, unsigned long *ptab, |
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index 7b4cefa2199b..5f961c464cc4 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c | |||
@@ -38,16 +38,16 @@ static void dump_fir(int cpu) | |||
38 | /* Todo: do some nicer parsing of bits and based on them go down | 38 | /* Todo: do some nicer parsing of bits and based on them go down |
39 | * to other sub-units FIRs and not only IIC | 39 | * to other sub-units FIRs and not only IIC |
40 | */ | 40 | */ |
41 | printk(KERN_ERR "Global Checkstop FIR : 0x%016lx\n", | 41 | printk(KERN_ERR "Global Checkstop FIR : 0x%016llx\n", |
42 | in_be64(&pregs->checkstop_fir)); | 42 | in_be64(&pregs->checkstop_fir)); |
43 | printk(KERN_ERR "Global Recoverable FIR : 0x%016lx\n", | 43 | printk(KERN_ERR "Global Recoverable FIR : 0x%016llx\n", |
44 | in_be64(&pregs->checkstop_fir)); | 44 | in_be64(&pregs->checkstop_fir)); |
45 | printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n", | 45 | printk(KERN_ERR "Global MachineCheck FIR : 0x%016llx\n", |
46 | in_be64(&pregs->spec_att_mchk_fir)); | 46 | in_be64(&pregs->spec_att_mchk_fir)); |
47 | 47 | ||
48 | if (iregs == NULL) | 48 | if (iregs == NULL) |
49 | return; | 49 | return; |
50 | printk(KERN_ERR "IOC FIR : 0x%016lx\n", | 50 | printk(KERN_ERR "IOC FIR : 0x%016llx\n", |
51 | in_be64(&iregs->ioc_fir)); | 51 | in_be64(&iregs->ioc_fir)); |
52 | 52 | ||
53 | } | 53 | } |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index a5bdb89a17c3..e487ad68ac11 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -151,7 +151,7 @@ static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb) | |||
151 | { | 151 | { |
152 | struct spu_priv2 __iomem *priv2 = spu->priv2; | 152 | struct spu_priv2 __iomem *priv2 = spu->priv2; |
153 | 153 | ||
154 | pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\n", | 154 | pr_debug("%s: adding SLB[%d] 0x%016llx 0x%016llx\n", |
155 | __func__, slbe, slb->vsid, slb->esid); | 155 | __func__, slbe, slb->vsid, slb->esid); |
156 | 156 | ||
157 | out_be64(&priv2->slb_index_W, slbe); | 157 | out_be64(&priv2->slb_index_W, slbe); |
@@ -221,7 +221,7 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr) | |||
221 | { | 221 | { |
222 | int ret; | 222 | int ret; |
223 | 223 | ||
224 | pr_debug("%s, %lx, %lx\n", __func__, dsisr, ea); | 224 | pr_debug("%s, %llx, %lx\n", __func__, dsisr, ea); |
225 | 225 | ||
226 | /* | 226 | /* |
227 | * Handle kernel space hash faults immediately. User hash | 227 | * Handle kernel space hash faults immediately. User hash |
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c index 19f6bfdbb933..fec1495e6b12 100644 --- a/arch/powerpc/platforms/cell/spu_callbacks.c +++ b/arch/powerpc/platforms/cell/spu_callbacks.c | |||
@@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall_block *s) | |||
54 | long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); | 54 | long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); |
55 | 55 | ||
56 | if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { | 56 | if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { |
57 | pr_debug("%s: invalid syscall #%ld", __func__, s->nr_ret); | 57 | pr_debug("%s: invalid syscall #%lld", __func__, s->nr_ret); |
58 | return -ENOSYS; | 58 | return -ENOSYS; |
59 | } | 59 | } |
60 | 60 | ||
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c index af116aadba10..c4d4a19235e0 100644 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c | |||
@@ -42,7 +42,7 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer, | |||
42 | return spufs_coredump_read[num].read(ctx, buffer, size, off); | 42 | return spufs_coredump_read[num].read(ctx, buffer, size, off); |
43 | 43 | ||
44 | data = spufs_coredump_read[num].get(ctx); | 44 | data = spufs_coredump_read[num].get(ctx); |
45 | ret = snprintf(buffer, size, "0x%.16lx", data); | 45 | ret = snprintf(buffer, size, "0x%.16llx", data); |
46 | if (ret >= size) | 46 | if (ret >= size) |
47 | return size; | 47 | return size; |
48 | return ++ret; /* count trailing NULL */ | 48 | return ++ret; /* count trailing NULL */ |
diff --git a/arch/powerpc/platforms/cell/spufs/fault.c b/arch/powerpc/platforms/cell/spufs/fault.c index f093a581ac74..a4dd3ae7223a 100644 --- a/arch/powerpc/platforms/cell/spufs/fault.c +++ b/arch/powerpc/platforms/cell/spufs/fault.c | |||
@@ -132,7 +132,7 @@ int spufs_handle_class1(struct spu_context *ctx) | |||
132 | 132 | ||
133 | spuctx_switch_state(ctx, SPU_UTIL_IOWAIT); | 133 | spuctx_switch_state(ctx, SPU_UTIL_IOWAIT); |
134 | 134 | ||
135 | pr_debug("ctx %p: ea %016lx, dsisr %016lx state %d\n", ctx, ea, | 135 | pr_debug("ctx %p: ea %016llx, dsisr %016llx state %d\n", ctx, ea, |
136 | dsisr, ctx->state); | 136 | dsisr, ctx->state); |
137 | 137 | ||
138 | ctx->stats.hash_flt++; | 138 | ctx->stats.hash_flt++; |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 7106b63d401b..0da7f2bf5ee1 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -1654,7 +1654,7 @@ out: | |||
1654 | 1654 | ||
1655 | static int spufs_check_valid_dma(struct mfc_dma_command *cmd) | 1655 | static int spufs_check_valid_dma(struct mfc_dma_command *cmd) |
1656 | { | 1656 | { |
1657 | pr_debug("queueing DMA %x %lx %x %x %x\n", cmd->lsa, | 1657 | pr_debug("queueing DMA %x %llx %x %x %x\n", cmd->lsa, |
1658 | cmd->ea, cmd->size, cmd->tag, cmd->cmd); | 1658 | cmd->ea, cmd->size, cmd->tag, cmd->cmd); |
1659 | 1659 | ||
1660 | switch (cmd->cmd) { | 1660 | switch (cmd->cmd) { |
@@ -1671,7 +1671,7 @@ static int spufs_check_valid_dma(struct mfc_dma_command *cmd) | |||
1671 | } | 1671 | } |
1672 | 1672 | ||
1673 | if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) { | 1673 | if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) { |
1674 | pr_debug("invalid DMA alignment, ea %lx lsa %x\n", | 1674 | pr_debug("invalid DMA alignment, ea %llx lsa %x\n", |
1675 | cmd->ea, cmd->lsa); | 1675 | cmd->ea, cmd->lsa); |
1676 | return -EIO; | 1676 | return -EIO; |
1677 | } | 1677 | } |
@@ -2633,7 +2633,7 @@ static int spufs_show_ctx(struct seq_file *s, void *private) | |||
2633 | } | 2633 | } |
2634 | 2634 | ||
2635 | seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)" | 2635 | seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)" |
2636 | " %c %lx %lx %lx %lx %x %x\n", | 2636 | " %c %llx %llx %llx %llx %x %x\n", |
2637 | ctx->state == SPU_STATE_SAVED ? 'S' : 'R', | 2637 | ctx->state == SPU_STATE_SAVED ? 'S' : 'R', |
2638 | ctx->flags, | 2638 | ctx->flags, |
2639 | ctx->sched_flags, | 2639 | ctx->sched_flags, |
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c index 8c619963becc..1db6b9e037fc 100644 --- a/arch/powerpc/platforms/fsl_uli1575.c +++ b/arch/powerpc/platforms/fsl_uli1575.c | |||
@@ -249,6 +249,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288); | |||
249 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); | 249 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); |
250 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249); | 250 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249); |
251 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575); | 251 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575); |
252 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); | ||
252 | 253 | ||
253 | static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev) | 254 | static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev) |
254 | { | 255 | { |
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c index bbe828f1b885..6ed75bffc8ab 100644 --- a/arch/powerpc/platforms/iseries/iommu.c +++ b/arch/powerpc/platforms/iseries/iommu.c | |||
@@ -66,7 +66,7 @@ static int tce_build_iSeries(struct iommu_table *tbl, long index, long npages, | |||
66 | 66 | ||
67 | rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce); | 67 | rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce); |
68 | if (rc) | 68 | if (rc) |
69 | panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", | 69 | panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n", |
70 | rc); | 70 | rc); |
71 | index++; | 71 | index++; |
72 | uaddr += TCE_PAGE_SIZE; | 72 | uaddr += TCE_PAGE_SIZE; |
@@ -81,7 +81,7 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages) | |||
81 | while (npages--) { | 81 | while (npages--) { |
82 | rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0); | 82 | rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0); |
83 | if (rc) | 83 | if (rc) |
84 | panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", | 84 | panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n", |
85 | rc); | 85 | rc); |
86 | index++; | 86 | index++; |
87 | } | 87 | } |
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c index 86db47c1b665..be2527a516ea 100644 --- a/arch/powerpc/platforms/pasemi/cpufreq.c +++ b/arch/powerpc/platforms/pasemi/cpufreq.c | |||
@@ -213,7 +213,7 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
213 | pr_debug("current astate is at %d\n",cur_astate); | 213 | pr_debug("current astate is at %d\n",cur_astate); |
214 | 214 | ||
215 | policy->cur = pas_freqs[cur_astate].frequency; | 215 | policy->cur = pas_freqs[cur_astate].frequency; |
216 | policy->cpus = cpu_online_map; | 216 | cpumask_copy(policy->cpus, &cpu_online_map); |
217 | 217 | ||
218 | ppc_proc_freq = policy->cur * 1000ul; | 218 | ppc_proc_freq = policy->cur * 1000ul; |
219 | 219 | ||
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c index 4dfb4bc242b5..beb38333b6d2 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_64.c +++ b/arch/powerpc/platforms/powermac/cpufreq_64.c | |||
@@ -362,7 +362,7 @@ static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
362 | /* secondary CPUs are tied to the primary one by the | 362 | /* secondary CPUs are tied to the primary one by the |
363 | * cpufreq core if in the secondary policy we tell it that | 363 | * cpufreq core if in the secondary policy we tell it that |
364 | * it actually must be one policy together with all others. */ | 364 | * it actually must be one policy together with all others. */ |
365 | policy->cpus = cpu_online_map; | 365 | cpumask_copy(policy->cpus, &cpu_online_map); |
366 | cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu); | 366 | cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu); |
367 | 367 | ||
368 | return cpufreq_frequency_table_cpuinfo(policy, | 368 | return cpufreq_frequency_table_cpuinfo(policy, |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 6b0711c15eca..bd8817b00fa4 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -53,7 +53,7 @@ | |||
53 | #include <asm/pmac_low_i2c.h> | 53 | #include <asm/pmac_low_i2c.h> |
54 | #include <asm/pmac_pfunc.h> | 54 | #include <asm/pmac_pfunc.h> |
55 | 55 | ||
56 | #define DEBUG | 56 | #undef DEBUG |
57 | 57 | ||
58 | #ifdef DEBUG | 58 | #ifdef DEBUG |
59 | #define DBG(fmt...) udbg_printf(fmt) | 59 | #define DBG(fmt...) udbg_printf(fmt) |
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index c90817acb472..3ee01b4f4257 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -127,10 +127,10 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum, | |||
127 | } | 127 | } |
128 | 128 | ||
129 | if (rc && printk_ratelimit()) { | 129 | if (rc && printk_ratelimit()) { |
130 | printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); | 130 | printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc); |
131 | printk("\tindex = 0x%lx\n", (u64)tbl->it_index); | 131 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
132 | printk("\ttcenum = 0x%lx\n", (u64)tcenum); | 132 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); |
133 | printk("\ttce val = 0x%lx\n", tce ); | 133 | printk("\ttce val = 0x%llx\n", tce ); |
134 | show_stack(current, (unsigned long *)__get_SP()); | 134 | show_stack(current, (unsigned long *)__get_SP()); |
135 | } | 135 | } |
136 | 136 | ||
@@ -210,10 +210,10 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, | |||
210 | } | 210 | } |
211 | 211 | ||
212 | if (rc && printk_ratelimit()) { | 212 | if (rc && printk_ratelimit()) { |
213 | printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); | 213 | printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc); |
214 | printk("\tindex = 0x%lx\n", (u64)tbl->it_index); | 214 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
215 | printk("\tnpages = 0x%lx\n", (u64)npages); | 215 | printk("\tnpages = 0x%llx\n", (u64)npages); |
216 | printk("\ttce[0] val = 0x%lx\n", tcep[0]); | 216 | printk("\ttce[0] val = 0x%llx\n", tcep[0]); |
217 | show_stack(current, (unsigned long *)__get_SP()); | 217 | show_stack(current, (unsigned long *)__get_SP()); |
218 | } | 218 | } |
219 | return ret; | 219 | return ret; |
@@ -227,9 +227,9 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages | |||
227 | rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0); | 227 | rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0); |
228 | 228 | ||
229 | if (rc && printk_ratelimit()) { | 229 | if (rc && printk_ratelimit()) { |
230 | printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); | 230 | printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc); |
231 | printk("\tindex = 0x%lx\n", (u64)tbl->it_index); | 231 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
232 | printk("\ttcenum = 0x%lx\n", (u64)tcenum); | 232 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); |
233 | show_stack(current, (unsigned long *)__get_SP()); | 233 | show_stack(current, (unsigned long *)__get_SP()); |
234 | } | 234 | } |
235 | 235 | ||
@@ -246,9 +246,9 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n | |||
246 | 246 | ||
247 | if (rc && printk_ratelimit()) { | 247 | if (rc && printk_ratelimit()) { |
248 | printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n"); | 248 | printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n"); |
249 | printk("\trc = %ld\n", rc); | 249 | printk("\trc = %lld\n", rc); |
250 | printk("\tindex = 0x%lx\n", (u64)tbl->it_index); | 250 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
251 | printk("\tnpages = 0x%lx\n", (u64)npages); | 251 | printk("\tnpages = 0x%llx\n", (u64)npages); |
252 | show_stack(current, (unsigned long *)__get_SP()); | 252 | show_stack(current, (unsigned long *)__get_SP()); |
253 | } | 253 | } |
254 | } | 254 | } |
@@ -261,10 +261,9 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum) | |||
261 | rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret); | 261 | rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret); |
262 | 262 | ||
263 | if (rc && printk_ratelimit()) { | 263 | if (rc && printk_ratelimit()) { |
264 | printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%ld\n", | 264 | printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n", rc); |
265 | rc); | 265 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
266 | printk("\tindex = 0x%lx\n", (u64)tbl->it_index); | 266 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); |
267 | printk("\ttcenum = 0x%lx\n", (u64)tcenum); | ||
268 | show_stack(current, (unsigned long *)__get_SP()); | 267 | show_stack(current, (unsigned long *)__get_SP()); |
269 | } | 268 | } |
270 | 269 | ||
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index f611d0369cc8..9817f63723dd 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -28,63 +28,104 @@ | |||
28 | #include <sysdev/fsl_pci.h> | 28 | #include <sysdev/fsl_pci.h> |
29 | 29 | ||
30 | #if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx) | 30 | #if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx) |
31 | static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, | ||
32 | unsigned int index, const struct resource *res, | ||
33 | resource_size_t offset) | ||
34 | { | ||
35 | resource_size_t pci_addr = res->start - offset; | ||
36 | resource_size_t phys_addr = res->start; | ||
37 | resource_size_t size = res->end - res->start + 1; | ||
38 | u32 flags = 0x80044000; /* enable & mem R/W */ | ||
39 | unsigned int i; | ||
40 | |||
41 | pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n", | ||
42 | (u64)res->start, (u64)size); | ||
43 | |||
44 | if (res->flags & IORESOURCE_PREFETCH) | ||
45 | flags |= 0x10000000; /* enable relaxed ordering */ | ||
46 | |||
47 | for (i = 0; size > 0; i++) { | ||
48 | unsigned int bits = min(__ilog2(size), | ||
49 | __ffs(pci_addr | phys_addr)); | ||
50 | |||
51 | if (index + i >= 5) | ||
52 | return -1; | ||
53 | |||
54 | out_be32(&pci->pow[index + i].potar, pci_addr >> 12); | ||
55 | out_be32(&pci->pow[index + i].potear, (u64)pci_addr >> 44); | ||
56 | out_be32(&pci->pow[index + i].powbar, phys_addr >> 12); | ||
57 | out_be32(&pci->pow[index + i].powar, flags | (bits - 1)); | ||
58 | |||
59 | pci_addr += (resource_size_t)1U << bits; | ||
60 | phys_addr += (resource_size_t)1U << bits; | ||
61 | size -= (resource_size_t)1U << bits; | ||
62 | } | ||
63 | |||
64 | return i; | ||
65 | } | ||
66 | |||
31 | /* atmu setup for fsl pci/pcie controller */ | 67 | /* atmu setup for fsl pci/pcie controller */ |
32 | static void __init setup_pci_atmu(struct pci_controller *hose, | 68 | static void __init setup_pci_atmu(struct pci_controller *hose, |
33 | struct resource *rsrc) | 69 | struct resource *rsrc) |
34 | { | 70 | { |
35 | struct ccsr_pci __iomem *pci; | 71 | struct ccsr_pci __iomem *pci; |
36 | int i; | 72 | int i, j, n; |
37 | 73 | ||
38 | pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", | 74 | pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", |
39 | (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); | 75 | (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); |
40 | pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1); | 76 | pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1); |
77 | if (!pci) { | ||
78 | dev_err(hose->parent, "Unable to map ATMU registers\n"); | ||
79 | return; | ||
80 | } | ||
41 | 81 | ||
42 | /* Disable all windows (except powar0 since its ignored) */ | 82 | /* Disable all windows (except powar0 since it's ignored) */ |
43 | for(i = 1; i < 5; i++) | 83 | for(i = 1; i < 5; i++) |
44 | out_be32(&pci->pow[i].powar, 0); | 84 | out_be32(&pci->pow[i].powar, 0); |
45 | for(i = 0; i < 3; i++) | 85 | for(i = 0; i < 3; i++) |
46 | out_be32(&pci->piw[i].piwar, 0); | 86 | out_be32(&pci->piw[i].piwar, 0); |
47 | 87 | ||
48 | /* Setup outbound MEM window */ | 88 | /* Setup outbound MEM window */ |
49 | for(i = 0; i < 3; i++) | 89 | for(i = 0, j = 1; i < 3; i++) { |
50 | if (hose->mem_resources[i].flags & IORESOURCE_MEM){ | 90 | if (!(hose->mem_resources[i].flags & IORESOURCE_MEM)) |
51 | resource_size_t pci_addr_start = | 91 | continue; |
52 | hose->mem_resources[i].start - | 92 | |
53 | hose->pci_mem_offset; | 93 | n = setup_one_atmu(pci, j, &hose->mem_resources[i], |
54 | pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n", | 94 | hose->pci_mem_offset); |
55 | (u64)hose->mem_resources[i].start, | 95 | |
56 | (u64)hose->mem_resources[i].end | 96 | if (n < 0 || j >= 5) { |
57 | - (u64)hose->mem_resources[i].start + 1); | 97 | pr_err("Ran out of outbound PCI ATMUs for resource %d!\n", i); |
58 | out_be32(&pci->pow[i+1].potar, (pci_addr_start >> 12)); | 98 | hose->mem_resources[i].flags |= IORESOURCE_DISABLED; |
59 | out_be32(&pci->pow[i+1].potear, 0); | 99 | } else |
60 | out_be32(&pci->pow[i+1].powbar, | 100 | j += n; |
61 | (hose->mem_resources[i].start >> 12)); | 101 | } |
62 | /* Enable, Mem R/W */ | ||
63 | out_be32(&pci->pow[i+1].powar, 0x80044000 | ||
64 | | (__ilog2(hose->mem_resources[i].end | ||
65 | - hose->mem_resources[i].start + 1) - 1)); | ||
66 | } | ||
67 | 102 | ||
68 | /* Setup outbound IO window */ | 103 | /* Setup outbound IO window */ |
69 | if (hose->io_resource.flags & IORESOURCE_IO){ | 104 | if (hose->io_resource.flags & IORESOURCE_IO) { |
70 | pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, " | 105 | if (j >= 5) { |
71 | "phy base 0x%016llx.\n", | 106 | pr_err("Ran out of outbound PCI ATMUs for IO resource\n"); |
72 | (u64)hose->io_resource.start, | 107 | } else { |
73 | (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1, | 108 | pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, " |
74 | (u64)hose->io_base_phys); | 109 | "phy base 0x%016llx.\n", |
75 | out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12)); | 110 | (u64)hose->io_resource.start, |
76 | out_be32(&pci->pow[i+1].potear, 0); | 111 | (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1, |
77 | out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12)); | 112 | (u64)hose->io_base_phys); |
78 | /* Enable, IO R/W */ | 113 | out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12)); |
79 | out_be32(&pci->pow[i+1].powar, 0x80088000 | 114 | out_be32(&pci->pow[j].potear, 0); |
80 | | (__ilog2(hose->io_resource.end | 115 | out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12)); |
81 | - hose->io_resource.start + 1) - 1)); | 116 | /* Enable, IO R/W */ |
117 | out_be32(&pci->pow[j].powar, 0x80088000 | ||
118 | | (__ilog2(hose->io_resource.end | ||
119 | - hose->io_resource.start + 1) - 1)); | ||
120 | } | ||
82 | } | 121 | } |
83 | 122 | ||
84 | /* Setup 2G inbound Memory Window @ 1 */ | 123 | /* Setup 2G inbound Memory Window @ 1 */ |
85 | out_be32(&pci->piw[2].pitar, 0x00000000); | 124 | out_be32(&pci->piw[2].pitar, 0x00000000); |
86 | out_be32(&pci->piw[2].piwbar,0x00000000); | 125 | out_be32(&pci->piw[2].piwbar,0x00000000); |
87 | out_be32(&pci->piw[2].piwar, PIWAR_2G); | 126 | out_be32(&pci->piw[2].piwar, PIWAR_2G); |
127 | |||
128 | iounmap(pci); | ||
88 | } | 129 | } |
89 | 130 | ||
90 | static void __init setup_pci_cmd(struct pci_controller *hose) | 131 | static void __init setup_pci_cmd(struct pci_controller *hose) |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 3e0d89dcdba2..a35297dbac28 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -435,7 +435,7 @@ static void __init mpic_scan_ht_msi(struct mpic *mpic, u8 __iomem *devbase, | |||
435 | addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32); | 435 | addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32); |
436 | } | 436 | } |
437 | 437 | ||
438 | printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%lx\n", | 438 | printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%llx\n", |
439 | PCI_SLOT(devfn), PCI_FUNC(devfn), | 439 | PCI_SLOT(devfn), PCI_FUNC(devfn), |
440 | flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr); | 440 | flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr); |
441 | 441 | ||
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index a94a3c3ae932..6b0a3538dc63 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -77,6 +77,7 @@ mainmenu "Linux Kernel Configuration" | |||
77 | config S390 | 77 | config S390 |
78 | def_bool y | 78 | def_bool y |
79 | select USE_GENERIC_SMP_HELPERS if SMP | 79 | select USE_GENERIC_SMP_HELPERS if SMP |
80 | select HAVE_SYSCALL_WRAPPERS | ||
80 | select HAVE_FUNCTION_TRACER | 81 | select HAVE_FUNCTION_TRACER |
81 | select HAVE_OPROFILE | 82 | select HAVE_OPROFILE |
82 | select HAVE_KPROBES | 83 | select HAVE_KPROBES |
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index f2af4167bd5f..63a23415fba6 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild | |||
@@ -13,4 +13,3 @@ unifdef-y += cmb.h | |||
13 | unifdef-y += debug.h | 13 | unifdef-y += debug.h |
14 | unifdef-y += chpid.h | 14 | unifdef-y += chpid.h |
15 | unifdef-y += schid.h | 15 | unifdef-y += schid.h |
16 | unifdef-y += swab.h | ||
diff --git a/arch/s390/include/asm/byteorder.h b/arch/s390/include/asm/byteorder.h index b95a2b2933fb..a332e59e26fc 100644 --- a/arch/s390/include/asm/byteorder.h +++ b/arch/s390/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _S390_BYTEORDER_H | 1 | #ifndef _S390_BYTEORDER_H |
2 | #define _S390_BYTEORDER_H | 2 | #define _S390_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _S390_BYTEORDER_H */ | 6 | #endif /* _S390_BYTEORDER_H */ |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index fc2c97197a53..6035cd20c7a7 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -547,7 +547,7 @@ sys32_setdomainname_wrapper: | |||
547 | .globl sys32_newuname_wrapper | 547 | .globl sys32_newuname_wrapper |
548 | sys32_newuname_wrapper: | 548 | sys32_newuname_wrapper: |
549 | llgtr %r2,%r2 # struct new_utsname * | 549 | llgtr %r2,%r2 # struct new_utsname * |
550 | jg s390x_newuname # branch to system call | 550 | jg sys_s390_newuname # branch to system call |
551 | 551 | ||
552 | .globl compat_sys_adjtimex_wrapper | 552 | .globl compat_sys_adjtimex_wrapper |
553 | compat_sys_adjtimex_wrapper: | 553 | compat_sys_adjtimex_wrapper: |
@@ -615,7 +615,7 @@ sys32_sysfs_wrapper: | |||
615 | .globl sys32_personality_wrapper | 615 | .globl sys32_personality_wrapper |
616 | sys32_personality_wrapper: | 616 | sys32_personality_wrapper: |
617 | llgfr %r2,%r2 # unsigned long | 617 | llgfr %r2,%r2 # unsigned long |
618 | jg s390x_personality # branch to system call | 618 | jg sys_s390_personality # branch to system call |
619 | 619 | ||
620 | .globl sys32_setfsuid16_wrapper | 620 | .globl sys32_setfsuid16_wrapper |
621 | sys32_setfsuid16_wrapper: | 621 | sys32_setfsuid16_wrapper: |
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index a65afc91e8aa..950c59c6688b 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
@@ -30,23 +30,23 @@ struct fadvise64_64_args; | |||
30 | struct old_sigaction; | 30 | struct old_sigaction; |
31 | struct sel_arg_struct; | 31 | struct sel_arg_struct; |
32 | 32 | ||
33 | long sys_pipe(unsigned long __user *fildes); | ||
34 | long sys_mmap2(struct mmap_arg_struct __user *arg); | 33 | long sys_mmap2(struct mmap_arg_struct __user *arg); |
35 | long old_mmap(struct mmap_arg_struct __user *arg); | 34 | long sys_s390_old_mmap(struct mmap_arg_struct __user *arg); |
36 | long sys_ipc(uint call, int first, unsigned long second, | 35 | long sys_ipc(uint call, int first, unsigned long second, |
37 | unsigned long third, void __user *ptr); | 36 | unsigned long third, void __user *ptr); |
38 | long s390x_newuname(struct new_utsname __user *name); | 37 | long sys_s390_newuname(struct new_utsname __user *name); |
39 | long s390x_personality(unsigned long personality); | 38 | long sys_s390_personality(unsigned long personality); |
40 | long s390_fadvise64(int fd, u32 offset_high, u32 offset_low, | 39 | long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, |
41 | size_t len, int advice); | 40 | size_t len, int advice); |
42 | long s390_fadvise64_64(struct fadvise64_64_args __user *args); | 41 | long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args); |
43 | long s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, u32 len_low); | 42 | long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, |
43 | u32 len_low); | ||
44 | long sys_fork(void); | 44 | long sys_fork(void); |
45 | long sys_clone(void); | 45 | long sys_clone(void); |
46 | long sys_vfork(void); | 46 | long sys_vfork(void); |
47 | void execve_tail(void); | 47 | void execve_tail(void); |
48 | long sys_execve(void); | 48 | long sys_execve(void); |
49 | int sys_sigsuspend(int history0, int history1, old_sigset_t mask); | 49 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); |
50 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | 50 | long sys_sigaction(int sig, const struct old_sigaction __user *act, |
51 | struct old_sigaction __user *oact); | 51 | struct old_sigaction __user *oact); |
52 | long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss); | 52 | long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss); |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index b6110bdf8dc2..5cd38a90e64d 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/tick.h> | 39 | #include <linux/tick.h> |
40 | #include <linux/elfcore.h> | 40 | #include <linux/elfcore.h> |
41 | #include <linux/kernel_stat.h> | 41 | #include <linux/kernel_stat.h> |
42 | #include <linux/syscalls.h> | ||
42 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
43 | #include <asm/pgtable.h> | 44 | #include <asm/pgtable.h> |
44 | #include <asm/system.h> | 45 | #include <asm/system.h> |
@@ -225,13 +226,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp, | |||
225 | return 0; | 226 | return 0; |
226 | } | 227 | } |
227 | 228 | ||
228 | asmlinkage long sys_fork(void) | 229 | SYSCALL_DEFINE0(fork) |
229 | { | 230 | { |
230 | struct pt_regs *regs = task_pt_regs(current); | 231 | struct pt_regs *regs = task_pt_regs(current); |
231 | return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); | 232 | return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); |
232 | } | 233 | } |
233 | 234 | ||
234 | asmlinkage long sys_clone(void) | 235 | SYSCALL_DEFINE0(clone) |
235 | { | 236 | { |
236 | struct pt_regs *regs = task_pt_regs(current); | 237 | struct pt_regs *regs = task_pt_regs(current); |
237 | unsigned long clone_flags; | 238 | unsigned long clone_flags; |
@@ -258,7 +259,7 @@ asmlinkage long sys_clone(void) | |||
258 | * do not have enough call-clobbered registers to hold all | 259 | * do not have enough call-clobbered registers to hold all |
259 | * the information you need. | 260 | * the information you need. |
260 | */ | 261 | */ |
261 | asmlinkage long sys_vfork(void) | 262 | SYSCALL_DEFINE0(vfork) |
262 | { | 263 | { |
263 | struct pt_regs *regs = task_pt_regs(current); | 264 | struct pt_regs *regs = task_pt_regs(current); |
264 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, | 265 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, |
@@ -278,7 +279,7 @@ asmlinkage void execve_tail(void) | |||
278 | /* | 279 | /* |
279 | * sys_execve() executes a new program. | 280 | * sys_execve() executes a new program. |
280 | */ | 281 | */ |
281 | asmlinkage long sys_execve(void) | 282 | SYSCALL_DEFINE0(execve) |
282 | { | 283 | { |
283 | struct pt_regs *regs = task_pt_regs(current); | 284 | struct pt_regs *regs = task_pt_regs(current); |
284 | char *filename; | 285 | char *filename; |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 8e6812a22670..3cf74c3ccb69 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/personality.h> | 25 | #include <linux/personality.h> |
26 | #include <linux/binfmts.h> | 26 | #include <linux/binfmts.h> |
27 | #include <linux/tracehook.h> | 27 | #include <linux/tracehook.h> |
28 | #include <linux/syscalls.h> | ||
28 | #include <asm/ucontext.h> | 29 | #include <asm/ucontext.h> |
29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
30 | #include <asm/lowcore.h> | 31 | #include <asm/lowcore.h> |
@@ -53,8 +54,7 @@ typedef struct | |||
53 | /* | 54 | /* |
54 | * Atomically swap in the new signal mask, and wait for a signal. | 55 | * Atomically swap in the new signal mask, and wait for a signal. |
55 | */ | 56 | */ |
56 | asmlinkage int | 57 | SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask) |
57 | sys_sigsuspend(int history0, int history1, old_sigset_t mask) | ||
58 | { | 58 | { |
59 | mask &= _BLOCKABLE; | 59 | mask &= _BLOCKABLE; |
60 | spin_lock_irq(¤t->sighand->siglock); | 60 | spin_lock_irq(¤t->sighand->siglock); |
@@ -70,9 +70,8 @@ sys_sigsuspend(int history0, int history1, old_sigset_t mask) | |||
70 | return -ERESTARTNOHAND; | 70 | return -ERESTARTNOHAND; |
71 | } | 71 | } |
72 | 72 | ||
73 | asmlinkage long | 73 | SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act, |
74 | sys_sigaction(int sig, const struct old_sigaction __user *act, | 74 | struct old_sigaction __user *, oact) |
75 | struct old_sigaction __user *oact) | ||
76 | { | 75 | { |
77 | struct k_sigaction new_ka, old_ka; | 76 | struct k_sigaction new_ka, old_ka; |
78 | int ret; | 77 | int ret; |
@@ -102,15 +101,13 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
102 | return ret; | 101 | return ret; |
103 | } | 102 | } |
104 | 103 | ||
105 | asmlinkage long | 104 | SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss, |
106 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | 105 | stack_t __user *, uoss) |
107 | { | 106 | { |
108 | struct pt_regs *regs = task_pt_regs(current); | 107 | struct pt_regs *regs = task_pt_regs(current); |
109 | return do_sigaltstack(uss, uoss, regs->gprs[15]); | 108 | return do_sigaltstack(uss, uoss, regs->gprs[15]); |
110 | } | 109 | } |
111 | 110 | ||
112 | |||
113 | |||
114 | /* Returns non-zero on fault. */ | 111 | /* Returns non-zero on fault. */ |
115 | static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | 112 | static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) |
116 | { | 113 | { |
@@ -164,7 +161,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | |||
164 | return 0; | 161 | return 0; |
165 | } | 162 | } |
166 | 163 | ||
167 | asmlinkage long sys_sigreturn(void) | 164 | SYSCALL_DEFINE0(sigreturn) |
168 | { | 165 | { |
169 | struct pt_regs *regs = task_pt_regs(current); | 166 | struct pt_regs *regs = task_pt_regs(current); |
170 | sigframe __user *frame = (sigframe __user *)regs->gprs[15]; | 167 | sigframe __user *frame = (sigframe __user *)regs->gprs[15]; |
@@ -191,7 +188,7 @@ badframe: | |||
191 | return 0; | 188 | return 0; |
192 | } | 189 | } |
193 | 190 | ||
194 | asmlinkage long sys_rt_sigreturn(void) | 191 | SYSCALL_DEFINE0(rt_sigreturn) |
195 | { | 192 | { |
196 | struct pt_regs *regs = task_pt_regs(current); | 193 | struct pt_regs *regs = task_pt_regs(current); |
197 | rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15]; | 194 | rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15]; |
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index c34be4568b80..c7ae4b17e0e3 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/personality.h> | 29 | #include <linux/personality.h> |
30 | #include <linux/unistd.h> | 30 | #include <linux/unistd.h> |
31 | #include <linux/ipc.h> | 31 | #include <linux/ipc.h> |
32 | #include <linux/syscalls.h> | ||
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
33 | #include "entry.h" | 34 | #include "entry.h" |
34 | 35 | ||
@@ -74,7 +75,7 @@ struct mmap_arg_struct { | |||
74 | unsigned long offset; | 75 | unsigned long offset; |
75 | }; | 76 | }; |
76 | 77 | ||
77 | asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg) | 78 | SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg) |
78 | { | 79 | { |
79 | struct mmap_arg_struct a; | 80 | struct mmap_arg_struct a; |
80 | int error = -EFAULT; | 81 | int error = -EFAULT; |
@@ -86,7 +87,7 @@ out: | |||
86 | return error; | 87 | return error; |
87 | } | 88 | } |
88 | 89 | ||
89 | asmlinkage long old_mmap(struct mmap_arg_struct __user *arg) | 90 | SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg) |
90 | { | 91 | { |
91 | struct mmap_arg_struct a; | 92 | struct mmap_arg_struct a; |
92 | long error = -EFAULT; | 93 | long error = -EFAULT; |
@@ -108,8 +109,8 @@ out: | |||
108 | * | 109 | * |
109 | * This is really horribly ugly. | 110 | * This is really horribly ugly. |
110 | */ | 111 | */ |
111 | asmlinkage long sys_ipc(uint call, int first, unsigned long second, | 112 | SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second, |
112 | unsigned long third, void __user *ptr) | 113 | unsigned long, third, void __user *, ptr) |
113 | { | 114 | { |
114 | struct ipc_kludge tmp; | 115 | struct ipc_kludge tmp; |
115 | int ret; | 116 | int ret; |
@@ -175,7 +176,7 @@ asmlinkage long sys_ipc(uint call, int first, unsigned long second, | |||
175 | } | 176 | } |
176 | 177 | ||
177 | #ifdef CONFIG_64BIT | 178 | #ifdef CONFIG_64BIT |
178 | asmlinkage long s390x_newuname(struct new_utsname __user *name) | 179 | SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name) |
179 | { | 180 | { |
180 | int ret = sys_newuname(name); | 181 | int ret = sys_newuname(name); |
181 | 182 | ||
@@ -186,7 +187,7 @@ asmlinkage long s390x_newuname(struct new_utsname __user *name) | |||
186 | return ret; | 187 | return ret; |
187 | } | 188 | } |
188 | 189 | ||
189 | asmlinkage long s390x_personality(unsigned long personality) | 190 | SYSCALL_DEFINE1(s390_personality, unsigned long, personality) |
190 | { | 191 | { |
191 | int ret; | 192 | int ret; |
192 | 193 | ||
@@ -205,15 +206,13 @@ asmlinkage long s390x_personality(unsigned long personality) | |||
205 | */ | 206 | */ |
206 | #ifndef CONFIG_64BIT | 207 | #ifndef CONFIG_64BIT |
207 | 208 | ||
208 | asmlinkage long | 209 | SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, offset_high, u32, offset_low, |
209 | s390_fadvise64(int fd, u32 offset_high, u32 offset_low, size_t len, int advice) | 210 | size_t, len, int, advice) |
210 | { | 211 | { |
211 | return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low, | 212 | return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low, |
212 | len, advice); | 213 | len, advice); |
213 | } | 214 | } |
214 | 215 | ||
215 | #endif | ||
216 | |||
217 | struct fadvise64_64_args { | 216 | struct fadvise64_64_args { |
218 | int fd; | 217 | int fd; |
219 | long long offset; | 218 | long long offset; |
@@ -221,8 +220,7 @@ struct fadvise64_64_args { | |||
221 | int advice; | 220 | int advice; |
222 | }; | 221 | }; |
223 | 222 | ||
224 | asmlinkage long | 223 | SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args) |
225 | s390_fadvise64_64(struct fadvise64_64_args __user *args) | ||
226 | { | 224 | { |
227 | struct fadvise64_64_args a; | 225 | struct fadvise64_64_args a; |
228 | 226 | ||
@@ -231,7 +229,6 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args) | |||
231 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); | 229 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); |
232 | } | 230 | } |
233 | 231 | ||
234 | #ifndef CONFIG_64BIT | ||
235 | /* | 232 | /* |
236 | * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last | 233 | * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last |
237 | * 64 bit argument "len" is split into the upper and lower 32 bits. The | 234 | * 64 bit argument "len" is split into the upper and lower 32 bits. The |
@@ -244,9 +241,19 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args) | |||
244 | * to | 241 | * to |
245 | * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len | 242 | * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len |
246 | */ | 243 | */ |
247 | asmlinkage long s390_fallocate(int fd, int mode, loff_t offset, | 244 | SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset, |
248 | u32 len_high, u32 len_low) | 245 | u32 len_high, u32 len_low) |
249 | { | 246 | { |
250 | return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); | 247 | return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); |
251 | } | 248 | } |
249 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
250 | asmlinkage long SyS_s390_fallocate(long fd, long mode, loff_t offset, | ||
251 | long len_high, long len_low) | ||
252 | { | ||
253 | return SYSC_s390_fallocate((int) fd, (int) mode, offset, | ||
254 | (u32) len_high, (u32) len_low); | ||
255 | } | ||
256 | SYSCALL_ALIAS(sys_s390_fallocate, SyS_s390_fallocate); | ||
257 | #endif | ||
258 | |||
252 | #endif | 259 | #endif |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 2d61787949d5..76d16e0140bb 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -98,7 +98,7 @@ SYSCALL(sys_uselib,sys_uselib,sys32_uselib_wrapper) | |||
98 | SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper) | 98 | SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper) |
99 | SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper) | 99 | SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper) |
100 | SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */ | 100 | SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */ |
101 | SYSCALL(old_mmap,old_mmap,old32_mmap_wrapper) /* 90 */ | 101 | SYSCALL(sys_s390_old_mmap,sys_s390_old_mmap,old32_mmap_wrapper) /* 90 */ |
102 | SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper) | 102 | SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper) |
103 | SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper) | 103 | SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper) |
104 | SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper) | 104 | SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper) |
@@ -130,7 +130,7 @@ SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) | |||
130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) | 130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) |
131 | SYSCALL(sys_clone,sys_clone,sys32_clone) /* 120 */ | 131 | SYSCALL(sys_clone,sys_clone,sys32_clone) /* 120 */ |
132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) | 132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) |
133 | SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper) | 133 | SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper) |
134 | NI_SYSCALL /* modify_ldt for i386 */ | 134 | NI_SYSCALL /* modify_ldt for i386 */ |
135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) | 135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) |
136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ | 136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ |
@@ -144,7 +144,7 @@ SYSCALL(sys_getpgid,sys_getpgid,sys32_getpgid_wrapper) | |||
144 | SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper) | 144 | SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper) |
145 | SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper) | 145 | SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper) |
146 | SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper) /* 135 */ | 146 | SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper) /* 135 */ |
147 | SYSCALL(sys_personality,s390x_personality,sys32_personality_wrapper) | 147 | SYSCALL(sys_personality,sys_s390_personality,sys32_personality_wrapper) |
148 | NI_SYSCALL /* for afs_syscall */ | 148 | NI_SYSCALL /* for afs_syscall */ |
149 | SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper) /* old setfsuid16 syscall */ | 149 | SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper) /* old setfsuid16 syscall */ |
150 | SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper) /* old setfsgid16 syscall */ | 150 | SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper) /* old setfsgid16 syscall */ |
@@ -261,7 +261,7 @@ SYSCALL(sys_epoll_create,sys_epoll_create,sys_epoll_create_wrapper) | |||
261 | SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper) /* 250 */ | 261 | SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper) /* 250 */ |
262 | SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper) | 262 | SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper) |
263 | SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper) | 263 | SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper) |
264 | SYSCALL(s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) | 264 | SYSCALL(sys_s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) |
265 | SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper) | 265 | SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper) |
266 | SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper) /* 255 */ | 266 | SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper) /* 255 */ |
267 | SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper) | 267 | SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper) |
@@ -272,7 +272,7 @@ SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper) /* 260 | |||
272 | SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) | 272 | SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) |
273 | SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) | 273 | SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) |
274 | NI_SYSCALL /* reserved for vserver */ | 274 | NI_SYSCALL /* reserved for vserver */ |
275 | SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) | 275 | SYSCALL(sys_s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) |
276 | SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) | 276 | SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) |
277 | SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) | 277 | SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) |
278 | SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper) | 278 | SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper) |
@@ -322,7 +322,7 @@ NI_SYSCALL /* 310 sys_move_pages */ | |||
322 | SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) | 322 | SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) |
323 | SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) | 323 | SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) |
324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) | 324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) |
325 | SYSCALL(s390_fallocate,sys_fallocate,sys_fallocate_wrapper) | 325 | SYSCALL(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper) |
326 | SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ | 326 | SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ |
327 | SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper) | 327 | SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper) |
328 | NI_SYSCALL /* 317 old sys_timer_fd */ | 328 | NI_SYSCALL /* 317 old sys_timer_fd */ |
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index f1a2a0d1c79c..43910cdf78a5 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild | |||
@@ -6,4 +6,3 @@ unifdef-y += unistd_32.h | |||
6 | unifdef-y += unistd_64.h | 6 | unifdef-y += unistd_64.h |
7 | unifdef-y += posix_types_32.h | 7 | unifdef-y += posix_types_32.h |
8 | unifdef-y += posix_types_64.h | 8 | unifdef-y += posix_types_64.h |
9 | unifdef-y += swab.h | ||
diff --git a/arch/sh/include/asm/byteorder.h b/arch/sh/include/asm/byteorder.h index e95c41a5c8cc..db2f5d7cb17d 100644 --- a/arch/sh/include/asm/byteorder.h +++ b/arch/sh/include/asm/byteorder.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef __ASM_SH_BYTEORDER_H | 1 | #ifndef __ASM_SH_BYTEORDER_H |
2 | #define __ASM_SH_BYTEORDER_H | 2 | #define __ASM_SH_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | |||
6 | #ifdef __LITTLE_ENDIAN__ | 4 | #ifdef __LITTLE_ENDIAN__ |
7 | #include <linux/byteorder/little_endian.h> | 5 | #include <linux/byteorder/little_endian.h> |
8 | #else | 6 | #else |
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h index 104c5e686106..8b30200305c3 100644 --- a/arch/sh/include/asm/syscalls_32.h +++ b/arch/sh/include/asm/syscalls_32.h | |||
@@ -36,9 +36,9 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, | |||
36 | asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | 36 | asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, |
37 | unsigned long r6, unsigned long r7, | 37 | unsigned long r6, unsigned long r7, |
38 | struct pt_regs __regs); | 38 | struct pt_regs __regs); |
39 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | 39 | asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, |
40 | unsigned long r6, unsigned long r7, | 40 | unsigned long r6, unsigned long r7, |
41 | struct pt_regs __regs); | 41 | struct pt_regs __regs); |
42 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, | 42 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, |
43 | size_t count, long dummy, loff_t pos); | 43 | size_t count, long dummy, loff_t pos); |
44 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, | 44 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, |
diff --git a/arch/sh/kernel/sys_sh32.c b/arch/sh/kernel/sys_sh32.c index dbba1e1833d4..63ba12836eae 100644 --- a/arch/sh/kernel/sys_sh32.c +++ b/arch/sh/kernel/sys_sh32.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * sys_pipe() is the normal C calling standard for creating | 22 | * sys_pipe() is the normal C calling standard for creating |
23 | * a pipe. It's not the way Unix traditionally does this, though. | 23 | * a pipe. It's not the way Unix traditionally does this, though. |
24 | */ | 24 | */ |
25 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | 25 | asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, |
26 | unsigned long r6, unsigned long r7, | 26 | unsigned long r6, unsigned long r7, |
27 | struct pt_regs __regs) | 27 | struct pt_regs __regs) |
28 | { | 28 | { |
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index 0af693e65764..e67c1733e1b9 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S | |||
@@ -58,7 +58,7 @@ ENTRY(sys_call_table) | |||
58 | .long sys_mkdir | 58 | .long sys_mkdir |
59 | .long sys_rmdir /* 40 */ | 59 | .long sys_rmdir /* 40 */ |
60 | .long sys_dup | 60 | .long sys_dup |
61 | .long sys_pipe | 61 | .long sys_sh_pipe |
62 | .long sys_times | 62 | .long sys_times |
63 | .long sys_ni_syscall /* old prof syscall holder */ | 63 | .long sys_ni_syscall /* old prof syscall holder */ |
64 | .long sys_brk /* 45 */ | 64 | .long sys_brk /* 45 */ |
@@ -105,7 +105,7 @@ ENTRY(sys_call_table) | |||
105 | .long sys_uselib | 105 | .long sys_uselib |
106 | .long sys_swapon | 106 | .long sys_swapon |
107 | .long sys_reboot | 107 | .long sys_reboot |
108 | .long old_readdir | 108 | .long sys_old_readdir |
109 | .long old_mmap /* 90 */ | 109 | .long old_mmap /* 90 */ |
110 | .long sys_munmap | 110 | .long sys_munmap |
111 | .long sys_truncate | 111 | .long sys_truncate |
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S index 0b436aa3cad7..557cb91f5caf 100644 --- a/arch/sh/kernel/syscalls_64.S +++ b/arch/sh/kernel/syscalls_64.S | |||
@@ -109,7 +109,7 @@ sys_call_table: | |||
109 | .long sys_uselib | 109 | .long sys_uselib |
110 | .long sys_swapon | 110 | .long sys_swapon |
111 | .long sys_reboot | 111 | .long sys_reboot |
112 | .long old_readdir | 112 | .long sys_old_readdir |
113 | .long old_mmap /* 90 */ | 113 | .long old_mmap /* 90 */ |
114 | .long sys_munmap | 114 | .long sys_munmap |
115 | .long sys_truncate | 115 | .long sys_truncate |
diff --git a/arch/sparc/configs/sparc32_defconfig b/arch/sparc/configs/sparc32_defconfig index 2e3a149ea0e7..09ab46e4c59d 100644 --- a/arch/sparc/configs/sparc32_defconfig +++ b/arch/sparc/configs/sparc32_defconfig | |||
@@ -1,15 +1,21 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.25 | 3 | # Linux kernel version: 2.6.28 |
4 | # Tue Apr 29 01:28:58 2008 | 4 | # Thu Jan 8 16:45:44 2009 |
5 | # | 5 | # |
6 | # CONFIG_64BIT is not set | ||
7 | CONFIG_SPARC=y | ||
8 | CONFIG_SPARC32=y | ||
9 | # CONFIG_SPARC64 is not set | ||
10 | CONFIG_ARCH_DEFCONFIG="arch/sparc/configs/sparc32_defconfig" | ||
11 | CONFIG_BITS=32 | ||
12 | CONFIG_AUDIT_ARCH=y | ||
6 | CONFIG_MMU=y | 13 | CONFIG_MMU=y |
7 | CONFIG_HIGHMEM=y | 14 | CONFIG_HIGHMEM=y |
8 | CONFIG_ZONE_DMA=y | 15 | CONFIG_ZONE_DMA=y |
9 | CONFIG_GENERIC_ISA_DMA=y | 16 | CONFIG_GENERIC_ISA_DMA=y |
10 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | 17 | CONFIG_ARCH_NO_VIRT_TO_BUS=y |
11 | CONFIG_OF=y | 18 | CONFIG_OF=y |
12 | CONFIG_HZ=100 | ||
13 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | 19 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
14 | 20 | ||
15 | # | 21 | # |
@@ -66,31 +72,30 @@ CONFIG_SIGNALFD=y | |||
66 | CONFIG_TIMERFD=y | 72 | CONFIG_TIMERFD=y |
67 | CONFIG_EVENTFD=y | 73 | CONFIG_EVENTFD=y |
68 | CONFIG_SHMEM=y | 74 | CONFIG_SHMEM=y |
75 | CONFIG_AIO=y | ||
69 | CONFIG_VM_EVENT_COUNTERS=y | 76 | CONFIG_VM_EVENT_COUNTERS=y |
77 | CONFIG_PCI_QUIRKS=y | ||
70 | CONFIG_SLAB=y | 78 | CONFIG_SLAB=y |
71 | # CONFIG_SLUB is not set | 79 | # CONFIG_SLUB is not set |
72 | # CONFIG_SLOB is not set | 80 | # CONFIG_SLOB is not set |
73 | # CONFIG_PROFILING is not set | 81 | # CONFIG_PROFILING is not set |
74 | # CONFIG_MARKERS is not set | ||
75 | CONFIG_HAVE_OPROFILE=y | 82 | CONFIG_HAVE_OPROFILE=y |
76 | # CONFIG_HAVE_KPROBES is not set | 83 | CONFIG_HAVE_ARCH_TRACEHOOK=y |
77 | # CONFIG_HAVE_KRETPROBES is not set | 84 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set |
78 | CONFIG_PROC_PAGE_MONITOR=y | ||
79 | CONFIG_SLABINFO=y | 85 | CONFIG_SLABINFO=y |
80 | CONFIG_RT_MUTEXES=y | 86 | CONFIG_RT_MUTEXES=y |
81 | # CONFIG_TINY_SHMEM is not set | ||
82 | CONFIG_BASE_SMALL=0 | 87 | CONFIG_BASE_SMALL=0 |
83 | CONFIG_MODULES=y | 88 | CONFIG_MODULES=y |
89 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
84 | CONFIG_MODULE_UNLOAD=y | 90 | CONFIG_MODULE_UNLOAD=y |
85 | # CONFIG_MODULE_FORCE_UNLOAD is not set | 91 | # CONFIG_MODULE_FORCE_UNLOAD is not set |
86 | # CONFIG_MODVERSIONS is not set | 92 | # CONFIG_MODVERSIONS is not set |
87 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 93 | # CONFIG_MODULE_SRCVERSION_ALL is not set |
88 | CONFIG_KMOD=y | ||
89 | CONFIG_BLOCK=y | 94 | CONFIG_BLOCK=y |
90 | # CONFIG_LBD is not set | 95 | # CONFIG_LBD is not set |
91 | # CONFIG_BLK_DEV_IO_TRACE is not set | 96 | # CONFIG_BLK_DEV_IO_TRACE is not set |
92 | # CONFIG_LSF is not set | ||
93 | # CONFIG_BLK_DEV_BSG is not set | 97 | # CONFIG_BLK_DEV_BSG is not set |
98 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
94 | 99 | ||
95 | # | 100 | # |
96 | # IO Schedulers | 101 | # IO Schedulers |
@@ -105,59 +110,73 @@ CONFIG_DEFAULT_CFQ=y | |||
105 | # CONFIG_DEFAULT_NOOP is not set | 110 | # CONFIG_DEFAULT_NOOP is not set |
106 | CONFIG_DEFAULT_IOSCHED="cfq" | 111 | CONFIG_DEFAULT_IOSCHED="cfq" |
107 | CONFIG_CLASSIC_RCU=y | 112 | CONFIG_CLASSIC_RCU=y |
113 | # CONFIG_TREE_RCU is not set | ||
114 | # CONFIG_PREEMPT_RCU is not set | ||
115 | # CONFIG_TREE_RCU_TRACE is not set | ||
116 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
117 | # CONFIG_FREEZER is not set | ||
108 | 118 | ||
109 | # | 119 | # |
110 | # General machine setup | 120 | # Processor type and features |
111 | # | 121 | # |
112 | # CONFIG_SMP is not set | 122 | # CONFIG_SMP is not set |
113 | CONFIG_SPARC=y | 123 | # CONFIG_HZ_100 is not set |
114 | CONFIG_SPARC32=y | 124 | CONFIG_HZ_250=y |
115 | CONFIG_SBUS=y | 125 | # CONFIG_HZ_300 is not set |
116 | CONFIG_SBUSCHAR=y | 126 | # CONFIG_HZ_1000 is not set |
117 | CONFIG_SERIAL_CONSOLE=y | 127 | CONFIG_HZ=250 |
118 | CONFIG_SUN_AUXIO=y | 128 | # CONFIG_SCHED_HRTICK is not set |
119 | CONFIG_SUN_IO=y | ||
120 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 129 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
121 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 130 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
122 | CONFIG_GENERIC_HWEIGHT=y | 131 | CONFIG_GENERIC_HWEIGHT=y |
123 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 132 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
124 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | 133 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y |
125 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | ||
126 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | ||
127 | CONFIG_EMULATED_CMPXCHG=y | 134 | CONFIG_EMULATED_CMPXCHG=y |
128 | CONFIG_SUN_PM=y | ||
129 | # CONFIG_SUN4 is not set | ||
130 | CONFIG_PCI=y | ||
131 | CONFIG_PCI_SYSCALL=y | ||
132 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
133 | CONFIG_PCI_LEGACY=y | ||
134 | # CONFIG_PCI_DEBUG is not set | ||
135 | # CONFIG_NO_DMA is not set | ||
136 | CONFIG_SUN_OPENPROMFS=m | ||
137 | # CONFIG_SPARC_LED is not set | ||
138 | CONFIG_BINFMT_ELF=y | ||
139 | CONFIG_BINFMT_MISC=m | ||
140 | CONFIG_SELECT_MEMORY_MODEL=y | 135 | CONFIG_SELECT_MEMORY_MODEL=y |
141 | CONFIG_FLATMEM_MANUAL=y | 136 | CONFIG_FLATMEM_MANUAL=y |
142 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 137 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
143 | # CONFIG_SPARSEMEM_MANUAL is not set | 138 | # CONFIG_SPARSEMEM_MANUAL is not set |
144 | CONFIG_FLATMEM=y | 139 | CONFIG_FLATMEM=y |
145 | CONFIG_FLAT_NODE_MEM_MAP=y | 140 | CONFIG_FLAT_NODE_MEM_MAP=y |
146 | # CONFIG_SPARSEMEM_STATIC is not set | 141 | CONFIG_PAGEFLAGS_EXTENDED=y |
147 | # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set | ||
148 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 142 | CONFIG_SPLIT_PTLOCK_CPUS=4 |
149 | # CONFIG_RESOURCES_64BIT is not set | 143 | # CONFIG_PHYS_ADDR_T_64BIT is not set |
150 | CONFIG_ZONE_DMA_FLAG=1 | 144 | CONFIG_ZONE_DMA_FLAG=1 |
151 | CONFIG_BOUNCE=y | 145 | CONFIG_BOUNCE=y |
146 | CONFIG_UNEVICTABLE_LRU=y | ||
147 | CONFIG_SUN_PM=y | ||
148 | # CONFIG_SPARC_LED is not set | ||
149 | CONFIG_SERIAL_CONSOLE=y | ||
152 | 150 | ||
153 | # | 151 | # |
154 | # Networking | 152 | # Bus options (PCI etc.) |
155 | # | 153 | # |
154 | CONFIG_SBUS=y | ||
155 | CONFIG_SBUSCHAR=y | ||
156 | CONFIG_PCI=y | ||
157 | CONFIG_PCI_SYSCALL=y | ||
158 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
159 | CONFIG_PCI_LEGACY=y | ||
160 | # CONFIG_PCI_DEBUG is not set | ||
161 | # CONFIG_PCI_STUB is not set | ||
162 | # CONFIG_PCCARD is not set | ||
163 | CONFIG_SUN_OPENPROMFS=m | ||
164 | CONFIG_SPARC32_PCI=y | ||
165 | |||
166 | # | ||
167 | # Executable file formats | ||
168 | # | ||
169 | CONFIG_BINFMT_ELF=y | ||
170 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
171 | # CONFIG_HAVE_AOUT is not set | ||
172 | CONFIG_BINFMT_MISC=m | ||
156 | CONFIG_NET=y | 173 | CONFIG_NET=y |
157 | 174 | ||
158 | # | 175 | # |
159 | # Networking options | 176 | # Networking options |
160 | # | 177 | # |
178 | # CONFIG_NET_NS is not set | ||
179 | CONFIG_COMPAT_NET_DEV_OPS=y | ||
161 | CONFIG_PACKET=y | 180 | CONFIG_PACKET=y |
162 | # CONFIG_PACKET_MMAP is not set | 181 | # CONFIG_PACKET_MMAP is not set |
163 | CONFIG_UNIX=y | 182 | CONFIG_UNIX=y |
@@ -166,6 +185,7 @@ CONFIG_XFRM_USER=m | |||
166 | # CONFIG_XFRM_SUB_POLICY is not set | 185 | # CONFIG_XFRM_SUB_POLICY is not set |
167 | # CONFIG_XFRM_MIGRATE is not set | 186 | # CONFIG_XFRM_MIGRATE is not set |
168 | # CONFIG_XFRM_STATISTICS is not set | 187 | # CONFIG_XFRM_STATISTICS is not set |
188 | CONFIG_XFRM_IPCOMP=y | ||
169 | CONFIG_NET_KEY=m | 189 | CONFIG_NET_KEY=m |
170 | # CONFIG_NET_KEY_MIGRATE is not set | 190 | # CONFIG_NET_KEY_MIGRATE is not set |
171 | CONFIG_INET=y | 191 | CONFIG_INET=y |
@@ -221,6 +241,7 @@ CONFIG_IPV6_TUNNEL=m | |||
221 | # CONFIG_TIPC is not set | 241 | # CONFIG_TIPC is not set |
222 | # CONFIG_ATM is not set | 242 | # CONFIG_ATM is not set |
223 | # CONFIG_BRIDGE is not set | 243 | # CONFIG_BRIDGE is not set |
244 | # CONFIG_NET_DSA is not set | ||
224 | # CONFIG_VLAN_8021Q is not set | 245 | # CONFIG_VLAN_8021Q is not set |
225 | # CONFIG_DECNET is not set | 246 | # CONFIG_DECNET is not set |
226 | # CONFIG_LLC2 is not set | 247 | # CONFIG_LLC2 is not set |
@@ -231,6 +252,7 @@ CONFIG_IPV6_TUNNEL=m | |||
231 | # CONFIG_ECONET is not set | 252 | # CONFIG_ECONET is not set |
232 | # CONFIG_WAN_ROUTER is not set | 253 | # CONFIG_WAN_ROUTER is not set |
233 | # CONFIG_NET_SCHED is not set | 254 | # CONFIG_NET_SCHED is not set |
255 | # CONFIG_DCB is not set | ||
234 | 256 | ||
235 | # | 257 | # |
236 | # Network testing | 258 | # Network testing |
@@ -241,14 +263,14 @@ CONFIG_NET_PKTGEN=m | |||
241 | # CONFIG_IRDA is not set | 263 | # CONFIG_IRDA is not set |
242 | # CONFIG_BT is not set | 264 | # CONFIG_BT is not set |
243 | # CONFIG_AF_RXRPC is not set | 265 | # CONFIG_AF_RXRPC is not set |
244 | 266 | # CONFIG_PHONET is not set | |
245 | # | 267 | CONFIG_WIRELESS=y |
246 | # Wireless | ||
247 | # | ||
248 | # CONFIG_CFG80211 is not set | 268 | # CONFIG_CFG80211 is not set |
269 | CONFIG_WIRELESS_OLD_REGULATORY=y | ||
249 | # CONFIG_WIRELESS_EXT is not set | 270 | # CONFIG_WIRELESS_EXT is not set |
271 | # CONFIG_LIB80211 is not set | ||
250 | # CONFIG_MAC80211 is not set | 272 | # CONFIG_MAC80211 is not set |
251 | # CONFIG_IEEE80211 is not set | 273 | # CONFIG_WIMAX is not set |
252 | # CONFIG_RFKILL is not set | 274 | # CONFIG_RFKILL is not set |
253 | # CONFIG_NET_9P is not set | 275 | # CONFIG_NET_9P is not set |
254 | 276 | ||
@@ -262,7 +284,9 @@ CONFIG_NET_PKTGEN=m | |||
262 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 284 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
263 | CONFIG_STANDALONE=y | 285 | CONFIG_STANDALONE=y |
264 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 286 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
265 | # CONFIG_FW_LOADER is not set | 287 | CONFIG_FW_LOADER=y |
288 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
289 | CONFIG_EXTRA_FIRMWARE="" | ||
266 | # CONFIG_DEBUG_DRIVER is not set | 290 | # CONFIG_DEBUG_DRIVER is not set |
267 | # CONFIG_DEBUG_DEVRES is not set | 291 | # CONFIG_DEBUG_DEVRES is not set |
268 | # CONFIG_SYS_HYPERVISOR is not set | 292 | # CONFIG_SYS_HYPERVISOR is not set |
@@ -286,12 +310,15 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 | |||
286 | # CONFIG_BLK_DEV_XIP is not set | 310 | # CONFIG_BLK_DEV_XIP is not set |
287 | # CONFIG_CDROM_PKTCDVD is not set | 311 | # CONFIG_CDROM_PKTCDVD is not set |
288 | # CONFIG_ATA_OVER_ETH is not set | 312 | # CONFIG_ATA_OVER_ETH is not set |
313 | # CONFIG_BLK_DEV_HD is not set | ||
289 | CONFIG_MISC_DEVICES=y | 314 | CONFIG_MISC_DEVICES=y |
290 | # CONFIG_PHANTOM is not set | 315 | # CONFIG_PHANTOM is not set |
291 | # CONFIG_EEPROM_93CX6 is not set | 316 | # CONFIG_EEPROM_93CX6 is not set |
292 | # CONFIG_SGI_IOC4 is not set | 317 | # CONFIG_SGI_IOC4 is not set |
293 | # CONFIG_TIFM_CORE is not set | 318 | # CONFIG_TIFM_CORE is not set |
294 | # CONFIG_ENCLOSURE_SERVICES is not set | 319 | # CONFIG_ENCLOSURE_SERVICES is not set |
320 | # CONFIG_HP_ILO is not set | ||
321 | # CONFIG_C2PORT is not set | ||
295 | CONFIG_HAVE_IDE=y | 322 | CONFIG_HAVE_IDE=y |
296 | # CONFIG_IDE is not set | 323 | # CONFIG_IDE is not set |
297 | 324 | ||
@@ -335,6 +362,7 @@ CONFIG_SCSI_SPI_ATTRS=y | |||
335 | # CONFIG_SCSI_SRP_ATTRS is not set | 362 | # CONFIG_SCSI_SRP_ATTRS is not set |
336 | CONFIG_SCSI_LOWLEVEL=y | 363 | CONFIG_SCSI_LOWLEVEL=y |
337 | # CONFIG_ISCSI_TCP is not set | 364 | # CONFIG_ISCSI_TCP is not set |
365 | # CONFIG_SCSI_CXGB3_ISCSI is not set | ||
338 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | 366 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set |
339 | # CONFIG_SCSI_3W_9XXX is not set | 367 | # CONFIG_SCSI_3W_9XXX is not set |
340 | # CONFIG_SCSI_ACARD is not set | 368 | # CONFIG_SCSI_ACARD is not set |
@@ -348,6 +376,8 @@ CONFIG_SCSI_LOWLEVEL=y | |||
348 | # CONFIG_MEGARAID_LEGACY is not set | 376 | # CONFIG_MEGARAID_LEGACY is not set |
349 | # CONFIG_MEGARAID_SAS is not set | 377 | # CONFIG_MEGARAID_SAS is not set |
350 | # CONFIG_SCSI_HPTIOP is not set | 378 | # CONFIG_SCSI_HPTIOP is not set |
379 | # CONFIG_LIBFC is not set | ||
380 | # CONFIG_FCOE is not set | ||
351 | # CONFIG_SCSI_DMX3191D is not set | 381 | # CONFIG_SCSI_DMX3191D is not set |
352 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | 382 | # CONFIG_SCSI_FUTURE_DOMAIN is not set |
353 | # CONFIG_SCSI_IPS is not set | 383 | # CONFIG_SCSI_IPS is not set |
@@ -367,6 +397,7 @@ CONFIG_SCSI_QLOGICPTI=m | |||
367 | # CONFIG_SCSI_DEBUG is not set | 397 | # CONFIG_SCSI_DEBUG is not set |
368 | CONFIG_SCSI_SUNESP=y | 398 | CONFIG_SCSI_SUNESP=y |
369 | # CONFIG_SCSI_SRP is not set | 399 | # CONFIG_SCSI_SRP is not set |
400 | # CONFIG_SCSI_DH is not set | ||
370 | # CONFIG_ATA is not set | 401 | # CONFIG_ATA is not set |
371 | # CONFIG_MD is not set | 402 | # CONFIG_MD is not set |
372 | # CONFIG_FUSION is not set | 403 | # CONFIG_FUSION is not set |
@@ -374,11 +405,14 @@ CONFIG_SCSI_SUNESP=y | |||
374 | # | 405 | # |
375 | # IEEE 1394 (FireWire) support | 406 | # IEEE 1394 (FireWire) support |
376 | # | 407 | # |
408 | |||
409 | # | ||
410 | # Enable only one of the two stacks, unless you know what you are doing | ||
411 | # | ||
377 | # CONFIG_FIREWIRE is not set | 412 | # CONFIG_FIREWIRE is not set |
378 | # CONFIG_IEEE1394 is not set | 413 | # CONFIG_IEEE1394 is not set |
379 | # CONFIG_I2O is not set | 414 | # CONFIG_I2O is not set |
380 | CONFIG_NETDEVICES=y | 415 | CONFIG_NETDEVICES=y |
381 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
382 | CONFIG_DUMMY=m | 416 | CONFIG_DUMMY=m |
383 | # CONFIG_BONDING is not set | 417 | # CONFIG_BONDING is not set |
384 | # CONFIG_MACVLAN is not set | 418 | # CONFIG_MACVLAN is not set |
@@ -402,14 +436,16 @@ CONFIG_SUNQE=m | |||
402 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 436 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
403 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 437 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
404 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | 438 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set |
439 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | ||
440 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | ||
441 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | ||
405 | # CONFIG_NET_PCI is not set | 442 | # CONFIG_NET_PCI is not set |
406 | # CONFIG_B44 is not set | 443 | # CONFIG_B44 is not set |
444 | # CONFIG_ATL2 is not set | ||
407 | CONFIG_NETDEV_1000=y | 445 | CONFIG_NETDEV_1000=y |
408 | # CONFIG_ACENIC is not set | 446 | # CONFIG_ACENIC is not set |
409 | # CONFIG_DL2K is not set | 447 | # CONFIG_DL2K is not set |
410 | # CONFIG_E1000 is not set | 448 | # CONFIG_E1000 is not set |
411 | # CONFIG_E1000E is not set | ||
412 | # CONFIG_E1000E_ENABLED is not set | ||
413 | # CONFIG_IP1000 is not set | 449 | # CONFIG_IP1000 is not set |
414 | # CONFIG_IGB is not set | 450 | # CONFIG_IGB is not set |
415 | # CONFIG_MYRI_SBUS is not set | 451 | # CONFIG_MYRI_SBUS is not set |
@@ -425,18 +461,25 @@ CONFIG_NETDEV_1000=y | |||
425 | # CONFIG_BNX2 is not set | 461 | # CONFIG_BNX2 is not set |
426 | # CONFIG_QLA3XXX is not set | 462 | # CONFIG_QLA3XXX is not set |
427 | # CONFIG_ATL1 is not set | 463 | # CONFIG_ATL1 is not set |
464 | # CONFIG_ATL1E is not set | ||
465 | # CONFIG_JME is not set | ||
428 | CONFIG_NETDEV_10000=y | 466 | CONFIG_NETDEV_10000=y |
429 | # CONFIG_CHELSIO_T1 is not set | 467 | # CONFIG_CHELSIO_T1 is not set |
468 | CONFIG_CHELSIO_T3_DEPENDS=y | ||
430 | # CONFIG_CHELSIO_T3 is not set | 469 | # CONFIG_CHELSIO_T3 is not set |
470 | # CONFIG_ENIC is not set | ||
431 | # CONFIG_IXGBE is not set | 471 | # CONFIG_IXGBE is not set |
432 | # CONFIG_IXGB is not set | 472 | # CONFIG_IXGB is not set |
433 | # CONFIG_S2IO is not set | 473 | # CONFIG_S2IO is not set |
434 | # CONFIG_MYRI10GE is not set | 474 | # CONFIG_MYRI10GE is not set |
435 | # CONFIG_NETXEN_NIC is not set | 475 | # CONFIG_NETXEN_NIC is not set |
436 | # CONFIG_NIU is not set | 476 | # CONFIG_NIU is not set |
477 | # CONFIG_MLX4_EN is not set | ||
437 | # CONFIG_MLX4_CORE is not set | 478 | # CONFIG_MLX4_CORE is not set |
438 | # CONFIG_TEHUTI is not set | 479 | # CONFIG_TEHUTI is not set |
439 | # CONFIG_BNX2X is not set | 480 | # CONFIG_BNX2X is not set |
481 | # CONFIG_QLGE is not set | ||
482 | # CONFIG_SFC is not set | ||
440 | # CONFIG_TR is not set | 483 | # CONFIG_TR is not set |
441 | 484 | ||
442 | # | 485 | # |
@@ -445,6 +488,10 @@ CONFIG_NETDEV_10000=y | |||
445 | # CONFIG_WLAN_PRE80211 is not set | 488 | # CONFIG_WLAN_PRE80211 is not set |
446 | # CONFIG_WLAN_80211 is not set | 489 | # CONFIG_WLAN_80211 is not set |
447 | # CONFIG_IWLWIFI_LEDS is not set | 490 | # CONFIG_IWLWIFI_LEDS is not set |
491 | |||
492 | # | ||
493 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
494 | # | ||
448 | # CONFIG_WAN is not set | 495 | # CONFIG_WAN is not set |
449 | # CONFIG_FDDI is not set | 496 | # CONFIG_FDDI is not set |
450 | # CONFIG_HIPPI is not set | 497 | # CONFIG_HIPPI is not set |
@@ -492,9 +539,11 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y | |||
492 | CONFIG_MOUSE_PS2_SYNAPTICS=y | 539 | CONFIG_MOUSE_PS2_SYNAPTICS=y |
493 | CONFIG_MOUSE_PS2_LIFEBOOK=y | 540 | CONFIG_MOUSE_PS2_LIFEBOOK=y |
494 | CONFIG_MOUSE_PS2_TRACKPOINT=y | 541 | CONFIG_MOUSE_PS2_TRACKPOINT=y |
542 | # CONFIG_MOUSE_PS2_ELANTECH is not set | ||
495 | # CONFIG_MOUSE_PS2_TOUCHKIT is not set | 543 | # CONFIG_MOUSE_PS2_TOUCHKIT is not set |
496 | CONFIG_MOUSE_SERIAL=m | 544 | CONFIG_MOUSE_SERIAL=m |
497 | # CONFIG_MOUSE_APPLETOUCH is not set | 545 | # CONFIG_MOUSE_APPLETOUCH is not set |
546 | # CONFIG_MOUSE_BCM5974 is not set | ||
498 | # CONFIG_MOUSE_VSXXXAA is not set | 547 | # CONFIG_MOUSE_VSXXXAA is not set |
499 | # CONFIG_INPUT_JOYSTICK is not set | 548 | # CONFIG_INPUT_JOYSTICK is not set |
500 | # CONFIG_INPUT_TABLET is not set | 549 | # CONFIG_INPUT_TABLET is not set |
@@ -516,15 +565,18 @@ CONFIG_SERIO_LIBPS2=m | |||
516 | # Character devices | 565 | # Character devices |
517 | # | 566 | # |
518 | CONFIG_VT=y | 567 | CONFIG_VT=y |
568 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
519 | CONFIG_VT_CONSOLE=y | 569 | CONFIG_VT_CONSOLE=y |
520 | CONFIG_HW_CONSOLE=y | 570 | CONFIG_HW_CONSOLE=y |
521 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | 571 | # CONFIG_VT_HW_CONSOLE_BINDING is not set |
572 | CONFIG_DEVKMEM=y | ||
522 | # CONFIG_SERIAL_NONSTANDARD is not set | 573 | # CONFIG_SERIAL_NONSTANDARD is not set |
523 | # CONFIG_NOZOMI is not set | 574 | # CONFIG_NOZOMI is not set |
524 | 575 | ||
525 | # | 576 | # |
526 | # Serial drivers | 577 | # Serial drivers |
527 | # | 578 | # |
579 | # CONFIG_SERIAL_8250 is not set | ||
528 | 580 | ||
529 | # | 581 | # |
530 | # Non-8250 serial port support | 582 | # Non-8250 serial port support |
@@ -540,23 +592,20 @@ CONFIG_SERIAL_CORE_CONSOLE=y | |||
540 | CONFIG_CONSOLE_POLL=y | 592 | CONFIG_CONSOLE_POLL=y |
541 | # CONFIG_SERIAL_JSM is not set | 593 | # CONFIG_SERIAL_JSM is not set |
542 | CONFIG_UNIX98_PTYS=y | 594 | CONFIG_UNIX98_PTYS=y |
595 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
543 | CONFIG_LEGACY_PTYS=y | 596 | CONFIG_LEGACY_PTYS=y |
544 | CONFIG_LEGACY_PTY_COUNT=256 | 597 | CONFIG_LEGACY_PTY_COUNT=256 |
545 | # CONFIG_IPMI_HANDLER is not set | 598 | # CONFIG_IPMI_HANDLER is not set |
546 | CONFIG_HW_RANDOM=m | 599 | CONFIG_HW_RANDOM=m |
547 | CONFIG_JS_RTC=m | ||
548 | # CONFIG_R3964 is not set | 600 | # CONFIG_R3964 is not set |
549 | # CONFIG_APPLICOM is not set | 601 | # CONFIG_APPLICOM is not set |
550 | # CONFIG_RAW_DRIVER is not set | 602 | # CONFIG_RAW_DRIVER is not set |
551 | # CONFIG_TCG_TPM is not set | 603 | # CONFIG_TCG_TPM is not set |
552 | CONFIG_DEVPORT=y | 604 | CONFIG_DEVPORT=y |
553 | # CONFIG_I2C is not set | 605 | # CONFIG_I2C is not set |
554 | |||
555 | # | ||
556 | # SPI support | ||
557 | # | ||
558 | # CONFIG_SPI is not set | 606 | # CONFIG_SPI is not set |
559 | # CONFIG_SPI_MASTER is not set | 607 | CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y |
608 | # CONFIG_GPIOLIB is not set | ||
560 | # CONFIG_W1 is not set | 609 | # CONFIG_W1 is not set |
561 | # CONFIG_POWER_SUPPLY is not set | 610 | # CONFIG_POWER_SUPPLY is not set |
562 | CONFIG_HWMON=y | 611 | CONFIG_HWMON=y |
@@ -577,25 +626,38 @@ CONFIG_HWMON=y | |||
577 | # CONFIG_SENSORS_W83627EHF is not set | 626 | # CONFIG_SENSORS_W83627EHF is not set |
578 | # CONFIG_HWMON_DEBUG_CHIP is not set | 627 | # CONFIG_HWMON_DEBUG_CHIP is not set |
579 | # CONFIG_THERMAL is not set | 628 | # CONFIG_THERMAL is not set |
629 | # CONFIG_THERMAL_HWMON is not set | ||
580 | # CONFIG_WATCHDOG is not set | 630 | # CONFIG_WATCHDOG is not set |
631 | CONFIG_SSB_POSSIBLE=y | ||
581 | 632 | ||
582 | # | 633 | # |
583 | # Sonics Silicon Backplane | 634 | # Sonics Silicon Backplane |
584 | # | 635 | # |
585 | CONFIG_SSB_POSSIBLE=y | ||
586 | # CONFIG_SSB is not set | 636 | # CONFIG_SSB is not set |
587 | 637 | ||
588 | # | 638 | # |
589 | # Multifunction device drivers | 639 | # Multifunction device drivers |
590 | # | 640 | # |
641 | # CONFIG_MFD_CORE is not set | ||
591 | # CONFIG_MFD_SM501 is not set | 642 | # CONFIG_MFD_SM501 is not set |
592 | # CONFIG_HTC_PASIC3 is not set | 643 | # CONFIG_HTC_PASIC3 is not set |
644 | # CONFIG_MFD_TMIO is not set | ||
645 | # CONFIG_REGULATOR is not set | ||
593 | 646 | ||
594 | # | 647 | # |
595 | # Multimedia devices | 648 | # Multimedia devices |
596 | # | 649 | # |
650 | |||
651 | # | ||
652 | # Multimedia core support | ||
653 | # | ||
597 | # CONFIG_VIDEO_DEV is not set | 654 | # CONFIG_VIDEO_DEV is not set |
598 | # CONFIG_DVB_CORE is not set | 655 | # CONFIG_DVB_CORE is not set |
656 | # CONFIG_VIDEO_MEDIA is not set | ||
657 | |||
658 | # | ||
659 | # Multimedia drivers | ||
660 | # | ||
599 | # CONFIG_DAB is not set | 661 | # CONFIG_DAB is not set |
600 | 662 | ||
601 | # | 663 | # |
@@ -616,15 +678,17 @@ CONFIG_SSB_POSSIBLE=y | |||
616 | # | 678 | # |
617 | # CONFIG_PROM_CONSOLE is not set | 679 | # CONFIG_PROM_CONSOLE is not set |
618 | CONFIG_DUMMY_CONSOLE=y | 680 | CONFIG_DUMMY_CONSOLE=y |
619 | |||
620 | # | ||
621 | # Sound | ||
622 | # | ||
623 | # CONFIG_SOUND is not set | 681 | # CONFIG_SOUND is not set |
624 | CONFIG_HID_SUPPORT=y | 682 | CONFIG_HID_SUPPORT=y |
625 | CONFIG_HID=y | 683 | CONFIG_HID=y |
626 | # CONFIG_HID_DEBUG is not set | 684 | # CONFIG_HID_DEBUG is not set |
627 | # CONFIG_HIDRAW is not set | 685 | # CONFIG_HIDRAW is not set |
686 | # CONFIG_HID_PID is not set | ||
687 | |||
688 | # | ||
689 | # Special HID drivers | ||
690 | # | ||
691 | CONFIG_HID_COMPAT=y | ||
628 | CONFIG_USB_SUPPORT=y | 692 | CONFIG_USB_SUPPORT=y |
629 | CONFIG_USB_ARCH_HAS_HCD=y | 693 | CONFIG_USB_ARCH_HAS_HCD=y |
630 | CONFIG_USB_ARCH_HAS_OHCI=y | 694 | CONFIG_USB_ARCH_HAS_OHCI=y |
@@ -632,32 +696,71 @@ CONFIG_USB_ARCH_HAS_EHCI=y | |||
632 | # CONFIG_USB is not set | 696 | # CONFIG_USB is not set |
633 | 697 | ||
634 | # | 698 | # |
635 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | 699 | # Enable Host or Gadget support to see Inventra options |
700 | # | ||
701 | |||
702 | # | ||
703 | # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; | ||
636 | # | 704 | # |
637 | # CONFIG_USB_GADGET is not set | 705 | # CONFIG_USB_GADGET is not set |
706 | |||
707 | # | ||
708 | # OTG and related infrastructure | ||
709 | # | ||
710 | # CONFIG_UWB is not set | ||
638 | # CONFIG_MMC is not set | 711 | # CONFIG_MMC is not set |
639 | # CONFIG_MEMSTICK is not set | 712 | # CONFIG_MEMSTICK is not set |
640 | # CONFIG_NEW_LEDS is not set | 713 | # CONFIG_NEW_LEDS is not set |
714 | # CONFIG_ACCESSIBILITY is not set | ||
641 | # CONFIG_INFINIBAND is not set | 715 | # CONFIG_INFINIBAND is not set |
642 | # CONFIG_RTC_CLASS is not set | 716 | CONFIG_RTC_LIB=y |
717 | CONFIG_RTC_CLASS=y | ||
718 | CONFIG_RTC_HCTOSYS=y | ||
719 | CONFIG_RTC_HCTOSYS_DEVICE="rtc0" | ||
720 | # CONFIG_RTC_DEBUG is not set | ||
721 | |||
722 | # | ||
723 | # RTC interfaces | ||
724 | # | ||
725 | CONFIG_RTC_INTF_SYSFS=y | ||
726 | CONFIG_RTC_INTF_PROC=y | ||
727 | CONFIG_RTC_INTF_DEV=y | ||
728 | # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set | ||
729 | # CONFIG_RTC_DRV_TEST is not set | ||
730 | |||
731 | # | ||
732 | # SPI RTC drivers | ||
733 | # | ||
734 | |||
735 | # | ||
736 | # Platform RTC drivers | ||
737 | # | ||
738 | # CONFIG_RTC_DRV_DS1286 is not set | ||
739 | # CONFIG_RTC_DRV_DS1511 is not set | ||
740 | # CONFIG_RTC_DRV_DS1553 is not set | ||
741 | # CONFIG_RTC_DRV_DS1742 is not set | ||
742 | # CONFIG_RTC_DRV_STK17TA8 is not set | ||
743 | # CONFIG_RTC_DRV_M48T86 is not set | ||
744 | # CONFIG_RTC_DRV_M48T35 is not set | ||
745 | CONFIG_RTC_DRV_M48T59=y | ||
746 | # CONFIG_RTC_DRV_BQ4802 is not set | ||
747 | # CONFIG_RTC_DRV_V3020 is not set | ||
748 | |||
749 | # | ||
750 | # on-CPU RTC drivers | ||
751 | # | ||
752 | # CONFIG_DMADEVICES is not set | ||
643 | # CONFIG_UIO is not set | 753 | # CONFIG_UIO is not set |
754 | # CONFIG_STAGING is not set | ||
644 | 755 | ||
645 | # | 756 | # |
646 | # Misc Linux/SPARC drivers | 757 | # Misc Linux/SPARC drivers |
647 | # | 758 | # |
648 | CONFIG_SUN_OPENPROMIO=m | 759 | CONFIG_SUN_OPENPROMIO=m |
649 | CONFIG_SUN_MOSTEK_RTC=m | ||
650 | # CONFIG_SUN_BPP is not set | ||
651 | # CONFIG_SUN_VIDEOPIX is not set | ||
652 | # CONFIG_TADPOLE_TS102_UCTRL is not set | 760 | # CONFIG_TADPOLE_TS102_UCTRL is not set |
653 | # CONFIG_SUN_JSFLASH is not set | 761 | # CONFIG_SUN_JSFLASH is not set |
654 | 762 | ||
655 | # | 763 | # |
656 | # Unix98 PTY support | ||
657 | # | ||
658 | CONFIG_UNIX98_PTY_COUNT=256 | ||
659 | |||
660 | # | ||
661 | # File systems | 764 | # File systems |
662 | # | 765 | # |
663 | CONFIG_EXT2_FS=y | 766 | CONFIG_EXT2_FS=y |
@@ -666,11 +769,12 @@ CONFIG_EXT2_FS_POSIX_ACL=y | |||
666 | CONFIG_EXT2_FS_SECURITY=y | 769 | CONFIG_EXT2_FS_SECURITY=y |
667 | # CONFIG_EXT2_FS_XIP is not set | 770 | # CONFIG_EXT2_FS_XIP is not set |
668 | # CONFIG_EXT3_FS is not set | 771 | # CONFIG_EXT3_FS is not set |
669 | # CONFIG_EXT4DEV_FS is not set | 772 | # CONFIG_EXT4_FS is not set |
670 | CONFIG_FS_MBCACHE=y | 773 | CONFIG_FS_MBCACHE=y |
671 | # CONFIG_REISERFS_FS is not set | 774 | # CONFIG_REISERFS_FS is not set |
672 | # CONFIG_JFS_FS is not set | 775 | # CONFIG_JFS_FS is not set |
673 | CONFIG_FS_POSIX_ACL=y | 776 | CONFIG_FS_POSIX_ACL=y |
777 | CONFIG_FILE_LOCKING=y | ||
674 | # CONFIG_XFS_FS is not set | 778 | # CONFIG_XFS_FS is not set |
675 | # CONFIG_OCFS2_FS is not set | 779 | # CONFIG_OCFS2_FS is not set |
676 | CONFIG_DNOTIFY=y | 780 | CONFIG_DNOTIFY=y |
@@ -702,14 +806,12 @@ CONFIG_ISO9660_FS=m | |||
702 | CONFIG_PROC_FS=y | 806 | CONFIG_PROC_FS=y |
703 | CONFIG_PROC_KCORE=y | 807 | CONFIG_PROC_KCORE=y |
704 | CONFIG_PROC_SYSCTL=y | 808 | CONFIG_PROC_SYSCTL=y |
809 | CONFIG_PROC_PAGE_MONITOR=y | ||
705 | CONFIG_SYSFS=y | 810 | CONFIG_SYSFS=y |
706 | # CONFIG_TMPFS is not set | 811 | # CONFIG_TMPFS is not set |
707 | # CONFIG_HUGETLB_PAGE is not set | 812 | # CONFIG_HUGETLB_PAGE is not set |
708 | # CONFIG_CONFIGFS_FS is not set | 813 | # CONFIG_CONFIGFS_FS is not set |
709 | 814 | CONFIG_MISC_FILESYSTEMS=y | |
710 | # | ||
711 | # Miscellaneous filesystems | ||
712 | # | ||
713 | # CONFIG_ADFS_FS is not set | 815 | # CONFIG_ADFS_FS is not set |
714 | # CONFIG_AFFS_FS is not set | 816 | # CONFIG_AFFS_FS is not set |
715 | # CONFIG_HFS_FS is not set | 817 | # CONFIG_HFS_FS is not set |
@@ -720,6 +822,7 @@ CONFIG_SYSFS=y | |||
720 | # CONFIG_CRAMFS is not set | 822 | # CONFIG_CRAMFS is not set |
721 | # CONFIG_VXFS_FS is not set | 823 | # CONFIG_VXFS_FS is not set |
722 | # CONFIG_MINIX_FS is not set | 824 | # CONFIG_MINIX_FS is not set |
825 | # CONFIG_OMFS_FS is not set | ||
723 | # CONFIG_HPFS_FS is not set | 826 | # CONFIG_HPFS_FS is not set |
724 | # CONFIG_QNX4FS_FS is not set | 827 | # CONFIG_QNX4FS_FS is not set |
725 | CONFIG_ROMFS_FS=m | 828 | CONFIG_ROMFS_FS=m |
@@ -729,13 +832,13 @@ CONFIG_NETWORK_FILESYSTEMS=y | |||
729 | CONFIG_NFS_FS=y | 832 | CONFIG_NFS_FS=y |
730 | # CONFIG_NFS_V3 is not set | 833 | # CONFIG_NFS_V3 is not set |
731 | # CONFIG_NFS_V4 is not set | 834 | # CONFIG_NFS_V4 is not set |
732 | # CONFIG_NFSD is not set | ||
733 | CONFIG_ROOT_NFS=y | 835 | CONFIG_ROOT_NFS=y |
836 | # CONFIG_NFSD is not set | ||
734 | CONFIG_LOCKD=y | 837 | CONFIG_LOCKD=y |
735 | CONFIG_NFS_COMMON=y | 838 | CONFIG_NFS_COMMON=y |
736 | CONFIG_SUNRPC=y | 839 | CONFIG_SUNRPC=y |
737 | CONFIG_SUNRPC_GSS=m | 840 | CONFIG_SUNRPC_GSS=m |
738 | # CONFIG_SUNRPC_BIND34 is not set | 841 | # CONFIG_SUNRPC_REGISTER_V4 is not set |
739 | CONFIG_RPCSEC_GSS_KRB5=m | 842 | CONFIG_RPCSEC_GSS_KRB5=m |
740 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 843 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
741 | # CONFIG_SMB_FS is not set | 844 | # CONFIG_SMB_FS is not set |
@@ -806,9 +909,12 @@ CONFIG_MAGIC_SYSRQ=y | |||
806 | # CONFIG_HEADERS_CHECK is not set | 909 | # CONFIG_HEADERS_CHECK is not set |
807 | CONFIG_DEBUG_KERNEL=y | 910 | CONFIG_DEBUG_KERNEL=y |
808 | CONFIG_DETECT_SOFTLOCKUP=y | 911 | CONFIG_DETECT_SOFTLOCKUP=y |
912 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
913 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
809 | # CONFIG_SCHED_DEBUG is not set | 914 | # CONFIG_SCHED_DEBUG is not set |
810 | # CONFIG_SCHEDSTATS is not set | 915 | # CONFIG_SCHEDSTATS is not set |
811 | # CONFIG_TIMER_STATS is not set | 916 | # CONFIG_TIMER_STATS is not set |
917 | # CONFIG_DEBUG_OBJECTS is not set | ||
812 | # CONFIG_DEBUG_SLAB is not set | 918 | # CONFIG_DEBUG_SLAB is not set |
813 | # CONFIG_DEBUG_RT_MUTEXES is not set | 919 | # CONFIG_DEBUG_RT_MUTEXES is not set |
814 | # CONFIG_RT_MUTEX_TESTER is not set | 920 | # CONFIG_RT_MUTEX_TESTER is not set |
@@ -822,37 +928,59 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
822 | # CONFIG_DEBUG_INFO is not set | 928 | # CONFIG_DEBUG_INFO is not set |
823 | # CONFIG_DEBUG_VM is not set | 929 | # CONFIG_DEBUG_VM is not set |
824 | # CONFIG_DEBUG_WRITECOUNT is not set | 930 | # CONFIG_DEBUG_WRITECOUNT is not set |
931 | CONFIG_DEBUG_MEMORY_INIT=y | ||
825 | # CONFIG_DEBUG_LIST is not set | 932 | # CONFIG_DEBUG_LIST is not set |
826 | # CONFIG_DEBUG_SG is not set | 933 | # CONFIG_DEBUG_SG is not set |
827 | CONFIG_FRAME_POINTER=y | 934 | # CONFIG_DEBUG_NOTIFIERS is not set |
828 | # CONFIG_BOOT_PRINTK_DELAY is not set | 935 | # CONFIG_BOOT_PRINTK_DELAY is not set |
829 | # CONFIG_RCU_TORTURE_TEST is not set | 936 | # CONFIG_RCU_TORTURE_TEST is not set |
937 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
830 | # CONFIG_BACKTRACE_SELF_TEST is not set | 938 | # CONFIG_BACKTRACE_SELF_TEST is not set |
939 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
831 | # CONFIG_FAULT_INJECTION is not set | 940 | # CONFIG_FAULT_INJECTION is not set |
941 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
942 | |||
943 | # | ||
944 | # Tracers | ||
945 | # | ||
946 | # CONFIG_SCHED_TRACER is not set | ||
947 | # CONFIG_CONTEXT_SWITCH_TRACER is not set | ||
948 | # CONFIG_BOOT_TRACER is not set | ||
949 | # CONFIG_TRACE_BRANCH_PROFILING is not set | ||
950 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | ||
832 | # CONFIG_SAMPLES is not set | 951 | # CONFIG_SAMPLES is not set |
833 | CONFIG_KGDB=y | ||
834 | CONFIG_HAVE_ARCH_KGDB=y | 952 | CONFIG_HAVE_ARCH_KGDB=y |
953 | CONFIG_KGDB=y | ||
835 | CONFIG_KGDB_SERIAL_CONSOLE=y | 954 | CONFIG_KGDB_SERIAL_CONSOLE=y |
836 | CONFIG_KGDB_TESTS=y | 955 | CONFIG_KGDB_TESTS=y |
837 | # CONFIG_KGDB_TESTS_ON_BOOT is not set | 956 | # CONFIG_KGDB_TESTS_ON_BOOT is not set |
838 | # CONFIG_DEBUG_STACK_USAGE is not set | 957 | # CONFIG_DEBUG_STACK_USAGE is not set |
958 | # CONFIG_STACK_DEBUG is not set | ||
839 | 959 | ||
840 | # | 960 | # |
841 | # Security options | 961 | # Security options |
842 | # | 962 | # |
843 | # CONFIG_KEYS is not set | 963 | # CONFIG_KEYS is not set |
844 | # CONFIG_SECURITY is not set | 964 | # CONFIG_SECURITY is not set |
965 | # CONFIG_SECURITYFS is not set | ||
845 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | 966 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set |
846 | CONFIG_CRYPTO=y | 967 | CONFIG_CRYPTO=y |
847 | 968 | ||
848 | # | 969 | # |
849 | # Crypto core or helper | 970 | # Crypto core or helper |
850 | # | 971 | # |
972 | # CONFIG_CRYPTO_FIPS is not set | ||
851 | CONFIG_CRYPTO_ALGAPI=y | 973 | CONFIG_CRYPTO_ALGAPI=y |
974 | CONFIG_CRYPTO_ALGAPI2=y | ||
852 | CONFIG_CRYPTO_AEAD=y | 975 | CONFIG_CRYPTO_AEAD=y |
976 | CONFIG_CRYPTO_AEAD2=y | ||
853 | CONFIG_CRYPTO_BLKCIPHER=y | 977 | CONFIG_CRYPTO_BLKCIPHER=y |
978 | CONFIG_CRYPTO_BLKCIPHER2=y | ||
854 | CONFIG_CRYPTO_HASH=y | 979 | CONFIG_CRYPTO_HASH=y |
980 | CONFIG_CRYPTO_HASH2=y | ||
981 | CONFIG_CRYPTO_RNG2=y | ||
855 | CONFIG_CRYPTO_MANAGER=y | 982 | CONFIG_CRYPTO_MANAGER=y |
983 | CONFIG_CRYPTO_MANAGER2=y | ||
856 | # CONFIG_CRYPTO_GF128MUL is not set | 984 | # CONFIG_CRYPTO_GF128MUL is not set |
857 | CONFIG_CRYPTO_NULL=m | 985 | CONFIG_CRYPTO_NULL=m |
858 | # CONFIG_CRYPTO_CRYPTD is not set | 986 | # CONFIG_CRYPTO_CRYPTD is not set |
@@ -890,6 +1018,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
890 | CONFIG_CRYPTO_MD4=y | 1018 | CONFIG_CRYPTO_MD4=y |
891 | CONFIG_CRYPTO_MD5=y | 1019 | CONFIG_CRYPTO_MD5=y |
892 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1020 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1021 | # CONFIG_CRYPTO_RMD128 is not set | ||
1022 | # CONFIG_CRYPTO_RMD160 is not set | ||
1023 | # CONFIG_CRYPTO_RMD256 is not set | ||
1024 | # CONFIG_CRYPTO_RMD320 is not set | ||
893 | CONFIG_CRYPTO_SHA1=y | 1025 | CONFIG_CRYPTO_SHA1=y |
894 | CONFIG_CRYPTO_SHA256=m | 1026 | CONFIG_CRYPTO_SHA256=m |
895 | CONFIG_CRYPTO_SHA512=m | 1027 | CONFIG_CRYPTO_SHA512=m |
@@ -921,15 +1053,21 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m | |||
921 | # | 1053 | # |
922 | CONFIG_CRYPTO_DEFLATE=y | 1054 | CONFIG_CRYPTO_DEFLATE=y |
923 | # CONFIG_CRYPTO_LZO is not set | 1055 | # CONFIG_CRYPTO_LZO is not set |
1056 | |||
1057 | # | ||
1058 | # Random Number Generation | ||
1059 | # | ||
1060 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
924 | # CONFIG_CRYPTO_HW is not set | 1061 | # CONFIG_CRYPTO_HW is not set |
925 | 1062 | ||
926 | # | 1063 | # |
927 | # Library routines | 1064 | # Library routines |
928 | # | 1065 | # |
929 | CONFIG_BITREVERSE=y | 1066 | CONFIG_BITREVERSE=y |
930 | # CONFIG_GENERIC_FIND_FIRST_BIT is not set | 1067 | CONFIG_GENERIC_FIND_LAST_BIT=y |
931 | # CONFIG_CRC_CCITT is not set | 1068 | # CONFIG_CRC_CCITT is not set |
932 | # CONFIG_CRC16 is not set | 1069 | # CONFIG_CRC16 is not set |
1070 | # CONFIG_CRC_T10DIF is not set | ||
933 | # CONFIG_CRC_ITU_T is not set | 1071 | # CONFIG_CRC_ITU_T is not set |
934 | CONFIG_CRC32=y | 1072 | CONFIG_CRC32=y |
935 | # CONFIG_CRC7 is not set | 1073 | # CONFIG_CRC7 is not set |
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index 95e38a43dff0..deeb0fba8029 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild | |||
@@ -17,4 +17,3 @@ header-y += traps.h | |||
17 | header-y += uctx.h | 17 | header-y += uctx.h |
18 | header-y += utrap.h | 18 | header-y += utrap.h |
19 | header-y += watchdog.h | 19 | header-y += watchdog.h |
20 | header-y += swab.h | ||
diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h index 48a047cd6fa9..ccc1b6b7de6c 100644 --- a/arch/sparc/include/asm/byteorder.h +++ b/arch/sparc/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _SPARC_BYTEORDER_H | 1 | #ifndef _SPARC_BYTEORDER_H |
2 | #define _SPARC_BYTEORDER_H | 2 | #define _SPARC_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _SPARC_BYTEORDER_H */ | 6 | #endif /* _SPARC_BYTEORDER_H */ |
diff --git a/arch/sparc/include/asm/oplib_32.h b/arch/sparc/include/asm/oplib_32.h index 73d45521db04..33e31ce6b31f 100644 --- a/arch/sparc/include/asm/oplib_32.h +++ b/arch/sparc/include/asm/oplib_32.h | |||
@@ -177,17 +177,6 @@ extern void prom_putsegment(int context, unsigned long virt_addr, | |||
177 | 177 | ||
178 | /* PROM device tree traversal functions... */ | 178 | /* PROM device tree traversal functions... */ |
179 | 179 | ||
180 | #ifdef PROMLIB_INTERNAL | ||
181 | |||
182 | /* Internal version of prom_getchild. */ | ||
183 | extern int __prom_getchild(int parent_node); | ||
184 | |||
185 | /* Internal version of prom_getsibling. */ | ||
186 | extern int __prom_getsibling(int node); | ||
187 | |||
188 | #endif | ||
189 | |||
190 | |||
191 | /* Get the child node of the given node, or zero if no child exists. */ | 180 | /* Get the child node of the given node, or zero if no child exists. */ |
192 | extern int prom_getchild(int parent_node); | 181 | extern int prom_getchild(int parent_node); |
193 | 182 | ||
diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h index 6d2c2ca98039..a5db0317b5fb 100644 --- a/arch/sparc/include/asm/oplib_64.h +++ b/arch/sparc/include/asm/oplib_64.h | |||
@@ -218,16 +218,6 @@ extern void prom_unmap(unsigned long size, unsigned long vaddr); | |||
218 | 218 | ||
219 | /* PROM device tree traversal functions... */ | 219 | /* PROM device tree traversal functions... */ |
220 | 220 | ||
221 | #ifdef PROMLIB_INTERNAL | ||
222 | |||
223 | /* Internal version of prom_getchild. */ | ||
224 | extern int __prom_getchild(int parent_node); | ||
225 | |||
226 | /* Internal version of prom_getsibling. */ | ||
227 | extern int __prom_getsibling(int node); | ||
228 | |||
229 | #endif | ||
230 | |||
231 | /* Get the child node of the given node, or zero if no child exists. */ | 221 | /* Get the child node of the given node, or zero if no child exists. */ |
232 | extern int prom_getchild(int parent_node); | 222 | extern int prom_getchild(int parent_node); |
233 | 223 | ||
diff --git a/arch/sparc/include/asm/signal.h b/arch/sparc/include/asm/signal.h index 41535e77b255..cba45206b7f2 100644 --- a/arch/sparc/include/asm/signal.h +++ b/arch/sparc/include/asm/signal.h | |||
@@ -84,7 +84,11 @@ | |||
84 | 84 | ||
85 | #define __OLD_NSIG 32 | 85 | #define __OLD_NSIG 32 |
86 | #define __NEW_NSIG 64 | 86 | #define __NEW_NSIG 64 |
87 | #ifdef __arch64__ | ||
87 | #define _NSIG_BPW 64 | 88 | #define _NSIG_BPW 64 |
89 | #else | ||
90 | #define _NSIG_BPW 32 | ||
91 | #endif | ||
88 | #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW) | 92 | #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW) |
89 | 93 | ||
90 | #define SIGRTMIN 32 | 94 | #define SIGRTMIN 32 |
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h index b8a65b64e1df..5bc0b8fd6374 100644 --- a/arch/sparc/include/asm/topology_64.h +++ b/arch/sparc/include/asm/topology_64.h | |||
@@ -47,6 +47,10 @@ static inline int pcibus_to_node(struct pci_bus *pbus) | |||
47 | (pcibus_to_node(bus) == -1 ? \ | 47 | (pcibus_to_node(bus) == -1 ? \ |
48 | CPU_MASK_ALL : \ | 48 | CPU_MASK_ALL : \ |
49 | node_to_cpumask(pcibus_to_node(bus))) | 49 | node_to_cpumask(pcibus_to_node(bus))) |
50 | #define cpumask_of_pcibus(bus) \ | ||
51 | (pcibus_to_node(bus) == -1 ? \ | ||
52 | CPU_MASK_ALL_PTR : \ | ||
53 | cpumask_of_node(pcibus_to_node(bus))) | ||
50 | 54 | ||
51 | #define SD_NODE_INIT (struct sched_domain) { \ | 55 | #define SD_NODE_INIT (struct sched_domain) { \ |
52 | .min_interval = 8, \ | 56 | .min_interval = 8, \ |
diff --git a/arch/sparc/kernel/auxio_32.c b/arch/sparc/kernel/auxio_32.c index 09c857215a52..45c41232fc4c 100644 --- a/arch/sparc/kernel/auxio_32.c +++ b/arch/sparc/kernel/auxio_32.c | |||
@@ -76,6 +76,7 @@ unsigned char get_auxio(void) | |||
76 | return sbus_readb(auxio_register); | 76 | return sbus_readb(auxio_register); |
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |
79 | EXPORT_SYMBOL(get_auxio); | ||
79 | 80 | ||
80 | void set_auxio(unsigned char bits_on, unsigned char bits_off) | 81 | void set_auxio(unsigned char bits_on, unsigned char bits_off) |
81 | { | 82 | { |
@@ -102,7 +103,7 @@ void set_auxio(unsigned char bits_on, unsigned char bits_off) | |||
102 | }; | 103 | }; |
103 | spin_unlock_irqrestore(&auxio_lock, flags); | 104 | spin_unlock_irqrestore(&auxio_lock, flags); |
104 | } | 105 | } |
105 | 106 | EXPORT_SYMBOL(set_auxio); | |
106 | 107 | ||
107 | /* sun4m power control register (AUXIO2) */ | 108 | /* sun4m power control register (AUXIO2) */ |
108 | 109 | ||
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c index 8b67347d4221..9f52db2d441c 100644 --- a/arch/sparc/kernel/auxio_64.c +++ b/arch/sparc/kernel/auxio_64.c | |||
@@ -72,6 +72,7 @@ void auxio_set_led(int on) | |||
72 | bit = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED); | 72 | bit = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED); |
73 | __auxio_set_bit(bit, on, ebus); | 73 | __auxio_set_bit(bit, on, ebus); |
74 | } | 74 | } |
75 | EXPORT_SYMBOL(auxio_set_led); | ||
75 | 76 | ||
76 | static void __auxio_sbus_set_lte(int on) | 77 | static void __auxio_sbus_set_lte(int on) |
77 | { | 78 | { |
@@ -90,6 +91,7 @@ void auxio_set_lte(int on) | |||
90 | break; | 91 | break; |
91 | } | 92 | } |
92 | } | 93 | } |
94 | EXPORT_SYMBOL(auxio_set_lte); | ||
93 | 95 | ||
94 | static struct of_device_id __initdata auxio_match[] = { | 96 | static struct of_device_id __initdata auxio_match[] = { |
95 | { | 97 | { |
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index 6c2da2420f76..f0b825505da5 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c | |||
@@ -5,6 +5,7 @@ | |||
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
8 | #include <linux/module.h> | ||
8 | #include <linux/init.h> | 9 | #include <linux/init.h> |
9 | #include <linux/smp.h> | 10 | #include <linux/smp.h> |
10 | #include <linux/threads.h> | 11 | #include <linux/threads.h> |
@@ -20,6 +21,7 @@ | |||
20 | #include "kernel.h" | 21 | #include "kernel.h" |
21 | 22 | ||
22 | DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; | 23 | DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; |
24 | EXPORT_PER_CPU_SYMBOL(__cpu_data); | ||
23 | 25 | ||
24 | struct cpu_info { | 26 | struct cpu_info { |
25 | int psr_vers; | 27 | int psr_vers; |
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index faf9ccd9ef5d..f41ecc5ac0b4 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S | |||
@@ -1088,8 +1088,8 @@ sunos_execv: | |||
1088 | ld [%sp + STACKFRAME_SZ + PT_I0], %o0 | 1088 | ld [%sp + STACKFRAME_SZ + PT_I0], %o0 |
1089 | 1089 | ||
1090 | .align 4 | 1090 | .align 4 |
1091 | .globl sys_pipe | 1091 | .globl sys_sparc_pipe |
1092 | sys_pipe: | 1092 | sys_sparc_pipe: |
1093 | mov %o7, %l5 | 1093 | mov %o7, %l5 |
1094 | add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg | 1094 | add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg |
1095 | call sparc_pipe | 1095 | call sparc_pipe |
diff --git a/arch/sparc/kernel/idprom.c b/arch/sparc/kernel/idprom.c index c16135e0c151..57922f69c3f7 100644 --- a/arch/sparc/kernel/idprom.c +++ b/arch/sparc/kernel/idprom.c | |||
@@ -8,11 +8,14 @@ | |||
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/module.h> | ||
11 | 12 | ||
12 | #include <asm/oplib.h> | 13 | #include <asm/oplib.h> |
13 | #include <asm/idprom.h> | 14 | #include <asm/idprom.h> |
14 | 15 | ||
15 | struct idprom *idprom; | 16 | struct idprom *idprom; |
17 | EXPORT_SYMBOL(idprom); | ||
18 | |||
16 | static struct idprom idprom_buffer; | 19 | static struct idprom idprom_buffer; |
17 | 20 | ||
18 | #ifdef CONFIG_SPARC32 | 21 | #ifdef CONFIG_SPARC32 |
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 7ce14f05eb48..87ea0d03d975 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -120,6 +120,7 @@ void __iomem *ioremap(unsigned long offset, unsigned long size) | |||
120 | sprintf(name, "phys_%08x", (u32)offset); | 120 | sprintf(name, "phys_%08x", (u32)offset); |
121 | return _sparc_alloc_io(0, offset, size, name); | 121 | return _sparc_alloc_io(0, offset, size, name); |
122 | } | 122 | } |
123 | EXPORT_SYMBOL(ioremap); | ||
123 | 124 | ||
124 | /* | 125 | /* |
125 | * Comlimentary to ioremap(). | 126 | * Comlimentary to ioremap(). |
@@ -141,6 +142,7 @@ void iounmap(volatile void __iomem *virtual) | |||
141 | kfree(res); | 142 | kfree(res); |
142 | } | 143 | } |
143 | } | 144 | } |
145 | EXPORT_SYMBOL(iounmap); | ||
144 | 146 | ||
145 | void __iomem *of_ioremap(struct resource *res, unsigned long offset, | 147 | void __iomem *of_ioremap(struct resource *res, unsigned long offset, |
146 | unsigned long size, char *name) | 148 | unsigned long size, char *name) |
@@ -237,6 +239,7 @@ void sbus_set_sbus64(struct device *dev, int x) | |||
237 | { | 239 | { |
238 | printk("sbus_set_sbus64: unsupported\n"); | 240 | printk("sbus_set_sbus64: unsupported\n"); |
239 | } | 241 | } |
242 | EXPORT_SYMBOL(sbus_set_sbus64); | ||
240 | 243 | ||
241 | /* | 244 | /* |
242 | * Allocate a chunk of memory suitable for DMA. | 245 | * Allocate a chunk of memory suitable for DMA. |
@@ -436,6 +439,7 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t len, dma_addr_t *pba) | |||
436 | *pba = virt_to_phys(va); /* equals virt_to_bus (R.I.P.) for us. */ | 439 | *pba = virt_to_phys(va); /* equals virt_to_bus (R.I.P.) for us. */ |
437 | return (void *) res->start; | 440 | return (void *) res->start; |
438 | } | 441 | } |
442 | EXPORT_SYMBOL(pci_alloc_consistent); | ||
439 | 443 | ||
440 | /* Free and unmap a consistent DMA buffer. | 444 | /* Free and unmap a consistent DMA buffer. |
441 | * cpu_addr is what was returned from pci_alloc_consistent, | 445 | * cpu_addr is what was returned from pci_alloc_consistent, |
@@ -477,6 +481,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t n, void *p, dma_addr_t ba) | |||
477 | 481 | ||
478 | free_pages(pgp, get_order(n)); | 482 | free_pages(pgp, get_order(n)); |
479 | } | 483 | } |
484 | EXPORT_SYMBOL(pci_free_consistent); | ||
480 | 485 | ||
481 | /* Map a single buffer of the indicated size for DMA in streaming mode. | 486 | /* Map a single buffer of the indicated size for DMA in streaming mode. |
482 | * The 32-bit bus address to use is returned. | 487 | * The 32-bit bus address to use is returned. |
@@ -491,6 +496,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, | |||
491 | /* IIep is write-through, not flushing. */ | 496 | /* IIep is write-through, not flushing. */ |
492 | return virt_to_phys(ptr); | 497 | return virt_to_phys(ptr); |
493 | } | 498 | } |
499 | EXPORT_SYMBOL(pci_map_single); | ||
494 | 500 | ||
495 | /* Unmap a single streaming mode DMA translation. The dma_addr and size | 501 | /* Unmap a single streaming mode DMA translation. The dma_addr and size |
496 | * must match what was provided for in a previous pci_map_single call. All | 502 | * must match what was provided for in a previous pci_map_single call. All |
@@ -508,6 +514,7 @@ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size, | |||
508 | (size + PAGE_SIZE-1) & PAGE_MASK); | 514 | (size + PAGE_SIZE-1) & PAGE_MASK); |
509 | } | 515 | } |
510 | } | 516 | } |
517 | EXPORT_SYMBOL(pci_unmap_single); | ||
511 | 518 | ||
512 | /* | 519 | /* |
513 | * Same as pci_map_single, but with pages. | 520 | * Same as pci_map_single, but with pages. |
@@ -519,6 +526,7 @@ dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page, | |||
519 | /* IIep is write-through, not flushing. */ | 526 | /* IIep is write-through, not flushing. */ |
520 | return page_to_phys(page) + offset; | 527 | return page_to_phys(page) + offset; |
521 | } | 528 | } |
529 | EXPORT_SYMBOL(pci_map_page); | ||
522 | 530 | ||
523 | void pci_unmap_page(struct pci_dev *hwdev, | 531 | void pci_unmap_page(struct pci_dev *hwdev, |
524 | dma_addr_t dma_address, size_t size, int direction) | 532 | dma_addr_t dma_address, size_t size, int direction) |
@@ -526,6 +534,7 @@ void pci_unmap_page(struct pci_dev *hwdev, | |||
526 | BUG_ON(direction == PCI_DMA_NONE); | 534 | BUG_ON(direction == PCI_DMA_NONE); |
527 | /* mmu_inval_dma_area XXX */ | 535 | /* mmu_inval_dma_area XXX */ |
528 | } | 536 | } |
537 | EXPORT_SYMBOL(pci_unmap_page); | ||
529 | 538 | ||
530 | /* Map a set of buffers described by scatterlist in streaming | 539 | /* Map a set of buffers described by scatterlist in streaming |
531 | * mode for DMA. This is the scather-gather version of the | 540 | * mode for DMA. This is the scather-gather version of the |
@@ -557,6 +566,7 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents, | |||
557 | } | 566 | } |
558 | return nents; | 567 | return nents; |
559 | } | 568 | } |
569 | EXPORT_SYMBOL(pci_map_sg); | ||
560 | 570 | ||
561 | /* Unmap a set of streaming mode DMA translations. | 571 | /* Unmap a set of streaming mode DMA translations. |
562 | * Again, cpu read rules concerning calls here are the same as for | 572 | * Again, cpu read rules concerning calls here are the same as for |
@@ -578,6 +588,7 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents, | |||
578 | } | 588 | } |
579 | } | 589 | } |
580 | } | 590 | } |
591 | EXPORT_SYMBOL(pci_unmap_sg); | ||
581 | 592 | ||
582 | /* Make physical memory consistent for a single | 593 | /* Make physical memory consistent for a single |
583 | * streaming mode DMA translation before or after a transfer. | 594 | * streaming mode DMA translation before or after a transfer. |
@@ -597,6 +608,7 @@ void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t si | |||
597 | (size + PAGE_SIZE-1) & PAGE_MASK); | 608 | (size + PAGE_SIZE-1) & PAGE_MASK); |
598 | } | 609 | } |
599 | } | 610 | } |
611 | EXPORT_SYMBOL(pci_dma_sync_single_for_cpu); | ||
600 | 612 | ||
601 | void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction) | 613 | void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction) |
602 | { | 614 | { |
@@ -606,6 +618,7 @@ void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t | |||
606 | (size + PAGE_SIZE-1) & PAGE_MASK); | 618 | (size + PAGE_SIZE-1) & PAGE_MASK); |
607 | } | 619 | } |
608 | } | 620 | } |
621 | EXPORT_SYMBOL(pci_dma_sync_single_for_device); | ||
609 | 622 | ||
610 | /* Make physical memory consistent for a set of streaming | 623 | /* Make physical memory consistent for a set of streaming |
611 | * mode DMA translations after a transfer. | 624 | * mode DMA translations after a transfer. |
@@ -628,6 +641,7 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sgl, int | |||
628 | } | 641 | } |
629 | } | 642 | } |
630 | } | 643 | } |
644 | EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu); | ||
631 | 645 | ||
632 | void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl, int nents, int direction) | 646 | void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl, int nents, int direction) |
633 | { | 647 | { |
@@ -644,6 +658,7 @@ void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl, | |||
644 | } | 658 | } |
645 | } | 659 | } |
646 | } | 660 | } |
661 | EXPORT_SYMBOL(pci_dma_sync_sg_for_device); | ||
647 | #endif /* CONFIG_PCI */ | 662 | #endif /* CONFIG_PCI */ |
648 | 663 | ||
649 | #ifdef CONFIG_PROC_FS | 664 | #ifdef CONFIG_PROC_FS |
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c index 1eff942fe22f..44dd5ee64339 100644 --- a/arch/sparc/kernel/irq_32.c +++ b/arch/sparc/kernel/irq_32.c | |||
@@ -294,6 +294,7 @@ void synchronize_irq(unsigned int irq) | |||
294 | while (sparc_irq[cpu_irq].flags & SPARC_IRQ_INPROGRESS) | 294 | while (sparc_irq[cpu_irq].flags & SPARC_IRQ_INPROGRESS) |
295 | cpu_relax(); | 295 | cpu_relax(); |
296 | } | 296 | } |
297 | EXPORT_SYMBOL(synchronize_irq); | ||
297 | #endif /* SMP */ | 298 | #endif /* SMP */ |
298 | 299 | ||
299 | void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs) | 300 | void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs) |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 923e9bbb9fe2..4638fba799e4 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -1077,6 +1077,7 @@ int pci_dma_supported(struct pci_dev *pdev, u64 device_mask) | |||
1077 | 1077 | ||
1078 | return (device_mask & dma_addr_mask) == dma_addr_mask; | 1078 | return (device_mask & dma_addr_mask) == dma_addr_mask; |
1079 | } | 1079 | } |
1080 | EXPORT_SYMBOL(pci_dma_supported); | ||
1080 | 1081 | ||
1081 | void pci_resource_to_user(const struct pci_dev *pdev, int bar, | 1082 | void pci_resource_to_user(const struct pci_dev *pdev, int bar, |
1082 | const struct resource *rp, resource_size_t *start, | 1083 | const struct resource *rp, resource_size_t *start, |
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 75ed98be3edf..85e7037429b9 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -956,6 +956,7 @@ void outsb(unsigned long addr, const void *src, unsigned long count) | |||
956 | /* addr += 1; */ | 956 | /* addr += 1; */ |
957 | } | 957 | } |
958 | } | 958 | } |
959 | EXPORT_SYMBOL(outsb); | ||
959 | 960 | ||
960 | void outsw(unsigned long addr, const void *src, unsigned long count) | 961 | void outsw(unsigned long addr, const void *src, unsigned long count) |
961 | { | 962 | { |
@@ -966,6 +967,7 @@ void outsw(unsigned long addr, const void *src, unsigned long count) | |||
966 | /* addr += 2; */ | 967 | /* addr += 2; */ |
967 | } | 968 | } |
968 | } | 969 | } |
970 | EXPORT_SYMBOL(outsw); | ||
969 | 971 | ||
970 | void outsl(unsigned long addr, const void *src, unsigned long count) | 972 | void outsl(unsigned long addr, const void *src, unsigned long count) |
971 | { | 973 | { |
@@ -976,6 +978,7 @@ void outsl(unsigned long addr, const void *src, unsigned long count) | |||
976 | /* addr += 4; */ | 978 | /* addr += 4; */ |
977 | } | 979 | } |
978 | } | 980 | } |
981 | EXPORT_SYMBOL(outsl); | ||
979 | 982 | ||
980 | void insb(unsigned long addr, void *dst, unsigned long count) | 983 | void insb(unsigned long addr, void *dst, unsigned long count) |
981 | { | 984 | { |
@@ -986,6 +989,7 @@ void insb(unsigned long addr, void *dst, unsigned long count) | |||
986 | /* addr += 1; */ | 989 | /* addr += 1; */ |
987 | } | 990 | } |
988 | } | 991 | } |
992 | EXPORT_SYMBOL(insb); | ||
989 | 993 | ||
990 | void insw(unsigned long addr, void *dst, unsigned long count) | 994 | void insw(unsigned long addr, void *dst, unsigned long count) |
991 | { | 995 | { |
@@ -996,6 +1000,7 @@ void insw(unsigned long addr, void *dst, unsigned long count) | |||
996 | /* addr += 2; */ | 1000 | /* addr += 2; */ |
997 | } | 1001 | } |
998 | } | 1002 | } |
1003 | EXPORT_SYMBOL(insw); | ||
999 | 1004 | ||
1000 | void insl(unsigned long addr, void *dst, unsigned long count) | 1005 | void insl(unsigned long addr, void *dst, unsigned long count) |
1001 | { | 1006 | { |
@@ -1009,5 +1014,6 @@ void insl(unsigned long addr, void *dst, unsigned long count) | |||
1009 | /* addr += 4; */ | 1014 | /* addr += 4; */ |
1010 | } | 1015 | } |
1011 | } | 1016 | } |
1017 | EXPORT_SYMBOL(insl); | ||
1012 | 1018 | ||
1013 | subsys_initcall(pcic_init); | 1019 | subsys_initcall(pcic_init); |
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index 5a8d8ced33da..f4bee35a1b46 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
@@ -44,6 +44,7 @@ | |||
44 | * Set in pm platform drivers (apc.c and pmc.c) | 44 | * Set in pm platform drivers (apc.c and pmc.c) |
45 | */ | 45 | */ |
46 | void (*pm_idle)(void); | 46 | void (*pm_idle)(void); |
47 | EXPORT_SYMBOL(pm_idle); | ||
47 | 48 | ||
48 | /* | 49 | /* |
49 | * Power-off handler instantiation for pm.h compliance | 50 | * Power-off handler instantiation for pm.h compliance |
@@ -673,6 +674,7 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
673 | "g1", "g2", "g3", "o0", "o1", "memory", "cc"); | 674 | "g1", "g2", "g3", "o0", "o1", "memory", "cc"); |
674 | return retval; | 675 | return retval; |
675 | } | 676 | } |
677 | EXPORT_SYMBOL(kernel_thread); | ||
676 | 678 | ||
677 | unsigned long get_wchan(struct task_struct *task) | 679 | unsigned long get_wchan(struct task_struct *task) |
678 | { | 680 | { |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index d5e2acef9877..cc8b5604442c 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -678,6 +678,7 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
678 | "g1", "g2", "g3", "o0", "o1", "memory", "cc"); | 678 | "g1", "g2", "g3", "o0", "o1", "memory", "cc"); |
679 | return retval; | 679 | return retval; |
680 | } | 680 | } |
681 | EXPORT_SYMBOL(kernel_thread); | ||
681 | 682 | ||
682 | typedef struct { | 683 | typedef struct { |
683 | union { | 684 | union { |
@@ -743,6 +744,7 @@ int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs) | |||
743 | } | 744 | } |
744 | return 1; | 745 | return 1; |
745 | } | 746 | } |
747 | EXPORT_SYMBOL(dump_fpu); | ||
746 | 748 | ||
747 | /* | 749 | /* |
748 | * sparc_execve() executes a new program after the asm stub has set | 750 | * sparc_execve() executes a new program after the asm stub has set |
diff --git a/arch/sparc/kernel/psycho_common.c b/arch/sparc/kernel/psycho_common.c index 40689ae3c9b0..8f1478475421 100644 --- a/arch/sparc/kernel/psycho_common.c +++ b/arch/sparc/kernel/psycho_common.c | |||
@@ -11,19 +11,19 @@ | |||
11 | #include "iommu_common.h" | 11 | #include "iommu_common.h" |
12 | #include "psycho_common.h" | 12 | #include "psycho_common.h" |
13 | 13 | ||
14 | #define PSYCHO_STRBUF_CTRL_DENAB 0x0000000000000002UL | 14 | #define PSYCHO_STRBUF_CTRL_DENAB 0x0000000000000002ULL |
15 | #define PSYCHO_STCERR_WRITE 0x0000000000000002UL | 15 | #define PSYCHO_STCERR_WRITE 0x0000000000000002ULL |
16 | #define PSYCHO_STCERR_READ 0x0000000000000001UL | 16 | #define PSYCHO_STCERR_READ 0x0000000000000001ULL |
17 | #define PSYCHO_STCTAG_PPN 0x0fffffff00000000UL | 17 | #define PSYCHO_STCTAG_PPN 0x0fffffff00000000ULL |
18 | #define PSYCHO_STCTAG_VPN 0x00000000ffffe000UL | 18 | #define PSYCHO_STCTAG_VPN 0x00000000ffffe000ULL |
19 | #define PSYCHO_STCTAG_VALID 0x0000000000000002UL | 19 | #define PSYCHO_STCTAG_VALID 0x0000000000000002ULL |
20 | #define PSYCHO_STCTAG_WRITE 0x0000000000000001UL | 20 | #define PSYCHO_STCTAG_WRITE 0x0000000000000001ULL |
21 | #define PSYCHO_STCLINE_LINDX 0x0000000001e00000UL | 21 | #define PSYCHO_STCLINE_LINDX 0x0000000001e00000ULL |
22 | #define PSYCHO_STCLINE_SPTR 0x00000000001f8000UL | 22 | #define PSYCHO_STCLINE_SPTR 0x00000000001f8000ULL |
23 | #define PSYCHO_STCLINE_LADDR 0x0000000000007f00UL | 23 | #define PSYCHO_STCLINE_LADDR 0x0000000000007f00ULL |
24 | #define PSYCHO_STCLINE_EPTR 0x00000000000000fcUL | 24 | #define PSYCHO_STCLINE_EPTR 0x00000000000000fcULL |
25 | #define PSYCHO_STCLINE_VALID 0x0000000000000002UL | 25 | #define PSYCHO_STCLINE_VALID 0x0000000000000002ULL |
26 | #define PSYCHO_STCLINE_FOFN 0x0000000000000001UL | 26 | #define PSYCHO_STCLINE_FOFN 0x0000000000000001ULL |
27 | 27 | ||
28 | static DEFINE_SPINLOCK(stc_buf_lock); | 28 | static DEFINE_SPINLOCK(stc_buf_lock); |
29 | static unsigned long stc_error_buf[128]; | 29 | static unsigned long stc_error_buf[128]; |
@@ -144,10 +144,10 @@ static void psycho_record_iommu_tags_and_data(struct pci_pbm_info *pbm, | |||
144 | #define PSYCHO_IOMMU_TAG_WRITE (0x1UL << 21UL) | 144 | #define PSYCHO_IOMMU_TAG_WRITE (0x1UL << 21UL) |
145 | #define PSYCHO_IOMMU_TAG_STREAM (0x1UL << 20UL) | 145 | #define PSYCHO_IOMMU_TAG_STREAM (0x1UL << 20UL) |
146 | #define PSYCHO_IOMMU_TAG_SIZE (0x1UL << 19UL) | 146 | #define PSYCHO_IOMMU_TAG_SIZE (0x1UL << 19UL) |
147 | #define PSYCHO_IOMMU_TAG_VPAGE 0x7ffffUL | 147 | #define PSYCHO_IOMMU_TAG_VPAGE 0x7ffffULL |
148 | #define PSYCHO_IOMMU_DATA_VALID (1UL << 30UL) | 148 | #define PSYCHO_IOMMU_DATA_VALID (1UL << 30UL) |
149 | #define PSYCHO_IOMMU_DATA_CACHE (1UL << 28UL) | 149 | #define PSYCHO_IOMMU_DATA_CACHE (1UL << 28UL) |
150 | #define PSYCHO_IOMMU_DATA_PPAGE 0xfffffffUL | 150 | #define PSYCHO_IOMMU_DATA_PPAGE 0xfffffffULL |
151 | 151 | ||
152 | static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm, | 152 | static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm, |
153 | u64 *tag, u64 *data) | 153 | u64 *tag, u64 *data) |
@@ -190,7 +190,7 @@ static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm, | |||
190 | pbm->name, i, | 190 | pbm->name, i, |
191 | ((data_val & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0), | 191 | ((data_val & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0), |
192 | ((data_val & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0), | 192 | ((data_val & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0), |
193 | (data_val & PSYCHO_IOMMU_DATA_PPAGE)<<IOMMU_PAGE_SHIFT); | 193 | (data_val & PSYCHO_IOMMU_DATA_PPAGE) << IOMMU_PAGE_SHIFT); |
194 | } | 194 | } |
195 | } | 195 | } |
196 | 196 | ||
@@ -285,20 +285,20 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm) | |||
285 | return ret; | 285 | return ret; |
286 | } | 286 | } |
287 | 287 | ||
288 | #define PSYCHO_PCIAFSR_PMA 0x8000000000000000UL | 288 | #define PSYCHO_PCIAFSR_PMA 0x8000000000000000ULL |
289 | #define PSYCHO_PCIAFSR_PTA 0x4000000000000000UL | 289 | #define PSYCHO_PCIAFSR_PTA 0x4000000000000000ULL |
290 | #define PSYCHO_PCIAFSR_PRTRY 0x2000000000000000UL | 290 | #define PSYCHO_PCIAFSR_PRTRY 0x2000000000000000ULL |
291 | #define PSYCHO_PCIAFSR_PPERR 0x1000000000000000UL | 291 | #define PSYCHO_PCIAFSR_PPERR 0x1000000000000000ULL |
292 | #define PSYCHO_PCIAFSR_SMA 0x0800000000000000UL | 292 | #define PSYCHO_PCIAFSR_SMA 0x0800000000000000ULL |
293 | #define PSYCHO_PCIAFSR_STA 0x0400000000000000UL | 293 | #define PSYCHO_PCIAFSR_STA 0x0400000000000000ULL |
294 | #define PSYCHO_PCIAFSR_SRTRY 0x0200000000000000UL | 294 | #define PSYCHO_PCIAFSR_SRTRY 0x0200000000000000ULL |
295 | #define PSYCHO_PCIAFSR_SPERR 0x0100000000000000UL | 295 | #define PSYCHO_PCIAFSR_SPERR 0x0100000000000000ULL |
296 | #define PSYCHO_PCIAFSR_RESV1 0x00ff000000000000UL | 296 | #define PSYCHO_PCIAFSR_RESV1 0x00ff000000000000ULL |
297 | #define PSYCHO_PCIAFSR_BMSK 0x0000ffff00000000UL | 297 | #define PSYCHO_PCIAFSR_BMSK 0x0000ffff00000000ULL |
298 | #define PSYCHO_PCIAFSR_BLK 0x0000000080000000UL | 298 | #define PSYCHO_PCIAFSR_BLK 0x0000000080000000ULL |
299 | #define PSYCHO_PCIAFSR_RESV2 0x0000000040000000UL | 299 | #define PSYCHO_PCIAFSR_RESV2 0x0000000040000000ULL |
300 | #define PSYCHO_PCIAFSR_MID 0x000000003e000000UL | 300 | #define PSYCHO_PCIAFSR_MID 0x000000003e000000ULL |
301 | #define PSYCHO_PCIAFSR_RESV3 0x0000000001ffffffUL | 301 | #define PSYCHO_PCIAFSR_RESV3 0x0000000001ffffffULL |
302 | 302 | ||
303 | irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) | 303 | irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) |
304 | { | 304 | { |
diff --git a/arch/sparc/kernel/sbus.c b/arch/sparc/kernel/sbus.c index 2ead310066d1..406e0872504e 100644 --- a/arch/sparc/kernel/sbus.c +++ b/arch/sparc/kernel/sbus.c | |||
@@ -117,6 +117,7 @@ void sbus_set_sbus64(struct device *dev, int bursts) | |||
117 | val |= (1UL << 4UL); | 117 | val |= (1UL << 4UL); |
118 | upa_writeq(val, cfg_reg); | 118 | upa_writeq(val, cfg_reg); |
119 | } | 119 | } |
120 | EXPORT_SYMBOL(sbus_set_sbus64); | ||
120 | 121 | ||
121 | /* INO number to IMAP register offset for SYSIO external IRQ's. | 122 | /* INO number to IMAP register offset for SYSIO external IRQ's. |
122 | * This should conform to both Sunfire/Wildfire server and Fusion | 123 | * This should conform to both Sunfire/Wildfire server and Fusion |
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index c96c65d1b58b..998cadb4e7f2 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c | |||
@@ -199,7 +199,9 @@ extern unsigned short ram_flags; | |||
199 | extern int root_mountflags; | 199 | extern int root_mountflags; |
200 | 200 | ||
201 | char reboot_command[COMMAND_LINE_SIZE]; | 201 | char reboot_command[COMMAND_LINE_SIZE]; |
202 | |||
202 | enum sparc_cpu sparc_cpu_model; | 203 | enum sparc_cpu sparc_cpu_model; |
204 | EXPORT_SYMBOL(sparc_cpu_model); | ||
203 | 205 | ||
204 | struct tt_entry *sparc_ttable; | 206 | struct tt_entry *sparc_ttable; |
205 | 207 | ||
@@ -391,6 +393,7 @@ void sun_do_break(void) | |||
391 | 393 | ||
392 | prom_cmdline(); | 394 | prom_cmdline(); |
393 | } | 395 | } |
396 | EXPORT_SYMBOL(sun_do_break); | ||
394 | 397 | ||
395 | int stop_a_enabled = 1; | 398 | int stop_a_enabled = 1; |
396 | 399 | ||
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 555db7452ebe..49d061f4ae9d 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c | |||
@@ -58,6 +58,7 @@ | |||
58 | * operations in asm/ns87303.h | 58 | * operations in asm/ns87303.h |
59 | */ | 59 | */ |
60 | DEFINE_SPINLOCK(ns87303_lock); | 60 | DEFINE_SPINLOCK(ns87303_lock); |
61 | EXPORT_SYMBOL(ns87303_lock); | ||
61 | 62 | ||
62 | struct screen_info screen_info = { | 63 | struct screen_info screen_info = { |
63 | 0, 0, /* orig-x, orig-y */ | 64 | 0, 0, /* orig-x, orig-y */ |
@@ -425,5 +426,7 @@ void sun_do_break(void) | |||
425 | 426 | ||
426 | prom_cmdline(); | 427 | prom_cmdline(); |
427 | } | 428 | } |
429 | EXPORT_SYMBOL(sun_do_break); | ||
428 | 430 | ||
429 | int stop_a_enabled = 1; | 431 | int stop_a_enabled = 1; |
432 | EXPORT_SYMBOL(stop_a_enabled); | ||
diff --git a/arch/sparc/kernel/sparc_ksyms_32.c b/arch/sparc/kernel/sparc_ksyms_32.c index e1e97639231b..baeab8720237 100644 --- a/arch/sparc/kernel/sparc_ksyms_32.c +++ b/arch/sparc/kernel/sparc_ksyms_32.c | |||
@@ -5,49 +5,14 @@ | |||
5 | * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) | 5 | * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* Tell string.h we don't want memcpy etc. as cpp defines */ | ||
9 | #define EXPORT_SYMTAB_STROPS | ||
10 | #define PROMLIB_INTERNAL | ||
11 | |||
12 | #include <linux/module.h> | 8 | #include <linux/module.h> |
13 | #include <linux/init.h> | 9 | #include <linux/init.h> |
14 | #include <linux/smp.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/string.h> | ||
17 | #include <linux/sched.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/in6.h> | ||
20 | #include <linux/spinlock.h> | ||
21 | #include <linux/mm.h> | ||
22 | #include <linux/syscalls.h> | ||
23 | #ifdef CONFIG_PCI | ||
24 | #include <linux/pci.h> | ||
25 | #endif | ||
26 | #include <linux/pm.h> | ||
27 | #ifdef CONFIG_HIGHMEM | ||
28 | #include <linux/highmem.h> | ||
29 | #endif | ||
30 | 10 | ||
31 | #include <asm/oplib.h> | ||
32 | #include <asm/delay.h> | ||
33 | #include <asm/system.h> | ||
34 | #include <asm/auxio.h> | ||
35 | #include <asm/pgtable.h> | 11 | #include <asm/pgtable.h> |
36 | #include <asm/io.h> | ||
37 | #include <asm/irq.h> | ||
38 | #include <asm/idprom.h> | ||
39 | #include <asm/head.h> | ||
40 | #include <asm/smp.h> | ||
41 | #include <asm/ptrace.h> | ||
42 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
43 | #include <asm/checksum.h> | 13 | #include <asm/delay.h> |
44 | #ifdef CONFIG_SBUS | 14 | #include <asm/head.h> |
45 | #include <asm/dma.h> | 15 | #include <asm/dma.h> |
46 | #endif | ||
47 | #include <asm/io-unit.h> | ||
48 | #include <asm/bug.h> | ||
49 | |||
50 | extern spinlock_t rtc_lock; | ||
51 | 16 | ||
52 | struct poll { | 17 | struct poll { |
53 | int fd; | 18 | int fd; |
@@ -55,72 +20,15 @@ struct poll { | |||
55 | short revents; | 20 | short revents; |
56 | }; | 21 | }; |
57 | 22 | ||
58 | extern void (*__copy_1page)(void *, const void *); | 23 | /* from entry.S */ |
59 | extern void __memmove(void *, const void *, __kernel_size_t); | ||
60 | extern void (*bzero_1page)(void *); | ||
61 | extern void *__bzero(void *, size_t); | ||
62 | extern void *__memscan_zero(void *, size_t); | ||
63 | extern void *__memscan_generic(void *, int, size_t); | ||
64 | extern int __strncmp(const char *, const char *, __kernel_size_t); | ||
65 | |||
66 | extern int __ashrdi3(int, int); | ||
67 | extern int __ashldi3(int, int); | ||
68 | extern int __lshrdi3(int, int); | ||
69 | extern int __muldi3(int, int); | ||
70 | extern int __divdi3(int, int); | ||
71 | |||
72 | /* Private functions with odd calling conventions. */ | ||
73 | extern void ___atomic24_add(void); | ||
74 | extern void ___atomic24_sub(void); | ||
75 | extern void ___rw_read_enter(void); | ||
76 | extern void ___rw_read_try(void); | ||
77 | extern void ___rw_read_exit(void); | ||
78 | extern void ___rw_write_enter(void); | ||
79 | |||
80 | /* Alias functions whose names begin with "." and export the aliases. | ||
81 | * The module references will be fixed up by module_frob_arch_sections. | ||
82 | */ | ||
83 | extern int _Div(int, int); | ||
84 | extern int _Mul(int, int); | ||
85 | extern int _Rem(int, int); | ||
86 | extern unsigned _Udiv(unsigned, unsigned); | ||
87 | extern unsigned _Umul(unsigned, unsigned); | ||
88 | extern unsigned _Urem(unsigned, unsigned); | ||
89 | |||
90 | /* used by various drivers */ | ||
91 | EXPORT_SYMBOL(sparc_cpu_model); | ||
92 | EXPORT_SYMBOL(kernel_thread); | ||
93 | #ifdef CONFIG_SMP | ||
94 | // XXX find what uses (or used) these. AV: see asm/spinlock.h | ||
95 | EXPORT_SYMBOL(___rw_read_enter); | ||
96 | EXPORT_SYMBOL(___rw_read_try); | ||
97 | EXPORT_SYMBOL(___rw_read_exit); | ||
98 | EXPORT_SYMBOL(___rw_write_enter); | ||
99 | #endif | ||
100 | |||
101 | EXPORT_SYMBOL(sparc_valid_addr_bitmap); | ||
102 | EXPORT_SYMBOL(phys_base); | ||
103 | EXPORT_SYMBOL(pfn_base); | ||
104 | |||
105 | /* Atomic operations. */ | ||
106 | EXPORT_SYMBOL(___atomic24_add); | ||
107 | EXPORT_SYMBOL(___atomic24_sub); | ||
108 | |||
109 | /* Per-CPU information table */ | ||
110 | EXPORT_PER_CPU_SYMBOL(__cpu_data); | ||
111 | |||
112 | #ifdef CONFIG_SMP | ||
113 | /* IRQ implementation. */ | ||
114 | EXPORT_SYMBOL(synchronize_irq); | ||
115 | #endif | ||
116 | |||
117 | EXPORT_SYMBOL(__udelay); | 24 | EXPORT_SYMBOL(__udelay); |
118 | EXPORT_SYMBOL(__ndelay); | 25 | EXPORT_SYMBOL(__ndelay); |
119 | EXPORT_SYMBOL(rtc_lock); | ||
120 | EXPORT_SYMBOL(set_auxio); | ||
121 | EXPORT_SYMBOL(get_auxio); | ||
122 | EXPORT_SYMBOL(io_remap_pfn_range); | ||
123 | 26 | ||
27 | /* from head_32.S */ | ||
28 | EXPORT_SYMBOL(__ret_efault); | ||
29 | EXPORT_SYMBOL(empty_zero_page); | ||
30 | |||
31 | /* Defined using magic */ | ||
124 | #ifndef CONFIG_SMP | 32 | #ifndef CONFIG_SMP |
125 | EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32)); | 33 | EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32)); |
126 | #else | 34 | #else |
@@ -132,122 +40,7 @@ EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl)); | |||
132 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one)); | 40 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one)); |
133 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl)); | 41 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl)); |
134 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one)); | 42 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one)); |
135 | |||
136 | EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached)); | 43 | EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached)); |
137 | 44 | ||
138 | #ifdef CONFIG_SBUS | 45 | /* Exporting a symbol from /init/main.c */ |
139 | EXPORT_SYMBOL(sbus_set_sbus64); | ||
140 | #endif | ||
141 | #ifdef CONFIG_PCI | ||
142 | EXPORT_SYMBOL(insb); | ||
143 | EXPORT_SYMBOL(outsb); | ||
144 | EXPORT_SYMBOL(insw); | ||
145 | EXPORT_SYMBOL(outsw); | ||
146 | EXPORT_SYMBOL(insl); | ||
147 | EXPORT_SYMBOL(outsl); | ||
148 | EXPORT_SYMBOL(pci_alloc_consistent); | ||
149 | EXPORT_SYMBOL(pci_free_consistent); | ||
150 | EXPORT_SYMBOL(pci_map_single); | ||
151 | EXPORT_SYMBOL(pci_unmap_single); | ||
152 | EXPORT_SYMBOL(pci_dma_sync_single_for_cpu); | ||
153 | EXPORT_SYMBOL(pci_dma_sync_single_for_device); | ||
154 | EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu); | ||
155 | EXPORT_SYMBOL(pci_dma_sync_sg_for_device); | ||
156 | EXPORT_SYMBOL(pci_map_sg); | ||
157 | EXPORT_SYMBOL(pci_unmap_sg); | ||
158 | EXPORT_SYMBOL(pci_map_page); | ||
159 | EXPORT_SYMBOL(pci_unmap_page); | ||
160 | /* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */ | ||
161 | EXPORT_SYMBOL(ioremap); | ||
162 | EXPORT_SYMBOL(iounmap); | ||
163 | #endif | ||
164 | |||
165 | /* in arch/sparc/mm/highmem.c */ | ||
166 | #ifdef CONFIG_HIGHMEM | ||
167 | EXPORT_SYMBOL(kmap_atomic); | ||
168 | EXPORT_SYMBOL(kunmap_atomic); | ||
169 | #endif | ||
170 | |||
171 | /* prom symbols */ | ||
172 | EXPORT_SYMBOL(idprom); | ||
173 | EXPORT_SYMBOL(prom_root_node); | ||
174 | EXPORT_SYMBOL(prom_getchild); | ||
175 | EXPORT_SYMBOL(prom_getsibling); | ||
176 | EXPORT_SYMBOL(prom_searchsiblings); | ||
177 | EXPORT_SYMBOL(prom_firstprop); | ||
178 | EXPORT_SYMBOL(prom_nextprop); | ||
179 | EXPORT_SYMBOL(prom_getproplen); | ||
180 | EXPORT_SYMBOL(prom_getproperty); | ||
181 | EXPORT_SYMBOL(prom_node_has_property); | ||
182 | EXPORT_SYMBOL(prom_setprop); | ||
183 | EXPORT_SYMBOL(saved_command_line); | 46 | EXPORT_SYMBOL(saved_command_line); |
184 | EXPORT_SYMBOL(prom_apply_obio_ranges); | ||
185 | EXPORT_SYMBOL(prom_feval); | ||
186 | EXPORT_SYMBOL(prom_getbool); | ||
187 | EXPORT_SYMBOL(prom_getstring); | ||
188 | EXPORT_SYMBOL(prom_getint); | ||
189 | EXPORT_SYMBOL(prom_getintdefault); | ||
190 | EXPORT_SYMBOL(prom_finddevice); | ||
191 | EXPORT_SYMBOL(romvec); | ||
192 | EXPORT_SYMBOL(__prom_getchild); | ||
193 | EXPORT_SYMBOL(__prom_getsibling); | ||
194 | |||
195 | /* sparc library symbols */ | ||
196 | EXPORT_SYMBOL(memscan); | ||
197 | EXPORT_SYMBOL(strlen); | ||
198 | EXPORT_SYMBOL(strncmp); | ||
199 | EXPORT_SYMBOL(page_kernel); | ||
200 | |||
201 | /* Special internal versions of library functions. */ | ||
202 | EXPORT_SYMBOL(__copy_1page); | ||
203 | EXPORT_SYMBOL(__memcpy); | ||
204 | EXPORT_SYMBOL(__memset); | ||
205 | EXPORT_SYMBOL(bzero_1page); | ||
206 | EXPORT_SYMBOL(__bzero); | ||
207 | EXPORT_SYMBOL(__memscan_zero); | ||
208 | EXPORT_SYMBOL(__memscan_generic); | ||
209 | EXPORT_SYMBOL(__strncmp); | ||
210 | EXPORT_SYMBOL(__memmove); | ||
211 | |||
212 | /* Moving data to/from userspace. */ | ||
213 | EXPORT_SYMBOL(__copy_user); | ||
214 | EXPORT_SYMBOL(__strncpy_from_user); | ||
215 | EXPORT_SYMBOL(__strnlen_user); | ||
216 | |||
217 | /* Networking helper routines. */ | ||
218 | EXPORT_SYMBOL(__csum_partial_copy_sparc_generic); | ||
219 | EXPORT_SYMBOL(csum_partial); | ||
220 | |||
221 | /* Cache flushing. */ | ||
222 | EXPORT_SYMBOL(sparc_flush_page_to_ram); | ||
223 | |||
224 | /* For when serial stuff is built as modules. */ | ||
225 | EXPORT_SYMBOL(sun_do_break); | ||
226 | |||
227 | EXPORT_SYMBOL(__ret_efault); | ||
228 | |||
229 | EXPORT_SYMBOL(memcmp); | ||
230 | EXPORT_SYMBOL(memcpy); | ||
231 | EXPORT_SYMBOL(memset); | ||
232 | EXPORT_SYMBOL(memmove); | ||
233 | EXPORT_SYMBOL(__ashrdi3); | ||
234 | EXPORT_SYMBOL(__ashldi3); | ||
235 | EXPORT_SYMBOL(__lshrdi3); | ||
236 | EXPORT_SYMBOL(__muldi3); | ||
237 | EXPORT_SYMBOL(__divdi3); | ||
238 | |||
239 | EXPORT_SYMBOL(_Rem); | ||
240 | EXPORT_SYMBOL(_Urem); | ||
241 | EXPORT_SYMBOL(_Mul); | ||
242 | EXPORT_SYMBOL(_Umul); | ||
243 | EXPORT_SYMBOL(_Div); | ||
244 | EXPORT_SYMBOL(_Udiv); | ||
245 | |||
246 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
247 | EXPORT_SYMBOL(do_BUG); | ||
248 | #endif | ||
249 | |||
250 | /* Sun Power Management Idle Handler */ | ||
251 | EXPORT_SYMBOL(pm_idle); | ||
252 | |||
253 | EXPORT_SYMBOL(empty_zero_page); | ||
diff --git a/arch/sparc/kernel/sparc_ksyms_64.c b/arch/sparc/kernel/sparc_ksyms_64.c index 0133211ab634..0f26066a08d9 100644 --- a/arch/sparc/kernel/sparc_ksyms_64.c +++ b/arch/sparc/kernel/sparc_ksyms_64.c | |||
@@ -5,50 +5,15 @@ | |||
5 | * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) | 5 | * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* Tell string.h we don't want memcpy etc. as cpp defines */ | ||
9 | #define EXPORT_SYMTAB_STROPS | ||
10 | #define PROMLIB_INTERNAL | ||
11 | |||
12 | #include <linux/module.h> | 8 | #include <linux/module.h> |
13 | #include <linux/types.h> | ||
14 | #include <linux/string.h> | ||
15 | #include <linux/sched.h> | ||
16 | #include <linux/in6.h> | ||
17 | #include <linux/pci.h> | 9 | #include <linux/pci.h> |
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/fs_struct.h> | ||
20 | #include <linux/fs.h> | ||
21 | #include <linux/mm.h> | ||
22 | #include <linux/socket.h> | ||
23 | #include <linux/syscalls.h> | ||
24 | #include <linux/percpu.h> | ||
25 | #include <linux/init.h> | 10 | #include <linux/init.h> |
26 | #include <linux/rwsem.h> | ||
27 | #include <net/compat.h> | ||
28 | 11 | ||
29 | #include <asm/oplib.h> | ||
30 | #include <asm/system.h> | 12 | #include <asm/system.h> |
31 | #include <asm/auxio.h> | ||
32 | #include <asm/pgtable.h> | ||
33 | #include <asm/io.h> | ||
34 | #include <asm/irq.h> | ||
35 | #include <asm/idprom.h> | ||
36 | #include <asm/elf.h> | ||
37 | #include <asm/head.h> | ||
38 | #include <asm/smp.h> | ||
39 | #include <asm/ptrace.h> | ||
40 | #include <asm/uaccess.h> | ||
41 | #include <asm/checksum.h> | ||
42 | #include <asm/fpumacro.h> | ||
43 | #include <asm/pgalloc.h> | ||
44 | #include <asm/cacheflush.h> | ||
45 | #ifdef CONFIG_SBUS | ||
46 | #include <asm/dma.h> | ||
47 | #endif | ||
48 | #include <asm/ns87303.h> | ||
49 | #include <asm/timer.h> | ||
50 | #include <asm/cpudata.h> | 13 | #include <asm/cpudata.h> |
51 | #include <asm/ftrace.h> | 14 | #include <asm/uaccess.h> |
15 | #include <asm/spitfire.h> | ||
16 | #include <asm/oplib.h> | ||
52 | #include <asm/hypervisor.h> | 17 | #include <asm/hypervisor.h> |
53 | 18 | ||
54 | struct poll { | 19 | struct poll { |
@@ -57,114 +22,24 @@ struct poll { | |||
57 | short revents; | 22 | short revents; |
58 | }; | 23 | }; |
59 | 24 | ||
60 | extern void die_if_kernel(char *str, struct pt_regs *regs); | 25 | /* from helpers.S */ |
61 | extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | ||
62 | extern void *__bzero(void *, size_t); | ||
63 | extern void *__memscan_zero(void *, size_t); | ||
64 | extern void *__memscan_generic(void *, int, size_t); | ||
65 | extern __kernel_size_t strlen(const char *); | ||
66 | extern void sys_sigsuspend(void); | ||
67 | extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg); | ||
68 | extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *); | ||
69 | extern long sparc32_open(const char __user * filename, int flags, int mode); | ||
70 | extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | ||
71 | unsigned long pfn, unsigned long size, pgprot_t prot); | ||
72 | |||
73 | extern int __ashrdi3(int, int); | ||
74 | |||
75 | extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs); | ||
76 | |||
77 | extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); | ||
78 | extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, | ||
79 | unsigned long *); | ||
80 | extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *, | ||
81 | unsigned long *, unsigned long *); | ||
82 | extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *, | ||
83 | unsigned long *, unsigned long *, unsigned long *); | ||
84 | |||
85 | extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *); | ||
86 | extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *, | ||
87 | unsigned long *); | ||
88 | extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *, | ||
89 | unsigned long *, unsigned long *); | ||
90 | extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *, | ||
91 | unsigned long *, unsigned long *, unsigned long *); | ||
92 | |||
93 | /* Per-CPU information table */ | ||
94 | EXPORT_PER_CPU_SYMBOL(__cpu_data); | ||
95 | |||
96 | /* used by various drivers */ | ||
97 | #ifdef CONFIG_SMP | ||
98 | /* Out of line rw-locking implementation. */ | ||
99 | EXPORT_SYMBOL(__read_lock); | ||
100 | EXPORT_SYMBOL(__read_unlock); | ||
101 | EXPORT_SYMBOL(__write_lock); | ||
102 | EXPORT_SYMBOL(__write_unlock); | ||
103 | EXPORT_SYMBOL(__write_trylock); | ||
104 | #endif /* CONFIG_SMP */ | ||
105 | |||
106 | #ifdef CONFIG_MCOUNT | ||
107 | EXPORT_SYMBOL(_mcount); | ||
108 | #endif | ||
109 | |||
110 | EXPORT_SYMBOL(sparc64_get_clock_tick); | ||
111 | |||
112 | /* RW semaphores */ | ||
113 | EXPORT_SYMBOL(__down_read); | ||
114 | EXPORT_SYMBOL(__down_read_trylock); | ||
115 | EXPORT_SYMBOL(__down_write); | ||
116 | EXPORT_SYMBOL(__down_write_trylock); | ||
117 | EXPORT_SYMBOL(__up_read); | ||
118 | EXPORT_SYMBOL(__up_write); | ||
119 | EXPORT_SYMBOL(__downgrade_write); | ||
120 | |||
121 | /* Atomic counter implementation. */ | ||
122 | EXPORT_SYMBOL(atomic_add); | ||
123 | EXPORT_SYMBOL(atomic_add_ret); | ||
124 | EXPORT_SYMBOL(atomic_sub); | ||
125 | EXPORT_SYMBOL(atomic_sub_ret); | ||
126 | EXPORT_SYMBOL(atomic64_add); | ||
127 | EXPORT_SYMBOL(atomic64_add_ret); | ||
128 | EXPORT_SYMBOL(atomic64_sub); | ||
129 | EXPORT_SYMBOL(atomic64_sub_ret); | ||
130 | |||
131 | /* Atomic bit operations. */ | ||
132 | EXPORT_SYMBOL(test_and_set_bit); | ||
133 | EXPORT_SYMBOL(test_and_clear_bit); | ||
134 | EXPORT_SYMBOL(test_and_change_bit); | ||
135 | EXPORT_SYMBOL(set_bit); | ||
136 | EXPORT_SYMBOL(clear_bit); | ||
137 | EXPORT_SYMBOL(change_bit); | ||
138 | |||
139 | EXPORT_SYMBOL(__flushw_user); | 26 | EXPORT_SYMBOL(__flushw_user); |
27 | EXPORT_SYMBOL_GPL(real_hard_smp_processor_id); | ||
140 | 28 | ||
29 | /* from head_64.S */ | ||
30 | EXPORT_SYMBOL(__ret_efault); | ||
141 | EXPORT_SYMBOL(tlb_type); | 31 | EXPORT_SYMBOL(tlb_type); |
142 | EXPORT_SYMBOL(sun4v_chip_type); | 32 | EXPORT_SYMBOL(sun4v_chip_type); |
143 | EXPORT_SYMBOL(get_fb_unmapped_area); | 33 | EXPORT_SYMBOL(prom_root_node); |
144 | EXPORT_SYMBOL(flush_icache_range); | ||
145 | |||
146 | EXPORT_SYMBOL(flush_dcache_page); | ||
147 | #ifdef DCACHE_ALIASING_POSSIBLE | ||
148 | EXPORT_SYMBOL(__flush_dcache_range); | ||
149 | #endif | ||
150 | 34 | ||
35 | /* from hvcalls.S */ | ||
151 | EXPORT_SYMBOL(sun4v_niagara_getperf); | 36 | EXPORT_SYMBOL(sun4v_niagara_getperf); |
152 | EXPORT_SYMBOL(sun4v_niagara_setperf); | 37 | EXPORT_SYMBOL(sun4v_niagara_setperf); |
153 | EXPORT_SYMBOL(sun4v_niagara2_getperf); | 38 | EXPORT_SYMBOL(sun4v_niagara2_getperf); |
154 | EXPORT_SYMBOL(sun4v_niagara2_setperf); | 39 | EXPORT_SYMBOL(sun4v_niagara2_setperf); |
155 | 40 | ||
156 | EXPORT_SYMBOL(auxio_set_led); | ||
157 | EXPORT_SYMBOL(auxio_set_lte); | ||
158 | #ifdef CONFIG_SBUS | ||
159 | EXPORT_SYMBOL(sbus_set_sbus64); | ||
160 | #endif | ||
161 | EXPORT_SYMBOL(outsb); | ||
162 | EXPORT_SYMBOL(outsw); | ||
163 | EXPORT_SYMBOL(outsl); | ||
164 | EXPORT_SYMBOL(insb); | ||
165 | EXPORT_SYMBOL(insw); | ||
166 | EXPORT_SYMBOL(insl); | ||
167 | #ifdef CONFIG_PCI | 41 | #ifdef CONFIG_PCI |
42 | /* inline functions in asm/pci_64.h */ | ||
168 | EXPORT_SYMBOL(pci_alloc_consistent); | 43 | EXPORT_SYMBOL(pci_alloc_consistent); |
169 | EXPORT_SYMBOL(pci_free_consistent); | 44 | EXPORT_SYMBOL(pci_free_consistent); |
170 | EXPORT_SYMBOL(pci_map_single); | 45 | EXPORT_SYMBOL(pci_map_single); |
@@ -173,112 +48,7 @@ EXPORT_SYMBOL(pci_map_sg); | |||
173 | EXPORT_SYMBOL(pci_unmap_sg); | 48 | EXPORT_SYMBOL(pci_unmap_sg); |
174 | EXPORT_SYMBOL(pci_dma_sync_single_for_cpu); | 49 | EXPORT_SYMBOL(pci_dma_sync_single_for_cpu); |
175 | EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu); | 50 | EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu); |
176 | EXPORT_SYMBOL(pci_dma_supported); | ||
177 | #endif | 51 | #endif |
178 | 52 | ||
179 | /* I/O device mmaping on Sparc64. */ | 53 | /* Exporting a symbol from /init/main.c */ |
180 | EXPORT_SYMBOL(io_remap_pfn_range); | ||
181 | |||
182 | EXPORT_SYMBOL(dump_fpu); | ||
183 | |||
184 | /* math-emu wants this */ | ||
185 | EXPORT_SYMBOL(die_if_kernel); | ||
186 | |||
187 | /* Kernel thread creation. */ | ||
188 | EXPORT_SYMBOL(kernel_thread); | ||
189 | |||
190 | /* prom symbols */ | ||
191 | EXPORT_SYMBOL(idprom); | ||
192 | EXPORT_SYMBOL(prom_root_node); | ||
193 | EXPORT_SYMBOL(prom_getchild); | ||
194 | EXPORT_SYMBOL(prom_getsibling); | ||
195 | EXPORT_SYMBOL(prom_searchsiblings); | ||
196 | EXPORT_SYMBOL(prom_firstprop); | ||
197 | EXPORT_SYMBOL(prom_nextprop); | ||
198 | EXPORT_SYMBOL(prom_getproplen); | ||
199 | EXPORT_SYMBOL(prom_getproperty); | ||
200 | EXPORT_SYMBOL(prom_node_has_property); | ||
201 | EXPORT_SYMBOL(prom_setprop); | ||
202 | EXPORT_SYMBOL(saved_command_line); | 54 | EXPORT_SYMBOL(saved_command_line); |
203 | EXPORT_SYMBOL(prom_finddevice); | ||
204 | EXPORT_SYMBOL(prom_feval); | ||
205 | EXPORT_SYMBOL(prom_getbool); | ||
206 | EXPORT_SYMBOL(prom_getstring); | ||
207 | EXPORT_SYMBOL(prom_getint); | ||
208 | EXPORT_SYMBOL(prom_getintdefault); | ||
209 | EXPORT_SYMBOL(__prom_getchild); | ||
210 | EXPORT_SYMBOL(__prom_getsibling); | ||
211 | |||
212 | /* sparc library symbols */ | ||
213 | EXPORT_SYMBOL(strlen); | ||
214 | EXPORT_SYMBOL(__strlen_user); | ||
215 | EXPORT_SYMBOL(__strnlen_user); | ||
216 | |||
217 | /* Special internal versions of library functions. */ | ||
218 | EXPORT_SYMBOL(_clear_page); | ||
219 | EXPORT_SYMBOL(clear_user_page); | ||
220 | EXPORT_SYMBOL(copy_user_page); | ||
221 | EXPORT_SYMBOL(__bzero); | ||
222 | EXPORT_SYMBOL(__memscan_zero); | ||
223 | EXPORT_SYMBOL(__memscan_generic); | ||
224 | EXPORT_SYMBOL(__memset); | ||
225 | |||
226 | EXPORT_SYMBOL(csum_partial); | ||
227 | EXPORT_SYMBOL(csum_partial_copy_nocheck); | ||
228 | EXPORT_SYMBOL(__csum_partial_copy_from_user); | ||
229 | EXPORT_SYMBOL(__csum_partial_copy_to_user); | ||
230 | EXPORT_SYMBOL(ip_fast_csum); | ||
231 | |||
232 | /* Moving data to/from/in userspace. */ | ||
233 | EXPORT_SYMBOL(___copy_to_user); | ||
234 | EXPORT_SYMBOL(___copy_from_user); | ||
235 | EXPORT_SYMBOL(___copy_in_user); | ||
236 | EXPORT_SYMBOL(copy_to_user_fixup); | ||
237 | EXPORT_SYMBOL(copy_from_user_fixup); | ||
238 | EXPORT_SYMBOL(copy_in_user_fixup); | ||
239 | EXPORT_SYMBOL(__strncpy_from_user); | ||
240 | EXPORT_SYMBOL(__clear_user); | ||
241 | |||
242 | /* Various address conversion macros use this. */ | ||
243 | EXPORT_SYMBOL(sparc64_valid_addr_bitmap); | ||
244 | |||
245 | /* No version information on this, heavily used in inline asm, | ||
246 | * and will always be 'void __ret_efault(void)'. | ||
247 | */ | ||
248 | EXPORT_SYMBOL(__ret_efault); | ||
249 | |||
250 | /* No version information on these, as gcc produces such symbols. */ | ||
251 | EXPORT_SYMBOL(memcmp); | ||
252 | EXPORT_SYMBOL(memcpy); | ||
253 | EXPORT_SYMBOL(memset); | ||
254 | EXPORT_SYMBOL(memmove); | ||
255 | EXPORT_SYMBOL(strncmp); | ||
256 | |||
257 | void VISenter(void); | ||
258 | /* RAID code needs this */ | ||
259 | EXPORT_SYMBOL(VISenter); | ||
260 | |||
261 | /* for input/keybdev */ | ||
262 | EXPORT_SYMBOL(sun_do_break); | ||
263 | EXPORT_SYMBOL(stop_a_enabled); | ||
264 | |||
265 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
266 | EXPORT_SYMBOL(do_BUG); | ||
267 | #endif | ||
268 | |||
269 | /* for ns8703 */ | ||
270 | EXPORT_SYMBOL(ns87303_lock); | ||
271 | |||
272 | EXPORT_SYMBOL(tick_ops); | ||
273 | |||
274 | EXPORT_SYMBOL(xor_vis_2); | ||
275 | EXPORT_SYMBOL(xor_vis_3); | ||
276 | EXPORT_SYMBOL(xor_vis_4); | ||
277 | EXPORT_SYMBOL(xor_vis_5); | ||
278 | |||
279 | EXPORT_SYMBOL(xor_niagara_2); | ||
280 | EXPORT_SYMBOL(xor_niagara_3); | ||
281 | EXPORT_SYMBOL(xor_niagara_4); | ||
282 | EXPORT_SYMBOL(xor_niagara_5); | ||
283 | |||
284 | EXPORT_SYMBOL_GPL(real_hard_smp_processor_id); | ||
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index 16ab0cb731c5..50afaed99c8a 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c | |||
@@ -60,7 +60,7 @@ extern int __smp4d_processor_id(void); | |||
60 | #define SMP_PRINTK(x) | 60 | #define SMP_PRINTK(x) |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | static inline unsigned long swap(volatile unsigned long *ptr, unsigned long val) | 63 | static inline unsigned long sun4d_swap(volatile unsigned long *ptr, unsigned long val) |
64 | { | 64 | { |
65 | __asm__ __volatile__("swap [%1], %0\n\t" : | 65 | __asm__ __volatile__("swap [%1], %0\n\t" : |
66 | "=&r" (val), "=&r" (ptr) : | 66 | "=&r" (val), "=&r" (ptr) : |
@@ -115,7 +115,7 @@ void __cpuinit smp4d_callin(void) | |||
115 | local_flush_tlb_all(); | 115 | local_flush_tlb_all(); |
116 | 116 | ||
117 | /* Allow master to continue. */ | 117 | /* Allow master to continue. */ |
118 | swap((unsigned long *)&cpu_callin_map[cpuid], 1); | 118 | sun4d_swap((unsigned long *)&cpu_callin_map[cpuid], 1); |
119 | local_flush_cache_all(); | 119 | local_flush_cache_all(); |
120 | local_flush_tlb_all(); | 120 | local_flush_tlb_all(); |
121 | 121 | ||
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index 39749e32dc7e..09058fc39e73 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/ipc.h> | 23 | #include <linux/ipc.h> |
24 | #include <linux/personality.h> | 24 | #include <linux/personality.h> |
25 | #include <linux/random.h> | 25 | #include <linux/random.h> |
26 | #include <linux/module.h> | ||
26 | 27 | ||
27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
28 | #include <asm/utrap.h> | 29 | #include <asm/utrap.h> |
@@ -354,6 +355,7 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u | |||
354 | 355 | ||
355 | return addr; | 356 | return addr; |
356 | } | 357 | } |
358 | EXPORT_SYMBOL(get_fb_unmapped_area); | ||
357 | 359 | ||
358 | /* Essentially the same as PowerPC... */ | 360 | /* Essentially the same as PowerPC... */ |
359 | void arch_pick_mmap_layout(struct mm_struct *mm) | 361 | void arch_pick_mmap_layout(struct mm_struct *mm) |
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S index 7a6786a71363..87f5a3b8a253 100644 --- a/arch/sparc/kernel/syscalls.S +++ b/arch/sparc/kernel/syscalls.S | |||
@@ -20,7 +20,7 @@ execve_merge: | |||
20 | add %sp, PTREGS_OFF, %o0 | 20 | add %sp, PTREGS_OFF, %o0 |
21 | 21 | ||
22 | .align 32 | 22 | .align 32 |
23 | sys_pipe: | 23 | sys_sparc_pipe: |
24 | ba,pt %xcc, sparc_pipe | 24 | ba,pt %xcc, sparc_pipe |
25 | add %sp, PTREGS_OFF, %o0 | 25 | add %sp, PTREGS_OFF, %o0 |
26 | sys_nis_syscall: | 26 | sys_nis_syscall: |
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 7d0807586442..dccc95df0c7f 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S | |||
@@ -24,7 +24,7 @@ sys_call_table: | |||
24 | /*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause | 24 | /*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause |
25 | /*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice | 25 | /*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice |
26 | /*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile | 26 | /*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile |
27 | /*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid | 27 | /*40*/ .long sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_getuid |
28 | /*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 | 28 | /*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 |
29 | /*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl | 29 | /*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl |
30 | /*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve | 30 | /*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve |
@@ -56,7 +56,7 @@ sys_call_table: | |||
56 | /*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname | 56 | /*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname |
57 | /*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl | 57 | /*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl |
58 | /*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask | 58 | /*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask |
59 | /*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, old_readdir | 59 | /*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, sys_old_readdir |
60 | /*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 | 60 | /*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 |
61 | /*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo | 61 | /*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo |
62 | /*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex | 62 | /*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index 9fc78cf354bd..e6007bb37046 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -26,7 +26,7 @@ sys_call_table32: | |||
26 | /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause | 26 | /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause |
27 | /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice | 27 | /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice |
28 | .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile | 28 | .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile |
29 | /*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid | 29 | /*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid |
30 | .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 | 30 | .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 |
31 | /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl | 31 | /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl |
32 | .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve | 32 | .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve |
@@ -100,7 +100,7 @@ sys_call_table: | |||
100 | /*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall | 100 | /*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall |
101 | /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice | 101 | /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice |
102 | .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 | 102 | .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 |
103 | /*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall | 103 | /*40*/ .word sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_nis_syscall |
104 | .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid | 104 | .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid |
105 | /*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl | 105 | /*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl |
106 | .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve | 106 | .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve |
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 00f7383c7657..614ac7b4a9dd 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c | |||
@@ -48,6 +48,8 @@ | |||
48 | #include "irq.h" | 48 | #include "irq.h" |
49 | 49 | ||
50 | DEFINE_SPINLOCK(rtc_lock); | 50 | DEFINE_SPINLOCK(rtc_lock); |
51 | EXPORT_SYMBOL(rtc_lock); | ||
52 | |||
51 | static int set_rtc_mmss(unsigned long); | 53 | static int set_rtc_mmss(unsigned long); |
52 | static int sbus_do_settimeofday(struct timespec *tv); | 54 | static int sbus_do_settimeofday(struct timespec *tv); |
53 | 55 | ||
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index 54405d362148..2db3c2229b95 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c | |||
@@ -176,6 +176,7 @@ static struct sparc64_tick_ops tick_operations __read_mostly = { | |||
176 | }; | 176 | }; |
177 | 177 | ||
178 | struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations; | 178 | struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations; |
179 | EXPORT_SYMBOL(tick_ops); | ||
179 | 180 | ||
180 | static void stick_disable_irq(void) | 181 | static void stick_disable_irq(void) |
181 | { | 182 | { |
@@ -639,6 +640,7 @@ unsigned long sparc64_get_clock_tick(unsigned int cpu) | |||
639 | return ft->clock_tick_ref; | 640 | return ft->clock_tick_ref; |
640 | return cpu_data(cpu).clock_tick; | 641 | return cpu_data(cpu).clock_tick; |
641 | } | 642 | } |
643 | EXPORT_SYMBOL(sparc64_get_clock_tick); | ||
642 | 644 | ||
643 | #ifdef CONFIG_CPU_FREQ | 645 | #ifdef CONFIG_CPU_FREQ |
644 | 646 | ||
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c index 213645be6e92..358283341b47 100644 --- a/arch/sparc/kernel/traps_32.c +++ b/arch/sparc/kernel/traps_32.c | |||
@@ -424,6 +424,7 @@ void do_BUG(const char *file, int line) | |||
424 | // bust_spinlocks(1); XXX Not in our original BUG() | 424 | // bust_spinlocks(1); XXX Not in our original BUG() |
425 | printk("kernel BUG at %s:%d!\n", file, line); | 425 | printk("kernel BUG at %s:%d!\n", file, line); |
426 | } | 426 | } |
427 | EXPORT_SYMBOL(do_BUG); | ||
427 | #endif | 428 | #endif |
428 | 429 | ||
429 | /* Since we have our mappings set up, on multiprocessors we can spin them | 430 | /* Since we have our mappings set up, on multiprocessors we can spin them |
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index bca3b4e09c41..c2d153d46586 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
@@ -128,6 +128,7 @@ void do_BUG(const char *file, int line) | |||
128 | bust_spinlocks(1); | 128 | bust_spinlocks(1); |
129 | printk("kernel BUG at %s:%d!\n", file, line); | 129 | printk("kernel BUG at %s:%d!\n", file, line); |
130 | } | 130 | } |
131 | EXPORT_SYMBOL(do_BUG); | ||
131 | #endif | 132 | #endif |
132 | 133 | ||
133 | static DEFINE_SPINLOCK(dimm_handler_lock); | 134 | static DEFINE_SPINLOCK(dimm_handler_lock); |
@@ -2261,6 +2262,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) | |||
2261 | do_exit(SIGKILL); | 2262 | do_exit(SIGKILL); |
2262 | do_exit(SIGSEGV); | 2263 | do_exit(SIGSEGV); |
2263 | } | 2264 | } |
2265 | EXPORT_SYMBOL(die_if_kernel); | ||
2264 | 2266 | ||
2265 | #define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19)) | 2267 | #define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19)) |
2266 | #define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19)) | 2268 | #define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19)) |
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c index f164d5a850f9..379209982a07 100644 --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c | |||
@@ -589,7 +589,6 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr | |||
589 | unsigned long pc = regs->tpc; | 589 | unsigned long pc = regs->tpc; |
590 | unsigned long tstate = regs->tstate; | 590 | unsigned long tstate = regs->tstate; |
591 | u32 insn; | 591 | u32 insn; |
592 | u32 first, second; | ||
593 | u64 value; | 592 | u64 value; |
594 | u8 freg; | 593 | u8 freg; |
595 | int flag; | 594 | int flag; |
@@ -601,19 +600,20 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr | |||
601 | pc = (u32)pc; | 600 | pc = (u32)pc; |
602 | if (get_user(insn, (u32 __user *) pc) != -EFAULT) { | 601 | if (get_user(insn, (u32 __user *) pc) != -EFAULT) { |
603 | int asi = decode_asi(insn, regs); | 602 | int asi = decode_asi(insn, regs); |
603 | u32 first, second; | ||
604 | int err; | 604 | int err; |
605 | 605 | ||
606 | if ((asi > ASI_SNFL) || | 606 | if ((asi > ASI_SNFL) || |
607 | (asi < ASI_P)) | 607 | (asi < ASI_P)) |
608 | goto daex; | 608 | goto daex; |
609 | first = second = 0; | ||
609 | err = get_user(first, (u32 __user *)sfar); | 610 | err = get_user(first, (u32 __user *)sfar); |
610 | if (!err) | 611 | if (!err) |
611 | err = get_user(second, (u32 __user *)(sfar + 4)); | 612 | err = get_user(second, (u32 __user *)(sfar + 4)); |
612 | if (err) { | 613 | if (err) { |
613 | if (asi & 0x2) /* NF */ { | 614 | if (!(asi & 0x2)) |
614 | first = 0; second = 0; | ||
615 | } else | ||
616 | goto daex; | 615 | goto daex; |
616 | first = second = 0; | ||
617 | } | 617 | } |
618 | save_and_clear_fpu(); | 618 | save_and_clear_fpu(); |
619 | freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); | 619 | freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); |
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index 375016e19144..273fc85269fc 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile | |||
@@ -42,3 +42,4 @@ lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o | |||
42 | 42 | ||
43 | obj-y += iomap.o | 43 | obj-y += iomap.o |
44 | obj-$(CONFIG_SPARC32) += atomic32.o | 44 | obj-$(CONFIG_SPARC32) += atomic32.o |
45 | obj-y += ksyms.o | ||
diff --git a/arch/sparc/lib/PeeCeeI.c b/arch/sparc/lib/PeeCeeI.c index 46053e6ddd7b..6529f8657597 100644 --- a/arch/sparc/lib/PeeCeeI.c +++ b/arch/sparc/lib/PeeCeeI.c | |||
@@ -4,6 +4,8 @@ | |||
4 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/module.h> | ||
8 | |||
7 | #include <asm/io.h> | 9 | #include <asm/io.h> |
8 | #include <asm/byteorder.h> | 10 | #include <asm/byteorder.h> |
9 | 11 | ||
@@ -15,6 +17,7 @@ void outsb(unsigned long __addr, const void *src, unsigned long count) | |||
15 | while (count--) | 17 | while (count--) |
16 | outb(*p++, addr); | 18 | outb(*p++, addr); |
17 | } | 19 | } |
20 | EXPORT_SYMBOL(outsb); | ||
18 | 21 | ||
19 | void outsw(unsigned long __addr, const void *src, unsigned long count) | 22 | void outsw(unsigned long __addr, const void *src, unsigned long count) |
20 | { | 23 | { |
@@ -25,6 +28,7 @@ void outsw(unsigned long __addr, const void *src, unsigned long count) | |||
25 | src += sizeof(u16); | 28 | src += sizeof(u16); |
26 | } | 29 | } |
27 | } | 30 | } |
31 | EXPORT_SYMBOL(outsw); | ||
28 | 32 | ||
29 | void outsl(unsigned long __addr, const void *src, unsigned long count) | 33 | void outsl(unsigned long __addr, const void *src, unsigned long count) |
30 | { | 34 | { |
@@ -78,6 +82,7 @@ void outsl(unsigned long __addr, const void *src, unsigned long count) | |||
78 | break; | 82 | break; |
79 | } | 83 | } |
80 | } | 84 | } |
85 | EXPORT_SYMBOL(outsl); | ||
81 | 86 | ||
82 | void insb(unsigned long __addr, void *dst, unsigned long count) | 87 | void insb(unsigned long __addr, void *dst, unsigned long count) |
83 | { | 88 | { |
@@ -105,6 +110,7 @@ void insb(unsigned long __addr, void *dst, unsigned long count) | |||
105 | *pb++ = inb(addr); | 110 | *pb++ = inb(addr); |
106 | } | 111 | } |
107 | } | 112 | } |
113 | EXPORT_SYMBOL(insb); | ||
108 | 114 | ||
109 | void insw(unsigned long __addr, void *dst, unsigned long count) | 115 | void insw(unsigned long __addr, void *dst, unsigned long count) |
110 | { | 116 | { |
@@ -132,6 +138,7 @@ void insw(unsigned long __addr, void *dst, unsigned long count) | |||
132 | *ps = le16_to_cpu(inw(addr)); | 138 | *ps = le16_to_cpu(inw(addr)); |
133 | } | 139 | } |
134 | } | 140 | } |
141 | EXPORT_SYMBOL(insw); | ||
135 | 142 | ||
136 | void insl(unsigned long __addr, void *dst, unsigned long count) | 143 | void insl(unsigned long __addr, void *dst, unsigned long count) |
137 | { | 144 | { |
@@ -200,4 +207,5 @@ void insl(unsigned long __addr, void *dst, unsigned long count) | |||
200 | } | 207 | } |
201 | } | 208 | } |
202 | } | 209 | } |
210 | EXPORT_SYMBOL(insl); | ||
203 | 211 | ||
diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c new file mode 100644 index 000000000000..704b12668388 --- /dev/null +++ b/arch/sparc/lib/ksyms.c | |||
@@ -0,0 +1,196 @@ | |||
1 | /* | ||
2 | * Export of symbols defined in assembler | ||
3 | */ | ||
4 | |||
5 | /* Tell string.h we don't want memcpy etc. as cpp defines */ | ||
6 | #define EXPORT_SYMTAB_STROPS | ||
7 | |||
8 | #include <linux/module.h> | ||
9 | #include <linux/string.h> | ||
10 | #include <linux/types.h> | ||
11 | |||
12 | #include <asm/checksum.h> | ||
13 | #include <asm/uaccess.h> | ||
14 | #include <asm/ftrace.h> | ||
15 | |||
16 | /* string functions */ | ||
17 | EXPORT_SYMBOL(strlen); | ||
18 | EXPORT_SYMBOL(__strlen_user); | ||
19 | EXPORT_SYMBOL(__strnlen_user); | ||
20 | EXPORT_SYMBOL(strncmp); | ||
21 | |||
22 | /* mem* functions */ | ||
23 | extern void *__memscan_zero(void *, size_t); | ||
24 | extern void *__memscan_generic(void *, int, size_t); | ||
25 | extern void *__bzero(void *, size_t); | ||
26 | |||
27 | EXPORT_SYMBOL(memscan); | ||
28 | EXPORT_SYMBOL(__memscan_zero); | ||
29 | EXPORT_SYMBOL(__memscan_generic); | ||
30 | EXPORT_SYMBOL(memcmp); | ||
31 | EXPORT_SYMBOL(memcpy); | ||
32 | EXPORT_SYMBOL(memset); | ||
33 | EXPORT_SYMBOL(__memset); | ||
34 | EXPORT_SYMBOL(memmove); | ||
35 | EXPORT_SYMBOL(__bzero); | ||
36 | |||
37 | /* Moving data to/from/in userspace. */ | ||
38 | EXPORT_SYMBOL(__strncpy_from_user); | ||
39 | |||
40 | /* Networking helper routines. */ | ||
41 | EXPORT_SYMBOL(csum_partial); | ||
42 | |||
43 | #ifdef CONFIG_MCOUNT | ||
44 | EXPORT_SYMBOL(_mcount); | ||
45 | #endif | ||
46 | |||
47 | /* | ||
48 | * sparc | ||
49 | */ | ||
50 | #ifdef CONFIG_SPARC32 | ||
51 | extern int __ashrdi3(int, int); | ||
52 | extern int __ashldi3(int, int); | ||
53 | extern int __lshrdi3(int, int); | ||
54 | extern int __muldi3(int, int); | ||
55 | extern int __divdi3(int, int); | ||
56 | |||
57 | extern void (*__copy_1page)(void *, const void *); | ||
58 | extern void (*bzero_1page)(void *); | ||
59 | |||
60 | extern int __strncmp(const char *, const char *, __kernel_size_t); | ||
61 | |||
62 | extern void ___rw_read_enter(void); | ||
63 | extern void ___rw_read_try(void); | ||
64 | extern void ___rw_read_exit(void); | ||
65 | extern void ___rw_write_enter(void); | ||
66 | extern void ___atomic24_add(void); | ||
67 | extern void ___atomic24_sub(void); | ||
68 | |||
69 | /* Alias functions whose names begin with "." and export the aliases. | ||
70 | * The module references will be fixed up by module_frob_arch_sections. | ||
71 | */ | ||
72 | extern int _Div(int, int); | ||
73 | extern int _Mul(int, int); | ||
74 | extern int _Rem(int, int); | ||
75 | extern unsigned _Udiv(unsigned, unsigned); | ||
76 | extern unsigned _Umul(unsigned, unsigned); | ||
77 | extern unsigned _Urem(unsigned, unsigned); | ||
78 | |||
79 | /* Networking helper routines. */ | ||
80 | EXPORT_SYMBOL(__csum_partial_copy_sparc_generic); | ||
81 | |||
82 | /* Special internal versions of library functions. */ | ||
83 | EXPORT_SYMBOL(__copy_1page); | ||
84 | EXPORT_SYMBOL(__memcpy); | ||
85 | EXPORT_SYMBOL(__memmove); | ||
86 | EXPORT_SYMBOL(bzero_1page); | ||
87 | |||
88 | /* string functions */ | ||
89 | EXPORT_SYMBOL(__strncmp); | ||
90 | |||
91 | /* Moving data to/from/in userspace. */ | ||
92 | EXPORT_SYMBOL(__copy_user); | ||
93 | |||
94 | /* Used by asm/spinlock.h */ | ||
95 | #ifdef CONFIG_SMP | ||
96 | EXPORT_SYMBOL(___rw_read_enter); | ||
97 | EXPORT_SYMBOL(___rw_read_try); | ||
98 | EXPORT_SYMBOL(___rw_read_exit); | ||
99 | EXPORT_SYMBOL(___rw_write_enter); | ||
100 | #endif | ||
101 | |||
102 | /* Atomic operations. */ | ||
103 | EXPORT_SYMBOL(___atomic24_add); | ||
104 | EXPORT_SYMBOL(___atomic24_sub); | ||
105 | |||
106 | EXPORT_SYMBOL(__ashrdi3); | ||
107 | EXPORT_SYMBOL(__ashldi3); | ||
108 | EXPORT_SYMBOL(__lshrdi3); | ||
109 | EXPORT_SYMBOL(__muldi3); | ||
110 | EXPORT_SYMBOL(__divdi3); | ||
111 | |||
112 | EXPORT_SYMBOL(_Rem); | ||
113 | EXPORT_SYMBOL(_Urem); | ||
114 | EXPORT_SYMBOL(_Mul); | ||
115 | EXPORT_SYMBOL(_Umul); | ||
116 | EXPORT_SYMBOL(_Div); | ||
117 | EXPORT_SYMBOL(_Udiv); | ||
118 | #endif | ||
119 | |||
120 | /* | ||
121 | * sparc64 | ||
122 | */ | ||
123 | #ifdef CONFIG_SPARC64 | ||
124 | /* Networking helper routines. */ | ||
125 | EXPORT_SYMBOL(csum_partial_copy_nocheck); | ||
126 | EXPORT_SYMBOL(__csum_partial_copy_from_user); | ||
127 | EXPORT_SYMBOL(__csum_partial_copy_to_user); | ||
128 | EXPORT_SYMBOL(ip_fast_csum); | ||
129 | |||
130 | /* Moving data to/from/in userspace. */ | ||
131 | EXPORT_SYMBOL(___copy_to_user); | ||
132 | EXPORT_SYMBOL(___copy_from_user); | ||
133 | EXPORT_SYMBOL(___copy_in_user); | ||
134 | EXPORT_SYMBOL(__clear_user); | ||
135 | |||
136 | /* RW semaphores */ | ||
137 | EXPORT_SYMBOL(__down_read); | ||
138 | EXPORT_SYMBOL(__down_read_trylock); | ||
139 | EXPORT_SYMBOL(__down_write); | ||
140 | EXPORT_SYMBOL(__down_write_trylock); | ||
141 | EXPORT_SYMBOL(__up_read); | ||
142 | EXPORT_SYMBOL(__up_write); | ||
143 | EXPORT_SYMBOL(__downgrade_write); | ||
144 | |||
145 | /* Atomic counter implementation. */ | ||
146 | EXPORT_SYMBOL(atomic_add); | ||
147 | EXPORT_SYMBOL(atomic_add_ret); | ||
148 | EXPORT_SYMBOL(atomic_sub); | ||
149 | EXPORT_SYMBOL(atomic_sub_ret); | ||
150 | EXPORT_SYMBOL(atomic64_add); | ||
151 | EXPORT_SYMBOL(atomic64_add_ret); | ||
152 | EXPORT_SYMBOL(atomic64_sub); | ||
153 | EXPORT_SYMBOL(atomic64_sub_ret); | ||
154 | |||
155 | /* Atomic bit operations. */ | ||
156 | EXPORT_SYMBOL(test_and_set_bit); | ||
157 | EXPORT_SYMBOL(test_and_clear_bit); | ||
158 | EXPORT_SYMBOL(test_and_change_bit); | ||
159 | EXPORT_SYMBOL(set_bit); | ||
160 | EXPORT_SYMBOL(clear_bit); | ||
161 | EXPORT_SYMBOL(change_bit); | ||
162 | |||
163 | /* Special internal versions of library functions. */ | ||
164 | EXPORT_SYMBOL(_clear_page); | ||
165 | EXPORT_SYMBOL(clear_user_page); | ||
166 | EXPORT_SYMBOL(copy_user_page); | ||
167 | |||
168 | /* RAID code needs this */ | ||
169 | void VISenter(void); | ||
170 | EXPORT_SYMBOL(VISenter); | ||
171 | |||
172 | extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); | ||
173 | extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, | ||
174 | unsigned long *); | ||
175 | extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *, | ||
176 | unsigned long *, unsigned long *); | ||
177 | extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *, | ||
178 | unsigned long *, unsigned long *, unsigned long *); | ||
179 | EXPORT_SYMBOL(xor_vis_2); | ||
180 | EXPORT_SYMBOL(xor_vis_3); | ||
181 | EXPORT_SYMBOL(xor_vis_4); | ||
182 | EXPORT_SYMBOL(xor_vis_5); | ||
183 | |||
184 | extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *); | ||
185 | extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *, | ||
186 | unsigned long *); | ||
187 | extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *, | ||
188 | unsigned long *, unsigned long *); | ||
189 | extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *, | ||
190 | unsigned long *, unsigned long *, unsigned long *); | ||
191 | |||
192 | EXPORT_SYMBOL(xor_niagara_2); | ||
193 | EXPORT_SYMBOL(xor_niagara_3); | ||
194 | EXPORT_SYMBOL(xor_niagara_4); | ||
195 | EXPORT_SYMBOL(xor_niagara_5); | ||
196 | #endif | ||
diff --git a/arch/sparc/lib/user_fixup.c b/arch/sparc/lib/user_fixup.c index 05a361b0a1a4..ac96ae236709 100644 --- a/arch/sparc/lib/user_fixup.c +++ b/arch/sparc/lib/user_fixup.c | |||
@@ -7,6 +7,8 @@ | |||
7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
8 | #include <linux/string.h> | 8 | #include <linux/string.h> |
9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
10 | #include <linux/module.h> | ||
11 | |||
10 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
11 | 13 | ||
12 | /* Calculating the exact fault address when using | 14 | /* Calculating the exact fault address when using |
@@ -40,6 +42,7 @@ unsigned long copy_from_user_fixup(void *to, const void __user *from, unsigned l | |||
40 | 42 | ||
41 | return size; | 43 | return size; |
42 | } | 44 | } |
45 | EXPORT_SYMBOL(copy_from_user_fixup); | ||
43 | 46 | ||
44 | unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size) | 47 | unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size) |
45 | { | 48 | { |
@@ -47,6 +50,7 @@ unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned lon | |||
47 | 50 | ||
48 | return compute_size((unsigned long) to, size, &offset); | 51 | return compute_size((unsigned long) to, size, &offset); |
49 | } | 52 | } |
53 | EXPORT_SYMBOL(copy_to_user_fixup); | ||
50 | 54 | ||
51 | unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size) | 55 | unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size) |
52 | { | 56 | { |
@@ -64,3 +68,4 @@ unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned lo | |||
64 | 68 | ||
65 | return size; | 69 | return size; |
66 | } | 70 | } |
71 | EXPORT_SYMBOL(copy_in_user_fixup); | ||
diff --git a/arch/sparc/mm/generic_32.c b/arch/sparc/mm/generic_32.c index a289261da9fd..5edcac184eaf 100644 --- a/arch/sparc/mm/generic_32.c +++ b/arch/sparc/mm/generic_32.c | |||
@@ -95,3 +95,4 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | |||
95 | flush_tlb_range(vma, beg, end); | 95 | flush_tlb_range(vma, beg, end); |
96 | return error; | 96 | return error; |
97 | } | 97 | } |
98 | EXPORT_SYMBOL(io_remap_pfn_range); | ||
diff --git a/arch/sparc/mm/generic_64.c b/arch/sparc/mm/generic_64.c index f362c2037013..04f2bf4cd571 100644 --- a/arch/sparc/mm/generic_64.c +++ b/arch/sparc/mm/generic_64.c | |||
@@ -161,3 +161,4 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | |||
161 | flush_tlb_range(vma, beg, end); | 161 | flush_tlb_range(vma, beg, end); |
162 | return error; | 162 | return error; |
163 | } | 163 | } |
164 | EXPORT_SYMBOL(io_remap_pfn_range); | ||
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c index 01fc6c254292..752d0c9fb544 100644 --- a/arch/sparc/mm/highmem.c +++ b/arch/sparc/mm/highmem.c | |||
@@ -62,6 +62,7 @@ void *kmap_atomic(struct page *page, enum km_type type) | |||
62 | 62 | ||
63 | return (void*) vaddr; | 63 | return (void*) vaddr; |
64 | } | 64 | } |
65 | EXPORT_SYMBOL(kmap_atomic); | ||
65 | 66 | ||
66 | void kunmap_atomic(void *kvaddr, enum km_type type) | 67 | void kunmap_atomic(void *kvaddr, enum km_type type) |
67 | { | 68 | { |
@@ -98,6 +99,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type) | |||
98 | 99 | ||
99 | pagefault_enable(); | 100 | pagefault_enable(); |
100 | } | 101 | } |
102 | EXPORT_SYMBOL(kunmap_atomic); | ||
101 | 103 | ||
102 | /* We may be fed a pagetable here by ptep_to_xxx and others. */ | 104 | /* We may be fed a pagetable here by ptep_to_xxx and others. */ |
103 | struct page *kmap_atomic_to_page(void *ptr) | 105 | struct page *kmap_atomic_to_page(void *ptr) |
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index fec926021f49..cbb282dab5a7 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c | |||
@@ -38,11 +38,16 @@ | |||
38 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | 38 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); |
39 | 39 | ||
40 | unsigned long *sparc_valid_addr_bitmap; | 40 | unsigned long *sparc_valid_addr_bitmap; |
41 | EXPORT_SYMBOL(sparc_valid_addr_bitmap); | ||
41 | 42 | ||
42 | unsigned long phys_base; | 43 | unsigned long phys_base; |
44 | EXPORT_SYMBOL(phys_base); | ||
45 | |||
43 | unsigned long pfn_base; | 46 | unsigned long pfn_base; |
47 | EXPORT_SYMBOL(pfn_base); | ||
44 | 48 | ||
45 | unsigned long page_kernel; | 49 | unsigned long page_kernel; |
50 | EXPORT_SYMBOL(page_kernel); | ||
46 | 51 | ||
47 | struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1]; | 52 | struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1]; |
48 | unsigned long sparc_unmapped_base; | 53 | unsigned long sparc_unmapped_base; |
@@ -522,3 +527,4 @@ void sparc_flush_page_to_ram(struct page *page) | |||
522 | if (vaddr) | 527 | if (vaddr) |
523 | __flush_page_to_ram(vaddr); | 528 | __flush_page_to_ram(vaddr); |
524 | } | 529 | } |
530 | EXPORT_SYMBOL(sparc_flush_page_to_ram); | ||
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index c77c7ef5d5d4..00373ce2d8fb 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -146,6 +146,7 @@ static void __init read_obp_memory(const char *property, | |||
146 | } | 146 | } |
147 | 147 | ||
148 | unsigned long *sparc64_valid_addr_bitmap __read_mostly; | 148 | unsigned long *sparc64_valid_addr_bitmap __read_mostly; |
149 | EXPORT_SYMBOL(sparc64_valid_addr_bitmap); | ||
149 | 150 | ||
150 | /* Kernel physical address base and size in bytes. */ | 151 | /* Kernel physical address base and size in bytes. */ |
151 | unsigned long kern_base __read_mostly; | 152 | unsigned long kern_base __read_mostly; |
@@ -369,6 +370,7 @@ void flush_dcache_page(struct page *page) | |||
369 | out: | 370 | out: |
370 | put_cpu(); | 371 | put_cpu(); |
371 | } | 372 | } |
373 | EXPORT_SYMBOL(flush_dcache_page); | ||
372 | 374 | ||
373 | void __kprobes flush_icache_range(unsigned long start, unsigned long end) | 375 | void __kprobes flush_icache_range(unsigned long start, unsigned long end) |
374 | { | 376 | { |
@@ -396,6 +398,7 @@ void __kprobes flush_icache_range(unsigned long start, unsigned long end) | |||
396 | } | 398 | } |
397 | } | 399 | } |
398 | } | 400 | } |
401 | EXPORT_SYMBOL(flush_icache_range); | ||
399 | 402 | ||
400 | void mmu_info(struct seq_file *m) | 403 | void mmu_info(struct seq_file *m) |
401 | { | 404 | { |
@@ -599,6 +602,7 @@ void __flush_dcache_range(unsigned long start, unsigned long end) | |||
599 | "i" (ASI_DCACHE_INVALIDATE)); | 602 | "i" (ASI_DCACHE_INVALIDATE)); |
600 | } | 603 | } |
601 | } | 604 | } |
605 | EXPORT_SYMBOL(__flush_dcache_range); | ||
602 | 606 | ||
603 | /* get_new_mmu_context() uses "cache + 1". */ | 607 | /* get_new_mmu_context() uses "cache + 1". */ |
604 | DEFINE_SPINLOCK(ctx_alloc_lock); | 608 | DEFINE_SPINLOCK(ctx_alloc_lock); |
diff --git a/arch/sparc/prom/init_32.c b/arch/sparc/prom/init_32.c index 873217c6d823..6193c33ed4d4 100644 --- a/arch/sparc/prom/init_32.c +++ b/arch/sparc/prom/init_32.c | |||
@@ -8,16 +8,20 @@ | |||
8 | 8 | ||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/module.h> | ||
11 | 12 | ||
12 | #include <asm/openprom.h> | 13 | #include <asm/openprom.h> |
13 | #include <asm/oplib.h> | 14 | #include <asm/oplib.h> |
14 | 15 | ||
15 | struct linux_romvec *romvec; | 16 | struct linux_romvec *romvec; |
17 | EXPORT_SYMBOL(romvec); | ||
18 | |||
16 | enum prom_major_version prom_vers; | 19 | enum prom_major_version prom_vers; |
17 | unsigned int prom_rev, prom_prev; | 20 | unsigned int prom_rev, prom_prev; |
18 | 21 | ||
19 | /* The root node of the prom device tree. */ | 22 | /* The root node of the prom device tree. */ |
20 | int prom_root_node; | 23 | int prom_root_node; |
24 | EXPORT_SYMBOL(prom_root_node); | ||
21 | 25 | ||
22 | /* Pointer to the device tree operations structure. */ | 26 | /* Pointer to the device tree operations structure. */ |
23 | struct linux_nodeops *prom_nodeops; | 27 | struct linux_nodeops *prom_nodeops; |
diff --git a/arch/sparc/prom/misc_32.c b/arch/sparc/prom/misc_32.c index cf6c3f6d36c3..4d61c540bb3d 100644 --- a/arch/sparc/prom/misc_32.c +++ b/arch/sparc/prom/misc_32.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
11 | #include <linux/module.h> | ||
12 | |||
11 | #include <asm/openprom.h> | 13 | #include <asm/openprom.h> |
12 | #include <asm/oplib.h> | 14 | #include <asm/oplib.h> |
13 | #include <asm/auxio.h> | 15 | #include <asm/auxio.h> |
@@ -44,6 +46,7 @@ prom_feval(char *fstring) | |||
44 | restore_current(); | 46 | restore_current(); |
45 | spin_unlock_irqrestore(&prom_lock, flags); | 47 | spin_unlock_irqrestore(&prom_lock, flags); |
46 | } | 48 | } |
49 | EXPORT_SYMBOL(prom_feval); | ||
47 | 50 | ||
48 | /* Drop into the prom, with the chance to continue with the 'go' | 51 | /* Drop into the prom, with the chance to continue with the 'go' |
49 | * prom command. | 52 | * prom command. |
diff --git a/arch/sparc/prom/misc_64.c b/arch/sparc/prom/misc_64.c index 9b0c0760901e..eedffb4fec2d 100644 --- a/arch/sparc/prom/misc_64.c +++ b/arch/sparc/prom/misc_64.c | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
14 | #include <linux/module.h> | ||
15 | |||
14 | #include <asm/openprom.h> | 16 | #include <asm/openprom.h> |
15 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
16 | #include <asm/system.h> | 18 | #include <asm/system.h> |
@@ -54,6 +56,7 @@ void prom_feval(const char *fstring) | |||
54 | p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) | | 56 | p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) | |
55 | P1275_INOUT(1, 1), fstring); | 57 | P1275_INOUT(1, 1), fstring); |
56 | } | 58 | } |
59 | EXPORT_SYMBOL(prom_feval); | ||
57 | 60 | ||
58 | #ifdef CONFIG_SMP | 61 | #ifdef CONFIG_SMP |
59 | extern void smp_capture(void); | 62 | extern void smp_capture(void); |
diff --git a/arch/sparc/prom/ranges.c b/arch/sparc/prom/ranges.c index 64579a376419..cd5790853ff6 100644 --- a/arch/sparc/prom/ranges.c +++ b/arch/sparc/prom/ranges.c | |||
@@ -6,6 +6,8 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
9 | #include <linux/module.h> | ||
10 | |||
9 | #include <asm/openprom.h> | 11 | #include <asm/openprom.h> |
10 | #include <asm/oplib.h> | 12 | #include <asm/oplib.h> |
11 | #include <asm/types.h> | 13 | #include <asm/types.h> |
@@ -62,6 +64,7 @@ prom_apply_obio_ranges(struct linux_prom_registers *regs, int nregs) | |||
62 | if(num_obio_ranges) | 64 | if(num_obio_ranges) |
63 | prom_adjust_regs(regs, nregs, promlib_obio_ranges, num_obio_ranges); | 65 | prom_adjust_regs(regs, nregs, promlib_obio_ranges, num_obio_ranges); |
64 | } | 66 | } |
67 | EXPORT_SYMBOL(prom_apply_obio_ranges); | ||
65 | 68 | ||
66 | void __init prom_ranges_init(void) | 69 | void __init prom_ranges_init(void) |
67 | { | 70 | { |
diff --git a/arch/sparc/prom/tree_32.c b/arch/sparc/prom/tree_32.c index 6d8187357331..646d244b1fdb 100644 --- a/arch/sparc/prom/tree_32.c +++ b/arch/sparc/prom/tree_32.c | |||
@@ -5,13 +5,12 @@ | |||
5 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | 5 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define PROMLIB_INTERNAL | ||
9 | |||
10 | #include <linux/string.h> | 8 | #include <linux/string.h> |
11 | #include <linux/types.h> | 9 | #include <linux/types.h> |
12 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
13 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
14 | #include <linux/ctype.h> | 12 | #include <linux/ctype.h> |
13 | #include <linux/module.h> | ||
15 | 14 | ||
16 | #include <asm/openprom.h> | 15 | #include <asm/openprom.h> |
17 | #include <asm/oplib.h> | 16 | #include <asm/oplib.h> |
@@ -50,6 +49,7 @@ int prom_getchild(int node) | |||
50 | 49 | ||
51 | return cnode; | 50 | return cnode; |
52 | } | 51 | } |
52 | EXPORT_SYMBOL(prom_getchild); | ||
53 | 53 | ||
54 | /* Internal version of prom_getsibling that does not alter return values. */ | 54 | /* Internal version of prom_getsibling that does not alter return values. */ |
55 | int __prom_getsibling(int node) | 55 | int __prom_getsibling(int node) |
@@ -81,6 +81,7 @@ int prom_getsibling(int node) | |||
81 | 81 | ||
82 | return sibnode; | 82 | return sibnode; |
83 | } | 83 | } |
84 | EXPORT_SYMBOL(prom_getsibling); | ||
84 | 85 | ||
85 | /* Return the length in bytes of property 'prop' at node 'node'. | 86 | /* Return the length in bytes of property 'prop' at node 'node'. |
86 | * Return -1 on error. | 87 | * Return -1 on error. |
@@ -99,6 +100,7 @@ int prom_getproplen(int node, const char *prop) | |||
99 | spin_unlock_irqrestore(&prom_lock, flags); | 100 | spin_unlock_irqrestore(&prom_lock, flags); |
100 | return ret; | 101 | return ret; |
101 | } | 102 | } |
103 | EXPORT_SYMBOL(prom_getproplen); | ||
102 | 104 | ||
103 | /* Acquire a property 'prop' at node 'node' and place it in | 105 | /* Acquire a property 'prop' at node 'node' and place it in |
104 | * 'buffer' which has a size of 'bufsize'. If the acquisition | 106 | * 'buffer' which has a size of 'bufsize'. If the acquisition |
@@ -119,6 +121,7 @@ int prom_getproperty(int node, const char *prop, char *buffer, int bufsize) | |||
119 | spin_unlock_irqrestore(&prom_lock, flags); | 121 | spin_unlock_irqrestore(&prom_lock, flags); |
120 | return ret; | 122 | return ret; |
121 | } | 123 | } |
124 | EXPORT_SYMBOL(prom_getproperty); | ||
122 | 125 | ||
123 | /* Acquire an integer property and return its value. Returns -1 | 126 | /* Acquire an integer property and return its value. Returns -1 |
124 | * on failure. | 127 | * on failure. |
@@ -132,6 +135,7 @@ int prom_getint(int node, char *prop) | |||
132 | 135 | ||
133 | return -1; | 136 | return -1; |
134 | } | 137 | } |
138 | EXPORT_SYMBOL(prom_getint); | ||
135 | 139 | ||
136 | /* Acquire an integer property, upon error return the passed default | 140 | /* Acquire an integer property, upon error return the passed default |
137 | * integer. | 141 | * integer. |
@@ -145,6 +149,7 @@ int prom_getintdefault(int node, char *property, int deflt) | |||
145 | 149 | ||
146 | return retval; | 150 | return retval; |
147 | } | 151 | } |
152 | EXPORT_SYMBOL(prom_getintdefault); | ||
148 | 153 | ||
149 | /* Acquire a boolean property, 1=TRUE 0=FALSE. */ | 154 | /* Acquire a boolean property, 1=TRUE 0=FALSE. */ |
150 | int prom_getbool(int node, char *prop) | 155 | int prom_getbool(int node, char *prop) |
@@ -155,6 +160,7 @@ int prom_getbool(int node, char *prop) | |||
155 | if(retval == -1) return 0; | 160 | if(retval == -1) return 0; |
156 | return 1; | 161 | return 1; |
157 | } | 162 | } |
163 | EXPORT_SYMBOL(prom_getbool); | ||
158 | 164 | ||
159 | /* Acquire a property whose value is a string, returns a null | 165 | /* Acquire a property whose value is a string, returns a null |
160 | * string on error. The char pointer is the user supplied string | 166 | * string on error. The char pointer is the user supplied string |
@@ -169,6 +175,7 @@ void prom_getstring(int node, char *prop, char *user_buf, int ubuf_size) | |||
169 | user_buf[0] = 0; | 175 | user_buf[0] = 0; |
170 | return; | 176 | return; |
171 | } | 177 | } |
178 | EXPORT_SYMBOL(prom_getstring); | ||
172 | 179 | ||
173 | 180 | ||
174 | /* Does the device at node 'node' have name 'name'? | 181 | /* Does the device at node 'node' have name 'name'? |
@@ -204,6 +211,7 @@ int prom_searchsiblings(int node_start, char *nodename) | |||
204 | 211 | ||
205 | return 0; | 212 | return 0; |
206 | } | 213 | } |
214 | EXPORT_SYMBOL(prom_searchsiblings); | ||
207 | 215 | ||
208 | /* Interal version of nextprop that does not alter return values. */ | 216 | /* Interal version of nextprop that does not alter return values. */ |
209 | char * __prom_nextprop(int node, char * oprop) | 217 | char * __prom_nextprop(int node, char * oprop) |
@@ -228,6 +236,7 @@ char * prom_firstprop(int node, char *bufer) | |||
228 | 236 | ||
229 | return __prom_nextprop(node, ""); | 237 | return __prom_nextprop(node, ""); |
230 | } | 238 | } |
239 | EXPORT_SYMBOL(prom_firstprop); | ||
231 | 240 | ||
232 | /* Return the property type string after property type 'oprop' | 241 | /* Return the property type string after property type 'oprop' |
233 | * at node 'node' . Returns empty string if no more | 242 | * at node 'node' . Returns empty string if no more |
@@ -240,6 +249,7 @@ char * prom_nextprop(int node, char *oprop, char *buffer) | |||
240 | 249 | ||
241 | return __prom_nextprop(node, oprop); | 250 | return __prom_nextprop(node, oprop); |
242 | } | 251 | } |
252 | EXPORT_SYMBOL(prom_nextprop); | ||
243 | 253 | ||
244 | int prom_finddevice(char *name) | 254 | int prom_finddevice(char *name) |
245 | { | 255 | { |
@@ -287,6 +297,7 @@ int prom_finddevice(char *name) | |||
287 | } | 297 | } |
288 | return node; | 298 | return node; |
289 | } | 299 | } |
300 | EXPORT_SYMBOL(prom_finddevice); | ||
290 | 301 | ||
291 | int prom_node_has_property(int node, char *prop) | 302 | int prom_node_has_property(int node, char *prop) |
292 | { | 303 | { |
@@ -299,6 +310,7 @@ int prom_node_has_property(int node, char *prop) | |||
299 | } while (*current_property); | 310 | } while (*current_property); |
300 | return 0; | 311 | return 0; |
301 | } | 312 | } |
313 | EXPORT_SYMBOL(prom_node_has_property); | ||
302 | 314 | ||
303 | /* Set property 'pname' at node 'node' to value 'value' which has a length | 315 | /* Set property 'pname' at node 'node' to value 'value' which has a length |
304 | * of 'size' bytes. Return the number of bytes the prom accepted. | 316 | * of 'size' bytes. Return the number of bytes the prom accepted. |
@@ -316,6 +328,7 @@ int prom_setprop(int node, const char *pname, char *value, int size) | |||
316 | spin_unlock_irqrestore(&prom_lock, flags); | 328 | spin_unlock_irqrestore(&prom_lock, flags); |
317 | return ret; | 329 | return ret; |
318 | } | 330 | } |
331 | EXPORT_SYMBOL(prom_setprop); | ||
319 | 332 | ||
320 | int prom_inst2pkg(int inst) | 333 | int prom_inst2pkg(int inst) |
321 | { | 334 | { |
diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c index 281aea44790b..8ea73ddc61dc 100644 --- a/arch/sparc/prom/tree_64.c +++ b/arch/sparc/prom/tree_64.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/module.h> | ||
13 | 14 | ||
14 | #include <asm/openprom.h> | 15 | #include <asm/openprom.h> |
15 | #include <asm/oplib.h> | 16 | #include <asm/oplib.h> |
@@ -32,6 +33,7 @@ inline int prom_getchild(int node) | |||
32 | if(cnode == -1) return 0; | 33 | if(cnode == -1) return 0; |
33 | return (int)cnode; | 34 | return (int)cnode; |
34 | } | 35 | } |
36 | EXPORT_SYMBOL(prom_getchild); | ||
35 | 37 | ||
36 | inline int prom_getparent(int node) | 38 | inline int prom_getparent(int node) |
37 | { | 39 | { |
@@ -63,6 +65,7 @@ inline int prom_getsibling(int node) | |||
63 | 65 | ||
64 | return sibnode; | 66 | return sibnode; |
65 | } | 67 | } |
68 | EXPORT_SYMBOL(prom_getsibling); | ||
66 | 69 | ||
67 | /* Return the length in bytes of property 'prop' at node 'node'. | 70 | /* Return the length in bytes of property 'prop' at node 'node'. |
68 | * Return -1 on error. | 71 | * Return -1 on error. |
@@ -75,6 +78,7 @@ inline int prom_getproplen(int node, const char *prop) | |||
75 | P1275_INOUT(2, 1), | 78 | P1275_INOUT(2, 1), |
76 | node, prop); | 79 | node, prop); |
77 | } | 80 | } |
81 | EXPORT_SYMBOL(prom_getproplen); | ||
78 | 82 | ||
79 | /* Acquire a property 'prop' at node 'node' and place it in | 83 | /* Acquire a property 'prop' at node 'node' and place it in |
80 | * 'buffer' which has a size of 'bufsize'. If the acquisition | 84 | * 'buffer' which has a size of 'bufsize'. If the acquisition |
@@ -97,6 +101,7 @@ inline int prom_getproperty(int node, const char *prop, | |||
97 | node, prop, buffer, P1275_SIZE(plen)); | 101 | node, prop, buffer, P1275_SIZE(plen)); |
98 | } | 102 | } |
99 | } | 103 | } |
104 | EXPORT_SYMBOL(prom_getproperty); | ||
100 | 105 | ||
101 | /* Acquire an integer property and return its value. Returns -1 | 106 | /* Acquire an integer property and return its value. Returns -1 |
102 | * on failure. | 107 | * on failure. |
@@ -110,6 +115,7 @@ inline int prom_getint(int node, const char *prop) | |||
110 | 115 | ||
111 | return -1; | 116 | return -1; |
112 | } | 117 | } |
118 | EXPORT_SYMBOL(prom_getint); | ||
113 | 119 | ||
114 | /* Acquire an integer property, upon error return the passed default | 120 | /* Acquire an integer property, upon error return the passed default |
115 | * integer. | 121 | * integer. |
@@ -124,6 +130,7 @@ int prom_getintdefault(int node, const char *property, int deflt) | |||
124 | 130 | ||
125 | return retval; | 131 | return retval; |
126 | } | 132 | } |
133 | EXPORT_SYMBOL(prom_getintdefault); | ||
127 | 134 | ||
128 | /* Acquire a boolean property, 1=TRUE 0=FALSE. */ | 135 | /* Acquire a boolean property, 1=TRUE 0=FALSE. */ |
129 | int prom_getbool(int node, const char *prop) | 136 | int prom_getbool(int node, const char *prop) |
@@ -134,6 +141,7 @@ int prom_getbool(int node, const char *prop) | |||
134 | if(retval == -1) return 0; | 141 | if(retval == -1) return 0; |
135 | return 1; | 142 | return 1; |
136 | } | 143 | } |
144 | EXPORT_SYMBOL(prom_getbool); | ||
137 | 145 | ||
138 | /* Acquire a property whose value is a string, returns a null | 146 | /* Acquire a property whose value is a string, returns a null |
139 | * string on error. The char pointer is the user supplied string | 147 | * string on error. The char pointer is the user supplied string |
@@ -148,7 +156,7 @@ void prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size) | |||
148 | user_buf[0] = 0; | 156 | user_buf[0] = 0; |
149 | return; | 157 | return; |
150 | } | 158 | } |
151 | 159 | EXPORT_SYMBOL(prom_getstring); | |
152 | 160 | ||
153 | /* Does the device at node 'node' have name 'name'? | 161 | /* Does the device at node 'node' have name 'name'? |
154 | * YES = 1 NO = 0 | 162 | * YES = 1 NO = 0 |
@@ -181,6 +189,7 @@ int prom_searchsiblings(int node_start, const char *nodename) | |||
181 | 189 | ||
182 | return 0; | 190 | return 0; |
183 | } | 191 | } |
192 | EXPORT_SYMBOL(prom_searchsiblings); | ||
184 | 193 | ||
185 | /* Return the first property type for node 'node'. | 194 | /* Return the first property type for node 'node'. |
186 | * buffer should be at least 32B in length | 195 | * buffer should be at least 32B in length |
@@ -194,6 +203,7 @@ inline char *prom_firstprop(int node, char *buffer) | |||
194 | node, (char *) 0x0, buffer); | 203 | node, (char *) 0x0, buffer); |
195 | return buffer; | 204 | return buffer; |
196 | } | 205 | } |
206 | EXPORT_SYMBOL(prom_firstprop); | ||
197 | 207 | ||
198 | /* Return the property type string after property type 'oprop' | 208 | /* Return the property type string after property type 'oprop' |
199 | * at node 'node' . Returns NULL string if no more | 209 | * at node 'node' . Returns NULL string if no more |
@@ -217,6 +227,7 @@ inline char *prom_nextprop(int node, const char *oprop, char *buffer) | |||
217 | node, oprop, buffer); | 227 | node, oprop, buffer); |
218 | return buffer; | 228 | return buffer; |
219 | } | 229 | } |
230 | EXPORT_SYMBOL(prom_nextprop); | ||
220 | 231 | ||
221 | int | 232 | int |
222 | prom_finddevice(const char *name) | 233 | prom_finddevice(const char *name) |
@@ -228,6 +239,7 @@ prom_finddevice(const char *name) | |||
228 | P1275_INOUT(1, 1), | 239 | P1275_INOUT(1, 1), |
229 | name); | 240 | name); |
230 | } | 241 | } |
242 | EXPORT_SYMBOL(prom_finddevice); | ||
231 | 243 | ||
232 | int prom_node_has_property(int node, const char *prop) | 244 | int prom_node_has_property(int node, const char *prop) |
233 | { | 245 | { |
@@ -241,7 +253,8 @@ int prom_node_has_property(int node, const char *prop) | |||
241 | } while (*buf); | 253 | } while (*buf); |
242 | return 0; | 254 | return 0; |
243 | } | 255 | } |
244 | 256 | EXPORT_SYMBOL(prom_node_has_property); | |
257 | |||
245 | /* Set property 'pname' at node 'node' to value 'value' which has a length | 258 | /* Set property 'pname' at node 'node' to value 'value' which has a length |
246 | * of 'size' bytes. Return the number of bytes the prom accepted. | 259 | * of 'size' bytes. Return the number of bytes the prom accepted. |
247 | */ | 260 | */ |
@@ -264,6 +277,7 @@ prom_setprop(int node, const char *pname, char *value, int size) | |||
264 | P1275_INOUT(4, 1), | 277 | P1275_INOUT(4, 1), |
265 | node, pname, value, P1275_SIZE(size)); | 278 | node, pname, value, P1275_SIZE(size)); |
266 | } | 279 | } |
280 | EXPORT_SYMBOL(prom_setprop); | ||
267 | 281 | ||
268 | inline int prom_inst2pkg(int inst) | 282 | inline int prom_inst2pkg(int inst) |
269 | { | 283 | { |
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index a9f8a814a1f7..4a8e80cdcfa5 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild | |||
@@ -22,4 +22,3 @@ unifdef-y += unistd_32.h | |||
22 | unifdef-y += unistd_64.h | 22 | unifdef-y += unistd_64.h |
23 | unifdef-y += vm86.h | 23 | unifdef-y += vm86.h |
24 | unifdef-y += vsyscall.h | 24 | unifdef-y += vsyscall.h |
25 | unifdef-y += swab.h | ||
diff --git a/arch/x86/include/asm/byteorder.h b/arch/x86/include/asm/byteorder.h index 7c49917e3d9d..b13a7a88f3eb 100644 --- a/arch/x86/include/asm/byteorder.h +++ b/arch/x86/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_X86_BYTEORDER_H | 1 | #ifndef _ASM_X86_BYTEORDER_H |
2 | #define _ASM_X86_BYTEORDER_H | 2 | #define _ASM_X86_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_X86_BYTEORDER_H */ | 6 | #endif /* _ASM_X86_BYTEORDER_H */ |
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h index ceb013660146..89897a6a65b9 100644 --- a/arch/x86/include/asm/mach-default/mach_wakecpu.h +++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h | |||
@@ -24,7 +24,13 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low) | |||
24 | { | 24 | { |
25 | } | 25 | } |
26 | 26 | ||
27 | #ifdef CONFIG_SMP | ||
27 | extern void __inquire_remote_apic(int apicid); | 28 | extern void __inquire_remote_apic(int apicid); |
29 | #else /* CONFIG_SMP */ | ||
30 | static inline void __inquire_remote_apic(int apicid) | ||
31 | { | ||
32 | } | ||
33 | #endif /* CONFIG_SMP */ | ||
28 | 34 | ||
29 | static inline void inquire_remote_apic(int apicid) | 35 | static inline void inquire_remote_apic(int apicid) |
30 | { | 36 | { |
diff --git a/arch/x86/include/asm/mtrr.h b/arch/x86/include/asm/mtrr.h index cb988aab716d..14080d22edb3 100644 --- a/arch/x86/include/asm/mtrr.h +++ b/arch/x86/include/asm/mtrr.h | |||
@@ -58,15 +58,15 @@ struct mtrr_gentry { | |||
58 | #endif /* !__i386__ */ | 58 | #endif /* !__i386__ */ |
59 | 59 | ||
60 | struct mtrr_var_range { | 60 | struct mtrr_var_range { |
61 | u32 base_lo; | 61 | __u32 base_lo; |
62 | u32 base_hi; | 62 | __u32 base_hi; |
63 | u32 mask_lo; | 63 | __u32 mask_lo; |
64 | u32 mask_hi; | 64 | __u32 mask_hi; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /* In the Intel processor's MTRR interface, the MTRR type is always held in | 67 | /* In the Intel processor's MTRR interface, the MTRR type is always held in |
68 | an 8 bit field: */ | 68 | an 8 bit field: */ |
69 | typedef u8 mtrr_type; | 69 | typedef __u8 mtrr_type; |
70 | 70 | ||
71 | #define MTRR_NUM_FIXED_RANGES 88 | 71 | #define MTRR_NUM_FIXED_RANGES 88 |
72 | #define MTRR_MAX_VAR_RANGES 256 | 72 | #define MTRR_MAX_VAR_RANGES 256 |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 83e69f4a37f0..06bbcbd66e9c 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -341,6 +341,25 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | |||
341 | 341 | ||
342 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) | 342 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) |
343 | 343 | ||
344 | static inline int is_new_memtype_allowed(unsigned long flags, | ||
345 | unsigned long new_flags) | ||
346 | { | ||
347 | /* | ||
348 | * Certain new memtypes are not allowed with certain | ||
349 | * requested memtype: | ||
350 | * - request is uncached, return cannot be write-back | ||
351 | * - request is write-combine, return cannot be write-back | ||
352 | */ | ||
353 | if ((flags == _PAGE_CACHE_UC_MINUS && | ||
354 | new_flags == _PAGE_CACHE_WB) || | ||
355 | (flags == _PAGE_CACHE_WC && | ||
356 | new_flags == _PAGE_CACHE_WB)) { | ||
357 | return 0; | ||
358 | } | ||
359 | |||
360 | return 1; | ||
361 | } | ||
362 | |||
344 | #ifndef __ASSEMBLY__ | 363 | #ifndef __ASSEMBLY__ |
345 | /* Indicate that x86 has its own track and untrack pfn vma functions */ | 364 | /* Indicate that x86 has its own track and untrack pfn vma functions */ |
346 | #define __HAVE_PFNMAP_TRACKING | 365 | #define __HAVE_PFNMAP_TRACKING |
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index 566a08466b19..0f830e4f5675 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <asm/proto.h> | 47 | #include <asm/proto.h> |
48 | #include <asm/apic.h> | 48 | #include <asm/apic.h> |
49 | #include <asm/i8259.h> | 49 | #include <asm/i8259.h> |
50 | #include <asm/smp.h> | ||
50 | 51 | ||
51 | #include <mach_apic.h> | 52 | #include <mach_apic.h> |
52 | #include <mach_apicdef.h> | 53 | #include <mach_apicdef.h> |
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 06fcd8f9323c..6f11e029e8c5 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -150,9 +150,8 @@ struct drv_cmd { | |||
150 | u32 val; | 150 | u32 val; |
151 | }; | 151 | }; |
152 | 152 | ||
153 | static long do_drv_read(void *_cmd) | 153 | static void do_drv_read(struct drv_cmd *cmd) |
154 | { | 154 | { |
155 | struct drv_cmd *cmd = _cmd; | ||
156 | u32 h; | 155 | u32 h; |
157 | 156 | ||
158 | switch (cmd->type) { | 157 | switch (cmd->type) { |
@@ -167,12 +166,10 @@ static long do_drv_read(void *_cmd) | |||
167 | default: | 166 | default: |
168 | break; | 167 | break; |
169 | } | 168 | } |
170 | return 0; | ||
171 | } | 169 | } |
172 | 170 | ||
173 | static long do_drv_write(void *_cmd) | 171 | static void do_drv_write(struct drv_cmd *cmd) |
174 | { | 172 | { |
175 | struct drv_cmd *cmd = _cmd; | ||
176 | u32 lo, hi; | 173 | u32 lo, hi; |
177 | 174 | ||
178 | switch (cmd->type) { | 175 | switch (cmd->type) { |
@@ -189,23 +186,30 @@ static long do_drv_write(void *_cmd) | |||
189 | default: | 186 | default: |
190 | break; | 187 | break; |
191 | } | 188 | } |
192 | return 0; | ||
193 | } | 189 | } |
194 | 190 | ||
195 | static void drv_read(struct drv_cmd *cmd) | 191 | static void drv_read(struct drv_cmd *cmd) |
196 | { | 192 | { |
193 | cpumask_t saved_mask = current->cpus_allowed; | ||
197 | cmd->val = 0; | 194 | cmd->val = 0; |
198 | 195 | ||
199 | work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd); | 196 | set_cpus_allowed_ptr(current, cmd->mask); |
197 | do_drv_read(cmd); | ||
198 | set_cpus_allowed_ptr(current, &saved_mask); | ||
200 | } | 199 | } |
201 | 200 | ||
202 | static void drv_write(struct drv_cmd *cmd) | 201 | static void drv_write(struct drv_cmd *cmd) |
203 | { | 202 | { |
203 | cpumask_t saved_mask = current->cpus_allowed; | ||
204 | unsigned int i; | 204 | unsigned int i; |
205 | 205 | ||
206 | for_each_cpu(i, cmd->mask) { | 206 | for_each_cpu(i, cmd->mask) { |
207 | work_on_cpu(i, do_drv_write, cmd); | 207 | set_cpus_allowed_ptr(current, cpumask_of(i)); |
208 | do_drv_write(cmd); | ||
208 | } | 209 | } |
210 | |||
211 | set_cpus_allowed_ptr(current, &saved_mask); | ||
212 | return; | ||
209 | } | 213 | } |
210 | 214 | ||
211 | static u32 get_cur_val(const struct cpumask *mask) | 215 | static u32 get_cur_val(const struct cpumask *mask) |
@@ -231,15 +235,10 @@ static u32 get_cur_val(const struct cpumask *mask) | |||
231 | return 0; | 235 | return 0; |
232 | } | 236 | } |
233 | 237 | ||
234 | if (unlikely(!alloc_cpumask_var(&cmd.mask, GFP_KERNEL))) | ||
235 | return 0; | ||
236 | |||
237 | cpumask_copy(cmd.mask, mask); | 238 | cpumask_copy(cmd.mask, mask); |
238 | 239 | ||
239 | drv_read(&cmd); | 240 | drv_read(&cmd); |
240 | 241 | ||
241 | free_cpumask_var(cmd.mask); | ||
242 | |||
243 | dprintk("get_cur_val = %u\n", cmd.val); | 242 | dprintk("get_cur_val = %u\n", cmd.val); |
244 | 243 | ||
245 | return cmd.val; | 244 | return cmd.val; |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index d6f0490a7391..46469029e9d3 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1203,7 +1203,6 @@ nmi_stack_correct: | |||
1203 | pushl %eax | 1203 | pushl %eax |
1204 | CFI_ADJUST_CFA_OFFSET 4 | 1204 | CFI_ADJUST_CFA_OFFSET 4 |
1205 | SAVE_ALL | 1205 | SAVE_ALL |
1206 | TRACE_IRQS_OFF | ||
1207 | xorl %edx,%edx # zero error code | 1206 | xorl %edx,%edx # zero error code |
1208 | movl %esp,%eax # pt_regs pointer | 1207 | movl %esp,%eax # pt_regs pointer |
1209 | call do_nmi | 1208 | call do_nmi |
@@ -1244,7 +1243,6 @@ nmi_espfix_stack: | |||
1244 | pushl %eax | 1243 | pushl %eax |
1245 | CFI_ADJUST_CFA_OFFSET 4 | 1244 | CFI_ADJUST_CFA_OFFSET 4 |
1246 | SAVE_ALL | 1245 | SAVE_ALL |
1247 | TRACE_IRQS_OFF | ||
1248 | FIXUP_ESPFIX_STACK # %eax == %esp | 1246 | FIXUP_ESPFIX_STACK # %eax == %esp |
1249 | xorl %edx,%edx # zero error code | 1247 | xorl %edx,%edx # zero error code |
1250 | call do_nmi | 1248 | call do_nmi |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index c0601c2848a1..a649a4ccad43 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/e820.h> | 27 | #include <asm/e820.h> |
28 | #include <asm/trampoline.h> | 28 | #include <asm/trampoline.h> |
29 | #include <asm/setup.h> | 29 | #include <asm/setup.h> |
30 | #include <asm/smp.h> | ||
30 | 31 | ||
31 | #include <mach_apic.h> | 32 | #include <mach_apic.h> |
32 | #ifdef CONFIG_X86_32 | 33 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index d44395ff34c3..e2e86a08f31d 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -88,7 +88,7 @@ ENTRY(sys_call_table) | |||
88 | .long sys_uselib | 88 | .long sys_uselib |
89 | .long sys_swapon | 89 | .long sys_swapon |
90 | .long sys_reboot | 90 | .long sys_reboot |
91 | .long old_readdir | 91 | .long sys_old_readdir |
92 | .long old_mmap /* 90 */ | 92 | .long old_mmap /* 90 */ |
93 | .long sys_munmap | 93 | .long sys_munmap |
94 | .long sys_truncate | 94 | .long sys_truncate |
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 9e268b6b204e..90dfae511a41 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -534,7 +534,7 @@ static int vmalloc_fault(unsigned long address) | |||
534 | happen within a race in page table update. In the later | 534 | happen within a race in page table update. In the later |
535 | case just flush. */ | 535 | case just flush. */ |
536 | 536 | ||
537 | pgd = pgd_offset(current->mm ?: &init_mm, address); | 537 | pgd = pgd_offset(current->active_mm, address); |
538 | pgd_ref = pgd_offset_k(address); | 538 | pgd_ref = pgd_offset_k(address); |
539 | if (pgd_none(*pgd_ref)) | 539 | if (pgd_none(*pgd_ref)) |
540 | return -1; | 540 | return -1; |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 85cbd3cd3723..8b08fb955274 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -601,12 +601,13 @@ void unmap_devmem(unsigned long pfn, unsigned long size, pgprot_t vma_prot) | |||
601 | * Reserved non RAM regions only and after successful reserve_memtype, | 601 | * Reserved non RAM regions only and after successful reserve_memtype, |
602 | * this func also keeps identity mapping (if any) in sync with this new prot. | 602 | * this func also keeps identity mapping (if any) in sync with this new prot. |
603 | */ | 603 | */ |
604 | static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t vma_prot) | 604 | static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, |
605 | int strict_prot) | ||
605 | { | 606 | { |
606 | int is_ram = 0; | 607 | int is_ram = 0; |
607 | int id_sz, ret; | 608 | int id_sz, ret; |
608 | unsigned long flags; | 609 | unsigned long flags; |
609 | unsigned long want_flags = (pgprot_val(vma_prot) & _PAGE_CACHE_MASK); | 610 | unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK); |
610 | 611 | ||
611 | is_ram = pagerange_is_ram(paddr, paddr + size); | 612 | is_ram = pagerange_is_ram(paddr, paddr + size); |
612 | 613 | ||
@@ -625,15 +626,24 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t vma_prot) | |||
625 | return ret; | 626 | return ret; |
626 | 627 | ||
627 | if (flags != want_flags) { | 628 | if (flags != want_flags) { |
628 | free_memtype(paddr, paddr + size); | 629 | if (strict_prot || !is_new_memtype_allowed(want_flags, flags)) { |
629 | printk(KERN_ERR | 630 | free_memtype(paddr, paddr + size); |
630 | "%s:%d map pfn expected mapping type %s for %Lx-%Lx, got %s\n", | 631 | printk(KERN_ERR "%s:%d map pfn expected mapping type %s" |
631 | current->comm, current->pid, | 632 | " for %Lx-%Lx, got %s\n", |
632 | cattr_name(want_flags), | 633 | current->comm, current->pid, |
633 | (unsigned long long)paddr, | 634 | cattr_name(want_flags), |
634 | (unsigned long long)(paddr + size), | 635 | (unsigned long long)paddr, |
635 | cattr_name(flags)); | 636 | (unsigned long long)(paddr + size), |
636 | return -EINVAL; | 637 | cattr_name(flags)); |
638 | return -EINVAL; | ||
639 | } | ||
640 | /* | ||
641 | * We allow returning different type than the one requested in | ||
642 | * non strict case. | ||
643 | */ | ||
644 | *vma_prot = __pgprot((pgprot_val(*vma_prot) & | ||
645 | (~_PAGE_CACHE_MASK)) | | ||
646 | flags); | ||
637 | } | 647 | } |
638 | 648 | ||
639 | /* Need to keep identity mapping in sync */ | 649 | /* Need to keep identity mapping in sync */ |
@@ -689,6 +699,7 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) | |||
689 | unsigned long vma_start = vma->vm_start; | 699 | unsigned long vma_start = vma->vm_start; |
690 | unsigned long vma_end = vma->vm_end; | 700 | unsigned long vma_end = vma->vm_end; |
691 | unsigned long vma_size = vma_end - vma_start; | 701 | unsigned long vma_size = vma_end - vma_start; |
702 | pgprot_t pgprot; | ||
692 | 703 | ||
693 | if (!pat_enabled) | 704 | if (!pat_enabled) |
694 | return 0; | 705 | return 0; |
@@ -702,7 +713,8 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) | |||
702 | WARN_ON_ONCE(1); | 713 | WARN_ON_ONCE(1); |
703 | return -EINVAL; | 714 | return -EINVAL; |
704 | } | 715 | } |
705 | return reserve_pfn_range(paddr, vma_size, __pgprot(prot)); | 716 | pgprot = __pgprot(prot); |
717 | return reserve_pfn_range(paddr, vma_size, &pgprot, 1); | ||
706 | } | 718 | } |
707 | 719 | ||
708 | /* reserve entire vma page by page, using pfn and prot from pte */ | 720 | /* reserve entire vma page by page, using pfn and prot from pte */ |
@@ -710,7 +722,8 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) | |||
710 | if (follow_phys(vma, vma_start + i, 0, &prot, &paddr)) | 722 | if (follow_phys(vma, vma_start + i, 0, &prot, &paddr)) |
711 | continue; | 723 | continue; |
712 | 724 | ||
713 | retval = reserve_pfn_range(paddr, PAGE_SIZE, __pgprot(prot)); | 725 | pgprot = __pgprot(prot); |
726 | retval = reserve_pfn_range(paddr, PAGE_SIZE, &pgprot, 1); | ||
714 | if (retval) | 727 | if (retval) |
715 | goto cleanup_ret; | 728 | goto cleanup_ret; |
716 | } | 729 | } |
@@ -741,7 +754,7 @@ cleanup_ret: | |||
741 | * Note that this function can be called with caller trying to map only a | 754 | * Note that this function can be called with caller trying to map only a |
742 | * subrange/page inside the vma. | 755 | * subrange/page inside the vma. |
743 | */ | 756 | */ |
744 | int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot, | 757 | int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot, |
745 | unsigned long pfn, unsigned long size) | 758 | unsigned long pfn, unsigned long size) |
746 | { | 759 | { |
747 | int retval = 0; | 760 | int retval = 0; |
@@ -758,14 +771,14 @@ int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot, | |||
758 | if (is_linear_pfn_mapping(vma)) { | 771 | if (is_linear_pfn_mapping(vma)) { |
759 | /* reserve the whole chunk starting from vm_pgoff */ | 772 | /* reserve the whole chunk starting from vm_pgoff */ |
760 | paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT; | 773 | paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT; |
761 | return reserve_pfn_range(paddr, vma_size, prot); | 774 | return reserve_pfn_range(paddr, vma_size, prot, 0); |
762 | } | 775 | } |
763 | 776 | ||
764 | /* reserve page by page using pfn and size */ | 777 | /* reserve page by page using pfn and size */ |
765 | base_paddr = (resource_size_t)pfn << PAGE_SHIFT; | 778 | base_paddr = (resource_size_t)pfn << PAGE_SHIFT; |
766 | for (i = 0; i < size; i += PAGE_SIZE) { | 779 | for (i = 0; i < size; i += PAGE_SIZE) { |
767 | paddr = base_paddr + i; | 780 | paddr = base_paddr + i; |
768 | retval = reserve_pfn_range(paddr, PAGE_SIZE, prot); | 781 | retval = reserve_pfn_range(paddr, PAGE_SIZE, prot, 0); |
769 | if (retval) | 782 | if (retval) |
770 | goto cleanup_ret; | 783 | goto cleanup_ret; |
771 | } | 784 | } |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index f884740da318..5ead808dd70c 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -314,17 +314,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
314 | return retval; | 314 | return retval; |
315 | 315 | ||
316 | if (flags != new_flags) { | 316 | if (flags != new_flags) { |
317 | /* | 317 | if (!is_new_memtype_allowed(flags, new_flags)) { |
318 | * Do not fallback to certain memory types with certain | ||
319 | * requested type: | ||
320 | * - request is uncached, return cannot be write-back | ||
321 | * - request is uncached, return cannot be write-combine | ||
322 | * - request is write-combine, return cannot be write-back | ||
323 | */ | ||
324 | if ((flags == _PAGE_CACHE_UC_MINUS && | ||
325 | (new_flags == _PAGE_CACHE_WB)) || | ||
326 | (flags == _PAGE_CACHE_WC && | ||
327 | new_flags == _PAGE_CACHE_WB)) { | ||
328 | free_memtype(addr, addr+len); | 318 | free_memtype(addr, addr+len); |
329 | return -EINVAL; | 319 | return -EINVAL; |
330 | } | 320 | } |
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index 58c02a454130..c68e1680da01 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild | |||
@@ -1,3 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | |||
3 | unifdef-y += swab.h | ||
diff --git a/arch/xtensa/include/asm/byteorder.h b/arch/xtensa/include/asm/byteorder.h index 329b94591ca4..54eb6315349c 100644 --- a/arch/xtensa/include/asm/byteorder.h +++ b/arch/xtensa/include/asm/byteorder.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _XTENSA_BYTEORDER_H | 1 | #ifndef _XTENSA_BYTEORDER_H |
2 | #define _XTENSA_BYTEORDER_H | 2 | #define _XTENSA_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | |||
6 | #ifdef __XTENSA_EL__ | 4 | #ifdef __XTENSA_EL__ |
7 | #include <linux/byteorder/little_endian.h> | 5 | #include <linux/byteorder/little_endian.h> |
8 | #elif defined(__XTENSA_EB__) | 6 | #elif defined(__XTENSA_EB__) |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 7f701cbe14ab..96039671e3b9 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -2660,6 +2660,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2660 | host->iomap = pcim_iomap_table(pdev); | 2660 | host->iomap = pcim_iomap_table(pdev); |
2661 | host->private_data = hpriv; | 2661 | host->private_data = hpriv; |
2662 | 2662 | ||
2663 | if (!(hpriv->cap & HOST_CAP_SSS)) | ||
2664 | host->flags |= ATA_HOST_PARALLEL_SCAN; | ||
2665 | |||
2663 | if (pi.flags & ATA_FLAG_EM) | 2666 | if (pi.flags & ATA_FLAG_EM) |
2664 | ahci_reset_em(host); | 2667 | ahci_reset_em(host); |
2665 | 2668 | ||
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c507a9ac78f4..71218d76d75e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -5920,6 +5920,17 @@ static void async_port_probe(void *data, async_cookie_t cookie) | |||
5920 | { | 5920 | { |
5921 | int rc; | 5921 | int rc; |
5922 | struct ata_port *ap = data; | 5922 | struct ata_port *ap = data; |
5923 | |||
5924 | /* | ||
5925 | * If we're not allowed to scan this host in parallel, | ||
5926 | * we need to wait until all previous scans have completed | ||
5927 | * before going further. | ||
5928 | * Jeff Garzik says this is only within a controller, so we | ||
5929 | * don't need to wait for port 0, only for later ports. | ||
5930 | */ | ||
5931 | if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0) | ||
5932 | async_synchronize_cookie(cookie); | ||
5933 | |||
5923 | /* probe */ | 5934 | /* probe */ |
5924 | if (ap->ops->error_handler) { | 5935 | if (ap->ops->error_handler) { |
5925 | struct ata_eh_info *ehi = &ap->link.eh_info; | 5936 | struct ata_eh_info *ehi = &ap->link.eh_info; |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 0eae9b453556..5a4aad123c42 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1013,9 +1013,12 @@ next_sg: | |||
1013 | qc->cursg_ofs = 0; | 1013 | qc->cursg_ofs = 0; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | /* consumed can be larger than count only for the last transfer */ | 1016 | /* |
1017 | WARN_ON_ONCE(qc->cursg && count != consumed); | 1017 | * There used to be a WARN_ON_ONCE(qc->cursg && count != consumed); |
1018 | 1018 | * Unfortunately __atapi_pio_bytes doesn't know enough to do the WARN | |
1019 | * check correctly as it doesn't know if it is the last request being | ||
1020 | * made. Somebody should implement a proper sanity check. | ||
1021 | */ | ||
1019 | if (bytes) | 1022 | if (bytes) |
1020 | goto next_sg; | 1023 | goto next_sg; |
1021 | return 0; | 1024 | return 0; |
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index f828a29d7756..f1bb2f9fecbf 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -80,7 +80,7 @@ | |||
80 | 80 | ||
81 | 81 | ||
82 | #define DRV_NAME "pata_it821x" | 82 | #define DRV_NAME "pata_it821x" |
83 | #define DRV_VERSION "0.4.0" | 83 | #define DRV_VERSION "0.4.2" |
84 | 84 | ||
85 | struct it821x_dev | 85 | struct it821x_dev |
86 | { | 86 | { |
@@ -494,8 +494,6 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unus | |||
494 | * special. In our case we need to lock the sector count to avoid | 494 | * special. In our case we need to lock the sector count to avoid |
495 | * blowing the brains out of the firmware with large LBA48 requests | 495 | * blowing the brains out of the firmware with large LBA48 requests |
496 | * | 496 | * |
497 | * FIXME: When FUA appears we need to block FUA too. And SMART and | ||
498 | * basically we need to filter commands for this chip. | ||
499 | */ | 497 | */ |
500 | 498 | ||
501 | static void it821x_dev_config(struct ata_device *adev) | 499 | static void it821x_dev_config(struct ata_device *adev) |
@@ -890,6 +888,13 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
890 | .flags = ATA_FLAG_SLAVE_POSS, | 888 | .flags = ATA_FLAG_SLAVE_POSS, |
891 | .pio_mask = 0x1f, | 889 | .pio_mask = 0x1f, |
892 | .mwdma_mask = 0x07, | 890 | .mwdma_mask = 0x07, |
891 | .udma_mask = ATA_UDMA6, | ||
892 | .port_ops = &it821x_rdc_port_ops | ||
893 | }; | ||
894 | static const struct ata_port_info info_rdc_11 = { | ||
895 | .flags = ATA_FLAG_SLAVE_POSS, | ||
896 | .pio_mask = 0x1f, | ||
897 | .mwdma_mask = 0x07, | ||
893 | /* No UDMA */ | 898 | /* No UDMA */ |
894 | .port_ops = &it821x_rdc_port_ops | 899 | .port_ops = &it821x_rdc_port_ops |
895 | }; | 900 | }; |
@@ -903,7 +908,11 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
903 | return rc; | 908 | return rc; |
904 | 909 | ||
905 | if (pdev->vendor == PCI_VENDOR_ID_RDC) { | 910 | if (pdev->vendor == PCI_VENDOR_ID_RDC) { |
906 | ppi[0] = &info_rdc; | 911 | /* Deal with Vortex86SX */ |
912 | if (pdev->revision == 0x11) | ||
913 | ppi[0] = &info_rdc_11; | ||
914 | else | ||
915 | ppi[0] = &info_rdc; | ||
907 | } else { | 916 | } else { |
908 | /* Force the card into bypass mode if so requested */ | 917 | /* Force the card into bypass mode if so requested */ |
909 | if (it8212_noraid) { | 918 | if (it8212_noraid) { |
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 4b1d4ac960f1..8df436ff7068 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c | |||
@@ -156,7 +156,7 @@ static volatile int fdc_busy = -1; | |||
156 | static volatile int fdc_nested; | 156 | static volatile int fdc_nested; |
157 | static DECLARE_WAIT_QUEUE_HEAD(fdc_wait); | 157 | static DECLARE_WAIT_QUEUE_HEAD(fdc_wait); |
158 | 158 | ||
159 | static DECLARE_WAIT_QUEUE_HEAD(motor_wait); | 159 | static DECLARE_COMPLETION(motor_on_completion); |
160 | 160 | ||
161 | static volatile int selected = -1; /* currently selected drive */ | 161 | static volatile int selected = -1; /* currently selected drive */ |
162 | 162 | ||
@@ -184,8 +184,7 @@ static unsigned char mfmencode[16]={ | |||
184 | static unsigned char mfmdecode[128]; | 184 | static unsigned char mfmdecode[128]; |
185 | 185 | ||
186 | /* floppy internal millisecond timer stuff */ | 186 | /* floppy internal millisecond timer stuff */ |
187 | static volatile int ms_busy = -1; | 187 | static DECLARE_COMPLETION(ms_wait_completion); |
188 | static DECLARE_WAIT_QUEUE_HEAD(ms_wait); | ||
189 | #define MS_TICKS ((amiga_eclock+50)/1000) | 188 | #define MS_TICKS ((amiga_eclock+50)/1000) |
190 | 189 | ||
191 | /* | 190 | /* |
@@ -211,8 +210,7 @@ static int fd_device[4] = { 0, 0, 0, 0 }; | |||
211 | 210 | ||
212 | static irqreturn_t ms_isr(int irq, void *dummy) | 211 | static irqreturn_t ms_isr(int irq, void *dummy) |
213 | { | 212 | { |
214 | ms_busy = -1; | 213 | complete(&ms_wait_completion); |
215 | wake_up(&ms_wait); | ||
216 | return IRQ_HANDLED; | 214 | return IRQ_HANDLED; |
217 | } | 215 | } |
218 | 216 | ||
@@ -220,19 +218,17 @@ static irqreturn_t ms_isr(int irq, void *dummy) | |||
220 | A more generic routine would do a schedule a la timer.device */ | 218 | A more generic routine would do a schedule a la timer.device */ |
221 | static void ms_delay(int ms) | 219 | static void ms_delay(int ms) |
222 | { | 220 | { |
223 | unsigned long flags; | ||
224 | int ticks; | 221 | int ticks; |
222 | static DEFINE_MUTEX(mutex); | ||
223 | |||
225 | if (ms > 0) { | 224 | if (ms > 0) { |
226 | local_irq_save(flags); | 225 | mutex_lock(&mutex); |
227 | while (ms_busy == 0) | ||
228 | sleep_on(&ms_wait); | ||
229 | ms_busy = 0; | ||
230 | local_irq_restore(flags); | ||
231 | ticks = MS_TICKS*ms-1; | 226 | ticks = MS_TICKS*ms-1; |
232 | ciaa.tblo=ticks%256; | 227 | ciaa.tblo=ticks%256; |
233 | ciaa.tbhi=ticks/256; | 228 | ciaa.tbhi=ticks/256; |
234 | ciaa.crb=0x19; /*count eclock, force load, one-shoot, start */ | 229 | ciaa.crb=0x19; /*count eclock, force load, one-shoot, start */ |
235 | sleep_on(&ms_wait); | 230 | wait_for_completion(&ms_wait_completion); |
231 | mutex_unlock(&mutex); | ||
236 | } | 232 | } |
237 | } | 233 | } |
238 | 234 | ||
@@ -254,8 +250,7 @@ static void get_fdc(int drive) | |||
254 | printk("get_fdc: drive %d fdc_busy %d fdc_nested %d\n",drive,fdc_busy,fdc_nested); | 250 | printk("get_fdc: drive %d fdc_busy %d fdc_nested %d\n",drive,fdc_busy,fdc_nested); |
255 | #endif | 251 | #endif |
256 | local_irq_save(flags); | 252 | local_irq_save(flags); |
257 | while (!try_fdc(drive)) | 253 | wait_event(fdc_wait, try_fdc(drive)); |
258 | sleep_on(&fdc_wait); | ||
259 | fdc_busy = drive; | 254 | fdc_busy = drive; |
260 | fdc_nested++; | 255 | fdc_nested++; |
261 | local_irq_restore(flags); | 256 | local_irq_restore(flags); |
@@ -330,7 +325,7 @@ static void fd_deselect (int drive) | |||
330 | static void motor_on_callback(unsigned long nr) | 325 | static void motor_on_callback(unsigned long nr) |
331 | { | 326 | { |
332 | if (!(ciaa.pra & DSKRDY) || --on_attempts == 0) { | 327 | if (!(ciaa.pra & DSKRDY) || --on_attempts == 0) { |
333 | wake_up (&motor_wait); | 328 | complete_all(&motor_on_completion); |
334 | } else { | 329 | } else { |
335 | motor_on_timer.expires = jiffies + HZ/10; | 330 | motor_on_timer.expires = jiffies + HZ/10; |
336 | add_timer(&motor_on_timer); | 331 | add_timer(&motor_on_timer); |
@@ -347,11 +342,12 @@ static int fd_motor_on(int nr) | |||
347 | unit[nr].motor = 1; | 342 | unit[nr].motor = 1; |
348 | fd_select(nr); | 343 | fd_select(nr); |
349 | 344 | ||
345 | INIT_COMPLETION(motor_on_completion); | ||
350 | motor_on_timer.data = nr; | 346 | motor_on_timer.data = nr; |
351 | mod_timer(&motor_on_timer, jiffies + HZ/2); | 347 | mod_timer(&motor_on_timer, jiffies + HZ/2); |
352 | 348 | ||
353 | on_attempts = 10; | 349 | on_attempts = 10; |
354 | sleep_on (&motor_wait); | 350 | wait_for_completion(&motor_on_completion); |
355 | fd_deselect(nr); | 351 | fd_deselect(nr); |
356 | } | 352 | } |
357 | 353 | ||
@@ -582,8 +578,7 @@ static void raw_read(int drive) | |||
582 | { | 578 | { |
583 | drive&=3; | 579 | drive&=3; |
584 | get_fdc(drive); | 580 | get_fdc(drive); |
585 | while (block_flag) | 581 | wait_event(wait_fd_block, !block_flag); |
586 | sleep_on(&wait_fd_block); | ||
587 | fd_select(drive); | 582 | fd_select(drive); |
588 | /* setup adkcon bits correctly */ | 583 | /* setup adkcon bits correctly */ |
589 | custom.adkcon = ADK_MSBSYNC; | 584 | custom.adkcon = ADK_MSBSYNC; |
@@ -598,8 +593,7 @@ static void raw_read(int drive) | |||
598 | 593 | ||
599 | block_flag = 1; | 594 | block_flag = 1; |
600 | 595 | ||
601 | while (block_flag) | 596 | wait_event(wait_fd_block, !block_flag); |
602 | sleep_on (&wait_fd_block); | ||
603 | 597 | ||
604 | custom.dsklen = 0; | 598 | custom.dsklen = 0; |
605 | fd_deselect(drive); | 599 | fd_deselect(drive); |
@@ -616,8 +610,7 @@ static int raw_write(int drive) | |||
616 | rel_fdc(); | 610 | rel_fdc(); |
617 | return 0; | 611 | return 0; |
618 | } | 612 | } |
619 | while (block_flag) | 613 | wait_event(wait_fd_block, !block_flag); |
620 | sleep_on(&wait_fd_block); | ||
621 | fd_select(drive); | 614 | fd_select(drive); |
622 | /* clear adkcon bits */ | 615 | /* clear adkcon bits */ |
623 | custom.adkcon = ADK_PRECOMP1|ADK_PRECOMP0|ADK_WORDSYNC|ADK_MSBSYNC; | 616 | custom.adkcon = ADK_PRECOMP1|ADK_PRECOMP0|ADK_WORDSYNC|ADK_MSBSYNC; |
@@ -1294,8 +1287,7 @@ static int non_int_flush_track (unsigned long nr) | |||
1294 | writepending = 0; | 1287 | writepending = 0; |
1295 | return 0; | 1288 | return 0; |
1296 | } | 1289 | } |
1297 | while (block_flag == 2) | 1290 | wait_event(wait_fd_block, block_flag != 2); |
1298 | sleep_on (&wait_fd_block); | ||
1299 | } | 1291 | } |
1300 | else { | 1292 | else { |
1301 | local_irq_restore(flags); | 1293 | local_irq_restore(flags); |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 7bcc1d8bc967..34f80fa6fed1 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -406,6 +406,7 @@ static int nbd_do_it(struct nbd_device *lo) | |||
406 | ret = sysfs_create_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); | 406 | ret = sysfs_create_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); |
407 | if (ret) { | 407 | if (ret) { |
408 | printk(KERN_ERR "nbd: sysfs_create_file failed!"); | 408 | printk(KERN_ERR "nbd: sysfs_create_file failed!"); |
409 | lo->pid = 0; | ||
409 | return ret; | 410 | return ret; |
410 | } | 411 | } |
411 | 412 | ||
@@ -413,6 +414,7 @@ static int nbd_do_it(struct nbd_device *lo) | |||
413 | nbd_end_request(req); | 414 | nbd_end_request(req); |
414 | 415 | ||
415 | sysfs_remove_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); | 416 | sysfs_remove_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); |
417 | lo->pid = 0; | ||
416 | return 0; | 418 | return 0; |
417 | } | 419 | } |
418 | 420 | ||
@@ -648,6 +650,8 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode, | |||
648 | set_capacity(lo->disk, lo->bytesize >> 9); | 650 | set_capacity(lo->disk, lo->bytesize >> 9); |
649 | return 0; | 651 | return 0; |
650 | case NBD_DO_IT: | 652 | case NBD_DO_IT: |
653 | if (lo->pid) | ||
654 | return -EBUSY; | ||
651 | if (!lo->file) | 655 | if (!lo->file) |
652 | return -EINVAL; | 656 | return -EINVAL; |
653 | thread = kthread_create(nbd_thread, lo, lo->disk->disk_name); | 657 | thread = kthread_create(nbd_thread, lo, lo->disk->disk_name); |
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 29e1dfafb7c6..381d686fc1a3 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -1206,6 +1206,7 @@ static struct of_device_id ace_of_match[] __devinitdata = { | |||
1206 | { .compatible = "xlnx,opb-sysace-1.00.b", }, | 1206 | { .compatible = "xlnx,opb-sysace-1.00.b", }, |
1207 | { .compatible = "xlnx,opb-sysace-1.00.c", }, | 1207 | { .compatible = "xlnx,opb-sysace-1.00.c", }, |
1208 | { .compatible = "xlnx,xps-sysace-1.00.a", }, | 1208 | { .compatible = "xlnx,xps-sysace-1.00.a", }, |
1209 | { .compatible = "xlnx,sysace", }, | ||
1209 | {}, | 1210 | {}, |
1210 | }; | 1211 | }; |
1211 | MODULE_DEVICE_TABLE(of, ace_of_match); | 1212 | MODULE_DEVICE_TABLE(of, ace_of_match); |
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 4e0cfdeab146..a58869ea8513 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c | |||
@@ -1963,6 +1963,7 @@ static int __init rs_init(void) | |||
1963 | { | 1963 | { |
1964 | unsigned long flags; | 1964 | unsigned long flags; |
1965 | struct serial_state * state; | 1965 | struct serial_state * state; |
1966 | int error; | ||
1966 | 1967 | ||
1967 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL)) | 1968 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL)) |
1968 | return -ENODEV; | 1969 | return -ENODEV; |
@@ -1975,8 +1976,11 @@ static int __init rs_init(void) | |||
1975 | * We request SERDAT and SERPER only, because the serial registers are | 1976 | * We request SERDAT and SERPER only, because the serial registers are |
1976 | * too spreaded over the custom register space | 1977 | * too spreaded over the custom register space |
1977 | */ | 1978 | */ |
1978 | if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4, "amiserial [Paula]")) | 1979 | if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4, |
1979 | return -EBUSY; | 1980 | "amiserial [Paula]")) { |
1981 | error = -EBUSY; | ||
1982 | goto fail_put_tty_driver; | ||
1983 | } | ||
1980 | 1984 | ||
1981 | IRQ_ports = NULL; | 1985 | IRQ_ports = NULL; |
1982 | 1986 | ||
@@ -1997,8 +2001,9 @@ static int __init rs_init(void) | |||
1997 | serial_driver->flags = TTY_DRIVER_REAL_RAW; | 2001 | serial_driver->flags = TTY_DRIVER_REAL_RAW; |
1998 | tty_set_operations(serial_driver, &serial_ops); | 2002 | tty_set_operations(serial_driver, &serial_ops); |
1999 | 2003 | ||
2000 | if (tty_register_driver(serial_driver)) | 2004 | error = tty_register_driver(serial_driver); |
2001 | panic("Couldn't register serial driver\n"); | 2005 | if (error) |
2006 | goto fail_release_mem_region; | ||
2002 | 2007 | ||
2003 | state = rs_table; | 2008 | state = rs_table; |
2004 | state->magic = SSTATE_MAGIC; | 2009 | state->magic = SSTATE_MAGIC; |
@@ -2024,8 +2029,14 @@ static int __init rs_init(void) | |||
2024 | local_irq_save(flags); | 2029 | local_irq_save(flags); |
2025 | 2030 | ||
2026 | /* set ISRs, and then disable the rx interrupts */ | 2031 | /* set ISRs, and then disable the rx interrupts */ |
2027 | request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); | 2032 | error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); |
2028 | request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, "serial RX", state); | 2033 | if (error) |
2034 | goto fail_unregister; | ||
2035 | |||
2036 | error = request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, | ||
2037 | "serial RX", state); | ||
2038 | if (error) | ||
2039 | goto fail_free_irq; | ||
2029 | 2040 | ||
2030 | /* turn off Rx and Tx interrupts */ | 2041 | /* turn off Rx and Tx interrupts */ |
2031 | custom.intena = IF_RBF | IF_TBE; | 2042 | custom.intena = IF_RBF | IF_TBE; |
@@ -2045,6 +2056,16 @@ static int __init rs_init(void) | |||
2045 | ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */ | 2056 | ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */ |
2046 | 2057 | ||
2047 | return 0; | 2058 | return 0; |
2059 | |||
2060 | fail_free_irq: | ||
2061 | free_irq(IRQ_AMIGA_TBE, state); | ||
2062 | fail_unregister: | ||
2063 | tty_unregister_driver(serial_driver); | ||
2064 | fail_release_mem_region: | ||
2065 | release_mem_region(CUSTOM_PHYSADDR+0x30, 4); | ||
2066 | fail_put_tty_driver: | ||
2067 | put_tty_driver(serial_driver); | ||
2068 | return error; | ||
2048 | } | 2069 | } |
2049 | 2070 | ||
2050 | static __exit void rs_exit(void) | 2071 | static __exit void rs_exit(void) |
@@ -2064,6 +2085,9 @@ static __exit void rs_exit(void) | |||
2064 | kfree(info); | 2085 | kfree(info); |
2065 | } | 2086 | } |
2066 | 2087 | ||
2088 | free_irq(IRQ_AMIGA_TBE, rs_table); | ||
2089 | free_irq(IRQ_AMIGA_RBF, rs_table); | ||
2090 | |||
2067 | release_mem_region(CUSTOM_PHYSADDR+0x30, 4); | 2091 | release_mem_region(CUSTOM_PHYSADDR+0x30, 4); |
2068 | } | 2092 | } |
2069 | 2093 | ||
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index 977dfb1096a0..f6094ae0ef33 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c | |||
@@ -103,7 +103,7 @@ static ssize_t | |||
103 | bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) | 103 | bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) |
104 | { | 104 | { |
105 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); | 105 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); |
106 | return sprintf(buf, "%lu\n", bsr_dev->bsr_len); | 106 | return sprintf(buf, "%llu\n", bsr_dev->bsr_len); |
107 | } | 107 | } |
108 | 108 | ||
109 | static struct device_attribute bsr_dev_attrs[] = { | 109 | static struct device_attribute bsr_dev_attrs[] = { |
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index 5a8a4c28c867..09676b4e5d89 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -318,7 +318,8 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) | |||
318 | } /* else count == 0 */ | 318 | } /* else count == 0 */ |
319 | 319 | ||
320 | tty->driver_data = hp; | 320 | tty->driver_data = hp; |
321 | tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */ | 321 | if (!hp->irq_requested) |
322 | tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */ | ||
322 | 323 | ||
323 | hp->tty = tty; | 324 | hp->tty = tty; |
324 | 325 | ||
@@ -764,13 +765,11 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data, | |||
764 | return ERR_PTR(err); | 765 | return ERR_PTR(err); |
765 | } | 766 | } |
766 | 767 | ||
767 | hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, | 768 | hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, |
768 | GFP_KERNEL); | 769 | GFP_KERNEL); |
769 | if (!hp) | 770 | if (!hp) |
770 | return ERR_PTR(-ENOMEM); | 771 | return ERR_PTR(-ENOMEM); |
771 | 772 | ||
772 | memset(hp, 0x00, sizeof(*hp)); | ||
773 | |||
774 | hp->vtermno = vtermno; | 773 | hp->vtermno = vtermno; |
775 | hp->data = data; | 774 | hp->data = data; |
776 | hp->ops = ops; | 775 | hp->ops = ops; |
@@ -876,8 +875,11 @@ static int hvc_init(void) | |||
876 | goto stop_thread; | 875 | goto stop_thread; |
877 | } | 876 | } |
878 | 877 | ||
879 | /* FIXME: This mb() seems completely random. Remove it. */ | 878 | /* |
880 | mb(); | 879 | * Make sure tty is fully registered before allowing it to be |
880 | * found by hvc_console_device. | ||
881 | */ | ||
882 | smp_mb(); | ||
881 | hvc_driver = drv; | 883 | hvc_driver = drv; |
882 | return 0; | 884 | return 0; |
883 | 885 | ||
diff --git a/drivers/char/hvc_irq.c b/drivers/char/hvc_irq.c index d09e5688d449..2623e177e8d6 100644 --- a/drivers/char/hvc_irq.c +++ b/drivers/char/hvc_irq.c | |||
@@ -37,7 +37,7 @@ int notifier_add_irq(struct hvc_struct *hp, int irq) | |||
37 | 37 | ||
38 | void notifier_del_irq(struct hvc_struct *hp, int irq) | 38 | void notifier_del_irq(struct hvc_struct *hp, int irq) |
39 | { | 39 | { |
40 | if (!irq) | 40 | if (!hp->irq_requested) |
41 | return; | 41 | return; |
42 | free_irq(irq, hp); | 42 | free_irq(irq, hp); |
43 | hp->irq_requested = 0; | 43 | hp->irq_requested = 0; |
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 146c97613da0..31038a0052a2 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -230,9 +230,7 @@ static void pty_set_termios(struct tty_struct *tty, | |||
230 | /** | 230 | /** |
231 | * pty_do_resize - resize event | 231 | * pty_do_resize - resize event |
232 | * @tty: tty being resized | 232 | * @tty: tty being resized |
233 | * @real_tty: real tty (not the same as tty if using a pty/tty pair) | 233 | * @ws: window size being set. |
234 | * @rows: rows (character) | ||
235 | * @cols: cols (character) | ||
236 | * | 234 | * |
237 | * Update the termios variables and send the neccessary signals to | 235 | * Update the termios variables and send the neccessary signals to |
238 | * peform a terminal resize correctly | 236 | * peform a terminal resize correctly |
diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c index 33872a219df6..33a2b531802e 100644 --- a/drivers/char/ser_a2232.c +++ b/drivers/char/ser_a2232.c | |||
@@ -718,6 +718,7 @@ static int __init a2232board_init(void) | |||
718 | u_char *from; | 718 | u_char *from; |
719 | volatile u_char *to; | 719 | volatile u_char *to; |
720 | volatile struct a2232memory *mem; | 720 | volatile struct a2232memory *mem; |
721 | int error, i; | ||
721 | 722 | ||
722 | #ifdef CONFIG_SMP | 723 | #ifdef CONFIG_SMP |
723 | return -ENODEV; /* This driver is not SMP aware. Is there an SMP ZorroII-bus-machine? */ | 724 | return -ENODEV; /* This driver is not SMP aware. Is there an SMP ZorroII-bus-machine? */ |
@@ -797,8 +798,15 @@ static int __init a2232board_init(void) | |||
797 | */ | 798 | */ |
798 | if (a2232_init_drivers()) return -ENODEV; // maybe we should use a different -Exxx? | 799 | if (a2232_init_drivers()) return -ENODEV; // maybe we should use a different -Exxx? |
799 | 800 | ||
800 | request_irq(IRQ_AMIGA_VERTB, a2232_vbl_inter, 0, "A2232 serial VBL", a2232_driver_ID); | 801 | error = request_irq(IRQ_AMIGA_VERTB, a2232_vbl_inter, 0, |
801 | return 0; | 802 | "A2232 serial VBL", a2232_driver_ID); |
803 | if (error) { | ||
804 | for (i = 0; i < nr_a2232; i++) | ||
805 | zorro_release_device(zd_a2232[i]); | ||
806 | tty_unregister_driver(a2232_driver); | ||
807 | put_tty_driver(a2232_driver); | ||
808 | } | ||
809 | return error; | ||
802 | } | 810 | } |
803 | 811 | ||
804 | static void __exit a2232board_exit(void) | 812 | static void __exit a2232board_exit(void) |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 53544e21f191..f329f459817c 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: synclink_gt.c,v 4.50 2007/07/25 19:29:25 paulkf Exp $ | ||
3 | * | ||
4 | * Device driver for Microgate SyncLink GT serial adapters. | 2 | * Device driver for Microgate SyncLink GT serial adapters. |
5 | * | 3 | * |
6 | * written by Paul Fulghum for Microgate Corporation | 4 | * written by Paul Fulghum for Microgate Corporation |
@@ -91,7 +89,6 @@ | |||
91 | * module identification | 89 | * module identification |
92 | */ | 90 | */ |
93 | static char *driver_name = "SyncLink GT"; | 91 | static char *driver_name = "SyncLink GT"; |
94 | static char *driver_version = "$Revision: 4.50 $"; | ||
95 | static char *tty_driver_name = "synclink_gt"; | 92 | static char *tty_driver_name = "synclink_gt"; |
96 | static char *tty_dev_prefix = "ttySLG"; | 93 | static char *tty_dev_prefix = "ttySLG"; |
97 | MODULE_LICENSE("GPL"); | 94 | MODULE_LICENSE("GPL"); |
@@ -1309,7 +1306,7 @@ static int read_proc(char *page, char **start, off_t off, int count, | |||
1309 | off_t begin = 0; | 1306 | off_t begin = 0; |
1310 | struct slgt_info *info; | 1307 | struct slgt_info *info; |
1311 | 1308 | ||
1312 | len += sprintf(page, "synclink_gt driver:%s\n", driver_version); | 1309 | len += sprintf(page, "synclink_gt driver\n"); |
1313 | 1310 | ||
1314 | info = slgt_device_list; | 1311 | info = slgt_device_list; |
1315 | while( info ) { | 1312 | while( info ) { |
@@ -2441,7 +2438,7 @@ static void program_hw(struct slgt_info *info) | |||
2441 | info->ri_chkcount = 0; | 2438 | info->ri_chkcount = 0; |
2442 | info->dsr_chkcount = 0; | 2439 | info->dsr_chkcount = 0; |
2443 | 2440 | ||
2444 | slgt_irq_on(info, IRQ_DCD | IRQ_CTS | IRQ_DSR); | 2441 | slgt_irq_on(info, IRQ_DCD | IRQ_CTS | IRQ_DSR | IRQ_RI); |
2445 | get_signals(info); | 2442 | get_signals(info); |
2446 | 2443 | ||
2447 | if (info->netcount || | 2444 | if (info->netcount || |
@@ -3576,7 +3573,7 @@ static void slgt_cleanup(void) | |||
3576 | struct slgt_info *info; | 3573 | struct slgt_info *info; |
3577 | struct slgt_info *tmp; | 3574 | struct slgt_info *tmp; |
3578 | 3575 | ||
3579 | printk("unload %s %s\n", driver_name, driver_version); | 3576 | printk(KERN_INFO "unload %s\n", driver_name); |
3580 | 3577 | ||
3581 | if (serial_driver) { | 3578 | if (serial_driver) { |
3582 | for (info=slgt_device_list ; info != NULL ; info=info->next_device) | 3579 | for (info=slgt_device_list ; info != NULL ; info=info->next_device) |
@@ -3619,7 +3616,7 @@ static int __init slgt_init(void) | |||
3619 | { | 3616 | { |
3620 | int rc; | 3617 | int rc; |
3621 | 3618 | ||
3622 | printk("%s %s\n", driver_name, driver_version); | 3619 | printk(KERN_INFO "%s\n", driver_name); |
3623 | 3620 | ||
3624 | serial_driver = alloc_tty_driver(MAX_DEVICES); | 3621 | serial_driver = alloc_tty_driver(MAX_DEVICES); |
3625 | if (!serial_driver) { | 3622 | if (!serial_driver) { |
@@ -3650,9 +3647,8 @@ static int __init slgt_init(void) | |||
3650 | goto error; | 3647 | goto error; |
3651 | } | 3648 | } |
3652 | 3649 | ||
3653 | printk("%s %s, tty major#%d\n", | 3650 | printk(KERN_INFO "%s, tty major#%d\n", |
3654 | driver_name, driver_version, | 3651 | driver_name, serial_driver->major); |
3655 | serial_driver->major); | ||
3656 | 3652 | ||
3657 | slgt_device_count = 0; | 3653 | slgt_device_count = 0; |
3658 | if ((rc = pci_register_driver(&pci_driver)) < 0) { | 3654 | if ((rc = pci_register_driver(&pci_driver)) < 0) { |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index d41b9f6f7903..33a9351c896d 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -473,6 +473,12 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) | |||
473 | unsigned long flags; | 473 | unsigned long flags; |
474 | 474 | ||
475 | spin_lock_irqsave(&sysrq_key_table_lock, flags); | 475 | spin_lock_irqsave(&sysrq_key_table_lock, flags); |
476 | /* | ||
477 | * Raise the apparent loglevel to maximum so that the sysrq header | ||
478 | * is shown to provide the user with positive feedback. We do not | ||
479 | * simply emit this at KERN_EMERG as that would change message | ||
480 | * routing in the consumers of /proc/kmsg. | ||
481 | */ | ||
476 | orig_log_level = console_loglevel; | 482 | orig_log_level = console_loglevel; |
477 | console_loglevel = 7; | 483 | console_loglevel = 7; |
478 | printk(KERN_INFO "SysRq : "); | 484 | printk(KERN_INFO "SysRq : "); |
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index a408c8e487ec..6f4c7d0a53bf 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c | |||
@@ -1057,7 +1057,7 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg) | |||
1057 | if (retval) | 1057 | if (retval) |
1058 | return retval; | 1058 | return retval; |
1059 | 1059 | ||
1060 | ld = tty_ldisc_ref(tty); | 1060 | ld = tty_ldisc_ref_wait(tty); |
1061 | switch (arg) { | 1061 | switch (arg) { |
1062 | case TCIFLUSH: | 1062 | case TCIFLUSH: |
1063 | if (ld && ld->ops->flush_buffer) | 1063 | if (ld && ld->ops->flush_buffer) |
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c index 0e8234bd0e19..994e1a58b987 100644 --- a/drivers/char/vme_scc.c +++ b/drivers/char/vme_scc.c | |||
@@ -198,6 +198,7 @@ static void scc_init_portstructs(void) | |||
198 | static int mvme147_scc_init(void) | 198 | static int mvme147_scc_init(void) |
199 | { | 199 | { |
200 | struct scc_port *port; | 200 | struct scc_port *port; |
201 | int error; | ||
201 | 202 | ||
202 | printk(KERN_INFO "SCC: MVME147 Serial Driver\n"); | 203 | printk(KERN_INFO "SCC: MVME147 Serial Driver\n"); |
203 | /* Init channel A */ | 204 | /* Init channel A */ |
@@ -207,14 +208,23 @@ static int mvme147_scc_init(void) | |||
207 | port->datap = port->ctrlp + 1; | 208 | port->datap = port->ctrlp + 1; |
208 | port->port_a = &scc_ports[0]; | 209 | port->port_a = &scc_ports[0]; |
209 | port->port_b = &scc_ports[1]; | 210 | port->port_b = &scc_ports[1]; |
210 | request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, | 211 | error = request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, |
211 | "SCC-A TX", port); | 212 | "SCC-A TX", port); |
212 | request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, | 213 | if (error) |
214 | goto fail; | ||
215 | error = request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, | ||
213 | "SCC-A status", port); | 216 | "SCC-A status", port); |
214 | request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, | 217 | if (error) |
218 | goto fail_free_a_tx; | ||
219 | error = request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, | ||
215 | "SCC-A RX", port); | 220 | "SCC-A RX", port); |
216 | request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, | 221 | if (error) |
217 | "SCC-A special cond", port); | 222 | goto fail_free_a_stat; |
223 | error = request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, | ||
224 | IRQF_DISABLED, "SCC-A special cond", port); | ||
225 | if (error) | ||
226 | goto fail_free_a_rx; | ||
227 | |||
218 | { | 228 | { |
219 | SCC_ACCESS_INIT(port); | 229 | SCC_ACCESS_INIT(port); |
220 | 230 | ||
@@ -234,14 +244,23 @@ static int mvme147_scc_init(void) | |||
234 | port->datap = port->ctrlp + 1; | 244 | port->datap = port->ctrlp + 1; |
235 | port->port_a = &scc_ports[0]; | 245 | port->port_a = &scc_ports[0]; |
236 | port->port_b = &scc_ports[1]; | 246 | port->port_b = &scc_ports[1]; |
237 | request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, | 247 | error = request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, |
238 | "SCC-B TX", port); | 248 | "SCC-B TX", port); |
239 | request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, | 249 | if (error) |
250 | goto fail_free_a_spcond; | ||
251 | error = request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, | ||
240 | "SCC-B status", port); | 252 | "SCC-B status", port); |
241 | request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, | 253 | if (error) |
254 | goto fail_free_b_tx; | ||
255 | error = request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, | ||
242 | "SCC-B RX", port); | 256 | "SCC-B RX", port); |
243 | request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, | 257 | if (error) |
244 | "SCC-B special cond", port); | 258 | goto fail_free_b_stat; |
259 | error = request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, | ||
260 | IRQF_DISABLED, "SCC-B special cond", port); | ||
261 | if (error) | ||
262 | goto fail_free_b_rx; | ||
263 | |||
245 | { | 264 | { |
246 | SCC_ACCESS_INIT(port); | 265 | SCC_ACCESS_INIT(port); |
247 | 266 | ||
@@ -257,6 +276,23 @@ static int mvme147_scc_init(void) | |||
257 | scc_init_drivers(); | 276 | scc_init_drivers(); |
258 | 277 | ||
259 | return 0; | 278 | return 0; |
279 | |||
280 | fail_free_b_rx: | ||
281 | free_irq(MVME147_IRQ_SCCB_RX, port); | ||
282 | fail_free_b_stat: | ||
283 | free_irq(MVME147_IRQ_SCCB_STAT, port); | ||
284 | fail_free_b_tx: | ||
285 | free_irq(MVME147_IRQ_SCCB_TX, port); | ||
286 | fail_free_a_spcond: | ||
287 | free_irq(MVME147_IRQ_SCCA_SPCOND, port); | ||
288 | fail_free_a_rx: | ||
289 | free_irq(MVME147_IRQ_SCCA_RX, port); | ||
290 | fail_free_a_stat: | ||
291 | free_irq(MVME147_IRQ_SCCA_STAT, port); | ||
292 | fail_free_a_tx: | ||
293 | free_irq(MVME147_IRQ_SCCA_TX, port); | ||
294 | fail: | ||
295 | return error; | ||
260 | } | 296 | } |
261 | #endif | 297 | #endif |
262 | 298 | ||
@@ -265,6 +301,7 @@ static int mvme147_scc_init(void) | |||
265 | static int mvme162_scc_init(void) | 301 | static int mvme162_scc_init(void) |
266 | { | 302 | { |
267 | struct scc_port *port; | 303 | struct scc_port *port; |
304 | int error; | ||
268 | 305 | ||
269 | if (!(mvme16x_config & MVME16x_CONFIG_GOT_SCCA)) | 306 | if (!(mvme16x_config & MVME16x_CONFIG_GOT_SCCA)) |
270 | return (-ENODEV); | 307 | return (-ENODEV); |
@@ -277,14 +314,23 @@ static int mvme162_scc_init(void) | |||
277 | port->datap = port->ctrlp + 2; | 314 | port->datap = port->ctrlp + 2; |
278 | port->port_a = &scc_ports[0]; | 315 | port->port_a = &scc_ports[0]; |
279 | port->port_b = &scc_ports[1]; | 316 | port->port_b = &scc_ports[1]; |
280 | request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, | 317 | error = request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, |
281 | "SCC-A TX", port); | 318 | "SCC-A TX", port); |
282 | request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, | 319 | if (error) |
320 | goto fail; | ||
321 | error = request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, | ||
283 | "SCC-A status", port); | 322 | "SCC-A status", port); |
284 | request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, | 323 | if (error) |
324 | goto fail_free_a_tx; | ||
325 | error = request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, | ||
285 | "SCC-A RX", port); | 326 | "SCC-A RX", port); |
286 | request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, | 327 | if (error) |
287 | "SCC-A special cond", port); | 328 | goto fail_free_a_stat; |
329 | error = request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, | ||
330 | IRQF_DISABLED, "SCC-A special cond", port); | ||
331 | if (error) | ||
332 | goto fail_free_a_rx; | ||
333 | |||
288 | { | 334 | { |
289 | SCC_ACCESS_INIT(port); | 335 | SCC_ACCESS_INIT(port); |
290 | 336 | ||
@@ -304,14 +350,22 @@ static int mvme162_scc_init(void) | |||
304 | port->datap = port->ctrlp + 2; | 350 | port->datap = port->ctrlp + 2; |
305 | port->port_a = &scc_ports[0]; | 351 | port->port_a = &scc_ports[0]; |
306 | port->port_b = &scc_ports[1]; | 352 | port->port_b = &scc_ports[1]; |
307 | request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, | 353 | error = request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, |
308 | "SCC-B TX", port); | 354 | "SCC-B TX", port); |
309 | request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, | 355 | if (error) |
356 | goto fail_free_a_spcond; | ||
357 | error = request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, | ||
310 | "SCC-B status", port); | 358 | "SCC-B status", port); |
311 | request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, | 359 | if (error) |
360 | goto fail_free_b_tx; | ||
361 | error = request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, | ||
312 | "SCC-B RX", port); | 362 | "SCC-B RX", port); |
313 | request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, | 363 | if (error) |
314 | "SCC-B special cond", port); | 364 | goto fail_free_b_stat; |
365 | error = request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, | ||
366 | IRQF_DISABLED, "SCC-B special cond", port); | ||
367 | if (error) | ||
368 | goto fail_free_b_rx; | ||
315 | 369 | ||
316 | { | 370 | { |
317 | SCC_ACCESS_INIT(port); /* Either channel will do */ | 371 | SCC_ACCESS_INIT(port); /* Either channel will do */ |
@@ -328,6 +382,23 @@ static int mvme162_scc_init(void) | |||
328 | scc_init_drivers(); | 382 | scc_init_drivers(); |
329 | 383 | ||
330 | return 0; | 384 | return 0; |
385 | |||
386 | fail_free_b_rx: | ||
387 | free_irq(MVME162_IRQ_SCCB_RX, port); | ||
388 | fail_free_b_stat: | ||
389 | free_irq(MVME162_IRQ_SCCB_STAT, port); | ||
390 | fail_free_b_tx: | ||
391 | free_irq(MVME162_IRQ_SCCB_TX, port); | ||
392 | fail_free_a_spcond: | ||
393 | free_irq(MVME162_IRQ_SCCA_SPCOND, port); | ||
394 | fail_free_a_rx: | ||
395 | free_irq(MVME162_IRQ_SCCA_RX, port); | ||
396 | fail_free_a_stat: | ||
397 | free_irq(MVME162_IRQ_SCCA_STAT, port); | ||
398 | fail_free_a_tx: | ||
399 | free_irq(MVME162_IRQ_SCCA_TX, port); | ||
400 | fail: | ||
401 | return error; | ||
331 | } | 402 | } |
332 | #endif | 403 | #endif |
333 | 404 | ||
@@ -336,6 +407,7 @@ static int mvme162_scc_init(void) | |||
336 | static int bvme6000_scc_init(void) | 407 | static int bvme6000_scc_init(void) |
337 | { | 408 | { |
338 | struct scc_port *port; | 409 | struct scc_port *port; |
410 | int error; | ||
339 | 411 | ||
340 | printk(KERN_INFO "SCC: BVME6000 Serial Driver\n"); | 412 | printk(KERN_INFO "SCC: BVME6000 Serial Driver\n"); |
341 | /* Init channel A */ | 413 | /* Init channel A */ |
@@ -345,14 +417,23 @@ static int bvme6000_scc_init(void) | |||
345 | port->datap = port->ctrlp + 4; | 417 | port->datap = port->ctrlp + 4; |
346 | port->port_a = &scc_ports[0]; | 418 | port->port_a = &scc_ports[0]; |
347 | port->port_b = &scc_ports[1]; | 419 | port->port_b = &scc_ports[1]; |
348 | request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, | 420 | error = request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, |
349 | "SCC-A TX", port); | 421 | "SCC-A TX", port); |
350 | request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, | 422 | if (error) |
423 | goto fail; | ||
424 | error = request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, | ||
351 | "SCC-A status", port); | 425 | "SCC-A status", port); |
352 | request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, | 426 | if (error) |
427 | goto fail_free_a_tx; | ||
428 | error = request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, | ||
353 | "SCC-A RX", port); | 429 | "SCC-A RX", port); |
354 | request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, | 430 | if (error) |
355 | "SCC-A special cond", port); | 431 | goto fail_free_a_stat; |
432 | error = request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, | ||
433 | IRQF_DISABLED, "SCC-A special cond", port); | ||
434 | if (error) | ||
435 | goto fail_free_a_rx; | ||
436 | |||
356 | { | 437 | { |
357 | SCC_ACCESS_INIT(port); | 438 | SCC_ACCESS_INIT(port); |
358 | 439 | ||
@@ -372,14 +453,22 @@ static int bvme6000_scc_init(void) | |||
372 | port->datap = port->ctrlp + 4; | 453 | port->datap = port->ctrlp + 4; |
373 | port->port_a = &scc_ports[0]; | 454 | port->port_a = &scc_ports[0]; |
374 | port->port_b = &scc_ports[1]; | 455 | port->port_b = &scc_ports[1]; |
375 | request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, | 456 | error = request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, |
376 | "SCC-B TX", port); | 457 | "SCC-B TX", port); |
377 | request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, | 458 | if (error) |
459 | goto fail_free_a_spcond; | ||
460 | error = request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, | ||
378 | "SCC-B status", port); | 461 | "SCC-B status", port); |
379 | request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, | 462 | if (error) |
463 | goto fail_free_b_tx; | ||
464 | error = request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, | ||
380 | "SCC-B RX", port); | 465 | "SCC-B RX", port); |
381 | request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, | 466 | if (error) |
382 | "SCC-B special cond", port); | 467 | goto fail_free_b_stat; |
468 | error = request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, | ||
469 | IRQF_DISABLED, "SCC-B special cond", port); | ||
470 | if (error) | ||
471 | goto fail_free_b_rx; | ||
383 | 472 | ||
384 | { | 473 | { |
385 | SCC_ACCESS_INIT(port); /* Either channel will do */ | 474 | SCC_ACCESS_INIT(port); /* Either channel will do */ |
@@ -393,6 +482,23 @@ static int bvme6000_scc_init(void) | |||
393 | scc_init_drivers(); | 482 | scc_init_drivers(); |
394 | 483 | ||
395 | return 0; | 484 | return 0; |
485 | |||
486 | fail: | ||
487 | free_irq(BVME_IRQ_SCCA_STAT, port); | ||
488 | fail_free_a_tx: | ||
489 | free_irq(BVME_IRQ_SCCA_RX, port); | ||
490 | fail_free_a_stat: | ||
491 | free_irq(BVME_IRQ_SCCA_SPCOND, port); | ||
492 | fail_free_a_rx: | ||
493 | free_irq(BVME_IRQ_SCCB_TX, port); | ||
494 | fail_free_a_spcond: | ||
495 | free_irq(BVME_IRQ_SCCB_STAT, port); | ||
496 | fail_free_b_tx: | ||
497 | free_irq(BVME_IRQ_SCCB_RX, port); | ||
498 | fail_free_b_stat: | ||
499 | free_irq(BVME_IRQ_SCCB_SPCOND, port); | ||
500 | fail_free_b_rx: | ||
501 | return error; | ||
396 | } | 502 | } |
397 | #endif | 503 | #endif |
398 | 504 | ||
diff --git a/drivers/dio/dio-sysfs.c b/drivers/dio/dio-sysfs.c index f46463038847..ee1a3b59bd4e 100644 --- a/drivers/dio/dio-sysfs.c +++ b/drivers/dio/dio-sysfs.c | |||
@@ -58,20 +58,25 @@ static ssize_t dio_show_resource(struct device *dev, struct device_attribute *at | |||
58 | struct dio_dev *d = to_dio_dev(dev); | 58 | struct dio_dev *d = to_dio_dev(dev); |
59 | 59 | ||
60 | return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n", | 60 | return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n", |
61 | dio_resource_start(d), dio_resource_end(d), | 61 | (unsigned long)dio_resource_start(d), |
62 | (unsigned long)dio_resource_end(d), | ||
62 | dio_resource_flags(d)); | 63 | dio_resource_flags(d)); |
63 | } | 64 | } |
64 | static DEVICE_ATTR(resource, S_IRUGO, dio_show_resource, NULL); | 65 | static DEVICE_ATTR(resource, S_IRUGO, dio_show_resource, NULL); |
65 | 66 | ||
66 | void dio_create_sysfs_dev_files(struct dio_dev *d) | 67 | int dio_create_sysfs_dev_files(struct dio_dev *d) |
67 | { | 68 | { |
68 | struct device *dev = &d->dev; | 69 | struct device *dev = &d->dev; |
70 | int error; | ||
69 | 71 | ||
70 | /* current configuration's attributes */ | 72 | /* current configuration's attributes */ |
71 | device_create_file(dev, &dev_attr_id); | 73 | if ((error = device_create_file(dev, &dev_attr_id)) || |
72 | device_create_file(dev, &dev_attr_ipl); | 74 | (error = device_create_file(dev, &dev_attr_ipl)) || |
73 | device_create_file(dev, &dev_attr_secid); | 75 | (error = device_create_file(dev, &dev_attr_secid)) || |
74 | device_create_file(dev, &dev_attr_name); | 76 | (error = device_create_file(dev, &dev_attr_name)) || |
75 | device_create_file(dev, &dev_attr_resource); | 77 | (error = device_create_file(dev, &dev_attr_resource))) |
78 | return error; | ||
79 | |||
80 | return 0; | ||
76 | } | 81 | } |
77 | 82 | ||
diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c index 07f274f853d9..10c3c498358c 100644 --- a/drivers/dio/dio.c +++ b/drivers/dio/dio.c | |||
@@ -173,6 +173,7 @@ static int __init dio_init(void) | |||
173 | mm_segment_t fs; | 173 | mm_segment_t fs; |
174 | int i; | 174 | int i; |
175 | struct dio_dev *dev; | 175 | struct dio_dev *dev; |
176 | int error; | ||
176 | 177 | ||
177 | if (!MACH_IS_HP300) | 178 | if (!MACH_IS_HP300) |
178 | return 0; | 179 | return 0; |
@@ -182,7 +183,11 @@ static int __init dio_init(void) | |||
182 | /* Initialize the DIO bus */ | 183 | /* Initialize the DIO bus */ |
183 | INIT_LIST_HEAD(&dio_bus.devices); | 184 | INIT_LIST_HEAD(&dio_bus.devices); |
184 | strcpy(dio_bus.dev.bus_id, "dio"); | 185 | strcpy(dio_bus.dev.bus_id, "dio"); |
185 | device_register(&dio_bus.dev); | 186 | error = device_register(&dio_bus.dev); |
187 | if (error) { | ||
188 | pr_err("DIO: Error registering dio_bus\n"); | ||
189 | return error; | ||
190 | } | ||
186 | 191 | ||
187 | /* Request all resources */ | 192 | /* Request all resources */ |
188 | dio_bus.num_resources = (hp300_model == HP_320 ? 1 : 2); | 193 | dio_bus.num_resources = (hp300_model == HP_320 ? 1 : 2); |
@@ -252,8 +257,15 @@ static int __init dio_init(void) | |||
252 | 257 | ||
253 | if (scode >= DIOII_SCBASE) | 258 | if (scode >= DIOII_SCBASE) |
254 | iounmap(va); | 259 | iounmap(va); |
255 | device_register(&dev->dev); | 260 | error = device_register(&dev->dev); |
256 | dio_create_sysfs_dev_files(dev); | 261 | if (error) { |
262 | pr_err("DIO: Error registering device %s\n", | ||
263 | dev->name); | ||
264 | continue; | ||
265 | } | ||
266 | error = dio_create_sysfs_dev_files(dev); | ||
267 | if (error) | ||
268 | dev_err(&dev->dev, "Error creating sysfs files\n"); | ||
257 | } | 269 | } |
258 | return 0; | 270 | return 0; |
259 | } | 271 | } |
diff --git a/drivers/gpio/max7301.c b/drivers/gpio/max7301.c index 8b24d784db93..3e7f4e06386e 100644 --- a/drivers/gpio/max7301.c +++ b/drivers/gpio/max7301.c | |||
@@ -217,8 +217,10 @@ static int __devinit max7301_probe(struct spi_device *spi) | |||
217 | int i, ret; | 217 | int i, ret; |
218 | 218 | ||
219 | pdata = spi->dev.platform_data; | 219 | pdata = spi->dev.platform_data; |
220 | if (!pdata || !pdata->base) | 220 | if (!pdata || !pdata->base) { |
221 | return -ENODEV; | 221 | dev_dbg(&spi->dev, "incorrect or missing platform data\n"); |
222 | return -EINVAL; | ||
223 | } | ||
222 | 224 | ||
223 | /* | 225 | /* |
224 | * bits_per_word cannot be configured in platform data | 226 | * bits_per_word cannot be configured in platform data |
diff --git a/drivers/gpio/max732x.c b/drivers/gpio/max732x.c index 55ae9a41897a..f7868243af89 100644 --- a/drivers/gpio/max732x.c +++ b/drivers/gpio/max732x.c | |||
@@ -267,8 +267,10 @@ static int __devinit max732x_probe(struct i2c_client *client, | |||
267 | int ret, nr_port; | 267 | int ret, nr_port; |
268 | 268 | ||
269 | pdata = client->dev.platform_data; | 269 | pdata = client->dev.platform_data; |
270 | if (pdata == NULL) | 270 | if (pdata == NULL) { |
271 | return -ENODEV; | 271 | dev_dbg(&client->dev, "no platform data\n"); |
272 | return -EINVAL; | ||
273 | } | ||
272 | 274 | ||
273 | chip = kzalloc(sizeof(struct max732x_chip), GFP_KERNEL); | 275 | chip = kzalloc(sizeof(struct max732x_chip), GFP_KERNEL); |
274 | if (chip == NULL) | 276 | if (chip == NULL) |
diff --git a/drivers/gpio/mcp23s08.c b/drivers/gpio/mcp23s08.c index 89c1d222e9d1..f6fae0e50e65 100644 --- a/drivers/gpio/mcp23s08.c +++ b/drivers/gpio/mcp23s08.c | |||
@@ -310,8 +310,10 @@ static int mcp23s08_probe(struct spi_device *spi) | |||
310 | unsigned base; | 310 | unsigned base; |
311 | 311 | ||
312 | pdata = spi->dev.platform_data; | 312 | pdata = spi->dev.platform_data; |
313 | if (!pdata || !gpio_is_valid(pdata->base)) | 313 | if (!pdata || !gpio_is_valid(pdata->base)) { |
314 | return -ENODEV; | 314 | dev_dbg(&spi->dev, "invalid or missing platform data\n"); |
315 | return -EINVAL; | ||
316 | } | ||
315 | 317 | ||
316 | for (addr = 0; addr < 4; addr++) { | 318 | for (addr = 0; addr < 4; addr++) { |
317 | if (!pdata->chip[addr].is_present) | 319 | if (!pdata->chip[addr].is_present) |
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c index 37f35388a2ae..8dc0164bd51e 100644 --- a/drivers/gpio/pca953x.c +++ b/drivers/gpio/pca953x.c | |||
@@ -202,8 +202,10 @@ static int __devinit pca953x_probe(struct i2c_client *client, | |||
202 | int ret; | 202 | int ret; |
203 | 203 | ||
204 | pdata = client->dev.platform_data; | 204 | pdata = client->dev.platform_data; |
205 | if (pdata == NULL) | 205 | if (pdata == NULL) { |
206 | return -ENODEV; | 206 | dev_dbg(&client->dev, "no platform data\n"); |
207 | return -EINVAL; | ||
208 | } | ||
207 | 209 | ||
208 | chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL); | 210 | chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL); |
209 | if (chip == NULL) | 211 | if (chip == NULL) |
diff --git a/drivers/gpio/pcf857x.c b/drivers/gpio/pcf857x.c index 4bc2070dd4a1..9525724be731 100644 --- a/drivers/gpio/pcf857x.c +++ b/drivers/gpio/pcf857x.c | |||
@@ -188,8 +188,10 @@ static int pcf857x_probe(struct i2c_client *client, | |||
188 | int status; | 188 | int status; |
189 | 189 | ||
190 | pdata = client->dev.platform_data; | 190 | pdata = client->dev.platform_data; |
191 | if (!pdata) | 191 | if (!pdata) { |
192 | return -ENODEV; | 192 | dev_dbg(&client->dev, "no platform data\n"); |
193 | return -EINVAL; | ||
194 | } | ||
193 | 195 | ||
194 | /* Allocate, initialize, and register this gpio_chip. */ | 196 | /* Allocate, initialize, and register this gpio_chip. */ |
195 | gpio = kzalloc(sizeof *gpio, GFP_KERNEL); | 197 | gpio = kzalloc(sizeof *gpio, GFP_KERNEL); |
@@ -248,8 +250,10 @@ static int pcf857x_probe(struct i2c_client *client, | |||
248 | else | 250 | else |
249 | status = i2c_read_le16(client); | 251 | status = i2c_read_le16(client); |
250 | 252 | ||
251 | } else | 253 | } else { |
252 | status = -ENODEV; | 254 | dev_dbg(&client->dev, "unsupported number of gpios\n"); |
255 | status = -EINVAL; | ||
256 | } | ||
253 | 257 | ||
254 | if (status < 0) | 258 | if (status < 0) |
255 | goto fail; | 259 | goto fail; |
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 4b33bc82cc24..b84bf066879b 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -189,6 +189,16 @@ config SENSORS_ADT7473 | |||
189 | This driver can also be built as a module. If so, the module | 189 | This driver can also be built as a module. If so, the module |
190 | will be called adt7473. | 190 | will be called adt7473. |
191 | 191 | ||
192 | config SENSORS_ADT7475 | ||
193 | tristate "Analog Devices ADT7475" | ||
194 | depends on I2C && EXPERIMENTAL | ||
195 | help | ||
196 | If you say yes here you get support for the Analog Devices | ||
197 | ADT7475 hardware monitoring chips. | ||
198 | |||
199 | This driver can also be build as a module. If so, the module | ||
200 | will be called adt7475. | ||
201 | |||
192 | config SENSORS_K8TEMP | 202 | config SENSORS_K8TEMP |
193 | tristate "AMD Athlon64/FX or Opteron temperature sensor" | 203 | tristate "AMD Athlon64/FX or Opteron temperature sensor" |
194 | depends on X86 && PCI && EXPERIMENTAL | 204 | depends on X86 && PCI && EXPERIMENTAL |
@@ -861,6 +871,8 @@ config SENSORS_HDAPS | |||
861 | config SENSORS_LIS3LV02D | 871 | config SENSORS_LIS3LV02D |
862 | tristate "STMicroeletronics LIS3LV02Dx three-axis digital accelerometer" | 872 | tristate "STMicroeletronics LIS3LV02Dx three-axis digital accelerometer" |
863 | depends on ACPI && INPUT | 873 | depends on ACPI && INPUT |
874 | select NEW_LEDS | ||
875 | select LEDS_CLASS | ||
864 | default n | 876 | default n |
865 | help | 877 | help |
866 | This driver provides support for the LIS3LV02Dx accelerometer. In | 878 | This driver provides support for the LIS3LV02Dx accelerometer. In |
@@ -872,10 +884,16 @@ config SENSORS_LIS3LV02D | |||
872 | /sys/devices/platform/lis3lv02d. | 884 | /sys/devices/platform/lis3lv02d. |
873 | 885 | ||
874 | This driver also provides an absolute input class device, allowing | 886 | This driver also provides an absolute input class device, allowing |
875 | the laptop to act as a pinball machine-esque joystick. | 887 | the laptop to act as a pinball machine-esque joystick. On HP laptops, |
888 | if the led infrastructure is activated, support for a led indicating | ||
889 | disk protection will be provided as hp:red:hddprotection. | ||
876 | 890 | ||
877 | This driver can also be built as a module. If so, the module | 891 | This driver can also be built as modules. If so, the core module |
878 | will be called lis3lv02d. | 892 | will be called lis3lv02d and a specific module for HP laptops will be |
893 | called hp_accel. | ||
894 | |||
895 | Say Y here if you have an applicable laptop and want to experience | ||
896 | the awesome power of lis3lv02d. | ||
879 | 897 | ||
880 | config SENSORS_APPLESMC | 898 | config SENSORS_APPLESMC |
881 | tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" | 899 | tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" |
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index 19cb1ace3eb4..2e80f37f39eb 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile | |||
@@ -28,6 +28,8 @@ obj-$(CONFIG_SENSORS_ADS7828) += ads7828.o | |||
28 | obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o | 28 | obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o |
29 | obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o | 29 | obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o |
30 | obj-$(CONFIG_SENSORS_ADT7473) += adt7473.o | 30 | obj-$(CONFIG_SENSORS_ADT7473) += adt7473.o |
31 | obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o | ||
32 | |||
31 | obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o | 33 | obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o |
32 | obj-$(CONFIG_SENSORS_AMS) += ams/ | 34 | obj-$(CONFIG_SENSORS_AMS) += ams/ |
33 | obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o | 35 | obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o |
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c index 70bb854086df..e52b38806d03 100644 --- a/drivers/hwmon/abituguru3.c +++ b/drivers/hwmon/abituguru3.c | |||
@@ -279,7 +279,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
279 | { "OTES1 Fan", 36, 2, 60, 1, 0 }, | 279 | { "OTES1 Fan", 36, 2, 60, 1, 0 }, |
280 | { NULL, 0, 0, 0, 0, 0 } } | 280 | { NULL, 0, 0, 0, 0, 0 } } |
281 | }, | 281 | }, |
282 | { 0x0011, "AT8 32X(ATI RD580-ULI M1575)", { | 282 | { 0x0011, "AT8 32X", { |
283 | { "CPU Core", 0, 0, 10, 1, 0 }, | 283 | { "CPU Core", 0, 0, 10, 1, 0 }, |
284 | { "DDR", 1, 0, 20, 1, 0 }, | 284 | { "DDR", 1, 0, 20, 1, 0 }, |
285 | { "DDR VTT", 2, 0, 10, 1, 0 }, | 285 | { "DDR VTT", 2, 0, 10, 1, 0 }, |
@@ -402,7 +402,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
402 | { "AUX3 Fan", 36, 2, 60, 1, 0 }, | 402 | { "AUX3 Fan", 36, 2, 60, 1, 0 }, |
403 | { NULL, 0, 0, 0, 0, 0 } } | 403 | { NULL, 0, 0, 0, 0, 0 } } |
404 | }, | 404 | }, |
405 | { 0x0016, "AW9D-MAX (Intel i975-ICH7)", { | 405 | { 0x0016, "AW9D-MAX", { |
406 | { "CPU Core", 0, 0, 10, 1, 0 }, | 406 | { "CPU Core", 0, 0, 10, 1, 0 }, |
407 | { "DDR2", 1, 0, 20, 1, 0 }, | 407 | { "DDR2", 1, 0, 20, 1, 0 }, |
408 | { "DDR2 VTT", 2, 0, 10, 1, 0 }, | 408 | { "DDR2 VTT", 2, 0, 10, 1, 0 }, |
@@ -482,7 +482,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
482 | { "AUX3 Fan", 36, 2, 60, 1, 0 }, | 482 | { "AUX3 Fan", 36, 2, 60, 1, 0 }, |
483 | { NULL, 0, 0, 0, 0, 0 } } | 483 | { NULL, 0, 0, 0, 0, 0 } } |
484 | }, | 484 | }, |
485 | { 0x0019, NULL /* Unknown, need DMI string */, { | 485 | { 0x0019, "IN9 32X MAX", { |
486 | { "CPU Core", 7, 0, 10, 1, 0 }, | 486 | { "CPU Core", 7, 0, 10, 1, 0 }, |
487 | { "DDR2", 13, 0, 20, 1, 0 }, | 487 | { "DDR2", 13, 0, 20, 1, 0 }, |
488 | { "DDR2 VTT", 14, 0, 10, 1, 0 }, | 488 | { "DDR2 VTT", 14, 0, 10, 1, 0 }, |
@@ -509,7 +509,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
509 | { "AUX3 FAN", 36, 2, 60, 1, 0 }, | 509 | { "AUX3 FAN", 36, 2, 60, 1, 0 }, |
510 | { NULL, 0, 0, 0, 0, 0 } } | 510 | { NULL, 0, 0, 0, 0, 0 } } |
511 | }, | 511 | }, |
512 | { 0x001A, "IP35 Pro(Intel P35-ICH9R)", { | 512 | { 0x001A, "IP35 Pro", { |
513 | { "CPU Core", 0, 0, 10, 1, 0 }, | 513 | { "CPU Core", 0, 0, 10, 1, 0 }, |
514 | { "DDR2", 1, 0, 20, 1, 0 }, | 514 | { "DDR2", 1, 0, 20, 1, 0 }, |
515 | { "DDR2 VTT", 2, 0, 10, 1, 0 }, | 515 | { "DDR2 VTT", 2, 0, 10, 1, 0 }, |
@@ -1128,6 +1128,7 @@ static int __init abituguru3_dmi_detect(void) | |||
1128 | { | 1128 | { |
1129 | const char *board_vendor, *board_name; | 1129 | const char *board_vendor, *board_name; |
1130 | int i, err = (force) ? 1 : -ENODEV; | 1130 | int i, err = (force) ? 1 : -ENODEV; |
1131 | size_t sublen; | ||
1131 | 1132 | ||
1132 | board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | 1133 | board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); |
1133 | if (!board_vendor || strcmp(board_vendor, "http://www.abit.com.tw/")) | 1134 | if (!board_vendor || strcmp(board_vendor, "http://www.abit.com.tw/")) |
@@ -1137,9 +1138,20 @@ static int __init abituguru3_dmi_detect(void) | |||
1137 | if (!board_name) | 1138 | if (!board_name) |
1138 | return err; | 1139 | return err; |
1139 | 1140 | ||
1141 | /* At the moment, we don't care about the part of the vendor | ||
1142 | * DMI string contained in brackets. Truncate the string at | ||
1143 | * the first occurrence of a bracket. Trim any trailing space | ||
1144 | * from the substring. | ||
1145 | */ | ||
1146 | sublen = strcspn(board_name, "("); | ||
1147 | while (sublen > 0 && board_name[sublen - 1] == ' ') | ||
1148 | sublen--; | ||
1149 | |||
1140 | for (i = 0; abituguru3_motherboards[i].id; i++) { | 1150 | for (i = 0; abituguru3_motherboards[i].id; i++) { |
1141 | const char *dmi_name = abituguru3_motherboards[i].dmi_name; | 1151 | const char *dmi_name = abituguru3_motherboards[i].dmi_name; |
1142 | if (dmi_name && !strcmp(dmi_name, board_name)) | 1152 | if (!dmi_name || strlen(dmi_name) != sublen) |
1153 | continue; | ||
1154 | if (!strncasecmp(board_name, dmi_name, sublen)) | ||
1143 | break; | 1155 | break; |
1144 | } | 1156 | } |
1145 | 1157 | ||
@@ -1153,7 +1165,7 @@ static int __init abituguru3_dmi_detect(void) | |||
1153 | 1165 | ||
1154 | static inline int abituguru3_dmi_detect(void) | 1166 | static inline int abituguru3_dmi_detect(void) |
1155 | { | 1167 | { |
1156 | return -ENODEV; | 1168 | return 1; |
1157 | } | 1169 | } |
1158 | 1170 | ||
1159 | #endif /* CONFIG_DMI */ | 1171 | #endif /* CONFIG_DMI */ |
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c new file mode 100644 index 000000000000..d39877a7da63 --- /dev/null +++ b/drivers/hwmon/adt7475.c | |||
@@ -0,0 +1,1221 @@ | |||
1 | /* | ||
2 | * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives | ||
3 | * Copyright (C) 2007-2008, Advanced Micro Devices, Inc. | ||
4 | * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> | ||
5 | * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com> | ||
6 | |||
7 | * Derived from the lm83 driver by Jean Delvare | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/slab.h> | ||
17 | #include <linux/i2c.h> | ||
18 | #include <linux/hwmon.h> | ||
19 | #include <linux/hwmon-sysfs.h> | ||
20 | #include <linux/err.h> | ||
21 | |||
22 | /* Indexes for the sysfs hooks */ | ||
23 | |||
24 | #define INPUT 0 | ||
25 | #define MIN 1 | ||
26 | #define MAX 2 | ||
27 | #define CONTROL 3 | ||
28 | #define OFFSET 3 | ||
29 | #define AUTOMIN 4 | ||
30 | #define THERM 5 | ||
31 | #define HYSTERSIS 6 | ||
32 | |||
33 | /* These are unique identifiers for the sysfs functions - unlike the | ||
34 | numbers above, these are not also indexes into an array | ||
35 | */ | ||
36 | |||
37 | #define ALARM 9 | ||
38 | #define FAULT 10 | ||
39 | |||
40 | /* 7475 Common Registers */ | ||
41 | |||
42 | #define REG_VOLTAGE_BASE 0x21 | ||
43 | #define REG_TEMP_BASE 0x25 | ||
44 | #define REG_TACH_BASE 0x28 | ||
45 | #define REG_PWM_BASE 0x30 | ||
46 | #define REG_PWM_MAX_BASE 0x38 | ||
47 | |||
48 | #define REG_DEVID 0x3D | ||
49 | #define REG_VENDID 0x3E | ||
50 | |||
51 | #define REG_STATUS1 0x41 | ||
52 | #define REG_STATUS2 0x42 | ||
53 | |||
54 | #define REG_VOLTAGE_MIN_BASE 0x46 | ||
55 | #define REG_VOLTAGE_MAX_BASE 0x47 | ||
56 | |||
57 | #define REG_TEMP_MIN_BASE 0x4E | ||
58 | #define REG_TEMP_MAX_BASE 0x4F | ||
59 | |||
60 | #define REG_TACH_MIN_BASE 0x54 | ||
61 | |||
62 | #define REG_PWM_CONFIG_BASE 0x5C | ||
63 | |||
64 | #define REG_TEMP_TRANGE_BASE 0x5F | ||
65 | |||
66 | #define REG_PWM_MIN_BASE 0x64 | ||
67 | |||
68 | #define REG_TEMP_TMIN_BASE 0x67 | ||
69 | #define REG_TEMP_THERM_BASE 0x6A | ||
70 | |||
71 | #define REG_REMOTE1_HYSTERSIS 0x6D | ||
72 | #define REG_REMOTE2_HYSTERSIS 0x6E | ||
73 | |||
74 | #define REG_TEMP_OFFSET_BASE 0x70 | ||
75 | |||
76 | #define REG_EXTEND1 0x76 | ||
77 | #define REG_EXTEND2 0x77 | ||
78 | #define REG_CONFIG5 0x7C | ||
79 | |||
80 | #define CONFIG5_TWOSCOMP 0x01 | ||
81 | #define CONFIG5_TEMPOFFSET 0x02 | ||
82 | |||
83 | /* ADT7475 Settings */ | ||
84 | |||
85 | #define ADT7475_VOLTAGE_COUNT 2 | ||
86 | #define ADT7475_TEMP_COUNT 3 | ||
87 | #define ADT7475_TACH_COUNT 4 | ||
88 | #define ADT7475_PWM_COUNT 3 | ||
89 | |||
90 | /* Macro to read the registers */ | ||
91 | |||
92 | #define adt7475_read(reg) i2c_smbus_read_byte_data(client, (reg)) | ||
93 | |||
94 | /* Macros to easily index the registers */ | ||
95 | |||
96 | #define TACH_REG(idx) (REG_TACH_BASE + ((idx) * 2)) | ||
97 | #define TACH_MIN_REG(idx) (REG_TACH_MIN_BASE + ((idx) * 2)) | ||
98 | |||
99 | #define PWM_REG(idx) (REG_PWM_BASE + (idx)) | ||
100 | #define PWM_MAX_REG(idx) (REG_PWM_MAX_BASE + (idx)) | ||
101 | #define PWM_MIN_REG(idx) (REG_PWM_MIN_BASE + (idx)) | ||
102 | #define PWM_CONFIG_REG(idx) (REG_PWM_CONFIG_BASE + (idx)) | ||
103 | |||
104 | #define VOLTAGE_REG(idx) (REG_VOLTAGE_BASE + (idx)) | ||
105 | #define VOLTAGE_MIN_REG(idx) (REG_VOLTAGE_MIN_BASE + ((idx) * 2)) | ||
106 | #define VOLTAGE_MAX_REG(idx) (REG_VOLTAGE_MAX_BASE + ((idx) * 2)) | ||
107 | |||
108 | #define TEMP_REG(idx) (REG_TEMP_BASE + (idx)) | ||
109 | #define TEMP_MIN_REG(idx) (REG_TEMP_MIN_BASE + ((idx) * 2)) | ||
110 | #define TEMP_MAX_REG(idx) (REG_TEMP_MAX_BASE + ((idx) * 2)) | ||
111 | #define TEMP_TMIN_REG(idx) (REG_TEMP_TMIN_BASE + (idx)) | ||
112 | #define TEMP_THERM_REG(idx) (REG_TEMP_THERM_BASE + (idx)) | ||
113 | #define TEMP_OFFSET_REG(idx) (REG_TEMP_OFFSET_BASE + (idx)) | ||
114 | #define TEMP_TRANGE_REG(idx) (REG_TEMP_TRANGE_BASE + (idx)) | ||
115 | |||
116 | static unsigned short normal_i2c[] = { 0x2e, I2C_CLIENT_END }; | ||
117 | |||
118 | I2C_CLIENT_INSMOD_1(adt7475); | ||
119 | |||
120 | static const struct i2c_device_id adt7475_id[] = { | ||
121 | { "adt7475", adt7475 }, | ||
122 | { } | ||
123 | }; | ||
124 | MODULE_DEVICE_TABLE(i2c, adt7475_id); | ||
125 | |||
126 | struct adt7475_data { | ||
127 | struct device *hwmon_dev; | ||
128 | struct mutex lock; | ||
129 | |||
130 | unsigned long measure_updated; | ||
131 | unsigned long limits_updated; | ||
132 | char valid; | ||
133 | |||
134 | u8 config5; | ||
135 | u16 alarms; | ||
136 | u16 voltage[3][3]; | ||
137 | u16 temp[7][3]; | ||
138 | u16 tach[2][4]; | ||
139 | u8 pwm[4][3]; | ||
140 | u8 range[3]; | ||
141 | u8 pwmctl[3]; | ||
142 | u8 pwmchan[3]; | ||
143 | }; | ||
144 | |||
145 | static struct i2c_driver adt7475_driver; | ||
146 | static struct adt7475_data *adt7475_update_device(struct device *dev); | ||
147 | static void adt7475_read_hystersis(struct i2c_client *client); | ||
148 | static void adt7475_read_pwm(struct i2c_client *client, int index); | ||
149 | |||
150 | /* Given a temp value, convert it to register value */ | ||
151 | |||
152 | static inline u16 temp2reg(struct adt7475_data *data, long val) | ||
153 | { | ||
154 | u16 ret; | ||
155 | |||
156 | if (!(data->config5 & CONFIG5_TWOSCOMP)) { | ||
157 | val = SENSORS_LIMIT(val, -64000, 191000); | ||
158 | ret = (val + 64500) / 1000; | ||
159 | } else { | ||
160 | val = SENSORS_LIMIT(val, -128000, 127000); | ||
161 | if (val < -500) | ||
162 | ret = (256500 + val) / 1000; | ||
163 | else | ||
164 | ret = (val + 500) / 1000; | ||
165 | } | ||
166 | |||
167 | return ret << 2; | ||
168 | } | ||
169 | |||
170 | /* Given a register value, convert it to a real temp value */ | ||
171 | |||
172 | static inline int reg2temp(struct adt7475_data *data, u16 reg) | ||
173 | { | ||
174 | if (data->config5 & CONFIG5_TWOSCOMP) { | ||
175 | if (reg >= 512) | ||
176 | return (reg - 1024) * 250; | ||
177 | else | ||
178 | return reg * 250; | ||
179 | } else | ||
180 | return (reg - 256) * 250; | ||
181 | } | ||
182 | |||
183 | static inline int tach2rpm(u16 tach) | ||
184 | { | ||
185 | if (tach == 0 || tach == 0xFFFF) | ||
186 | return 0; | ||
187 | |||
188 | return (90000 * 60) / tach; | ||
189 | } | ||
190 | |||
191 | static inline u16 rpm2tach(unsigned long rpm) | ||
192 | { | ||
193 | if (rpm == 0) | ||
194 | return 0; | ||
195 | |||
196 | return SENSORS_LIMIT((90000 * 60) / rpm, 1, 0xFFFF); | ||
197 | } | ||
198 | |||
199 | static inline int reg2vcc(u16 reg) | ||
200 | { | ||
201 | return (4296 * reg) / 1000; | ||
202 | } | ||
203 | |||
204 | static inline int reg2vccp(u16 reg) | ||
205 | { | ||
206 | return (2929 * reg) / 1000; | ||
207 | } | ||
208 | |||
209 | static inline u16 vcc2reg(long vcc) | ||
210 | { | ||
211 | vcc = SENSORS_LIMIT(vcc, 0, 4396); | ||
212 | return (vcc * 1000) / 4296; | ||
213 | } | ||
214 | |||
215 | static inline u16 vccp2reg(long vcc) | ||
216 | { | ||
217 | vcc = SENSORS_LIMIT(vcc, 0, 2998); | ||
218 | return (vcc * 1000) / 2929; | ||
219 | } | ||
220 | |||
221 | static u16 adt7475_read_word(struct i2c_client *client, int reg) | ||
222 | { | ||
223 | u16 val; | ||
224 | |||
225 | val = i2c_smbus_read_byte_data(client, reg); | ||
226 | val |= (i2c_smbus_read_byte_data(client, reg + 1) << 8); | ||
227 | |||
228 | return val; | ||
229 | } | ||
230 | |||
231 | static void adt7475_write_word(struct i2c_client *client, int reg, u16 val) | ||
232 | { | ||
233 | i2c_smbus_write_byte_data(client, reg + 1, val >> 8); | ||
234 | i2c_smbus_write_byte_data(client, reg, val & 0xFF); | ||
235 | } | ||
236 | |||
237 | /* Find the nearest value in a table - used for pwm frequency and | ||
238 | auto temp range */ | ||
239 | static int find_nearest(long val, const int *array, int size) | ||
240 | { | ||
241 | int i; | ||
242 | |||
243 | if (val < array[0]) | ||
244 | return 0; | ||
245 | |||
246 | if (val > array[size - 1]) | ||
247 | return size - 1; | ||
248 | |||
249 | for (i = 0; i < size - 1; i++) { | ||
250 | int a, b; | ||
251 | |||
252 | if (val > array[i + 1]) | ||
253 | continue; | ||
254 | |||
255 | a = val - array[i]; | ||
256 | b = array[i + 1] - val; | ||
257 | |||
258 | return (a <= b) ? i : i + 1; | ||
259 | } | ||
260 | |||
261 | return 0; | ||
262 | } | ||
263 | |||
264 | static ssize_t show_voltage(struct device *dev, struct device_attribute *attr, | ||
265 | char *buf) | ||
266 | { | ||
267 | struct adt7475_data *data = adt7475_update_device(dev); | ||
268 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
269 | unsigned short val; | ||
270 | |||
271 | switch (sattr->nr) { | ||
272 | case ALARM: | ||
273 | return sprintf(buf, "%d\n", | ||
274 | (data->alarms >> (sattr->index + 1)) & 1); | ||
275 | default: | ||
276 | val = data->voltage[sattr->nr][sattr->index]; | ||
277 | return sprintf(buf, "%d\n", | ||
278 | sattr->index == | ||
279 | 0 ? reg2vccp(val) : reg2vcc(val)); | ||
280 | } | ||
281 | } | ||
282 | |||
283 | static ssize_t set_voltage(struct device *dev, struct device_attribute *attr, | ||
284 | const char *buf, size_t count) | ||
285 | { | ||
286 | |||
287 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
288 | struct i2c_client *client = to_i2c_client(dev); | ||
289 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
290 | unsigned char reg; | ||
291 | long val; | ||
292 | |||
293 | if (strict_strtol(buf, 10, &val)) | ||
294 | return -EINVAL; | ||
295 | |||
296 | mutex_lock(&data->lock); | ||
297 | |||
298 | data->voltage[sattr->nr][sattr->index] = | ||
299 | sattr->index ? vcc2reg(val) : vccp2reg(val); | ||
300 | |||
301 | if (sattr->nr == MIN) | ||
302 | reg = VOLTAGE_MIN_REG(sattr->index); | ||
303 | else | ||
304 | reg = VOLTAGE_MAX_REG(sattr->index); | ||
305 | |||
306 | i2c_smbus_write_byte_data(client, reg, | ||
307 | data->voltage[sattr->nr][sattr->index] >> 2); | ||
308 | mutex_unlock(&data->lock); | ||
309 | |||
310 | return count; | ||
311 | } | ||
312 | |||
313 | static ssize_t show_temp(struct device *dev, struct device_attribute *attr, | ||
314 | char *buf) | ||
315 | { | ||
316 | struct adt7475_data *data = adt7475_update_device(dev); | ||
317 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
318 | int out; | ||
319 | |||
320 | switch (sattr->nr) { | ||
321 | case HYSTERSIS: | ||
322 | mutex_lock(&data->lock); | ||
323 | out = data->temp[sattr->nr][sattr->index]; | ||
324 | if (sattr->index != 1) | ||
325 | out = (out >> 4) & 0xF; | ||
326 | else | ||
327 | out = (out & 0xF); | ||
328 | /* Show the value as an absolute number tied to | ||
329 | * THERM */ | ||
330 | out = reg2temp(data, data->temp[THERM][sattr->index]) - | ||
331 | out * 1000; | ||
332 | mutex_unlock(&data->lock); | ||
333 | break; | ||
334 | |||
335 | case OFFSET: | ||
336 | /* Offset is always 2's complement, regardless of the | ||
337 | * setting in CONFIG5 */ | ||
338 | mutex_lock(&data->lock); | ||
339 | out = (s8)data->temp[sattr->nr][sattr->index]; | ||
340 | if (data->config5 & CONFIG5_TEMPOFFSET) | ||
341 | out *= 1000; | ||
342 | else | ||
343 | out *= 500; | ||
344 | mutex_unlock(&data->lock); | ||
345 | break; | ||
346 | |||
347 | case ALARM: | ||
348 | out = (data->alarms >> (sattr->index + 4)) & 1; | ||
349 | break; | ||
350 | |||
351 | case FAULT: | ||
352 | /* Note - only for remote1 and remote2 */ | ||
353 | out = data->alarms & (sattr->index ? 0x8000 : 0x4000); | ||
354 | out = out ? 0 : 1; | ||
355 | break; | ||
356 | |||
357 | default: | ||
358 | /* All other temp values are in the configured format */ | ||
359 | out = reg2temp(data, data->temp[sattr->nr][sattr->index]); | ||
360 | } | ||
361 | |||
362 | return sprintf(buf, "%d\n", out); | ||
363 | } | ||
364 | |||
365 | static ssize_t set_temp(struct device *dev, struct device_attribute *attr, | ||
366 | const char *buf, size_t count) | ||
367 | { | ||
368 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
369 | struct i2c_client *client = to_i2c_client(dev); | ||
370 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
371 | unsigned char reg = 0; | ||
372 | u8 out; | ||
373 | int temp; | ||
374 | long val; | ||
375 | |||
376 | if (strict_strtol(buf, 10, &val)) | ||
377 | return -EINVAL; | ||
378 | |||
379 | mutex_lock(&data->lock); | ||
380 | |||
381 | /* We need the config register in all cases for temp <-> reg conv. */ | ||
382 | data->config5 = adt7475_read(REG_CONFIG5); | ||
383 | |||
384 | switch (sattr->nr) { | ||
385 | case OFFSET: | ||
386 | if (data->config5 & CONFIG5_TEMPOFFSET) { | ||
387 | val = SENSORS_LIMIT(val, -63000, 127000); | ||
388 | out = data->temp[OFFSET][sattr->index] = val / 1000; | ||
389 | } else { | ||
390 | val = SENSORS_LIMIT(val, -63000, 64000); | ||
391 | out = data->temp[OFFSET][sattr->index] = val / 500; | ||
392 | } | ||
393 | break; | ||
394 | |||
395 | case HYSTERSIS: | ||
396 | /* The value will be given as an absolute value, turn it | ||
397 | into an offset based on THERM */ | ||
398 | |||
399 | /* Read fresh THERM and HYSTERSIS values from the chip */ | ||
400 | data->temp[THERM][sattr->index] = | ||
401 | adt7475_read(TEMP_THERM_REG(sattr->index)) << 2; | ||
402 | adt7475_read_hystersis(client); | ||
403 | |||
404 | temp = reg2temp(data, data->temp[THERM][sattr->index]); | ||
405 | val = SENSORS_LIMIT(val, temp - 15000, temp); | ||
406 | val = (temp - val) / 1000; | ||
407 | |||
408 | if (sattr->index != 1) { | ||
409 | data->temp[HYSTERSIS][sattr->index] &= 0xF0; | ||
410 | data->temp[HYSTERSIS][sattr->index] |= (val & 0xF) << 4; | ||
411 | } else { | ||
412 | data->temp[HYSTERSIS][sattr->index] &= 0x0F; | ||
413 | data->temp[HYSTERSIS][sattr->index] |= (val & 0xF); | ||
414 | } | ||
415 | |||
416 | out = data->temp[HYSTERSIS][sattr->index]; | ||
417 | break; | ||
418 | |||
419 | default: | ||
420 | data->temp[sattr->nr][sattr->index] = temp2reg(data, val); | ||
421 | |||
422 | /* We maintain an extra 2 digits of precision for simplicity | ||
423 | * - shift those back off before writing the value */ | ||
424 | out = (u8) (data->temp[sattr->nr][sattr->index] >> 2); | ||
425 | } | ||
426 | |||
427 | switch (sattr->nr) { | ||
428 | case MIN: | ||
429 | reg = TEMP_MIN_REG(sattr->index); | ||
430 | break; | ||
431 | case MAX: | ||
432 | reg = TEMP_MAX_REG(sattr->index); | ||
433 | break; | ||
434 | case OFFSET: | ||
435 | reg = TEMP_OFFSET_REG(sattr->index); | ||
436 | break; | ||
437 | case AUTOMIN: | ||
438 | reg = TEMP_TMIN_REG(sattr->index); | ||
439 | break; | ||
440 | case THERM: | ||
441 | reg = TEMP_THERM_REG(sattr->index); | ||
442 | break; | ||
443 | case HYSTERSIS: | ||
444 | if (sattr->index != 2) | ||
445 | reg = REG_REMOTE1_HYSTERSIS; | ||
446 | else | ||
447 | reg = REG_REMOTE2_HYSTERSIS; | ||
448 | |||
449 | break; | ||
450 | } | ||
451 | |||
452 | i2c_smbus_write_byte_data(client, reg, out); | ||
453 | |||
454 | mutex_unlock(&data->lock); | ||
455 | return count; | ||
456 | } | ||
457 | |||
458 | /* Table of autorange values - the user will write the value in millidegrees, | ||
459 | and we'll convert it */ | ||
460 | static const int autorange_table[] = { | ||
461 | 2000, 2500, 3330, 4000, 5000, 6670, 8000, | ||
462 | 10000, 13330, 16000, 20000, 26670, 32000, 40000, | ||
463 | 53330, 80000 | ||
464 | }; | ||
465 | |||
466 | static ssize_t show_point2(struct device *dev, struct device_attribute *attr, | ||
467 | char *buf) | ||
468 | { | ||
469 | struct adt7475_data *data = adt7475_update_device(dev); | ||
470 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
471 | int out, val; | ||
472 | |||
473 | mutex_lock(&data->lock); | ||
474 | out = (data->range[sattr->index] >> 4) & 0x0F; | ||
475 | val = reg2temp(data, data->temp[AUTOMIN][sattr->index]); | ||
476 | mutex_unlock(&data->lock); | ||
477 | |||
478 | return sprintf(buf, "%d\n", val + autorange_table[out]); | ||
479 | } | ||
480 | |||
481 | static ssize_t set_point2(struct device *dev, struct device_attribute *attr, | ||
482 | const char *buf, size_t count) | ||
483 | { | ||
484 | struct i2c_client *client = to_i2c_client(dev); | ||
485 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
486 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
487 | int temp; | ||
488 | long val; | ||
489 | |||
490 | if (strict_strtol(buf, 10, &val)) | ||
491 | return -EINVAL; | ||
492 | |||
493 | mutex_lock(&data->lock); | ||
494 | |||
495 | /* Get a fresh copy of the needed registers */ | ||
496 | data->config5 = adt7475_read(REG_CONFIG5); | ||
497 | data->temp[AUTOMIN][sattr->index] = | ||
498 | adt7475_read(TEMP_TMIN_REG(sattr->index)) << 2; | ||
499 | data->range[sattr->index] = | ||
500 | adt7475_read(TEMP_TRANGE_REG(sattr->index)); | ||
501 | |||
502 | /* The user will write an absolute value, so subtract the start point | ||
503 | to figure the range */ | ||
504 | temp = reg2temp(data, data->temp[AUTOMIN][sattr->index]); | ||
505 | val = SENSORS_LIMIT(val, temp + autorange_table[0], | ||
506 | temp + autorange_table[ARRAY_SIZE(autorange_table) - 1]); | ||
507 | val -= temp; | ||
508 | |||
509 | /* Find the nearest table entry to what the user wrote */ | ||
510 | val = find_nearest(val, autorange_table, ARRAY_SIZE(autorange_table)); | ||
511 | |||
512 | data->range[sattr->index] &= ~0xF0; | ||
513 | data->range[sattr->index] |= val << 4; | ||
514 | |||
515 | i2c_smbus_write_byte_data(client, TEMP_TRANGE_REG(sattr->index), | ||
516 | data->range[sattr->index]); | ||
517 | |||
518 | mutex_unlock(&data->lock); | ||
519 | return count; | ||
520 | } | ||
521 | |||
522 | static ssize_t show_tach(struct device *dev, struct device_attribute *attr, | ||
523 | char *buf) | ||
524 | { | ||
525 | struct adt7475_data *data = adt7475_update_device(dev); | ||
526 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
527 | int out; | ||
528 | |||
529 | if (sattr->nr == ALARM) | ||
530 | out = (data->alarms >> (sattr->index + 10)) & 1; | ||
531 | else | ||
532 | out = tach2rpm(data->tach[sattr->nr][sattr->index]); | ||
533 | |||
534 | return sprintf(buf, "%d\n", out); | ||
535 | } | ||
536 | |||
537 | static ssize_t set_tach(struct device *dev, struct device_attribute *attr, | ||
538 | const char *buf, size_t count) | ||
539 | { | ||
540 | |||
541 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
542 | struct i2c_client *client = to_i2c_client(dev); | ||
543 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
544 | unsigned long val; | ||
545 | |||
546 | if (strict_strtoul(buf, 10, &val)) | ||
547 | return -EINVAL; | ||
548 | |||
549 | mutex_lock(&data->lock); | ||
550 | |||
551 | data->tach[MIN][sattr->index] = rpm2tach(val); | ||
552 | |||
553 | adt7475_write_word(client, TACH_MIN_REG(sattr->index), | ||
554 | data->tach[MIN][sattr->index]); | ||
555 | |||
556 | mutex_unlock(&data->lock); | ||
557 | return count; | ||
558 | } | ||
559 | |||
560 | static ssize_t show_pwm(struct device *dev, struct device_attribute *attr, | ||
561 | char *buf) | ||
562 | { | ||
563 | struct adt7475_data *data = adt7475_update_device(dev); | ||
564 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
565 | |||
566 | return sprintf(buf, "%d\n", data->pwm[sattr->nr][sattr->index]); | ||
567 | } | ||
568 | |||
569 | static ssize_t show_pwmchan(struct device *dev, struct device_attribute *attr, | ||
570 | char *buf) | ||
571 | { | ||
572 | struct adt7475_data *data = adt7475_update_device(dev); | ||
573 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
574 | |||
575 | return sprintf(buf, "%d\n", data->pwmchan[sattr->index]); | ||
576 | } | ||
577 | |||
578 | static ssize_t show_pwmctrl(struct device *dev, struct device_attribute *attr, | ||
579 | char *buf) | ||
580 | { | ||
581 | struct adt7475_data *data = adt7475_update_device(dev); | ||
582 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
583 | |||
584 | return sprintf(buf, "%d\n", data->pwmctl[sattr->index]); | ||
585 | } | ||
586 | |||
587 | static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, | ||
588 | const char *buf, size_t count) | ||
589 | { | ||
590 | |||
591 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
592 | struct i2c_client *client = to_i2c_client(dev); | ||
593 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
594 | unsigned char reg = 0; | ||
595 | long val; | ||
596 | |||
597 | if (strict_strtol(buf, 10, &val)) | ||
598 | return -EINVAL; | ||
599 | |||
600 | mutex_lock(&data->lock); | ||
601 | |||
602 | switch (sattr->nr) { | ||
603 | case INPUT: | ||
604 | /* Get a fresh value for CONTROL */ | ||
605 | data->pwm[CONTROL][sattr->index] = | ||
606 | adt7475_read(PWM_CONFIG_REG(sattr->index)); | ||
607 | |||
608 | /* If we are not in manual mode, then we shouldn't allow | ||
609 | * the user to set the pwm speed */ | ||
610 | if (((data->pwm[CONTROL][sattr->index] >> 5) & 7) != 7) { | ||
611 | mutex_unlock(&data->lock); | ||
612 | return count; | ||
613 | } | ||
614 | |||
615 | reg = PWM_REG(sattr->index); | ||
616 | break; | ||
617 | |||
618 | case MIN: | ||
619 | reg = PWM_MIN_REG(sattr->index); | ||
620 | break; | ||
621 | |||
622 | case MAX: | ||
623 | reg = PWM_MAX_REG(sattr->index); | ||
624 | break; | ||
625 | } | ||
626 | |||
627 | data->pwm[sattr->nr][sattr->index] = SENSORS_LIMIT(val, 0, 0xFF); | ||
628 | i2c_smbus_write_byte_data(client, reg, | ||
629 | data->pwm[sattr->nr][sattr->index]); | ||
630 | |||
631 | mutex_unlock(&data->lock); | ||
632 | |||
633 | return count; | ||
634 | } | ||
635 | |||
636 | /* Called by set_pwmctrl and set_pwmchan */ | ||
637 | |||
638 | static int hw_set_pwm(struct i2c_client *client, int index, | ||
639 | unsigned int pwmctl, unsigned int pwmchan) | ||
640 | { | ||
641 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
642 | long val = 0; | ||
643 | |||
644 | switch (pwmctl) { | ||
645 | case 0: | ||
646 | val = 0x03; /* Run at full speed */ | ||
647 | break; | ||
648 | case 1: | ||
649 | val = 0x07; /* Manual mode */ | ||
650 | break; | ||
651 | case 2: | ||
652 | switch (pwmchan) { | ||
653 | case 1: | ||
654 | /* Remote1 controls PWM */ | ||
655 | val = 0x00; | ||
656 | break; | ||
657 | case 2: | ||
658 | /* local controls PWM */ | ||
659 | val = 0x01; | ||
660 | break; | ||
661 | case 4: | ||
662 | /* remote2 controls PWM */ | ||
663 | val = 0x02; | ||
664 | break; | ||
665 | case 6: | ||
666 | /* local/remote2 control PWM */ | ||
667 | val = 0x05; | ||
668 | break; | ||
669 | case 7: | ||
670 | /* All three control PWM */ | ||
671 | val = 0x06; | ||
672 | break; | ||
673 | default: | ||
674 | return -EINVAL; | ||
675 | } | ||
676 | break; | ||
677 | default: | ||
678 | return -EINVAL; | ||
679 | } | ||
680 | |||
681 | data->pwmctl[index] = pwmctl; | ||
682 | data->pwmchan[index] = pwmchan; | ||
683 | |||
684 | data->pwm[CONTROL][index] &= ~0xE0; | ||
685 | data->pwm[CONTROL][index] |= (val & 7) << 5; | ||
686 | |||
687 | i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index), | ||
688 | data->pwm[CONTROL][index]); | ||
689 | |||
690 | return 0; | ||
691 | } | ||
692 | |||
693 | static ssize_t set_pwmchan(struct device *dev, struct device_attribute *attr, | ||
694 | const char *buf, size_t count) | ||
695 | { | ||
696 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
697 | struct i2c_client *client = to_i2c_client(dev); | ||
698 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
699 | int r; | ||
700 | long val; | ||
701 | |||
702 | if (strict_strtol(buf, 10, &val)) | ||
703 | return -EINVAL; | ||
704 | |||
705 | mutex_lock(&data->lock); | ||
706 | /* Read Modify Write PWM values */ | ||
707 | adt7475_read_pwm(client, sattr->index); | ||
708 | r = hw_set_pwm(client, sattr->index, data->pwmctl[sattr->index], val); | ||
709 | if (r) | ||
710 | count = r; | ||
711 | mutex_unlock(&data->lock); | ||
712 | |||
713 | return count; | ||
714 | } | ||
715 | |||
716 | static ssize_t set_pwmctrl(struct device *dev, struct device_attribute *attr, | ||
717 | const char *buf, size_t count) | ||
718 | { | ||
719 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
720 | struct i2c_client *client = to_i2c_client(dev); | ||
721 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
722 | int r; | ||
723 | long val; | ||
724 | |||
725 | if (strict_strtol(buf, 10, &val)) | ||
726 | return -EINVAL; | ||
727 | |||
728 | mutex_lock(&data->lock); | ||
729 | /* Read Modify Write PWM values */ | ||
730 | adt7475_read_pwm(client, sattr->index); | ||
731 | r = hw_set_pwm(client, sattr->index, val, data->pwmchan[sattr->index]); | ||
732 | if (r) | ||
733 | count = r; | ||
734 | mutex_unlock(&data->lock); | ||
735 | |||
736 | return count; | ||
737 | } | ||
738 | |||
739 | /* List of frequencies for the PWM */ | ||
740 | static const int pwmfreq_table[] = { | ||
741 | 11, 14, 22, 29, 35, 44, 58, 88 | ||
742 | }; | ||
743 | |||
744 | static ssize_t show_pwmfreq(struct device *dev, struct device_attribute *attr, | ||
745 | char *buf) | ||
746 | { | ||
747 | struct adt7475_data *data = adt7475_update_device(dev); | ||
748 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
749 | |||
750 | return sprintf(buf, "%d\n", | ||
751 | pwmfreq_table[data->range[sattr->index] & 7]); | ||
752 | } | ||
753 | |||
754 | static ssize_t set_pwmfreq(struct device *dev, struct device_attribute *attr, | ||
755 | const char *buf, size_t count) | ||
756 | { | ||
757 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | ||
758 | struct i2c_client *client = to_i2c_client(dev); | ||
759 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
760 | int out; | ||
761 | long val; | ||
762 | |||
763 | if (strict_strtol(buf, 10, &val)) | ||
764 | return -EINVAL; | ||
765 | |||
766 | out = find_nearest(val, pwmfreq_table, ARRAY_SIZE(pwmfreq_table)); | ||
767 | |||
768 | mutex_lock(&data->lock); | ||
769 | |||
770 | data->range[sattr->index] = | ||
771 | adt7475_read(TEMP_TRANGE_REG(sattr->index)); | ||
772 | data->range[sattr->index] &= ~7; | ||
773 | data->range[sattr->index] |= out; | ||
774 | |||
775 | i2c_smbus_write_byte_data(client, TEMP_TRANGE_REG(sattr->index), | ||
776 | data->range[sattr->index]); | ||
777 | |||
778 | mutex_unlock(&data->lock); | ||
779 | return count; | ||
780 | } | ||
781 | |||
782 | static SENSOR_DEVICE_ATTR_2(in1_input, S_IRUGO, show_voltage, NULL, INPUT, 0); | ||
783 | static SENSOR_DEVICE_ATTR_2(in1_max, S_IRUGO | S_IWUSR, show_voltage, | ||
784 | set_voltage, MAX, 0); | ||
785 | static SENSOR_DEVICE_ATTR_2(in1_min, S_IRUGO | S_IWUSR, show_voltage, | ||
786 | set_voltage, MIN, 0); | ||
787 | static SENSOR_DEVICE_ATTR_2(in1_alarm, S_IRUGO, show_voltage, NULL, ALARM, 0); | ||
788 | static SENSOR_DEVICE_ATTR_2(in2_input, S_IRUGO, show_voltage, NULL, INPUT, 1); | ||
789 | static SENSOR_DEVICE_ATTR_2(in2_max, S_IRUGO | S_IWUSR, show_voltage, | ||
790 | set_voltage, MAX, 1); | ||
791 | static SENSOR_DEVICE_ATTR_2(in2_min, S_IRUGO | S_IWUSR, show_voltage, | ||
792 | set_voltage, MIN, 1); | ||
793 | static SENSOR_DEVICE_ATTR_2(in2_alarm, S_IRUGO, show_voltage, NULL, ALARM, 1); | ||
794 | static SENSOR_DEVICE_ATTR_2(temp1_input, S_IRUGO, show_temp, NULL, INPUT, 0); | ||
795 | static SENSOR_DEVICE_ATTR_2(temp1_alarm, S_IRUGO, show_temp, NULL, ALARM, 0); | ||
796 | static SENSOR_DEVICE_ATTR_2(temp1_fault, S_IRUGO, show_temp, NULL, FAULT, 0); | ||
797 | static SENSOR_DEVICE_ATTR_2(temp1_max, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
798 | MAX, 0); | ||
799 | static SENSOR_DEVICE_ATTR_2(temp1_min, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
800 | MIN, 0); | ||
801 | static SENSOR_DEVICE_ATTR_2(temp1_offset, S_IRUGO | S_IWUSR, show_temp, | ||
802 | set_temp, OFFSET, 0); | ||
803 | static SENSOR_DEVICE_ATTR_2(temp1_auto_point1_temp, S_IRUGO | S_IWUSR, | ||
804 | show_temp, set_temp, AUTOMIN, 0); | ||
805 | static SENSOR_DEVICE_ATTR_2(temp1_auto_point2_temp, S_IRUGO | S_IWUSR, | ||
806 | show_point2, set_point2, 0, 0); | ||
807 | static SENSOR_DEVICE_ATTR_2(temp1_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
808 | THERM, 0); | ||
809 | static SENSOR_DEVICE_ATTR_2(temp1_crit_hyst, S_IRUGO | S_IWUSR, show_temp, | ||
810 | set_temp, HYSTERSIS, 0); | ||
811 | static SENSOR_DEVICE_ATTR_2(temp2_input, S_IRUGO, show_temp, NULL, INPUT, 1); | ||
812 | static SENSOR_DEVICE_ATTR_2(temp2_alarm, S_IRUGO, show_temp, NULL, ALARM, 1); | ||
813 | static SENSOR_DEVICE_ATTR_2(temp2_max, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
814 | MAX, 1); | ||
815 | static SENSOR_DEVICE_ATTR_2(temp2_min, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
816 | MIN, 1); | ||
817 | static SENSOR_DEVICE_ATTR_2(temp2_offset, S_IRUGO | S_IWUSR, show_temp, | ||
818 | set_temp, OFFSET, 1); | ||
819 | static SENSOR_DEVICE_ATTR_2(temp2_auto_point1_temp, S_IRUGO | S_IWUSR, | ||
820 | show_temp, set_temp, AUTOMIN, 1); | ||
821 | static SENSOR_DEVICE_ATTR_2(temp2_auto_point2_temp, S_IRUGO | S_IWUSR, | ||
822 | show_point2, set_point2, 0, 1); | ||
823 | static SENSOR_DEVICE_ATTR_2(temp2_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
824 | THERM, 1); | ||
825 | static SENSOR_DEVICE_ATTR_2(temp2_crit_hyst, S_IRUGO | S_IWUSR, show_temp, | ||
826 | set_temp, HYSTERSIS, 1); | ||
827 | static SENSOR_DEVICE_ATTR_2(temp3_input, S_IRUGO, show_temp, NULL, INPUT, 2); | ||
828 | static SENSOR_DEVICE_ATTR_2(temp3_alarm, S_IRUGO, show_temp, NULL, ALARM, 2); | ||
829 | static SENSOR_DEVICE_ATTR_2(temp3_fault, S_IRUGO, show_temp, NULL, FAULT, 2); | ||
830 | static SENSOR_DEVICE_ATTR_2(temp3_max, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
831 | MAX, 2); | ||
832 | static SENSOR_DEVICE_ATTR_2(temp3_min, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
833 | MIN, 2); | ||
834 | static SENSOR_DEVICE_ATTR_2(temp3_offset, S_IRUGO | S_IWUSR, show_temp, | ||
835 | set_temp, OFFSET, 2); | ||
836 | static SENSOR_DEVICE_ATTR_2(temp3_auto_point1_temp, S_IRUGO | S_IWUSR, | ||
837 | show_temp, set_temp, AUTOMIN, 2); | ||
838 | static SENSOR_DEVICE_ATTR_2(temp3_auto_point2_temp, S_IRUGO | S_IWUSR, | ||
839 | show_point2, set_point2, 0, 2); | ||
840 | static SENSOR_DEVICE_ATTR_2(temp3_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, | ||
841 | THERM, 2); | ||
842 | static SENSOR_DEVICE_ATTR_2(temp3_crit_hyst, S_IRUGO | S_IWUSR, show_temp, | ||
843 | set_temp, HYSTERSIS, 2); | ||
844 | static SENSOR_DEVICE_ATTR_2(fan1_input, S_IRUGO, show_tach, NULL, INPUT, 0); | ||
845 | static SENSOR_DEVICE_ATTR_2(fan1_min, S_IRUGO | S_IWUSR, show_tach, set_tach, | ||
846 | MIN, 0); | ||
847 | static SENSOR_DEVICE_ATTR_2(fan1_alarm, S_IRUGO, show_tach, NULL, ALARM, 0); | ||
848 | static SENSOR_DEVICE_ATTR_2(fan2_input, S_IRUGO, show_tach, NULL, INPUT, 1); | ||
849 | static SENSOR_DEVICE_ATTR_2(fan2_min, S_IRUGO | S_IWUSR, show_tach, set_tach, | ||
850 | MIN, 1); | ||
851 | static SENSOR_DEVICE_ATTR_2(fan2_alarm, S_IRUGO, show_tach, NULL, ALARM, 1); | ||
852 | static SENSOR_DEVICE_ATTR_2(fan3_input, S_IRUGO, show_tach, NULL, INPUT, 2); | ||
853 | static SENSOR_DEVICE_ATTR_2(fan3_min, S_IRUGO | S_IWUSR, show_tach, set_tach, | ||
854 | MIN, 2); | ||
855 | static SENSOR_DEVICE_ATTR_2(fan3_alarm, S_IRUGO, show_tach, NULL, ALARM, 2); | ||
856 | static SENSOR_DEVICE_ATTR_2(fan4_input, S_IRUGO, show_tach, NULL, INPUT, 3); | ||
857 | static SENSOR_DEVICE_ATTR_2(fan4_min, S_IRUGO | S_IWUSR, show_tach, set_tach, | ||
858 | MIN, 3); | ||
859 | static SENSOR_DEVICE_ATTR_2(fan4_alarm, S_IRUGO, show_tach, NULL, ALARM, 3); | ||
860 | static SENSOR_DEVICE_ATTR_2(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm, INPUT, | ||
861 | 0); | ||
862 | static SENSOR_DEVICE_ATTR_2(pwm1_freq, S_IRUGO | S_IWUSR, show_pwmfreq, | ||
863 | set_pwmfreq, INPUT, 0); | ||
864 | static SENSOR_DEVICE_ATTR_2(pwm1_enable, S_IRUGO | S_IWUSR, show_pwmctrl, | ||
865 | set_pwmctrl, INPUT, 0); | ||
866 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_channel_temp, S_IRUGO | S_IWUSR, | ||
867 | show_pwmchan, set_pwmchan, INPUT, 0); | ||
868 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, | ||
869 | set_pwm, MIN, 0); | ||
870 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_pwm, S_IRUGO | S_IWUSR, show_pwm, | ||
871 | set_pwm, MAX, 0); | ||
872 | static SENSOR_DEVICE_ATTR_2(pwm2, S_IRUGO | S_IWUSR, show_pwm, set_pwm, INPUT, | ||
873 | 1); | ||
874 | static SENSOR_DEVICE_ATTR_2(pwm2_freq, S_IRUGO | S_IWUSR, show_pwmfreq, | ||
875 | set_pwmfreq, INPUT, 1); | ||
876 | static SENSOR_DEVICE_ATTR_2(pwm2_enable, S_IRUGO | S_IWUSR, show_pwmctrl, | ||
877 | set_pwmctrl, INPUT, 1); | ||
878 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_channel_temp, S_IRUGO | S_IWUSR, | ||
879 | show_pwmchan, set_pwmchan, INPUT, 1); | ||
880 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, | ||
881 | set_pwm, MIN, 1); | ||
882 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_pwm, S_IRUGO | S_IWUSR, show_pwm, | ||
883 | set_pwm, MAX, 1); | ||
884 | static SENSOR_DEVICE_ATTR_2(pwm3, S_IRUGO | S_IWUSR, show_pwm, set_pwm, INPUT, | ||
885 | 2); | ||
886 | static SENSOR_DEVICE_ATTR_2(pwm3_freq, S_IRUGO | S_IWUSR, show_pwmfreq, | ||
887 | set_pwmfreq, INPUT, 2); | ||
888 | static SENSOR_DEVICE_ATTR_2(pwm3_enable, S_IRUGO | S_IWUSR, show_pwmctrl, | ||
889 | set_pwmctrl, INPUT, 2); | ||
890 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_channel_temp, S_IRUGO | S_IWUSR, | ||
891 | show_pwmchan, set_pwmchan, INPUT, 2); | ||
892 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, | ||
893 | set_pwm, MIN, 2); | ||
894 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_pwm, S_IRUGO | S_IWUSR, show_pwm, | ||
895 | set_pwm, MAX, 2); | ||
896 | |||
897 | static struct attribute *adt7475_attrs[] = { | ||
898 | &sensor_dev_attr_in1_input.dev_attr.attr, | ||
899 | &sensor_dev_attr_in1_max.dev_attr.attr, | ||
900 | &sensor_dev_attr_in1_min.dev_attr.attr, | ||
901 | &sensor_dev_attr_in1_alarm.dev_attr.attr, | ||
902 | &sensor_dev_attr_in2_input.dev_attr.attr, | ||
903 | &sensor_dev_attr_in2_max.dev_attr.attr, | ||
904 | &sensor_dev_attr_in2_min.dev_attr.attr, | ||
905 | &sensor_dev_attr_in2_alarm.dev_attr.attr, | ||
906 | &sensor_dev_attr_temp1_input.dev_attr.attr, | ||
907 | &sensor_dev_attr_temp1_alarm.dev_attr.attr, | ||
908 | &sensor_dev_attr_temp1_fault.dev_attr.attr, | ||
909 | &sensor_dev_attr_temp1_max.dev_attr.attr, | ||
910 | &sensor_dev_attr_temp1_min.dev_attr.attr, | ||
911 | &sensor_dev_attr_temp1_offset.dev_attr.attr, | ||
912 | &sensor_dev_attr_temp1_auto_point1_temp.dev_attr.attr, | ||
913 | &sensor_dev_attr_temp1_auto_point2_temp.dev_attr.attr, | ||
914 | &sensor_dev_attr_temp1_crit.dev_attr.attr, | ||
915 | &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr, | ||
916 | &sensor_dev_attr_temp2_input.dev_attr.attr, | ||
917 | &sensor_dev_attr_temp2_alarm.dev_attr.attr, | ||
918 | &sensor_dev_attr_temp2_max.dev_attr.attr, | ||
919 | &sensor_dev_attr_temp2_min.dev_attr.attr, | ||
920 | &sensor_dev_attr_temp2_offset.dev_attr.attr, | ||
921 | &sensor_dev_attr_temp2_auto_point1_temp.dev_attr.attr, | ||
922 | &sensor_dev_attr_temp2_auto_point2_temp.dev_attr.attr, | ||
923 | &sensor_dev_attr_temp2_crit.dev_attr.attr, | ||
924 | &sensor_dev_attr_temp2_crit_hyst.dev_attr.attr, | ||
925 | &sensor_dev_attr_temp3_input.dev_attr.attr, | ||
926 | &sensor_dev_attr_temp3_fault.dev_attr.attr, | ||
927 | &sensor_dev_attr_temp3_alarm.dev_attr.attr, | ||
928 | &sensor_dev_attr_temp3_max.dev_attr.attr, | ||
929 | &sensor_dev_attr_temp3_min.dev_attr.attr, | ||
930 | &sensor_dev_attr_temp3_offset.dev_attr.attr, | ||
931 | &sensor_dev_attr_temp3_auto_point1_temp.dev_attr.attr, | ||
932 | &sensor_dev_attr_temp3_auto_point2_temp.dev_attr.attr, | ||
933 | &sensor_dev_attr_temp3_crit.dev_attr.attr, | ||
934 | &sensor_dev_attr_temp3_crit_hyst.dev_attr.attr, | ||
935 | &sensor_dev_attr_fan1_input.dev_attr.attr, | ||
936 | &sensor_dev_attr_fan1_min.dev_attr.attr, | ||
937 | &sensor_dev_attr_fan1_alarm.dev_attr.attr, | ||
938 | &sensor_dev_attr_fan2_input.dev_attr.attr, | ||
939 | &sensor_dev_attr_fan2_min.dev_attr.attr, | ||
940 | &sensor_dev_attr_fan2_alarm.dev_attr.attr, | ||
941 | &sensor_dev_attr_fan3_input.dev_attr.attr, | ||
942 | &sensor_dev_attr_fan3_min.dev_attr.attr, | ||
943 | &sensor_dev_attr_fan3_alarm.dev_attr.attr, | ||
944 | &sensor_dev_attr_fan4_input.dev_attr.attr, | ||
945 | &sensor_dev_attr_fan4_min.dev_attr.attr, | ||
946 | &sensor_dev_attr_fan4_alarm.dev_attr.attr, | ||
947 | &sensor_dev_attr_pwm1.dev_attr.attr, | ||
948 | &sensor_dev_attr_pwm1_freq.dev_attr.attr, | ||
949 | &sensor_dev_attr_pwm1_enable.dev_attr.attr, | ||
950 | &sensor_dev_attr_pwm1_auto_channel_temp.dev_attr.attr, | ||
951 | &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr, | ||
952 | &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr, | ||
953 | &sensor_dev_attr_pwm2.dev_attr.attr, | ||
954 | &sensor_dev_attr_pwm2_freq.dev_attr.attr, | ||
955 | &sensor_dev_attr_pwm2_enable.dev_attr.attr, | ||
956 | &sensor_dev_attr_pwm2_auto_channel_temp.dev_attr.attr, | ||
957 | &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr, | ||
958 | &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr, | ||
959 | &sensor_dev_attr_pwm3.dev_attr.attr, | ||
960 | &sensor_dev_attr_pwm3_freq.dev_attr.attr, | ||
961 | &sensor_dev_attr_pwm3_enable.dev_attr.attr, | ||
962 | &sensor_dev_attr_pwm3_auto_channel_temp.dev_attr.attr, | ||
963 | &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr, | ||
964 | &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr, | ||
965 | NULL, | ||
966 | }; | ||
967 | |||
968 | struct attribute_group adt7475_attr_group = { .attrs = adt7475_attrs }; | ||
969 | |||
970 | static int adt7475_detect(struct i2c_client *client, int kind, | ||
971 | struct i2c_board_info *info) | ||
972 | { | ||
973 | struct i2c_adapter *adapter = client->adapter; | ||
974 | |||
975 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | ||
976 | return -ENODEV; | ||
977 | |||
978 | if (kind <= 0) { | ||
979 | if (adt7475_read(REG_VENDID) != 0x41 || | ||
980 | adt7475_read(REG_DEVID) != 0x75) { | ||
981 | dev_err(&adapter->dev, | ||
982 | "Couldn't detect a adt7475 part at 0x%02x\n", | ||
983 | (unsigned int)client->addr); | ||
984 | return -ENODEV; | ||
985 | } | ||
986 | } | ||
987 | |||
988 | strlcpy(info->type, adt7475_id[0].name, I2C_NAME_SIZE); | ||
989 | |||
990 | return 0; | ||
991 | } | ||
992 | |||
993 | static int adt7475_probe(struct i2c_client *client, | ||
994 | const struct i2c_device_id *id) | ||
995 | { | ||
996 | struct adt7475_data *data; | ||
997 | int i, ret = 0; | ||
998 | |||
999 | data = kzalloc(sizeof(*data), GFP_KERNEL); | ||
1000 | if (data == NULL) | ||
1001 | return -ENOMEM; | ||
1002 | |||
1003 | mutex_init(&data->lock); | ||
1004 | i2c_set_clientdata(client, data); | ||
1005 | |||
1006 | /* Call adt7475_read_pwm for all pwm's as this will reprogram any | ||
1007 | pwm's which are disabled to manual mode with 0% duty cycle */ | ||
1008 | for (i = 0; i < ADT7475_PWM_COUNT; i++) | ||
1009 | adt7475_read_pwm(client, i); | ||
1010 | |||
1011 | ret = sysfs_create_group(&client->dev.kobj, &adt7475_attr_group); | ||
1012 | if (ret) | ||
1013 | goto efree; | ||
1014 | |||
1015 | data->hwmon_dev = hwmon_device_register(&client->dev); | ||
1016 | if (IS_ERR(data->hwmon_dev)) { | ||
1017 | ret = PTR_ERR(data->hwmon_dev); | ||
1018 | goto eremove; | ||
1019 | } | ||
1020 | |||
1021 | return 0; | ||
1022 | |||
1023 | eremove: | ||
1024 | sysfs_remove_group(&client->dev.kobj, &adt7475_attr_group); | ||
1025 | efree: | ||
1026 | kfree(data); | ||
1027 | return ret; | ||
1028 | } | ||
1029 | |||
1030 | static int adt7475_remove(struct i2c_client *client) | ||
1031 | { | ||
1032 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
1033 | |||
1034 | hwmon_device_unregister(data->hwmon_dev); | ||
1035 | sysfs_remove_group(&client->dev.kobj, &adt7475_attr_group); | ||
1036 | kfree(data); | ||
1037 | |||
1038 | return 0; | ||
1039 | } | ||
1040 | |||
1041 | static struct i2c_driver adt7475_driver = { | ||
1042 | .class = I2C_CLASS_HWMON, | ||
1043 | .driver = { | ||
1044 | .name = "adt7475", | ||
1045 | }, | ||
1046 | .probe = adt7475_probe, | ||
1047 | .remove = adt7475_remove, | ||
1048 | .id_table = adt7475_id, | ||
1049 | .detect = adt7475_detect, | ||
1050 | .address_data = &addr_data, | ||
1051 | }; | ||
1052 | |||
1053 | static void adt7475_read_hystersis(struct i2c_client *client) | ||
1054 | { | ||
1055 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
1056 | |||
1057 | data->temp[HYSTERSIS][0] = (u16) adt7475_read(REG_REMOTE1_HYSTERSIS); | ||
1058 | data->temp[HYSTERSIS][1] = data->temp[HYSTERSIS][0]; | ||
1059 | data->temp[HYSTERSIS][2] = (u16) adt7475_read(REG_REMOTE2_HYSTERSIS); | ||
1060 | } | ||
1061 | |||
1062 | static void adt7475_read_pwm(struct i2c_client *client, int index) | ||
1063 | { | ||
1064 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
1065 | unsigned int v; | ||
1066 | |||
1067 | data->pwm[CONTROL][index] = adt7475_read(PWM_CONFIG_REG(index)); | ||
1068 | |||
1069 | /* Figure out the internal value for pwmctrl and pwmchan | ||
1070 | based on the current settings */ | ||
1071 | v = (data->pwm[CONTROL][index] >> 5) & 7; | ||
1072 | |||
1073 | if (v == 3) | ||
1074 | data->pwmctl[index] = 0; | ||
1075 | else if (v == 7) | ||
1076 | data->pwmctl[index] = 1; | ||
1077 | else if (v == 4) { | ||
1078 | /* The fan is disabled - we don't want to | ||
1079 | support that, so change to manual mode and | ||
1080 | set the duty cycle to 0 instead | ||
1081 | */ | ||
1082 | data->pwm[INPUT][index] = 0; | ||
1083 | data->pwm[CONTROL][index] &= ~0xE0; | ||
1084 | data->pwm[CONTROL][index] |= (7 << 5); | ||
1085 | |||
1086 | i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index), | ||
1087 | data->pwm[INPUT][index]); | ||
1088 | |||
1089 | i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index), | ||
1090 | data->pwm[CONTROL][index]); | ||
1091 | |||
1092 | data->pwmctl[index] = 1; | ||
1093 | } else { | ||
1094 | data->pwmctl[index] = 2; | ||
1095 | |||
1096 | switch (v) { | ||
1097 | case 0: | ||
1098 | data->pwmchan[index] = 1; | ||
1099 | break; | ||
1100 | case 1: | ||
1101 | data->pwmchan[index] = 2; | ||
1102 | break; | ||
1103 | case 2: | ||
1104 | data->pwmchan[index] = 4; | ||
1105 | break; | ||
1106 | case 5: | ||
1107 | data->pwmchan[index] = 6; | ||
1108 | break; | ||
1109 | case 6: | ||
1110 | data->pwmchan[index] = 7; | ||
1111 | break; | ||
1112 | } | ||
1113 | } | ||
1114 | } | ||
1115 | |||
1116 | static struct adt7475_data *adt7475_update_device(struct device *dev) | ||
1117 | { | ||
1118 | struct i2c_client *client = to_i2c_client(dev); | ||
1119 | struct adt7475_data *data = i2c_get_clientdata(client); | ||
1120 | u8 ext; | ||
1121 | int i; | ||
1122 | |||
1123 | mutex_lock(&data->lock); | ||
1124 | |||
1125 | /* Measurement values update every 2 seconds */ | ||
1126 | if (time_after(jiffies, data->measure_updated + HZ * 2) || | ||
1127 | !data->valid) { | ||
1128 | data->alarms = adt7475_read(REG_STATUS2) << 8; | ||
1129 | data->alarms |= adt7475_read(REG_STATUS1); | ||
1130 | |||
1131 | ext = adt7475_read(REG_EXTEND1); | ||
1132 | for (i = 0; i < ADT7475_VOLTAGE_COUNT; i++) | ||
1133 | data->voltage[INPUT][i] = | ||
1134 | (adt7475_read(VOLTAGE_REG(i)) << 2) | | ||
1135 | ((ext >> ((i + 1) * 2)) & 3); | ||
1136 | |||
1137 | ext = adt7475_read(REG_EXTEND2); | ||
1138 | for (i = 0; i < ADT7475_TEMP_COUNT; i++) | ||
1139 | data->temp[INPUT][i] = | ||
1140 | (adt7475_read(TEMP_REG(i)) << 2) | | ||
1141 | ((ext >> ((i + 1) * 2)) & 3); | ||
1142 | |||
1143 | for (i = 0; i < ADT7475_TACH_COUNT; i++) | ||
1144 | data->tach[INPUT][i] = | ||
1145 | adt7475_read_word(client, TACH_REG(i)); | ||
1146 | |||
1147 | /* Updated by hw when in auto mode */ | ||
1148 | for (i = 0; i < ADT7475_PWM_COUNT; i++) | ||
1149 | data->pwm[INPUT][i] = adt7475_read(PWM_REG(i)); | ||
1150 | |||
1151 | data->measure_updated = jiffies; | ||
1152 | } | ||
1153 | |||
1154 | /* Limits and settings, should never change update every 60 seconds */ | ||
1155 | if (time_after(jiffies, data->limits_updated + HZ * 2) || | ||
1156 | !data->valid) { | ||
1157 | data->config5 = adt7475_read(REG_CONFIG5); | ||
1158 | |||
1159 | for (i = 0; i < ADT7475_VOLTAGE_COUNT; i++) { | ||
1160 | /* Adjust values so they match the input precision */ | ||
1161 | data->voltage[MIN][i] = | ||
1162 | adt7475_read(VOLTAGE_MIN_REG(i)) << 2; | ||
1163 | data->voltage[MAX][i] = | ||
1164 | adt7475_read(VOLTAGE_MAX_REG(i)) << 2; | ||
1165 | } | ||
1166 | |||
1167 | for (i = 0; i < ADT7475_TEMP_COUNT; i++) { | ||
1168 | /* Adjust values so they match the input precision */ | ||
1169 | data->temp[MIN][i] = | ||
1170 | adt7475_read(TEMP_MIN_REG(i)) << 2; | ||
1171 | data->temp[MAX][i] = | ||
1172 | adt7475_read(TEMP_MAX_REG(i)) << 2; | ||
1173 | data->temp[AUTOMIN][i] = | ||
1174 | adt7475_read(TEMP_TMIN_REG(i)) << 2; | ||
1175 | data->temp[THERM][i] = | ||
1176 | adt7475_read(TEMP_THERM_REG(i)) << 2; | ||
1177 | data->temp[OFFSET][i] = | ||
1178 | adt7475_read(TEMP_OFFSET_REG(i)); | ||
1179 | } | ||
1180 | adt7475_read_hystersis(client); | ||
1181 | |||
1182 | for (i = 0; i < ADT7475_TACH_COUNT; i++) | ||
1183 | data->tach[MIN][i] = | ||
1184 | adt7475_read_word(client, TACH_MIN_REG(i)); | ||
1185 | |||
1186 | for (i = 0; i < ADT7475_PWM_COUNT; i++) { | ||
1187 | data->pwm[MAX][i] = adt7475_read(PWM_MAX_REG(i)); | ||
1188 | data->pwm[MIN][i] = adt7475_read(PWM_MIN_REG(i)); | ||
1189 | /* Set the channel and control information */ | ||
1190 | adt7475_read_pwm(client, i); | ||
1191 | } | ||
1192 | |||
1193 | data->range[0] = adt7475_read(TEMP_TRANGE_REG(0)); | ||
1194 | data->range[1] = adt7475_read(TEMP_TRANGE_REG(1)); | ||
1195 | data->range[2] = adt7475_read(TEMP_TRANGE_REG(2)); | ||
1196 | |||
1197 | data->limits_updated = jiffies; | ||
1198 | data->valid = 1; | ||
1199 | } | ||
1200 | |||
1201 | mutex_unlock(&data->lock); | ||
1202 | |||
1203 | return data; | ||
1204 | } | ||
1205 | |||
1206 | static int __init sensors_adt7475_init(void) | ||
1207 | { | ||
1208 | return i2c_add_driver(&adt7475_driver); | ||
1209 | } | ||
1210 | |||
1211 | static void __exit sensors_adt7475_exit(void) | ||
1212 | { | ||
1213 | i2c_del_driver(&adt7475_driver); | ||
1214 | } | ||
1215 | |||
1216 | MODULE_AUTHOR("Advanced Micro Devices, Inc"); | ||
1217 | MODULE_DESCRIPTION("adt7475 driver"); | ||
1218 | MODULE_LICENSE("GPL"); | ||
1219 | |||
1220 | module_init(sensors_adt7475_init); | ||
1221 | module_exit(sensors_adt7475_exit); | ||
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index dca47a591baf..e30186236588 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -590,6 +590,11 @@ static ssize_t applesmc_light_show(struct device *dev, | |||
590 | } | 590 | } |
591 | 591 | ||
592 | ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length); | 592 | ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length); |
593 | /* newer macbooks report a single 10-bit bigendian value */ | ||
594 | if (data_length == 10) { | ||
595 | left = be16_to_cpu(*(__be16 *)(buffer + 6)) >> 2; | ||
596 | goto out; | ||
597 | } | ||
593 | left = buffer[2]; | 598 | left = buffer[2]; |
594 | if (ret) | 599 | if (ret) |
595 | goto out; | 600 | goto out; |
diff --git a/drivers/hwmon/hp_accel.c b/drivers/hwmon/hp_accel.c index bf8d40580577..03705240000f 100644 --- a/drivers/hwmon/hp_accel.c +++ b/drivers/hwmon/hp_accel.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Yan Burman | 4 | * Copyright (C) 2007-2008 Yan Burman |
5 | * Copyright (C) 2008 Eric Piel | 5 | * Copyright (C) 2008 Eric Piel |
6 | * Copyright (C) 2008 Pavel Machek | 6 | * Copyright (C) 2008-2009 Pavel Machek |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/freezer.h> | 36 | #include <linux/freezer.h> |
37 | #include <linux/version.h> | 37 | #include <linux/version.h> |
38 | #include <linux/uaccess.h> | 38 | #include <linux/uaccess.h> |
39 | #include <linux/leds.h> | ||
39 | #include <acpi/acpi_drivers.h> | 40 | #include <acpi/acpi_drivers.h> |
40 | #include <asm/atomic.h> | 41 | #include <asm/atomic.h> |
41 | #include "lis3lv02d.h" | 42 | #include "lis3lv02d.h" |
@@ -43,6 +44,36 @@ | |||
43 | #define DRIVER_NAME "lis3lv02d" | 44 | #define DRIVER_NAME "lis3lv02d" |
44 | #define ACPI_MDPS_CLASS "accelerometer" | 45 | #define ACPI_MDPS_CLASS "accelerometer" |
45 | 46 | ||
47 | /* Delayed LEDs infrastructure ------------------------------------ */ | ||
48 | |||
49 | /* Special LED class that can defer work */ | ||
50 | struct delayed_led_classdev { | ||
51 | struct led_classdev led_classdev; | ||
52 | struct work_struct work; | ||
53 | enum led_brightness new_brightness; | ||
54 | |||
55 | unsigned int led; /* For driver */ | ||
56 | void (*set_brightness)(struct delayed_led_classdev *data, enum led_brightness value); | ||
57 | }; | ||
58 | |||
59 | static inline void delayed_set_status_worker(struct work_struct *work) | ||
60 | { | ||
61 | struct delayed_led_classdev *data = | ||
62 | container_of(work, struct delayed_led_classdev, work); | ||
63 | |||
64 | data->set_brightness(data, data->new_brightness); | ||
65 | } | ||
66 | |||
67 | static inline void delayed_sysfs_set(struct led_classdev *led_cdev, | ||
68 | enum led_brightness brightness) | ||
69 | { | ||
70 | struct delayed_led_classdev *data = container_of(led_cdev, | ||
71 | struct delayed_led_classdev, led_classdev); | ||
72 | data->new_brightness = brightness; | ||
73 | schedule_work(&data->work); | ||
74 | } | ||
75 | |||
76 | /* HP-specific accelerometer driver ------------------------------------ */ | ||
46 | 77 | ||
47 | /* For automatic insertion of the module */ | 78 | /* For automatic insertion of the module */ |
48 | static struct acpi_device_id lis3lv02d_device_ids[] = { | 79 | static struct acpi_device_id lis3lv02d_device_ids[] = { |
@@ -154,10 +185,33 @@ static struct dmi_system_id lis3lv02d_dmi_ids[] = { | |||
154 | */ | 185 | */ |
155 | }; | 186 | }; |
156 | 187 | ||
188 | static void hpled_set(struct delayed_led_classdev *led_cdev, enum led_brightness value) | ||
189 | { | ||
190 | acpi_handle handle = adev.device->handle; | ||
191 | unsigned long long ret; /* Not used when writing */ | ||
192 | union acpi_object in_obj[1]; | ||
193 | struct acpi_object_list args = { 1, in_obj }; | ||
194 | |||
195 | in_obj[0].type = ACPI_TYPE_INTEGER; | ||
196 | in_obj[0].integer.value = !!value; | ||
197 | |||
198 | acpi_evaluate_integer(handle, "ALED", &args, &ret); | ||
199 | } | ||
200 | |||
201 | static struct delayed_led_classdev hpled_led = { | ||
202 | .led_classdev = { | ||
203 | .name = "hp::hddprotect", | ||
204 | .default_trigger = "none", | ||
205 | .brightness_set = delayed_sysfs_set, | ||
206 | .flags = LED_CORE_SUSPENDRESUME, | ||
207 | }, | ||
208 | .set_brightness = hpled_set, | ||
209 | }; | ||
157 | 210 | ||
158 | static int lis3lv02d_add(struct acpi_device *device) | 211 | static int lis3lv02d_add(struct acpi_device *device) |
159 | { | 212 | { |
160 | u8 val; | 213 | u8 val; |
214 | int ret; | ||
161 | 215 | ||
162 | if (!device) | 216 | if (!device) |
163 | return -EINVAL; | 217 | return -EINVAL; |
@@ -183,7 +237,19 @@ static int lis3lv02d_add(struct acpi_device *device) | |||
183 | adev.ac = lis3lv02d_axis_normal; | 237 | adev.ac = lis3lv02d_axis_normal; |
184 | } | 238 | } |
185 | 239 | ||
186 | return lis3lv02d_init_device(&adev); | 240 | INIT_WORK(&hpled_led.work, delayed_set_status_worker); |
241 | ret = led_classdev_register(NULL, &hpled_led.led_classdev); | ||
242 | if (ret) | ||
243 | return ret; | ||
244 | |||
245 | ret = lis3lv02d_init_device(&adev); | ||
246 | if (ret) { | ||
247 | flush_work(&hpled_led.work); | ||
248 | led_classdev_unregister(&hpled_led.led_classdev); | ||
249 | return ret; | ||
250 | } | ||
251 | |||
252 | return ret; | ||
187 | } | 253 | } |
188 | 254 | ||
189 | static int lis3lv02d_remove(struct acpi_device *device, int type) | 255 | static int lis3lv02d_remove(struct acpi_device *device, int type) |
@@ -194,6 +260,9 @@ static int lis3lv02d_remove(struct acpi_device *device, int type) | |||
194 | lis3lv02d_joystick_disable(); | 260 | lis3lv02d_joystick_disable(); |
195 | lis3lv02d_poweroff(device->handle); | 261 | lis3lv02d_poweroff(device->handle); |
196 | 262 | ||
263 | flush_work(&hpled_led.work); | ||
264 | led_classdev_unregister(&hpled_led.led_classdev); | ||
265 | |||
197 | return lis3lv02d_remove_fs(); | 266 | return lis3lv02d_remove_fs(); |
198 | } | 267 | } |
199 | 268 | ||
@@ -256,7 +325,7 @@ static void __exit lis3lv02d_exit_module(void) | |||
256 | acpi_bus_unregister_driver(&lis3lv02d_driver); | 325 | acpi_bus_unregister_driver(&lis3lv02d_driver); |
257 | } | 326 | } |
258 | 327 | ||
259 | MODULE_DESCRIPTION("Glue between LIS3LV02Dx and HP ACPI BIOS"); | 328 | MODULE_DESCRIPTION("Glue between LIS3LV02Dx and HP ACPI BIOS and support for disk protection LED."); |
260 | MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek"); | 329 | MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek"); |
261 | MODULE_LICENSE("GPL"); | 330 | MODULE_LICENSE("GPL"); |
262 | 331 | ||
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index bd2bde0ef95e..1fe995111841 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/hwmon-sysfs.h> | 31 | #include <linux/hwmon-sysfs.h> |
32 | #include <linux/err.h> | 32 | #include <linux/err.h> |
33 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
34 | #include <asm/processor.h> | ||
34 | 35 | ||
35 | #define TEMP_FROM_REG(val) (((((val) >> 16) & 0xff) - 49) * 1000) | 36 | #define TEMP_FROM_REG(val) (((((val) >> 16) & 0xff) - 49) * 1000) |
36 | #define REG_TEMP 0xe4 | 37 | #define REG_TEMP 0xe4 |
@@ -47,6 +48,8 @@ struct k8temp_data { | |||
47 | /* registers values */ | 48 | /* registers values */ |
48 | u8 sensorsp; /* sensor presence bits - SEL_CORE & SEL_PLACE */ | 49 | u8 sensorsp; /* sensor presence bits - SEL_CORE & SEL_PLACE */ |
49 | u32 temp[2][2]; /* core, place */ | 50 | u32 temp[2][2]; /* core, place */ |
51 | u8 swap_core_select; /* meaning of SEL_CORE is inverted */ | ||
52 | u32 temp_offset; | ||
50 | }; | 53 | }; |
51 | 54 | ||
52 | static struct k8temp_data *k8temp_update_device(struct device *dev) | 55 | static struct k8temp_data *k8temp_update_device(struct device *dev) |
@@ -114,10 +117,15 @@ static ssize_t show_temp(struct device *dev, | |||
114 | to_sensor_dev_attr_2(devattr); | 117 | to_sensor_dev_attr_2(devattr); |
115 | int core = attr->nr; | 118 | int core = attr->nr; |
116 | int place = attr->index; | 119 | int place = attr->index; |
120 | int temp; | ||
117 | struct k8temp_data *data = k8temp_update_device(dev); | 121 | struct k8temp_data *data = k8temp_update_device(dev); |
118 | 122 | ||
119 | return sprintf(buf, "%d\n", | 123 | if (data->swap_core_select) |
120 | TEMP_FROM_REG(data->temp[core][place])); | 124 | core = core ? 0 : 1; |
125 | |||
126 | temp = TEMP_FROM_REG(data->temp[core][place]) + data->temp_offset; | ||
127 | |||
128 | return sprintf(buf, "%d\n", temp); | ||
121 | } | 129 | } |
122 | 130 | ||
123 | /* core, place */ | 131 | /* core, place */ |
@@ -141,20 +149,49 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, | |||
141 | int err; | 149 | int err; |
142 | u8 scfg; | 150 | u8 scfg; |
143 | u32 temp; | 151 | u32 temp; |
152 | u8 model, stepping; | ||
144 | struct k8temp_data *data; | 153 | struct k8temp_data *data; |
145 | u32 cpuid = cpuid_eax(1); | ||
146 | |||
147 | /* this feature should be available since SH-C0 core */ | ||
148 | if ((cpuid == 0xf40) || (cpuid == 0xf50) || (cpuid == 0xf51)) { | ||
149 | err = -ENODEV; | ||
150 | goto exit; | ||
151 | } | ||
152 | 154 | ||
153 | if (!(data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL))) { | 155 | if (!(data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL))) { |
154 | err = -ENOMEM; | 156 | err = -ENOMEM; |
155 | goto exit; | 157 | goto exit; |
156 | } | 158 | } |
157 | 159 | ||
160 | model = boot_cpu_data.x86_model; | ||
161 | stepping = boot_cpu_data.x86_mask; | ||
162 | |||
163 | switch (boot_cpu_data.x86) { | ||
164 | case 0xf: | ||
165 | /* feature available since SH-C0, exclude older revisions */ | ||
166 | if (((model == 4) && (stepping == 0)) || | ||
167 | ((model == 5) && (stepping <= 1))) { | ||
168 | err = -ENODEV; | ||
169 | goto exit_free; | ||
170 | } | ||
171 | |||
172 | /* | ||
173 | * AMD NPT family 0fh, i.e. RevF and RevG: | ||
174 | * meaning of SEL_CORE bit is inverted | ||
175 | */ | ||
176 | if (model >= 0x40) { | ||
177 | data->swap_core_select = 1; | ||
178 | dev_warn(&pdev->dev, "Temperature readouts might be " | ||
179 | "wrong - check erratum #141\n"); | ||
180 | } | ||
181 | |||
182 | if ((model >= 0x69) && | ||
183 | !(model == 0xc1 || model == 0x6c || model == 0x7c)) { | ||
184 | /* | ||
185 | * RevG desktop CPUs (i.e. no socket S1G1 parts) | ||
186 | * need additional offset, otherwise reported | ||
187 | * temperature is below ambient temperature | ||
188 | */ | ||
189 | data->temp_offset = 21000; | ||
190 | } | ||
191 | |||
192 | break; | ||
193 | } | ||
194 | |||
158 | pci_read_config_byte(pdev, REG_TEMP, &scfg); | 195 | pci_read_config_byte(pdev, REG_TEMP, &scfg); |
159 | scfg &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */ | 196 | scfg &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */ |
160 | pci_write_config_byte(pdev, REG_TEMP, scfg); | 197 | pci_write_config_byte(pdev, REG_TEMP, scfg); |
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig index 59c3d23f5bdc..b9bef04b7be4 100644 --- a/drivers/i2c/chips/Kconfig +++ b/drivers/i2c/chips/Kconfig | |||
@@ -139,15 +139,4 @@ config SENSORS_TSL2550 | |||
139 | This driver can also be built as a module. If so, the module | 139 | This driver can also be built as a module. If so, the module |
140 | will be called tsl2550. | 140 | will be called tsl2550. |
141 | 141 | ||
142 | config MCU_MPC8349EMITX | ||
143 | tristate "MPC8349E-mITX MCU driver" | ||
144 | depends on I2C && PPC_83xx | ||
145 | select GENERIC_GPIO | ||
146 | select ARCH_REQUIRE_GPIOLIB | ||
147 | help | ||
148 | Say Y here to enable soft power-off functionality on the Freescale | ||
149 | boards with the MPC8349E-mITX-compatible MCU chips. This driver will | ||
150 | also register MCU GPIOs with the generic GPIO API, so you'll able | ||
151 | to use MCU pins as GPIOs. | ||
152 | |||
153 | endmenu | 142 | endmenu |
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 83accaaf8164..00fcb5193ac2 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile | |||
@@ -19,7 +19,6 @@ obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o | |||
19 | obj-$(CONFIG_PCF8575) += pcf8575.o | 19 | obj-$(CONFIG_PCF8575) += pcf8575.o |
20 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o | 20 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o |
21 | obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o | 21 | obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o |
22 | obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o | ||
23 | 22 | ||
24 | ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) | 23 | ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) |
25 | EXTRA_CFLAGS += -DDEBUG | 24 | EXTRA_CFLAGS += -DDEBUG |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 3f9503867e6b..b1c6f68d98ce 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -701,11 +701,6 @@ config BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | |||
701 | depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX | 701 | depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX |
702 | endchoice | 702 | endchoice |
703 | 703 | ||
704 | config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ | ||
705 | int "Maximum transfer size (KB) per request (up to 128)" | ||
706 | default "128" | ||
707 | depends on BLK_DEV_IDE_AU1XXX | ||
708 | |||
709 | config BLK_DEV_IDE_TX4938 | 704 | config BLK_DEV_IDE_TX4938 |
710 | tristate "TX4938 internal IDE support" | 705 | tristate "TX4938 internal IDE support" |
711 | depends on SOC_TX4938 | 706 | depends on SOC_TX4938 |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 4088a622873e..806760d24cef 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -633,7 +633,7 @@ static void ide_disk_setup(ide_drive_t *drive) | |||
633 | printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name, | 633 | printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name, |
634 | q->max_sectors / 2); | 634 | q->max_sectors / 2); |
635 | 635 | ||
636 | if (ata_id_is_ssd(id) || ata_id_is_cfa(id)) | 636 | if (ata_id_is_ssd(id)) |
637 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); | 637 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); |
638 | 638 | ||
639 | /* calculate drive capacity, and select LBA if possible */ | 639 | /* calculate drive capacity, and select LBA if possible */ |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index e728cfe7273f..753b92ebe0ae 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -493,7 +493,7 @@ static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long ti | |||
493 | stat = tp_ops->read_status(hwif); | 493 | stat = tp_ops->read_status(hwif); |
494 | 494 | ||
495 | if (stat & ATA_BUSY) { | 495 | if (stat & ATA_BUSY) { |
496 | local_irq_save(flags); | 496 | local_save_flags(flags); |
497 | local_irq_enable_in_hardirq(); | 497 | local_irq_enable_in_hardirq(); |
498 | timeout += jiffies; | 498 | timeout += jiffies; |
499 | while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { | 499 | while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { |
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index 4b3bf6a06b70..60538d9c84ee 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c | |||
@@ -186,12 +186,10 @@ void ide_complete_pm_request(ide_drive_t *drive, struct request *rq) | |||
186 | blk_pm_suspend_request(rq) ? "suspend" : "resume"); | 186 | blk_pm_suspend_request(rq) ? "suspend" : "resume"); |
187 | #endif | 187 | #endif |
188 | spin_lock_irqsave(q->queue_lock, flags); | 188 | spin_lock_irqsave(q->queue_lock, flags); |
189 | if (blk_pm_suspend_request(rq)) { | 189 | if (blk_pm_suspend_request(rq)) |
190 | blk_stop_queue(q); | 190 | blk_stop_queue(q); |
191 | } else { | 191 | else |
192 | drive->dev_flags &= ~IDE_DFLAG_BLOCKED; | 192 | drive->dev_flags &= ~IDE_DFLAG_BLOCKED; |
193 | blk_start_queue(q); | ||
194 | } | ||
195 | spin_unlock_irqrestore(q->queue_lock, flags); | 193 | spin_unlock_irqrestore(q->queue_lock, flags); |
196 | 194 | ||
197 | drive->hwif->rq = NULL; | 195 | drive->hwif->rq = NULL; |
@@ -219,6 +217,8 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq) | |||
219 | * point. | 217 | * point. |
220 | */ | 218 | */ |
221 | ide_hwif_t *hwif = drive->hwif; | 219 | ide_hwif_t *hwif = drive->hwif; |
220 | struct request_queue *q = drive->queue; | ||
221 | unsigned long flags; | ||
222 | int rc; | 222 | int rc; |
223 | #ifdef DEBUG_PM | 223 | #ifdef DEBUG_PM |
224 | printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name); | 224 | printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name); |
@@ -231,5 +231,9 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq) | |||
231 | rc = ide_wait_not_busy(hwif, 100000); | 231 | rc = ide_wait_not_busy(hwif, 100000); |
232 | if (rc) | 232 | if (rc) |
233 | printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); | 233 | printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); |
234 | |||
235 | spin_lock_irqsave(q->queue_lock, flags); | ||
236 | blk_start_queue(q); | ||
237 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
234 | } | 238 | } |
235 | } | 239 | } |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 0ccbb4459fb9..312127ea443a 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -796,7 +796,7 @@ static int ide_probe_port(ide_hwif_t *hwif) | |||
796 | if (irqd) | 796 | if (irqd) |
797 | disable_irq(hwif->irq); | 797 | disable_irq(hwif->irq); |
798 | 798 | ||
799 | local_irq_save(flags); | 799 | local_save_flags(flags); |
800 | local_irq_enable_in_hardirq(); | 800 | local_irq_enable_in_hardirq(); |
801 | 801 | ||
802 | if (ide_port_wait_ready(hwif) == -EBUSY) | 802 | if (ide_port_wait_ready(hwif) == -EBUSY) |
diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c index 0be27ac1f077..e1c4f5437396 100644 --- a/drivers/ide/it821x.c +++ b/drivers/ide/it821x.c | |||
@@ -68,6 +68,8 @@ | |||
68 | 68 | ||
69 | #define DRV_NAME "it821x" | 69 | #define DRV_NAME "it821x" |
70 | 70 | ||
71 | #define QUIRK_VORTEX86 1 | ||
72 | |||
71 | struct it821x_dev | 73 | struct it821x_dev |
72 | { | 74 | { |
73 | unsigned int smart:1, /* Are we in smart raid mode */ | 75 | unsigned int smart:1, /* Are we in smart raid mode */ |
@@ -79,6 +81,7 @@ struct it821x_dev | |||
79 | u16 pio[2]; /* Cached PIO values */ | 81 | u16 pio[2]; /* Cached PIO values */ |
80 | u16 mwdma[2]; /* Cached MWDMA values */ | 82 | u16 mwdma[2]; /* Cached MWDMA values */ |
81 | u16 udma[2]; /* Cached UDMA values (per drive) */ | 83 | u16 udma[2]; /* Cached UDMA values (per drive) */ |
84 | u16 quirks; | ||
82 | }; | 85 | }; |
83 | 86 | ||
84 | #define ATA_66 0 | 87 | #define ATA_66 0 |
@@ -557,8 +560,7 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) | |||
557 | * this is necessary. | 560 | * this is necessary. |
558 | */ | 561 | */ |
559 | 562 | ||
560 | pci_read_config_byte(dev, 0x08, &conf); | 563 | if (dev->revision == 0x10) { |
561 | if (conf == 0x10) { | ||
562 | idev->timing10 = 1; | 564 | idev->timing10 = 1; |
563 | hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; | 565 | hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; |
564 | if (idev->smart == 0) | 566 | if (idev->smart == 0) |
@@ -577,6 +579,12 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) | |||
577 | 579 | ||
578 | hwif->ultra_mask = ATA_UDMA6; | 580 | hwif->ultra_mask = ATA_UDMA6; |
579 | hwif->mwdma_mask = ATA_MWDMA2; | 581 | hwif->mwdma_mask = ATA_MWDMA2; |
582 | |||
583 | /* Vortex86SX quirk: prevent Ultra-DMA mode to fix BadCRC issue */ | ||
584 | if (idev->quirks & QUIRK_VORTEX86) { | ||
585 | if (dev->revision == 0x11) | ||
586 | hwif->ultra_mask = 0; | ||
587 | } | ||
580 | } | 588 | } |
581 | 589 | ||
582 | static void it8212_disable_raid(struct pci_dev *dev) | 590 | static void it8212_disable_raid(struct pci_dev *dev) |
@@ -649,6 +657,8 @@ static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_devic | |||
649 | return -ENOMEM; | 657 | return -ENOMEM; |
650 | } | 658 | } |
651 | 659 | ||
660 | itdevs->quirks = id->driver_data; | ||
661 | |||
652 | rc = ide_pci_init_one(dev, &it821x_chipset, itdevs); | 662 | rc = ide_pci_init_one(dev, &it821x_chipset, itdevs); |
653 | if (rc) | 663 | if (rc) |
654 | kfree(itdevs); | 664 | kfree(itdevs); |
@@ -668,6 +678,7 @@ static void __devexit it821x_remove(struct pci_dev *dev) | |||
668 | static const struct pci_device_id it821x_pci_tbl[] = { | 678 | static const struct pci_device_id it821x_pci_tbl[] = { |
669 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 }, | 679 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 }, |
670 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 }, | 680 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 }, |
681 | { PCI_VDEVICE(RDC, PCI_DEVICE_ID_RDC_D1010), QUIRK_VORTEX86 }, | ||
671 | { 0, }, | 682 | { 0, }, |
672 | }; | 683 | }; |
673 | 684 | ||
diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c index 48cc748c5043..6297956507c0 100644 --- a/drivers/ide/sl82c105.c +++ b/drivers/ide/sl82c105.c | |||
@@ -310,10 +310,6 @@ static const struct ide_port_info sl82c105_chipset __devinitdata = { | |||
310 | .dma_ops = &sl82c105_dma_ops, | 310 | .dma_ops = &sl82c105_dma_ops, |
311 | .host_flags = IDE_HFLAG_IO_32BIT | | 311 | .host_flags = IDE_HFLAG_IO_32BIT | |
312 | IDE_HFLAG_UNMASK_IRQS | | 312 | IDE_HFLAG_UNMASK_IRQS | |
313 | /* FIXME: check for Compatibility mode in generic IDE PCI code */ | ||
314 | #if defined(CONFIG_LOPEC) || defined(CONFIG_SANDPOINT) | ||
315 | IDE_HFLAG_FORCE_LEGACY_IRQS | | ||
316 | #endif | ||
317 | IDE_HFLAG_SERIALIZE_DMA | | 313 | IDE_HFLAG_SERIALIZE_DMA | |
318 | IDE_HFLAG_NO_AUTODMA, | 314 | IDE_HFLAG_NO_AUTODMA, |
319 | .pio_mask = ATA_PIO5, | 315 | .pio_mask = ATA_PIO5, |
diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c index b4ef218072cd..d9095345f7ca 100644 --- a/drivers/ide/tx4938ide.c +++ b/drivers/ide/tx4938ide.c | |||
@@ -202,7 +202,6 @@ static const struct ide_tp_ops tx4938ide_tp_ops = { | |||
202 | .exec_command = ide_exec_command, | 202 | .exec_command = ide_exec_command, |
203 | .read_status = ide_read_status, | 203 | .read_status = ide_read_status, |
204 | .read_altstatus = ide_read_altstatus, | 204 | .read_altstatus = ide_read_altstatus, |
205 | .read_sff_dma_status = ide_read_sff_dma_status, | ||
206 | 205 | ||
207 | .set_irq = ide_set_irq, | 206 | .set_irq = ide_set_irq, |
208 | 207 | ||
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c index fecc0e03c3fc..703c3eeb20a8 100644 --- a/drivers/ide/via82cxxx.c +++ b/drivers/ide/via82cxxx.c | |||
@@ -432,8 +432,6 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i | |||
432 | if (via_clock < 20000 || via_clock > 50000) { | 432 | if (via_clock < 20000 || via_clock > 50000) { |
433 | printk(KERN_WARNING DRV_NAME ": User given PCI clock speed " | 433 | printk(KERN_WARNING DRV_NAME ": User given PCI clock speed " |
434 | "impossible (%d), using 33 MHz instead.\n", via_clock); | 434 | "impossible (%d), using 33 MHz instead.\n", via_clock); |
435 | printk(KERN_WARNING DRV_NAME ": Use ide0=ata66 if you want " | ||
436 | "to assume 80-wire cable.\n"); | ||
437 | via_clock = 33333; | 435 | via_clock = 33333; |
438 | } | 436 | } |
439 | 437 | ||
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 3b77b674cbf6..c7b8a506af65 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -955,7 +955,7 @@ void ehca_poll_eqs(unsigned long data) | |||
955 | struct ehca_eq *eq = &shca->eq; | 955 | struct ehca_eq *eq = &shca->eq; |
956 | int max = 3; | 956 | int max = 3; |
957 | volatile u64 q_ofs, q_ofs2; | 957 | volatile u64 q_ofs, q_ofs2; |
958 | u64 flags; | 958 | unsigned long flags; |
959 | spin_lock_irqsave(&eq->spinlock, flags); | 959 | spin_lock_irqsave(&eq->spinlock, flags); |
960 | q_ofs = eq->ipz_queue.current_q_offset; | 960 | q_ofs = eq->ipz_queue.current_q_offset; |
961 | spin_unlock_irqrestore(&eq->spinlock, flags); | 961 | spin_unlock_irqrestore(&eq->spinlock, flags); |
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index dcefe1fceb5c..61588bd273bd 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -543,14 +543,21 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
543 | { | 543 | { |
544 | static int mlx4_ib_version_printed; | 544 | static int mlx4_ib_version_printed; |
545 | struct mlx4_ib_dev *ibdev; | 545 | struct mlx4_ib_dev *ibdev; |
546 | int num_ports = 0; | ||
546 | int i; | 547 | int i; |
547 | 548 | ||
548 | |||
549 | if (!mlx4_ib_version_printed) { | 549 | if (!mlx4_ib_version_printed) { |
550 | printk(KERN_INFO "%s", mlx4_ib_version); | 550 | printk(KERN_INFO "%s", mlx4_ib_version); |
551 | ++mlx4_ib_version_printed; | 551 | ++mlx4_ib_version_printed; |
552 | } | 552 | } |
553 | 553 | ||
554 | mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) | ||
555 | num_ports++; | ||
556 | |||
557 | /* No point in registering a device with no ports... */ | ||
558 | if (num_ports == 0) | ||
559 | return NULL; | ||
560 | |||
554 | ibdev = (struct mlx4_ib_dev *) ib_alloc_device(sizeof *ibdev); | 561 | ibdev = (struct mlx4_ib_dev *) ib_alloc_device(sizeof *ibdev); |
555 | if (!ibdev) { | 562 | if (!ibdev) { |
556 | dev_err(&dev->pdev->dev, "Device struct alloc failed\n"); | 563 | dev_err(&dev->pdev->dev, "Device struct alloc failed\n"); |
@@ -574,9 +581,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
574 | ibdev->ib_dev.owner = THIS_MODULE; | 581 | ibdev->ib_dev.owner = THIS_MODULE; |
575 | ibdev->ib_dev.node_type = RDMA_NODE_IB_CA; | 582 | ibdev->ib_dev.node_type = RDMA_NODE_IB_CA; |
576 | ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey; | 583 | ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey; |
577 | ibdev->num_ports = 0; | 584 | ibdev->num_ports = num_ports; |
578 | mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) | ||
579 | ibdev->num_ports++; | ||
580 | ibdev->ib_dev.phys_port_cnt = ibdev->num_ports; | 585 | ibdev->ib_dev.phys_port_cnt = ibdev->num_ports; |
581 | ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors; | 586 | ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors; |
582 | ibdev->ib_dev.dma_device = &dev->pdev->dev; | 587 | ibdev->ib_dev.dma_device = &dev->pdev->dev; |
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 6ba57e91d7ab..a01b4488208b 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -778,12 +778,13 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core, | |||
778 | unsigned long flags; | 778 | unsigned long flags; |
779 | struct list_head *hte; | 779 | struct list_head *hte; |
780 | struct nes_cm_node *cm_node; | 780 | struct nes_cm_node *cm_node; |
781 | __be32 tmp_addr = cpu_to_be32(loc_addr); | ||
781 | 782 | ||
782 | /* get a handle on the hte */ | 783 | /* get a handle on the hte */ |
783 | hte = &cm_core->connected_nodes; | 784 | hte = &cm_core->connected_nodes; |
784 | 785 | ||
785 | nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n", | 786 | nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n", |
786 | &loc_addr, loc_port, cm_core, hte); | 787 | &tmp_addr, loc_port, cm_core, hte); |
787 | 788 | ||
788 | /* walk list and find cm_node associated with this session ID */ | 789 | /* walk list and find cm_node associated with this session ID */ |
789 | spin_lock_irqsave(&cm_core->ht_lock, flags); | 790 | spin_lock_irqsave(&cm_core->ht_lock, flags); |
@@ -816,6 +817,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core, | |||
816 | { | 817 | { |
817 | unsigned long flags; | 818 | unsigned long flags; |
818 | struct nes_cm_listener *listen_node; | 819 | struct nes_cm_listener *listen_node; |
820 | __be32 tmp_addr = cpu_to_be32(dst_addr); | ||
819 | 821 | ||
820 | /* walk list and find cm_node associated with this session ID */ | 822 | /* walk list and find cm_node associated with this session ID */ |
821 | spin_lock_irqsave(&cm_core->listen_list_lock, flags); | 823 | spin_lock_irqsave(&cm_core->listen_list_lock, flags); |
@@ -833,7 +835,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core, | |||
833 | spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); | 835 | spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); |
834 | 836 | ||
835 | nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n", | 837 | nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n", |
836 | &dst_addr, dst_port); | 838 | &tmp_addr, dst_port); |
837 | 839 | ||
838 | /* no listener */ | 840 | /* no listener */ |
839 | return NULL; | 841 | return NULL; |
@@ -2059,6 +2061,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, | |||
2059 | struct tcphdr *tcph; | 2061 | struct tcphdr *tcph; |
2060 | struct nes_cm_info nfo; | 2062 | struct nes_cm_info nfo; |
2061 | int skb_handled = 1; | 2063 | int skb_handled = 1; |
2064 | __be32 tmp_daddr, tmp_saddr; | ||
2062 | 2065 | ||
2063 | if (!skb) | 2066 | if (!skb) |
2064 | return 0; | 2067 | return 0; |
@@ -2074,8 +2077,11 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, | |||
2074 | nfo.rem_addr = ntohl(iph->saddr); | 2077 | nfo.rem_addr = ntohl(iph->saddr); |
2075 | nfo.rem_port = ntohs(tcph->source); | 2078 | nfo.rem_port = ntohs(tcph->source); |
2076 | 2079 | ||
2080 | tmp_daddr = cpu_to_be32(iph->daddr); | ||
2081 | tmp_saddr = cpu_to_be32(iph->saddr); | ||
2082 | |||
2077 | nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n", | 2083 | nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n", |
2078 | &iph->daddr, tcph->dest, &iph->saddr, tcph->source); | 2084 | &tmp_daddr, tcph->dest, &tmp_saddr, tcph->source); |
2079 | 2085 | ||
2080 | do { | 2086 | do { |
2081 | cm_node = find_node(cm_core, | 2087 | cm_node = find_node(cm_core, |
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c index aa9b7348c728..6f3bc1b6bf22 100644 --- a/drivers/infiniband/hw/nes/nes_utils.c +++ b/drivers/infiniband/hw/nes/nes_utils.c | |||
@@ -655,6 +655,7 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti | |||
655 | struct nes_adapter *nesadapter = nesdev->nesadapter; | 655 | struct nes_adapter *nesadapter = nesdev->nesadapter; |
656 | int arp_index; | 656 | int arp_index; |
657 | int err = 0; | 657 | int err = 0; |
658 | __be32 tmp_addr; | ||
658 | 659 | ||
659 | for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) { | 660 | for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) { |
660 | if (nesadapter->arp_table[arp_index].ip_addr == ip_addr) | 661 | if (nesadapter->arp_table[arp_index].ip_addr == ip_addr) |
@@ -682,8 +683,9 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti | |||
682 | 683 | ||
683 | /* DELETE or RESOLVE */ | 684 | /* DELETE or RESOLVE */ |
684 | if (arp_index == nesadapter->arp_table_size) { | 685 | if (arp_index == nesadapter->arp_table_size) { |
686 | tmp_addr = cpu_to_be32(ip_addr); | ||
685 | nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n", | 687 | nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n", |
686 | &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); | 688 | &tmp_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); |
687 | return -1; | 689 | return -1; |
688 | } | 690 | } |
689 | 691 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 19e06bc38b39..dce0443f9d69 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -711,26 +711,26 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
711 | 711 | ||
712 | neigh = *to_ipoib_neigh(skb->dst->neighbour); | 712 | neigh = *to_ipoib_neigh(skb->dst->neighbour); |
713 | 713 | ||
714 | if (neigh->ah) | 714 | if (unlikely((memcmp(&neigh->dgid.raw, |
715 | if (unlikely((memcmp(&neigh->dgid.raw, | 715 | skb->dst->neighbour->ha + 4, |
716 | skb->dst->neighbour->ha + 4, | 716 | sizeof(union ib_gid))) || |
717 | sizeof(union ib_gid))) || | 717 | (neigh->dev != dev))) { |
718 | (neigh->dev != dev))) { | 718 | spin_lock_irqsave(&priv->lock, flags); |
719 | spin_lock_irqsave(&priv->lock, flags); | 719 | /* |
720 | /* | 720 | * It's safe to call ipoib_put_ah() inside |
721 | * It's safe to call ipoib_put_ah() inside | 721 | * priv->lock here, because we know that |
722 | * priv->lock here, because we know that | 722 | * path->ah will always hold one more reference, |
723 | * path->ah will always hold one more reference, | 723 | * so ipoib_put_ah() will never do more than |
724 | * so ipoib_put_ah() will never do more than | 724 | * decrement the ref count. |
725 | * decrement the ref count. | 725 | */ |
726 | */ | 726 | if (neigh->ah) |
727 | ipoib_put_ah(neigh->ah); | 727 | ipoib_put_ah(neigh->ah); |
728 | list_del(&neigh->list); | 728 | list_del(&neigh->list); |
729 | ipoib_neigh_free(dev, neigh); | 729 | ipoib_neigh_free(dev, neigh); |
730 | spin_unlock_irqrestore(&priv->lock, flags); | 730 | spin_unlock_irqrestore(&priv->lock, flags); |
731 | ipoib_path_lookup(skb, dev); | 731 | ipoib_path_lookup(skb, dev); |
732 | return NETDEV_TX_OK; | 732 | return NETDEV_TX_OK; |
733 | } | 733 | } |
734 | 734 | ||
735 | if (ipoib_cm_get(neigh)) { | 735 | if (ipoib_cm_get(neigh)) { |
736 | if (ipoib_cm_up(neigh)) { | 736 | if (ipoib_cm_up(neigh)) { |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index a2eb3b9789eb..59d02e0b8df1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -529,6 +529,9 @@ void ipoib_mcast_join_task(struct work_struct *work) | |||
529 | if (!priv->broadcast) { | 529 | if (!priv->broadcast) { |
530 | struct ipoib_mcast *broadcast; | 530 | struct ipoib_mcast *broadcast; |
531 | 531 | ||
532 | if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) | ||
533 | return; | ||
534 | |||
532 | broadcast = ipoib_mcast_alloc(dev, 1); | 535 | broadcast = ipoib_mcast_alloc(dev, 1); |
533 | if (!broadcast) { | 536 | if (!broadcast) { |
534 | ipoib_warn(priv, "failed to allocate broadcast group\n"); | 537 | ipoib_warn(priv, "failed to allocate broadcast group\n"); |
diff --git a/drivers/infiniband/ulp/iser/Kconfig b/drivers/infiniband/ulp/iser/Kconfig index 77dedba829e6..b411c51842da 100644 --- a/drivers/infiniband/ulp/iser/Kconfig +++ b/drivers/infiniband/ulp/iser/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config INFINIBAND_ISER | 1 | config INFINIBAND_ISER |
2 | tristate "iSCSI Extensions for RDMA (iSER)" | 2 | tristate "iSCSI Extensions for RDMA (iSER)" |
3 | depends on SCSI && INET | 3 | depends on SCSI && INET && INFINIBAND_ADDR_TRANS |
4 | select SCSI_ISCSI_ATTRS | 4 | select SCSI_ISCSI_ATTRS |
5 | ---help--- | 5 | ---help--- |
6 | Support for the iSCSI Extensions for RDMA (iSER) Protocol | 6 | Support for the iSCSI Extensions for RDMA (iSER) Protocol |
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 199055db5082..67e5553f699a 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -220,4 +220,11 @@ config HP_SDC_RTC | |||
220 | Say Y here if you want to support the built-in real time clock | 220 | Say Y here if you want to support the built-in real time clock |
221 | of the HP SDC controller. | 221 | of the HP SDC controller. |
222 | 222 | ||
223 | config INPUT_PCF50633_PMU | ||
224 | tristate "PCF50633 PMU events" | ||
225 | depends on MFD_PCF50633 | ||
226 | help | ||
227 | Say Y to include support for delivering PMU events via input | ||
228 | layer on NXP PCF50633. | ||
229 | |||
223 | endif | 230 | endif |
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index d7db2aeb8a98..bb62e6efacf3 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile | |||
@@ -21,3 +21,4 @@ obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o | |||
21 | obj-$(CONFIG_INPUT_UINPUT) += uinput.o | 21 | obj-$(CONFIG_INPUT_UINPUT) += uinput.o |
22 | obj-$(CONFIG_INPUT_APANEL) += apanel.o | 22 | obj-$(CONFIG_INPUT_APANEL) += apanel.o |
23 | obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o | 23 | obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o |
24 | obj-$(CONFIG_INPUT_PCF50633_PMU) += pcf50633-input.o | ||
diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c new file mode 100644 index 000000000000..039dcb00ebd9 --- /dev/null +++ b/drivers/input/misc/pcf50633-input.c | |||
@@ -0,0 +1,132 @@ | |||
1 | /* NXP PCF50633 Input Driver | ||
2 | * | ||
3 | * (C) 2006-2008 by Openmoko, Inc. | ||
4 | * Author: Balaji Rao <balajirrao@openmoko.org> | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Broken down from monstrous PCF50633 driver mainly by | ||
8 | * Harald Welte, Andy Green and Werner Almesberger | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/device.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/input.h> | ||
23 | |||
24 | #include <linux/mfd/pcf50633/core.h> | ||
25 | |||
26 | #define PCF50633_OOCSTAT_ONKEY 0x01 | ||
27 | #define PCF50633_REG_OOCSTAT 0x12 | ||
28 | #define PCF50633_REG_OOCMODE 0x10 | ||
29 | |||
30 | struct pcf50633_input { | ||
31 | struct pcf50633 *pcf; | ||
32 | struct input_dev *input_dev; | ||
33 | }; | ||
34 | |||
35 | static void | ||
36 | pcf50633_input_irq(int irq, void *data) | ||
37 | { | ||
38 | struct pcf50633_input *input; | ||
39 | int onkey_released; | ||
40 | |||
41 | input = data; | ||
42 | |||
43 | /* We report only one event depending on the key press status */ | ||
44 | onkey_released = pcf50633_reg_read(input->pcf, PCF50633_REG_OOCSTAT) | ||
45 | & PCF50633_OOCSTAT_ONKEY; | ||
46 | |||
47 | if (irq == PCF50633_IRQ_ONKEYF && !onkey_released) | ||
48 | input_report_key(input->input_dev, KEY_POWER, 1); | ||
49 | else if (irq == PCF50633_IRQ_ONKEYR && onkey_released) | ||
50 | input_report_key(input->input_dev, KEY_POWER, 0); | ||
51 | |||
52 | input_sync(input->input_dev); | ||
53 | } | ||
54 | |||
55 | static int __devinit pcf50633_input_probe(struct platform_device *pdev) | ||
56 | { | ||
57 | struct pcf50633_input *input; | ||
58 | struct pcf50633_subdev_pdata *pdata = pdev->dev.platform_data; | ||
59 | struct input_dev *input_dev; | ||
60 | int ret; | ||
61 | |||
62 | |||
63 | input = kzalloc(sizeof(*input), GFP_KERNEL); | ||
64 | if (!input) | ||
65 | return -ENOMEM; | ||
66 | |||
67 | input_dev = input_allocate_device(); | ||
68 | if (!input_dev) { | ||
69 | kfree(input); | ||
70 | return -ENOMEM; | ||
71 | } | ||
72 | |||
73 | platform_set_drvdata(pdev, input); | ||
74 | input->pcf = pdata->pcf; | ||
75 | input->input_dev = input_dev; | ||
76 | |||
77 | input_dev->name = "PCF50633 PMU events"; | ||
78 | input_dev->id.bustype = BUS_I2C; | ||
79 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_PWR); | ||
80 | set_bit(KEY_POWER, input_dev->keybit); | ||
81 | |||
82 | ret = input_register_device(input_dev); | ||
83 | if (ret) { | ||
84 | input_free_device(input_dev); | ||
85 | kfree(input); | ||
86 | return ret; | ||
87 | } | ||
88 | pcf50633_register_irq(pdata->pcf, PCF50633_IRQ_ONKEYR, | ||
89 | pcf50633_input_irq, input); | ||
90 | pcf50633_register_irq(pdata->pcf, PCF50633_IRQ_ONKEYF, | ||
91 | pcf50633_input_irq, input); | ||
92 | |||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | static int __devexit pcf50633_input_remove(struct platform_device *pdev) | ||
97 | { | ||
98 | struct pcf50633_input *input = platform_get_drvdata(pdev); | ||
99 | |||
100 | pcf50633_free_irq(input->pcf, PCF50633_IRQ_ONKEYR); | ||
101 | pcf50633_free_irq(input->pcf, PCF50633_IRQ_ONKEYF); | ||
102 | |||
103 | input_unregister_device(input->input_dev); | ||
104 | kfree(input); | ||
105 | |||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | static struct platform_driver pcf50633_input_driver = { | ||
110 | .driver = { | ||
111 | .name = "pcf50633-input", | ||
112 | }, | ||
113 | .probe = pcf50633_input_probe, | ||
114 | .remove = __devexit_p(pcf50633_input_remove), | ||
115 | }; | ||
116 | |||
117 | static int __init pcf50633_input_init(void) | ||
118 | { | ||
119 | return platform_driver_register(&pcf50633_input_driver); | ||
120 | } | ||
121 | module_init(pcf50633_input_init); | ||
122 | |||
123 | static void __exit pcf50633_input_exit(void) | ||
124 | { | ||
125 | platform_driver_unregister(&pcf50633_input_driver); | ||
126 | } | ||
127 | module_exit(pcf50633_input_exit); | ||
128 | |||
129 | MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>"); | ||
130 | MODULE_DESCRIPTION("PCF50633 input driver"); | ||
131 | MODULE_LICENSE("GPL"); | ||
132 | MODULE_ALIAS("platform:pcf50633-input"); | ||
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 97f4708b3879..595ba8eb4a07 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c | |||
@@ -3615,7 +3615,7 @@ hfcm_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg) | |||
3615 | static void | 3615 | static void |
3616 | ph_state_change(struct dchannel *dch) | 3616 | ph_state_change(struct dchannel *dch) |
3617 | { | 3617 | { |
3618 | struct hfc_multi *hc = dch->hw; | 3618 | struct hfc_multi *hc; |
3619 | int ch, i; | 3619 | int ch, i; |
3620 | 3620 | ||
3621 | if (!dch) { | 3621 | if (!dch) { |
@@ -3623,6 +3623,7 @@ ph_state_change(struct dchannel *dch) | |||
3623 | __func__); | 3623 | __func__); |
3624 | return; | 3624 | return; |
3625 | } | 3625 | } |
3626 | hc = dch->hw; | ||
3626 | ch = dch->slot; | 3627 | ch = dch->slot; |
3627 | 3628 | ||
3628 | if (hc->type == 1) { | 3629 | if (hc->type == 1) { |
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index 917bf41a293b..f0e14dfcf71d 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c | |||
@@ -61,7 +61,7 @@ u32 hfc_jiffies; | |||
61 | 61 | ||
62 | MODULE_AUTHOR("Karsten Keil"); | 62 | MODULE_AUTHOR("Karsten Keil"); |
63 | MODULE_LICENSE("GPL"); | 63 | MODULE_LICENSE("GPL"); |
64 | module_param(debug, uint, 0); | 64 | module_param(debug, uint, S_IRUGO | S_IWUSR); |
65 | module_param(poll, uint, S_IRUGO | S_IWUSR); | 65 | module_param(poll, uint, S_IRUGO | S_IWUSR); |
66 | 66 | ||
67 | enum { | 67 | enum { |
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 7c5f97033b9f..cb8943da4f12 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -292,7 +292,9 @@ isdn_net_unbind_channel(isdn_net_local * lp) | |||
292 | lp->dialstate = 0; | 292 | lp->dialstate = 0; |
293 | dev->rx_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL; | 293 | dev->rx_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL; |
294 | dev->st_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL; | 294 | dev->st_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL; |
295 | isdn_free_channel(lp->isdn_device, lp->isdn_channel, ISDN_USAGE_NET); | 295 | if (lp->isdn_device != -1 && lp->isdn_channel != -1) |
296 | isdn_free_channel(lp->isdn_device, lp->isdn_channel, | ||
297 | ISDN_USAGE_NET); | ||
296 | lp->flags &= ~ISDN_NET_CONNECTED; | 298 | lp->flags &= ~ISDN_NET_CONNECTED; |
297 | lp->isdn_device = -1; | 299 | lp->isdn_device = -1; |
298 | lp->isdn_channel = -1; | 300 | lp->isdn_channel = -1; |
@@ -2513,7 +2515,6 @@ static const struct net_device_ops isdn_netdev_ops = { | |||
2513 | .ndo_stop = isdn_net_close, | 2515 | .ndo_stop = isdn_net_close, |
2514 | .ndo_do_ioctl = isdn_net_ioctl, | 2516 | .ndo_do_ioctl = isdn_net_ioctl, |
2515 | 2517 | ||
2516 | .ndo_validate_addr = NULL, | ||
2517 | .ndo_start_xmit = isdn_net_start_xmit, | 2518 | .ndo_start_xmit = isdn_net_start_xmit, |
2518 | .ndo_get_stats = isdn_net_get_stats, | 2519 | .ndo_get_stats = isdn_net_get_stats, |
2519 | .ndo_tx_timeout = isdn_net_tx_timeout, | 2520 | .ndo_tx_timeout = isdn_net_tx_timeout, |
@@ -2528,12 +2529,8 @@ static void _isdn_setup(struct net_device *dev) | |||
2528 | 2529 | ||
2529 | ether_setup(dev); | 2530 | ether_setup(dev); |
2530 | 2531 | ||
2531 | dev->flags = IFF_NOARP | IFF_POINTOPOINT; | ||
2532 | /* Setup the generic properties */ | 2532 | /* Setup the generic properties */ |
2533 | dev->mtu = 1500; | ||
2534 | dev->flags = IFF_NOARP|IFF_POINTOPOINT; | 2533 | dev->flags = IFF_NOARP|IFF_POINTOPOINT; |
2535 | dev->type = ARPHRD_ETHER; | ||
2536 | dev->addr_len = ETH_ALEN; | ||
2537 | dev->header_ops = NULL; | 2534 | dev->header_ops = NULL; |
2538 | dev->netdev_ops = &isdn_netdev_ops; | 2535 | dev->netdev_ops = &isdn_netdev_ops; |
2539 | 2536 | ||
diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c index 0ac67bff303a..58c43e429f73 100644 --- a/drivers/isdn/mISDN/dsp_cmx.c +++ b/drivers/isdn/mISDN/dsp_cmx.c | |||
@@ -1579,7 +1579,7 @@ send_packet: | |||
1579 | schedule_work(&dsp->workq); | 1579 | schedule_work(&dsp->workq); |
1580 | } | 1580 | } |
1581 | 1581 | ||
1582 | static u32 jittercount; /* counter for jitter check */; | 1582 | static u32 jittercount; /* counter for jitter check */ |
1583 | struct timer_list dsp_spl_tl; | 1583 | struct timer_list dsp_spl_tl; |
1584 | u32 dsp_spl_jiffies; /* calculate the next time to fire */ | 1584 | u32 dsp_spl_jiffies; /* calculate the next time to fire */ |
1585 | static u16 dsp_count; /* last sample count */ | 1585 | static u16 dsp_count; /* last sample count */ |
@@ -1893,7 +1893,7 @@ dsp_cmx_hdlc(struct dsp *dsp, struct sk_buff *skb) | |||
1893 | /* in case of hardware (echo) */ | 1893 | /* in case of hardware (echo) */ |
1894 | if (dsp->pcm_slot_tx >= 0) | 1894 | if (dsp->pcm_slot_tx >= 0) |
1895 | return; | 1895 | return; |
1896 | if (dsp->echo) | 1896 | if (dsp->echo) { |
1897 | nskb = skb_clone(skb, GFP_ATOMIC); | 1897 | nskb = skb_clone(skb, GFP_ATOMIC); |
1898 | if (nskb) { | 1898 | if (nskb) { |
1899 | hh = mISDN_HEAD_P(nskb); | 1899 | hh = mISDN_HEAD_P(nskb); |
@@ -1902,6 +1902,7 @@ dsp_cmx_hdlc(struct dsp *dsp, struct sk_buff *skb) | |||
1902 | skb_queue_tail(&dsp->sendq, nskb); | 1902 | skb_queue_tail(&dsp->sendq, nskb); |
1903 | schedule_work(&dsp->workq); | 1903 | schedule_work(&dsp->workq); |
1904 | } | 1904 | } |
1905 | } | ||
1905 | return; | 1906 | return; |
1906 | } | 1907 | } |
1907 | /* in case of hardware conference */ | 1908 | /* in case of hardware conference */ |
diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c index bf999bdc41c3..18cf87c113e7 100644 --- a/drivers/isdn/mISDN/dsp_pipeline.c +++ b/drivers/isdn/mISDN/dsp_pipeline.c | |||
@@ -110,8 +110,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem) | |||
110 | } | 110 | } |
111 | list_add_tail(&entry->list, &dsp_elements); | 111 | list_add_tail(&entry->list, &dsp_elements); |
112 | 112 | ||
113 | for (i = 0; i < (sizeof(element_attributes) | 113 | for (i = 0; i < ARRAY_SIZE(element_attributes); ++i) { |
114 | / sizeof(struct device_attribute)); ++i) | ||
115 | ret = device_create_file(&entry->dev, | 114 | ret = device_create_file(&entry->dev, |
116 | &element_attributes[i]); | 115 | &element_attributes[i]); |
117 | if (ret) { | 116 | if (ret) { |
@@ -119,6 +118,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem) | |||
119 | __func__); | 118 | __func__); |
120 | goto err2; | 119 | goto err2; |
121 | } | 120 | } |
121 | } | ||
122 | 122 | ||
123 | #ifdef PIPELINE_DEBUG | 123 | #ifdef PIPELINE_DEBUG |
124 | printk(KERN_DEBUG "%s: %s registered\n", __func__, elem->name); | 124 | printk(KERN_DEBUG "%s: %s registered\n", __func__, elem->name); |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index a4a1ae214630..742713611bc5 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -119,13 +119,6 @@ config LEDS_GPIO | |||
119 | outputs. To be useful the particular board must have LEDs | 119 | outputs. To be useful the particular board must have LEDs |
120 | and they must be connected to the GPIO lines. | 120 | and they must be connected to the GPIO lines. |
121 | 121 | ||
122 | config LEDS_HP_DISK | ||
123 | tristate "LED Support for disk protection LED on HP notebooks" | ||
124 | depends on LEDS_CLASS && ACPI | ||
125 | help | ||
126 | This option enable support for disk protection LED, found on | ||
127 | newer HP notebooks. | ||
128 | |||
129 | config LEDS_CLEVO_MAIL | 122 | config LEDS_CLEVO_MAIL |
130 | tristate "Mail LED on Clevo notebook (EXPERIMENTAL)" | 123 | tristate "Mail LED on Clevo notebook (EXPERIMENTAL)" |
131 | depends on LEDS_CLASS && X86 && SERIO_I8042 && DMI && EXPERIMENTAL | 124 | depends on LEDS_CLASS && X86 && SERIO_I8042 && DMI && EXPERIMENTAL |
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index bc247cb02e82..9d76f0f160a4 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -23,7 +23,6 @@ obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o | |||
23 | obj-$(CONFIG_LEDS_FSG) += leds-fsg.o | 23 | obj-$(CONFIG_LEDS_FSG) += leds-fsg.o |
24 | obj-$(CONFIG_LEDS_PCA955X) += leds-pca955x.o | 24 | obj-$(CONFIG_LEDS_PCA955X) += leds-pca955x.o |
25 | obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o | 25 | obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o |
26 | obj-$(CONFIG_LEDS_HP_DISK) += leds-hp-disk.o | ||
27 | obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o | 26 | obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o |
28 | 27 | ||
29 | # LED Triggers | 28 | # LED Triggers |
diff --git a/drivers/leds/leds-hp-disk.c b/drivers/leds/leds-hp-disk.c deleted file mode 100644 index d786adc8c5e3..000000000000 --- a/drivers/leds/leds-hp-disk.c +++ /dev/null | |||
@@ -1,137 +0,0 @@ | |||
1 | /* | ||
2 | * leds-hp-disk.c - driver for HP "hard disk protection" LED | ||
3 | * | ||
4 | * Copyright (C) 2008 Pavel Machek | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/dmi.h> | ||
24 | #include <linux/module.h> | ||
25 | #include <linux/types.h> | ||
26 | #include <linux/platform_device.h> | ||
27 | #include <linux/interrupt.h> | ||
28 | #include <linux/input.h> | ||
29 | #include <linux/kthread.h> | ||
30 | #include <linux/leds.h> | ||
31 | #include <acpi/acpi_drivers.h> | ||
32 | |||
33 | #define DRIVER_NAME "leds-hp-disk" | ||
34 | #define ACPI_MDPS_CLASS "led" | ||
35 | |||
36 | /* For automatic insertion of the module */ | ||
37 | static struct acpi_device_id hpled_device_ids[] = { | ||
38 | {"HPQ0004", 0}, /* HP Mobile Data Protection System PNP */ | ||
39 | {"", 0}, | ||
40 | }; | ||
41 | MODULE_DEVICE_TABLE(acpi, hpled_device_ids); | ||
42 | |||
43 | struct acpi_hpled { | ||
44 | struct acpi_device *device; /* The ACPI device */ | ||
45 | }; | ||
46 | |||
47 | static struct acpi_hpled adev; | ||
48 | |||
49 | static acpi_status hpled_acpi_write(acpi_handle handle, int reg) | ||
50 | { | ||
51 | unsigned long long ret; /* Not used when writing */ | ||
52 | union acpi_object in_obj[1]; | ||
53 | struct acpi_object_list args = { 1, in_obj }; | ||
54 | |||
55 | in_obj[0].type = ACPI_TYPE_INTEGER; | ||
56 | in_obj[0].integer.value = reg; | ||
57 | |||
58 | return acpi_evaluate_integer(handle, "ALED", &args, &ret); | ||
59 | } | ||
60 | |||
61 | static void hpled_set(struct led_classdev *led_cdev, | ||
62 | enum led_brightness value) | ||
63 | { | ||
64 | hpled_acpi_write(adev.device->handle, !!value); | ||
65 | } | ||
66 | |||
67 | static struct led_classdev hpled_led = { | ||
68 | .name = "hp:red:hddprotection", | ||
69 | .default_trigger = "heartbeat", | ||
70 | .brightness_set = hpled_set, | ||
71 | .flags = LED_CORE_SUSPENDRESUME, | ||
72 | }; | ||
73 | |||
74 | static int hpled_add(struct acpi_device *device) | ||
75 | { | ||
76 | int ret; | ||
77 | |||
78 | if (!device) | ||
79 | return -EINVAL; | ||
80 | |||
81 | adev.device = device; | ||
82 | strcpy(acpi_device_name(device), DRIVER_NAME); | ||
83 | strcpy(acpi_device_class(device), ACPI_MDPS_CLASS); | ||
84 | device->driver_data = &adev; | ||
85 | |||
86 | ret = led_classdev_register(NULL, &hpled_led); | ||
87 | return ret; | ||
88 | } | ||
89 | |||
90 | static int hpled_remove(struct acpi_device *device, int type) | ||
91 | { | ||
92 | if (!device) | ||
93 | return -EINVAL; | ||
94 | |||
95 | led_classdev_unregister(&hpled_led); | ||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | |||
100 | |||
101 | static struct acpi_driver leds_hp_driver = { | ||
102 | .name = DRIVER_NAME, | ||
103 | .class = ACPI_MDPS_CLASS, | ||
104 | .ids = hpled_device_ids, | ||
105 | .ops = { | ||
106 | .add = hpled_add, | ||
107 | .remove = hpled_remove, | ||
108 | } | ||
109 | }; | ||
110 | |||
111 | static int __init hpled_init_module(void) | ||
112 | { | ||
113 | int ret; | ||
114 | |||
115 | if (acpi_disabled) | ||
116 | return -ENODEV; | ||
117 | |||
118 | ret = acpi_bus_register_driver(&leds_hp_driver); | ||
119 | if (ret < 0) | ||
120 | return ret; | ||
121 | |||
122 | printk(KERN_INFO DRIVER_NAME " driver loaded.\n"); | ||
123 | |||
124 | return 0; | ||
125 | } | ||
126 | |||
127 | static void __exit hpled_exit_module(void) | ||
128 | { | ||
129 | acpi_bus_unregister_driver(&leds_hp_driver); | ||
130 | } | ||
131 | |||
132 | MODULE_DESCRIPTION("Driver for HP disk protection LED"); | ||
133 | MODULE_AUTHOR("Pavel Machek <pavel@suse.cz>"); | ||
134 | MODULE_LICENSE("GPL"); | ||
135 | |||
136 | module_init(hpled_init_module); | ||
137 | module_exit(hpled_exit_module); | ||
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 416f9e7286ba..06a2b0f7737c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -217,6 +217,29 @@ config MFD_WM8350_I2C | |||
217 | I2C as the control interface. Additional options must be | 217 | I2C as the control interface. Additional options must be |
218 | selected to enable support for the functionality of the chip. | 218 | selected to enable support for the functionality of the chip. |
219 | 219 | ||
220 | config MFD_PCF50633 | ||
221 | tristate "Support for NXP PCF50633" | ||
222 | depends on I2C | ||
223 | help | ||
224 | Say yes here if you have NXP PCF50633 chip on your board. | ||
225 | This core driver provides register access and IRQ handling | ||
226 | facilities, and registers devices for the various functions | ||
227 | so that function-specific drivers can bind to them. | ||
228 | |||
229 | config PCF50633_ADC | ||
230 | tristate "Support for NXP PCF50633 ADC" | ||
231 | depends on MFD_PCF50633 | ||
232 | help | ||
233 | Say yes here if you want to include support for ADC in the | ||
234 | NXP PCF50633 chip. | ||
235 | |||
236 | config PCF50633_GPIO | ||
237 | tristate "Support for NXP PCF50633 GPIO" | ||
238 | depends on MFD_PCF50633 | ||
239 | help | ||
240 | Say yes here if you want to include support GPIO for pins on | ||
241 | the PCF50633 chip. | ||
242 | |||
220 | endmenu | 243 | endmenu |
221 | 244 | ||
222 | menu "Multimedia Capabilities Port drivers" | 245 | menu "Multimedia Capabilities Port drivers" |
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 0c9418b36c26..3afb5192e4da 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile | |||
@@ -37,3 +37,7 @@ endif | |||
37 | obj-$(CONFIG_UCB1400_CORE) += ucb1400_core.o | 37 | obj-$(CONFIG_UCB1400_CORE) += ucb1400_core.o |
38 | 38 | ||
39 | obj-$(CONFIG_PMIC_DA903X) += da903x.o | 39 | obj-$(CONFIG_PMIC_DA903X) += da903x.o |
40 | |||
41 | obj-$(CONFIG_MFD_PCF50633) += pcf50633-core.o | ||
42 | obj-$(CONFIG_PCF50633_ADC) += pcf50633-adc.o | ||
43 | obj-$(CONFIG_PCF50633_GPIO) += pcf50633-gpio.o \ No newline at end of file | ||
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c index 4214b3f72426..7ac12cb0be4a 100644 --- a/drivers/mfd/dm355evm_msp.c +++ b/drivers/mfd/dm355evm_msp.c | |||
@@ -107,6 +107,9 @@ static const u8 msp_gpios[] = { | |||
107 | MSP_GPIO(0, SWITCH1), MSP_GPIO(1, SWITCH1), | 107 | MSP_GPIO(0, SWITCH1), MSP_GPIO(1, SWITCH1), |
108 | MSP_GPIO(2, SWITCH1), MSP_GPIO(3, SWITCH1), | 108 | MSP_GPIO(2, SWITCH1), MSP_GPIO(3, SWITCH1), |
109 | MSP_GPIO(4, SWITCH1), | 109 | MSP_GPIO(4, SWITCH1), |
110 | /* switches on MMC/SD sockets */ | ||
111 | MSP_GPIO(1, SDMMC), MSP_GPIO(2, SDMMC), /* mmc0 WP, nCD */ | ||
112 | MSP_GPIO(3, SDMMC), MSP_GPIO(4, SDMMC), /* mmc1 WP, nCD */ | ||
110 | }; | 113 | }; |
111 | 114 | ||
112 | #define MSP_GPIO_REG(offset) (msp_gpios[(offset)] >> 3) | 115 | #define MSP_GPIO_REG(offset) (msp_gpios[(offset)] >> 3) |
@@ -304,6 +307,13 @@ static int add_children(struct i2c_client *client) | |||
304 | gpio_export(gpio, false); | 307 | gpio_export(gpio, false); |
305 | } | 308 | } |
306 | 309 | ||
310 | /* MMC/SD inputs -- right after the last config input */ | ||
311 | if (client->dev.platform_data) { | ||
312 | void (*mmcsd_setup)(unsigned) = client->dev.platform_data; | ||
313 | |||
314 | mmcsd_setup(dm355evm_msp_gpio.base + 8 + 5); | ||
315 | } | ||
316 | |||
307 | /* RTC is a 32 bit counter, no alarm */ | 317 | /* RTC is a 32 bit counter, no alarm */ |
308 | if (msp_has_rtc()) { | 318 | if (msp_has_rtc()) { |
309 | child = add_child(client, "rtc-dm355evm", | 319 | child = add_child(client, "rtc-dm355evm", |
diff --git a/drivers/mfd/pcf50633-adc.c b/drivers/mfd/pcf50633-adc.c new file mode 100644 index 000000000000..c2d05becfa97 --- /dev/null +++ b/drivers/mfd/pcf50633-adc.c | |||
@@ -0,0 +1,277 @@ | |||
1 | /* NXP PCF50633 ADC Driver | ||
2 | * | ||
3 | * (C) 2006-2008 by Openmoko, Inc. | ||
4 | * Author: Balaji Rao <balajirrao@openmoko.org> | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Broken down from monstrous PCF50633 driver mainly by | ||
8 | * Harald Welte, Andy Green and Werner Almesberger | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | * NOTE: This driver does not yet support subtractive ADC mode, which means | ||
16 | * you can do only one measurement per read request. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/module.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/device.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/completion.h> | ||
25 | |||
26 | #include <linux/mfd/pcf50633/core.h> | ||
27 | #include <linux/mfd/pcf50633/adc.h> | ||
28 | |||
29 | struct pcf50633_adc_request { | ||
30 | int mux; | ||
31 | int avg; | ||
32 | int result; | ||
33 | void (*callback)(struct pcf50633 *, void *, int); | ||
34 | void *callback_param; | ||
35 | |||
36 | /* Used in case of sync requests */ | ||
37 | struct completion completion; | ||
38 | |||
39 | }; | ||
40 | |||
41 | #define PCF50633_MAX_ADC_FIFO_DEPTH 8 | ||
42 | |||
43 | struct pcf50633_adc { | ||
44 | struct pcf50633 *pcf; | ||
45 | |||
46 | /* Private stuff */ | ||
47 | struct pcf50633_adc_request *queue[PCF50633_MAX_ADC_FIFO_DEPTH]; | ||
48 | int queue_head; | ||
49 | int queue_tail; | ||
50 | struct mutex queue_mutex; | ||
51 | }; | ||
52 | |||
53 | static inline struct pcf50633_adc *__to_adc(struct pcf50633 *pcf) | ||
54 | { | ||
55 | return platform_get_drvdata(pcf->adc_pdev); | ||
56 | } | ||
57 | |||
58 | static void adc_setup(struct pcf50633 *pcf, int channel, int avg) | ||
59 | { | ||
60 | channel &= PCF50633_ADCC1_ADCMUX_MASK; | ||
61 | |||
62 | /* kill ratiometric, but enable ACCSW biasing */ | ||
63 | pcf50633_reg_write(pcf, PCF50633_REG_ADCC2, 0x00); | ||
64 | pcf50633_reg_write(pcf, PCF50633_REG_ADCC3, 0x01); | ||
65 | |||
66 | /* start ADC conversion on selected channel */ | ||
67 | pcf50633_reg_write(pcf, PCF50633_REG_ADCC1, channel | avg | | ||
68 | PCF50633_ADCC1_ADCSTART | PCF50633_ADCC1_RES_10BIT); | ||
69 | } | ||
70 | |||
71 | static void trigger_next_adc_job_if_any(struct pcf50633 *pcf) | ||
72 | { | ||
73 | struct pcf50633_adc *adc = __to_adc(pcf); | ||
74 | int head; | ||
75 | |||
76 | mutex_lock(&adc->queue_mutex); | ||
77 | |||
78 | head = adc->queue_head; | ||
79 | |||
80 | if (!adc->queue[head]) { | ||
81 | mutex_unlock(&adc->queue_mutex); | ||
82 | return; | ||
83 | } | ||
84 | mutex_unlock(&adc->queue_mutex); | ||
85 | |||
86 | adc_setup(pcf, adc->queue[head]->mux, adc->queue[head]->avg); | ||
87 | } | ||
88 | |||
89 | static int | ||
90 | adc_enqueue_request(struct pcf50633 *pcf, struct pcf50633_adc_request *req) | ||
91 | { | ||
92 | struct pcf50633_adc *adc = __to_adc(pcf); | ||
93 | int head, tail; | ||
94 | |||
95 | mutex_lock(&adc->queue_mutex); | ||
96 | |||
97 | head = adc->queue_head; | ||
98 | tail = adc->queue_tail; | ||
99 | |||
100 | if (adc->queue[tail]) { | ||
101 | mutex_unlock(&adc->queue_mutex); | ||
102 | return -EBUSY; | ||
103 | } | ||
104 | |||
105 | adc->queue[tail] = req; | ||
106 | adc->queue_tail = (tail + 1) & (PCF50633_MAX_ADC_FIFO_DEPTH - 1); | ||
107 | |||
108 | mutex_unlock(&adc->queue_mutex); | ||
109 | |||
110 | trigger_next_adc_job_if_any(pcf); | ||
111 | |||
112 | return 0; | ||
113 | } | ||
114 | |||
115 | static void | ||
116 | pcf50633_adc_sync_read_callback(struct pcf50633 *pcf, void *param, int result) | ||
117 | { | ||
118 | struct pcf50633_adc_request *req = param; | ||
119 | |||
120 | req->result = result; | ||
121 | complete(&req->completion); | ||
122 | } | ||
123 | |||
124 | int pcf50633_adc_sync_read(struct pcf50633 *pcf, int mux, int avg) | ||
125 | { | ||
126 | struct pcf50633_adc_request *req; | ||
127 | |||
128 | /* req is freed when the result is ready, in interrupt handler */ | ||
129 | req = kzalloc(sizeof(*req), GFP_KERNEL); | ||
130 | if (!req) | ||
131 | return -ENOMEM; | ||
132 | |||
133 | req->mux = mux; | ||
134 | req->avg = avg; | ||
135 | req->callback = pcf50633_adc_sync_read_callback; | ||
136 | req->callback_param = req; | ||
137 | |||
138 | init_completion(&req->completion); | ||
139 | adc_enqueue_request(pcf, req); | ||
140 | wait_for_completion(&req->completion); | ||
141 | |||
142 | return req->result; | ||
143 | } | ||
144 | EXPORT_SYMBOL_GPL(pcf50633_adc_sync_read); | ||
145 | |||
146 | int pcf50633_adc_async_read(struct pcf50633 *pcf, int mux, int avg, | ||
147 | void (*callback)(struct pcf50633 *, void *, int), | ||
148 | void *callback_param) | ||
149 | { | ||
150 | struct pcf50633_adc_request *req; | ||
151 | |||
152 | /* req is freed when the result is ready, in interrupt handler */ | ||
153 | req = kmalloc(sizeof(*req), GFP_KERNEL); | ||
154 | if (!req) | ||
155 | return -ENOMEM; | ||
156 | |||
157 | req->mux = mux; | ||
158 | req->avg = avg; | ||
159 | req->callback = callback; | ||
160 | req->callback_param = callback_param; | ||
161 | |||
162 | adc_enqueue_request(pcf, req); | ||
163 | |||
164 | return 0; | ||
165 | } | ||
166 | EXPORT_SYMBOL_GPL(pcf50633_adc_async_read); | ||
167 | |||
168 | static int adc_result(struct pcf50633 *pcf) | ||
169 | { | ||
170 | u8 adcs1, adcs3; | ||
171 | u16 result; | ||
172 | |||
173 | adcs1 = pcf50633_reg_read(pcf, PCF50633_REG_ADCS1); | ||
174 | adcs3 = pcf50633_reg_read(pcf, PCF50633_REG_ADCS3); | ||
175 | result = (adcs1 << 2) | (adcs3 & PCF50633_ADCS3_ADCDAT1L_MASK); | ||
176 | |||
177 | dev_dbg(pcf->dev, "adc result = %d\n", result); | ||
178 | |||
179 | return result; | ||
180 | } | ||
181 | |||
182 | static void pcf50633_adc_irq(int irq, void *data) | ||
183 | { | ||
184 | struct pcf50633_adc *adc = data; | ||
185 | struct pcf50633 *pcf = adc->pcf; | ||
186 | struct pcf50633_adc_request *req; | ||
187 | int head; | ||
188 | |||
189 | mutex_lock(&adc->queue_mutex); | ||
190 | head = adc->queue_head; | ||
191 | |||
192 | req = adc->queue[head]; | ||
193 | if (WARN_ON(!req)) { | ||
194 | dev_err(pcf->dev, "pcf50633-adc irq: ADC queue empty!\n"); | ||
195 | mutex_unlock(&adc->queue_mutex); | ||
196 | return; | ||
197 | } | ||
198 | adc->queue[head] = NULL; | ||
199 | adc->queue_head = (head + 1) & | ||
200 | (PCF50633_MAX_ADC_FIFO_DEPTH - 1); | ||
201 | |||
202 | mutex_unlock(&adc->queue_mutex); | ||
203 | |||
204 | req->callback(pcf, req->callback_param, adc_result(pcf)); | ||
205 | kfree(req); | ||
206 | |||
207 | trigger_next_adc_job_if_any(pcf); | ||
208 | } | ||
209 | |||
210 | static int __devinit pcf50633_adc_probe(struct platform_device *pdev) | ||
211 | { | ||
212 | struct pcf50633_subdev_pdata *pdata = pdev->dev.platform_data; | ||
213 | struct pcf50633_adc *adc; | ||
214 | |||
215 | adc = kzalloc(sizeof(*adc), GFP_KERNEL); | ||
216 | if (!adc) | ||
217 | return -ENOMEM; | ||
218 | |||
219 | adc->pcf = pdata->pcf; | ||
220 | platform_set_drvdata(pdev, adc); | ||
221 | |||
222 | pcf50633_register_irq(pdata->pcf, PCF50633_IRQ_ADCRDY, | ||
223 | pcf50633_adc_irq, adc); | ||
224 | |||
225 | mutex_init(&adc->queue_mutex); | ||
226 | |||
227 | return 0; | ||
228 | } | ||
229 | |||
230 | static int __devexit pcf50633_adc_remove(struct platform_device *pdev) | ||
231 | { | ||
232 | struct pcf50633_adc *adc = platform_get_drvdata(pdev); | ||
233 | int i, head; | ||
234 | |||
235 | pcf50633_free_irq(adc->pcf, PCF50633_IRQ_ADCRDY); | ||
236 | |||
237 | mutex_lock(&adc->queue_mutex); | ||
238 | head = adc->queue_head; | ||
239 | |||
240 | if (WARN_ON(adc->queue[head])) | ||
241 | dev_err(adc->pcf->dev, | ||
242 | "adc driver removed with request pending\n"); | ||
243 | |||
244 | for (i = 0; i < PCF50633_MAX_ADC_FIFO_DEPTH; i++) | ||
245 | kfree(adc->queue[i]); | ||
246 | |||
247 | mutex_unlock(&adc->queue_mutex); | ||
248 | kfree(adc); | ||
249 | |||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | static struct platform_driver pcf50633_adc_driver = { | ||
254 | .driver = { | ||
255 | .name = "pcf50633-adc", | ||
256 | }, | ||
257 | .probe = pcf50633_adc_probe, | ||
258 | .remove = __devexit_p(pcf50633_adc_remove), | ||
259 | }; | ||
260 | |||
261 | static int __init pcf50633_adc_init(void) | ||
262 | { | ||
263 | return platform_driver_register(&pcf50633_adc_driver); | ||
264 | } | ||
265 | module_init(pcf50633_adc_init); | ||
266 | |||
267 | static void __exit pcf50633_adc_exit(void) | ||
268 | { | ||
269 | platform_driver_unregister(&pcf50633_adc_driver); | ||
270 | } | ||
271 | module_exit(pcf50633_adc_exit); | ||
272 | |||
273 | MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>"); | ||
274 | MODULE_DESCRIPTION("PCF50633 adc driver"); | ||
275 | MODULE_LICENSE("GPL"); | ||
276 | MODULE_ALIAS("platform:pcf50633-adc"); | ||
277 | |||
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c new file mode 100644 index 000000000000..24508e28e3fb --- /dev/null +++ b/drivers/mfd/pcf50633-core.c | |||
@@ -0,0 +1,710 @@ | |||
1 | /* NXP PCF50633 Power Management Unit (PMU) driver | ||
2 | * | ||
3 | * (C) 2006-2008 by Openmoko, Inc. | ||
4 | * Author: Harald Welte <laforge@openmoko.org> | ||
5 | * Balaji Rao <balajirrao@openmoko.org> | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/device.h> | ||
17 | #include <linux/sysfs.h> | ||
18 | #include <linux/device.h> | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/types.h> | ||
21 | #include <linux/interrupt.h> | ||
22 | #include <linux/workqueue.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/i2c.h> | ||
25 | #include <linux/irq.h> | ||
26 | |||
27 | #include <linux/mfd/pcf50633/core.h> | ||
28 | |||
29 | /* Two MBCS registers used during cold start */ | ||
30 | #define PCF50633_REG_MBCS1 0x4b | ||
31 | #define PCF50633_REG_MBCS2 0x4c | ||
32 | #define PCF50633_MBCS1_USBPRES 0x01 | ||
33 | #define PCF50633_MBCS1_ADAPTPRES 0x01 | ||
34 | |||
35 | static int __pcf50633_read(struct pcf50633 *pcf, u8 reg, int num, u8 *data) | ||
36 | { | ||
37 | int ret; | ||
38 | |||
39 | ret = i2c_smbus_read_i2c_block_data(pcf->i2c_client, reg, | ||
40 | num, data); | ||
41 | if (ret < 0) | ||
42 | dev_err(pcf->dev, "Error reading %d regs at %d\n", num, reg); | ||
43 | |||
44 | return ret; | ||
45 | } | ||
46 | |||
47 | static int __pcf50633_write(struct pcf50633 *pcf, u8 reg, int num, u8 *data) | ||
48 | { | ||
49 | int ret; | ||
50 | |||
51 | ret = i2c_smbus_write_i2c_block_data(pcf->i2c_client, reg, | ||
52 | num, data); | ||
53 | if (ret < 0) | ||
54 | dev_err(pcf->dev, "Error writing %d regs at %d\n", num, reg); | ||
55 | |||
56 | return ret; | ||
57 | |||
58 | } | ||
59 | |||
60 | /* Read a block of upto 32 regs */ | ||
61 | int pcf50633_read_block(struct pcf50633 *pcf, u8 reg, | ||
62 | int nr_regs, u8 *data) | ||
63 | { | ||
64 | int ret; | ||
65 | |||
66 | mutex_lock(&pcf->lock); | ||
67 | ret = __pcf50633_read(pcf, reg, nr_regs, data); | ||
68 | mutex_unlock(&pcf->lock); | ||
69 | |||
70 | return ret; | ||
71 | } | ||
72 | EXPORT_SYMBOL_GPL(pcf50633_read_block); | ||
73 | |||
74 | /* Write a block of upto 32 regs */ | ||
75 | int pcf50633_write_block(struct pcf50633 *pcf , u8 reg, | ||
76 | int nr_regs, u8 *data) | ||
77 | { | ||
78 | int ret; | ||
79 | |||
80 | mutex_lock(&pcf->lock); | ||
81 | ret = __pcf50633_write(pcf, reg, nr_regs, data); | ||
82 | mutex_unlock(&pcf->lock); | ||
83 | |||
84 | return ret; | ||
85 | } | ||
86 | EXPORT_SYMBOL_GPL(pcf50633_write_block); | ||
87 | |||
88 | u8 pcf50633_reg_read(struct pcf50633 *pcf, u8 reg) | ||
89 | { | ||
90 | u8 val; | ||
91 | |||
92 | mutex_lock(&pcf->lock); | ||
93 | __pcf50633_read(pcf, reg, 1, &val); | ||
94 | mutex_unlock(&pcf->lock); | ||
95 | |||
96 | return val; | ||
97 | } | ||
98 | EXPORT_SYMBOL_GPL(pcf50633_reg_read); | ||
99 | |||
100 | int pcf50633_reg_write(struct pcf50633 *pcf, u8 reg, u8 val) | ||
101 | { | ||
102 | int ret; | ||
103 | |||
104 | mutex_lock(&pcf->lock); | ||
105 | ret = __pcf50633_write(pcf, reg, 1, &val); | ||
106 | mutex_unlock(&pcf->lock); | ||
107 | |||
108 | return ret; | ||
109 | } | ||
110 | EXPORT_SYMBOL_GPL(pcf50633_reg_write); | ||
111 | |||
112 | int pcf50633_reg_set_bit_mask(struct pcf50633 *pcf, u8 reg, u8 mask, u8 val) | ||
113 | { | ||
114 | int ret; | ||
115 | u8 tmp; | ||
116 | |||
117 | val &= mask; | ||
118 | |||
119 | mutex_lock(&pcf->lock); | ||
120 | ret = __pcf50633_read(pcf, reg, 1, &tmp); | ||
121 | if (ret < 0) | ||
122 | goto out; | ||
123 | |||
124 | tmp &= ~mask; | ||
125 | tmp |= val; | ||
126 | ret = __pcf50633_write(pcf, reg, 1, &tmp); | ||
127 | |||
128 | out: | ||
129 | mutex_unlock(&pcf->lock); | ||
130 | |||
131 | return ret; | ||
132 | } | ||
133 | EXPORT_SYMBOL_GPL(pcf50633_reg_set_bit_mask); | ||
134 | |||
135 | int pcf50633_reg_clear_bits(struct pcf50633 *pcf, u8 reg, u8 val) | ||
136 | { | ||
137 | int ret; | ||
138 | u8 tmp; | ||
139 | |||
140 | mutex_lock(&pcf->lock); | ||
141 | ret = __pcf50633_read(pcf, reg, 1, &tmp); | ||
142 | if (ret < 0) | ||
143 | goto out; | ||
144 | |||
145 | tmp &= ~val; | ||
146 | ret = __pcf50633_write(pcf, reg, 1, &tmp); | ||
147 | |||
148 | out: | ||
149 | mutex_unlock(&pcf->lock); | ||
150 | |||
151 | return ret; | ||
152 | } | ||
153 | EXPORT_SYMBOL_GPL(pcf50633_reg_clear_bits); | ||
154 | |||
155 | /* sysfs attributes */ | ||
156 | static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr, | ||
157 | char *buf) | ||
158 | { | ||
159 | struct pcf50633 *pcf = dev_get_drvdata(dev); | ||
160 | u8 dump[16]; | ||
161 | int n, n1, idx = 0; | ||
162 | char *buf1 = buf; | ||
163 | static u8 address_no_read[] = { /* must be ascending */ | ||
164 | PCF50633_REG_INT1, | ||
165 | PCF50633_REG_INT2, | ||
166 | PCF50633_REG_INT3, | ||
167 | PCF50633_REG_INT4, | ||
168 | PCF50633_REG_INT5, | ||
169 | 0 /* terminator */ | ||
170 | }; | ||
171 | |||
172 | for (n = 0; n < 256; n += sizeof(dump)) { | ||
173 | for (n1 = 0; n1 < sizeof(dump); n1++) | ||
174 | if (n == address_no_read[idx]) { | ||
175 | idx++; | ||
176 | dump[n1] = 0x00; | ||
177 | } else | ||
178 | dump[n1] = pcf50633_reg_read(pcf, n + n1); | ||
179 | |||
180 | hex_dump_to_buffer(dump, sizeof(dump), 16, 1, buf1, 128, 0); | ||
181 | buf1 += strlen(buf1); | ||
182 | *buf1++ = '\n'; | ||
183 | *buf1 = '\0'; | ||
184 | } | ||
185 | |||
186 | return buf1 - buf; | ||
187 | } | ||
188 | static DEVICE_ATTR(dump_regs, 0400, show_dump_regs, NULL); | ||
189 | |||
190 | static ssize_t show_resume_reason(struct device *dev, | ||
191 | struct device_attribute *attr, char *buf) | ||
192 | { | ||
193 | struct pcf50633 *pcf = dev_get_drvdata(dev); | ||
194 | int n; | ||
195 | |||
196 | n = sprintf(buf, "%02x%02x%02x%02x%02x\n", | ||
197 | pcf->resume_reason[0], | ||
198 | pcf->resume_reason[1], | ||
199 | pcf->resume_reason[2], | ||
200 | pcf->resume_reason[3], | ||
201 | pcf->resume_reason[4]); | ||
202 | |||
203 | return n; | ||
204 | } | ||
205 | static DEVICE_ATTR(resume_reason, 0400, show_resume_reason, NULL); | ||
206 | |||
207 | static struct attribute *pcf_sysfs_entries[] = { | ||
208 | &dev_attr_dump_regs.attr, | ||
209 | &dev_attr_resume_reason.attr, | ||
210 | NULL, | ||
211 | }; | ||
212 | |||
213 | static struct attribute_group pcf_attr_group = { | ||
214 | .name = NULL, /* put in device directory */ | ||
215 | .attrs = pcf_sysfs_entries, | ||
216 | }; | ||
217 | |||
218 | int pcf50633_register_irq(struct pcf50633 *pcf, int irq, | ||
219 | void (*handler) (int, void *), void *data) | ||
220 | { | ||
221 | if (irq < 0 || irq > PCF50633_NUM_IRQ || !handler) | ||
222 | return -EINVAL; | ||
223 | |||
224 | if (WARN_ON(pcf->irq_handler[irq].handler)) | ||
225 | return -EBUSY; | ||
226 | |||
227 | mutex_lock(&pcf->lock); | ||
228 | pcf->irq_handler[irq].handler = handler; | ||
229 | pcf->irq_handler[irq].data = data; | ||
230 | mutex_unlock(&pcf->lock); | ||
231 | |||
232 | return 0; | ||
233 | } | ||
234 | EXPORT_SYMBOL_GPL(pcf50633_register_irq); | ||
235 | |||
236 | int pcf50633_free_irq(struct pcf50633 *pcf, int irq) | ||
237 | { | ||
238 | if (irq < 0 || irq > PCF50633_NUM_IRQ) | ||
239 | return -EINVAL; | ||
240 | |||
241 | mutex_lock(&pcf->lock); | ||
242 | pcf->irq_handler[irq].handler = NULL; | ||
243 | mutex_unlock(&pcf->lock); | ||
244 | |||
245 | return 0; | ||
246 | } | ||
247 | EXPORT_SYMBOL_GPL(pcf50633_free_irq); | ||
248 | |||
249 | static int __pcf50633_irq_mask_set(struct pcf50633 *pcf, int irq, u8 mask) | ||
250 | { | ||
251 | u8 reg, bits, tmp; | ||
252 | int ret = 0, idx; | ||
253 | |||
254 | idx = irq >> 3; | ||
255 | reg = PCF50633_REG_INT1M + idx; | ||
256 | bits = 1 << (irq & 0x07); | ||
257 | |||
258 | mutex_lock(&pcf->lock); | ||
259 | |||
260 | if (mask) { | ||
261 | ret = __pcf50633_read(pcf, reg, 1, &tmp); | ||
262 | if (ret < 0) | ||
263 | goto out; | ||
264 | |||
265 | tmp |= bits; | ||
266 | |||
267 | ret = __pcf50633_write(pcf, reg, 1, &tmp); | ||
268 | if (ret < 0) | ||
269 | goto out; | ||
270 | |||
271 | pcf->mask_regs[idx] &= ~bits; | ||
272 | pcf->mask_regs[idx] |= bits; | ||
273 | } else { | ||
274 | ret = __pcf50633_read(pcf, reg, 1, &tmp); | ||
275 | if (ret < 0) | ||
276 | goto out; | ||
277 | |||
278 | tmp &= ~bits; | ||
279 | |||
280 | ret = __pcf50633_write(pcf, reg, 1, &tmp); | ||
281 | if (ret < 0) | ||
282 | goto out; | ||
283 | |||
284 | pcf->mask_regs[idx] &= ~bits; | ||
285 | } | ||
286 | out: | ||
287 | mutex_unlock(&pcf->lock); | ||
288 | |||
289 | return ret; | ||
290 | } | ||
291 | |||
292 | int pcf50633_irq_mask(struct pcf50633 *pcf, int irq) | ||
293 | { | ||
294 | dev_info(pcf->dev, "Masking IRQ %d\n", irq); | ||
295 | |||
296 | return __pcf50633_irq_mask_set(pcf, irq, 1); | ||
297 | } | ||
298 | EXPORT_SYMBOL_GPL(pcf50633_irq_mask); | ||
299 | |||
300 | int pcf50633_irq_unmask(struct pcf50633 *pcf, int irq) | ||
301 | { | ||
302 | dev_info(pcf->dev, "Unmasking IRQ %d\n", irq); | ||
303 | |||
304 | return __pcf50633_irq_mask_set(pcf, irq, 0); | ||
305 | } | ||
306 | EXPORT_SYMBOL_GPL(pcf50633_irq_unmask); | ||
307 | |||
308 | int pcf50633_irq_mask_get(struct pcf50633 *pcf, int irq) | ||
309 | { | ||
310 | u8 reg, bits; | ||
311 | |||
312 | reg = irq >> 3; | ||
313 | bits = 1 << (irq & 0x07); | ||
314 | |||
315 | return pcf->mask_regs[reg] & bits; | ||
316 | } | ||
317 | EXPORT_SYMBOL_GPL(pcf50633_irq_mask_get); | ||
318 | |||
319 | static void pcf50633_irq_call_handler(struct pcf50633 *pcf, int irq) | ||
320 | { | ||
321 | if (pcf->irq_handler[irq].handler) | ||
322 | pcf->irq_handler[irq].handler(irq, pcf->irq_handler[irq].data); | ||
323 | } | ||
324 | |||
325 | /* Maximum amount of time ONKEY is held before emergency action is taken */ | ||
326 | #define PCF50633_ONKEY1S_TIMEOUT 8 | ||
327 | |||
328 | static void pcf50633_irq_worker(struct work_struct *work) | ||
329 | { | ||
330 | struct pcf50633 *pcf; | ||
331 | int ret, i, j; | ||
332 | u8 pcf_int[5], chgstat; | ||
333 | |||
334 | pcf = container_of(work, struct pcf50633, irq_work); | ||
335 | |||
336 | /* Read the 5 INT regs in one transaction */ | ||
337 | ret = pcf50633_read_block(pcf, PCF50633_REG_INT1, | ||
338 | ARRAY_SIZE(pcf_int), pcf_int); | ||
339 | if (ret != ARRAY_SIZE(pcf_int)) { | ||
340 | dev_err(pcf->dev, "Error reading INT registers\n"); | ||
341 | |||
342 | /* | ||
343 | * If this doesn't ACK the interrupt to the chip, we'll be | ||
344 | * called once again as we're level triggered. | ||
345 | */ | ||
346 | goto out; | ||
347 | } | ||
348 | |||
349 | /* We immediately read the usb and adapter status. We thus make sure | ||
350 | * only of USBINS/USBREM IRQ handlers are called */ | ||
351 | if (pcf_int[0] & (PCF50633_INT1_USBINS | PCF50633_INT1_USBREM)) { | ||
352 | chgstat = pcf50633_reg_read(pcf, PCF50633_REG_MBCS2); | ||
353 | if (chgstat & (0x3 << 4)) | ||
354 | pcf_int[0] &= ~(1 << PCF50633_INT1_USBREM); | ||
355 | else | ||
356 | pcf_int[0] &= ~(1 << PCF50633_INT1_USBINS); | ||
357 | } | ||
358 | |||
359 | /* Make sure only one of ADPINS or ADPREM is set */ | ||
360 | if (pcf_int[0] & (PCF50633_INT1_ADPINS | PCF50633_INT1_ADPREM)) { | ||
361 | chgstat = pcf50633_reg_read(pcf, PCF50633_REG_MBCS2); | ||
362 | if (chgstat & (0x3 << 4)) | ||
363 | pcf_int[0] &= ~(1 << PCF50633_INT1_ADPREM); | ||
364 | else | ||
365 | pcf_int[0] &= ~(1 << PCF50633_INT1_ADPINS); | ||
366 | } | ||
367 | |||
368 | dev_dbg(pcf->dev, "INT1=0x%02x INT2=0x%02x INT3=0x%02x " | ||
369 | "INT4=0x%02x INT5=0x%02x\n", pcf_int[0], | ||
370 | pcf_int[1], pcf_int[2], pcf_int[3], pcf_int[4]); | ||
371 | |||
372 | /* Some revisions of the chip don't have a 8s standby mode on | ||
373 | * ONKEY1S press. We try to manually do it in such cases. */ | ||
374 | if ((pcf_int[0] & PCF50633_INT1_SECOND) && pcf->onkey1s_held) { | ||
375 | dev_info(pcf->dev, "ONKEY1S held for %d secs\n", | ||
376 | pcf->onkey1s_held); | ||
377 | if (pcf->onkey1s_held++ == PCF50633_ONKEY1S_TIMEOUT) | ||
378 | if (pcf->pdata->force_shutdown) | ||
379 | pcf->pdata->force_shutdown(pcf); | ||
380 | } | ||
381 | |||
382 | if (pcf_int[2] & PCF50633_INT3_ONKEY1S) { | ||
383 | dev_info(pcf->dev, "ONKEY1S held\n"); | ||
384 | pcf->onkey1s_held = 1 ; | ||
385 | |||
386 | /* Unmask IRQ_SECOND */ | ||
387 | pcf50633_reg_clear_bits(pcf, PCF50633_REG_INT1M, | ||
388 | PCF50633_INT1_SECOND); | ||
389 | |||
390 | /* Unmask IRQ_ONKEYR */ | ||
391 | pcf50633_reg_clear_bits(pcf, PCF50633_REG_INT2M, | ||
392 | PCF50633_INT2_ONKEYR); | ||
393 | } | ||
394 | |||
395 | if ((pcf_int[1] & PCF50633_INT2_ONKEYR) && pcf->onkey1s_held) { | ||
396 | pcf->onkey1s_held = 0; | ||
397 | |||
398 | /* Mask SECOND and ONKEYR interrupts */ | ||
399 | if (pcf->mask_regs[0] & PCF50633_INT1_SECOND) | ||
400 | pcf50633_reg_set_bit_mask(pcf, | ||
401 | PCF50633_REG_INT1M, | ||
402 | PCF50633_INT1_SECOND, | ||
403 | PCF50633_INT1_SECOND); | ||
404 | |||
405 | if (pcf->mask_regs[1] & PCF50633_INT2_ONKEYR) | ||
406 | pcf50633_reg_set_bit_mask(pcf, | ||
407 | PCF50633_REG_INT2M, | ||
408 | PCF50633_INT2_ONKEYR, | ||
409 | PCF50633_INT2_ONKEYR); | ||
410 | } | ||
411 | |||
412 | /* Have we just resumed ? */ | ||
413 | if (pcf->is_suspended) { | ||
414 | pcf->is_suspended = 0; | ||
415 | |||
416 | /* Set the resume reason filtering out non resumers */ | ||
417 | for (i = 0; i < ARRAY_SIZE(pcf_int); i++) | ||
418 | pcf->resume_reason[i] = pcf_int[i] & | ||
419 | pcf->pdata->resumers[i]; | ||
420 | |||
421 | /* Make sure we don't pass on any ONKEY events to | ||
422 | * userspace now */ | ||
423 | pcf_int[1] &= ~(PCF50633_INT2_ONKEYR | PCF50633_INT2_ONKEYF); | ||
424 | } | ||
425 | |||
426 | for (i = 0; i < ARRAY_SIZE(pcf_int); i++) { | ||
427 | /* Unset masked interrupts */ | ||
428 | pcf_int[i] &= ~pcf->mask_regs[i]; | ||
429 | |||
430 | for (j = 0; j < 8 ; j++) | ||
431 | if (pcf_int[i] & (1 << j)) | ||
432 | pcf50633_irq_call_handler(pcf, (i * 8) + j); | ||
433 | } | ||
434 | |||
435 | out: | ||
436 | put_device(pcf->dev); | ||
437 | enable_irq(pcf->irq); | ||
438 | } | ||
439 | |||
440 | static irqreturn_t pcf50633_irq(int irq, void *data) | ||
441 | { | ||
442 | struct pcf50633 *pcf = data; | ||
443 | |||
444 | dev_dbg(pcf->dev, "pcf50633_irq\n"); | ||
445 | |||
446 | get_device(pcf->dev); | ||
447 | disable_irq(pcf->irq); | ||
448 | schedule_work(&pcf->irq_work); | ||
449 | |||
450 | return IRQ_HANDLED; | ||
451 | } | ||
452 | |||
453 | static void | ||
454 | pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name, | ||
455 | struct platform_device **pdev) | ||
456 | { | ||
457 | struct pcf50633_subdev_pdata *subdev_pdata; | ||
458 | int ret; | ||
459 | |||
460 | *pdev = platform_device_alloc(name, -1); | ||
461 | if (!*pdev) { | ||
462 | dev_err(pcf->dev, "Falied to allocate %s\n", name); | ||
463 | return; | ||
464 | } | ||
465 | |||
466 | subdev_pdata = kmalloc(sizeof(*subdev_pdata), GFP_KERNEL); | ||
467 | if (!subdev_pdata) { | ||
468 | dev_err(pcf->dev, "Error allocating subdev pdata\n"); | ||
469 | platform_device_put(*pdev); | ||
470 | } | ||
471 | |||
472 | subdev_pdata->pcf = pcf; | ||
473 | platform_device_add_data(*pdev, subdev_pdata, sizeof(*subdev_pdata)); | ||
474 | |||
475 | (*pdev)->dev.parent = pcf->dev; | ||
476 | |||
477 | ret = platform_device_add(*pdev); | ||
478 | if (ret) { | ||
479 | dev_err(pcf->dev, "Failed to register %s: %d\n", name, ret); | ||
480 | platform_device_put(*pdev); | ||
481 | *pdev = NULL; | ||
482 | } | ||
483 | } | ||
484 | |||
485 | #ifdef CONFIG_PM | ||
486 | static int pcf50633_suspend(struct device *dev, pm_message_t state) | ||
487 | { | ||
488 | struct pcf50633 *pcf; | ||
489 | int ret = 0, i; | ||
490 | u8 res[5]; | ||
491 | |||
492 | pcf = dev_get_drvdata(dev); | ||
493 | |||
494 | /* Make sure our interrupt handlers are not called | ||
495 | * henceforth */ | ||
496 | disable_irq(pcf->irq); | ||
497 | |||
498 | /* Make sure that any running IRQ worker has quit */ | ||
499 | cancel_work_sync(&pcf->irq_work); | ||
500 | |||
501 | /* Save the masks */ | ||
502 | ret = pcf50633_read_block(pcf, PCF50633_REG_INT1M, | ||
503 | ARRAY_SIZE(pcf->suspend_irq_masks), | ||
504 | pcf->suspend_irq_masks); | ||
505 | if (ret < 0) { | ||
506 | dev_err(pcf->dev, "error saving irq masks\n"); | ||
507 | goto out; | ||
508 | } | ||
509 | |||
510 | /* Write wakeup irq masks */ | ||
511 | for (i = 0; i < ARRAY_SIZE(res); i++) | ||
512 | res[i] = ~pcf->pdata->resumers[i]; | ||
513 | |||
514 | ret = pcf50633_write_block(pcf, PCF50633_REG_INT1M, | ||
515 | ARRAY_SIZE(res), &res[0]); | ||
516 | if (ret < 0) { | ||
517 | dev_err(pcf->dev, "error writing wakeup irq masks\n"); | ||
518 | goto out; | ||
519 | } | ||
520 | |||
521 | pcf->is_suspended = 1; | ||
522 | |||
523 | out: | ||
524 | return ret; | ||
525 | } | ||
526 | |||
527 | static int pcf50633_resume(struct device *dev) | ||
528 | { | ||
529 | struct pcf50633 *pcf; | ||
530 | int ret; | ||
531 | |||
532 | pcf = dev_get_drvdata(dev); | ||
533 | |||
534 | /* Write the saved mask registers */ | ||
535 | ret = pcf50633_write_block(pcf, PCF50633_REG_INT1M, | ||
536 | ARRAY_SIZE(pcf->suspend_irq_masks), | ||
537 | pcf->suspend_irq_masks); | ||
538 | if (ret < 0) | ||
539 | dev_err(pcf->dev, "Error restoring saved suspend masks\n"); | ||
540 | |||
541 | /* Restore regulators' state */ | ||
542 | |||
543 | |||
544 | get_device(pcf->dev); | ||
545 | |||
546 | /* | ||
547 | * Clear any pending interrupts and set resume reason if any. | ||
548 | * This will leave with enable_irq() | ||
549 | */ | ||
550 | pcf50633_irq_worker(&pcf->irq_work); | ||
551 | |||
552 | return 0; | ||
553 | } | ||
554 | #else | ||
555 | #define pcf50633_suspend NULL | ||
556 | #define pcf50633_resume NULL | ||
557 | #endif | ||
558 | |||
559 | static int __devinit pcf50633_probe(struct i2c_client *client, | ||
560 | const struct i2c_device_id *ids) | ||
561 | { | ||
562 | struct pcf50633 *pcf; | ||
563 | struct pcf50633_platform_data *pdata = client->dev.platform_data; | ||
564 | int i, ret = 0; | ||
565 | int version, variant; | ||
566 | |||
567 | pcf = kzalloc(sizeof(*pcf), GFP_KERNEL); | ||
568 | if (!pcf) | ||
569 | return -ENOMEM; | ||
570 | |||
571 | pcf->pdata = pdata; | ||
572 | |||
573 | mutex_init(&pcf->lock); | ||
574 | |||
575 | i2c_set_clientdata(client, pcf); | ||
576 | pcf->dev = &client->dev; | ||
577 | pcf->i2c_client = client; | ||
578 | pcf->irq = client->irq; | ||
579 | |||
580 | INIT_WORK(&pcf->irq_work, pcf50633_irq_worker); | ||
581 | |||
582 | version = pcf50633_reg_read(pcf, 0); | ||
583 | variant = pcf50633_reg_read(pcf, 1); | ||
584 | if (version < 0 || variant < 0) { | ||
585 | dev_err(pcf->dev, "Unable to probe pcf50633\n"); | ||
586 | ret = -ENODEV; | ||
587 | goto err; | ||
588 | } | ||
589 | |||
590 | dev_info(pcf->dev, "Probed device version %d variant %d\n", | ||
591 | version, variant); | ||
592 | |||
593 | /* Enable all interrupts except RTC SECOND */ | ||
594 | pcf->mask_regs[0] = 0x80; | ||
595 | pcf50633_reg_write(pcf, PCF50633_REG_INT1M, pcf->mask_regs[0]); | ||
596 | pcf50633_reg_write(pcf, PCF50633_REG_INT2M, 0x00); | ||
597 | pcf50633_reg_write(pcf, PCF50633_REG_INT3M, 0x00); | ||
598 | pcf50633_reg_write(pcf, PCF50633_REG_INT4M, 0x00); | ||
599 | pcf50633_reg_write(pcf, PCF50633_REG_INT5M, 0x00); | ||
600 | |||
601 | /* Create sub devices */ | ||
602 | pcf50633_client_dev_register(pcf, "pcf50633-input", | ||
603 | &pcf->input_pdev); | ||
604 | pcf50633_client_dev_register(pcf, "pcf50633-rtc", | ||
605 | &pcf->rtc_pdev); | ||
606 | pcf50633_client_dev_register(pcf, "pcf50633-mbc", | ||
607 | &pcf->mbc_pdev); | ||
608 | pcf50633_client_dev_register(pcf, "pcf50633-adc", | ||
609 | &pcf->adc_pdev); | ||
610 | |||
611 | for (i = 0; i < PCF50633_NUM_REGULATORS; i++) { | ||
612 | struct platform_device *pdev; | ||
613 | |||
614 | pdev = platform_device_alloc("pcf50633-regltr", i); | ||
615 | if (!pdev) { | ||
616 | dev_err(pcf->dev, "Cannot create regulator\n"); | ||
617 | continue; | ||
618 | } | ||
619 | |||
620 | pdev->dev.parent = pcf->dev; | ||
621 | pdev->dev.platform_data = &pdata->reg_init_data[i]; | ||
622 | pdev->dev.driver_data = pcf; | ||
623 | pcf->regulator_pdev[i] = pdev; | ||
624 | |||
625 | platform_device_add(pdev); | ||
626 | } | ||
627 | |||
628 | if (client->irq) { | ||
629 | set_irq_handler(client->irq, handle_level_irq); | ||
630 | ret = request_irq(client->irq, pcf50633_irq, | ||
631 | IRQF_TRIGGER_LOW, "pcf50633", pcf); | ||
632 | |||
633 | if (ret) { | ||
634 | dev_err(pcf->dev, "Failed to request IRQ %d\n", ret); | ||
635 | goto err; | ||
636 | } | ||
637 | } else { | ||
638 | dev_err(pcf->dev, "No IRQ configured\n"); | ||
639 | goto err; | ||
640 | } | ||
641 | |||
642 | if (enable_irq_wake(client->irq) < 0) | ||
643 | dev_err(pcf->dev, "IRQ %u cannot be enabled as wake-up source" | ||
644 | "in this hardware revision", client->irq); | ||
645 | |||
646 | ret = sysfs_create_group(&client->dev.kobj, &pcf_attr_group); | ||
647 | if (ret) | ||
648 | dev_err(pcf->dev, "error creating sysfs entries\n"); | ||
649 | |||
650 | if (pdata->probe_done) | ||
651 | pdata->probe_done(pcf); | ||
652 | |||
653 | return 0; | ||
654 | |||
655 | err: | ||
656 | kfree(pcf); | ||
657 | return ret; | ||
658 | } | ||
659 | |||
660 | static int __devexit pcf50633_remove(struct i2c_client *client) | ||
661 | { | ||
662 | struct pcf50633 *pcf = i2c_get_clientdata(client); | ||
663 | int i; | ||
664 | |||
665 | free_irq(pcf->irq, pcf); | ||
666 | |||
667 | platform_device_unregister(pcf->input_pdev); | ||
668 | platform_device_unregister(pcf->rtc_pdev); | ||
669 | platform_device_unregister(pcf->mbc_pdev); | ||
670 | platform_device_unregister(pcf->adc_pdev); | ||
671 | |||
672 | for (i = 0; i < PCF50633_NUM_REGULATORS; i++) | ||
673 | platform_device_unregister(pcf->regulator_pdev[i]); | ||
674 | |||
675 | kfree(pcf); | ||
676 | |||
677 | return 0; | ||
678 | } | ||
679 | |||
680 | static struct i2c_device_id pcf50633_id_table[] = { | ||
681 | {"pcf50633", 0x73}, | ||
682 | }; | ||
683 | |||
684 | static struct i2c_driver pcf50633_driver = { | ||
685 | .driver = { | ||
686 | .name = "pcf50633", | ||
687 | .suspend = pcf50633_suspend, | ||
688 | .resume = pcf50633_resume, | ||
689 | }, | ||
690 | .id_table = pcf50633_id_table, | ||
691 | .probe = pcf50633_probe, | ||
692 | .remove = __devexit_p(pcf50633_remove), | ||
693 | }; | ||
694 | |||
695 | static int __init pcf50633_init(void) | ||
696 | { | ||
697 | return i2c_add_driver(&pcf50633_driver); | ||
698 | } | ||
699 | |||
700 | static void __exit pcf50633_exit(void) | ||
701 | { | ||
702 | i2c_del_driver(&pcf50633_driver); | ||
703 | } | ||
704 | |||
705 | MODULE_DESCRIPTION("I2C chip driver for NXP PCF50633 PMU"); | ||
706 | MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>"); | ||
707 | MODULE_LICENSE("GPL"); | ||
708 | |||
709 | module_init(pcf50633_init); | ||
710 | module_exit(pcf50633_exit); | ||
diff --git a/drivers/mfd/pcf50633-gpio.c b/drivers/mfd/pcf50633-gpio.c new file mode 100644 index 000000000000..2fa2eca5c9cc --- /dev/null +++ b/drivers/mfd/pcf50633-gpio.c | |||
@@ -0,0 +1,118 @@ | |||
1 | /* NXP PCF50633 GPIO Driver | ||
2 | * | ||
3 | * (C) 2006-2008 by Openmoko, Inc. | ||
4 | * Author: Balaji Rao <balajirrao@openmoko.org> | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Broken down from monstrous PCF50633 driver mainly by | ||
8 | * Harald Welte, Andy Green and Werner Almesberger | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | |||
19 | #include <linux/mfd/pcf50633/core.h> | ||
20 | #include <linux/mfd/pcf50633/gpio.h> | ||
21 | |||
22 | enum pcf50633_regulator_id { | ||
23 | PCF50633_REGULATOR_AUTO, | ||
24 | PCF50633_REGULATOR_DOWN1, | ||
25 | PCF50633_REGULATOR_DOWN2, | ||
26 | PCF50633_REGULATOR_LDO1, | ||
27 | PCF50633_REGULATOR_LDO2, | ||
28 | PCF50633_REGULATOR_LDO3, | ||
29 | PCF50633_REGULATOR_LDO4, | ||
30 | PCF50633_REGULATOR_LDO5, | ||
31 | PCF50633_REGULATOR_LDO6, | ||
32 | PCF50633_REGULATOR_HCLDO, | ||
33 | PCF50633_REGULATOR_MEMLDO, | ||
34 | }; | ||
35 | |||
36 | #define PCF50633_REG_AUTOOUT 0x1a | ||
37 | #define PCF50633_REG_DOWN1OUT 0x1e | ||
38 | #define PCF50633_REG_DOWN2OUT 0x22 | ||
39 | #define PCF50633_REG_MEMLDOOUT 0x26 | ||
40 | #define PCF50633_REG_LDO1OUT 0x2d | ||
41 | #define PCF50633_REG_LDO2OUT 0x2f | ||
42 | #define PCF50633_REG_LDO3OUT 0x31 | ||
43 | #define PCF50633_REG_LDO4OUT 0x33 | ||
44 | #define PCF50633_REG_LDO5OUT 0x35 | ||
45 | #define PCF50633_REG_LDO6OUT 0x37 | ||
46 | #define PCF50633_REG_HCLDOOUT 0x39 | ||
47 | |||
48 | static const u8 pcf50633_regulator_registers[PCF50633_NUM_REGULATORS] = { | ||
49 | [PCF50633_REGULATOR_AUTO] = PCF50633_REG_AUTOOUT, | ||
50 | [PCF50633_REGULATOR_DOWN1] = PCF50633_REG_DOWN1OUT, | ||
51 | [PCF50633_REGULATOR_DOWN2] = PCF50633_REG_DOWN2OUT, | ||
52 | [PCF50633_REGULATOR_MEMLDO] = PCF50633_REG_MEMLDOOUT, | ||
53 | [PCF50633_REGULATOR_LDO1] = PCF50633_REG_LDO1OUT, | ||
54 | [PCF50633_REGULATOR_LDO2] = PCF50633_REG_LDO2OUT, | ||
55 | [PCF50633_REGULATOR_LDO3] = PCF50633_REG_LDO3OUT, | ||
56 | [PCF50633_REGULATOR_LDO4] = PCF50633_REG_LDO4OUT, | ||
57 | [PCF50633_REGULATOR_LDO5] = PCF50633_REG_LDO5OUT, | ||
58 | [PCF50633_REGULATOR_LDO6] = PCF50633_REG_LDO6OUT, | ||
59 | [PCF50633_REGULATOR_HCLDO] = PCF50633_REG_HCLDOOUT, | ||
60 | }; | ||
61 | |||
62 | int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val) | ||
63 | { | ||
64 | u8 reg; | ||
65 | |||
66 | reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG; | ||
67 | |||
68 | return pcf50633_reg_set_bit_mask(pcf, reg, 0x07, val); | ||
69 | } | ||
70 | EXPORT_SYMBOL_GPL(pcf50633_gpio_set); | ||
71 | |||
72 | u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio) | ||
73 | { | ||
74 | u8 reg, val; | ||
75 | |||
76 | reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG; | ||
77 | val = pcf50633_reg_read(pcf, reg) & 0x07; | ||
78 | |||
79 | return val; | ||
80 | } | ||
81 | EXPORT_SYMBOL_GPL(pcf50633_gpio_get); | ||
82 | |||
83 | int pcf50633_gpio_invert_set(struct pcf50633 *pcf, int gpio, int invert) | ||
84 | { | ||
85 | u8 val, reg; | ||
86 | |||
87 | reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG; | ||
88 | val = !!invert << 3; | ||
89 | |||
90 | return pcf50633_reg_set_bit_mask(pcf, reg, 1 << 3, val); | ||
91 | } | ||
92 | EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_set); | ||
93 | |||
94 | int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio) | ||
95 | { | ||
96 | u8 reg, val; | ||
97 | |||
98 | reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG; | ||
99 | val = pcf50633_reg_read(pcf, reg); | ||
100 | |||
101 | return val & (1 << 3); | ||
102 | } | ||
103 | EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_get); | ||
104 | |||
105 | int pcf50633_gpio_power_supply_set(struct pcf50633 *pcf, | ||
106 | int gpio, int regulator, int on) | ||
107 | { | ||
108 | u8 reg, val, mask; | ||
109 | |||
110 | /* the *ENA register is always one after the *OUT register */ | ||
111 | reg = pcf50633_regulator_registers[regulator] + 1; | ||
112 | |||
113 | val = !!on << (gpio - PCF50633_GPIO1); | ||
114 | mask = 1 << (gpio - PCF50633_GPIO1); | ||
115 | |||
116 | return pcf50633_reg_set_bit_mask(pcf, reg, mask, val); | ||
117 | } | ||
118 | EXPORT_SYMBOL_GPL(pcf50633_gpio_power_supply_set); | ||
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 170f9d47c2f9..0e5761f12634 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c | |||
@@ -41,6 +41,7 @@ struct sm501_gpio_chip { | |||
41 | struct gpio_chip gpio; | 41 | struct gpio_chip gpio; |
42 | struct sm501_gpio *ourgpio; /* to get back to parent. */ | 42 | struct sm501_gpio *ourgpio; /* to get back to parent. */ |
43 | void __iomem *regbase; | 43 | void __iomem *regbase; |
44 | void __iomem *control; /* address of control reg. */ | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | struct sm501_gpio { | 47 | struct sm501_gpio { |
@@ -908,6 +909,25 @@ static int sm501_gpio_get(struct gpio_chip *chip, unsigned offset) | |||
908 | return result & 1UL; | 909 | return result & 1UL; |
909 | } | 910 | } |
910 | 911 | ||
912 | static void sm501_gpio_ensure_gpio(struct sm501_gpio_chip *smchip, | ||
913 | unsigned long bit) | ||
914 | { | ||
915 | unsigned long ctrl; | ||
916 | |||
917 | /* check and modify if this pin is not set as gpio. */ | ||
918 | |||
919 | if (readl(smchip->control) & bit) { | ||
920 | dev_info(sm501_gpio_to_dev(smchip->ourgpio)->dev, | ||
921 | "changing mode of gpio, bit %08lx\n", bit); | ||
922 | |||
923 | ctrl = readl(smchip->control); | ||
924 | ctrl &= ~bit; | ||
925 | writel(ctrl, smchip->control); | ||
926 | |||
927 | sm501_sync_regs(sm501_gpio_to_dev(smchip->ourgpio)); | ||
928 | } | ||
929 | } | ||
930 | |||
911 | static void sm501_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 931 | static void sm501_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |
912 | 932 | ||
913 | { | 933 | { |
@@ -929,6 +949,8 @@ static void sm501_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | |||
929 | writel(val, regs); | 949 | writel(val, regs); |
930 | 950 | ||
931 | sm501_sync_regs(sm501_gpio_to_dev(smgpio)); | 951 | sm501_sync_regs(sm501_gpio_to_dev(smgpio)); |
952 | sm501_gpio_ensure_gpio(smchip, bit); | ||
953 | |||
932 | spin_unlock_irqrestore(&smgpio->lock, save); | 954 | spin_unlock_irqrestore(&smgpio->lock, save); |
933 | } | 955 | } |
934 | 956 | ||
@@ -941,8 +963,8 @@ static int sm501_gpio_input(struct gpio_chip *chip, unsigned offset) | |||
941 | unsigned long save; | 963 | unsigned long save; |
942 | unsigned long ddr; | 964 | unsigned long ddr; |
943 | 965 | ||
944 | dev_info(sm501_gpio_to_dev(smgpio)->dev, "%s(%p,%d)\n", | 966 | dev_dbg(sm501_gpio_to_dev(smgpio)->dev, "%s(%p,%d)\n", |
945 | __func__, chip, offset); | 967 | __func__, chip, offset); |
946 | 968 | ||
947 | spin_lock_irqsave(&smgpio->lock, save); | 969 | spin_lock_irqsave(&smgpio->lock, save); |
948 | 970 | ||
@@ -950,6 +972,8 @@ static int sm501_gpio_input(struct gpio_chip *chip, unsigned offset) | |||
950 | writel(ddr & ~bit, regs + SM501_GPIO_DDR_LOW); | 972 | writel(ddr & ~bit, regs + SM501_GPIO_DDR_LOW); |
951 | 973 | ||
952 | sm501_sync_regs(sm501_gpio_to_dev(smgpio)); | 974 | sm501_sync_regs(sm501_gpio_to_dev(smgpio)); |
975 | sm501_gpio_ensure_gpio(smchip, bit); | ||
976 | |||
953 | spin_unlock_irqrestore(&smgpio->lock, save); | 977 | spin_unlock_irqrestore(&smgpio->lock, save); |
954 | 978 | ||
955 | return 0; | 979 | return 0; |
@@ -1012,9 +1036,11 @@ static int __devinit sm501_gpio_register_chip(struct sm501_devdata *sm, | |||
1012 | if (base > 0) | 1036 | if (base > 0) |
1013 | base += 32; | 1037 | base += 32; |
1014 | chip->regbase = gpio->regs + SM501_GPIO_DATA_HIGH; | 1038 | chip->regbase = gpio->regs + SM501_GPIO_DATA_HIGH; |
1039 | chip->control = sm->regs + SM501_GPIO63_32_CONTROL; | ||
1015 | gchip->label = "SM501-HIGH"; | 1040 | gchip->label = "SM501-HIGH"; |
1016 | } else { | 1041 | } else { |
1017 | chip->regbase = gpio->regs + SM501_GPIO_DATA_LOW; | 1042 | chip->regbase = gpio->regs + SM501_GPIO_DATA_LOW; |
1043 | chip->control = sm->regs + SM501_GPIO31_0_CONTROL; | ||
1018 | gchip->label = "SM501-LOW"; | 1044 | gchip->label = "SM501-LOW"; |
1019 | } | 1045 | } |
1020 | 1046 | ||
diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c index b59c385cbc12..e7ab0035d305 100644 --- a/drivers/mfd/twl4030-core.c +++ b/drivers/mfd/twl4030-core.c | |||
@@ -38,6 +38,9 @@ | |||
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | #include <linux/i2c/twl4030.h> | 39 | #include <linux/i2c/twl4030.h> |
40 | 40 | ||
41 | #ifdef CONFIG_ARM | ||
42 | #include <mach/cpu.h> | ||
43 | #endif | ||
41 | 44 | ||
42 | /* | 45 | /* |
43 | * The TWL4030 "Triton 2" is one of a family of a multi-function "Power | 46 | * The TWL4030 "Triton 2" is one of a family of a multi-function "Power |
@@ -646,7 +649,7 @@ static inline int __init unprotect_pm_master(void) | |||
646 | return e; | 649 | return e; |
647 | } | 650 | } |
648 | 651 | ||
649 | static void __init clocks_init(void) | 652 | static void __init clocks_init(struct device *dev) |
650 | { | 653 | { |
651 | int e = 0; | 654 | int e = 0; |
652 | struct clk *osc; | 655 | struct clk *osc; |
@@ -655,9 +658,9 @@ static void __init clocks_init(void) | |||
655 | 658 | ||
656 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 659 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
657 | if (cpu_is_omap2430()) | 660 | if (cpu_is_omap2430()) |
658 | osc = clk_get(NULL, "osc_ck"); | 661 | osc = clk_get(dev, "osc_ck"); |
659 | else | 662 | else |
660 | osc = clk_get(NULL, "osc_sys_ck"); | 663 | osc = clk_get(dev, "osc_sys_ck"); |
661 | 664 | ||
662 | if (IS_ERR(osc)) { | 665 | if (IS_ERR(osc)) { |
663 | printk(KERN_WARNING "Skipping twl4030 internal clock init and " | 666 | printk(KERN_WARNING "Skipping twl4030 internal clock init and " |
@@ -773,7 +776,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
773 | inuse = true; | 776 | inuse = true; |
774 | 777 | ||
775 | /* setup clock framework */ | 778 | /* setup clock framework */ |
776 | clocks_init(); | 779 | clocks_init(&client->dev); |
777 | 780 | ||
778 | /* Maybe init the T2 Interrupt subsystem */ | 781 | /* Maybe init the T2 Interrupt subsystem */ |
779 | if (client->irq | 782 | if (client->irq |
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c index 73b7fb8de47a..82fb9958f22f 100644 --- a/drivers/misc/sgi-xp/xpc_sn2.c +++ b/drivers/misc/sgi-xp/xpc_sn2.c | |||
@@ -899,7 +899,7 @@ xpc_update_partition_info_sn2(struct xpc_partition *part, u8 remote_rp_version, | |||
899 | dev_dbg(xpc_part, " remote_vars_pa = 0x%016lx\n", | 899 | dev_dbg(xpc_part, " remote_vars_pa = 0x%016lx\n", |
900 | part_sn2->remote_vars_pa); | 900 | part_sn2->remote_vars_pa); |
901 | 901 | ||
902 | part->last_heartbeat = remote_vars->heartbeat; | 902 | part->last_heartbeat = remote_vars->heartbeat - 1; |
903 | dev_dbg(xpc_part, " last_heartbeat = 0x%016lx\n", | 903 | dev_dbg(xpc_part, " last_heartbeat = 0x%016lx\n", |
904 | part->last_heartbeat); | 904 | part->last_heartbeat); |
905 | 905 | ||
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index c092c3929224..5b91a85fe107 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c | |||
@@ -177,6 +177,7 @@ static const struct net_device_ops el2_netdev_ops = { | |||
177 | .ndo_get_stats = eip_get_stats, | 177 | .ndo_get_stats = eip_get_stats, |
178 | .ndo_set_multicast_list = eip_set_multicast_list, | 178 | .ndo_set_multicast_list = eip_set_multicast_list, |
179 | .ndo_validate_addr = eth_validate_addr, | 179 | .ndo_validate_addr = eth_validate_addr, |
180 | .ndo_set_mac_address = eth_mac_addr, | ||
180 | .ndo_change_mtu = eth_change_mtu, | 181 | .ndo_change_mtu = eth_change_mtu, |
181 | #ifdef CONFIG_NET_POLL_CONTROLLER | 182 | #ifdef CONFIG_NET_POLL_CONTROLLER |
182 | .ndo_poll_controller = eip_poll, | 183 | .ndo_poll_controller = eip_poll, |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 665e7fdf27a1..cdbbb6226fc5 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -3109,6 +3109,8 @@ static void acpi_set_WOL(struct net_device *dev) | |||
3109 | struct vortex_private *vp = netdev_priv(dev); | 3109 | struct vortex_private *vp = netdev_priv(dev); |
3110 | void __iomem *ioaddr = vp->ioaddr; | 3110 | void __iomem *ioaddr = vp->ioaddr; |
3111 | 3111 | ||
3112 | device_set_wakeup_enable(vp->gendev, vp->enable_wol); | ||
3113 | |||
3112 | if (vp->enable_wol) { | 3114 | if (vp->enable_wol) { |
3113 | /* Power up on: 1==Downloaded Filter, 2==Magic Packets, 4==Link Status. */ | 3115 | /* Power up on: 1==Downloaded Filter, 2==Magic Packets, 4==Link Status. */ |
3114 | EL3WINDOW(7); | 3116 | EL3WINDOW(7); |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index dd7ac8290aec..4e19ae3ce6be 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1821,6 +1821,7 @@ static const struct net_device_ops cp_netdev_ops = { | |||
1821 | .ndo_open = cp_open, | 1821 | .ndo_open = cp_open, |
1822 | .ndo_stop = cp_close, | 1822 | .ndo_stop = cp_close, |
1823 | .ndo_validate_addr = eth_validate_addr, | 1823 | .ndo_validate_addr = eth_validate_addr, |
1824 | .ndo_set_mac_address = eth_mac_addr, | ||
1824 | .ndo_set_multicast_list = cp_set_rx_mode, | 1825 | .ndo_set_multicast_list = cp_set_rx_mode, |
1825 | .ndo_get_stats = cp_get_stats, | 1826 | .ndo_get_stats = cp_get_stats, |
1826 | .ndo_do_ioctl = cp_ioctl, | 1827 | .ndo_do_ioctl = cp_ioctl, |
@@ -1832,6 +1833,7 @@ static const struct net_device_ops cp_netdev_ops = { | |||
1832 | #ifdef BROKEN | 1833 | #ifdef BROKEN |
1833 | .ndo_change_mtu = cp_change_mtu, | 1834 | .ndo_change_mtu = cp_change_mtu, |
1834 | #endif | 1835 | #endif |
1836 | |||
1835 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1837 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1836 | .ndo_poll_controller = cp_poll_controller, | 1838 | .ndo_poll_controller = cp_poll_controller, |
1837 | #endif | 1839 | #endif |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index fe370f805793..a5b24202d564 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -917,6 +917,7 @@ static const struct net_device_ops rtl8139_netdev_ops = { | |||
917 | .ndo_stop = rtl8139_close, | 917 | .ndo_stop = rtl8139_close, |
918 | .ndo_get_stats = rtl8139_get_stats, | 918 | .ndo_get_stats = rtl8139_get_stats, |
919 | .ndo_validate_addr = eth_validate_addr, | 919 | .ndo_validate_addr = eth_validate_addr, |
920 | .ndo_set_mac_address = eth_mac_addr, | ||
920 | .ndo_start_xmit = rtl8139_start_xmit, | 921 | .ndo_start_xmit = rtl8139_start_xmit, |
921 | .ndo_set_multicast_list = rtl8139_set_rx_mode, | 922 | .ndo_set_multicast_list = rtl8139_set_rx_mode, |
922 | .ndo_do_ioctl = netdev_ioctl, | 923 | .ndo_do_ioctl = netdev_ioctl, |
@@ -924,7 +925,6 @@ static const struct net_device_ops rtl8139_netdev_ops = { | |||
924 | #ifdef CONFIG_NET_POLL_CONTROLLER | 925 | #ifdef CONFIG_NET_POLL_CONTROLLER |
925 | .ndo_poll_controller = rtl8139_poll_controller, | 926 | .ndo_poll_controller = rtl8139_poll_controller, |
926 | #endif | 927 | #endif |
927 | |||
928 | }; | 928 | }; |
929 | 929 | ||
930 | static int __devinit rtl8139_init_one (struct pci_dev *pdev, | 930 | static int __devinit rtl8139_init_one (struct pci_dev *pdev, |
diff --git a/drivers/net/8390.c b/drivers/net/8390.c index fbe609a51e02..ec3e22e6306f 100644 --- a/drivers/net/8390.c +++ b/drivers/net/8390.c | |||
@@ -63,6 +63,7 @@ const struct net_device_ops ei_netdev_ops = { | |||
63 | .ndo_get_stats = ei_get_stats, | 63 | .ndo_get_stats = ei_get_stats, |
64 | .ndo_set_multicast_list = ei_set_multicast_list, | 64 | .ndo_set_multicast_list = ei_set_multicast_list, |
65 | .ndo_validate_addr = eth_validate_addr, | 65 | .ndo_validate_addr = eth_validate_addr, |
66 | .ndo_set_mac_address = eth_mac_addr, | ||
66 | .ndo_change_mtu = eth_change_mtu, | 67 | .ndo_change_mtu = eth_change_mtu, |
67 | #ifdef CONFIG_NET_POLL_CONTROLLER | 68 | #ifdef CONFIG_NET_POLL_CONTROLLER |
68 | .ndo_poll_controller = ei_poll, | 69 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/8390p.c b/drivers/net/8390p.c index ee70b358a816..da863c91d1d0 100644 --- a/drivers/net/8390p.c +++ b/drivers/net/8390p.c | |||
@@ -68,6 +68,7 @@ const struct net_device_ops eip_netdev_ops = { | |||
68 | .ndo_get_stats = eip_get_stats, | 68 | .ndo_get_stats = eip_get_stats, |
69 | .ndo_set_multicast_list = eip_set_multicast_list, | 69 | .ndo_set_multicast_list = eip_set_multicast_list, |
70 | .ndo_validate_addr = eth_validate_addr, | 70 | .ndo_validate_addr = eth_validate_addr, |
71 | .ndo_set_mac_address = eth_mac_addr, | ||
71 | .ndo_change_mtu = eth_change_mtu, | 72 | .ndo_change_mtu = eth_change_mtu, |
72 | #ifdef CONFIG_NET_POLL_CONTROLLER | 73 | #ifdef CONFIG_NET_POLL_CONTROLLER |
73 | .ndo_poll_controller = eip_poll, | 74 | .ndo_poll_controller = eip_poll, |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 65afda4a62d9..9fe8cb7d43ac 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1600,7 +1600,7 @@ config 8139_OLD_RX_RESET | |||
1600 | old RX-reset behavior. If unsure, say N. | 1600 | old RX-reset behavior. If unsure, say N. |
1601 | 1601 | ||
1602 | config R6040 | 1602 | config R6040 |
1603 | tristate "RDC R6040 Fast Ethernet Adapter support (EXPERIMENTAL)" | 1603 | tristate "RDC R6040 Fast Ethernet Adapter support" |
1604 | depends on NET_PCI && PCI | 1604 | depends on NET_PCI && PCI |
1605 | select CRC32 | 1605 | select CRC32 |
1606 | select MII | 1606 | select MII |
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 5b396ff6c83f..9589d620639d 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -460,6 +460,7 @@ static const struct net_device_ops ace_netdev_ops = { | |||
460 | .ndo_get_stats = ace_get_stats, | 460 | .ndo_get_stats = ace_get_stats, |
461 | .ndo_start_xmit = ace_start_xmit, | 461 | .ndo_start_xmit = ace_start_xmit, |
462 | .ndo_set_multicast_list = ace_set_multicast_list, | 462 | .ndo_set_multicast_list = ace_set_multicast_list, |
463 | .ndo_validate_addr = eth_validate_addr, | ||
463 | .ndo_set_mac_address = ace_set_mac_addr, | 464 | .ndo_set_mac_address = ace_set_mac_addr, |
464 | .ndo_change_mtu = ace_change_mtu, | 465 | .ndo_change_mtu = ace_change_mtu, |
465 | #if ACENIC_DO_VLAN | 466 | #if ACENIC_DO_VLAN |
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c index 6278606d1049..d15d8b79d8e5 100644 --- a/drivers/net/arm/etherh.c +++ b/drivers/net/arm/etherh.c | |||
@@ -646,6 +646,7 @@ static const struct net_device_ops etherh_netdev_ops = { | |||
646 | .ndo_get_stats = ei_get_stats, | 646 | .ndo_get_stats = ei_get_stats, |
647 | .ndo_set_multicast_list = ei_set_multicast_list, | 647 | .ndo_set_multicast_list = ei_set_multicast_list, |
648 | .ndo_validate_addr = eth_validate_addr, | 648 | .ndo_validate_addr = eth_validate_addr, |
649 | .ndo_set_mac_address = eth_set_mac_addr, | ||
649 | .ndo_change_mtu = eth_change_mtu, | 650 | .ndo_change_mtu = eth_change_mtu, |
650 | #ifdef CONFIG_NET_POLL_CONTROLLER | 651 | #ifdef CONFIG_NET_POLL_CONTROLLER |
651 | .ndo_poll_controller = ei_poll, | 652 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/arm/ks8695net.c b/drivers/net/arm/ks8695net.c index 9ad22d1b00fd..1cf2f949c0b4 100644 --- a/drivers/net/arm/ks8695net.c +++ b/drivers/net/arm/ks8695net.c | |||
@@ -1357,6 +1357,7 @@ static const struct net_device_ops ks8695_netdev_ops = { | |||
1357 | .ndo_start_xmit = ks8695_start_xmit, | 1357 | .ndo_start_xmit = ks8695_start_xmit, |
1358 | .ndo_tx_timeout = ks8695_timeout, | 1358 | .ndo_tx_timeout = ks8695_timeout, |
1359 | .ndo_set_mac_address = ks8695_set_mac, | 1359 | .ndo_set_mac_address = ks8695_set_mac, |
1360 | .ndo_validate_addr = eth_validate_addr, | ||
1360 | .ndo_set_multicast_list = ks8695_set_multicast, | 1361 | .ndo_set_multicast_list = ks8695_set_multicast, |
1361 | }; | 1362 | }; |
1362 | 1363 | ||
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c index 337488ec707c..a4eb6c40678c 100644 --- a/drivers/net/ax88796.c +++ b/drivers/net/ax88796.c | |||
@@ -37,7 +37,10 @@ static int phy_debug = 0; | |||
37 | #define __ei_open ax_ei_open | 37 | #define __ei_open ax_ei_open |
38 | #define __ei_close ax_ei_close | 38 | #define __ei_close ax_ei_close |
39 | #define __ei_poll ax_ei_poll | 39 | #define __ei_poll ax_ei_poll |
40 | #define __ei_start_xmit ax_ei_start_xmit | ||
40 | #define __ei_tx_timeout ax_ei_tx_timeout | 41 | #define __ei_tx_timeout ax_ei_tx_timeout |
42 | #define __ei_get_stats ax_ei_get_stats | ||
43 | #define __ei_set_multicast_list ax_ei_set_multicast_list | ||
41 | #define __ei_interrupt ax_ei_interrupt | 44 | #define __ei_interrupt ax_ei_interrupt |
42 | #define ____alloc_ei_netdev ax__alloc_ei_netdev | 45 | #define ____alloc_ei_netdev ax__alloc_ei_netdev |
43 | #define __NS8390_init ax_NS8390_init | 46 | #define __NS8390_init ax_NS8390_init |
@@ -623,6 +626,23 @@ static void ax_eeprom_register_write(struct eeprom_93cx6 *eeprom) | |||
623 | } | 626 | } |
624 | #endif | 627 | #endif |
625 | 628 | ||
629 | static const struct net_device_ops ax_netdev_ops = { | ||
630 | .ndo_open = ax_open, | ||
631 | .ndo_stop = ax_close, | ||
632 | .ndo_do_ioctl = ax_ioctl, | ||
633 | |||
634 | .ndo_start_xmit = ax_ei_start_xmit, | ||
635 | .ndo_tx_timeout = ax_ei_tx_timeout, | ||
636 | .ndo_get_stats = ax_ei_get_stats, | ||
637 | .ndo_set_multicast_list = ax_ei_set_multicast_list, | ||
638 | .ndo_validate_addr = eth_validate_addr, | ||
639 | .ndo_set_mac_address = eth_mac_addr, | ||
640 | .ndo_change_mtu = eth_change_mtu, | ||
641 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
642 | .ndo_poll_controller = ax_ei_poll, | ||
643 | #endif | ||
644 | }; | ||
645 | |||
626 | /* setup code */ | 646 | /* setup code */ |
627 | 647 | ||
628 | static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local) | 648 | static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local) |
@@ -738,9 +758,7 @@ static int ax_init_dev(struct net_device *dev, int first_init) | |||
738 | ei_status.get_8390_hdr = &ax_get_8390_hdr; | 758 | ei_status.get_8390_hdr = &ax_get_8390_hdr; |
739 | ei_status.priv = 0; | 759 | ei_status.priv = 0; |
740 | 760 | ||
741 | dev->open = ax_open; | 761 | dev->netdev_ops = &ax_netdev_ops; |
742 | dev->stop = ax_close; | ||
743 | dev->do_ioctl = ax_ioctl; | ||
744 | dev->ethtool_ops = &ax_ethtool_ops; | 762 | dev->ethtool_ops = &ax_ethtool_ops; |
745 | 763 | ||
746 | ax->msg_enable = NETIF_MSG_LINK; | 764 | ax->msg_enable = NETIF_MSG_LINK; |
@@ -753,9 +771,6 @@ static int ax_init_dev(struct net_device *dev, int first_init) | |||
753 | ax->mii.mdio_write = ax_phy_write; | 771 | ax->mii.mdio_write = ax_phy_write; |
754 | ax->mii.dev = dev; | 772 | ax->mii.dev = dev; |
755 | 773 | ||
756 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
757 | dev->poll_controller = ax_ei_poll; | ||
758 | #endif | ||
759 | ax_NS8390_init(dev, 0); | 774 | ax_NS8390_init(dev, 0); |
760 | 775 | ||
761 | if (first_init) | 776 | if (first_init) |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 6926ebedfdc9..c38512ebcea6 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -73,8 +73,8 @@ | |||
73 | (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP)) | 73 | (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP)) |
74 | #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) | 74 | #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) |
75 | 75 | ||
76 | #define RX_PKT_OFFSET 30 | 76 | #define RX_PKT_OFFSET (RX_HEADER_LEN + 2) |
77 | #define RX_PKT_BUF_SZ (1536 + RX_PKT_OFFSET + 64) | 77 | #define RX_PKT_BUF_SZ (1536 + RX_PKT_OFFSET) |
78 | 78 | ||
79 | /* minimum number of free TX descriptors required to wake up TX process */ | 79 | /* minimum number of free TX descriptors required to wake up TX process */ |
80 | #define B44_TX_WAKEUP_THRESH (B44_TX_RING_SIZE / 4) | 80 | #define B44_TX_WAKEUP_THRESH (B44_TX_RING_SIZE / 4) |
@@ -679,10 +679,10 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
679 | dev_kfree_skb_any(skb); | 679 | dev_kfree_skb_any(skb); |
680 | return -ENOMEM; | 680 | return -ENOMEM; |
681 | } | 681 | } |
682 | bp->force_copybreak = 1; | ||
682 | } | 683 | } |
683 | 684 | ||
684 | rh = (struct rx_header *) skb->data; | 685 | rh = (struct rx_header *) skb->data; |
685 | skb_reserve(skb, RX_PKT_OFFSET); | ||
686 | 686 | ||
687 | rh->len = 0; | 687 | rh->len = 0; |
688 | rh->flags = 0; | 688 | rh->flags = 0; |
@@ -693,13 +693,13 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
693 | if (src_map != NULL) | 693 | if (src_map != NULL) |
694 | src_map->skb = NULL; | 694 | src_map->skb = NULL; |
695 | 695 | ||
696 | ctrl = (DESC_CTRL_LEN & (RX_PKT_BUF_SZ - RX_PKT_OFFSET)); | 696 | ctrl = (DESC_CTRL_LEN & RX_PKT_BUF_SZ); |
697 | if (dest_idx == (B44_RX_RING_SIZE - 1)) | 697 | if (dest_idx == (B44_RX_RING_SIZE - 1)) |
698 | ctrl |= DESC_CTRL_EOT; | 698 | ctrl |= DESC_CTRL_EOT; |
699 | 699 | ||
700 | dp = &bp->rx_ring[dest_idx]; | 700 | dp = &bp->rx_ring[dest_idx]; |
701 | dp->ctrl = cpu_to_le32(ctrl); | 701 | dp->ctrl = cpu_to_le32(ctrl); |
702 | dp->addr = cpu_to_le32((u32) mapping + RX_PKT_OFFSET + bp->dma_offset); | 702 | dp->addr = cpu_to_le32((u32) mapping + bp->dma_offset); |
703 | 703 | ||
704 | if (bp->flags & B44_FLAG_RX_RING_HACK) | 704 | if (bp->flags & B44_FLAG_RX_RING_HACK) |
705 | b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, | 705 | b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, |
@@ -801,7 +801,7 @@ static int b44_rx(struct b44 *bp, int budget) | |||
801 | /* Omit CRC. */ | 801 | /* Omit CRC. */ |
802 | len -= 4; | 802 | len -= 4; |
803 | 803 | ||
804 | if (len > RX_COPY_THRESHOLD) { | 804 | if (!bp->force_copybreak && len > RX_COPY_THRESHOLD) { |
805 | int skb_size; | 805 | int skb_size; |
806 | skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod); | 806 | skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod); |
807 | if (skb_size < 0) | 807 | if (skb_size < 0) |
@@ -809,8 +809,8 @@ static int b44_rx(struct b44 *bp, int budget) | |||
809 | ssb_dma_unmap_single(bp->sdev, map, | 809 | ssb_dma_unmap_single(bp->sdev, map, |
810 | skb_size, DMA_FROM_DEVICE); | 810 | skb_size, DMA_FROM_DEVICE); |
811 | /* Leave out rx_header */ | 811 | /* Leave out rx_header */ |
812 | skb_put(skb, len + RX_PKT_OFFSET); | 812 | skb_put(skb, len + RX_PKT_OFFSET); |
813 | skb_pull(skb, RX_PKT_OFFSET); | 813 | skb_pull(skb, RX_PKT_OFFSET); |
814 | } else { | 814 | } else { |
815 | struct sk_buff *copy_skb; | 815 | struct sk_buff *copy_skb; |
816 | 816 | ||
@@ -2153,6 +2153,7 @@ static int __devinit b44_init_one(struct ssb_device *sdev, | |||
2153 | bp = netdev_priv(dev); | 2153 | bp = netdev_priv(dev); |
2154 | bp->sdev = sdev; | 2154 | bp->sdev = sdev; |
2155 | bp->dev = dev; | 2155 | bp->dev = dev; |
2156 | bp->force_copybreak = 0; | ||
2156 | 2157 | ||
2157 | bp->msg_enable = netif_msg_init(b44_debug, B44_DEF_MSG_ENABLE); | 2158 | bp->msg_enable = netif_msg_init(b44_debug, B44_DEF_MSG_ENABLE); |
2158 | 2159 | ||
diff --git a/drivers/net/b44.h b/drivers/net/b44.h index 7db0c84a7950..e678498de6db 100644 --- a/drivers/net/b44.h +++ b/drivers/net/b44.h | |||
@@ -395,7 +395,7 @@ struct b44 { | |||
395 | u32 rx_pending; | 395 | u32 rx_pending; |
396 | u32 tx_pending; | 396 | u32 tx_pending; |
397 | u8 phy_addr; | 397 | u8 phy_addr; |
398 | 398 | u8 force_copybreak; | |
399 | struct mii_if_info mii_if; | 399 | struct mii_if_info mii_if; |
400 | }; | 400 | }; |
401 | 401 | ||
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index fd705d1295a7..6fcccef4cf3d 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -20,6 +20,11 @@ | |||
20 | * (you will need to reboot afterwards) */ | 20 | * (you will need to reboot afterwards) */ |
21 | /* #define BNX2X_STOP_ON_ERROR */ | 21 | /* #define BNX2X_STOP_ON_ERROR */ |
22 | 22 | ||
23 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
24 | #define BCM_VLAN 1 | ||
25 | #endif | ||
26 | |||
27 | |||
23 | /* error/debug prints */ | 28 | /* error/debug prints */ |
24 | 29 | ||
25 | #define DRV_MODULE_NAME "bnx2x" | 30 | #define DRV_MODULE_NAME "bnx2x" |
@@ -78,11 +83,6 @@ | |||
78 | #endif | 83 | #endif |
79 | 84 | ||
80 | 85 | ||
81 | #ifdef NETIF_F_HW_VLAN_TX | ||
82 | #define BCM_VLAN 1 | ||
83 | #endif | ||
84 | |||
85 | |||
86 | #define U64_LO(x) (u32)(((u64)(x)) & 0xffffffff) | 86 | #define U64_LO(x) (u32)(((u64)(x)) & 0xffffffff) |
87 | #define U64_HI(x) (u32)(((u64)(x)) >> 32) | 87 | #define U64_HI(x) (u32)(((u64)(x)) >> 32) |
88 | #define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo)) | 88 | #define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo)) |
@@ -150,6 +150,9 @@ struct sw_rx_page { | |||
150 | 150 | ||
151 | #define PAGES_PER_SGE_SHIFT 0 | 151 | #define PAGES_PER_SGE_SHIFT 0 |
152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) | 152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) |
153 | #define SGE_PAGE_SIZE PAGE_SIZE | ||
154 | #define SGE_PAGE_SHIFT PAGE_SHIFT | ||
155 | #define SGE_PAGE_ALIGN(addr) PAGE_ALIGN(addr) | ||
153 | 156 | ||
154 | #define BCM_RX_ETH_PAYLOAD_ALIGN 64 | 157 | #define BCM_RX_ETH_PAYLOAD_ALIGN 64 |
155 | 158 | ||
@@ -736,7 +739,7 @@ struct bnx2x { | |||
736 | struct bnx2x_fastpath fp[MAX_CONTEXT]; | 739 | struct bnx2x_fastpath fp[MAX_CONTEXT]; |
737 | void __iomem *regview; | 740 | void __iomem *regview; |
738 | void __iomem *doorbells; | 741 | void __iomem *doorbells; |
739 | #define BNX2X_DB_SIZE (16*2048) | 742 | #define BNX2X_DB_SIZE (16*BCM_PAGE_SIZE) |
740 | 743 | ||
741 | struct net_device *dev; | 744 | struct net_device *dev; |
742 | struct pci_dev *pdev; | 745 | struct pci_dev *pdev; |
@@ -801,6 +804,8 @@ struct bnx2x { | |||
801 | #define TPA_ENABLE_FLAG 0x80 | 804 | #define TPA_ENABLE_FLAG 0x80 |
802 | #define NO_MCP_FLAG 0x100 | 805 | #define NO_MCP_FLAG 0x100 |
803 | #define BP_NOMCP(bp) (bp->flags & NO_MCP_FLAG) | 806 | #define BP_NOMCP(bp) (bp->flags & NO_MCP_FLAG) |
807 | #define HW_VLAN_TX_FLAG 0x400 | ||
808 | #define HW_VLAN_RX_FLAG 0x800 | ||
804 | 809 | ||
805 | int func; | 810 | int func; |
806 | #define BP_PORT(bp) (bp->func % PORT_MAX) | 811 | #define BP_PORT(bp) (bp->func % PORT_MAX) |
@@ -811,7 +816,7 @@ struct bnx2x { | |||
811 | int pm_cap; | 816 | int pm_cap; |
812 | int pcie_cap; | 817 | int pcie_cap; |
813 | 818 | ||
814 | struct work_struct sp_task; | 819 | struct delayed_work sp_task; |
815 | struct work_struct reset_task; | 820 | struct work_struct reset_task; |
816 | 821 | ||
817 | struct timer_list timer; | 822 | struct timer_list timer; |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 4be05847f86f..7c533797c064 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -38,9 +38,7 @@ | |||
38 | #include <linux/time.h> | 38 | #include <linux/time.h> |
39 | #include <linux/ethtool.h> | 39 | #include <linux/ethtool.h> |
40 | #include <linux/mii.h> | 40 | #include <linux/mii.h> |
41 | #ifdef NETIF_F_HW_VLAN_TX | 41 | #include <linux/if_vlan.h> |
42 | #include <linux/if_vlan.h> | ||
43 | #endif | ||
44 | #include <net/ip.h> | 42 | #include <net/ip.h> |
45 | #include <net/tcp.h> | 43 | #include <net/tcp.h> |
46 | #include <net/checksum.h> | 44 | #include <net/checksum.h> |
@@ -95,6 +93,7 @@ MODULE_PARM_DESC(debug, "default debug msglevel"); | |||
95 | module_param(use_multi, int, 0); | 93 | module_param(use_multi, int, 0); |
96 | MODULE_PARM_DESC(use_multi, "use per-CPU queues"); | 94 | MODULE_PARM_DESC(use_multi, "use per-CPU queues"); |
97 | #endif | 95 | #endif |
96 | static struct workqueue_struct *bnx2x_wq; | ||
98 | 97 | ||
99 | enum bnx2x_board_type { | 98 | enum bnx2x_board_type { |
100 | BCM57710 = 0, | 99 | BCM57710 = 0, |
@@ -671,7 +670,8 @@ static void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw) | |||
671 | synchronize_irq(bp->pdev->irq); | 670 | synchronize_irq(bp->pdev->irq); |
672 | 671 | ||
673 | /* make sure sp_task is not running */ | 672 | /* make sure sp_task is not running */ |
674 | cancel_work_sync(&bp->sp_task); | 673 | cancel_delayed_work(&bp->sp_task); |
674 | flush_workqueue(bnx2x_wq); | ||
675 | } | 675 | } |
676 | 676 | ||
677 | /* fast path */ | 677 | /* fast path */ |
@@ -972,7 +972,7 @@ static inline void bnx2x_free_rx_sge(struct bnx2x *bp, | |||
972 | return; | 972 | return; |
973 | 973 | ||
974 | pci_unmap_page(bp->pdev, pci_unmap_addr(sw_buf, mapping), | 974 | pci_unmap_page(bp->pdev, pci_unmap_addr(sw_buf, mapping), |
975 | BCM_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); | 975 | SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); |
976 | __free_pages(page, PAGES_PER_SGE_SHIFT); | 976 | __free_pages(page, PAGES_PER_SGE_SHIFT); |
977 | 977 | ||
978 | sw_buf->page = NULL; | 978 | sw_buf->page = NULL; |
@@ -1000,7 +1000,7 @@ static inline int bnx2x_alloc_rx_sge(struct bnx2x *bp, | |||
1000 | if (unlikely(page == NULL)) | 1000 | if (unlikely(page == NULL)) |
1001 | return -ENOMEM; | 1001 | return -ENOMEM; |
1002 | 1002 | ||
1003 | mapping = pci_map_page(bp->pdev, page, 0, BCM_PAGE_SIZE*PAGES_PER_SGE, | 1003 | mapping = pci_map_page(bp->pdev, page, 0, SGE_PAGE_SIZE*PAGES_PER_SGE, |
1004 | PCI_DMA_FROMDEVICE); | 1004 | PCI_DMA_FROMDEVICE); |
1005 | if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { | 1005 | if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { |
1006 | __free_pages(page, PAGES_PER_SGE_SHIFT); | 1006 | __free_pages(page, PAGES_PER_SGE_SHIFT); |
@@ -1096,9 +1096,9 @@ static void bnx2x_update_sge_prod(struct bnx2x_fastpath *fp, | |||
1096 | struct eth_fast_path_rx_cqe *fp_cqe) | 1096 | struct eth_fast_path_rx_cqe *fp_cqe) |
1097 | { | 1097 | { |
1098 | struct bnx2x *bp = fp->bp; | 1098 | struct bnx2x *bp = fp->bp; |
1099 | u16 sge_len = BCM_PAGE_ALIGN(le16_to_cpu(fp_cqe->pkt_len) - | 1099 | u16 sge_len = SGE_PAGE_ALIGN(le16_to_cpu(fp_cqe->pkt_len) - |
1100 | le16_to_cpu(fp_cqe->len_on_bd)) >> | 1100 | le16_to_cpu(fp_cqe->len_on_bd)) >> |
1101 | BCM_PAGE_SHIFT; | 1101 | SGE_PAGE_SHIFT; |
1102 | u16 last_max, last_elem, first_elem; | 1102 | u16 last_max, last_elem, first_elem; |
1103 | u16 delta = 0; | 1103 | u16 delta = 0; |
1104 | u16 i; | 1104 | u16 i; |
@@ -1203,22 +1203,22 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1203 | u16 cqe_idx) | 1203 | u16 cqe_idx) |
1204 | { | 1204 | { |
1205 | struct sw_rx_page *rx_pg, old_rx_pg; | 1205 | struct sw_rx_page *rx_pg, old_rx_pg; |
1206 | struct page *sge; | ||
1207 | u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd); | 1206 | u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd); |
1208 | u32 i, frag_len, frag_size, pages; | 1207 | u32 i, frag_len, frag_size, pages; |
1209 | int err; | 1208 | int err; |
1210 | int j; | 1209 | int j; |
1211 | 1210 | ||
1212 | frag_size = le16_to_cpu(fp_cqe->pkt_len) - len_on_bd; | 1211 | frag_size = le16_to_cpu(fp_cqe->pkt_len) - len_on_bd; |
1213 | pages = BCM_PAGE_ALIGN(frag_size) >> BCM_PAGE_SHIFT; | 1212 | pages = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; |
1214 | 1213 | ||
1215 | /* This is needed in order to enable forwarding support */ | 1214 | /* This is needed in order to enable forwarding support */ |
1216 | if (frag_size) | 1215 | if (frag_size) |
1217 | skb_shinfo(skb)->gso_size = min((u32)BCM_PAGE_SIZE, | 1216 | skb_shinfo(skb)->gso_size = min((u32)SGE_PAGE_SIZE, |
1218 | max(frag_size, (u32)len_on_bd)); | 1217 | max(frag_size, (u32)len_on_bd)); |
1219 | 1218 | ||
1220 | #ifdef BNX2X_STOP_ON_ERROR | 1219 | #ifdef BNX2X_STOP_ON_ERROR |
1221 | if (pages > 8*PAGES_PER_SGE) { | 1220 | if (pages > |
1221 | min((u32)8, (u32)MAX_SKB_FRAGS) * SGE_PAGE_SIZE * PAGES_PER_SGE) { | ||
1222 | BNX2X_ERR("SGL length is too long: %d. CQE index is %d\n", | 1222 | BNX2X_ERR("SGL length is too long: %d. CQE index is %d\n", |
1223 | pages, cqe_idx); | 1223 | pages, cqe_idx); |
1224 | BNX2X_ERR("fp_cqe->pkt_len = %d fp_cqe->len_on_bd = %d\n", | 1224 | BNX2X_ERR("fp_cqe->pkt_len = %d fp_cqe->len_on_bd = %d\n", |
@@ -1234,9 +1234,8 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1234 | 1234 | ||
1235 | /* FW gives the indices of the SGE as if the ring is an array | 1235 | /* FW gives the indices of the SGE as if the ring is an array |
1236 | (meaning that "next" element will consume 2 indices) */ | 1236 | (meaning that "next" element will consume 2 indices) */ |
1237 | frag_len = min(frag_size, (u32)(BCM_PAGE_SIZE*PAGES_PER_SGE)); | 1237 | frag_len = min(frag_size, (u32)(SGE_PAGE_SIZE*PAGES_PER_SGE)); |
1238 | rx_pg = &fp->rx_page_ring[sge_idx]; | 1238 | rx_pg = &fp->rx_page_ring[sge_idx]; |
1239 | sge = rx_pg->page; | ||
1240 | old_rx_pg = *rx_pg; | 1239 | old_rx_pg = *rx_pg; |
1241 | 1240 | ||
1242 | /* If we fail to allocate a substitute page, we simply stop | 1241 | /* If we fail to allocate a substitute page, we simply stop |
@@ -1249,7 +1248,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1249 | 1248 | ||
1250 | /* Unmap the page as we r going to pass it to the stack */ | 1249 | /* Unmap the page as we r going to pass it to the stack */ |
1251 | pci_unmap_page(bp->pdev, pci_unmap_addr(&old_rx_pg, mapping), | 1250 | pci_unmap_page(bp->pdev, pci_unmap_addr(&old_rx_pg, mapping), |
1252 | BCM_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); | 1251 | SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); |
1253 | 1252 | ||
1254 | /* Add one frag and update the appropriate fields in the skb */ | 1253 | /* Add one frag and update the appropriate fields in the skb */ |
1255 | skb_fill_page_desc(skb, j, old_rx_pg.page, 0, frag_len); | 1254 | skb_fill_page_desc(skb, j, old_rx_pg.page, 0, frag_len); |
@@ -1282,6 +1281,13 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1282 | if (likely(new_skb)) { | 1281 | if (likely(new_skb)) { |
1283 | /* fix ip xsum and give it to the stack */ | 1282 | /* fix ip xsum and give it to the stack */ |
1284 | /* (no need to map the new skb) */ | 1283 | /* (no need to map the new skb) */ |
1284 | #ifdef BCM_VLAN | ||
1285 | int is_vlan_cqe = | ||
1286 | (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & | ||
1287 | PARSING_FLAGS_VLAN); | ||
1288 | int is_not_hwaccel_vlan_cqe = | ||
1289 | (is_vlan_cqe && (!(bp->flags & HW_VLAN_RX_FLAG))); | ||
1290 | #endif | ||
1285 | 1291 | ||
1286 | prefetch(skb); | 1292 | prefetch(skb); |
1287 | prefetch(((char *)(skb)) + 128); | 1293 | prefetch(((char *)(skb)) + 128); |
@@ -1306,6 +1312,12 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1306 | struct iphdr *iph; | 1312 | struct iphdr *iph; |
1307 | 1313 | ||
1308 | iph = (struct iphdr *)skb->data; | 1314 | iph = (struct iphdr *)skb->data; |
1315 | #ifdef BCM_VLAN | ||
1316 | /* If there is no Rx VLAN offloading - | ||
1317 | take VLAN tag into an account */ | ||
1318 | if (unlikely(is_not_hwaccel_vlan_cqe)) | ||
1319 | iph = (struct iphdr *)((u8 *)iph + VLAN_HLEN); | ||
1320 | #endif | ||
1309 | iph->check = 0; | 1321 | iph->check = 0; |
1310 | iph->check = ip_fast_csum((u8 *)iph, iph->ihl); | 1322 | iph->check = ip_fast_csum((u8 *)iph, iph->ihl); |
1311 | } | 1323 | } |
@@ -1313,9 +1325,8 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1313 | if (!bnx2x_fill_frag_skb(bp, fp, skb, | 1325 | if (!bnx2x_fill_frag_skb(bp, fp, skb, |
1314 | &cqe->fast_path_cqe, cqe_idx)) { | 1326 | &cqe->fast_path_cqe, cqe_idx)) { |
1315 | #ifdef BCM_VLAN | 1327 | #ifdef BCM_VLAN |
1316 | if ((bp->vlgrp != NULL) && | 1328 | if ((bp->vlgrp != NULL) && is_vlan_cqe && |
1317 | (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & | 1329 | (!is_not_hwaccel_vlan_cqe)) |
1318 | PARSING_FLAGS_VLAN)) | ||
1319 | vlan_hwaccel_receive_skb(skb, bp->vlgrp, | 1330 | vlan_hwaccel_receive_skb(skb, bp->vlgrp, |
1320 | le16_to_cpu(cqe->fast_path_cqe. | 1331 | le16_to_cpu(cqe->fast_path_cqe. |
1321 | vlan_tag)); | 1332 | vlan_tag)); |
@@ -1355,11 +1366,23 @@ static inline void bnx2x_update_rx_prod(struct bnx2x *bp, | |||
1355 | rx_prods.cqe_prod = rx_comp_prod; | 1366 | rx_prods.cqe_prod = rx_comp_prod; |
1356 | rx_prods.sge_prod = rx_sge_prod; | 1367 | rx_prods.sge_prod = rx_sge_prod; |
1357 | 1368 | ||
1369 | /* | ||
1370 | * Make sure that the BD and SGE data is updated before updating the | ||
1371 | * producers since FW might read the BD/SGE right after the producer | ||
1372 | * is updated. | ||
1373 | * This is only applicable for weak-ordered memory model archs such | ||
1374 | * as IA-64. The following barrier is also mandatory since FW will | ||
1375 | * assumes BDs must have buffers. | ||
1376 | */ | ||
1377 | wmb(); | ||
1378 | |||
1358 | for (i = 0; i < sizeof(struct tstorm_eth_rx_producers)/4; i++) | 1379 | for (i = 0; i < sizeof(struct tstorm_eth_rx_producers)/4; i++) |
1359 | REG_WR(bp, BAR_TSTRORM_INTMEM + | 1380 | REG_WR(bp, BAR_TSTRORM_INTMEM + |
1360 | TSTORM_RX_PRODS_OFFSET(BP_PORT(bp), FP_CL_ID(fp)) + i*4, | 1381 | TSTORM_RX_PRODS_OFFSET(BP_PORT(bp), FP_CL_ID(fp)) + i*4, |
1361 | ((u32 *)&rx_prods)[i]); | 1382 | ((u32 *)&rx_prods)[i]); |
1362 | 1383 | ||
1384 | mmiowb(); /* keep prod updates ordered */ | ||
1385 | |||
1363 | DP(NETIF_MSG_RX_STATUS, | 1386 | DP(NETIF_MSG_RX_STATUS, |
1364 | "Wrote: bd_prod %u cqe_prod %u sge_prod %u\n", | 1387 | "Wrote: bd_prod %u cqe_prod %u sge_prod %u\n", |
1365 | bd_prod, rx_comp_prod, rx_sge_prod); | 1388 | bd_prod, rx_comp_prod, rx_sge_prod); |
@@ -1415,7 +1438,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) | |||
1415 | DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x" | 1438 | DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x" |
1416 | " queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags), | 1439 | " queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags), |
1417 | cqe_fp_flags, cqe->fast_path_cqe.status_flags, | 1440 | cqe_fp_flags, cqe->fast_path_cqe.status_flags, |
1418 | cqe->fast_path_cqe.rss_hash_result, | 1441 | le32_to_cpu(cqe->fast_path_cqe.rss_hash_result), |
1419 | le16_to_cpu(cqe->fast_path_cqe.vlan_tag), | 1442 | le16_to_cpu(cqe->fast_path_cqe.vlan_tag), |
1420 | le16_to_cpu(cqe->fast_path_cqe.pkt_len)); | 1443 | le16_to_cpu(cqe->fast_path_cqe.pkt_len)); |
1421 | 1444 | ||
@@ -1547,7 +1570,7 @@ reuse_rx: | |||
1547 | } | 1570 | } |
1548 | 1571 | ||
1549 | #ifdef BCM_VLAN | 1572 | #ifdef BCM_VLAN |
1550 | if ((bp->vlgrp != NULL) && | 1573 | if ((bp->vlgrp != NULL) && (bp->flags & HW_VLAN_RX_FLAG) && |
1551 | (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & | 1574 | (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & |
1552 | PARSING_FLAGS_VLAN)) | 1575 | PARSING_FLAGS_VLAN)) |
1553 | vlan_hwaccel_receive_skb(skb, bp->vlgrp, | 1576 | vlan_hwaccel_receive_skb(skb, bp->vlgrp, |
@@ -1580,7 +1603,6 @@ next_cqe: | |||
1580 | /* Update producers */ | 1603 | /* Update producers */ |
1581 | bnx2x_update_rx_prod(bp, fp, bd_prod_fw, sw_comp_prod, | 1604 | bnx2x_update_rx_prod(bp, fp, bd_prod_fw, sw_comp_prod, |
1582 | fp->rx_sge_prod); | 1605 | fp->rx_sge_prod); |
1583 | mmiowb(); /* keep prod updates ordered */ | ||
1584 | 1606 | ||
1585 | fp->rx_pkt += rx_pkt; | 1607 | fp->rx_pkt += rx_pkt; |
1586 | fp->rx_calls++; | 1608 | fp->rx_calls++; |
@@ -1660,7 +1682,7 @@ static irqreturn_t bnx2x_interrupt(int irq, void *dev_instance) | |||
1660 | 1682 | ||
1661 | 1683 | ||
1662 | if (unlikely(status & 0x1)) { | 1684 | if (unlikely(status & 0x1)) { |
1663 | schedule_work(&bp->sp_task); | 1685 | queue_delayed_work(bnx2x_wq, &bp->sp_task, 0); |
1664 | 1686 | ||
1665 | status &= ~0x1; | 1687 | status &= ~0x1; |
1666 | if (!status) | 1688 | if (!status) |
@@ -1887,7 +1909,8 @@ static int bnx2x_set_spio(struct bnx2x *bp, int spio_num, u32 mode) | |||
1887 | 1909 | ||
1888 | static void bnx2x_calc_fc_adv(struct bnx2x *bp) | 1910 | static void bnx2x_calc_fc_adv(struct bnx2x *bp) |
1889 | { | 1911 | { |
1890 | switch (bp->link_vars.ieee_fc) { | 1912 | switch (bp->link_vars.ieee_fc & |
1913 | MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) { | ||
1891 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE: | 1914 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE: |
1892 | bp->port.advertising &= ~(ADVERTISED_Asym_Pause | | 1915 | bp->port.advertising &= ~(ADVERTISED_Asym_Pause | |
1893 | ADVERTISED_Pause); | 1916 | ADVERTISED_Pause); |
@@ -1957,10 +1980,11 @@ static u8 bnx2x_initial_phy_init(struct bnx2x *bp) | |||
1957 | rc = bnx2x_phy_init(&bp->link_params, &bp->link_vars); | 1980 | rc = bnx2x_phy_init(&bp->link_params, &bp->link_vars); |
1958 | bnx2x_release_phy_lock(bp); | 1981 | bnx2x_release_phy_lock(bp); |
1959 | 1982 | ||
1983 | bnx2x_calc_fc_adv(bp); | ||
1984 | |||
1960 | if (bp->link_vars.link_up) | 1985 | if (bp->link_vars.link_up) |
1961 | bnx2x_link_report(bp); | 1986 | bnx2x_link_report(bp); |
1962 | 1987 | ||
1963 | bnx2x_calc_fc_adv(bp); | ||
1964 | 1988 | ||
1965 | return rc; | 1989 | return rc; |
1966 | } | 1990 | } |
@@ -2220,9 +2244,7 @@ static void bnx2x_link_attn(struct bnx2x *bp) | |||
2220 | /* Make sure that we are synced with the current statistics */ | 2244 | /* Make sure that we are synced with the current statistics */ |
2221 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); | 2245 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); |
2222 | 2246 | ||
2223 | bnx2x_acquire_phy_lock(bp); | ||
2224 | bnx2x_link_update(&bp->link_params, &bp->link_vars); | 2247 | bnx2x_link_update(&bp->link_params, &bp->link_vars); |
2225 | bnx2x_release_phy_lock(bp); | ||
2226 | 2248 | ||
2227 | if (bp->link_vars.link_up) { | 2249 | if (bp->link_vars.link_up) { |
2228 | 2250 | ||
@@ -2471,6 +2493,8 @@ static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted) | |||
2471 | if (asserted & ATTN_HARD_WIRED_MASK) { | 2493 | if (asserted & ATTN_HARD_WIRED_MASK) { |
2472 | if (asserted & ATTN_NIG_FOR_FUNC) { | 2494 | if (asserted & ATTN_NIG_FOR_FUNC) { |
2473 | 2495 | ||
2496 | bnx2x_acquire_phy_lock(bp); | ||
2497 | |||
2474 | /* save nig interrupt mask */ | 2498 | /* save nig interrupt mask */ |
2475 | bp->nig_mask = REG_RD(bp, nig_int_mask_addr); | 2499 | bp->nig_mask = REG_RD(bp, nig_int_mask_addr); |
2476 | REG_WR(bp, nig_int_mask_addr, 0); | 2500 | REG_WR(bp, nig_int_mask_addr, 0); |
@@ -2526,8 +2550,10 @@ static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted) | |||
2526 | REG_WR(bp, hc_addr, asserted); | 2550 | REG_WR(bp, hc_addr, asserted); |
2527 | 2551 | ||
2528 | /* now set back the mask */ | 2552 | /* now set back the mask */ |
2529 | if (asserted & ATTN_NIG_FOR_FUNC) | 2553 | if (asserted & ATTN_NIG_FOR_FUNC) { |
2530 | REG_WR(bp, nig_int_mask_addr, bp->nig_mask); | 2554 | REG_WR(bp, nig_int_mask_addr, bp->nig_mask); |
2555 | bnx2x_release_phy_lock(bp); | ||
2556 | } | ||
2531 | } | 2557 | } |
2532 | 2558 | ||
2533 | static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn) | 2559 | static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn) |
@@ -2795,8 +2821,10 @@ static void bnx2x_attn_int_deasserted(struct bnx2x *bp, u32 deasserted) | |||
2795 | static void bnx2x_attn_int(struct bnx2x *bp) | 2821 | static void bnx2x_attn_int(struct bnx2x *bp) |
2796 | { | 2822 | { |
2797 | /* read local copy of bits */ | 2823 | /* read local copy of bits */ |
2798 | u32 attn_bits = bp->def_status_blk->atten_status_block.attn_bits; | 2824 | u32 attn_bits = le32_to_cpu(bp->def_status_blk->atten_status_block. |
2799 | u32 attn_ack = bp->def_status_blk->atten_status_block.attn_bits_ack; | 2825 | attn_bits); |
2826 | u32 attn_ack = le32_to_cpu(bp->def_status_blk->atten_status_block. | ||
2827 | attn_bits_ack); | ||
2800 | u32 attn_state = bp->attn_state; | 2828 | u32 attn_state = bp->attn_state; |
2801 | 2829 | ||
2802 | /* look for changed bits */ | 2830 | /* look for changed bits */ |
@@ -2820,7 +2848,7 @@ static void bnx2x_attn_int(struct bnx2x *bp) | |||
2820 | 2848 | ||
2821 | static void bnx2x_sp_task(struct work_struct *work) | 2849 | static void bnx2x_sp_task(struct work_struct *work) |
2822 | { | 2850 | { |
2823 | struct bnx2x *bp = container_of(work, struct bnx2x, sp_task); | 2851 | struct bnx2x *bp = container_of(work, struct bnx2x, sp_task.work); |
2824 | u16 status; | 2852 | u16 status; |
2825 | 2853 | ||
2826 | 2854 | ||
@@ -2844,7 +2872,7 @@ static void bnx2x_sp_task(struct work_struct *work) | |||
2844 | if (status & 0x2) | 2872 | if (status & 0x2) |
2845 | bp->stats_pending = 0; | 2873 | bp->stats_pending = 0; |
2846 | 2874 | ||
2847 | bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, bp->def_att_idx, | 2875 | bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, le16_to_cpu(bp->def_att_idx), |
2848 | IGU_INT_NOP, 1); | 2876 | IGU_INT_NOP, 1); |
2849 | bnx2x_ack_sb(bp, DEF_SB_ID, USTORM_ID, le16_to_cpu(bp->def_u_idx), | 2877 | bnx2x_ack_sb(bp, DEF_SB_ID, USTORM_ID, le16_to_cpu(bp->def_u_idx), |
2850 | IGU_INT_NOP, 1); | 2878 | IGU_INT_NOP, 1); |
@@ -2875,7 +2903,7 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) | |||
2875 | return IRQ_HANDLED; | 2903 | return IRQ_HANDLED; |
2876 | #endif | 2904 | #endif |
2877 | 2905 | ||
2878 | schedule_work(&bp->sp_task); | 2906 | queue_delayed_work(bnx2x_wq, &bp->sp_task, 0); |
2879 | 2907 | ||
2880 | return IRQ_HANDLED; | 2908 | return IRQ_HANDLED; |
2881 | } | 2909 | } |
@@ -2892,7 +2920,7 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) | |||
2892 | #define ADD_64(s_hi, a_hi, s_lo, a_lo) \ | 2920 | #define ADD_64(s_hi, a_hi, s_lo, a_lo) \ |
2893 | do { \ | 2921 | do { \ |
2894 | s_lo += a_lo; \ | 2922 | s_lo += a_lo; \ |
2895 | s_hi += a_hi + (s_lo < a_lo) ? 1 : 0; \ | 2923 | s_hi += a_hi + ((s_lo < a_lo) ? 1 : 0); \ |
2896 | } while (0) | 2924 | } while (0) |
2897 | 2925 | ||
2898 | /* difference = minuend - subtrahend */ | 2926 | /* difference = minuend - subtrahend */ |
@@ -4496,7 +4524,7 @@ static void bnx2x_init_context(struct bnx2x *bp) | |||
4496 | 4524 | ||
4497 | static void bnx2x_init_ind_table(struct bnx2x *bp) | 4525 | static void bnx2x_init_ind_table(struct bnx2x *bp) |
4498 | { | 4526 | { |
4499 | int port = BP_PORT(bp); | 4527 | int func = BP_FUNC(bp); |
4500 | int i; | 4528 | int i; |
4501 | 4529 | ||
4502 | if (!is_multi(bp)) | 4530 | if (!is_multi(bp)) |
@@ -4505,10 +4533,8 @@ static void bnx2x_init_ind_table(struct bnx2x *bp) | |||
4505 | DP(NETIF_MSG_IFUP, "Initializing indirection table\n"); | 4533 | DP(NETIF_MSG_IFUP, "Initializing indirection table\n"); |
4506 | for (i = 0; i < TSTORM_INDIRECTION_TABLE_SIZE; i++) | 4534 | for (i = 0; i < TSTORM_INDIRECTION_TABLE_SIZE; i++) |
4507 | REG_WR8(bp, BAR_TSTRORM_INTMEM + | 4535 | REG_WR8(bp, BAR_TSTRORM_INTMEM + |
4508 | TSTORM_INDIRECTION_TABLE_OFFSET(port) + i, | 4536 | TSTORM_INDIRECTION_TABLE_OFFSET(func) + i, |
4509 | i % bp->num_queues); | 4537 | BP_CL_ID(bp) + (i % bp->num_queues)); |
4510 | |||
4511 | REG_WR(bp, PRS_REG_A_PRSU_20, 0xf); | ||
4512 | } | 4538 | } |
4513 | 4539 | ||
4514 | static void bnx2x_set_client_config(struct bnx2x *bp) | 4540 | static void bnx2x_set_client_config(struct bnx2x *bp) |
@@ -4517,12 +4543,12 @@ static void bnx2x_set_client_config(struct bnx2x *bp) | |||
4517 | int port = BP_PORT(bp); | 4543 | int port = BP_PORT(bp); |
4518 | int i; | 4544 | int i; |
4519 | 4545 | ||
4520 | tstorm_client.mtu = bp->dev->mtu + ETH_OVREHEAD; | 4546 | tstorm_client.mtu = bp->dev->mtu; |
4521 | tstorm_client.statistics_counter_id = BP_CL_ID(bp); | 4547 | tstorm_client.statistics_counter_id = BP_CL_ID(bp); |
4522 | tstorm_client.config_flags = | 4548 | tstorm_client.config_flags = |
4523 | TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE; | 4549 | TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE; |
4524 | #ifdef BCM_VLAN | 4550 | #ifdef BCM_VLAN |
4525 | if (bp->rx_mode && bp->vlgrp) { | 4551 | if (bp->rx_mode && bp->vlgrp && (bp->flags & HW_VLAN_RX_FLAG)) { |
4526 | tstorm_client.config_flags |= | 4552 | tstorm_client.config_flags |= |
4527 | TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE; | 4553 | TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE; |
4528 | DP(NETIF_MSG_IFUP, "vlan removal enabled\n"); | 4554 | DP(NETIF_MSG_IFUP, "vlan removal enabled\n"); |
@@ -4531,7 +4557,7 @@ static void bnx2x_set_client_config(struct bnx2x *bp) | |||
4531 | 4557 | ||
4532 | if (bp->flags & TPA_ENABLE_FLAG) { | 4558 | if (bp->flags & TPA_ENABLE_FLAG) { |
4533 | tstorm_client.max_sges_for_packet = | 4559 | tstorm_client.max_sges_for_packet = |
4534 | BCM_PAGE_ALIGN(tstorm_client.mtu) >> BCM_PAGE_SHIFT; | 4560 | SGE_PAGE_ALIGN(tstorm_client.mtu) >> SGE_PAGE_SHIFT; |
4535 | tstorm_client.max_sges_for_packet = | 4561 | tstorm_client.max_sges_for_packet = |
4536 | ((tstorm_client.max_sges_for_packet + | 4562 | ((tstorm_client.max_sges_for_packet + |
4537 | PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> | 4563 | PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> |
@@ -4714,10 +4740,11 @@ static void bnx2x_init_internal_func(struct bnx2x *bp) | |||
4714 | bp->e1hov); | 4740 | bp->e1hov); |
4715 | } | 4741 | } |
4716 | 4742 | ||
4717 | /* Init CQ ring mapping and aggregation size */ | 4743 | /* Init CQ ring mapping and aggregation size, the FW limit is 8 frags */ |
4718 | max_agg_size = min((u32)(bp->rx_buf_size + | 4744 | max_agg_size = |
4719 | 8*BCM_PAGE_SIZE*PAGES_PER_SGE), | 4745 | min((u32)(min((u32)8, (u32)MAX_SKB_FRAGS) * |
4720 | (u32)0xffff); | 4746 | SGE_PAGE_SIZE * PAGES_PER_SGE), |
4747 | (u32)0xffff); | ||
4721 | for_each_queue(bp, i) { | 4748 | for_each_queue(bp, i) { |
4722 | struct bnx2x_fastpath *fp = &bp->fp[i]; | 4749 | struct bnx2x_fastpath *fp = &bp->fp[i]; |
4723 | 4750 | ||
@@ -4785,6 +4812,15 @@ static void bnx2x_nic_init(struct bnx2x *bp, u32 load_code) | |||
4785 | bnx2x_init_context(bp); | 4812 | bnx2x_init_context(bp); |
4786 | bnx2x_init_internal(bp, load_code); | 4813 | bnx2x_init_internal(bp, load_code); |
4787 | bnx2x_init_ind_table(bp); | 4814 | bnx2x_init_ind_table(bp); |
4815 | bnx2x_stats_init(bp); | ||
4816 | |||
4817 | /* At this point, we are ready for interrupts */ | ||
4818 | atomic_set(&bp->intr_sem, 0); | ||
4819 | |||
4820 | /* flush all before enabling interrupts */ | ||
4821 | mb(); | ||
4822 | mmiowb(); | ||
4823 | |||
4788 | bnx2x_int_enable(bp); | 4824 | bnx2x_int_enable(bp); |
4789 | } | 4825 | } |
4790 | 4826 | ||
@@ -5134,7 +5170,6 @@ static int bnx2x_init_common(struct bnx2x *bp) | |||
5134 | REG_WR(bp, PXP2_REG_RQ_SRC_ENDIAN_M, 1); | 5170 | REG_WR(bp, PXP2_REG_RQ_SRC_ENDIAN_M, 1); |
5135 | REG_WR(bp, PXP2_REG_RQ_CDU_ENDIAN_M, 1); | 5171 | REG_WR(bp, PXP2_REG_RQ_CDU_ENDIAN_M, 1); |
5136 | REG_WR(bp, PXP2_REG_RQ_DBG_ENDIAN_M, 1); | 5172 | REG_WR(bp, PXP2_REG_RQ_DBG_ENDIAN_M, 1); |
5137 | REG_WR(bp, PXP2_REG_RQ_HC_ENDIAN_M, 1); | ||
5138 | 5173 | ||
5139 | /* REG_WR(bp, PXP2_REG_RD_PBF_SWAP_MODE, 1); */ | 5174 | /* REG_WR(bp, PXP2_REG_RD_PBF_SWAP_MODE, 1); */ |
5140 | REG_WR(bp, PXP2_REG_RD_QM_SWAP_MODE, 1); | 5175 | REG_WR(bp, PXP2_REG_RD_QM_SWAP_MODE, 1); |
@@ -5212,6 +5247,7 @@ static int bnx2x_init_common(struct bnx2x *bp) | |||
5212 | } | 5247 | } |
5213 | 5248 | ||
5214 | bnx2x_init_block(bp, PRS_COMMON_START, PRS_COMMON_END); | 5249 | bnx2x_init_block(bp, PRS_COMMON_START, PRS_COMMON_END); |
5250 | REG_WR(bp, PRS_REG_A_PRSU_20, 0xf); | ||
5215 | /* set NIC mode */ | 5251 | /* set NIC mode */ |
5216 | REG_WR(bp, PRS_REG_NIC_MODE, 1); | 5252 | REG_WR(bp, PRS_REG_NIC_MODE, 1); |
5217 | if (CHIP_IS_E1H(bp)) | 5253 | if (CHIP_IS_E1H(bp)) |
@@ -6393,17 +6429,8 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6393 | } | 6429 | } |
6394 | } | 6430 | } |
6395 | 6431 | ||
6396 | bnx2x_stats_init(bp); | ||
6397 | |||
6398 | bp->state = BNX2X_STATE_OPENING_WAIT4_PORT; | 6432 | bp->state = BNX2X_STATE_OPENING_WAIT4_PORT; |
6399 | 6433 | ||
6400 | /* Enable Rx interrupt handling before sending the ramrod | ||
6401 | as it's completed on Rx FP queue */ | ||
6402 | bnx2x_napi_enable(bp); | ||
6403 | |||
6404 | /* Enable interrupt handling */ | ||
6405 | atomic_set(&bp->intr_sem, 0); | ||
6406 | |||
6407 | rc = bnx2x_setup_leading(bp); | 6434 | rc = bnx2x_setup_leading(bp); |
6408 | if (rc) { | 6435 | if (rc) { |
6409 | BNX2X_ERR("Setup leading failed!\n"); | 6436 | BNX2X_ERR("Setup leading failed!\n"); |
@@ -7501,7 +7528,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
7501 | 7528 | ||
7502 | mutex_init(&bp->port.phy_mutex); | 7529 | mutex_init(&bp->port.phy_mutex); |
7503 | 7530 | ||
7504 | INIT_WORK(&bp->sp_task, bnx2x_sp_task); | 7531 | INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task); |
7505 | INIT_WORK(&bp->reset_task, bnx2x_reset_task); | 7532 | INIT_WORK(&bp->reset_task, bnx2x_reset_task); |
7506 | 7533 | ||
7507 | rc = bnx2x_get_hwinfo(bp); | 7534 | rc = bnx2x_get_hwinfo(bp); |
@@ -8727,6 +8754,8 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up) | |||
8727 | tx_bd->general_data = ((UNICAST_ADDRESS << | 8754 | tx_bd->general_data = ((UNICAST_ADDRESS << |
8728 | ETH_TX_BD_ETH_ADDR_TYPE_SHIFT) | 1); | 8755 | ETH_TX_BD_ETH_ADDR_TYPE_SHIFT) | 1); |
8729 | 8756 | ||
8757 | wmb(); | ||
8758 | |||
8730 | fp->hw_tx_prods->bds_prod = | 8759 | fp->hw_tx_prods->bds_prod = |
8731 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + 1); | 8760 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + 1); |
8732 | mb(); /* FW restriction: must not reorder writing nbd and packets */ | 8761 | mb(); /* FW restriction: must not reorder writing nbd and packets */ |
@@ -8778,7 +8807,6 @@ test_loopback_rx_exit: | |||
8778 | /* Update producers */ | 8807 | /* Update producers */ |
8779 | bnx2x_update_rx_prod(bp, fp, fp->rx_bd_prod, fp->rx_comp_prod, | 8808 | bnx2x_update_rx_prod(bp, fp, fp->rx_bd_prod, fp->rx_comp_prod, |
8780 | fp->rx_sge_prod); | 8809 | fp->rx_sge_prod); |
8781 | mmiowb(); /* keep prod updates ordered */ | ||
8782 | 8810 | ||
8783 | test_loopback_exit: | 8811 | test_loopback_exit: |
8784 | bp->link_params.loopback_mode = LOOPBACK_NONE; | 8812 | bp->link_params.loopback_mode = LOOPBACK_NONE; |
@@ -9549,11 +9577,14 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9549 | "sending pkt %u @%p next_idx %u bd %u @%p\n", | 9577 | "sending pkt %u @%p next_idx %u bd %u @%p\n", |
9550 | pkt_prod, tx_buf, fp->tx_pkt_prod, bd_prod, tx_bd); | 9578 | pkt_prod, tx_buf, fp->tx_pkt_prod, bd_prod, tx_bd); |
9551 | 9579 | ||
9552 | if ((bp->vlgrp != NULL) && vlan_tx_tag_present(skb)) { | 9580 | #ifdef BCM_VLAN |
9581 | if ((bp->vlgrp != NULL) && vlan_tx_tag_present(skb) && | ||
9582 | (bp->flags & HW_VLAN_TX_FLAG)) { | ||
9553 | tx_bd->vlan = cpu_to_le16(vlan_tx_tag_get(skb)); | 9583 | tx_bd->vlan = cpu_to_le16(vlan_tx_tag_get(skb)); |
9554 | tx_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_VLAN_TAG; | 9584 | tx_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_VLAN_TAG; |
9555 | vlan_off += 4; | 9585 | vlan_off += 4; |
9556 | } else | 9586 | } else |
9587 | #endif | ||
9557 | tx_bd->vlan = cpu_to_le16(pkt_prod); | 9588 | tx_bd->vlan = cpu_to_le16(pkt_prod); |
9558 | 9589 | ||
9559 | if (xmit_type) { | 9590 | if (xmit_type) { |
@@ -9705,6 +9736,15 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9705 | 9736 | ||
9706 | DP(NETIF_MSG_TX_QUEUED, "doorbell: nbd %d bd %u\n", nbd, bd_prod); | 9737 | DP(NETIF_MSG_TX_QUEUED, "doorbell: nbd %d bd %u\n", nbd, bd_prod); |
9707 | 9738 | ||
9739 | /* | ||
9740 | * Make sure that the BD data is updated before updating the producer | ||
9741 | * since FW might read the BD right after the producer is updated. | ||
9742 | * This is only applicable for weak-ordered memory model archs such | ||
9743 | * as IA-64. The following barrier is also mandatory since FW will | ||
9744 | * assumes packets must have BDs. | ||
9745 | */ | ||
9746 | wmb(); | ||
9747 | |||
9708 | fp->hw_tx_prods->bds_prod = | 9748 | fp->hw_tx_prods->bds_prod = |
9709 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + nbd); | 9749 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + nbd); |
9710 | mb(); /* FW restriction: must not reorder writing nbd and packets */ | 9750 | mb(); /* FW restriction: must not reorder writing nbd and packets */ |
@@ -9718,6 +9758,9 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9718 | dev->trans_start = jiffies; | 9758 | dev->trans_start = jiffies; |
9719 | 9759 | ||
9720 | if (unlikely(bnx2x_tx_avail(fp) < MAX_SKB_FRAGS + 3)) { | 9760 | if (unlikely(bnx2x_tx_avail(fp) < MAX_SKB_FRAGS + 3)) { |
9761 | /* We want bnx2x_tx_int to "see" the updated tx_bd_prod | ||
9762 | if we put Tx into XOFF state. */ | ||
9763 | smp_mb(); | ||
9721 | netif_stop_queue(dev); | 9764 | netif_stop_queue(dev); |
9722 | bp->eth_stats.driver_xoff++; | 9765 | bp->eth_stats.driver_xoff++; |
9723 | if (bnx2x_tx_avail(fp) >= MAX_SKB_FRAGS + 3) | 9766 | if (bnx2x_tx_avail(fp) >= MAX_SKB_FRAGS + 3) |
@@ -9987,6 +10030,16 @@ static void bnx2x_vlan_rx_register(struct net_device *dev, | |||
9987 | struct bnx2x *bp = netdev_priv(dev); | 10030 | struct bnx2x *bp = netdev_priv(dev); |
9988 | 10031 | ||
9989 | bp->vlgrp = vlgrp; | 10032 | bp->vlgrp = vlgrp; |
10033 | |||
10034 | /* Set flags according to the required capabilities */ | ||
10035 | bp->flags &= ~(HW_VLAN_RX_FLAG | HW_VLAN_TX_FLAG); | ||
10036 | |||
10037 | if (dev->features & NETIF_F_HW_VLAN_TX) | ||
10038 | bp->flags |= HW_VLAN_TX_FLAG; | ||
10039 | |||
10040 | if (dev->features & NETIF_F_HW_VLAN_RX) | ||
10041 | bp->flags |= HW_VLAN_RX_FLAG; | ||
10042 | |||
9990 | if (netif_running(dev)) | 10043 | if (netif_running(dev)) |
9991 | bnx2x_set_client_config(bp); | 10044 | bnx2x_set_client_config(bp); |
9992 | } | 10045 | } |
@@ -10143,6 +10196,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, | |||
10143 | dev->features |= NETIF_F_HIGHDMA; | 10196 | dev->features |= NETIF_F_HIGHDMA; |
10144 | #ifdef BCM_VLAN | 10197 | #ifdef BCM_VLAN |
10145 | dev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); | 10198 | dev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); |
10199 | bp->flags |= (HW_VLAN_RX_FLAG | HW_VLAN_TX_FLAG); | ||
10146 | #endif | 10200 | #endif |
10147 | dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN); | 10201 | dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN); |
10148 | dev->features |= NETIF_F_TSO6; | 10202 | dev->features |= NETIF_F_TSO6; |
@@ -10519,12 +10573,20 @@ static struct pci_driver bnx2x_pci_driver = { | |||
10519 | 10573 | ||
10520 | static int __init bnx2x_init(void) | 10574 | static int __init bnx2x_init(void) |
10521 | { | 10575 | { |
10576 | bnx2x_wq = create_singlethread_workqueue("bnx2x"); | ||
10577 | if (bnx2x_wq == NULL) { | ||
10578 | printk(KERN_ERR PFX "Cannot create workqueue\n"); | ||
10579 | return -ENOMEM; | ||
10580 | } | ||
10581 | |||
10522 | return pci_register_driver(&bnx2x_pci_driver); | 10582 | return pci_register_driver(&bnx2x_pci_driver); |
10523 | } | 10583 | } |
10524 | 10584 | ||
10525 | static void __exit bnx2x_cleanup(void) | 10585 | static void __exit bnx2x_cleanup(void) |
10526 | { | 10586 | { |
10527 | pci_unregister_driver(&bnx2x_pci_driver); | 10587 | pci_unregister_driver(&bnx2x_pci_driver); |
10588 | |||
10589 | destroy_workqueue(bnx2x_wq); | ||
10528 | } | 10590 | } |
10529 | 10591 | ||
10530 | module_init(bnx2x_init); | 10592 | module_init(bnx2x_init); |
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h index 5b346f9eaa8b..a89d8cc51205 100644 --- a/drivers/net/cxgb3/adapter.h +++ b/drivers/net/cxgb3/adapter.h | |||
@@ -50,12 +50,17 @@ struct vlan_group; | |||
50 | struct adapter; | 50 | struct adapter; |
51 | struct sge_qset; | 51 | struct sge_qset; |
52 | 52 | ||
53 | enum { /* rx_offload flags */ | ||
54 | T3_RX_CSUM = 1 << 0, | ||
55 | T3_LRO = 1 << 1, | ||
56 | }; | ||
57 | |||
53 | struct port_info { | 58 | struct port_info { |
54 | struct adapter *adapter; | 59 | struct adapter *adapter; |
55 | struct vlan_group *vlan_grp; | 60 | struct vlan_group *vlan_grp; |
56 | struct sge_qset *qs; | 61 | struct sge_qset *qs; |
57 | u8 port_id; | 62 | u8 port_id; |
58 | u8 rx_csum_offload; | 63 | u8 rx_offload; |
59 | u8 nqsets; | 64 | u8 nqsets; |
60 | u8 first_qset; | 65 | u8 first_qset; |
61 | struct cphy phy; | 66 | struct cphy phy; |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 2847f947499d..0089746b8d02 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -546,7 +546,7 @@ static int setup_sge_qsets(struct adapter *adap) | |||
546 | pi->qs = &adap->sge.qs[pi->first_qset]; | 546 | pi->qs = &adap->sge.qs[pi->first_qset]; |
547 | for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; | 547 | for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; |
548 | ++j, ++qset_idx) { | 548 | ++j, ++qset_idx) { |
549 | set_qset_lro(dev, qset_idx, pi->rx_csum_offload); | 549 | set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO); |
550 | err = t3_sge_alloc_qset(adap, qset_idx, 1, | 550 | err = t3_sge_alloc_qset(adap, qset_idx, 1, |
551 | (adap->flags & USING_MSIX) ? qset_idx + 1 : | 551 | (adap->flags & USING_MSIX) ? qset_idx + 1 : |
552 | irq_idx, | 552 | irq_idx, |
@@ -1657,17 +1657,19 @@ static u32 get_rx_csum(struct net_device *dev) | |||
1657 | { | 1657 | { |
1658 | struct port_info *p = netdev_priv(dev); | 1658 | struct port_info *p = netdev_priv(dev); |
1659 | 1659 | ||
1660 | return p->rx_csum_offload; | 1660 | return p->rx_offload & T3_RX_CSUM; |
1661 | } | 1661 | } |
1662 | 1662 | ||
1663 | static int set_rx_csum(struct net_device *dev, u32 data) | 1663 | static int set_rx_csum(struct net_device *dev, u32 data) |
1664 | { | 1664 | { |
1665 | struct port_info *p = netdev_priv(dev); | 1665 | struct port_info *p = netdev_priv(dev); |
1666 | 1666 | ||
1667 | p->rx_csum_offload = data; | 1667 | if (data) { |
1668 | if (!data) { | 1668 | p->rx_offload |= T3_RX_CSUM; |
1669 | } else { | ||
1669 | int i; | 1670 | int i; |
1670 | 1671 | ||
1672 | p->rx_offload &= ~(T3_RX_CSUM | T3_LRO); | ||
1671 | for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) | 1673 | for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) |
1672 | set_qset_lro(dev, i, 0); | 1674 | set_qset_lro(dev, i, 0); |
1673 | } | 1675 | } |
@@ -1830,15 +1832,18 @@ static int cxgb3_set_flags(struct net_device *dev, u32 data) | |||
1830 | int i; | 1832 | int i; |
1831 | 1833 | ||
1832 | if (data & ETH_FLAG_LRO) { | 1834 | if (data & ETH_FLAG_LRO) { |
1833 | if (!pi->rx_csum_offload) | 1835 | if (!(pi->rx_offload & T3_RX_CSUM)) |
1834 | return -EINVAL; | 1836 | return -EINVAL; |
1835 | 1837 | ||
1838 | pi->rx_offload |= T3_LRO; | ||
1836 | for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) | 1839 | for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) |
1837 | set_qset_lro(dev, i, 1); | 1840 | set_qset_lro(dev, i, 1); |
1838 | 1841 | ||
1839 | } else | 1842 | } else { |
1843 | pi->rx_offload &= ~T3_LRO; | ||
1840 | for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) | 1844 | for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) |
1841 | set_qset_lro(dev, i, 0); | 1845 | set_qset_lro(dev, i, 0); |
1846 | } | ||
1842 | 1847 | ||
1843 | return 0; | 1848 | return 0; |
1844 | } | 1849 | } |
@@ -1926,7 +1931,7 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) | |||
1926 | pi = adap2pinfo(adapter, i); | 1931 | pi = adap2pinfo(adapter, i); |
1927 | if (t.qset_idx >= pi->first_qset && | 1932 | if (t.qset_idx >= pi->first_qset && |
1928 | t.qset_idx < pi->first_qset + pi->nqsets && | 1933 | t.qset_idx < pi->first_qset + pi->nqsets && |
1929 | !pi->rx_csum_offload) | 1934 | !(pi->rx_offload & T3_RX_CSUM)) |
1930 | return -EINVAL; | 1935 | return -EINVAL; |
1931 | } | 1936 | } |
1932 | 1937 | ||
@@ -2946,7 +2951,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
2946 | adapter->port[i] = netdev; | 2951 | adapter->port[i] = netdev; |
2947 | pi = netdev_priv(netdev); | 2952 | pi = netdev_priv(netdev); |
2948 | pi->adapter = adapter; | 2953 | pi->adapter = adapter; |
2949 | pi->rx_csum_offload = 1; | 2954 | pi->rx_offload = T3_RX_CSUM | T3_LRO; |
2950 | pi->port_id = i; | 2955 | pi->port_id = i; |
2951 | netif_carrier_off(netdev); | 2956 | netif_carrier_off(netdev); |
2952 | netif_tx_stop_all_queues(netdev); | 2957 | netif_tx_stop_all_queues(netdev); |
@@ -2955,6 +2960,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
2955 | netdev->mem_end = mmio_start + mmio_len - 1; | 2960 | netdev->mem_end = mmio_start + mmio_len - 1; |
2956 | netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; | 2961 | netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; |
2957 | netdev->features |= NETIF_F_LLTX; | 2962 | netdev->features |= NETIF_F_LLTX; |
2963 | netdev->features |= NETIF_F_LRO; | ||
2958 | if (pci_using_dac) | 2964 | if (pci_using_dac) |
2959 | netdev->features |= NETIF_F_HIGHDMA; | 2965 | netdev->features |= NETIF_F_HIGHDMA; |
2960 | 2966 | ||
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 6c641a889471..14f9fb3e8795 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -1932,7 +1932,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq, | |||
1932 | skb_pull(skb, sizeof(*p) + pad); | 1932 | skb_pull(skb, sizeof(*p) + pad); |
1933 | skb->protocol = eth_type_trans(skb, adap->port[p->iff]); | 1933 | skb->protocol = eth_type_trans(skb, adap->port[p->iff]); |
1934 | pi = netdev_priv(skb->dev); | 1934 | pi = netdev_priv(skb->dev); |
1935 | if (pi->rx_csum_offload && p->csum_valid && p->csum == htons(0xffff) && | 1935 | if ((pi->rx_offload & T3_RX_CSUM) && p->csum_valid && p->csum == htons(0xffff) && |
1936 | !p->fragment) { | 1936 | !p->fragment) { |
1937 | qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++; | 1937 | qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++; |
1938 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1938 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index f2a5963b5a95..e415e81ecd3e 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -390,7 +390,8 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) | |||
390 | } | 390 | } |
391 | 391 | ||
392 | static DEFINE_MUTEX(nvm_mutex); | 392 | static DEFINE_MUTEX(nvm_mutex); |
393 | static pid_t nvm_owner = -1; | 393 | static pid_t nvm_owner_pid = -1; |
394 | static char nvm_owner_name[TASK_COMM_LEN] = ""; | ||
394 | 395 | ||
395 | /** | 396 | /** |
396 | * e1000_acquire_swflag_ich8lan - Acquire software control flag | 397 | * e1000_acquire_swflag_ich8lan - Acquire software control flag |
@@ -408,11 +409,15 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) | |||
408 | might_sleep(); | 409 | might_sleep(); |
409 | 410 | ||
410 | if (!mutex_trylock(&nvm_mutex)) { | 411 | if (!mutex_trylock(&nvm_mutex)) { |
411 | WARN(1, KERN_ERR "e1000e mutex contention. Owned by pid %d\n", | 412 | WARN(1, KERN_ERR "e1000e mutex contention. Owned by process " |
412 | nvm_owner); | 413 | "%s (pid %d), required by process %s (pid %d)\n", |
414 | nvm_owner_name, nvm_owner_pid, | ||
415 | current->comm, current->pid); | ||
416 | |||
413 | mutex_lock(&nvm_mutex); | 417 | mutex_lock(&nvm_mutex); |
414 | } | 418 | } |
415 | nvm_owner = current->pid; | 419 | nvm_owner_pid = current->pid; |
420 | strncpy(nvm_owner_name, current->comm, TASK_COMM_LEN); | ||
416 | 421 | ||
417 | while (timeout) { | 422 | while (timeout) { |
418 | extcnf_ctrl = er32(EXTCNF_CTRL); | 423 | extcnf_ctrl = er32(EXTCNF_CTRL); |
@@ -430,7 +435,8 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) | |||
430 | hw_dbg(hw, "FW or HW has locked the resource for too long.\n"); | 435 | hw_dbg(hw, "FW or HW has locked the resource for too long.\n"); |
431 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; | 436 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; |
432 | ew32(EXTCNF_CTRL, extcnf_ctrl); | 437 | ew32(EXTCNF_CTRL, extcnf_ctrl); |
433 | nvm_owner = -1; | 438 | nvm_owner_pid = -1; |
439 | strcpy(nvm_owner_name, ""); | ||
434 | mutex_unlock(&nvm_mutex); | 440 | mutex_unlock(&nvm_mutex); |
435 | return -E1000_ERR_CONFIG; | 441 | return -E1000_ERR_CONFIG; |
436 | } | 442 | } |
@@ -454,7 +460,8 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw) | |||
454 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; | 460 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; |
455 | ew32(EXTCNF_CTRL, extcnf_ctrl); | 461 | ew32(EXTCNF_CTRL, extcnf_ctrl); |
456 | 462 | ||
457 | nvm_owner = -1; | 463 | nvm_owner_pid = -1; |
464 | strcpy(nvm_owner_name, ""); | ||
458 | mutex_unlock(&nvm_mutex); | 465 | mutex_unlock(&nvm_mutex); |
459 | } | 466 | } |
460 | 467 | ||
diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c index 20eb05cddb83..b07ba1924de0 100644 --- a/drivers/net/e2100.c +++ b/drivers/net/e2100.c | |||
@@ -169,6 +169,7 @@ static const struct net_device_ops e21_netdev_ops = { | |||
169 | .ndo_get_stats = ei_get_stats, | 169 | .ndo_get_stats = ei_get_stats, |
170 | .ndo_set_multicast_list = ei_set_multicast_list, | 170 | .ndo_set_multicast_list = ei_set_multicast_list, |
171 | .ndo_validate_addr = eth_validate_addr, | 171 | .ndo_validate_addr = eth_validate_addr, |
172 | .ndo_set_mac_address = eth_mac_addr, | ||
172 | .ndo_change_mtu = eth_change_mtu, | 173 | .ndo_change_mtu = eth_change_mtu, |
173 | #ifdef CONFIG_NET_POLL_CONTROLLER | 174 | #ifdef CONFIG_NET_POLL_CONTROLLER |
174 | .ndo_poll_controller = ei_poll, | 175 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index e3131ea629cd..dfe92264e825 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -132,7 +132,7 @@ void ehea_dump(void *adr, int len, char *msg) | |||
132 | int x; | 132 | int x; |
133 | unsigned char *deb = adr; | 133 | unsigned char *deb = adr; |
134 | for (x = 0; x < len; x += 16) { | 134 | for (x = 0; x < len; x += 16) { |
135 | printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg, | 135 | printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg, |
136 | deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); | 136 | deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); |
137 | deb += 16; | 137 | deb += 16; |
138 | } | 138 | } |
@@ -883,7 +883,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param) | |||
883 | 883 | ||
884 | while (eqe) { | 884 | while (eqe) { |
885 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); | 885 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); |
886 | ehea_error("QP aff_err: entry=0x%lx, token=0x%x", | 886 | ehea_error("QP aff_err: entry=0x%llx, token=0x%x", |
887 | eqe->entry, qp_token); | 887 | eqe->entry, qp_token); |
888 | 888 | ||
889 | qp = port->port_res[qp_token].qp; | 889 | qp = port->port_res[qp_token].qp; |
@@ -1159,7 +1159,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe) | |||
1159 | netif_stop_queue(port->netdev); | 1159 | netif_stop_queue(port->netdev); |
1160 | break; | 1160 | break; |
1161 | default: | 1161 | default: |
1162 | ehea_error("unknown event code %x, eqe=0x%lX", ec, eqe); | 1162 | ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe); |
1163 | break; | 1163 | break; |
1164 | } | 1164 | } |
1165 | } | 1165 | } |
@@ -1971,7 +1971,7 @@ static void ehea_set_multicast_list(struct net_device *dev) | |||
1971 | } | 1971 | } |
1972 | 1972 | ||
1973 | if (dev->mc_count > port->adapter->max_mc_mac) { | 1973 | if (dev->mc_count > port->adapter->max_mc_mac) { |
1974 | ehea_info("Mcast registration limit reached (0x%lx). " | 1974 | ehea_info("Mcast registration limit reached (0x%llx). " |
1975 | "Use ALLMULTI!", | 1975 | "Use ALLMULTI!", |
1976 | port->adapter->max_mc_mac); | 1976 | port->adapter->max_mc_mac); |
1977 | goto out; | 1977 | goto out; |
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index 225c692b5d99..49d766ebbcf4 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -168,7 +168,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
168 | cq->fw_handle, rpage, 1); | 168 | cq->fw_handle, rpage, 1); |
169 | if (hret < H_SUCCESS) { | 169 | if (hret < H_SUCCESS) { |
170 | ehea_error("register_rpage_cq failed ehea_cq=%p " | 170 | ehea_error("register_rpage_cq failed ehea_cq=%p " |
171 | "hret=%lx counter=%i act_pages=%i", | 171 | "hret=%llx counter=%i act_pages=%i", |
172 | cq, hret, counter, cq->attr.nr_pages); | 172 | cq, hret, counter, cq->attr.nr_pages); |
173 | goto out_kill_hwq; | 173 | goto out_kill_hwq; |
174 | } | 174 | } |
@@ -178,13 +178,13 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
178 | 178 | ||
179 | if ((hret != H_SUCCESS) || (vpage)) { | 179 | if ((hret != H_SUCCESS) || (vpage)) { |
180 | ehea_error("registration of pages not " | 180 | ehea_error("registration of pages not " |
181 | "complete hret=%lx\n", hret); | 181 | "complete hret=%llx\n", hret); |
182 | goto out_kill_hwq; | 182 | goto out_kill_hwq; |
183 | } | 183 | } |
184 | } else { | 184 | } else { |
185 | if (hret != H_PAGE_REGISTERED) { | 185 | if (hret != H_PAGE_REGISTERED) { |
186 | ehea_error("CQ: registration of page failed " | 186 | ehea_error("CQ: registration of page failed " |
187 | "hret=%lx\n", hret); | 187 | "hret=%llx\n", hret); |
188 | goto out_kill_hwq; | 188 | goto out_kill_hwq; |
189 | } | 189 | } |
190 | } | 190 | } |
@@ -986,15 +986,15 @@ void print_error_data(u64 *data) | |||
986 | length = EHEA_PAGESIZE; | 986 | length = EHEA_PAGESIZE; |
987 | 987 | ||
988 | if (type == 0x8) /* Queue Pair */ | 988 | if (type == 0x8) /* Queue Pair */ |
989 | ehea_error("QP (resource=%lX) state: AER=0x%lX, AERR=0x%lX, " | 989 | ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, " |
990 | "port=%lX", resource, data[6], data[12], data[22]); | 990 | "port=%llX", resource, data[6], data[12], data[22]); |
991 | 991 | ||
992 | if (type == 0x4) /* Completion Queue */ | 992 | if (type == 0x4) /* Completion Queue */ |
993 | ehea_error("CQ (resource=%lX) state: AER=0x%lX", resource, | 993 | ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource, |
994 | data[6]); | 994 | data[6]); |
995 | 995 | ||
996 | if (type == 0x3) /* Event Queue */ | 996 | if (type == 0x3) /* Event Queue */ |
997 | ehea_error("EQ (resource=%lX) state: AER=0x%lX", resource, | 997 | ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource, |
998 | data[6]); | 998 | data[6]); |
999 | 999 | ||
1000 | ehea_dump(data, length, "error data"); | 1000 | ehea_dump(data, length, "error data"); |
@@ -1016,11 +1016,11 @@ void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle) | |||
1016 | rblock); | 1016 | rblock); |
1017 | 1017 | ||
1018 | if (ret == H_R_STATE) | 1018 | if (ret == H_R_STATE) |
1019 | ehea_error("No error data is available: %lX.", res_handle); | 1019 | ehea_error("No error data is available: %llX.", res_handle); |
1020 | else if (ret == H_SUCCESS) | 1020 | else if (ret == H_SUCCESS) |
1021 | print_error_data(rblock); | 1021 | print_error_data(rblock); |
1022 | else | 1022 | else |
1023 | ehea_error("Error data could not be fetched: %lX", res_handle); | 1023 | ehea_error("Error data could not be fetched: %llX", res_handle); |
1024 | 1024 | ||
1025 | kfree(rblock); | 1025 | kfree(rblock); |
1026 | } | 1026 | } |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index d039e16f2763..7d60551d538f 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -1599,6 +1599,7 @@ static const struct net_device_ops enic_netdev_ops = { | |||
1599 | .ndo_start_xmit = enic_hard_start_xmit, | 1599 | .ndo_start_xmit = enic_hard_start_xmit, |
1600 | .ndo_get_stats = enic_get_stats, | 1600 | .ndo_get_stats = enic_get_stats, |
1601 | .ndo_validate_addr = eth_validate_addr, | 1601 | .ndo_validate_addr = eth_validate_addr, |
1602 | .ndo_set_mac_address = eth_mac_addr, | ||
1602 | .ndo_set_multicast_list = enic_set_multicast_list, | 1603 | .ndo_set_multicast_list = enic_set_multicast_list, |
1603 | .ndo_change_mtu = enic_change_mtu, | 1604 | .ndo_change_mtu = enic_change_mtu, |
1604 | .ndo_vlan_rx_register = enic_vlan_rx_register, | 1605 | .ndo_vlan_rx_register = enic_vlan_rx_register, |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 5b68dc20168d..5b910cf63740 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -13,7 +13,7 @@ | |||
13 | * Copyright (C) 2004 Andrew de Quincey (wol support) | 13 | * Copyright (C) 2004 Andrew de Quincey (wol support) |
14 | * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane | 14 | * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane |
15 | * IRQ rate fixes, bigendian fixes, cleanups, verification) | 15 | * IRQ rate fixes, bigendian fixes, cleanups, verification) |
16 | * Copyright (c) 2004,2005,2006,2007,2008 NVIDIA Corporation | 16 | * Copyright (c) 2004,2005,2006,2007,2008,2009 NVIDIA Corporation |
17 | * | 17 | * |
18 | * This program is free software; you can redistribute it and/or modify | 18 | * This program is free software; you can redistribute it and/or modify |
19 | * it under the terms of the GNU General Public License as published by | 19 | * it under the terms of the GNU General Public License as published by |
@@ -39,7 +39,7 @@ | |||
39 | * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few | 39 | * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few |
40 | * superfluous timer interrupts from the nic. | 40 | * superfluous timer interrupts from the nic. |
41 | */ | 41 | */ |
42 | #define FORCEDETH_VERSION "0.61" | 42 | #define FORCEDETH_VERSION "0.62" |
43 | #define DRV_NAME "forcedeth" | 43 | #define DRV_NAME "forcedeth" |
44 | 44 | ||
45 | #include <linux/module.h> | 45 | #include <linux/module.h> |
@@ -2096,14 +2096,15 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2096 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); | 2096 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); |
2097 | } | 2097 | } |
2098 | 2098 | ||
2099 | spin_lock_irqsave(&np->lock, flags); | ||
2099 | empty_slots = nv_get_empty_tx_slots(np); | 2100 | empty_slots = nv_get_empty_tx_slots(np); |
2100 | if (unlikely(empty_slots <= entries)) { | 2101 | if (unlikely(empty_slots <= entries)) { |
2101 | spin_lock_irqsave(&np->lock, flags); | ||
2102 | netif_stop_queue(dev); | 2102 | netif_stop_queue(dev); |
2103 | np->tx_stop = 1; | 2103 | np->tx_stop = 1; |
2104 | spin_unlock_irqrestore(&np->lock, flags); | 2104 | spin_unlock_irqrestore(&np->lock, flags); |
2105 | return NETDEV_TX_BUSY; | 2105 | return NETDEV_TX_BUSY; |
2106 | } | 2106 | } |
2107 | spin_unlock_irqrestore(&np->lock, flags); | ||
2107 | 2108 | ||
2108 | start_tx = put_tx = np->put_tx.orig; | 2109 | start_tx = put_tx = np->put_tx.orig; |
2109 | 2110 | ||
@@ -2214,14 +2215,15 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
2214 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); | 2215 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); |
2215 | } | 2216 | } |
2216 | 2217 | ||
2218 | spin_lock_irqsave(&np->lock, flags); | ||
2217 | empty_slots = nv_get_empty_tx_slots(np); | 2219 | empty_slots = nv_get_empty_tx_slots(np); |
2218 | if (unlikely(empty_slots <= entries)) { | 2220 | if (unlikely(empty_slots <= entries)) { |
2219 | spin_lock_irqsave(&np->lock, flags); | ||
2220 | netif_stop_queue(dev); | 2221 | netif_stop_queue(dev); |
2221 | np->tx_stop = 1; | 2222 | np->tx_stop = 1; |
2222 | spin_unlock_irqrestore(&np->lock, flags); | 2223 | spin_unlock_irqrestore(&np->lock, flags); |
2223 | return NETDEV_TX_BUSY; | 2224 | return NETDEV_TX_BUSY; |
2224 | } | 2225 | } |
2226 | spin_unlock_irqrestore(&np->lock, flags); | ||
2225 | 2227 | ||
2226 | start_tx = put_tx = np->put_tx.ex; | 2228 | start_tx = put_tx = np->put_tx.ex; |
2227 | start_tx_ctx = np->put_tx_ctx; | 2229 | start_tx_ctx = np->put_tx_ctx; |
@@ -3403,10 +3405,10 @@ static irqreturn_t nv_nic_irq(int foo, void *data) | |||
3403 | 3405 | ||
3404 | #ifdef CONFIG_FORCEDETH_NAPI | 3406 | #ifdef CONFIG_FORCEDETH_NAPI |
3405 | if (events & NVREG_IRQ_RX_ALL) { | 3407 | if (events & NVREG_IRQ_RX_ALL) { |
3408 | spin_lock(&np->lock); | ||
3406 | netif_rx_schedule(&np->napi); | 3409 | netif_rx_schedule(&np->napi); |
3407 | 3410 | ||
3408 | /* Disable furthur receive irq's */ | 3411 | /* Disable furthur receive irq's */ |
3409 | spin_lock(&np->lock); | ||
3410 | np->irqmask &= ~NVREG_IRQ_RX_ALL; | 3412 | np->irqmask &= ~NVREG_IRQ_RX_ALL; |
3411 | 3413 | ||
3412 | if (np->msi_flags & NV_MSI_X_ENABLED) | 3414 | if (np->msi_flags & NV_MSI_X_ENABLED) |
@@ -3520,10 +3522,10 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data) | |||
3520 | 3522 | ||
3521 | #ifdef CONFIG_FORCEDETH_NAPI | 3523 | #ifdef CONFIG_FORCEDETH_NAPI |
3522 | if (events & NVREG_IRQ_RX_ALL) { | 3524 | if (events & NVREG_IRQ_RX_ALL) { |
3525 | spin_lock(&np->lock); | ||
3523 | netif_rx_schedule(&np->napi); | 3526 | netif_rx_schedule(&np->napi); |
3524 | 3527 | ||
3525 | /* Disable furthur receive irq's */ | 3528 | /* Disable furthur receive irq's */ |
3526 | spin_lock(&np->lock); | ||
3527 | np->irqmask &= ~NVREG_IRQ_RX_ALL; | 3529 | np->irqmask &= ~NVREG_IRQ_RX_ALL; |
3528 | 3530 | ||
3529 | if (np->msi_flags & NV_MSI_X_ENABLED) | 3531 | if (np->msi_flags & NV_MSI_X_ENABLED) |
@@ -6167,19 +6169,19 @@ static struct pci_device_id pci_tbl[] = { | |||
6167 | }, | 6169 | }, |
6168 | { /* MCP79 Ethernet Controller */ | 6170 | { /* MCP79 Ethernet Controller */ |
6169 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36), | 6171 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36), |
6170 | .driver_data = DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, | 6172 | .driver_data = DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, |
6171 | }, | 6173 | }, |
6172 | { /* MCP79 Ethernet Controller */ | 6174 | { /* MCP79 Ethernet Controller */ |
6173 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37), | 6175 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37), |
6174 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, | 6176 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, |
6175 | }, | 6177 | }, |
6176 | { /* MCP79 Ethernet Controller */ | 6178 | { /* MCP79 Ethernet Controller */ |
6177 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38), | 6179 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38), |
6178 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, | 6180 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, |
6179 | }, | 6181 | }, |
6180 | { /* MCP79 Ethernet Controller */ | 6182 | { /* MCP79 Ethernet Controller */ |
6181 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39), | 6183 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39), |
6182 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, | 6184 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, |
6183 | }, | 6185 | }, |
6184 | {0,}, | 6186 | {0,}, |
6185 | }; | 6187 | }; |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 4e6a9195fe5f..ce900e54d8d1 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -795,6 +795,7 @@ static int fs_enet_open(struct net_device *dev) | |||
795 | 795 | ||
796 | err = fs_init_phy(dev); | 796 | err = fs_init_phy(dev); |
797 | if (err) { | 797 | if (err) { |
798 | free_irq(fep->interrupt, dev); | ||
798 | if (fep->fpi->use_napi) | 799 | if (fep->fpi->use_napi) |
799 | napi_disable(&fep->napi); | 800 | napi_disable(&fep->napi); |
800 | return err; | 801 | return err; |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 1b8deca8b9f8..ea530673236e 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -296,6 +296,20 @@ err_out: | |||
296 | return err; | 296 | return err; |
297 | } | 297 | } |
298 | 298 | ||
299 | /* Ioctl MII Interface */ | ||
300 | static int gfar_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | ||
301 | { | ||
302 | struct gfar_private *priv = netdev_priv(dev); | ||
303 | |||
304 | if (!netif_running(dev)) | ||
305 | return -EINVAL; | ||
306 | |||
307 | if (!priv->phydev) | ||
308 | return -ENODEV; | ||
309 | |||
310 | return phy_mii_ioctl(priv->phydev, if_mii(rq), cmd); | ||
311 | } | ||
312 | |||
299 | /* Set up the ethernet device structure, private data, | 313 | /* Set up the ethernet device structure, private data, |
300 | * and anything else we need before we start */ | 314 | * and anything else we need before we start */ |
301 | static int gfar_probe(struct of_device *ofdev, | 315 | static int gfar_probe(struct of_device *ofdev, |
@@ -366,6 +380,7 @@ static int gfar_probe(struct of_device *ofdev, | |||
366 | dev->set_multicast_list = gfar_set_multi; | 380 | dev->set_multicast_list = gfar_set_multi; |
367 | 381 | ||
368 | dev->ethtool_ops = &gfar_ethtool_ops; | 382 | dev->ethtool_ops = &gfar_ethtool_ops; |
383 | dev->do_ioctl = gfar_ioctl; | ||
369 | 384 | ||
370 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM) { | 385 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM) { |
371 | priv->rx_csum_enable = 1; | 386 | priv->rx_csum_enable = 1; |
@@ -1607,10 +1622,18 @@ static int gfar_clean_tx_ring(struct net_device *dev) | |||
1607 | static void gfar_schedule_cleanup(struct net_device *dev) | 1622 | static void gfar_schedule_cleanup(struct net_device *dev) |
1608 | { | 1623 | { |
1609 | struct gfar_private *priv = netdev_priv(dev); | 1624 | struct gfar_private *priv = netdev_priv(dev); |
1625 | unsigned long flags; | ||
1626 | |||
1627 | spin_lock_irqsave(&priv->txlock, flags); | ||
1628 | spin_lock(&priv->rxlock); | ||
1629 | |||
1610 | if (netif_rx_schedule_prep(&priv->napi)) { | 1630 | if (netif_rx_schedule_prep(&priv->napi)) { |
1611 | gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED); | 1631 | gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED); |
1612 | __netif_rx_schedule(&priv->napi); | 1632 | __netif_rx_schedule(&priv->napi); |
1613 | } | 1633 | } |
1634 | |||
1635 | spin_unlock(&priv->rxlock); | ||
1636 | spin_unlock_irqrestore(&priv->txlock, flags); | ||
1614 | } | 1637 | } |
1615 | 1638 | ||
1616 | /* Interrupt Handler for Transmit complete */ | 1639 | /* Interrupt Handler for Transmit complete */ |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 32200227c923..7e8b3c59a7d6 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -576,6 +576,7 @@ static const struct net_device_ops hamachi_netdev_ops = { | |||
576 | .ndo_set_multicast_list = set_rx_mode, | 576 | .ndo_set_multicast_list = set_rx_mode, |
577 | .ndo_change_mtu = eth_change_mtu, | 577 | .ndo_change_mtu = eth_change_mtu, |
578 | .ndo_validate_addr = eth_validate_addr, | 578 | .ndo_validate_addr = eth_validate_addr, |
579 | .ndo_set_mac_address = eth_mac_addr, | ||
579 | .ndo_tx_timeout = hamachi_tx_timeout, | 580 | .ndo_tx_timeout = hamachi_tx_timeout, |
580 | .ndo_do_ioctl = netdev_ioctl, | 581 | .ndo_do_ioctl = netdev_ioctl, |
581 | }; | 582 | }; |
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 50f1e172ee8f..2d4089894ec7 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -717,11 +717,12 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file, | |||
717 | unsigned int cmd, unsigned long arg) | 717 | unsigned int cmd, unsigned long arg) |
718 | { | 718 | { |
719 | struct sixpack *sp = sp_get(tty); | 719 | struct sixpack *sp = sp_get(tty); |
720 | struct net_device *dev = sp->dev; | 720 | struct net_device *dev; |
721 | unsigned int tmp, err; | 721 | unsigned int tmp, err; |
722 | 722 | ||
723 | if (!sp) | 723 | if (!sp) |
724 | return -ENXIO; | 724 | return -ENXIO; |
725 | dev = sp->dev; | ||
725 | 726 | ||
726 | switch(cmd) { | 727 | switch(cmd) { |
727 | case SIOCGIFNAME: | 728 | case SIOCGIFNAME: |
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c index b507dbc16e62..5e070f446635 100644 --- a/drivers/net/hp-plus.c +++ b/drivers/net/hp-plus.c | |||
@@ -166,6 +166,7 @@ static const struct net_device_ops hpp_netdev_ops = { | |||
166 | .ndo_get_stats = eip_get_stats, | 166 | .ndo_get_stats = eip_get_stats, |
167 | .ndo_set_multicast_list = eip_set_multicast_list, | 167 | .ndo_set_multicast_list = eip_set_multicast_list, |
168 | .ndo_validate_addr = eth_validate_addr, | 168 | .ndo_validate_addr = eth_validate_addr, |
169 | .ndo_set_mac_address = eth_mac_addr, | ||
169 | .ndo_change_mtu = eth_change_mtu, | 170 | .ndo_change_mtu = eth_change_mtu, |
170 | #ifdef CONFIG_NET_POLL_CONTROLLER | 171 | #ifdef CONFIG_NET_POLL_CONTROLLER |
171 | .ndo_poll_controller = eip_poll, | 172 | .ndo_poll_controller = eip_poll, |
diff --git a/drivers/net/hydra.c b/drivers/net/hydra.c index 9cb38a8d4387..8ac0930c183c 100644 --- a/drivers/net/hydra.c +++ b/drivers/net/hydra.c | |||
@@ -103,6 +103,7 @@ static const struct net_device_ops hydra_netdev_ops = { | |||
103 | .ndo_get_stats = ei_get_stats, | 103 | .ndo_get_stats = ei_get_stats, |
104 | .ndo_set_multicast_list = ei_set_multicast_list, | 104 | .ndo_set_multicast_list = ei_set_multicast_list, |
105 | .ndo_validate_addr = eth_validate_addr, | 105 | .ndo_validate_addr = eth_validate_addr, |
106 | .ndo_set_mac_address = eth_mac_addr, | ||
106 | .ndo_change_mtu = eth_change_mtu, | 107 | .ndo_change_mtu = eth_change_mtu, |
107 | #ifdef CONFIG_NET_POLL_CONTROLLER | 108 | #ifdef CONFIG_NET_POLL_CONTROLLER |
108 | .ndo_poll_controller = ei_poll, | 109 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c index ecf9798987fa..2a2fc17b2878 100644 --- a/drivers/net/ibm_newemac/mal.c +++ b/drivers/net/ibm_newemac/mal.c | |||
@@ -613,7 +613,9 @@ static int __devinit mal_probe(struct of_device *ofdev, | |||
613 | INIT_LIST_HEAD(&mal->list); | 613 | INIT_LIST_HEAD(&mal->list); |
614 | spin_lock_init(&mal->lock); | 614 | spin_lock_init(&mal->lock); |
615 | 615 | ||
616 | netif_napi_add(NULL, &mal->napi, mal_poll, | 616 | init_dummy_netdev(&mal->dummy_dev); |
617 | |||
618 | netif_napi_add(&mal->dummy_dev, &mal->napi, mal_poll, | ||
617 | CONFIG_IBM_NEW_EMAC_POLL_WEIGHT); | 619 | CONFIG_IBM_NEW_EMAC_POLL_WEIGHT); |
618 | 620 | ||
619 | /* Load power-on reset defaults */ | 621 | /* Load power-on reset defaults */ |
diff --git a/drivers/net/ibm_newemac/mal.h b/drivers/net/ibm_newemac/mal.h index 2f0a87360844..9ededfbf0726 100644 --- a/drivers/net/ibm_newemac/mal.h +++ b/drivers/net/ibm_newemac/mal.h | |||
@@ -214,6 +214,8 @@ struct mal_instance { | |||
214 | int index; | 214 | int index; |
215 | spinlock_t lock; | 215 | spinlock_t lock; |
216 | 216 | ||
217 | struct net_device dummy_dev; | ||
218 | |||
217 | unsigned int features; | 219 | unsigned int features; |
218 | }; | 220 | }; |
219 | 221 | ||
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index ca3bb9f7321b..dfa6348ac1dc 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -602,7 +602,7 @@ static int ibmveth_open(struct net_device *netdev) | |||
602 | 602 | ||
603 | if(lpar_rc != H_SUCCESS) { | 603 | if(lpar_rc != H_SUCCESS) { |
604 | ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); | 604 | ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); |
605 | ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n", | 605 | ibmveth_error_printk("buffer TCE:0x%llx filter TCE:0x%llx rxq desc:0x%llx MAC:0x%llx\n", |
606 | adapter->buffer_list_dma, | 606 | adapter->buffer_list_dma, |
607 | adapter->filter_list_dma, | 607 | adapter->filter_list_dma, |
608 | rxq_desc.desc, | 608 | rxq_desc.desc, |
@@ -1378,13 +1378,13 @@ static int ibmveth_show(struct seq_file *seq, void *v) | |||
1378 | seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac); | 1378 | seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac); |
1379 | 1379 | ||
1380 | seq_printf(seq, "\nAdapter Statistics:\n"); | 1380 | seq_printf(seq, "\nAdapter Statistics:\n"); |
1381 | seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed); | 1381 | seq_printf(seq, " TX: vio_map_single failres: %lld\n", adapter->tx_map_failed); |
1382 | seq_printf(seq, " send failures: %ld\n", adapter->tx_send_failed); | 1382 | seq_printf(seq, " send failures: %lld\n", adapter->tx_send_failed); |
1383 | seq_printf(seq, " RX: replenish task cycles: %ld\n", adapter->replenish_task_cycles); | 1383 | seq_printf(seq, " RX: replenish task cycles: %lld\n", adapter->replenish_task_cycles); |
1384 | seq_printf(seq, " alloc_skb_failures: %ld\n", adapter->replenish_no_mem); | 1384 | seq_printf(seq, " alloc_skb_failures: %lld\n", adapter->replenish_no_mem); |
1385 | seq_printf(seq, " add buffer failures: %ld\n", adapter->replenish_add_buff_failure); | 1385 | seq_printf(seq, " add buffer failures: %lld\n", adapter->replenish_add_buff_failure); |
1386 | seq_printf(seq, " invalid buffers: %ld\n", adapter->rx_invalid_buffer); | 1386 | seq_printf(seq, " invalid buffers: %lld\n", adapter->rx_invalid_buffer); |
1387 | seq_printf(seq, " no buffers: %ld\n", adapter->rx_no_buffer); | 1387 | seq_printf(seq, " no buffers: %lld\n", adapter->rx_no_buffer); |
1388 | 1388 | ||
1389 | return 0; | 1389 | return 0; |
1390 | } | 1390 | } |
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index 75a1d0a86dee..941164076a2b 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c | |||
@@ -594,7 +594,7 @@ static int au1k_irda_rx(struct net_device *dev) | |||
594 | update_rx_stats(dev, flags, count); | 594 | update_rx_stats(dev, flags, count); |
595 | skb=alloc_skb(count+1,GFP_ATOMIC); | 595 | skb=alloc_skb(count+1,GFP_ATOMIC); |
596 | if (skb == NULL) { | 596 | if (skb == NULL) { |
597 | aup->stats.rx_dropped++; | 597 | aup->netdev->stats.rx_dropped++; |
598 | continue; | 598 | continue; |
599 | } | 599 | } |
600 | skb_reserve(skb, 1); | 600 | skb_reserve(skb, 1); |
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 687c2d53d4d2..6f3e7f71658d 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -1194,13 +1194,13 @@ toshoboe_interrupt (int irq, void *dev_id) | |||
1194 | txp = txpc; | 1194 | txp = txpc; |
1195 | txpc++; | 1195 | txpc++; |
1196 | txpc %= TX_SLOTS; | 1196 | txpc %= TX_SLOTS; |
1197 | self->stats.tx_packets++; | 1197 | self->netdev->stats.tx_packets++; |
1198 | if (self->ring->tx[txpc].control & OBOE_CTL_TX_HW_OWNS) | 1198 | if (self->ring->tx[txpc].control & OBOE_CTL_TX_HW_OWNS) |
1199 | self->ring->tx[txp].control &= ~OBOE_CTL_TX_RTCENTX; | 1199 | self->ring->tx[txp].control &= ~OBOE_CTL_TX_RTCENTX; |
1200 | } | 1200 | } |
1201 | self->stats.tx_packets--; | 1201 | self->netdev->stats.tx_packets--; |
1202 | #else | 1202 | #else |
1203 | self->stats.tx_packets++; | 1203 | self->netdev->stats.tx_packets++; |
1204 | #endif | 1204 | #endif |
1205 | toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); | 1205 | toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); |
1206 | } | 1206 | } |
@@ -1280,7 +1280,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1280 | skb_put (skb, len); | 1280 | skb_put (skb, len); |
1281 | skb_copy_to_linear_data(skb, self->rx_bufs[self->rxs], | 1281 | skb_copy_to_linear_data(skb, self->rx_bufs[self->rxs], |
1282 | len); | 1282 | len); |
1283 | self->stats.rx_packets++; | 1283 | self->netdev->stats.rx_packets++; |
1284 | skb->dev = self->netdev; | 1284 | skb->dev = self->netdev; |
1285 | skb_reset_mac_header(skb); | 1285 | skb_reset_mac_header(skb); |
1286 | skb->protocol = htons (ETH_P_IRDA); | 1286 | skb->protocol = htons (ETH_P_IRDA); |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 29118f58a141..3a22dc41b656 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1073,7 +1073,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1073 | { | 1073 | { |
1074 | unsigned int i; | 1074 | unsigned int i; |
1075 | int ret; | 1075 | int ret; |
1076 | char stir421x_fw_name[11]; | 1076 | char stir421x_fw_name[12]; |
1077 | const struct firmware *fw; | 1077 | const struct firmware *fw; |
1078 | const unsigned char *fw_version_ptr; /* pointer to version string */ | 1078 | const unsigned char *fw_version_ptr; /* pointer to version string */ |
1079 | unsigned long fw_version = 0; | 1079 | unsigned long fw_version = 0; |
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index c7457f97259d..cb793c2bade2 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -429,7 +429,7 @@ SIMPLE_PORT_ATTR(promiscuous); | |||
429 | SIMPLE_PORT_ATTR(num_mcast); | 429 | SIMPLE_PORT_ATTR(num_mcast); |
430 | CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map); | 430 | CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map); |
431 | CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map); | 431 | CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map); |
432 | CUSTOM_PORT_ATTR(mac_addr, "0x%lX\n", port->mac_addr); | 432 | CUSTOM_PORT_ATTR(mac_addr, "0x%llX\n", port->mac_addr); |
433 | 433 | ||
434 | #define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr) | 434 | #define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr) |
435 | static struct attribute *veth_port_default_attrs[] = { | 435 | static struct attribute *veth_port_default_attrs[] = { |
diff --git a/drivers/net/korina.c b/drivers/net/korina.c index 4a5580c1126a..1d6e48e13366 100644 --- a/drivers/net/korina.c +++ b/drivers/net/korina.c | |||
@@ -84,7 +84,10 @@ | |||
84 | #define KORINA_NUM_RDS 64 /* number of receive descriptors */ | 84 | #define KORINA_NUM_RDS 64 /* number of receive descriptors */ |
85 | #define KORINA_NUM_TDS 64 /* number of transmit descriptors */ | 85 | #define KORINA_NUM_TDS 64 /* number of transmit descriptors */ |
86 | 86 | ||
87 | #define KORINA_RBSIZE 536 /* size of one resource buffer = Ether MTU */ | 87 | /* KORINA_RBSIZE is the hardware's default maximum receive |
88 | * frame size in bytes. Having this hardcoded means that there | ||
89 | * is no support for MTU sizes greater than 1500. */ | ||
90 | #define KORINA_RBSIZE 1536 /* size of one resource buffer = Ether MTU */ | ||
88 | #define KORINA_RDS_MASK (KORINA_NUM_RDS - 1) | 91 | #define KORINA_RDS_MASK (KORINA_NUM_RDS - 1) |
89 | #define KORINA_TDS_MASK (KORINA_NUM_TDS - 1) | 92 | #define KORINA_TDS_MASK (KORINA_NUM_TDS - 1) |
90 | #define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) | 93 | #define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) |
@@ -196,7 +199,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
196 | struct korina_private *lp = netdev_priv(dev); | 199 | struct korina_private *lp = netdev_priv(dev); |
197 | unsigned long flags; | 200 | unsigned long flags; |
198 | u32 length; | 201 | u32 length; |
199 | u32 chain_index; | 202 | u32 chain_prev, chain_next; |
200 | struct dma_desc *td; | 203 | struct dma_desc *td; |
201 | 204 | ||
202 | spin_lock_irqsave(&lp->lock, flags); | 205 | spin_lock_irqsave(&lp->lock, flags); |
@@ -228,8 +231,8 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
228 | /* Setup the transmit descriptor. */ | 231 | /* Setup the transmit descriptor. */ |
229 | dma_cache_inv((u32) td, sizeof(*td)); | 232 | dma_cache_inv((u32) td, sizeof(*td)); |
230 | td->ca = CPHYSADDR(skb->data); | 233 | td->ca = CPHYSADDR(skb->data); |
231 | chain_index = (lp->tx_chain_tail - 1) & | 234 | chain_prev = (lp->tx_chain_tail - 1) & KORINA_TDS_MASK; |
232 | KORINA_TDS_MASK; | 235 | chain_next = (lp->tx_chain_tail + 1) & KORINA_TDS_MASK; |
233 | 236 | ||
234 | if (readl(&(lp->tx_dma_regs->dmandptr)) == 0) { | 237 | if (readl(&(lp->tx_dma_regs->dmandptr)) == 0) { |
235 | if (lp->tx_chain_status == desc_empty) { | 238 | if (lp->tx_chain_status == desc_empty) { |
@@ -237,7 +240,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
237 | td->control = DMA_COUNT(length) | | 240 | td->control = DMA_COUNT(length) | |
238 | DMA_DESC_COF | DMA_DESC_IOF; | 241 | DMA_DESC_COF | DMA_DESC_IOF; |
239 | /* Move tail */ | 242 | /* Move tail */ |
240 | lp->tx_chain_tail = chain_index; | 243 | lp->tx_chain_tail = chain_next; |
241 | /* Write to NDPTR */ | 244 | /* Write to NDPTR */ |
242 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), | 245 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), |
243 | &lp->tx_dma_regs->dmandptr); | 246 | &lp->tx_dma_regs->dmandptr); |
@@ -248,12 +251,12 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
248 | td->control = DMA_COUNT(length) | | 251 | td->control = DMA_COUNT(length) | |
249 | DMA_DESC_COF | DMA_DESC_IOF; | 252 | DMA_DESC_COF | DMA_DESC_IOF; |
250 | /* Link to prev */ | 253 | /* Link to prev */ |
251 | lp->td_ring[chain_index].control &= | 254 | lp->td_ring[chain_prev].control &= |
252 | ~DMA_DESC_COF; | 255 | ~DMA_DESC_COF; |
253 | /* Link to prev */ | 256 | /* Link to prev */ |
254 | lp->td_ring[chain_index].link = CPHYSADDR(td); | 257 | lp->td_ring[chain_prev].link = CPHYSADDR(td); |
255 | /* Move tail */ | 258 | /* Move tail */ |
256 | lp->tx_chain_tail = chain_index; | 259 | lp->tx_chain_tail = chain_next; |
257 | /* Write to NDPTR */ | 260 | /* Write to NDPTR */ |
258 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), | 261 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), |
259 | &(lp->tx_dma_regs->dmandptr)); | 262 | &(lp->tx_dma_regs->dmandptr)); |
@@ -267,17 +270,16 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
267 | td->control = DMA_COUNT(length) | | 270 | td->control = DMA_COUNT(length) | |
268 | DMA_DESC_COF | DMA_DESC_IOF; | 271 | DMA_DESC_COF | DMA_DESC_IOF; |
269 | /* Move tail */ | 272 | /* Move tail */ |
270 | lp->tx_chain_tail = chain_index; | 273 | lp->tx_chain_tail = chain_next; |
271 | lp->tx_chain_status = desc_filled; | 274 | lp->tx_chain_status = desc_filled; |
272 | netif_stop_queue(dev); | ||
273 | } else { | 275 | } else { |
274 | /* Update tail */ | 276 | /* Update tail */ |
275 | td->control = DMA_COUNT(length) | | 277 | td->control = DMA_COUNT(length) | |
276 | DMA_DESC_COF | DMA_DESC_IOF; | 278 | DMA_DESC_COF | DMA_DESC_IOF; |
277 | lp->td_ring[chain_index].control &= | 279 | lp->td_ring[chain_prev].control &= |
278 | ~DMA_DESC_COF; | 280 | ~DMA_DESC_COF; |
279 | lp->td_ring[chain_index].link = CPHYSADDR(td); | 281 | lp->td_ring[chain_prev].link = CPHYSADDR(td); |
280 | lp->tx_chain_tail = chain_index; | 282 | lp->tx_chain_tail = chain_next; |
281 | } | 283 | } |
282 | } | 284 | } |
283 | dma_cache_wback((u32) td, sizeof(*td)); | 285 | dma_cache_wback((u32) td, sizeof(*td)); |
@@ -327,13 +329,13 @@ static irqreturn_t korina_rx_dma_interrupt(int irq, void *dev_id) | |||
327 | 329 | ||
328 | dmas = readl(&lp->rx_dma_regs->dmas); | 330 | dmas = readl(&lp->rx_dma_regs->dmas); |
329 | if (dmas & (DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR)) { | 331 | if (dmas & (DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR)) { |
330 | netif_rx_schedule_prep(&lp->napi); | ||
331 | |||
332 | dmasm = readl(&lp->rx_dma_regs->dmasm); | 332 | dmasm = readl(&lp->rx_dma_regs->dmasm); |
333 | writel(dmasm | (DMA_STAT_DONE | | 333 | writel(dmasm | (DMA_STAT_DONE | |
334 | DMA_STAT_HALT | DMA_STAT_ERR), | 334 | DMA_STAT_HALT | DMA_STAT_ERR), |
335 | &lp->rx_dma_regs->dmasm); | 335 | &lp->rx_dma_regs->dmasm); |
336 | 336 | ||
337 | netif_rx_schedule(&lp->napi); | ||
338 | |||
337 | if (dmas & DMA_STAT_ERR) | 339 | if (dmas & DMA_STAT_ERR) |
338 | printk(KERN_ERR DRV_NAME "%s: DMA error\n", dev->name); | 340 | printk(KERN_ERR DRV_NAME "%s: DMA error\n", dev->name); |
339 | 341 | ||
@@ -350,15 +352,20 @@ static int korina_rx(struct net_device *dev, int limit) | |||
350 | struct dma_desc *rd = &lp->rd_ring[lp->rx_next_done]; | 352 | struct dma_desc *rd = &lp->rd_ring[lp->rx_next_done]; |
351 | struct sk_buff *skb, *skb_new; | 353 | struct sk_buff *skb, *skb_new; |
352 | u8 *pkt_buf; | 354 | u8 *pkt_buf; |
353 | u32 devcs, pkt_len, dmas, rx_free_desc; | 355 | u32 devcs, pkt_len, dmas; |
354 | int count; | 356 | int count; |
355 | 357 | ||
356 | dma_cache_inv((u32)rd, sizeof(*rd)); | 358 | dma_cache_inv((u32)rd, sizeof(*rd)); |
357 | 359 | ||
358 | for (count = 0; count < limit; count++) { | 360 | for (count = 0; count < limit; count++) { |
361 | skb = lp->rx_skb[lp->rx_next_done]; | ||
362 | skb_new = NULL; | ||
359 | 363 | ||
360 | devcs = rd->devcs; | 364 | devcs = rd->devcs; |
361 | 365 | ||
366 | if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0) | ||
367 | break; | ||
368 | |||
362 | /* Update statistics counters */ | 369 | /* Update statistics counters */ |
363 | if (devcs & ETH_RX_CRC) | 370 | if (devcs & ETH_RX_CRC) |
364 | dev->stats.rx_crc_errors++; | 371 | dev->stats.rx_crc_errors++; |
@@ -381,63 +388,55 @@ static int korina_rx(struct net_device *dev, int limit) | |||
381 | * in Rc32434 (errata ref #077) */ | 388 | * in Rc32434 (errata ref #077) */ |
382 | dev->stats.rx_errors++; | 389 | dev->stats.rx_errors++; |
383 | dev->stats.rx_dropped++; | 390 | dev->stats.rx_dropped++; |
384 | } | 391 | } else if ((devcs & ETH_RX_ROK)) { |
385 | |||
386 | while ((rx_free_desc = KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) { | ||
387 | /* init the var. used for the later | ||
388 | * operations within the while loop */ | ||
389 | skb_new = NULL; | ||
390 | pkt_len = RCVPKT_LENGTH(devcs); | 392 | pkt_len = RCVPKT_LENGTH(devcs); |
391 | skb = lp->rx_skb[lp->rx_next_done]; | 393 | |
392 | 394 | /* must be the (first and) last | |
393 | if ((devcs & ETH_RX_ROK)) { | 395 | * descriptor then */ |
394 | /* must be the (first and) last | 396 | pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data; |
395 | * descriptor then */ | 397 | |
396 | pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data; | 398 | /* invalidate the cache */ |
397 | 399 | dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4); | |
398 | /* invalidate the cache */ | 400 | |
399 | dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4); | 401 | /* Malloc up new buffer. */ |
400 | 402 | skb_new = netdev_alloc_skb(dev, KORINA_RBSIZE + 2); | |
401 | /* Malloc up new buffer. */ | 403 | |
402 | skb_new = netdev_alloc_skb(dev, KORINA_RBSIZE + 2); | 404 | if (!skb_new) |
403 | 405 | break; | |
404 | if (!skb_new) | 406 | /* Do not count the CRC */ |
405 | break; | 407 | skb_put(skb, pkt_len - 4); |
406 | /* Do not count the CRC */ | 408 | skb->protocol = eth_type_trans(skb, dev); |
407 | skb_put(skb, pkt_len - 4); | 409 | |
408 | skb->protocol = eth_type_trans(skb, dev); | 410 | /* Pass the packet to upper layers */ |
409 | 411 | netif_receive_skb(skb); | |
410 | /* Pass the packet to upper layers */ | 412 | dev->stats.rx_packets++; |
411 | netif_receive_skb(skb); | 413 | dev->stats.rx_bytes += pkt_len; |
412 | dev->stats.rx_packets++; | 414 | |
413 | dev->stats.rx_bytes += pkt_len; | 415 | /* Update the mcast stats */ |
414 | 416 | if (devcs & ETH_RX_MP) | |
415 | /* Update the mcast stats */ | 417 | dev->stats.multicast++; |
416 | if (devcs & ETH_RX_MP) | 418 | |
417 | dev->stats.multicast++; | 419 | lp->rx_skb[lp->rx_next_done] = skb_new; |
418 | |||
419 | lp->rx_skb[lp->rx_next_done] = skb_new; | ||
420 | } | ||
421 | |||
422 | rd->devcs = 0; | ||
423 | |||
424 | /* Restore descriptor's curr_addr */ | ||
425 | if (skb_new) | ||
426 | rd->ca = CPHYSADDR(skb_new->data); | ||
427 | else | ||
428 | rd->ca = CPHYSADDR(skb->data); | ||
429 | |||
430 | rd->control = DMA_COUNT(KORINA_RBSIZE) | | ||
431 | DMA_DESC_COD | DMA_DESC_IOD; | ||
432 | lp->rd_ring[(lp->rx_next_done - 1) & | ||
433 | KORINA_RDS_MASK].control &= | ||
434 | ~DMA_DESC_COD; | ||
435 | |||
436 | lp->rx_next_done = (lp->rx_next_done + 1) & KORINA_RDS_MASK; | ||
437 | dma_cache_wback((u32)rd, sizeof(*rd)); | ||
438 | rd = &lp->rd_ring[lp->rx_next_done]; | ||
439 | writel(~DMA_STAT_DONE, &lp->rx_dma_regs->dmas); | ||
440 | } | 420 | } |
421 | |||
422 | rd->devcs = 0; | ||
423 | |||
424 | /* Restore descriptor's curr_addr */ | ||
425 | if (skb_new) | ||
426 | rd->ca = CPHYSADDR(skb_new->data); | ||
427 | else | ||
428 | rd->ca = CPHYSADDR(skb->data); | ||
429 | |||
430 | rd->control = DMA_COUNT(KORINA_RBSIZE) | | ||
431 | DMA_DESC_COD | DMA_DESC_IOD; | ||
432 | lp->rd_ring[(lp->rx_next_done - 1) & | ||
433 | KORINA_RDS_MASK].control &= | ||
434 | ~DMA_DESC_COD; | ||
435 | |||
436 | lp->rx_next_done = (lp->rx_next_done + 1) & KORINA_RDS_MASK; | ||
437 | dma_cache_wback((u32)rd, sizeof(*rd)); | ||
438 | rd = &lp->rd_ring[lp->rx_next_done]; | ||
439 | writel(~DMA_STAT_DONE, &lp->rx_dma_regs->dmas); | ||
441 | } | 440 | } |
442 | 441 | ||
443 | dmas = readl(&lp->rx_dma_regs->dmas); | 442 | dmas = readl(&lp->rx_dma_regs->dmas); |
@@ -623,12 +622,12 @@ korina_tx_dma_interrupt(int irq, void *dev_id) | |||
623 | dmas = readl(&lp->tx_dma_regs->dmas); | 622 | dmas = readl(&lp->tx_dma_regs->dmas); |
624 | 623 | ||
625 | if (dmas & (DMA_STAT_FINI | DMA_STAT_ERR)) { | 624 | if (dmas & (DMA_STAT_FINI | DMA_STAT_ERR)) { |
626 | korina_tx(dev); | ||
627 | |||
628 | dmasm = readl(&lp->tx_dma_regs->dmasm); | 625 | dmasm = readl(&lp->tx_dma_regs->dmasm); |
629 | writel(dmasm | (DMA_STAT_FINI | DMA_STAT_ERR), | 626 | writel(dmasm | (DMA_STAT_FINI | DMA_STAT_ERR), |
630 | &lp->tx_dma_regs->dmasm); | 627 | &lp->tx_dma_regs->dmasm); |
631 | 628 | ||
629 | korina_tx(dev); | ||
630 | |||
632 | if (lp->tx_chain_status == desc_filled && | 631 | if (lp->tx_chain_status == desc_filled && |
633 | (readl(&(lp->tx_dma_regs->dmandptr)) == 0)) { | 632 | (readl(&(lp->tx_dma_regs->dmandptr)) == 0)) { |
634 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), | 633 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), |
@@ -901,6 +900,8 @@ static int korina_restart(struct net_device *dev) | |||
901 | 900 | ||
902 | korina_free_ring(dev); | 901 | korina_free_ring(dev); |
903 | 902 | ||
903 | napi_disable(&lp->napi); | ||
904 | |||
904 | ret = korina_init(dev); | 905 | ret = korina_init(dev); |
905 | if (ret < 0) { | 906 | if (ret < 0) { |
906 | printk(KERN_ERR DRV_NAME "%s: cannot restart device\n", | 907 | printk(KERN_ERR DRV_NAME "%s: cannot restart device\n", |
@@ -999,14 +1000,14 @@ static int korina_open(struct net_device *dev) | |||
999 | * that handles the Done Finished | 1000 | * that handles the Done Finished |
1000 | * Ovr and Und Events */ | 1001 | * Ovr and Und Events */ |
1001 | ret = request_irq(lp->rx_irq, &korina_rx_dma_interrupt, | 1002 | ret = request_irq(lp->rx_irq, &korina_rx_dma_interrupt, |
1002 | IRQF_SHARED | IRQF_DISABLED, "Korina ethernet Rx", dev); | 1003 | IRQF_DISABLED, "Korina ethernet Rx", dev); |
1003 | if (ret < 0) { | 1004 | if (ret < 0) { |
1004 | printk(KERN_ERR DRV_NAME "%s: unable to get Rx DMA IRQ %d\n", | 1005 | printk(KERN_ERR DRV_NAME "%s: unable to get Rx DMA IRQ %d\n", |
1005 | dev->name, lp->rx_irq); | 1006 | dev->name, lp->rx_irq); |
1006 | goto err_release; | 1007 | goto err_release; |
1007 | } | 1008 | } |
1008 | ret = request_irq(lp->tx_irq, &korina_tx_dma_interrupt, | 1009 | ret = request_irq(lp->tx_irq, &korina_tx_dma_interrupt, |
1009 | IRQF_SHARED | IRQF_DISABLED, "Korina ethernet Tx", dev); | 1010 | IRQF_DISABLED, "Korina ethernet Tx", dev); |
1010 | if (ret < 0) { | 1011 | if (ret < 0) { |
1011 | printk(KERN_ERR DRV_NAME "%s: unable to get Tx DMA IRQ %d\n", | 1012 | printk(KERN_ERR DRV_NAME "%s: unable to get Tx DMA IRQ %d\n", |
1012 | dev->name, lp->tx_irq); | 1013 | dev->name, lp->tx_irq); |
@@ -1015,7 +1016,7 @@ static int korina_open(struct net_device *dev) | |||
1015 | 1016 | ||
1016 | /* Install handler for overrun error. */ | 1017 | /* Install handler for overrun error. */ |
1017 | ret = request_irq(lp->ovr_irq, &korina_ovr_interrupt, | 1018 | ret = request_irq(lp->ovr_irq, &korina_ovr_interrupt, |
1018 | IRQF_SHARED | IRQF_DISABLED, "Ethernet Overflow", dev); | 1019 | IRQF_DISABLED, "Ethernet Overflow", dev); |
1019 | if (ret < 0) { | 1020 | if (ret < 0) { |
1020 | printk(KERN_ERR DRV_NAME"%s: unable to get OVR IRQ %d\n", | 1021 | printk(KERN_ERR DRV_NAME"%s: unable to get OVR IRQ %d\n", |
1021 | dev->name, lp->ovr_irq); | 1022 | dev->name, lp->ovr_irq); |
@@ -1024,7 +1025,7 @@ static int korina_open(struct net_device *dev) | |||
1024 | 1025 | ||
1025 | /* Install handler for underflow error. */ | 1026 | /* Install handler for underflow error. */ |
1026 | ret = request_irq(lp->und_irq, &korina_und_interrupt, | 1027 | ret = request_irq(lp->und_irq, &korina_und_interrupt, |
1027 | IRQF_SHARED | IRQF_DISABLED, "Ethernet Underflow", dev); | 1028 | IRQF_DISABLED, "Ethernet Underflow", dev); |
1028 | if (ret < 0) { | 1029 | if (ret < 0) { |
1029 | printk(KERN_ERR DRV_NAME "%s: unable to get UND IRQ %d\n", | 1030 | printk(KERN_ERR DRV_NAME "%s: unable to get UND IRQ %d\n", |
1030 | dev->name, lp->und_irq); | 1031 | dev->name, lp->und_irq); |
@@ -1067,6 +1068,8 @@ static int korina_close(struct net_device *dev) | |||
1067 | 1068 | ||
1068 | korina_free_ring(dev); | 1069 | korina_free_ring(dev); |
1069 | 1070 | ||
1071 | napi_disable(&lp->napi); | ||
1072 | |||
1070 | free_irq(lp->rx_irq, dev); | 1073 | free_irq(lp->rx_irq, dev); |
1071 | free_irq(lp->tx_irq, dev); | 1074 | free_irq(lp->tx_irq, dev); |
1072 | free_irq(lp->ovr_irq, dev); | 1075 | free_irq(lp->ovr_irq, dev); |
@@ -1089,7 +1092,6 @@ static int korina_probe(struct platform_device *pdev) | |||
1089 | return -ENOMEM; | 1092 | return -ENOMEM; |
1090 | } | 1093 | } |
1091 | SET_NETDEV_DEV(dev, &pdev->dev); | 1094 | SET_NETDEV_DEV(dev, &pdev->dev); |
1092 | platform_set_drvdata(pdev, dev); | ||
1093 | lp = netdev_priv(dev); | 1095 | lp = netdev_priv(dev); |
1094 | 1096 | ||
1095 | bif->dev = dev; | 1097 | bif->dev = dev; |
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c index 57716e22660c..8e884869a05b 100644 --- a/drivers/net/mac8390.c +++ b/drivers/net/mac8390.c | |||
@@ -486,6 +486,7 @@ static const struct net_device_ops mac8390_netdev_ops = { | |||
486 | .ndo_get_stats = ei_get_stats, | 486 | .ndo_get_stats = ei_get_stats, |
487 | .ndo_set_multicast_list = ei_set_multicast_list, | 487 | .ndo_set_multicast_list = ei_set_multicast_list, |
488 | .ndo_validate_addr = eth_validate_addr, | 488 | .ndo_validate_addr = eth_validate_addr, |
489 | .ndo_set_mac_address = eth_mac_addr, | ||
489 | .ndo_change_mtu = eth_change_mtu, | 490 | .ndo_change_mtu = eth_change_mtu, |
490 | #ifdef CONFIG_NET_POLL_CONTROLLER | 491 | #ifdef CONFIG_NET_POLL_CONTROLLER |
491 | .ndo_poll_controller = ei_poll, | 492 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index 15bb38d99304..9f6644a44030 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c | |||
@@ -952,6 +952,7 @@ static const struct net_device_ops mlx4_netdev_ops = { | |||
952 | .ndo_get_stats = mlx4_en_get_stats, | 952 | .ndo_get_stats = mlx4_en_get_stats, |
953 | .ndo_set_multicast_list = mlx4_en_set_multicast, | 953 | .ndo_set_multicast_list = mlx4_en_set_multicast, |
954 | .ndo_set_mac_address = mlx4_en_set_mac, | 954 | .ndo_set_mac_address = mlx4_en_set_mac, |
955 | .ndo_validate_addr = eth_validate_addr, | ||
955 | .ndo_change_mtu = mlx4_en_change_mtu, | 956 | .ndo_change_mtu = mlx4_en_change_mtu, |
956 | .ndo_tx_timeout = mlx4_en_tx_timeout, | 957 | .ndo_tx_timeout = mlx4_en_tx_timeout, |
957 | .ndo_vlan_rx_register = mlx4_en_vlan_rx_register, | 958 | .ndo_vlan_rx_register = mlx4_en_vlan_rx_register, |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 710c79e7a2db..6ef2490d5c3e 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -912,8 +912,8 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) | |||
912 | int i; | 912 | int i; |
913 | 913 | ||
914 | if (msi_x) { | 914 | if (msi_x) { |
915 | nreq = min(dev->caps.num_eqs - dev->caps.reserved_eqs, | 915 | nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, |
916 | num_possible_cpus() + 1); | 916 | num_possible_cpus() + 1); |
917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); | 917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); |
918 | if (!entries) | 918 | if (!entries) |
919 | goto no_msi; | 919 | goto no_msi; |
diff --git a/drivers/net/ne-h8300.c b/drivers/net/ne-h8300.c index b57239171046..7bd6662d5b04 100644 --- a/drivers/net/ne-h8300.c +++ b/drivers/net/ne-h8300.c | |||
@@ -202,6 +202,7 @@ static const struct net_device_ops ne_netdev_ops = { | |||
202 | .ndo_get_stats = ei_get_stats, | 202 | .ndo_get_stats = ei_get_stats, |
203 | .ndo_set_multicast_list = ei_set_multicast_list, | 203 | .ndo_set_multicast_list = ei_set_multicast_list, |
204 | .ndo_validate_addr = eth_validate_addr, | 204 | .ndo_validate_addr = eth_validate_addr, |
205 | .ndo_set_mac_address = eth_mac_addr, | ||
205 | .ndo_change_mtu = eth_change_mtu, | 206 | .ndo_change_mtu = eth_change_mtu, |
206 | #ifdef CONFIG_NET_POLL_CONTROLLER | 207 | #ifdef CONFIG_NET_POLL_CONTROLLER |
207 | .ndo_poll_controller = ei_poll, | 208 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index 62f20ba211cb..f090d3b9ec94 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c | |||
@@ -208,6 +208,7 @@ static const struct net_device_ops ne2k_netdev_ops = { | |||
208 | .ndo_get_stats = ei_get_stats, | 208 | .ndo_get_stats = ei_get_stats, |
209 | .ndo_set_multicast_list = ei_set_multicast_list, | 209 | .ndo_set_multicast_list = ei_set_multicast_list, |
210 | .ndo_validate_addr = eth_validate_addr, | 210 | .ndo_validate_addr = eth_validate_addr, |
211 | .ndo_set_mac_address = eth_mac_addr, | ||
211 | .ndo_change_mtu = eth_change_mtu, | 212 | .ndo_change_mtu = eth_change_mtu, |
212 | #ifdef CONFIG_NET_POLL_CONTROLLER | 213 | #ifdef CONFIG_NET_POLL_CONTROLLER |
213 | .ndo_poll_controller = ei_poll, | 214 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index f8e601c51da7..c11c568fd7db 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -308,27 +308,16 @@ struct netxen_ring_ctx { | |||
308 | #define netxen_set_cmd_desc_ctxid(cmd_desc, var) \ | 308 | #define netxen_set_cmd_desc_ctxid(cmd_desc, var) \ |
309 | ((cmd_desc)->port_ctxid |= ((var) << 4 & 0xF0)) | 309 | ((cmd_desc)->port_ctxid |= ((var) << 4 & 0xF0)) |
310 | 310 | ||
311 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ | 311 | #define netxen_set_tx_port(_desc, _port) \ |
312 | (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ | 312 | (_desc)->port_ctxid = ((_port) & 0xf) | (((_port) << 4) & 0xf0) |
313 | ~cpu_to_le16(0x7f)) | cpu_to_le16((val) & 0x7f) | 313 | |
314 | #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ | 314 | #define netxen_set_tx_flags_opcode(_desc, _flags, _opcode) \ |
315 | (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ | 315 | (_desc)->flags_opcode = \ |
316 | ~cpu_to_le16((u16)0x3f << 7)) | cpu_to_le16(((val) & 0x3f) << 7) | 316 | cpu_to_le16(((_flags) & 0x7f) | (((_opcode) & 0x3f) << 7)) |
317 | 317 | ||
318 | #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ | 318 | #define netxen_set_tx_frags_len(_desc, _frags, _len) \ |
319 | (cmd_desc)->num_of_buffers_total_length = \ | 319 | (_desc)->num_of_buffers_total_length = \ |
320 | ((cmd_desc)->num_of_buffers_total_length & \ | 320 | cpu_to_le32(((_frags) & 0xff) | (((_len) & 0xffffff) << 8)) |
321 | ~cpu_to_le32(0xff)) | cpu_to_le32((val) & 0xff) | ||
322 | #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ | ||
323 | (cmd_desc)->num_of_buffers_total_length = \ | ||
324 | ((cmd_desc)->num_of_buffers_total_length & \ | ||
325 | ~cpu_to_le32((u32)0xffffff << 8)) | \ | ||
326 | cpu_to_le32(((val) & 0xffffff) << 8) | ||
327 | |||
328 | #define netxen_get_cmd_desc_opcode(cmd_desc) \ | ||
329 | ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003f) | ||
330 | #define netxen_get_cmd_desc_totallength(cmd_desc) \ | ||
331 | ((le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) & 0xffffff) | ||
332 | 321 | ||
333 | struct cmd_desc_type0 { | 322 | struct cmd_desc_type0 { |
334 | u8 tcp_hdr_offset; /* For LSO only */ | 323 | u8 tcp_hdr_offset; /* For LSO only */ |
@@ -510,7 +499,8 @@ typedef enum { | |||
510 | NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a, | 499 | NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a, |
511 | NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b, | 500 | NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b, |
512 | NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, | 501 | NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, |
513 | NETXEN_BRDTYPE_P3_10G_XFP = 0x0032 | 502 | NETXEN_BRDTYPE_P3_10G_XFP = 0x0032, |
503 | NETXEN_BRDTYPE_P3_10G_TP = 0x0080 | ||
514 | 504 | ||
515 | } netxen_brdtype_t; | 505 | } netxen_brdtype_t; |
516 | 506 | ||
@@ -757,7 +747,7 @@ extern char netxen_nic_driver_name[]; | |||
757 | */ | 747 | */ |
758 | struct netxen_skb_frag { | 748 | struct netxen_skb_frag { |
759 | u64 dma; | 749 | u64 dma; |
760 | u32 length; | 750 | ulong length; |
761 | }; | 751 | }; |
762 | 752 | ||
763 | #define _netxen_set_bits(config_word, start, bits, val) {\ | 753 | #define _netxen_set_bits(config_word, start, bits, val) {\ |
@@ -783,13 +773,7 @@ struct netxen_skb_frag { | |||
783 | struct netxen_cmd_buffer { | 773 | struct netxen_cmd_buffer { |
784 | struct sk_buff *skb; | 774 | struct sk_buff *skb; |
785 | struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; | 775 | struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; |
786 | u32 total_length; | 776 | u32 frag_count; |
787 | u32 mss; | ||
788 | u16 port; | ||
789 | u8 cmd; | ||
790 | u8 frag_count; | ||
791 | unsigned long time_stamp; | ||
792 | u32 state; | ||
793 | }; | 777 | }; |
794 | 778 | ||
795 | /* In rx_buffer, we do not need multiple fragments as is a single buffer */ | 779 | /* In rx_buffer, we do not need multiple fragments as is a single buffer */ |
@@ -876,7 +860,6 @@ struct nx_host_rds_ring { | |||
876 | u32 skb_size; | 860 | u32 skb_size; |
877 | struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ | 861 | struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ |
878 | struct list_head free_list; | 862 | struct list_head free_list; |
879 | int begin_alloc; | ||
880 | }; | 863 | }; |
881 | 864 | ||
882 | /* | 865 | /* |
@@ -995,31 +978,31 @@ struct netxen_recv_context { | |||
995 | */ | 978 | */ |
996 | 979 | ||
997 | typedef struct { | 980 | typedef struct { |
998 | u64 host_phys_addr; /* Ring base addr */ | 981 | __le64 host_phys_addr; /* Ring base addr */ |
999 | u32 ring_size; /* Ring entries */ | 982 | __le32 ring_size; /* Ring entries */ |
1000 | u16 msi_index; | 983 | __le16 msi_index; |
1001 | u16 rsvd; /* Padding */ | 984 | __le16 rsvd; /* Padding */ |
1002 | } nx_hostrq_sds_ring_t; | 985 | } nx_hostrq_sds_ring_t; |
1003 | 986 | ||
1004 | typedef struct { | 987 | typedef struct { |
1005 | u64 host_phys_addr; /* Ring base addr */ | 988 | __le64 host_phys_addr; /* Ring base addr */ |
1006 | u64 buff_size; /* Packet buffer size */ | 989 | __le64 buff_size; /* Packet buffer size */ |
1007 | u32 ring_size; /* Ring entries */ | 990 | __le32 ring_size; /* Ring entries */ |
1008 | u32 ring_kind; /* Class of ring */ | 991 | __le32 ring_kind; /* Class of ring */ |
1009 | } nx_hostrq_rds_ring_t; | 992 | } nx_hostrq_rds_ring_t; |
1010 | 993 | ||
1011 | typedef struct { | 994 | typedef struct { |
1012 | u64 host_rsp_dma_addr; /* Response dma'd here */ | 995 | __le64 host_rsp_dma_addr; /* Response dma'd here */ |
1013 | u32 capabilities[4]; /* Flag bit vector */ | 996 | __le32 capabilities[4]; /* Flag bit vector */ |
1014 | u32 host_int_crb_mode; /* Interrupt crb usage */ | 997 | __le32 host_int_crb_mode; /* Interrupt crb usage */ |
1015 | u32 host_rds_crb_mode; /* RDS crb usage */ | 998 | __le32 host_rds_crb_mode; /* RDS crb usage */ |
1016 | /* These ring offsets are relative to data[0] below */ | 999 | /* These ring offsets are relative to data[0] below */ |
1017 | u32 rds_ring_offset; /* Offset to RDS config */ | 1000 | __le32 rds_ring_offset; /* Offset to RDS config */ |
1018 | u32 sds_ring_offset; /* Offset to SDS config */ | 1001 | __le32 sds_ring_offset; /* Offset to SDS config */ |
1019 | u16 num_rds_rings; /* Count of RDS rings */ | 1002 | __le16 num_rds_rings; /* Count of RDS rings */ |
1020 | u16 num_sds_rings; /* Count of SDS rings */ | 1003 | __le16 num_sds_rings; /* Count of SDS rings */ |
1021 | u16 rsvd1; /* Padding */ | 1004 | __le16 rsvd1; /* Padding */ |
1022 | u16 rsvd2; /* Padding */ | 1005 | __le16 rsvd2; /* Padding */ |
1023 | u8 reserved[128]; /* reserve space for future expansion*/ | 1006 | u8 reserved[128]; /* reserve space for future expansion*/ |
1024 | /* MUST BE 64-bit aligned. | 1007 | /* MUST BE 64-bit aligned. |
1025 | The following is packed: | 1008 | The following is packed: |
@@ -1029,24 +1012,24 @@ typedef struct { | |||
1029 | } nx_hostrq_rx_ctx_t; | 1012 | } nx_hostrq_rx_ctx_t; |
1030 | 1013 | ||
1031 | typedef struct { | 1014 | typedef struct { |
1032 | u32 host_producer_crb; /* Crb to use */ | 1015 | __le32 host_producer_crb; /* Crb to use */ |
1033 | u32 rsvd1; /* Padding */ | 1016 | __le32 rsvd1; /* Padding */ |
1034 | } nx_cardrsp_rds_ring_t; | 1017 | } nx_cardrsp_rds_ring_t; |
1035 | 1018 | ||
1036 | typedef struct { | 1019 | typedef struct { |
1037 | u32 host_consumer_crb; /* Crb to use */ | 1020 | __le32 host_consumer_crb; /* Crb to use */ |
1038 | u32 interrupt_crb; /* Crb to use */ | 1021 | __le32 interrupt_crb; /* Crb to use */ |
1039 | } nx_cardrsp_sds_ring_t; | 1022 | } nx_cardrsp_sds_ring_t; |
1040 | 1023 | ||
1041 | typedef struct { | 1024 | typedef struct { |
1042 | /* These ring offsets are relative to data[0] below */ | 1025 | /* These ring offsets are relative to data[0] below */ |
1043 | u32 rds_ring_offset; /* Offset to RDS config */ | 1026 | __le32 rds_ring_offset; /* Offset to RDS config */ |
1044 | u32 sds_ring_offset; /* Offset to SDS config */ | 1027 | __le32 sds_ring_offset; /* Offset to SDS config */ |
1045 | u32 host_ctx_state; /* Starting State */ | 1028 | __le32 host_ctx_state; /* Starting State */ |
1046 | u32 num_fn_per_port; /* How many PCI fn share the port */ | 1029 | __le32 num_fn_per_port; /* How many PCI fn share the port */ |
1047 | u16 num_rds_rings; /* Count of RDS rings */ | 1030 | __le16 num_rds_rings; /* Count of RDS rings */ |
1048 | u16 num_sds_rings; /* Count of SDS rings */ | 1031 | __le16 num_sds_rings; /* Count of SDS rings */ |
1049 | u16 context_id; /* Handle for context */ | 1032 | __le16 context_id; /* Handle for context */ |
1050 | u8 phys_port; /* Physical id of port */ | 1033 | u8 phys_port; /* Physical id of port */ |
1051 | u8 virt_port; /* Virtual/Logical id of port */ | 1034 | u8 virt_port; /* Virtual/Logical id of port */ |
1052 | u8 reserved[128]; /* save space for future expansion */ | 1035 | u8 reserved[128]; /* save space for future expansion */ |
@@ -1072,34 +1055,34 @@ typedef struct { | |||
1072 | */ | 1055 | */ |
1073 | 1056 | ||
1074 | typedef struct { | 1057 | typedef struct { |
1075 | u64 host_phys_addr; /* Ring base addr */ | 1058 | __le64 host_phys_addr; /* Ring base addr */ |
1076 | u32 ring_size; /* Ring entries */ | 1059 | __le32 ring_size; /* Ring entries */ |
1077 | u32 rsvd; /* Padding */ | 1060 | __le32 rsvd; /* Padding */ |
1078 | } nx_hostrq_cds_ring_t; | 1061 | } nx_hostrq_cds_ring_t; |
1079 | 1062 | ||
1080 | typedef struct { | 1063 | typedef struct { |
1081 | u64 host_rsp_dma_addr; /* Response dma'd here */ | 1064 | __le64 host_rsp_dma_addr; /* Response dma'd here */ |
1082 | u64 cmd_cons_dma_addr; /* */ | 1065 | __le64 cmd_cons_dma_addr; /* */ |
1083 | u64 dummy_dma_addr; /* */ | 1066 | __le64 dummy_dma_addr; /* */ |
1084 | u32 capabilities[4]; /* Flag bit vector */ | 1067 | __le32 capabilities[4]; /* Flag bit vector */ |
1085 | u32 host_int_crb_mode; /* Interrupt crb usage */ | 1068 | __le32 host_int_crb_mode; /* Interrupt crb usage */ |
1086 | u32 rsvd1; /* Padding */ | 1069 | __le32 rsvd1; /* Padding */ |
1087 | u16 rsvd2; /* Padding */ | 1070 | __le16 rsvd2; /* Padding */ |
1088 | u16 interrupt_ctl; | 1071 | __le16 interrupt_ctl; |
1089 | u16 msi_index; | 1072 | __le16 msi_index; |
1090 | u16 rsvd3; /* Padding */ | 1073 | __le16 rsvd3; /* Padding */ |
1091 | nx_hostrq_cds_ring_t cds_ring; /* Desc of cds ring */ | 1074 | nx_hostrq_cds_ring_t cds_ring; /* Desc of cds ring */ |
1092 | u8 reserved[128]; /* future expansion */ | 1075 | u8 reserved[128]; /* future expansion */ |
1093 | } nx_hostrq_tx_ctx_t; | 1076 | } nx_hostrq_tx_ctx_t; |
1094 | 1077 | ||
1095 | typedef struct { | 1078 | typedef struct { |
1096 | u32 host_producer_crb; /* Crb to use */ | 1079 | __le32 host_producer_crb; /* Crb to use */ |
1097 | u32 interrupt_crb; /* Crb to use */ | 1080 | __le32 interrupt_crb; /* Crb to use */ |
1098 | } nx_cardrsp_cds_ring_t; | 1081 | } nx_cardrsp_cds_ring_t; |
1099 | 1082 | ||
1100 | typedef struct { | 1083 | typedef struct { |
1101 | u32 host_ctx_state; /* Starting state */ | 1084 | __le32 host_ctx_state; /* Starting state */ |
1102 | u16 context_id; /* Handle for context */ | 1085 | __le16 context_id; /* Handle for context */ |
1103 | u8 phys_port; /* Physical id of port */ | 1086 | u8 phys_port; /* Physical id of port */ |
1104 | u8 virt_port; /* Virtual/Logical id of port */ | 1087 | u8 virt_port; /* Virtual/Logical id of port */ |
1105 | nx_cardrsp_cds_ring_t cds_ring; /* Card cds settings */ | 1088 | nx_cardrsp_cds_ring_t cds_ring; /* Card cds settings */ |
@@ -1202,9 +1185,9 @@ enum { | |||
1202 | #define VPORT_MISS_MODE_ACCEPT_MULTI 2 /* accept unmatched multicast */ | 1185 | #define VPORT_MISS_MODE_ACCEPT_MULTI 2 /* accept unmatched multicast */ |
1203 | 1186 | ||
1204 | typedef struct { | 1187 | typedef struct { |
1205 | u64 qhdr; | 1188 | __le64 qhdr; |
1206 | u64 req_hdr; | 1189 | __le64 req_hdr; |
1207 | u64 words[6]; | 1190 | __le64 words[6]; |
1208 | } nx_nic_req_t; | 1191 | } nx_nic_req_t; |
1209 | 1192 | ||
1210 | typedef struct { | 1193 | typedef struct { |
@@ -1486,8 +1469,6 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter); | |||
1486 | 1469 | ||
1487 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); | 1470 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); |
1488 | int netxen_init_firmware(struct netxen_adapter *adapter); | 1471 | int netxen_init_firmware(struct netxen_adapter *adapter); |
1489 | void netxen_tso_check(struct netxen_adapter *adapter, | ||
1490 | struct cmd_desc_type0 *desc, struct sk_buff *skb); | ||
1491 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); | 1472 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); |
1492 | void netxen_watchdog_task(struct work_struct *work); | 1473 | void netxen_watchdog_task(struct work_struct *work); |
1493 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, | 1474 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, |
@@ -1496,6 +1477,7 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter); | |||
1496 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); | 1477 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); |
1497 | void netxen_p2_nic_set_multi(struct net_device *netdev); | 1478 | void netxen_p2_nic_set_multi(struct net_device *netdev); |
1498 | void netxen_p3_nic_set_multi(struct net_device *netdev); | 1479 | void netxen_p3_nic_set_multi(struct net_device *netdev); |
1480 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter); | ||
1499 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); | 1481 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); |
1500 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); | 1482 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); |
1501 | 1483 | ||
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index 64b51643c626..746bdb470418 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c | |||
@@ -76,7 +76,7 @@ netxen_api_unlock(struct netxen_adapter *adapter) | |||
76 | static u32 | 76 | static u32 |
77 | netxen_poll_rsp(struct netxen_adapter *adapter) | 77 | netxen_poll_rsp(struct netxen_adapter *adapter) |
78 | { | 78 | { |
79 | u32 raw_rsp, rsp = NX_CDRP_RSP_OK; | 79 | u32 rsp = NX_CDRP_RSP_OK; |
80 | int timeout = 0; | 80 | int timeout = 0; |
81 | 81 | ||
82 | do { | 82 | do { |
@@ -86,10 +86,7 @@ netxen_poll_rsp(struct netxen_adapter *adapter) | |||
86 | if (++timeout > NX_OS_CRB_RETRY_COUNT) | 86 | if (++timeout > NX_OS_CRB_RETRY_COUNT) |
87 | return NX_CDRP_RSP_TIMEOUT; | 87 | return NX_CDRP_RSP_TIMEOUT; |
88 | 88 | ||
89 | netxen_nic_read_w1(adapter, NX_CDRP_CRB_OFFSET, | 89 | netxen_nic_read_w1(adapter, NX_CDRP_CRB_OFFSET, &rsp); |
90 | &raw_rsp); | ||
91 | |||
92 | rsp = le32_to_cpu(raw_rsp); | ||
93 | } while (!NX_CDRP_IS_RSP(rsp)); | 90 | } while (!NX_CDRP_IS_RSP(rsp)); |
94 | 91 | ||
95 | return rsp; | 92 | return rsp; |
@@ -109,20 +106,16 @@ netxen_issue_cmd(struct netxen_adapter *adapter, | |||
109 | if (netxen_api_lock(adapter)) | 106 | if (netxen_api_lock(adapter)) |
110 | return NX_RCODE_TIMEOUT; | 107 | return NX_RCODE_TIMEOUT; |
111 | 108 | ||
112 | netxen_nic_write_w1(adapter, NX_SIGN_CRB_OFFSET, | 109 | netxen_nic_write_w1(adapter, NX_SIGN_CRB_OFFSET, signature); |
113 | cpu_to_le32(signature)); | ||
114 | 110 | ||
115 | netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET, | 111 | netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET, arg1); |
116 | cpu_to_le32(arg1)); | ||
117 | 112 | ||
118 | netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET, | 113 | netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET, arg2); |
119 | cpu_to_le32(arg2)); | ||
120 | 114 | ||
121 | netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET, | 115 | netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET, arg3); |
122 | cpu_to_le32(arg3)); | ||
123 | 116 | ||
124 | netxen_nic_write_w1(adapter, NX_CDRP_CRB_OFFSET, | 117 | netxen_nic_write_w1(adapter, NX_CDRP_CRB_OFFSET, |
125 | cpu_to_le32(NX_CDRP_FORM_CMD(cmd))); | 118 | NX_CDRP_FORM_CMD(cmd)); |
126 | 119 | ||
127 | rsp = netxen_poll_rsp(adapter); | 120 | rsp = netxen_poll_rsp(adapter); |
128 | 121 | ||
@@ -133,7 +126,6 @@ netxen_issue_cmd(struct netxen_adapter *adapter, | |||
133 | rcode = NX_RCODE_TIMEOUT; | 126 | rcode = NX_RCODE_TIMEOUT; |
134 | } else if (rsp == NX_CDRP_RSP_FAIL) { | 127 | } else if (rsp == NX_CDRP_RSP_FAIL) { |
135 | netxen_nic_read_w1(adapter, NX_ARG1_CRB_OFFSET, &rcode); | 128 | netxen_nic_read_w1(adapter, NX_ARG1_CRB_OFFSET, &rcode); |
136 | rcode = le32_to_cpu(rcode); | ||
137 | 129 | ||
138 | printk(KERN_ERR "%s: failed card response code:0x%x\n", | 130 | printk(KERN_ERR "%s: failed card response code:0x%x\n", |
139 | netxen_nic_driver_name, rcode); | 131 | netxen_nic_driver_name, rcode); |
@@ -183,7 +175,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
183 | 175 | ||
184 | int i, nrds_rings, nsds_rings; | 176 | int i, nrds_rings, nsds_rings; |
185 | size_t rq_size, rsp_size; | 177 | size_t rq_size, rsp_size; |
186 | u32 cap, reg; | 178 | u32 cap, reg, val; |
187 | 179 | ||
188 | int err; | 180 | int err; |
189 | 181 | ||
@@ -225,11 +217,14 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
225 | 217 | ||
226 | prq->num_rds_rings = cpu_to_le16(nrds_rings); | 218 | prq->num_rds_rings = cpu_to_le16(nrds_rings); |
227 | prq->num_sds_rings = cpu_to_le16(nsds_rings); | 219 | prq->num_sds_rings = cpu_to_le16(nsds_rings); |
228 | prq->rds_ring_offset = 0; | 220 | prq->rds_ring_offset = cpu_to_le32(0); |
229 | prq->sds_ring_offset = prq->rds_ring_offset + | 221 | |
222 | val = le32_to_cpu(prq->rds_ring_offset) + | ||
230 | (sizeof(nx_hostrq_rds_ring_t) * nrds_rings); | 223 | (sizeof(nx_hostrq_rds_ring_t) * nrds_rings); |
224 | prq->sds_ring_offset = cpu_to_le32(val); | ||
231 | 225 | ||
232 | prq_rds = (nx_hostrq_rds_ring_t *)(prq->data + prq->rds_ring_offset); | 226 | prq_rds = (nx_hostrq_rds_ring_t *)(prq->data + |
227 | le32_to_cpu(prq->rds_ring_offset)); | ||
233 | 228 | ||
234 | for (i = 0; i < nrds_rings; i++) { | 229 | for (i = 0; i < nrds_rings; i++) { |
235 | 230 | ||
@@ -241,17 +236,14 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
241 | prq_rds[i].buff_size = cpu_to_le64(rds_ring->dma_size); | 236 | prq_rds[i].buff_size = cpu_to_le64(rds_ring->dma_size); |
242 | } | 237 | } |
243 | 238 | ||
244 | prq_sds = (nx_hostrq_sds_ring_t *)(prq->data + prq->sds_ring_offset); | 239 | prq_sds = (nx_hostrq_sds_ring_t *)(prq->data + |
240 | le32_to_cpu(prq->sds_ring_offset)); | ||
245 | 241 | ||
246 | prq_sds[0].host_phys_addr = | 242 | prq_sds[0].host_phys_addr = |
247 | cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr); | 243 | cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr); |
248 | prq_sds[0].ring_size = cpu_to_le32(adapter->max_rx_desc_count); | 244 | prq_sds[0].ring_size = cpu_to_le32(adapter->max_rx_desc_count); |
249 | /* only one msix vector for now */ | 245 | /* only one msix vector for now */ |
250 | prq_sds[0].msi_index = cpu_to_le32(0); | 246 | prq_sds[0].msi_index = cpu_to_le16(0); |
251 | |||
252 | /* now byteswap offsets */ | ||
253 | prq->rds_ring_offset = cpu_to_le32(prq->rds_ring_offset); | ||
254 | prq->sds_ring_offset = cpu_to_le32(prq->sds_ring_offset); | ||
255 | 247 | ||
256 | phys_addr = hostrq_phys_addr; | 248 | phys_addr = hostrq_phys_addr; |
257 | err = netxen_issue_cmd(adapter, | 249 | err = netxen_issue_cmd(adapter, |
@@ -269,9 +261,9 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
269 | 261 | ||
270 | 262 | ||
271 | prsp_rds = ((nx_cardrsp_rds_ring_t *) | 263 | prsp_rds = ((nx_cardrsp_rds_ring_t *) |
272 | &prsp->data[prsp->rds_ring_offset]); | 264 | &prsp->data[le32_to_cpu(prsp->rds_ring_offset)]); |
273 | 265 | ||
274 | for (i = 0; i < le32_to_cpu(prsp->num_rds_rings); i++) { | 266 | for (i = 0; i < le16_to_cpu(prsp->num_rds_rings); i++) { |
275 | rds_ring = &recv_ctx->rds_rings[i]; | 267 | rds_ring = &recv_ctx->rds_rings[i]; |
276 | 268 | ||
277 | reg = le32_to_cpu(prsp_rds[i].host_producer_crb); | 269 | reg = le32_to_cpu(prsp_rds[i].host_producer_crb); |
@@ -279,7 +271,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
279 | } | 271 | } |
280 | 272 | ||
281 | prsp_sds = ((nx_cardrsp_sds_ring_t *) | 273 | prsp_sds = ((nx_cardrsp_sds_ring_t *) |
282 | &prsp->data[prsp->sds_ring_offset]); | 274 | &prsp->data[le32_to_cpu(prsp->sds_ring_offset)]); |
283 | reg = le32_to_cpu(prsp_sds[0].host_consumer_crb); | 275 | reg = le32_to_cpu(prsp_sds[0].host_consumer_crb); |
284 | recv_ctx->crb_sts_consumer = NETXEN_NIC_REG(reg - 0x200); | 276 | recv_ctx->crb_sts_consumer = NETXEN_NIC_REG(reg - 0x200); |
285 | 277 | ||
@@ -288,7 +280,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
288 | 280 | ||
289 | recv_ctx->state = le32_to_cpu(prsp->host_ctx_state); | 281 | recv_ctx->state = le32_to_cpu(prsp->host_ctx_state); |
290 | recv_ctx->context_id = le16_to_cpu(prsp->context_id); | 282 | recv_ctx->context_id = le16_to_cpu(prsp->context_id); |
291 | recv_ctx->virt_port = le16_to_cpu(prsp->virt_port); | 283 | recv_ctx->virt_port = prsp->virt_port; |
292 | 284 | ||
293 | out_free_rsp: | 285 | out_free_rsp: |
294 | pci_free_consistent(adapter->pdev, rsp_size, prsp, cardrsp_phys_addr); | 286 | pci_free_consistent(adapter->pdev, rsp_size, prsp, cardrsp_phys_addr); |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index e45ce2951729..c0bd40fcf708 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -136,11 +136,9 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
136 | 136 | ||
137 | ecmd->port = PORT_TP; | 137 | ecmd->port = PORT_TP; |
138 | 138 | ||
139 | if (netif_running(dev)) { | 139 | ecmd->speed = adapter->link_speed; |
140 | ecmd->speed = adapter->link_speed; | 140 | ecmd->duplex = adapter->link_duplex; |
141 | ecmd->duplex = adapter->link_duplex; | 141 | ecmd->autoneg = adapter->link_autoneg; |
142 | ecmd->autoneg = adapter->link_autoneg; | ||
143 | } | ||
144 | 142 | ||
145 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | 143 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
146 | u32 val; | 144 | u32 val; |
@@ -171,7 +169,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
171 | } else | 169 | } else |
172 | return -EIO; | 170 | return -EIO; |
173 | 171 | ||
174 | ecmd->phy_address = adapter->portnum; | 172 | ecmd->phy_address = adapter->physical_port; |
175 | ecmd->transceiver = XCVR_EXTERNAL; | 173 | ecmd->transceiver = XCVR_EXTERNAL; |
176 | 174 | ||
177 | switch ((netxen_brdtype_t) boardinfo->board_type) { | 175 | switch ((netxen_brdtype_t) boardinfo->board_type) { |
@@ -180,13 +178,13 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
180 | case NETXEN_BRDTYPE_P3_REF_QG: | 178 | case NETXEN_BRDTYPE_P3_REF_QG: |
181 | case NETXEN_BRDTYPE_P3_4_GB: | 179 | case NETXEN_BRDTYPE_P3_4_GB: |
182 | case NETXEN_BRDTYPE_P3_4_GB_MM: | 180 | case NETXEN_BRDTYPE_P3_4_GB_MM: |
183 | case NETXEN_BRDTYPE_P3_10000_BASE_T: | ||
184 | 181 | ||
185 | ecmd->supported |= SUPPORTED_Autoneg; | 182 | ecmd->supported |= SUPPORTED_Autoneg; |
186 | ecmd->advertising |= ADVERTISED_Autoneg; | 183 | ecmd->advertising |= ADVERTISED_Autoneg; |
187 | case NETXEN_BRDTYPE_P2_SB31_10G_CX4: | 184 | case NETXEN_BRDTYPE_P2_SB31_10G_CX4: |
188 | case NETXEN_BRDTYPE_P3_10G_CX4: | 185 | case NETXEN_BRDTYPE_P3_10G_CX4: |
189 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: | 186 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: |
187 | case NETXEN_BRDTYPE_P3_10000_BASE_T: | ||
190 | ecmd->supported |= SUPPORTED_TP; | 188 | ecmd->supported |= SUPPORTED_TP; |
191 | ecmd->advertising |= ADVERTISED_TP; | 189 | ecmd->advertising |= ADVERTISED_TP; |
192 | ecmd->port = PORT_TP; | 190 | ecmd->port = PORT_TP; |
@@ -204,16 +202,33 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
204 | ecmd->port = PORT_FIBRE; | 202 | ecmd->port = PORT_FIBRE; |
205 | ecmd->autoneg = AUTONEG_DISABLE; | 203 | ecmd->autoneg = AUTONEG_DISABLE; |
206 | break; | 204 | break; |
207 | case NETXEN_BRDTYPE_P2_SB31_10G: | ||
208 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: | 205 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: |
209 | case NETXEN_BRDTYPE_P3_10G_SFP_CT: | 206 | case NETXEN_BRDTYPE_P3_10G_SFP_CT: |
210 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: | 207 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: |
208 | ecmd->advertising |= ADVERTISED_TP; | ||
209 | ecmd->supported |= SUPPORTED_TP; | ||
210 | case NETXEN_BRDTYPE_P2_SB31_10G: | ||
211 | case NETXEN_BRDTYPE_P3_10G_XFP: | 211 | case NETXEN_BRDTYPE_P3_10G_XFP: |
212 | ecmd->supported |= SUPPORTED_FIBRE; | 212 | ecmd->supported |= SUPPORTED_FIBRE; |
213 | ecmd->advertising |= ADVERTISED_FIBRE; | 213 | ecmd->advertising |= ADVERTISED_FIBRE; |
214 | ecmd->port = PORT_FIBRE; | 214 | ecmd->port = PORT_FIBRE; |
215 | ecmd->autoneg = AUTONEG_DISABLE; | 215 | ecmd->autoneg = AUTONEG_DISABLE; |
216 | break; | 216 | break; |
217 | case NETXEN_BRDTYPE_P3_10G_TP: | ||
218 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | ||
219 | ecmd->autoneg = AUTONEG_DISABLE; | ||
220 | ecmd->supported |= (SUPPORTED_FIBRE | SUPPORTED_TP); | ||
221 | ecmd->advertising |= | ||
222 | (ADVERTISED_FIBRE | ADVERTISED_TP); | ||
223 | ecmd->port = PORT_FIBRE; | ||
224 | } else { | ||
225 | ecmd->autoneg = AUTONEG_ENABLE; | ||
226 | ecmd->supported |= (SUPPORTED_TP |SUPPORTED_Autoneg); | ||
227 | ecmd->advertising |= | ||
228 | (ADVERTISED_TP | ADVERTISED_Autoneg); | ||
229 | ecmd->port = PORT_TP; | ||
230 | } | ||
231 | break; | ||
217 | default: | 232 | default: |
218 | printk(KERN_ERR "netxen-nic: Unsupported board model %d\n", | 233 | printk(KERN_ERR "netxen-nic: Unsupported board model %d\n", |
219 | (netxen_brdtype_t) boardinfo->board_type); | 234 | (netxen_brdtype_t) boardinfo->board_type); |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index aa6e603bfcbf..821cff68b3f3 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -503,17 +503,15 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter, | |||
503 | 503 | ||
504 | i = 0; | 504 | i = 0; |
505 | 505 | ||
506 | netif_tx_lock_bh(adapter->netdev); | ||
507 | |||
506 | producer = adapter->cmd_producer; | 508 | producer = adapter->cmd_producer; |
507 | do { | 509 | do { |
508 | cmd_desc = &cmd_desc_arr[i]; | 510 | cmd_desc = &cmd_desc_arr[i]; |
509 | 511 | ||
510 | pbuf = &adapter->cmd_buf_arr[producer]; | 512 | pbuf = &adapter->cmd_buf_arr[producer]; |
511 | pbuf->mss = 0; | ||
512 | pbuf->total_length = 0; | ||
513 | pbuf->skb = NULL; | 513 | pbuf->skb = NULL; |
514 | pbuf->cmd = 0; | ||
515 | pbuf->frag_count = 0; | 514 | pbuf->frag_count = 0; |
516 | pbuf->port = 0; | ||
517 | 515 | ||
518 | /* adapter->ahw.cmd_desc_head[producer] = *cmd_desc; */ | 516 | /* adapter->ahw.cmd_desc_head[producer] = *cmd_desc; */ |
519 | memcpy(&adapter->ahw.cmd_desc_head[producer], | 517 | memcpy(&adapter->ahw.cmd_desc_head[producer], |
@@ -531,6 +529,8 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter, | |||
531 | 529 | ||
532 | netxen_nic_update_cmd_producer(adapter, adapter->cmd_producer); | 530 | netxen_nic_update_cmd_producer(adapter, adapter->cmd_producer); |
533 | 531 | ||
532 | netif_tx_unlock_bh(adapter->netdev); | ||
533 | |||
534 | return 0; | 534 | return 0; |
535 | } | 535 | } |
536 | 536 | ||
@@ -539,16 +539,19 @@ static int nx_p3_sre_macaddr_change(struct net_device *dev, | |||
539 | { | 539 | { |
540 | struct netxen_adapter *adapter = netdev_priv(dev); | 540 | struct netxen_adapter *adapter = netdev_priv(dev); |
541 | nx_nic_req_t req; | 541 | nx_nic_req_t req; |
542 | nx_mac_req_t mac_req; | 542 | nx_mac_req_t *mac_req; |
543 | u64 word; | ||
543 | int rv; | 544 | int rv; |
544 | 545 | ||
545 | memset(&req, 0, sizeof(nx_nic_req_t)); | 546 | memset(&req, 0, sizeof(nx_nic_req_t)); |
546 | req.qhdr |= (NX_NIC_REQUEST << 23); | 547 | req.qhdr = cpu_to_le64(NX_NIC_REQUEST << 23); |
547 | req.req_hdr |= NX_MAC_EVENT; | 548 | |
548 | req.req_hdr |= ((u64)adapter->portnum << 16); | 549 | word = NX_MAC_EVENT | ((u64)adapter->portnum << 16); |
549 | mac_req.op = op; | 550 | req.req_hdr = cpu_to_le64(word); |
550 | memcpy(&mac_req.mac_addr, addr, 6); | 551 | |
551 | req.words[0] = cpu_to_le64(*(u64 *)&mac_req); | 552 | mac_req = (nx_mac_req_t *)&req.words[0]; |
553 | mac_req->op = op; | ||
554 | memcpy(mac_req->mac_addr, addr, 6); | ||
552 | 555 | ||
553 | rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); | 556 | rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); |
554 | if (rv != 0) { | 557 | if (rv != 0) { |
@@ -612,18 +615,35 @@ send_fw_cmd: | |||
612 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) | 615 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) |
613 | { | 616 | { |
614 | nx_nic_req_t req; | 617 | nx_nic_req_t req; |
618 | u64 word; | ||
615 | 619 | ||
616 | memset(&req, 0, sizeof(nx_nic_req_t)); | 620 | memset(&req, 0, sizeof(nx_nic_req_t)); |
617 | 621 | ||
618 | req.qhdr |= (NX_HOST_REQUEST << 23); | 622 | req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23); |
619 | req.req_hdr |= NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE; | 623 | |
620 | req.req_hdr |= ((u64)adapter->portnum << 16); | 624 | word = NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE | |
625 | ((u64)adapter->portnum << 16); | ||
626 | req.req_hdr = cpu_to_le64(word); | ||
627 | |||
621 | req.words[0] = cpu_to_le64(mode); | 628 | req.words[0] = cpu_to_le64(mode); |
622 | 629 | ||
623 | return netxen_send_cmd_descs(adapter, | 630 | return netxen_send_cmd_descs(adapter, |
624 | (struct cmd_desc_type0 *)&req, 1); | 631 | (struct cmd_desc_type0 *)&req, 1); |
625 | } | 632 | } |
626 | 633 | ||
634 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter) | ||
635 | { | ||
636 | nx_mac_list_t *cur, *next; | ||
637 | |||
638 | cur = adapter->mac_list; | ||
639 | |||
640 | while (cur) { | ||
641 | next = cur->next; | ||
642 | kfree(cur); | ||
643 | cur = next; | ||
644 | } | ||
645 | } | ||
646 | |||
627 | #define NETXEN_CONFIG_INTR_COALESCE 3 | 647 | #define NETXEN_CONFIG_INTR_COALESCE 3 |
628 | 648 | ||
629 | /* | 649 | /* |
@@ -632,13 +652,15 @@ int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) | |||
632 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter) | 652 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter) |
633 | { | 653 | { |
634 | nx_nic_req_t req; | 654 | nx_nic_req_t req; |
655 | u64 word; | ||
635 | int rv; | 656 | int rv; |
636 | 657 | ||
637 | memset(&req, 0, sizeof(nx_nic_req_t)); | 658 | memset(&req, 0, sizeof(nx_nic_req_t)); |
638 | 659 | ||
639 | req.qhdr |= (NX_NIC_REQUEST << 23); | 660 | req.qhdr = cpu_to_le64(NX_NIC_REQUEST << 23); |
640 | req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE; | 661 | |
641 | req.req_hdr |= ((u64)adapter->portnum << 16); | 662 | word = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16); |
663 | req.req_hdr = cpu_to_le64(word); | ||
642 | 664 | ||
643 | memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal)); | 665 | memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal)); |
644 | 666 | ||
@@ -772,13 +794,10 @@ int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, __le64 *mac) | |||
772 | adapter->hw_read_wx(adapter, crbaddr, &mac_lo, 4); | 794 | adapter->hw_read_wx(adapter, crbaddr, &mac_lo, 4); |
773 | adapter->hw_read_wx(adapter, crbaddr+4, &mac_hi, 4); | 795 | adapter->hw_read_wx(adapter, crbaddr+4, &mac_hi, 4); |
774 | 796 | ||
775 | mac_hi = cpu_to_le32(mac_hi); | ||
776 | mac_lo = cpu_to_le32(mac_lo); | ||
777 | |||
778 | if (pci_func & 1) | 797 | if (pci_func & 1) |
779 | *mac = ((mac_lo >> 16) | ((u64)mac_hi << 16)); | 798 | *mac = le64_to_cpu((mac_lo >> 16) | ((u64)mac_hi << 16)); |
780 | else | 799 | else |
781 | *mac = ((mac_lo) | ((u64)mac_hi << 32)); | 800 | *mac = le64_to_cpu((u64)mac_lo | ((u64)mac_hi << 32)); |
782 | 801 | ||
783 | return 0; | 802 | return 0; |
784 | } | 803 | } |
@@ -937,7 +956,7 @@ int netxen_load_firmware(struct netxen_adapter *adapter) | |||
937 | { | 956 | { |
938 | int i; | 957 | int i; |
939 | u32 data, size = 0; | 958 | u32 data, size = 0; |
940 | u32 flashaddr = NETXEN_BOOTLD_START, memaddr = NETXEN_BOOTLD_START; | 959 | u32 flashaddr = NETXEN_BOOTLD_START; |
941 | 960 | ||
942 | size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START)/4; | 961 | size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START)/4; |
943 | 962 | ||
@@ -949,10 +968,8 @@ int netxen_load_firmware(struct netxen_adapter *adapter) | |||
949 | if (netxen_rom_fast_read(adapter, flashaddr, (int *)&data) != 0) | 968 | if (netxen_rom_fast_read(adapter, flashaddr, (int *)&data) != 0) |
950 | return -EIO; | 969 | return -EIO; |
951 | 970 | ||
952 | adapter->pci_mem_write(adapter, memaddr, &data, 4); | 971 | adapter->pci_mem_write(adapter, flashaddr, &data, 4); |
953 | flashaddr += 4; | 972 | flashaddr += 4; |
954 | memaddr += 4; | ||
955 | cond_resched(); | ||
956 | } | 973 | } |
957 | msleep(1); | 974 | msleep(1); |
958 | 975 | ||
@@ -2034,7 +2051,13 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2034 | rv = -1; | 2051 | rv = -1; |
2035 | } | 2052 | } |
2036 | 2053 | ||
2037 | DPRINTK(INFO, "Discovered board type:0x%x ", boardinfo->board_type); | 2054 | if (boardinfo->board_type == NETXEN_BRDTYPE_P3_4_GB_MM) { |
2055 | u32 gpio = netxen_nic_reg_read(adapter, | ||
2056 | NETXEN_ROMUSB_GLB_PAD_GPIO_I); | ||
2057 | if ((gpio & 0x8000) == 0) | ||
2058 | boardinfo->board_type = NETXEN_BRDTYPE_P3_10G_TP; | ||
2059 | } | ||
2060 | |||
2038 | switch ((netxen_brdtype_t) boardinfo->board_type) { | 2061 | switch ((netxen_brdtype_t) boardinfo->board_type) { |
2039 | case NETXEN_BRDTYPE_P2_SB35_4G: | 2062 | case NETXEN_BRDTYPE_P2_SB35_4G: |
2040 | adapter->ahw.board_type = NETXEN_NIC_GBE; | 2063 | adapter->ahw.board_type = NETXEN_NIC_GBE; |
@@ -2053,7 +2076,6 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2053 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: | 2076 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: |
2054 | case NETXEN_BRDTYPE_P3_10G_XFP: | 2077 | case NETXEN_BRDTYPE_P3_10G_XFP: |
2055 | case NETXEN_BRDTYPE_P3_10000_BASE_T: | 2078 | case NETXEN_BRDTYPE_P3_10000_BASE_T: |
2056 | |||
2057 | adapter->ahw.board_type = NETXEN_NIC_XGBE; | 2079 | adapter->ahw.board_type = NETXEN_NIC_XGBE; |
2058 | break; | 2080 | break; |
2059 | case NETXEN_BRDTYPE_P1_BD: | 2081 | case NETXEN_BRDTYPE_P1_BD: |
@@ -2063,9 +2085,12 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2063 | case NETXEN_BRDTYPE_P3_REF_QG: | 2085 | case NETXEN_BRDTYPE_P3_REF_QG: |
2064 | case NETXEN_BRDTYPE_P3_4_GB: | 2086 | case NETXEN_BRDTYPE_P3_4_GB: |
2065 | case NETXEN_BRDTYPE_P3_4_GB_MM: | 2087 | case NETXEN_BRDTYPE_P3_4_GB_MM: |
2066 | |||
2067 | adapter->ahw.board_type = NETXEN_NIC_GBE; | 2088 | adapter->ahw.board_type = NETXEN_NIC_GBE; |
2068 | break; | 2089 | break; |
2090 | case NETXEN_BRDTYPE_P3_10G_TP: | ||
2091 | adapter->ahw.board_type = (adapter->portnum < 2) ? | ||
2092 | NETXEN_NIC_XGBE : NETXEN_NIC_GBE; | ||
2093 | break; | ||
2069 | default: | 2094 | default: |
2070 | printk("%s: Unknown(%x)\n", netxen_nic_driver_name, | 2095 | printk("%s: Unknown(%x)\n", netxen_nic_driver_name, |
2071 | boardinfo->board_type); | 2096 | boardinfo->board_type); |
@@ -2110,12 +2135,16 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
2110 | { | 2135 | { |
2111 | __u32 status; | 2136 | __u32 status; |
2112 | __u32 autoneg; | 2137 | __u32 autoneg; |
2113 | __u32 mode; | ||
2114 | __u32 port_mode; | 2138 | __u32 port_mode; |
2115 | 2139 | ||
2116 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); | 2140 | if (!netif_carrier_ok(adapter->netdev)) { |
2117 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ | 2141 | adapter->link_speed = 0; |
2142 | adapter->link_duplex = -1; | ||
2143 | adapter->link_autoneg = AUTONEG_ENABLE; | ||
2144 | return; | ||
2145 | } | ||
2118 | 2146 | ||
2147 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | ||
2119 | adapter->hw_read_wx(adapter, | 2148 | adapter->hw_read_wx(adapter, |
2120 | NETXEN_PORT_MODE_ADDR, &port_mode, 4); | 2149 | NETXEN_PORT_MODE_ADDR, &port_mode, 4); |
2121 | if (port_mode == NETXEN_PORT_MODE_802_3_AP) { | 2150 | if (port_mode == NETXEN_PORT_MODE_802_3_AP) { |
@@ -2141,7 +2170,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
2141 | adapter->link_speed = SPEED_1000; | 2170 | adapter->link_speed = SPEED_1000; |
2142 | break; | 2171 | break; |
2143 | default: | 2172 | default: |
2144 | adapter->link_speed = -1; | 2173 | adapter->link_speed = 0; |
2145 | break; | 2174 | break; |
2146 | } | 2175 | } |
2147 | switch (netxen_get_phy_duplex(status)) { | 2176 | switch (netxen_get_phy_duplex(status)) { |
@@ -2164,7 +2193,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
2164 | goto link_down; | 2193 | goto link_down; |
2165 | } else { | 2194 | } else { |
2166 | link_down: | 2195 | link_down: |
2167 | adapter->link_speed = -1; | 2196 | adapter->link_speed = 0; |
2168 | adapter->link_duplex = -1; | 2197 | adapter->link_duplex = -1; |
2169 | } | 2198 | } |
2170 | } | 2199 | } |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index d924468e506e..ca7c8d8050c9 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -308,7 +308,6 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) | |||
308 | } | 308 | } |
309 | memset(rds_ring->rx_buf_arr, 0, RCV_BUFFSIZE); | 309 | memset(rds_ring->rx_buf_arr, 0, RCV_BUFFSIZE); |
310 | INIT_LIST_HEAD(&rds_ring->free_list); | 310 | INIT_LIST_HEAD(&rds_ring->free_list); |
311 | rds_ring->begin_alloc = 0; | ||
312 | /* | 311 | /* |
313 | * Now go through all of them, set reference handles | 312 | * Now go through all of them, set reference handles |
314 | * and put them in the queues. | 313 | * and put them in the queues. |
@@ -439,6 +438,8 @@ static int netxen_wait_rom_done(struct netxen_adapter *adapter) | |||
439 | long timeout = 0; | 438 | long timeout = 0; |
440 | long done = 0; | 439 | long done = 0; |
441 | 440 | ||
441 | cond_resched(); | ||
442 | |||
442 | while (done == 0) { | 443 | while (done == 0) { |
443 | done = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_GLB_STATUS); | 444 | done = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_GLB_STATUS); |
444 | done &= 2; | 445 | done &= 2; |
@@ -533,12 +534,9 @@ static int do_rom_fast_write(struct netxen_adapter *adapter, int addr, | |||
533 | static int do_rom_fast_read(struct netxen_adapter *adapter, | 534 | static int do_rom_fast_read(struct netxen_adapter *adapter, |
534 | int addr, int *valp) | 535 | int addr, int *valp) |
535 | { | 536 | { |
536 | cond_resched(); | ||
537 | |||
538 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); | 537 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); |
539 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); | ||
540 | udelay(100); /* prevent bursting on CRB */ | ||
541 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 538 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
539 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); | ||
542 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); | 540 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); |
543 | if (netxen_wait_rom_done(adapter)) { | 541 | if (netxen_wait_rom_done(adapter)) { |
544 | printk("Error waiting for rom done\n"); | 542 | printk("Error waiting for rom done\n"); |
@@ -546,7 +544,7 @@ static int do_rom_fast_read(struct netxen_adapter *adapter, | |||
546 | } | 544 | } |
547 | /* reset abyte_cnt and dummy_byte_cnt */ | 545 | /* reset abyte_cnt and dummy_byte_cnt */ |
548 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); | 546 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); |
549 | udelay(100); /* prevent bursting on CRB */ | 547 | udelay(10); |
550 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 548 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
551 | 549 | ||
552 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); | 550 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); |
@@ -884,14 +882,16 @@ int netxen_flash_unlock(struct netxen_adapter *adapter) | |||
884 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | 882 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) |
885 | { | 883 | { |
886 | int addr, val; | 884 | int addr, val; |
887 | int i, init_delay = 0; | 885 | int i, n, init_delay = 0; |
888 | struct crb_addr_pair *buf; | 886 | struct crb_addr_pair *buf; |
889 | unsigned offset, n; | 887 | unsigned offset; |
890 | u32 off; | 888 | u32 off; |
891 | 889 | ||
892 | /* resetall */ | 890 | /* resetall */ |
891 | rom_lock(adapter); | ||
893 | netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET, | 892 | netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET, |
894 | 0xffffffff); | 893 | 0xffffffff); |
894 | netxen_rom_unlock(adapter); | ||
895 | 895 | ||
896 | if (verbose) { | 896 | if (verbose) { |
897 | if (netxen_rom_fast_read(adapter, NETXEN_BOARDTYPE, &val) == 0) | 897 | if (netxen_rom_fast_read(adapter, NETXEN_BOARDTYPE, &val) == 0) |
@@ -910,7 +910,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
910 | 910 | ||
911 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { | 911 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { |
912 | if (netxen_rom_fast_read(adapter, 0, &n) != 0 || | 912 | if (netxen_rom_fast_read(adapter, 0, &n) != 0 || |
913 | (n != 0xcafecafeUL) || | 913 | (n != 0xcafecafe) || |
914 | netxen_rom_fast_read(adapter, 4, &n) != 0) { | 914 | netxen_rom_fast_read(adapter, 4, &n) != 0) { |
915 | printk(KERN_ERR "%s: ERROR Reading crb_init area: " | 915 | printk(KERN_ERR "%s: ERROR Reading crb_init area: " |
916 | "n: %08x\n", netxen_nic_driver_name, n); | 916 | "n: %08x\n", netxen_nic_driver_name, n); |
@@ -975,6 +975,14 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
975 | /* do not reset PCI */ | 975 | /* do not reset PCI */ |
976 | if (off == (ROMUSB_GLB + 0xbc)) | 976 | if (off == (ROMUSB_GLB + 0xbc)) |
977 | continue; | 977 | continue; |
978 | if (off == (ROMUSB_GLB + 0xa8)) | ||
979 | continue; | ||
980 | if (off == (ROMUSB_GLB + 0xc8)) /* core clock */ | ||
981 | continue; | ||
982 | if (off == (ROMUSB_GLB + 0x24)) /* MN clock */ | ||
983 | continue; | ||
984 | if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */ | ||
985 | continue; | ||
978 | if (off == (NETXEN_CRB_PEG_NET_1 + 0x18)) | 986 | if (off == (NETXEN_CRB_PEG_NET_1 + 0x18)) |
979 | buf[i].data = 0x1020; | 987 | buf[i].data = 0x1020; |
980 | /* skip the function enable register */ | 988 | /* skip the function enable register */ |
@@ -992,23 +1000,21 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
992 | continue; | 1000 | continue; |
993 | } | 1001 | } |
994 | 1002 | ||
1003 | init_delay = 1; | ||
995 | /* After writing this register, HW needs time for CRB */ | 1004 | /* After writing this register, HW needs time for CRB */ |
996 | /* to quiet down (else crb_window returns 0xffffffff) */ | 1005 | /* to quiet down (else crb_window returns 0xffffffff) */ |
997 | if (off == NETXEN_ROMUSB_GLB_SW_RESET) { | 1006 | if (off == NETXEN_ROMUSB_GLB_SW_RESET) { |
998 | init_delay = 1; | 1007 | init_delay = 1000; |
999 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { | 1008 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
1000 | /* hold xdma in reset also */ | 1009 | /* hold xdma in reset also */ |
1001 | buf[i].data = NETXEN_NIC_XDMA_RESET; | 1010 | buf[i].data = NETXEN_NIC_XDMA_RESET; |
1011 | buf[i].data = 0x8000ff; | ||
1002 | } | 1012 | } |
1003 | } | 1013 | } |
1004 | 1014 | ||
1005 | adapter->hw_write_wx(adapter, off, &buf[i].data, 4); | 1015 | adapter->hw_write_wx(adapter, off, &buf[i].data, 4); |
1006 | 1016 | ||
1007 | if (init_delay == 1) { | 1017 | msleep(init_delay); |
1008 | msleep(1000); | ||
1009 | init_delay = 0; | ||
1010 | } | ||
1011 | msleep(1); | ||
1012 | } | 1018 | } |
1013 | kfree(buf); | 1019 | kfree(buf); |
1014 | 1020 | ||
@@ -1277,7 +1283,7 @@ static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
1277 | 1283 | ||
1278 | dev_kfree_skb_any(skb); | 1284 | dev_kfree_skb_any(skb); |
1279 | for (i = 0; i < nr_frags; i++) { | 1285 | for (i = 0; i < nr_frags; i++) { |
1280 | index = frag_desc->frag_handles[i]; | 1286 | index = le16_to_cpu(frag_desc->frag_handles[i]); |
1281 | skb = netxen_process_rxbuf(adapter, | 1287 | skb = netxen_process_rxbuf(adapter, |
1282 | rds_ring, index, cksum); | 1288 | rds_ring, index, cksum); |
1283 | if (skb) | 1289 | if (skb) |
@@ -1428,7 +1434,6 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1428 | struct rcv_desc *pdesc; | 1434 | struct rcv_desc *pdesc; |
1429 | struct netxen_rx_buffer *buffer; | 1435 | struct netxen_rx_buffer *buffer; |
1430 | int count = 0; | 1436 | int count = 0; |
1431 | int index = 0; | ||
1432 | netxen_ctx_msg msg = 0; | 1437 | netxen_ctx_msg msg = 0; |
1433 | dma_addr_t dma; | 1438 | dma_addr_t dma; |
1434 | struct list_head *head; | 1439 | struct list_head *head; |
@@ -1436,7 +1441,6 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1436 | rds_ring = &recv_ctx->rds_rings[ringid]; | 1441 | rds_ring = &recv_ctx->rds_rings[ringid]; |
1437 | 1442 | ||
1438 | producer = rds_ring->producer; | 1443 | producer = rds_ring->producer; |
1439 | index = rds_ring->begin_alloc; | ||
1440 | head = &rds_ring->free_list; | 1444 | head = &rds_ring->free_list; |
1441 | 1445 | ||
1442 | /* We can start writing rx descriptors into the phantom memory. */ | 1446 | /* We can start writing rx descriptors into the phantom memory. */ |
@@ -1444,39 +1448,37 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1444 | 1448 | ||
1445 | skb = dev_alloc_skb(rds_ring->skb_size); | 1449 | skb = dev_alloc_skb(rds_ring->skb_size); |
1446 | if (unlikely(!skb)) { | 1450 | if (unlikely(!skb)) { |
1447 | rds_ring->begin_alloc = index; | ||
1448 | break; | 1451 | break; |
1449 | } | 1452 | } |
1450 | 1453 | ||
1454 | if (!adapter->ahw.cut_through) | ||
1455 | skb_reserve(skb, 2); | ||
1456 | |||
1457 | dma = pci_map_single(pdev, skb->data, | ||
1458 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | ||
1459 | if (pci_dma_mapping_error(pdev, dma)) { | ||
1460 | dev_kfree_skb_any(skb); | ||
1461 | break; | ||
1462 | } | ||
1463 | |||
1464 | count++; | ||
1451 | buffer = list_entry(head->next, struct netxen_rx_buffer, list); | 1465 | buffer = list_entry(head->next, struct netxen_rx_buffer, list); |
1452 | list_del(&buffer->list); | 1466 | list_del(&buffer->list); |
1453 | 1467 | ||
1454 | count++; /* now there should be no failure */ | ||
1455 | pdesc = &rds_ring->desc_head[producer]; | ||
1456 | |||
1457 | if (!adapter->ahw.cut_through) | ||
1458 | skb_reserve(skb, 2); | ||
1459 | /* This will be setup when we receive the | ||
1460 | * buffer after it has been filled FSL TBD TBD | ||
1461 | * skb->dev = netdev; | ||
1462 | */ | ||
1463 | dma = pci_map_single(pdev, skb->data, rds_ring->dma_size, | ||
1464 | PCI_DMA_FROMDEVICE); | ||
1465 | pdesc->addr_buffer = cpu_to_le64(dma); | ||
1466 | buffer->skb = skb; | 1468 | buffer->skb = skb; |
1467 | buffer->state = NETXEN_BUFFER_BUSY; | 1469 | buffer->state = NETXEN_BUFFER_BUSY; |
1468 | buffer->dma = dma; | 1470 | buffer->dma = dma; |
1471 | |||
1469 | /* make a rcv descriptor */ | 1472 | /* make a rcv descriptor */ |
1473 | pdesc = &rds_ring->desc_head[producer]; | ||
1474 | pdesc->addr_buffer = cpu_to_le64(dma); | ||
1470 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); | 1475 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); |
1471 | pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); | 1476 | pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); |
1472 | DPRINTK(INFO, "done writing descripter\n"); | 1477 | |
1473 | producer = | 1478 | producer = get_next_index(producer, rds_ring->max_rx_desc_count); |
1474 | get_next_index(producer, rds_ring->max_rx_desc_count); | ||
1475 | index = get_next_index(index, rds_ring->max_rx_desc_count); | ||
1476 | } | 1479 | } |
1477 | /* if we did allocate buffers, then write the count to Phantom */ | 1480 | /* if we did allocate buffers, then write the count to Phantom */ |
1478 | if (count) { | 1481 | if (count) { |
1479 | rds_ring->begin_alloc = index; | ||
1480 | rds_ring->producer = producer; | 1482 | rds_ring->producer = producer; |
1481 | /* Window = 1 */ | 1483 | /* Window = 1 */ |
1482 | adapter->pci_write_normalize(adapter, | 1484 | adapter->pci_write_normalize(adapter, |
@@ -1515,49 +1517,50 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, | |||
1515 | struct rcv_desc *pdesc; | 1517 | struct rcv_desc *pdesc; |
1516 | struct netxen_rx_buffer *buffer; | 1518 | struct netxen_rx_buffer *buffer; |
1517 | int count = 0; | 1519 | int count = 0; |
1518 | int index = 0; | ||
1519 | struct list_head *head; | 1520 | struct list_head *head; |
1521 | dma_addr_t dma; | ||
1520 | 1522 | ||
1521 | rds_ring = &recv_ctx->rds_rings[ringid]; | 1523 | rds_ring = &recv_ctx->rds_rings[ringid]; |
1522 | 1524 | ||
1523 | producer = rds_ring->producer; | 1525 | producer = rds_ring->producer; |
1524 | index = rds_ring->begin_alloc; | ||
1525 | head = &rds_ring->free_list; | 1526 | head = &rds_ring->free_list; |
1526 | /* We can start writing rx descriptors into the phantom memory. */ | 1527 | /* We can start writing rx descriptors into the phantom memory. */ |
1527 | while (!list_empty(head)) { | 1528 | while (!list_empty(head)) { |
1528 | 1529 | ||
1529 | skb = dev_alloc_skb(rds_ring->skb_size); | 1530 | skb = dev_alloc_skb(rds_ring->skb_size); |
1530 | if (unlikely(!skb)) { | 1531 | if (unlikely(!skb)) { |
1531 | rds_ring->begin_alloc = index; | ||
1532 | break; | 1532 | break; |
1533 | } | 1533 | } |
1534 | 1534 | ||
1535 | if (!adapter->ahw.cut_through) | ||
1536 | skb_reserve(skb, 2); | ||
1537 | |||
1538 | dma = pci_map_single(pdev, skb->data, | ||
1539 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | ||
1540 | if (pci_dma_mapping_error(pdev, dma)) { | ||
1541 | dev_kfree_skb_any(skb); | ||
1542 | break; | ||
1543 | } | ||
1544 | |||
1545 | count++; | ||
1535 | buffer = list_entry(head->next, struct netxen_rx_buffer, list); | 1546 | buffer = list_entry(head->next, struct netxen_rx_buffer, list); |
1536 | list_del(&buffer->list); | 1547 | list_del(&buffer->list); |
1537 | 1548 | ||
1538 | count++; /* now there should be no failure */ | ||
1539 | pdesc = &rds_ring->desc_head[producer]; | ||
1540 | if (!adapter->ahw.cut_through) | ||
1541 | skb_reserve(skb, 2); | ||
1542 | buffer->skb = skb; | 1549 | buffer->skb = skb; |
1543 | buffer->state = NETXEN_BUFFER_BUSY; | 1550 | buffer->state = NETXEN_BUFFER_BUSY; |
1544 | buffer->dma = pci_map_single(pdev, skb->data, | 1551 | buffer->dma = dma; |
1545 | rds_ring->dma_size, | ||
1546 | PCI_DMA_FROMDEVICE); | ||
1547 | 1552 | ||
1548 | /* make a rcv descriptor */ | 1553 | /* make a rcv descriptor */ |
1554 | pdesc = &rds_ring->desc_head[producer]; | ||
1549 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); | 1555 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); |
1550 | pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); | 1556 | pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); |
1551 | pdesc->addr_buffer = cpu_to_le64(buffer->dma); | 1557 | pdesc->addr_buffer = cpu_to_le64(buffer->dma); |
1552 | producer = | 1558 | |
1553 | get_next_index(producer, rds_ring->max_rx_desc_count); | 1559 | producer = get_next_index(producer, rds_ring->max_rx_desc_count); |
1554 | index = get_next_index(index, rds_ring->max_rx_desc_count); | ||
1555 | buffer = &rds_ring->rx_buf_arr[index]; | ||
1556 | } | 1560 | } |
1557 | 1561 | ||
1558 | /* if we did allocate buffers, then write the count to Phantom */ | 1562 | /* if we did allocate buffers, then write the count to Phantom */ |
1559 | if (count) { | 1563 | if (count) { |
1560 | rds_ring->begin_alloc = index; | ||
1561 | rds_ring->producer = producer; | 1564 | rds_ring->producer = producer; |
1562 | /* Window = 1 */ | 1565 | /* Window = 1 */ |
1563 | adapter->pci_write_normalize(adapter, | 1566 | adapter->pci_write_normalize(adapter, |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index ba01524b5531..86867405a367 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "netxen_nic_phan_reg.h" | 39 | #include "netxen_nic_phan_reg.h" |
40 | 40 | ||
41 | #include <linux/dma-mapping.h> | 41 | #include <linux/dma-mapping.h> |
42 | #include <linux/if_vlan.h> | ||
42 | #include <net/ip.h> | 43 | #include <net/ip.h> |
43 | 44 | ||
44 | MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); | 45 | MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); |
@@ -242,7 +243,7 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
242 | case NETXEN_BRDTYPE_P3_4_GB: | 243 | case NETXEN_BRDTYPE_P3_4_GB: |
243 | case NETXEN_BRDTYPE_P3_4_GB_MM: | 244 | case NETXEN_BRDTYPE_P3_4_GB_MM: |
244 | adapter->msix_supported = !!use_msi_x; | 245 | adapter->msix_supported = !!use_msi_x; |
245 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G; | 246 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; |
246 | break; | 247 | break; |
247 | 248 | ||
248 | case NETXEN_BRDTYPE_P2_SB35_4G: | 249 | case NETXEN_BRDTYPE_P2_SB35_4G: |
@@ -251,6 +252,14 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
251 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; | 252 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; |
252 | break; | 253 | break; |
253 | 254 | ||
255 | case NETXEN_BRDTYPE_P3_10G_TP: | ||
256 | adapter->msix_supported = !!use_msi_x; | ||
257 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) | ||
258 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G; | ||
259 | else | ||
260 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; | ||
261 | break; | ||
262 | |||
254 | default: | 263 | default: |
255 | adapter->msix_supported = 0; | 264 | adapter->msix_supported = 0; |
256 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; | 265 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; |
@@ -271,10 +280,15 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
271 | static int | 280 | static int |
272 | netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot) | 281 | netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot) |
273 | { | 282 | { |
274 | int ret = 0; | 283 | u32 val, timeout; |
275 | 284 | ||
276 | if (first_boot == 0x55555555) { | 285 | if (first_boot == 0x55555555) { |
277 | /* This is the first boot after power up */ | 286 | /* This is the first boot after power up */ |
287 | adapter->pci_write_normalize(adapter, | ||
288 | NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC); | ||
289 | |||
290 | if (!NX_IS_REVISION_P2(adapter->ahw.revision_id)) | ||
291 | return 0; | ||
278 | 292 | ||
279 | /* PCI bus master workaround */ | 293 | /* PCI bus master workaround */ |
280 | adapter->hw_read_wx(adapter, | 294 | adapter->hw_read_wx(adapter, |
@@ -294,18 +308,26 @@ netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot) | |||
294 | /* clear the register for future unloads/loads */ | 308 | /* clear the register for future unloads/loads */ |
295 | adapter->pci_write_normalize(adapter, | 309 | adapter->pci_write_normalize(adapter, |
296 | NETXEN_CAM_RAM(0x1fc), 0); | 310 | NETXEN_CAM_RAM(0x1fc), 0); |
297 | ret = -1; | 311 | return -EIO; |
298 | } | 312 | } |
299 | 313 | ||
300 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { | 314 | /* Start P2 boot loader */ |
301 | /* Start P2 boot loader */ | 315 | val = adapter->pci_read_normalize(adapter, |
302 | adapter->pci_write_normalize(adapter, | 316 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE); |
303 | NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC); | 317 | adapter->pci_write_normalize(adapter, |
304 | adapter->pci_write_normalize(adapter, | 318 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE, val | 0x1); |
305 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE, 1); | 319 | timeout = 0; |
306 | } | 320 | do { |
321 | msleep(1); | ||
322 | val = adapter->pci_read_normalize(adapter, | ||
323 | NETXEN_CAM_RAM(0x1fc)); | ||
324 | |||
325 | if (++timeout > 5000) | ||
326 | return -EIO; | ||
327 | |||
328 | } while (val == NETXEN_BDINFO_MAGIC); | ||
307 | } | 329 | } |
308 | return ret; | 330 | return 0; |
309 | } | 331 | } |
310 | 332 | ||
311 | static void netxen_set_port_mode(struct netxen_adapter *adapter) | 333 | static void netxen_set_port_mode(struct netxen_adapter *adapter) |
@@ -784,8 +806,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
784 | CRB_CMDPEG_STATE, 0); | 806 | CRB_CMDPEG_STATE, 0); |
785 | netxen_pinit_from_rom(adapter, 0); | 807 | netxen_pinit_from_rom(adapter, 0); |
786 | msleep(1); | 808 | msleep(1); |
787 | netxen_load_firmware(adapter); | ||
788 | } | 809 | } |
810 | netxen_load_firmware(adapter); | ||
789 | 811 | ||
790 | if (NX_IS_REVISION_P3(revision_id)) | 812 | if (NX_IS_REVISION_P3(revision_id)) |
791 | netxen_pcie_strap_init(adapter); | 813 | netxen_pcie_strap_init(adapter); |
@@ -801,13 +823,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
801 | 823 | ||
802 | } | 824 | } |
803 | 825 | ||
804 | if ((first_boot == 0x55555555) && | ||
805 | (NX_IS_REVISION_P2(revision_id))) { | ||
806 | /* Unlock the HW, prompting the boot sequence */ | ||
807 | adapter->pci_write_normalize(adapter, | ||
808 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE, 1); | ||
809 | } | ||
810 | |||
811 | err = netxen_initialize_adapter_offload(adapter); | 826 | err = netxen_initialize_adapter_offload(adapter); |
812 | if (err) | 827 | if (err) |
813 | goto err_out_iounmap; | 828 | goto err_out_iounmap; |
@@ -821,7 +836,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
821 | adapter->pci_write_normalize(adapter, CRB_DRIVER_VERSION, i); | 836 | adapter->pci_write_normalize(adapter, CRB_DRIVER_VERSION, i); |
822 | 837 | ||
823 | /* Handshake with the card before we register the devices. */ | 838 | /* Handshake with the card before we register the devices. */ |
824 | netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); | 839 | err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); |
840 | if (err) | ||
841 | goto err_out_free_offload; | ||
825 | 842 | ||
826 | } /* first_driver */ | 843 | } /* first_driver */ |
827 | 844 | ||
@@ -925,6 +942,7 @@ err_out_disable_msi: | |||
925 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) | 942 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) |
926 | pci_disable_msi(pdev); | 943 | pci_disable_msi(pdev); |
927 | 944 | ||
945 | err_out_free_offload: | ||
928 | if (first_driver) | 946 | if (first_driver) |
929 | netxen_free_adapter_offload(adapter); | 947 | netxen_free_adapter_offload(adapter); |
930 | 948 | ||
@@ -968,6 +986,9 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
968 | netxen_free_hw_resources(adapter); | 986 | netxen_free_hw_resources(adapter); |
969 | netxen_release_rx_buffers(adapter); | 987 | netxen_release_rx_buffers(adapter); |
970 | netxen_free_sw_resources(adapter); | 988 | netxen_free_sw_resources(adapter); |
989 | |||
990 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | ||
991 | netxen_p3_free_mac_list(adapter); | ||
971 | } | 992 | } |
972 | 993 | ||
973 | if (adapter->portnum == 0) | 994 | if (adapter->portnum == 0) |
@@ -1137,29 +1158,64 @@ static int netxen_nic_close(struct net_device *netdev) | |||
1137 | return 0; | 1158 | return 0; |
1138 | } | 1159 | } |
1139 | 1160 | ||
1140 | void netxen_tso_check(struct netxen_adapter *adapter, | 1161 | static bool netxen_tso_check(struct net_device *netdev, |
1141 | struct cmd_desc_type0 *desc, struct sk_buff *skb) | 1162 | struct cmd_desc_type0 *desc, struct sk_buff *skb) |
1142 | { | 1163 | { |
1143 | if (desc->mss) { | 1164 | bool tso = false; |
1144 | desc->total_hdr_length = (sizeof(struct ethhdr) + | 1165 | u8 opcode = TX_ETHER_PKT; |
1145 | ip_hdrlen(skb) + tcp_hdrlen(skb)); | ||
1146 | 1166 | ||
1147 | if ((NX_IS_REVISION_P3(adapter->ahw.revision_id)) && | 1167 | if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && |
1148 | (skb->protocol == htons(ETH_P_IPV6))) | 1168 | skb_shinfo(skb)->gso_size > 0) { |
1149 | netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO6); | 1169 | |
1150 | else | 1170 | desc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); |
1151 | netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO); | 1171 | desc->total_hdr_length = |
1172 | skb_transport_offset(skb) + tcp_hdrlen(skb); | ||
1173 | |||
1174 | opcode = (skb->protocol == htons(ETH_P_IPV6)) ? | ||
1175 | TX_TCP_LSO6 : TX_TCP_LSO; | ||
1176 | tso = true; | ||
1152 | 1177 | ||
1153 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1178 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1154 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) | 1179 | u8 l4proto; |
1155 | netxen_set_cmd_desc_opcode(desc, TX_TCP_PKT); | 1180 | |
1156 | else if (ip_hdr(skb)->protocol == IPPROTO_UDP) | 1181 | if (skb->protocol == htons(ETH_P_IP)) { |
1157 | netxen_set_cmd_desc_opcode(desc, TX_UDP_PKT); | 1182 | l4proto = ip_hdr(skb)->protocol; |
1158 | else | 1183 | |
1159 | return; | 1184 | if (l4proto == IPPROTO_TCP) |
1185 | opcode = TX_TCP_PKT; | ||
1186 | else if(l4proto == IPPROTO_UDP) | ||
1187 | opcode = TX_UDP_PKT; | ||
1188 | } else if (skb->protocol == htons(ETH_P_IPV6)) { | ||
1189 | l4proto = ipv6_hdr(skb)->nexthdr; | ||
1190 | |||
1191 | if (l4proto == IPPROTO_TCP) | ||
1192 | opcode = TX_TCPV6_PKT; | ||
1193 | else if(l4proto == IPPROTO_UDP) | ||
1194 | opcode = TX_UDPV6_PKT; | ||
1195 | } | ||
1160 | } | 1196 | } |
1161 | desc->tcp_hdr_offset = skb_transport_offset(skb); | 1197 | desc->tcp_hdr_offset = skb_transport_offset(skb); |
1162 | desc->ip_hdr_offset = skb_network_offset(skb); | 1198 | desc->ip_hdr_offset = skb_network_offset(skb); |
1199 | netxen_set_tx_flags_opcode(desc, 0, opcode); | ||
1200 | return tso; | ||
1201 | } | ||
1202 | |||
1203 | static void | ||
1204 | netxen_clean_tx_dma_mapping(struct pci_dev *pdev, | ||
1205 | struct netxen_cmd_buffer *pbuf, int last) | ||
1206 | { | ||
1207 | int k; | ||
1208 | struct netxen_skb_frag *buffrag; | ||
1209 | |||
1210 | buffrag = &pbuf->frag_array[0]; | ||
1211 | pci_unmap_single(pdev, buffrag->dma, | ||
1212 | buffrag->length, PCI_DMA_TODEVICE); | ||
1213 | |||
1214 | for (k = 1; k < last; k++) { | ||
1215 | buffrag = &pbuf->frag_array[k]; | ||
1216 | pci_unmap_page(pdev, buffrag->dma, | ||
1217 | buffrag->length, PCI_DMA_TODEVICE); | ||
1218 | } | ||
1163 | } | 1219 | } |
1164 | 1220 | ||
1165 | static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 1221 | static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) |
@@ -1167,33 +1223,22 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1167 | struct netxen_adapter *adapter = netdev_priv(netdev); | 1223 | struct netxen_adapter *adapter = netdev_priv(netdev); |
1168 | struct netxen_hardware_context *hw = &adapter->ahw; | 1224 | struct netxen_hardware_context *hw = &adapter->ahw; |
1169 | unsigned int first_seg_len = skb->len - skb->data_len; | 1225 | unsigned int first_seg_len = skb->len - skb->data_len; |
1226 | struct netxen_cmd_buffer *pbuf; | ||
1170 | struct netxen_skb_frag *buffrag; | 1227 | struct netxen_skb_frag *buffrag; |
1171 | unsigned int i; | 1228 | struct cmd_desc_type0 *hwdesc; |
1229 | struct pci_dev *pdev = adapter->pdev; | ||
1230 | dma_addr_t temp_dma; | ||
1231 | int i, k; | ||
1172 | 1232 | ||
1173 | u32 producer, consumer; | 1233 | u32 producer, consumer; |
1174 | u32 saved_producer = 0; | 1234 | int frag_count, no_of_desc; |
1175 | struct cmd_desc_type0 *hwdesc; | ||
1176 | int k; | ||
1177 | struct netxen_cmd_buffer *pbuf = NULL; | ||
1178 | int frag_count; | ||
1179 | int no_of_desc; | ||
1180 | u32 num_txd = adapter->max_tx_desc_count; | 1235 | u32 num_txd = adapter->max_tx_desc_count; |
1236 | bool is_tso = false; | ||
1181 | 1237 | ||
1182 | frag_count = skb_shinfo(skb)->nr_frags + 1; | 1238 | frag_count = skb_shinfo(skb)->nr_frags + 1; |
1183 | 1239 | ||
1184 | /* There 4 fragments per descriptor */ | 1240 | /* There 4 fragments per descriptor */ |
1185 | no_of_desc = (frag_count + 3) >> 2; | 1241 | no_of_desc = (frag_count + 3) >> 2; |
1186 | if (netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) { | ||
1187 | if (skb_shinfo(skb)->gso_size > 0) { | ||
1188 | |||
1189 | no_of_desc++; | ||
1190 | if ((ip_hdrlen(skb) + tcp_hdrlen(skb) + | ||
1191 | sizeof(struct ethhdr)) > | ||
1192 | (sizeof(struct cmd_desc_type0) - 2)) { | ||
1193 | no_of_desc++; | ||
1194 | } | ||
1195 | } | ||
1196 | } | ||
1197 | 1242 | ||
1198 | producer = adapter->cmd_producer; | 1243 | producer = adapter->cmd_producer; |
1199 | smp_mb(); | 1244 | smp_mb(); |
@@ -1205,34 +1250,26 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1205 | } | 1250 | } |
1206 | 1251 | ||
1207 | /* Copy the descriptors into the hardware */ | 1252 | /* Copy the descriptors into the hardware */ |
1208 | saved_producer = producer; | ||
1209 | hwdesc = &hw->cmd_desc_head[producer]; | 1253 | hwdesc = &hw->cmd_desc_head[producer]; |
1210 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); | 1254 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); |
1211 | /* Take skb->data itself */ | 1255 | /* Take skb->data itself */ |
1212 | pbuf = &adapter->cmd_buf_arr[producer]; | 1256 | pbuf = &adapter->cmd_buf_arr[producer]; |
1213 | if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && | 1257 | |
1214 | skb_shinfo(skb)->gso_size > 0) { | 1258 | is_tso = netxen_tso_check(netdev, hwdesc, skb); |
1215 | pbuf->mss = skb_shinfo(skb)->gso_size; | 1259 | |
1216 | hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); | ||
1217 | } else { | ||
1218 | pbuf->mss = 0; | ||
1219 | hwdesc->mss = 0; | ||
1220 | } | ||
1221 | pbuf->total_length = skb->len; | ||
1222 | pbuf->skb = skb; | 1260 | pbuf->skb = skb; |
1223 | pbuf->cmd = TX_ETHER_PKT; | ||
1224 | pbuf->frag_count = frag_count; | 1261 | pbuf->frag_count = frag_count; |
1225 | pbuf->port = adapter->portnum; | ||
1226 | buffrag = &pbuf->frag_array[0]; | 1262 | buffrag = &pbuf->frag_array[0]; |
1227 | buffrag->dma = pci_map_single(adapter->pdev, skb->data, first_seg_len, | 1263 | temp_dma = pci_map_single(pdev, skb->data, first_seg_len, |
1228 | PCI_DMA_TODEVICE); | 1264 | PCI_DMA_TODEVICE); |
1265 | if (pci_dma_mapping_error(pdev, temp_dma)) | ||
1266 | goto drop_packet; | ||
1267 | |||
1268 | buffrag->dma = temp_dma; | ||
1229 | buffrag->length = first_seg_len; | 1269 | buffrag->length = first_seg_len; |
1230 | netxen_set_cmd_desc_totallength(hwdesc, skb->len); | 1270 | netxen_set_tx_frags_len(hwdesc, frag_count, skb->len); |
1231 | netxen_set_cmd_desc_num_of_buff(hwdesc, frag_count); | 1271 | netxen_set_tx_port(hwdesc, adapter->portnum); |
1232 | netxen_set_cmd_desc_opcode(hwdesc, TX_ETHER_PKT); | ||
1233 | 1272 | ||
1234 | netxen_set_cmd_desc_port(hwdesc, adapter->portnum); | ||
1235 | netxen_set_cmd_desc_ctxid(hwdesc, adapter->portnum); | ||
1236 | hwdesc->buffer1_length = cpu_to_le16(first_seg_len); | 1273 | hwdesc->buffer1_length = cpu_to_le16(first_seg_len); |
1237 | hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma); | 1274 | hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma); |
1238 | 1275 | ||
@@ -1240,7 +1277,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1240 | struct skb_frag_struct *frag; | 1277 | struct skb_frag_struct *frag; |
1241 | int len, temp_len; | 1278 | int len, temp_len; |
1242 | unsigned long offset; | 1279 | unsigned long offset; |
1243 | dma_addr_t temp_dma; | ||
1244 | 1280 | ||
1245 | /* move to next desc. if there is a need */ | 1281 | /* move to next desc. if there is a need */ |
1246 | if ((i & 0x3) == 0) { | 1282 | if ((i & 0x3) == 0) { |
@@ -1256,8 +1292,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1256 | offset = frag->page_offset; | 1292 | offset = frag->page_offset; |
1257 | 1293 | ||
1258 | temp_len = len; | 1294 | temp_len = len; |
1259 | temp_dma = pci_map_page(adapter->pdev, frag->page, offset, | 1295 | temp_dma = pci_map_page(pdev, frag->page, offset, |
1260 | len, PCI_DMA_TODEVICE); | 1296 | len, PCI_DMA_TODEVICE); |
1297 | if (pci_dma_mapping_error(pdev, temp_dma)) { | ||
1298 | netxen_clean_tx_dma_mapping(pdev, pbuf, i); | ||
1299 | goto drop_packet; | ||
1300 | } | ||
1261 | 1301 | ||
1262 | buffrag++; | 1302 | buffrag++; |
1263 | buffrag->dma = temp_dma; | 1303 | buffrag->dma = temp_dma; |
@@ -1285,16 +1325,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1285 | } | 1325 | } |
1286 | producer = get_next_index(producer, num_txd); | 1326 | producer = get_next_index(producer, num_txd); |
1287 | 1327 | ||
1288 | /* might change opcode to TX_TCP_LSO */ | ||
1289 | netxen_tso_check(adapter, &hw->cmd_desc_head[saved_producer], skb); | ||
1290 | |||
1291 | /* For LSO, we need to copy the MAC/IP/TCP headers into | 1328 | /* For LSO, we need to copy the MAC/IP/TCP headers into |
1292 | * the descriptor ring | 1329 | * the descriptor ring |
1293 | */ | 1330 | */ |
1294 | if (netxen_get_cmd_desc_opcode(&hw->cmd_desc_head[saved_producer]) | 1331 | if (is_tso) { |
1295 | == TX_TCP_LSO) { | ||
1296 | int hdr_len, first_hdr_len, more_hdr; | 1332 | int hdr_len, first_hdr_len, more_hdr; |
1297 | hdr_len = hw->cmd_desc_head[saved_producer].total_hdr_length; | 1333 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
1298 | if (hdr_len > (sizeof(struct cmd_desc_type0) - 2)) { | 1334 | if (hdr_len > (sizeof(struct cmd_desc_type0) - 2)) { |
1299 | first_hdr_len = sizeof(struct cmd_desc_type0) - 2; | 1335 | first_hdr_len = sizeof(struct cmd_desc_type0) - 2; |
1300 | more_hdr = 1; | 1336 | more_hdr = 1; |
@@ -1336,6 +1372,11 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1336 | netdev->trans_start = jiffies; | 1372 | netdev->trans_start = jiffies; |
1337 | 1373 | ||
1338 | return NETDEV_TX_OK; | 1374 | return NETDEV_TX_OK; |
1375 | |||
1376 | drop_packet: | ||
1377 | adapter->stats.txdropped++; | ||
1378 | dev_kfree_skb_any(skb); | ||
1379 | return NETDEV_TX_OK; | ||
1339 | } | 1380 | } |
1340 | 1381 | ||
1341 | static int netxen_nic_check_temp(struct netxen_adapter *adapter) | 1382 | static int netxen_nic_check_temp(struct netxen_adapter *adapter) |
@@ -1407,6 +1448,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter) | |||
1407 | netif_carrier_off(netdev); | 1448 | netif_carrier_off(netdev); |
1408 | netif_stop_queue(netdev); | 1449 | netif_stop_queue(netdev); |
1409 | } | 1450 | } |
1451 | |||
1452 | netxen_nic_set_link_parameters(adapter); | ||
1410 | } else if (!adapter->ahw.linkup && linkup) { | 1453 | } else if (!adapter->ahw.linkup && linkup) { |
1411 | printk(KERN_INFO "%s: %s NIC Link is up\n", | 1454 | printk(KERN_INFO "%s: %s NIC Link is up\n", |
1412 | netxen_nic_driver_name, netdev->name); | 1455 | netxen_nic_driver_name, netdev->name); |
@@ -1415,6 +1458,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter) | |||
1415 | netif_carrier_on(netdev); | 1458 | netif_carrier_on(netdev); |
1416 | netif_wake_queue(netdev); | 1459 | netif_wake_queue(netdev); |
1417 | } | 1460 | } |
1461 | |||
1462 | netxen_nic_set_link_parameters(adapter); | ||
1418 | } | 1463 | } |
1419 | } | 1464 | } |
1420 | 1465 | ||
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 42021aca1ddd..e80294d8cc19 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -1956,6 +1956,7 @@ static const struct net_device_ops netdev_ops = { | |||
1956 | .ndo_change_mtu = ns83820_change_mtu, | 1956 | .ndo_change_mtu = ns83820_change_mtu, |
1957 | .ndo_set_multicast_list = ns83820_set_multicast, | 1957 | .ndo_set_multicast_list = ns83820_set_multicast, |
1958 | .ndo_validate_addr = eth_validate_addr, | 1958 | .ndo_validate_addr = eth_validate_addr, |
1959 | .ndo_set_mac_address = eth_mac_addr, | ||
1959 | .ndo_tx_timeout = ns83820_tx_timeout, | 1960 | .ndo_tx_timeout = ns83820_tx_timeout, |
1960 | #ifdef NS83820_VLAN_ACCEL_SUPPORT | 1961 | #ifdef NS83820_VLAN_ACCEL_SUPPORT |
1961 | .ndo_vlan_rx_register = ns83820_vlan_rx_register, | 1962 | .ndo_vlan_rx_register = ns83820_vlan_rx_register, |
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 5b7a574ce571..d0349e7d73ea 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -712,7 +712,7 @@ static inline void pasemi_mac_rx_error(const struct pasemi_mac *mac, | |||
712 | rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if)); | 712 | rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if)); |
713 | ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno)); | 713 | ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno)); |
714 | 714 | ||
715 | printk(KERN_ERR "pasemi_mac: rx error. macrx %016lx, rx status %lx\n", | 715 | printk(KERN_ERR "pasemi_mac: rx error. macrx %016llx, rx status %llx\n", |
716 | macrx, *chan->status); | 716 | macrx, *chan->status); |
717 | 717 | ||
718 | printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n", | 718 | printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n", |
@@ -730,8 +730,8 @@ static inline void pasemi_mac_tx_error(const struct pasemi_mac *mac, | |||
730 | 730 | ||
731 | cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno)); | 731 | cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno)); |
732 | 732 | ||
733 | printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016lx, "\ | 733 | printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016llx, "\ |
734 | "tx status 0x%016lx\n", mactx, *chan->status); | 734 | "tx status 0x%016llx\n", mactx, *chan->status); |
735 | 735 | ||
736 | printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta); | 736 | printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta); |
737 | } | 737 | } |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index e35460165bf7..0a06e4fd37d9 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -231,15 +231,6 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr) | |||
231 | if ((phy_id & 0x1fffffff) == 0x1fffffff) | 231 | if ((phy_id & 0x1fffffff) == 0x1fffffff) |
232 | return NULL; | 232 | return NULL; |
233 | 233 | ||
234 | /* | ||
235 | * Broken hardware is sometimes missing the pull-up resistor on the | ||
236 | * MDIO line, which results in reads to non-existent devices returning | ||
237 | * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent | ||
238 | * device as well. | ||
239 | */ | ||
240 | if (phy_id == 0) | ||
241 | return NULL; | ||
242 | |||
243 | dev = phy_device_create(bus, addr, phy_id); | 234 | dev = phy_device_create(bus, addr, phy_id); |
244 | 235 | ||
245 | return dev; | 236 | return dev; |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 06b448285eb5..7b2728b8f1b7 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -250,6 +250,7 @@ static int ppp_connect_channel(struct channel *pch, int unit); | |||
250 | static int ppp_disconnect_channel(struct channel *pch); | 250 | static int ppp_disconnect_channel(struct channel *pch); |
251 | static void ppp_destroy_channel(struct channel *pch); | 251 | static void ppp_destroy_channel(struct channel *pch); |
252 | static int unit_get(struct idr *p, void *ptr); | 252 | static int unit_get(struct idr *p, void *ptr); |
253 | static int unit_set(struct idr *p, void *ptr, int n); | ||
253 | static void unit_put(struct idr *p, int n); | 254 | static void unit_put(struct idr *p, int n); |
254 | static void *unit_find(struct idr *p, int n); | 255 | static void *unit_find(struct idr *p, int n); |
255 | 256 | ||
@@ -2432,11 +2433,18 @@ ppp_create_interface(int unit, int *retp) | |||
2432 | } else { | 2433 | } else { |
2433 | if (unit_find(&ppp_units_idr, unit)) | 2434 | if (unit_find(&ppp_units_idr, unit)) |
2434 | goto out2; /* unit already exists */ | 2435 | goto out2; /* unit already exists */ |
2435 | else { | 2436 | /* |
2436 | /* darn, someone is cheating us? */ | 2437 | * if caller need a specified unit number |
2437 | *retp = -EINVAL; | 2438 | * lets try to satisfy him, otherwise -- |
2439 | * he should better ask us for new unit number | ||
2440 | * | ||
2441 | * NOTE: yes I know that returning EEXIST it's not | ||
2442 | * fair but at least pppd will ask us to allocate | ||
2443 | * new unit in this case so user is happy :) | ||
2444 | */ | ||
2445 | unit = unit_set(&ppp_units_idr, ppp, unit); | ||
2446 | if (unit < 0) | ||
2438 | goto out2; | 2447 | goto out2; |
2439 | } | ||
2440 | } | 2448 | } |
2441 | 2449 | ||
2442 | /* Initialize the new ppp unit */ | 2450 | /* Initialize the new ppp unit */ |
@@ -2677,14 +2685,37 @@ static void __exit ppp_cleanup(void) | |||
2677 | * by holding all_ppp_mutex | 2685 | * by holding all_ppp_mutex |
2678 | */ | 2686 | */ |
2679 | 2687 | ||
2688 | /* associate pointer with specified number */ | ||
2689 | static int unit_set(struct idr *p, void *ptr, int n) | ||
2690 | { | ||
2691 | int unit, err; | ||
2692 | |||
2693 | again: | ||
2694 | if (!idr_pre_get(p, GFP_KERNEL)) { | ||
2695 | printk(KERN_ERR "PPP: No free memory for idr\n"); | ||
2696 | return -ENOMEM; | ||
2697 | } | ||
2698 | |||
2699 | err = idr_get_new_above(p, ptr, n, &unit); | ||
2700 | if (err == -EAGAIN) | ||
2701 | goto again; | ||
2702 | |||
2703 | if (unit != n) { | ||
2704 | idr_remove(p, unit); | ||
2705 | return -EINVAL; | ||
2706 | } | ||
2707 | |||
2708 | return unit; | ||
2709 | } | ||
2710 | |||
2680 | /* get new free unit number and associate pointer with it */ | 2711 | /* get new free unit number and associate pointer with it */ |
2681 | static int unit_get(struct idr *p, void *ptr) | 2712 | static int unit_get(struct idr *p, void *ptr) |
2682 | { | 2713 | { |
2683 | int unit, err; | 2714 | int unit, err; |
2684 | 2715 | ||
2685 | again: | 2716 | again: |
2686 | if (idr_pre_get(p, GFP_KERNEL) == 0) { | 2717 | if (!idr_pre_get(p, GFP_KERNEL)) { |
2687 | printk(KERN_ERR "Out of memory expanding drawable idr\n"); | 2718 | printk(KERN_ERR "PPP: No free memory for idr\n"); |
2688 | return -ENOMEM; | 2719 | return -ENOMEM; |
2689 | } | 2720 | } |
2690 | 2721 | ||
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index 459663a4023d..c1dadadfab18 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -28,11 +28,11 @@ | |||
28 | } while (0) | 28 | } while (0) |
29 | 29 | ||
30 | #define QLGE_VENDOR_ID 0x1077 | 30 | #define QLGE_VENDOR_ID 0x1077 |
31 | #define QLGE_DEVICE_ID1 0x8012 | 31 | #define QLGE_DEVICE_ID 0x8012 |
32 | #define QLGE_DEVICE_ID 0x8000 | ||
33 | 32 | ||
34 | #define MAX_RX_RINGS 128 | 33 | #define MAX_CPUS 8 |
35 | #define MAX_TX_RINGS 128 | 34 | #define MAX_TX_RINGS MAX_CPUS |
35 | #define MAX_RX_RINGS ((MAX_CPUS * 2) + 1) | ||
36 | 36 | ||
37 | #define NUM_TX_RING_ENTRIES 256 | 37 | #define NUM_TX_RING_ENTRIES 256 |
38 | #define NUM_RX_RING_ENTRIES 256 | 38 | #define NUM_RX_RING_ENTRIES 256 |
@@ -45,6 +45,7 @@ | |||
45 | #define MAX_SPLIT_SIZE 1023 | 45 | #define MAX_SPLIT_SIZE 1023 |
46 | #define QLGE_SB_PAD 32 | 46 | #define QLGE_SB_PAD 32 |
47 | 47 | ||
48 | #define MAX_CQ 128 | ||
48 | #define DFLT_COALESCE_WAIT 100 /* 100 usec wait for coalescing */ | 49 | #define DFLT_COALESCE_WAIT 100 /* 100 usec wait for coalescing */ |
49 | #define MAX_INTER_FRAME_WAIT 10 /* 10 usec max interframe-wait for coalescing */ | 50 | #define MAX_INTER_FRAME_WAIT 10 /* 10 usec max interframe-wait for coalescing */ |
50 | #define DFLT_INTER_FRAME_WAIT (MAX_INTER_FRAME_WAIT/2) | 51 | #define DFLT_INTER_FRAME_WAIT (MAX_INTER_FRAME_WAIT/2) |
@@ -961,8 +962,7 @@ struct ib_mac_iocb_rsp { | |||
961 | #define IB_MAC_IOCB_RSP_DS 0x40 /* data is in small buffer */ | 962 | #define IB_MAC_IOCB_RSP_DS 0x40 /* data is in small buffer */ |
962 | #define IB_MAC_IOCB_RSP_DL 0x80 /* data is in large buffer */ | 963 | #define IB_MAC_IOCB_RSP_DL 0x80 /* data is in large buffer */ |
963 | __le32 data_len; /* */ | 964 | __le32 data_len; /* */ |
964 | __le32 data_addr_lo; /* */ | 965 | __le64 data_addr; /* */ |
965 | __le32 data_addr_hi; /* */ | ||
966 | __le32 rss; /* */ | 966 | __le32 rss; /* */ |
967 | __le16 vlan_id; /* 12 bits */ | 967 | __le16 vlan_id; /* 12 bits */ |
968 | #define IB_MAC_IOCB_RSP_C 0x1000 /* VLAN CFI bit */ | 968 | #define IB_MAC_IOCB_RSP_C 0x1000 /* VLAN CFI bit */ |
@@ -976,8 +976,7 @@ struct ib_mac_iocb_rsp { | |||
976 | #define IB_MAC_IOCB_RSP_HS 0x40 | 976 | #define IB_MAC_IOCB_RSP_HS 0x40 |
977 | #define IB_MAC_IOCB_RSP_HL 0x80 | 977 | #define IB_MAC_IOCB_RSP_HL 0x80 |
978 | __le32 hdr_len; /* */ | 978 | __le32 hdr_len; /* */ |
979 | __le32 hdr_addr_lo; /* */ | 979 | __le64 hdr_addr; /* */ |
980 | __le32 hdr_addr_hi; /* */ | ||
981 | } __attribute((packed)); | 980 | } __attribute((packed)); |
982 | 981 | ||
983 | struct ib_ae_iocb_rsp { | 982 | struct ib_ae_iocb_rsp { |
@@ -1042,10 +1041,8 @@ struct wqicb { | |||
1042 | __le16 cq_id_rss; | 1041 | __le16 cq_id_rss; |
1043 | #define Q_CQ_ID_RSS_RV 0x8000 | 1042 | #define Q_CQ_ID_RSS_RV 0x8000 |
1044 | __le16 rid; | 1043 | __le16 rid; |
1045 | __le32 addr_lo; | 1044 | __le64 addr; |
1046 | __le32 addr_hi; | 1045 | __le64 cnsmr_idx_addr; |
1047 | __le32 cnsmr_idx_addr_lo; | ||
1048 | __le32 cnsmr_idx_addr_hi; | ||
1049 | } __attribute((packed)); | 1046 | } __attribute((packed)); |
1050 | 1047 | ||
1051 | /* | 1048 | /* |
@@ -1070,18 +1067,14 @@ struct cqicb { | |||
1070 | #define LEN_CPP_64 0x0002 | 1067 | #define LEN_CPP_64 0x0002 |
1071 | #define LEN_CPP_128 0x0003 | 1068 | #define LEN_CPP_128 0x0003 |
1072 | __le16 rid; | 1069 | __le16 rid; |
1073 | __le32 addr_lo; | 1070 | __le64 addr; |
1074 | __le32 addr_hi; | 1071 | __le64 prod_idx_addr; |
1075 | __le32 prod_idx_addr_lo; | ||
1076 | __le32 prod_idx_addr_hi; | ||
1077 | __le16 pkt_delay; | 1072 | __le16 pkt_delay; |
1078 | __le16 irq_delay; | 1073 | __le16 irq_delay; |
1079 | __le32 lbq_addr_lo; | 1074 | __le64 lbq_addr; |
1080 | __le32 lbq_addr_hi; | ||
1081 | __le16 lbq_buf_size; | 1075 | __le16 lbq_buf_size; |
1082 | __le16 lbq_len; /* entry count */ | 1076 | __le16 lbq_len; /* entry count */ |
1083 | __le32 sbq_addr_lo; | 1077 | __le64 sbq_addr; |
1084 | __le32 sbq_addr_hi; | ||
1085 | __le16 sbq_buf_size; | 1078 | __le16 sbq_buf_size; |
1086 | __le16 sbq_len; /* entry count */ | 1079 | __le16 sbq_len; /* entry count */ |
1087 | } __attribute((packed)); | 1080 | } __attribute((packed)); |
@@ -1145,7 +1138,7 @@ struct tx_ring { | |||
1145 | struct wqicb wqicb; /* structure used to inform chip of new queue */ | 1138 | struct wqicb wqicb; /* structure used to inform chip of new queue */ |
1146 | void *wq_base; /* pci_alloc:virtual addr for tx */ | 1139 | void *wq_base; /* pci_alloc:virtual addr for tx */ |
1147 | dma_addr_t wq_base_dma; /* pci_alloc:dma addr for tx */ | 1140 | dma_addr_t wq_base_dma; /* pci_alloc:dma addr for tx */ |
1148 | u32 *cnsmr_idx_sh_reg; /* shadow copy of consumer idx */ | 1141 | __le32 *cnsmr_idx_sh_reg; /* shadow copy of consumer idx */ |
1149 | dma_addr_t cnsmr_idx_sh_reg_dma; /* dma-shadow copy of consumer */ | 1142 | dma_addr_t cnsmr_idx_sh_reg_dma; /* dma-shadow copy of consumer */ |
1150 | u32 wq_size; /* size in bytes of queue area */ | 1143 | u32 wq_size; /* size in bytes of queue area */ |
1151 | u32 wq_len; /* number of entries in queue */ | 1144 | u32 wq_len; /* number of entries in queue */ |
@@ -1181,7 +1174,7 @@ struct rx_ring { | |||
1181 | u32 cq_size; | 1174 | u32 cq_size; |
1182 | u32 cq_len; | 1175 | u32 cq_len; |
1183 | u16 cq_id; | 1176 | u16 cq_id; |
1184 | volatile __le32 *prod_idx_sh_reg; /* Shadowed producer register. */ | 1177 | __le32 *prod_idx_sh_reg; /* Shadowed producer register. */ |
1185 | dma_addr_t prod_idx_sh_reg_dma; | 1178 | dma_addr_t prod_idx_sh_reg_dma; |
1186 | void __iomem *cnsmr_idx_db_reg; /* PCI doorbell mem area + 0 */ | 1179 | void __iomem *cnsmr_idx_db_reg; /* PCI doorbell mem area + 0 */ |
1187 | u32 cnsmr_idx; /* current sw idx */ | 1180 | u32 cnsmr_idx; /* current sw idx */ |
@@ -1402,9 +1395,11 @@ struct ql_adapter { | |||
1402 | int rx_ring_count; | 1395 | int rx_ring_count; |
1403 | int ring_mem_size; | 1396 | int ring_mem_size; |
1404 | void *ring_mem; | 1397 | void *ring_mem; |
1405 | struct rx_ring *rx_ring; | 1398 | |
1399 | struct rx_ring rx_ring[MAX_RX_RINGS]; | ||
1400 | struct tx_ring tx_ring[MAX_TX_RINGS]; | ||
1401 | |||
1406 | int rx_csum; | 1402 | int rx_csum; |
1407 | struct tx_ring *tx_ring; | ||
1408 | u32 default_rx_queue; | 1403 | u32 default_rx_queue; |
1409 | 1404 | ||
1410 | u16 rx_coalesce_usecs; /* cqicb->int_delay */ | 1405 | u16 rx_coalesce_usecs; /* cqicb->int_delay */ |
@@ -1459,6 +1454,24 @@ static inline void ql_write_db_reg(u32 val, void __iomem *addr) | |||
1459 | mmiowb(); | 1454 | mmiowb(); |
1460 | } | 1455 | } |
1461 | 1456 | ||
1457 | /* | ||
1458 | * Shadow Registers: | ||
1459 | * Outbound queues have a consumer index that is maintained by the chip. | ||
1460 | * Inbound queues have a producer index that is maintained by the chip. | ||
1461 | * For lower overhead, these registers are "shadowed" to host memory | ||
1462 | * which allows the device driver to track the queue progress without | ||
1463 | * PCI reads. When an entry is placed on an inbound queue, the chip will | ||
1464 | * update the relevant index register and then copy the value to the | ||
1465 | * shadow register in host memory. | ||
1466 | */ | ||
1467 | static inline u32 ql_read_sh_reg(__le32 *addr) | ||
1468 | { | ||
1469 | u32 reg; | ||
1470 | reg = le32_to_cpu(*addr); | ||
1471 | rmb(); | ||
1472 | return reg; | ||
1473 | } | ||
1474 | |||
1462 | extern char qlge_driver_name[]; | 1475 | extern char qlge_driver_name[]; |
1463 | extern const char qlge_driver_version[]; | 1476 | extern const char qlge_driver_version[]; |
1464 | extern const struct ethtool_ops qlge_ethtool_ops; | 1477 | extern const struct ethtool_ops qlge_ethtool_ops; |
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c index 3f5e02d2e4a9..379b895ed6e6 100644 --- a/drivers/net/qlge/qlge_dbg.c +++ b/drivers/net/qlge/qlge_dbg.c | |||
@@ -435,14 +435,10 @@ void ql_dump_wqicb(struct wqicb *wqicb) | |||
435 | printk(KERN_ERR PFX "wqicb->cq_id_rss = %d.\n", | 435 | printk(KERN_ERR PFX "wqicb->cq_id_rss = %d.\n", |
436 | le16_to_cpu(wqicb->cq_id_rss)); | 436 | le16_to_cpu(wqicb->cq_id_rss)); |
437 | printk(KERN_ERR PFX "wqicb->rid = 0x%x.\n", le16_to_cpu(wqicb->rid)); | 437 | printk(KERN_ERR PFX "wqicb->rid = 0x%x.\n", le16_to_cpu(wqicb->rid)); |
438 | printk(KERN_ERR PFX "wqicb->wq_addr_lo = 0x%.08x.\n", | 438 | printk(KERN_ERR PFX "wqicb->wq_addr = 0x%llx.\n", |
439 | le32_to_cpu(wqicb->addr_lo)); | 439 | (unsigned long long) le64_to_cpu(wqicb->addr)); |
440 | printk(KERN_ERR PFX "wqicb->wq_addr_hi = 0x%.08x.\n", | 440 | printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr = 0x%llx.\n", |
441 | le32_to_cpu(wqicb->addr_hi)); | 441 | (unsigned long long) le64_to_cpu(wqicb->cnsmr_idx_addr)); |
442 | printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr_lo = 0x%.08x.\n", | ||
443 | le32_to_cpu(wqicb->cnsmr_idx_addr_lo)); | ||
444 | printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr_hi = 0x%.08x.\n", | ||
445 | le32_to_cpu(wqicb->cnsmr_idx_addr_hi)); | ||
446 | } | 442 | } |
447 | 443 | ||
448 | void ql_dump_tx_ring(struct tx_ring *tx_ring) | 444 | void ql_dump_tx_ring(struct tx_ring *tx_ring) |
@@ -455,10 +451,11 @@ void ql_dump_tx_ring(struct tx_ring *tx_ring) | |||
455 | printk(KERN_ERR PFX "tx_ring->base = %p.\n", tx_ring->wq_base); | 451 | printk(KERN_ERR PFX "tx_ring->base = %p.\n", tx_ring->wq_base); |
456 | printk(KERN_ERR PFX "tx_ring->base_dma = 0x%llx.\n", | 452 | printk(KERN_ERR PFX "tx_ring->base_dma = 0x%llx.\n", |
457 | (unsigned long long) tx_ring->wq_base_dma); | 453 | (unsigned long long) tx_ring->wq_base_dma); |
458 | printk(KERN_ERR PFX "tx_ring->cnsmr_idx_sh_reg = %p.\n", | 454 | printk(KERN_ERR PFX |
459 | tx_ring->cnsmr_idx_sh_reg); | 455 | "tx_ring->cnsmr_idx_sh_reg, addr = 0x%p, value = %d.\n", |
460 | printk(KERN_ERR PFX "tx_ring->cnsmr_idx_sh_reg_dma = 0x%llx.\n", | 456 | tx_ring->cnsmr_idx_sh_reg, |
461 | (unsigned long long) tx_ring->cnsmr_idx_sh_reg_dma); | 457 | tx_ring->cnsmr_idx_sh_reg |
458 | ? ql_read_sh_reg(tx_ring->cnsmr_idx_sh_reg) : 0); | ||
462 | printk(KERN_ERR PFX "tx_ring->size = %d.\n", tx_ring->wq_size); | 459 | printk(KERN_ERR PFX "tx_ring->size = %d.\n", tx_ring->wq_size); |
463 | printk(KERN_ERR PFX "tx_ring->len = %d.\n", tx_ring->wq_len); | 460 | printk(KERN_ERR PFX "tx_ring->len = %d.\n", tx_ring->wq_len); |
464 | printk(KERN_ERR PFX "tx_ring->prod_idx_db_reg = %p.\n", | 461 | printk(KERN_ERR PFX "tx_ring->prod_idx_db_reg = %p.\n", |
@@ -510,30 +507,22 @@ void ql_dump_cqicb(struct cqicb *cqicb) | |||
510 | printk(KERN_ERR PFX "cqicb->msix_vect = %d.\n", cqicb->msix_vect); | 507 | printk(KERN_ERR PFX "cqicb->msix_vect = %d.\n", cqicb->msix_vect); |
511 | printk(KERN_ERR PFX "cqicb->flags = %x.\n", cqicb->flags); | 508 | printk(KERN_ERR PFX "cqicb->flags = %x.\n", cqicb->flags); |
512 | printk(KERN_ERR PFX "cqicb->len = %d.\n", le16_to_cpu(cqicb->len)); | 509 | printk(KERN_ERR PFX "cqicb->len = %d.\n", le16_to_cpu(cqicb->len)); |
513 | printk(KERN_ERR PFX "cqicb->addr_lo = %x.\n", | 510 | printk(KERN_ERR PFX "cqicb->addr = 0x%llx.\n", |
514 | le32_to_cpu(cqicb->addr_lo)); | 511 | (unsigned long long) le64_to_cpu(cqicb->addr)); |
515 | printk(KERN_ERR PFX "cqicb->addr_hi = %x.\n", | 512 | printk(KERN_ERR PFX "cqicb->prod_idx_addr = 0x%llx.\n", |
516 | le32_to_cpu(cqicb->addr_hi)); | 513 | (unsigned long long) le64_to_cpu(cqicb->prod_idx_addr)); |
517 | printk(KERN_ERR PFX "cqicb->prod_idx_addr_lo = %x.\n", | ||
518 | le32_to_cpu(cqicb->prod_idx_addr_lo)); | ||
519 | printk(KERN_ERR PFX "cqicb->prod_idx_addr_hi = %x.\n", | ||
520 | le32_to_cpu(cqicb->prod_idx_addr_hi)); | ||
521 | printk(KERN_ERR PFX "cqicb->pkt_delay = 0x%.04x.\n", | 514 | printk(KERN_ERR PFX "cqicb->pkt_delay = 0x%.04x.\n", |
522 | le16_to_cpu(cqicb->pkt_delay)); | 515 | le16_to_cpu(cqicb->pkt_delay)); |
523 | printk(KERN_ERR PFX "cqicb->irq_delay = 0x%.04x.\n", | 516 | printk(KERN_ERR PFX "cqicb->irq_delay = 0x%.04x.\n", |
524 | le16_to_cpu(cqicb->irq_delay)); | 517 | le16_to_cpu(cqicb->irq_delay)); |
525 | printk(KERN_ERR PFX "cqicb->lbq_addr_lo = %x.\n", | 518 | printk(KERN_ERR PFX "cqicb->lbq_addr = 0x%llx.\n", |
526 | le32_to_cpu(cqicb->lbq_addr_lo)); | 519 | (unsigned long long) le64_to_cpu(cqicb->lbq_addr)); |
527 | printk(KERN_ERR PFX "cqicb->lbq_addr_hi = %x.\n", | ||
528 | le32_to_cpu(cqicb->lbq_addr_hi)); | ||
529 | printk(KERN_ERR PFX "cqicb->lbq_buf_size = 0x%.04x.\n", | 520 | printk(KERN_ERR PFX "cqicb->lbq_buf_size = 0x%.04x.\n", |
530 | le16_to_cpu(cqicb->lbq_buf_size)); | 521 | le16_to_cpu(cqicb->lbq_buf_size)); |
531 | printk(KERN_ERR PFX "cqicb->lbq_len = 0x%.04x.\n", | 522 | printk(KERN_ERR PFX "cqicb->lbq_len = 0x%.04x.\n", |
532 | le16_to_cpu(cqicb->lbq_len)); | 523 | le16_to_cpu(cqicb->lbq_len)); |
533 | printk(KERN_ERR PFX "cqicb->sbq_addr_lo = %x.\n", | 524 | printk(KERN_ERR PFX "cqicb->sbq_addr = 0x%llx.\n", |
534 | le32_to_cpu(cqicb->sbq_addr_lo)); | 525 | (unsigned long long) le64_to_cpu(cqicb->sbq_addr)); |
535 | printk(KERN_ERR PFX "cqicb->sbq_addr_hi = %x.\n", | ||
536 | le32_to_cpu(cqicb->sbq_addr_hi)); | ||
537 | printk(KERN_ERR PFX "cqicb->sbq_buf_size = 0x%.04x.\n", | 526 | printk(KERN_ERR PFX "cqicb->sbq_buf_size = 0x%.04x.\n", |
538 | le16_to_cpu(cqicb->sbq_buf_size)); | 527 | le16_to_cpu(cqicb->sbq_buf_size)); |
539 | printk(KERN_ERR PFX "cqicb->sbq_len = 0x%.04x.\n", | 528 | printk(KERN_ERR PFX "cqicb->sbq_len = 0x%.04x.\n", |
@@ -558,9 +547,10 @@ void ql_dump_rx_ring(struct rx_ring *rx_ring) | |||
558 | printk(KERN_ERR PFX "rx_ring->cq_size = %d.\n", rx_ring->cq_size); | 547 | printk(KERN_ERR PFX "rx_ring->cq_size = %d.\n", rx_ring->cq_size); |
559 | printk(KERN_ERR PFX "rx_ring->cq_len = %d.\n", rx_ring->cq_len); | 548 | printk(KERN_ERR PFX "rx_ring->cq_len = %d.\n", rx_ring->cq_len); |
560 | printk(KERN_ERR PFX | 549 | printk(KERN_ERR PFX |
561 | "rx_ring->prod_idx_sh_reg, addr = %p, value = %d.\n", | 550 | "rx_ring->prod_idx_sh_reg, addr = 0x%p, value = %d.\n", |
562 | rx_ring->prod_idx_sh_reg, | 551 | rx_ring->prod_idx_sh_reg, |
563 | rx_ring->prod_idx_sh_reg ? *(rx_ring->prod_idx_sh_reg) : 0); | 552 | rx_ring->prod_idx_sh_reg |
553 | ? ql_read_sh_reg(rx_ring->prod_idx_sh_reg) : 0); | ||
564 | printk(KERN_ERR PFX "rx_ring->prod_idx_sh_reg_dma = %llx.\n", | 554 | printk(KERN_ERR PFX "rx_ring->prod_idx_sh_reg_dma = %llx.\n", |
565 | (unsigned long long) rx_ring->prod_idx_sh_reg_dma); | 555 | (unsigned long long) rx_ring->prod_idx_sh_reg_dma); |
566 | printk(KERN_ERR PFX "rx_ring->cnsmr_idx_db_reg = %p.\n", | 556 | printk(KERN_ERR PFX "rx_ring->cnsmr_idx_db_reg = %p.\n", |
@@ -809,10 +799,8 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp) | |||
809 | 799 | ||
810 | printk(KERN_ERR PFX "data_len = %d\n", | 800 | printk(KERN_ERR PFX "data_len = %d\n", |
811 | le32_to_cpu(ib_mac_rsp->data_len)); | 801 | le32_to_cpu(ib_mac_rsp->data_len)); |
812 | printk(KERN_ERR PFX "data_addr_hi = 0x%x\n", | 802 | printk(KERN_ERR PFX "data_addr = 0x%llx\n", |
813 | le32_to_cpu(ib_mac_rsp->data_addr_hi)); | 803 | (unsigned long long) le64_to_cpu(ib_mac_rsp->data_addr)); |
814 | printk(KERN_ERR PFX "data_addr_lo = 0x%x\n", | ||
815 | le32_to_cpu(ib_mac_rsp->data_addr_lo)); | ||
816 | if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) | 804 | if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) |
817 | printk(KERN_ERR PFX "rss = %x\n", | 805 | printk(KERN_ERR PFX "rss = %x\n", |
818 | le32_to_cpu(ib_mac_rsp->rss)); | 806 | le32_to_cpu(ib_mac_rsp->rss)); |
@@ -828,10 +816,8 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp) | |||
828 | if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { | 816 | if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { |
829 | printk(KERN_ERR PFX "hdr length = %d.\n", | 817 | printk(KERN_ERR PFX "hdr length = %d.\n", |
830 | le32_to_cpu(ib_mac_rsp->hdr_len)); | 818 | le32_to_cpu(ib_mac_rsp->hdr_len)); |
831 | printk(KERN_ERR PFX "hdr addr_hi = 0x%x.\n", | 819 | printk(KERN_ERR PFX "hdr addr = 0x%llx.\n", |
832 | le32_to_cpu(ib_mac_rsp->hdr_addr_hi)); | 820 | (unsigned long long) le64_to_cpu(ib_mac_rsp->hdr_addr)); |
833 | printk(KERN_ERR PFX "hdr addr_lo = 0x%x.\n", | ||
834 | le32_to_cpu(ib_mac_rsp->hdr_addr_lo)); | ||
835 | } | 821 | } |
836 | } | 822 | } |
837 | #endif | 823 | #endif |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index f4c016012f18..45421c8b6010 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -76,7 +76,6 @@ MODULE_PARM_DESC(irq_type, "0 = MSI-X, 1 = MSI, 2 = Legacy."); | |||
76 | 76 | ||
77 | static struct pci_device_id qlge_pci_tbl[] __devinitdata = { | 77 | static struct pci_device_id qlge_pci_tbl[] __devinitdata = { |
78 | {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QLGE_DEVICE_ID)}, | 78 | {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QLGE_DEVICE_ID)}, |
79 | {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QLGE_DEVICE_ID1)}, | ||
80 | /* required last entry */ | 79 | /* required last entry */ |
81 | {0,} | 80 | {0,} |
82 | }; | 81 | }; |
@@ -127,12 +126,12 @@ static int ql_sem_trylock(struct ql_adapter *qdev, u32 sem_mask) | |||
127 | 126 | ||
128 | int ql_sem_spinlock(struct ql_adapter *qdev, u32 sem_mask) | 127 | int ql_sem_spinlock(struct ql_adapter *qdev, u32 sem_mask) |
129 | { | 128 | { |
130 | unsigned int seconds = 3; | 129 | unsigned int wait_count = 30; |
131 | do { | 130 | do { |
132 | if (!ql_sem_trylock(qdev, sem_mask)) | 131 | if (!ql_sem_trylock(qdev, sem_mask)) |
133 | return 0; | 132 | return 0; |
134 | ssleep(1); | 133 | udelay(100); |
135 | } while (--seconds); | 134 | } while (--wait_count); |
136 | return -ETIMEDOUT; | 135 | return -ETIMEDOUT; |
137 | } | 136 | } |
138 | 137 | ||
@@ -1545,7 +1544,7 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev, | |||
1545 | static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | 1544 | static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) |
1546 | { | 1545 | { |
1547 | struct ql_adapter *qdev = rx_ring->qdev; | 1546 | struct ql_adapter *qdev = rx_ring->qdev; |
1548 | u32 prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); | 1547 | u32 prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); |
1549 | struct ob_mac_iocb_rsp *net_rsp = NULL; | 1548 | struct ob_mac_iocb_rsp *net_rsp = NULL; |
1550 | int count = 0; | 1549 | int count = 0; |
1551 | 1550 | ||
@@ -1571,7 +1570,7 @@ static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | |||
1571 | } | 1570 | } |
1572 | count++; | 1571 | count++; |
1573 | ql_update_cq(rx_ring); | 1572 | ql_update_cq(rx_ring); |
1574 | prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); | 1573 | prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); |
1575 | } | 1574 | } |
1576 | ql_write_cq_idx(rx_ring); | 1575 | ql_write_cq_idx(rx_ring); |
1577 | if (netif_queue_stopped(qdev->ndev) && net_rsp != NULL) { | 1576 | if (netif_queue_stopped(qdev->ndev) && net_rsp != NULL) { |
@@ -1591,7 +1590,7 @@ static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | |||
1591 | static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) | 1590 | static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) |
1592 | { | 1591 | { |
1593 | struct ql_adapter *qdev = rx_ring->qdev; | 1592 | struct ql_adapter *qdev = rx_ring->qdev; |
1594 | u32 prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); | 1593 | u32 prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); |
1595 | struct ql_net_rsp_iocb *net_rsp; | 1594 | struct ql_net_rsp_iocb *net_rsp; |
1596 | int count = 0; | 1595 | int count = 0; |
1597 | 1596 | ||
@@ -1624,7 +1623,7 @@ static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) | |||
1624 | } | 1623 | } |
1625 | count++; | 1624 | count++; |
1626 | ql_update_cq(rx_ring); | 1625 | ql_update_cq(rx_ring); |
1627 | prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); | 1626 | prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); |
1628 | if (count == budget) | 1627 | if (count == budget) |
1629 | break; | 1628 | break; |
1630 | } | 1629 | } |
@@ -1787,7 +1786,7 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
1787 | * Check the default queue and wake handler if active. | 1786 | * Check the default queue and wake handler if active. |
1788 | */ | 1787 | */ |
1789 | rx_ring = &qdev->rx_ring[0]; | 1788 | rx_ring = &qdev->rx_ring[0]; |
1790 | if (le32_to_cpu(*rx_ring->prod_idx_sh_reg) != rx_ring->cnsmr_idx) { | 1789 | if (ql_read_sh_reg(rx_ring->prod_idx_sh_reg) != rx_ring->cnsmr_idx) { |
1791 | QPRINTK(qdev, INTR, INFO, "Waking handler for rx_ring[0].\n"); | 1790 | QPRINTK(qdev, INTR, INFO, "Waking handler for rx_ring[0].\n"); |
1792 | ql_disable_completion_interrupt(qdev, intr_context->intr); | 1791 | ql_disable_completion_interrupt(qdev, intr_context->intr); |
1793 | queue_delayed_work_on(smp_processor_id(), qdev->q_workqueue, | 1792 | queue_delayed_work_on(smp_processor_id(), qdev->q_workqueue, |
@@ -1801,7 +1800,7 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
1801 | */ | 1800 | */ |
1802 | for (i = 1; i < qdev->rx_ring_count; i++) { | 1801 | for (i = 1; i < qdev->rx_ring_count; i++) { |
1803 | rx_ring = &qdev->rx_ring[i]; | 1802 | rx_ring = &qdev->rx_ring[i]; |
1804 | if (le32_to_cpu(*rx_ring->prod_idx_sh_reg) != | 1803 | if (ql_read_sh_reg(rx_ring->prod_idx_sh_reg) != |
1805 | rx_ring->cnsmr_idx) { | 1804 | rx_ring->cnsmr_idx) { |
1806 | QPRINTK(qdev, INTR, INFO, | 1805 | QPRINTK(qdev, INTR, INFO, |
1807 | "Waking handler for rx_ring[%d].\n", i); | 1806 | "Waking handler for rx_ring[%d].\n", i); |
@@ -2356,28 +2355,6 @@ static void ql_tx_ring_clean(struct ql_adapter *qdev) | |||
2356 | } | 2355 | } |
2357 | } | 2356 | } |
2358 | 2357 | ||
2359 | static void ql_free_ring_cb(struct ql_adapter *qdev) | ||
2360 | { | ||
2361 | kfree(qdev->ring_mem); | ||
2362 | } | ||
2363 | |||
2364 | static int ql_alloc_ring_cb(struct ql_adapter *qdev) | ||
2365 | { | ||
2366 | /* Allocate space for tx/rx ring control blocks. */ | ||
2367 | qdev->ring_mem_size = | ||
2368 | (qdev->tx_ring_count * sizeof(struct tx_ring)) + | ||
2369 | (qdev->rx_ring_count * sizeof(struct rx_ring)); | ||
2370 | qdev->ring_mem = kmalloc(qdev->ring_mem_size, GFP_KERNEL); | ||
2371 | if (qdev->ring_mem == NULL) { | ||
2372 | return -ENOMEM; | ||
2373 | } else { | ||
2374 | qdev->rx_ring = qdev->ring_mem; | ||
2375 | qdev->tx_ring = qdev->ring_mem + | ||
2376 | (qdev->rx_ring_count * sizeof(struct rx_ring)); | ||
2377 | } | ||
2378 | return 0; | ||
2379 | } | ||
2380 | |||
2381 | static void ql_free_mem_resources(struct ql_adapter *qdev) | 2358 | static void ql_free_mem_resources(struct ql_adapter *qdev) |
2382 | { | 2359 | { |
2383 | int i; | 2360 | int i; |
@@ -2467,12 +2444,9 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2467 | bq_len = (rx_ring->cq_len == 65536) ? 0 : (u16) rx_ring->cq_len; | 2444 | bq_len = (rx_ring->cq_len == 65536) ? 0 : (u16) rx_ring->cq_len; |
2468 | cqicb->len = cpu_to_le16(bq_len | LEN_V | LEN_CPP_CONT); | 2445 | cqicb->len = cpu_to_le16(bq_len | LEN_V | LEN_CPP_CONT); |
2469 | 2446 | ||
2470 | cqicb->addr_lo = cpu_to_le32(rx_ring->cq_base_dma); | 2447 | cqicb->addr = cpu_to_le64(rx_ring->cq_base_dma); |
2471 | cqicb->addr_hi = cpu_to_le32((u64) rx_ring->cq_base_dma >> 32); | ||
2472 | 2448 | ||
2473 | cqicb->prod_idx_addr_lo = cpu_to_le32(rx_ring->prod_idx_sh_reg_dma); | 2449 | cqicb->prod_idx_addr = cpu_to_le64(rx_ring->prod_idx_sh_reg_dma); |
2474 | cqicb->prod_idx_addr_hi = | ||
2475 | cpu_to_le32((u64) rx_ring->prod_idx_sh_reg_dma >> 32); | ||
2476 | 2450 | ||
2477 | /* | 2451 | /* |
2478 | * Set up the control block load flags. | 2452 | * Set up the control block load flags. |
@@ -2483,10 +2457,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2483 | if (rx_ring->lbq_len) { | 2457 | if (rx_ring->lbq_len) { |
2484 | cqicb->flags |= FLAGS_LL; /* Load lbq values */ | 2458 | cqicb->flags |= FLAGS_LL; /* Load lbq values */ |
2485 | *((u64 *) rx_ring->lbq_base_indirect) = rx_ring->lbq_base_dma; | 2459 | *((u64 *) rx_ring->lbq_base_indirect) = rx_ring->lbq_base_dma; |
2486 | cqicb->lbq_addr_lo = | 2460 | cqicb->lbq_addr = |
2487 | cpu_to_le32(rx_ring->lbq_base_indirect_dma); | 2461 | cpu_to_le64(rx_ring->lbq_base_indirect_dma); |
2488 | cqicb->lbq_addr_hi = | ||
2489 | cpu_to_le32((u64) rx_ring->lbq_base_indirect_dma >> 32); | ||
2490 | bq_len = (rx_ring->lbq_buf_size == 65536) ? 0 : | 2462 | bq_len = (rx_ring->lbq_buf_size == 65536) ? 0 : |
2491 | (u16) rx_ring->lbq_buf_size; | 2463 | (u16) rx_ring->lbq_buf_size; |
2492 | cqicb->lbq_buf_size = cpu_to_le16(bq_len); | 2464 | cqicb->lbq_buf_size = cpu_to_le16(bq_len); |
@@ -2501,10 +2473,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2501 | if (rx_ring->sbq_len) { | 2473 | if (rx_ring->sbq_len) { |
2502 | cqicb->flags |= FLAGS_LS; /* Load sbq values */ | 2474 | cqicb->flags |= FLAGS_LS; /* Load sbq values */ |
2503 | *((u64 *) rx_ring->sbq_base_indirect) = rx_ring->sbq_base_dma; | 2475 | *((u64 *) rx_ring->sbq_base_indirect) = rx_ring->sbq_base_dma; |
2504 | cqicb->sbq_addr_lo = | 2476 | cqicb->sbq_addr = |
2505 | cpu_to_le32(rx_ring->sbq_base_indirect_dma); | 2477 | cpu_to_le64(rx_ring->sbq_base_indirect_dma); |
2506 | cqicb->sbq_addr_hi = | ||
2507 | cpu_to_le32((u64) rx_ring->sbq_base_indirect_dma >> 32); | ||
2508 | cqicb->sbq_buf_size = | 2478 | cqicb->sbq_buf_size = |
2509 | cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8); | 2479 | cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8); |
2510 | bq_len = (rx_ring->sbq_len == 65536) ? 0 : | 2480 | bq_len = (rx_ring->sbq_len == 65536) ? 0 : |
@@ -2611,12 +2581,9 @@ static int ql_start_tx_ring(struct ql_adapter *qdev, struct tx_ring *tx_ring) | |||
2611 | Q_FLAGS_LB | Q_FLAGS_LI | Q_FLAGS_LO); | 2581 | Q_FLAGS_LB | Q_FLAGS_LI | Q_FLAGS_LO); |
2612 | wqicb->cq_id_rss = cpu_to_le16(tx_ring->cq_id); | 2582 | wqicb->cq_id_rss = cpu_to_le16(tx_ring->cq_id); |
2613 | wqicb->rid = 0; | 2583 | wqicb->rid = 0; |
2614 | wqicb->addr_lo = cpu_to_le32(tx_ring->wq_base_dma); | 2584 | wqicb->addr = cpu_to_le64(tx_ring->wq_base_dma); |
2615 | wqicb->addr_hi = cpu_to_le32((u64) tx_ring->wq_base_dma >> 32); | ||
2616 | 2585 | ||
2617 | wqicb->cnsmr_idx_addr_lo = cpu_to_le32(tx_ring->cnsmr_idx_sh_reg_dma); | 2586 | wqicb->cnsmr_idx_addr = cpu_to_le64(tx_ring->cnsmr_idx_sh_reg_dma); |
2618 | wqicb->cnsmr_idx_addr_hi = | ||
2619 | cpu_to_le32((u64) tx_ring->cnsmr_idx_sh_reg_dma >> 32); | ||
2620 | 2587 | ||
2621 | ql_init_tx_ring(qdev, tx_ring); | 2588 | ql_init_tx_ring(qdev, tx_ring); |
2622 | 2589 | ||
@@ -2746,14 +2713,14 @@ static void ql_resolve_queues_to_irqs(struct ql_adapter *qdev) | |||
2746 | * Outbound queue is for outbound completions only. | 2713 | * Outbound queue is for outbound completions only. |
2747 | */ | 2714 | */ |
2748 | intr_context->handler = qlge_msix_tx_isr; | 2715 | intr_context->handler = qlge_msix_tx_isr; |
2749 | sprintf(intr_context->name, "%s-txq-%d", | 2716 | sprintf(intr_context->name, "%s-tx-%d", |
2750 | qdev->ndev->name, i); | 2717 | qdev->ndev->name, i); |
2751 | } else { | 2718 | } else { |
2752 | /* | 2719 | /* |
2753 | * Inbound queues handle unicast frames only. | 2720 | * Inbound queues handle unicast frames only. |
2754 | */ | 2721 | */ |
2755 | intr_context->handler = qlge_msix_rx_isr; | 2722 | intr_context->handler = qlge_msix_rx_isr; |
2756 | sprintf(intr_context->name, "%s-rxq-%d", | 2723 | sprintf(intr_context->name, "%s-rx-%d", |
2757 | qdev->ndev->name, i); | 2724 | qdev->ndev->name, i); |
2758 | } | 2725 | } |
2759 | } | 2726 | } |
@@ -3247,7 +3214,6 @@ static int qlge_close(struct net_device *ndev) | |||
3247 | msleep(1); | 3214 | msleep(1); |
3248 | ql_adapter_down(qdev); | 3215 | ql_adapter_down(qdev); |
3249 | ql_release_adapter_resources(qdev); | 3216 | ql_release_adapter_resources(qdev); |
3250 | ql_free_ring_cb(qdev); | ||
3251 | return 0; | 3217 | return 0; |
3252 | } | 3218 | } |
3253 | 3219 | ||
@@ -3273,8 +3239,8 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3273 | * This limitation can be removed when requested. | 3239 | * This limitation can be removed when requested. |
3274 | */ | 3240 | */ |
3275 | 3241 | ||
3276 | if (cpu_cnt > 8) | 3242 | if (cpu_cnt > MAX_CPUS) |
3277 | cpu_cnt = 8; | 3243 | cpu_cnt = MAX_CPUS; |
3278 | 3244 | ||
3279 | /* | 3245 | /* |
3280 | * rx_ring[0] is always the default queue. | 3246 | * rx_ring[0] is always the default queue. |
@@ -3294,9 +3260,6 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3294 | */ | 3260 | */ |
3295 | qdev->rx_ring_count = qdev->tx_ring_count + qdev->rss_ring_count + 1; | 3261 | qdev->rx_ring_count = qdev->tx_ring_count + qdev->rss_ring_count + 1; |
3296 | 3262 | ||
3297 | if (ql_alloc_ring_cb(qdev)) | ||
3298 | return -ENOMEM; | ||
3299 | |||
3300 | for (i = 0; i < qdev->tx_ring_count; i++) { | 3263 | for (i = 0; i < qdev->tx_ring_count; i++) { |
3301 | tx_ring = &qdev->tx_ring[i]; | 3264 | tx_ring = &qdev->tx_ring[i]; |
3302 | memset((void *)tx_ring, 0, sizeof(tx_ring)); | 3265 | memset((void *)tx_ring, 0, sizeof(tx_ring)); |
@@ -3393,7 +3356,6 @@ static int qlge_open(struct net_device *ndev) | |||
3393 | 3356 | ||
3394 | error_up: | 3357 | error_up: |
3395 | ql_release_adapter_resources(qdev); | 3358 | ql_release_adapter_resources(qdev); |
3396 | ql_free_ring_cb(qdev); | ||
3397 | return err; | 3359 | return err; |
3398 | } | 3360 | } |
3399 | 3361 | ||
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index cf3a082bc89d..72fd9e97c190 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
@@ -49,8 +49,8 @@ | |||
49 | #include <asm/processor.h> | 49 | #include <asm/processor.h> |
50 | 50 | ||
51 | #define DRV_NAME "r6040" | 51 | #define DRV_NAME "r6040" |
52 | #define DRV_VERSION "0.20" | 52 | #define DRV_VERSION "0.21" |
53 | #define DRV_RELDATE "07Jan2009" | 53 | #define DRV_RELDATE "09Jan2009" |
54 | 54 | ||
55 | /* PHY CHIP Address */ | 55 | /* PHY CHIP Address */ |
56 | #define PHY1_ADDR 1 /* For MAC1 */ | 56 | #define PHY1_ADDR 1 /* For MAC1 */ |
@@ -457,22 +457,12 @@ static void r6040_down(struct net_device *dev) | |||
457 | iowrite16(adrp[0], ioaddr + MID_0L); | 457 | iowrite16(adrp[0], ioaddr + MID_0L); |
458 | iowrite16(adrp[1], ioaddr + MID_0M); | 458 | iowrite16(adrp[1], ioaddr + MID_0M); |
459 | iowrite16(adrp[2], ioaddr + MID_0H); | 459 | iowrite16(adrp[2], ioaddr + MID_0H); |
460 | free_irq(dev->irq, dev); | ||
461 | |||
462 | /* Free RX buffer */ | ||
463 | r6040_free_rxbufs(dev); | ||
464 | |||
465 | /* Free TX buffer */ | ||
466 | r6040_free_txbufs(dev); | ||
467 | |||
468 | /* Free Descriptor memory */ | ||
469 | pci_free_consistent(pdev, RX_DESC_SIZE, lp->rx_ring, lp->rx_ring_dma); | ||
470 | pci_free_consistent(pdev, TX_DESC_SIZE, lp->tx_ring, lp->tx_ring_dma); | ||
471 | } | 460 | } |
472 | 461 | ||
473 | static int r6040_close(struct net_device *dev) | 462 | static int r6040_close(struct net_device *dev) |
474 | { | 463 | { |
475 | struct r6040_private *lp = netdev_priv(dev); | 464 | struct r6040_private *lp = netdev_priv(dev); |
465 | struct pci_dev *pdev = lp->pdev; | ||
476 | 466 | ||
477 | /* deleted timer */ | 467 | /* deleted timer */ |
478 | del_timer_sync(&lp->timer); | 468 | del_timer_sync(&lp->timer); |
@@ -481,8 +471,28 @@ static int r6040_close(struct net_device *dev) | |||
481 | napi_disable(&lp->napi); | 471 | napi_disable(&lp->napi); |
482 | netif_stop_queue(dev); | 472 | netif_stop_queue(dev); |
483 | r6040_down(dev); | 473 | r6040_down(dev); |
474 | |||
475 | free_irq(dev->irq, dev); | ||
476 | |||
477 | /* Free RX buffer */ | ||
478 | r6040_free_rxbufs(dev); | ||
479 | |||
480 | /* Free TX buffer */ | ||
481 | r6040_free_txbufs(dev); | ||
482 | |||
484 | spin_unlock_irq(&lp->lock); | 483 | spin_unlock_irq(&lp->lock); |
485 | 484 | ||
485 | /* Free Descriptor memory */ | ||
486 | if (lp->rx_ring) { | ||
487 | pci_free_consistent(pdev, RX_DESC_SIZE, lp->rx_ring, lp->rx_ring_dma); | ||
488 | lp->rx_ring = 0; | ||
489 | } | ||
490 | |||
491 | if (lp->tx_ring) { | ||
492 | pci_free_consistent(pdev, TX_DESC_SIZE, lp->tx_ring, lp->tx_ring_dma); | ||
493 | lp->tx_ring = 0; | ||
494 | } | ||
495 | |||
486 | return 0; | 496 | return 0; |
487 | } | 497 | } |
488 | 498 | ||
@@ -1049,6 +1059,7 @@ static const struct net_device_ops r6040_netdev_ops = { | |||
1049 | .ndo_set_multicast_list = r6040_multicast_list, | 1059 | .ndo_set_multicast_list = r6040_multicast_list, |
1050 | .ndo_change_mtu = eth_change_mtu, | 1060 | .ndo_change_mtu = eth_change_mtu, |
1051 | .ndo_validate_addr = eth_validate_addr, | 1061 | .ndo_validate_addr = eth_validate_addr, |
1062 | .ndo_set_mac_address = eth_mac_addr, | ||
1052 | .ndo_do_ioctl = r6040_ioctl, | 1063 | .ndo_do_ioctl = r6040_ioctl, |
1053 | .ndo_tx_timeout = r6040_tx_timeout, | 1064 | .ndo_tx_timeout = r6040_tx_timeout, |
1054 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1065 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -1143,8 +1154,10 @@ static int __devinit r6040_init_one(struct pci_dev *pdev, | |||
1143 | 1154 | ||
1144 | /* Some bootloader/BIOSes do not initialize | 1155 | /* Some bootloader/BIOSes do not initialize |
1145 | * MAC address, warn about that */ | 1156 | * MAC address, warn about that */ |
1146 | if (!(adrp[0] || adrp[1] || adrp[2])) | 1157 | if (!(adrp[0] || adrp[1] || adrp[2])) { |
1147 | printk(KERN_WARNING DRV_NAME ": MAC address not initialized\n"); | 1158 | printk(KERN_WARNING DRV_NAME ": MAC address not initialized, generating random\n"); |
1159 | random_ether_addr(dev->dev_addr); | ||
1160 | } | ||
1148 | 1161 | ||
1149 | /* Link new device into r6040_root_dev */ | 1162 | /* Link new device into r6040_root_dev */ |
1150 | lp->pdev = pdev; | 1163 | lp->pdev = pdev; |
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c index 42fd31276602..8b75bef4a841 100644 --- a/drivers/net/sc92031.c +++ b/drivers/net/sc92031.c | |||
@@ -1408,6 +1408,7 @@ static const struct net_device_ops sc92031_netdev_ops = { | |||
1408 | .ndo_set_multicast_list = sc92031_set_multicast_list, | 1408 | .ndo_set_multicast_list = sc92031_set_multicast_list, |
1409 | .ndo_change_mtu = eth_change_mtu, | 1409 | .ndo_change_mtu = eth_change_mtu, |
1410 | .ndo_validate_addr = eth_validate_addr, | 1410 | .ndo_validate_addr = eth_validate_addr, |
1411 | .ndo_set_mac_address = eth_mac_addr, | ||
1411 | .ndo_tx_timeout = sc92031_tx_timeout, | 1412 | .ndo_tx_timeout = sc92031_tx_timeout, |
1412 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1413 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1413 | .ndo_poll_controller = sc92031_poll_controller, | 1414 | .ndo_poll_controller = sc92031_poll_controller, |
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c index b9768760fae7..9ecb77da9545 100644 --- a/drivers/net/sfc/tenxpress.c +++ b/drivers/net/sfc/tenxpress.c | |||
@@ -636,10 +636,11 @@ static void tenxpress_phy_fini(struct efx_nic *efx) | |||
636 | { | 636 | { |
637 | int reg; | 637 | int reg; |
638 | 638 | ||
639 | if (efx->phy_type == PHY_TYPE_SFT9001B) { | 639 | if (efx->phy_type == PHY_TYPE_SFT9001B) |
640 | device_remove_file(&efx->pci_dev->dev, | 640 | device_remove_file(&efx->pci_dev->dev, |
641 | &dev_attr_phy_short_reach); | 641 | &dev_attr_phy_short_reach); |
642 | } else { | 642 | |
643 | if (efx->phy_type == PHY_TYPE_SFX7101) { | ||
643 | /* Power down the LNPGA */ | 644 | /* Power down the LNPGA */ |
644 | reg = (1 << PMA_PMD_LNPGA_POWERDOWN_LBN); | 645 | reg = (1 << PMA_PMD_LNPGA_POWERDOWN_LBN); |
645 | mdio_clause45_write(efx, efx->mii.phy_id, MDIO_MMD_PMAPMD, | 646 | mdio_clause45_write(efx, efx->mii.phy_id, MDIO_MMD_PMAPMD, |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index 4acd41a093ad..be4465bc0a69 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -389,6 +389,7 @@ static const struct net_device_ops sis900_netdev_ops = { | |||
389 | .ndo_set_multicast_list = set_rx_mode, | 389 | .ndo_set_multicast_list = set_rx_mode, |
390 | .ndo_change_mtu = eth_change_mtu, | 390 | .ndo_change_mtu = eth_change_mtu, |
391 | .ndo_validate_addr = eth_validate_addr, | 391 | .ndo_validate_addr = eth_validate_addr, |
392 | .ndo_set_mac_address = eth_mac_addr, | ||
392 | .ndo_do_ioctl = mii_ioctl, | 393 | .ndo_do_ioctl = mii_ioctl, |
393 | .ndo_tx_timeout = sis900_tx_timeout, | 394 | .ndo_tx_timeout = sis900_tx_timeout, |
394 | #ifdef CONFIG_NET_POLL_CONTROLLER | 395 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -508,10 +509,10 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, | |||
508 | else | 509 | else |
509 | ret = sis900_get_mac_addr(pci_dev, net_dev); | 510 | ret = sis900_get_mac_addr(pci_dev, net_dev); |
510 | 511 | ||
511 | if (ret == 0) { | 512 | if (!ret || !is_valid_ether_addr(net_dev->dev_addr)) { |
512 | printk(KERN_WARNING "%s: Cannot read MAC address.\n", dev_name); | 513 | random_ether_addr(net_dev->dev_addr); |
513 | ret = -ENODEV; | 514 | printk(KERN_WARNING "%s: Unreadable or invalid MAC address," |
514 | goto err_unmap_rx; | 515 | "using random generated one\n", dev_name); |
515 | } | 516 | } |
516 | 517 | ||
517 | /* 630ET : set the mii access mode as software-mode */ | 518 | /* 630ET : set the mii access mode as software-mode */ |
diff --git a/drivers/net/smc-mca.c b/drivers/net/smc-mca.c index 404b80e5ba11..8d36d40649ef 100644 --- a/drivers/net/smc-mca.c +++ b/drivers/net/smc-mca.c | |||
@@ -192,6 +192,7 @@ static const struct net_device_ops ultramca_netdev_ops = { | |||
192 | .ndo_get_stats = ei_get_stats, | 192 | .ndo_get_stats = ei_get_stats, |
193 | .ndo_set_multicast_list = ei_set_multicast_list, | 193 | .ndo_set_multicast_list = ei_set_multicast_list, |
194 | .ndo_validate_addr = eth_validate_addr, | 194 | .ndo_validate_addr = eth_validate_addr, |
195 | .ndo_set_mac_address = eth_mac_addr, | ||
195 | .ndo_change_mtu = eth_change_mtu, | 196 | .ndo_change_mtu = eth_change_mtu, |
196 | #ifdef CONFIG_NET_POLL_CONTROLLER | 197 | #ifdef CONFIG_NET_POLL_CONTROLLER |
197 | .ndo_poll_controller = ei_poll, | 198 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c index b3866089a206..2033fee3143a 100644 --- a/drivers/net/smc-ultra.c +++ b/drivers/net/smc-ultra.c | |||
@@ -196,6 +196,7 @@ static const struct net_device_ops ultra_netdev_ops = { | |||
196 | .ndo_get_stats = ei_get_stats, | 196 | .ndo_get_stats = ei_get_stats, |
197 | .ndo_set_multicast_list = ei_set_multicast_list, | 197 | .ndo_set_multicast_list = ei_set_multicast_list, |
198 | .ndo_validate_addr = eth_validate_addr, | 198 | .ndo_validate_addr = eth_validate_addr, |
199 | .ndo_set_mac_address = eth_mac_addr, | ||
199 | .ndo_change_mtu = eth_change_mtu, | 200 | .ndo_change_mtu = eth_change_mtu, |
200 | #ifdef CONFIG_NET_POLL_CONTROLLER | 201 | #ifdef CONFIG_NET_POLL_CONTROLLER |
201 | .ndo_poll_controller = ei_poll, | 202 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index dc3f1108884d..f513bdf1c887 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -144,6 +144,7 @@ static inline u32 smsc911x_reg_read(struct smsc911x_data *pdata, u32 reg) | |||
144 | } | 144 | } |
145 | 145 | ||
146 | BUG(); | 146 | BUG(); |
147 | return 0; | ||
147 | } | 148 | } |
148 | 149 | ||
149 | static inline void smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg, | 150 | static inline void smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg, |
@@ -1740,6 +1741,7 @@ static const struct net_device_ops smsc911x_netdev_ops = { | |||
1740 | .ndo_set_multicast_list = smsc911x_set_multicast_list, | 1741 | .ndo_set_multicast_list = smsc911x_set_multicast_list, |
1741 | .ndo_do_ioctl = smsc911x_do_ioctl, | 1742 | .ndo_do_ioctl = smsc911x_do_ioctl, |
1742 | .ndo_validate_addr = eth_validate_addr, | 1743 | .ndo_validate_addr = eth_validate_addr, |
1744 | .ndo_set_mac_address = eth_mac_addr, | ||
1743 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1745 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1744 | .ndo_poll_controller = smsc911x_poll_controller, | 1746 | .ndo_poll_controller = smsc911x_poll_controller, |
1745 | #endif | 1747 | #endif |
@@ -1967,7 +1969,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | |||
1967 | smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF); | 1969 | smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF); |
1968 | 1970 | ||
1969 | retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED, | 1971 | retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED, |
1970 | SMSC_CHIPNAME, dev); | 1972 | dev->name, dev); |
1971 | if (retval) { | 1973 | if (retval) { |
1972 | SMSC_WARNING(PROBE, | 1974 | SMSC_WARNING(PROBE, |
1973 | "Unable to claim requested irq: %d", dev->irq); | 1975 | "Unable to claim requested irq: %d", dev->irq); |
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c index 27e017d96966..c14a4c6452c7 100644 --- a/drivers/net/smsc9420.c +++ b/drivers/net/smsc9420.c | |||
@@ -1551,6 +1551,7 @@ static const struct net_device_ops smsc9420_netdev_ops = { | |||
1551 | .ndo_set_multicast_list = smsc9420_set_multicast_list, | 1551 | .ndo_set_multicast_list = smsc9420_set_multicast_list, |
1552 | .ndo_do_ioctl = smsc9420_do_ioctl, | 1552 | .ndo_do_ioctl = smsc9420_do_ioctl, |
1553 | .ndo_validate_addr = eth_validate_addr, | 1553 | .ndo_validate_addr = eth_validate_addr, |
1554 | .ndo_set_mac_address = eth_mac_addr, | ||
1554 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1555 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1555 | .ndo_poll_controller = smsc9420_poll_controller, | 1556 | .ndo_poll_controller = smsc9420_poll_controller, |
1556 | #endif /* CONFIG_NET_POLL_CONTROLLER */ | 1557 | #endif /* CONFIG_NET_POLL_CONTROLLER */ |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 7d5a1303e30d..11441225bf41 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -442,40 +442,30 @@ static void magic_packet_detection_enable(struct ucc_geth_private *ugeth) | |||
442 | { | 442 | { |
443 | struct ucc_fast_private *uccf; | 443 | struct ucc_fast_private *uccf; |
444 | struct ucc_geth __iomem *ug_regs; | 444 | struct ucc_geth __iomem *ug_regs; |
445 | u32 maccfg2, uccm; | ||
446 | 445 | ||
447 | uccf = ugeth->uccf; | 446 | uccf = ugeth->uccf; |
448 | ug_regs = ugeth->ug_regs; | 447 | ug_regs = ugeth->ug_regs; |
449 | 448 | ||
450 | /* Enable interrupts for magic packet detection */ | 449 | /* Enable interrupts for magic packet detection */ |
451 | uccm = in_be32(uccf->p_uccm); | 450 | setbits32(uccf->p_uccm, UCC_GETH_UCCE_MPD); |
452 | uccm |= UCCE_MPD; | ||
453 | out_be32(uccf->p_uccm, uccm); | ||
454 | 451 | ||
455 | /* Enable magic packet detection */ | 452 | /* Enable magic packet detection */ |
456 | maccfg2 = in_be32(&ug_regs->maccfg2); | 453 | setbits32(&ug_regs->maccfg2, MACCFG2_MPE); |
457 | maccfg2 |= MACCFG2_MPE; | ||
458 | out_be32(&ug_regs->maccfg2, maccfg2); | ||
459 | } | 454 | } |
460 | 455 | ||
461 | static void magic_packet_detection_disable(struct ucc_geth_private *ugeth) | 456 | static void magic_packet_detection_disable(struct ucc_geth_private *ugeth) |
462 | { | 457 | { |
463 | struct ucc_fast_private *uccf; | 458 | struct ucc_fast_private *uccf; |
464 | struct ucc_geth __iomem *ug_regs; | 459 | struct ucc_geth __iomem *ug_regs; |
465 | u32 maccfg2, uccm; | ||
466 | 460 | ||
467 | uccf = ugeth->uccf; | 461 | uccf = ugeth->uccf; |
468 | ug_regs = ugeth->ug_regs; | 462 | ug_regs = ugeth->ug_regs; |
469 | 463 | ||
470 | /* Disable interrupts for magic packet detection */ | 464 | /* Disable interrupts for magic packet detection */ |
471 | uccm = in_be32(uccf->p_uccm); | 465 | clrbits32(uccf->p_uccm, UCC_GETH_UCCE_MPD); |
472 | uccm &= ~UCCE_MPD; | ||
473 | out_be32(uccf->p_uccm, uccm); | ||
474 | 466 | ||
475 | /* Disable magic packet detection */ | 467 | /* Disable magic packet detection */ |
476 | maccfg2 = in_be32(&ug_regs->maccfg2); | 468 | clrbits32(&ug_regs->maccfg2, MACCFG2_MPE); |
477 | maccfg2 &= ~MACCFG2_MPE; | ||
478 | out_be32(&ug_regs->maccfg2, maccfg2); | ||
479 | } | 469 | } |
480 | #endif /* MAGIC_PACKET */ | 470 | #endif /* MAGIC_PACKET */ |
481 | 471 | ||
@@ -585,7 +575,8 @@ static void get_statistics(struct ucc_geth_private *ugeth, | |||
585 | 575 | ||
586 | /* Hardware only if user handed pointer and driver actually | 576 | /* Hardware only if user handed pointer and driver actually |
587 | gathers hardware statistics */ | 577 | gathers hardware statistics */ |
588 | if (hardware_statistics && (in_be32(&uf_regs->upsmr) & UPSMR_HSE)) { | 578 | if (hardware_statistics && |
579 | (in_be32(&uf_regs->upsmr) & UCC_GETH_UPSMR_HSE)) { | ||
589 | hardware_statistics->tx64 = in_be32(&ug_regs->tx64); | 580 | hardware_statistics->tx64 = in_be32(&ug_regs->tx64); |
590 | hardware_statistics->tx127 = in_be32(&ug_regs->tx127); | 581 | hardware_statistics->tx127 = in_be32(&ug_regs->tx127); |
591 | hardware_statistics->tx255 = in_be32(&ug_regs->tx255); | 582 | hardware_statistics->tx255 = in_be32(&ug_regs->tx255); |
@@ -1181,9 +1172,7 @@ int init_flow_control_params(u32 automatic_flow_control_mode, | |||
1181 | out_be32(uempr_register, value); | 1172 | out_be32(uempr_register, value); |
1182 | 1173 | ||
1183 | /* Set UPSMR register */ | 1174 | /* Set UPSMR register */ |
1184 | value = in_be32(upsmr_register); | 1175 | setbits32(upsmr_register, automatic_flow_control_mode); |
1185 | value |= automatic_flow_control_mode; | ||
1186 | out_be32(upsmr_register, value); | ||
1187 | 1176 | ||
1188 | value = in_be32(maccfg1_register); | 1177 | value = in_be32(maccfg1_register); |
1189 | if (rx_flow_control_enable) | 1178 | if (rx_flow_control_enable) |
@@ -1200,14 +1189,11 @@ static int init_hw_statistics_gathering_mode(int enable_hardware_statistics, | |||
1200 | u32 __iomem *upsmr_register, | 1189 | u32 __iomem *upsmr_register, |
1201 | u16 __iomem *uescr_register) | 1190 | u16 __iomem *uescr_register) |
1202 | { | 1191 | { |
1203 | u32 upsmr_value = 0; | ||
1204 | u16 uescr_value = 0; | 1192 | u16 uescr_value = 0; |
1193 | |||
1205 | /* Enable hardware statistics gathering if requested */ | 1194 | /* Enable hardware statistics gathering if requested */ |
1206 | if (enable_hardware_statistics) { | 1195 | if (enable_hardware_statistics) |
1207 | upsmr_value = in_be32(upsmr_register); | 1196 | setbits32(upsmr_register, UCC_GETH_UPSMR_HSE); |
1208 | upsmr_value |= UPSMR_HSE; | ||
1209 | out_be32(upsmr_register, upsmr_value); | ||
1210 | } | ||
1211 | 1197 | ||
1212 | /* Clear hardware statistics counters */ | 1198 | /* Clear hardware statistics counters */ |
1213 | uescr_value = in_be16(uescr_register); | 1199 | uescr_value = in_be16(uescr_register); |
@@ -1233,23 +1219,17 @@ static int init_firmware_statistics_gathering_mode(int | |||
1233 | { | 1219 | { |
1234 | /* Note: this function does not check if */ | 1220 | /* Note: this function does not check if */ |
1235 | /* the parameters it receives are NULL */ | 1221 | /* the parameters it receives are NULL */ |
1236 | u16 temoder_value; | ||
1237 | u32 remoder_value; | ||
1238 | 1222 | ||
1239 | if (enable_tx_firmware_statistics) { | 1223 | if (enable_tx_firmware_statistics) { |
1240 | out_be32(tx_rmon_base_ptr, | 1224 | out_be32(tx_rmon_base_ptr, |
1241 | tx_firmware_statistics_structure_address); | 1225 | tx_firmware_statistics_structure_address); |
1242 | temoder_value = in_be16(temoder_register); | 1226 | setbits16(temoder_register, TEMODER_TX_RMON_STATISTICS_ENABLE); |
1243 | temoder_value |= TEMODER_TX_RMON_STATISTICS_ENABLE; | ||
1244 | out_be16(temoder_register, temoder_value); | ||
1245 | } | 1227 | } |
1246 | 1228 | ||
1247 | if (enable_rx_firmware_statistics) { | 1229 | if (enable_rx_firmware_statistics) { |
1248 | out_be32(rx_rmon_base_ptr, | 1230 | out_be32(rx_rmon_base_ptr, |
1249 | rx_firmware_statistics_structure_address); | 1231 | rx_firmware_statistics_structure_address); |
1250 | remoder_value = in_be32(remoder_register); | 1232 | setbits32(remoder_register, REMODER_RX_RMON_STATISTICS_ENABLE); |
1251 | remoder_value |= REMODER_RX_RMON_STATISTICS_ENABLE; | ||
1252 | out_be32(remoder_register, remoder_value); | ||
1253 | } | 1233 | } |
1254 | 1234 | ||
1255 | return 0; | 1235 | return 0; |
@@ -1316,15 +1296,12 @@ static int init_check_frame_length_mode(int length_check, | |||
1316 | static int init_preamble_length(u8 preamble_length, | 1296 | static int init_preamble_length(u8 preamble_length, |
1317 | u32 __iomem *maccfg2_register) | 1297 | u32 __iomem *maccfg2_register) |
1318 | { | 1298 | { |
1319 | u32 value = 0; | ||
1320 | |||
1321 | if ((preamble_length < 3) || (preamble_length > 7)) | 1299 | if ((preamble_length < 3) || (preamble_length > 7)) |
1322 | return -EINVAL; | 1300 | return -EINVAL; |
1323 | 1301 | ||
1324 | value = in_be32(maccfg2_register); | 1302 | clrsetbits_be32(maccfg2_register, MACCFG2_PREL_MASK, |
1325 | value &= ~MACCFG2_PREL_MASK; | 1303 | preamble_length << MACCFG2_PREL_SHIFT); |
1326 | value |= (preamble_length << MACCFG2_PREL_SHIFT); | 1304 | |
1327 | out_be32(maccfg2_register, value); | ||
1328 | return 0; | 1305 | return 0; |
1329 | } | 1306 | } |
1330 | 1307 | ||
@@ -1337,19 +1314,19 @@ static int init_rx_parameters(int reject_broadcast, | |||
1337 | value = in_be32(upsmr_register); | 1314 | value = in_be32(upsmr_register); |
1338 | 1315 | ||
1339 | if (reject_broadcast) | 1316 | if (reject_broadcast) |
1340 | value |= UPSMR_BRO; | 1317 | value |= UCC_GETH_UPSMR_BRO; |
1341 | else | 1318 | else |
1342 | value &= ~UPSMR_BRO; | 1319 | value &= ~UCC_GETH_UPSMR_BRO; |
1343 | 1320 | ||
1344 | if (receive_short_frames) | 1321 | if (receive_short_frames) |
1345 | value |= UPSMR_RSH; | 1322 | value |= UCC_GETH_UPSMR_RSH; |
1346 | else | 1323 | else |
1347 | value &= ~UPSMR_RSH; | 1324 | value &= ~UCC_GETH_UPSMR_RSH; |
1348 | 1325 | ||
1349 | if (promiscuous) | 1326 | if (promiscuous) |
1350 | value |= UPSMR_PRO; | 1327 | value |= UCC_GETH_UPSMR_PRO; |
1351 | else | 1328 | else |
1352 | value &= ~UPSMR_PRO; | 1329 | value &= ~UCC_GETH_UPSMR_PRO; |
1353 | 1330 | ||
1354 | out_be32(upsmr_register, value); | 1331 | out_be32(upsmr_register, value); |
1355 | 1332 | ||
@@ -1410,26 +1387,27 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth) | |||
1410 | 1387 | ||
1411 | /* Set UPSMR */ | 1388 | /* Set UPSMR */ |
1412 | upsmr = in_be32(&uf_regs->upsmr); | 1389 | upsmr = in_be32(&uf_regs->upsmr); |
1413 | upsmr &= ~(UPSMR_RPM | UPSMR_R10M | UPSMR_TBIM | UPSMR_RMM); | 1390 | upsmr &= ~(UCC_GETH_UPSMR_RPM | UCC_GETH_UPSMR_R10M | |
1391 | UCC_GETH_UPSMR_TBIM | UCC_GETH_UPSMR_RMM); | ||
1414 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_RMII) || | 1392 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_RMII) || |
1415 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII) || | 1393 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII) || |
1416 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_ID) || | 1394 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_ID) || |
1417 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) || | 1395 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) || |
1418 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || | 1396 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || |
1419 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { | 1397 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { |
1420 | upsmr |= UPSMR_RPM; | 1398 | upsmr |= UCC_GETH_UPSMR_RPM; |
1421 | switch (ugeth->max_speed) { | 1399 | switch (ugeth->max_speed) { |
1422 | case SPEED_10: | 1400 | case SPEED_10: |
1423 | upsmr |= UPSMR_R10M; | 1401 | upsmr |= UCC_GETH_UPSMR_R10M; |
1424 | /* FALLTHROUGH */ | 1402 | /* FALLTHROUGH */ |
1425 | case SPEED_100: | 1403 | case SPEED_100: |
1426 | if (ugeth->phy_interface != PHY_INTERFACE_MODE_RTBI) | 1404 | if (ugeth->phy_interface != PHY_INTERFACE_MODE_RTBI) |
1427 | upsmr |= UPSMR_RMM; | 1405 | upsmr |= UCC_GETH_UPSMR_RMM; |
1428 | } | 1406 | } |
1429 | } | 1407 | } |
1430 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) || | 1408 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) || |
1431 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { | 1409 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { |
1432 | upsmr |= UPSMR_TBIM; | 1410 | upsmr |= UCC_GETH_UPSMR_TBIM; |
1433 | } | 1411 | } |
1434 | out_be32(&uf_regs->upsmr, upsmr); | 1412 | out_be32(&uf_regs->upsmr, upsmr); |
1435 | 1413 | ||
@@ -1517,9 +1495,9 @@ static void adjust_link(struct net_device *dev) | |||
1517 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || | 1495 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || |
1518 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { | 1496 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { |
1519 | if (phydev->speed == SPEED_10) | 1497 | if (phydev->speed == SPEED_10) |
1520 | upsmr |= UPSMR_R10M; | 1498 | upsmr |= UCC_GETH_UPSMR_R10M; |
1521 | else | 1499 | else |
1522 | upsmr &= ~(UPSMR_R10M); | 1500 | upsmr &= ~UCC_GETH_UPSMR_R10M; |
1523 | } | 1501 | } |
1524 | break; | 1502 | break; |
1525 | default: | 1503 | default: |
@@ -1602,10 +1580,8 @@ static int ugeth_graceful_stop_tx(struct ucc_geth_private *ugeth) | |||
1602 | uccf = ugeth->uccf; | 1580 | uccf = ugeth->uccf; |
1603 | 1581 | ||
1604 | /* Mask GRACEFUL STOP TX interrupt bit and clear it */ | 1582 | /* Mask GRACEFUL STOP TX interrupt bit and clear it */ |
1605 | temp = in_be32(uccf->p_uccm); | 1583 | clrbits32(uccf->p_uccm, UCC_GETH_UCCE_GRA); |
1606 | temp &= ~UCCE_GRA; | 1584 | out_be32(uccf->p_ucce, UCC_GETH_UCCE_GRA); /* clear by writing 1 */ |
1607 | out_be32(uccf->p_uccm, temp); | ||
1608 | out_be32(uccf->p_ucce, UCCE_GRA); /* clear by writing 1 */ | ||
1609 | 1585 | ||
1610 | /* Issue host command */ | 1586 | /* Issue host command */ |
1611 | cecr_subblock = | 1587 | cecr_subblock = |
@@ -1617,7 +1593,7 @@ static int ugeth_graceful_stop_tx(struct ucc_geth_private *ugeth) | |||
1617 | do { | 1593 | do { |
1618 | msleep(10); | 1594 | msleep(10); |
1619 | temp = in_be32(uccf->p_ucce); | 1595 | temp = in_be32(uccf->p_ucce); |
1620 | } while (!(temp & UCCE_GRA) && --i); | 1596 | } while (!(temp & UCC_GETH_UCCE_GRA) && --i); |
1621 | 1597 | ||
1622 | uccf->stopped_tx = 1; | 1598 | uccf->stopped_tx = 1; |
1623 | 1599 | ||
@@ -1975,12 +1951,9 @@ static void ucc_geth_set_multi(struct net_device *dev) | |||
1975 | uf_regs = ugeth->uccf->uf_regs; | 1951 | uf_regs = ugeth->uccf->uf_regs; |
1976 | 1952 | ||
1977 | if (dev->flags & IFF_PROMISC) { | 1953 | if (dev->flags & IFF_PROMISC) { |
1978 | 1954 | setbits32(&uf_regs->upsmr, UCC_GETH_UPSMR_PRO); | |
1979 | out_be32(&uf_regs->upsmr, in_be32(&uf_regs->upsmr) | UPSMR_PRO); | ||
1980 | |||
1981 | } else { | 1955 | } else { |
1982 | 1956 | clrbits32(&uf_regs->upsmr, UCC_GETH_UPSMR_PRO); | |
1983 | out_be32(&uf_regs->upsmr, in_be32(&uf_regs->upsmr)&~UPSMR_PRO); | ||
1984 | 1957 | ||
1985 | p_82xx_addr_filt = | 1958 | p_82xx_addr_filt = |
1986 | (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth-> | 1959 | (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth-> |
@@ -2020,7 +1993,6 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth) | |||
2020 | { | 1993 | { |
2021 | struct ucc_geth __iomem *ug_regs = ugeth->ug_regs; | 1994 | struct ucc_geth __iomem *ug_regs = ugeth->ug_regs; |
2022 | struct phy_device *phydev = ugeth->phydev; | 1995 | struct phy_device *phydev = ugeth->phydev; |
2023 | u32 tempval; | ||
2024 | 1996 | ||
2025 | ugeth_vdbg("%s: IN", __func__); | 1997 | ugeth_vdbg("%s: IN", __func__); |
2026 | 1998 | ||
@@ -2037,9 +2009,7 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth) | |||
2037 | out_be32(ugeth->uccf->p_ucce, 0xffffffff); | 2009 | out_be32(ugeth->uccf->p_ucce, 0xffffffff); |
2038 | 2010 | ||
2039 | /* Disable Rx and Tx */ | 2011 | /* Disable Rx and Tx */ |
2040 | tempval = in_be32(&ug_regs->maccfg1); | 2012 | clrbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); |
2041 | tempval &= ~(MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); | ||
2042 | out_be32(&ug_regs->maccfg1, tempval); | ||
2043 | 2013 | ||
2044 | ucc_geth_memclean(ugeth); | 2014 | ucc_geth_memclean(ugeth); |
2045 | } | 2015 | } |
@@ -2153,10 +2123,10 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth) | |||
2153 | /* Generate uccm_mask for receive */ | 2123 | /* Generate uccm_mask for receive */ |
2154 | uf_info->uccm_mask = ug_info->eventRegMask & UCCE_OTHER;/* Errors */ | 2124 | uf_info->uccm_mask = ug_info->eventRegMask & UCCE_OTHER;/* Errors */ |
2155 | for (i = 0; i < ug_info->numQueuesRx; i++) | 2125 | for (i = 0; i < ug_info->numQueuesRx; i++) |
2156 | uf_info->uccm_mask |= (UCCE_RXBF_SINGLE_MASK << i); | 2126 | uf_info->uccm_mask |= (UCC_GETH_UCCE_RXF0 << i); |
2157 | 2127 | ||
2158 | for (i = 0; i < ug_info->numQueuesTx; i++) | 2128 | for (i = 0; i < ug_info->numQueuesTx; i++) |
2159 | uf_info->uccm_mask |= (UCCE_TXBF_SINGLE_MASK << i); | 2129 | uf_info->uccm_mask |= (UCC_GETH_UCCE_TXB0 << i); |
2160 | /* Initialize the general fast UCC block. */ | 2130 | /* Initialize the general fast UCC block. */ |
2161 | if (ucc_fast_init(uf_info, &ugeth->uccf)) { | 2131 | if (ucc_fast_init(uf_info, &ugeth->uccf)) { |
2162 | if (netif_msg_probe(ugeth)) | 2132 | if (netif_msg_probe(ugeth)) |
@@ -2185,7 +2155,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) | |||
2185 | struct ucc_geth __iomem *ug_regs; | 2155 | struct ucc_geth __iomem *ug_regs; |
2186 | int ret_val = -EINVAL; | 2156 | int ret_val = -EINVAL; |
2187 | u32 remoder = UCC_GETH_REMODER_INIT; | 2157 | u32 remoder = UCC_GETH_REMODER_INIT; |
2188 | u32 init_enet_pram_offset, cecr_subblock, command, maccfg1; | 2158 | u32 init_enet_pram_offset, cecr_subblock, command; |
2189 | u32 ifstat, i, j, size, l2qt, l3qt, length; | 2159 | u32 ifstat, i, j, size, l2qt, l3qt, length; |
2190 | u16 temoder = UCC_GETH_TEMODER_INIT; | 2160 | u16 temoder = UCC_GETH_TEMODER_INIT; |
2191 | u16 test; | 2161 | u16 test; |
@@ -2281,10 +2251,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) | |||
2281 | &uf_regs->upsmr, | 2251 | &uf_regs->upsmr, |
2282 | &ug_regs->uempr, &ug_regs->maccfg1); | 2252 | &ug_regs->uempr, &ug_regs->maccfg1); |
2283 | 2253 | ||
2284 | maccfg1 = in_be32(&ug_regs->maccfg1); | 2254 | setbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); |
2285 | maccfg1 |= MACCFG1_ENABLE_RX; | ||
2286 | maccfg1 |= MACCFG1_ENABLE_TX; | ||
2287 | out_be32(&ug_regs->maccfg1, maccfg1); | ||
2288 | 2255 | ||
2289 | /* Set IPGIFG */ | 2256 | /* Set IPGIFG */ |
2290 | /* For more details see the hardware spec. */ | 2257 | /* For more details see the hardware spec. */ |
@@ -3274,7 +3241,6 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ) | |||
3274 | static int ucc_geth_poll(struct napi_struct *napi, int budget) | 3241 | static int ucc_geth_poll(struct napi_struct *napi, int budget) |
3275 | { | 3242 | { |
3276 | struct ucc_geth_private *ugeth = container_of(napi, struct ucc_geth_private, napi); | 3243 | struct ucc_geth_private *ugeth = container_of(napi, struct ucc_geth_private, napi); |
3277 | struct net_device *dev = ugeth->dev; | ||
3278 | struct ucc_geth_info *ug_info; | 3244 | struct ucc_geth_info *ug_info; |
3279 | int howmany, i; | 3245 | int howmany, i; |
3280 | 3246 | ||
@@ -3285,14 +3251,8 @@ static int ucc_geth_poll(struct napi_struct *napi, int budget) | |||
3285 | howmany += ucc_geth_rx(ugeth, i, budget - howmany); | 3251 | howmany += ucc_geth_rx(ugeth, i, budget - howmany); |
3286 | 3252 | ||
3287 | if (howmany < budget) { | 3253 | if (howmany < budget) { |
3288 | struct ucc_fast_private *uccf; | ||
3289 | u32 uccm; | ||
3290 | |||
3291 | netif_rx_complete(napi); | 3254 | netif_rx_complete(napi); |
3292 | uccf = ugeth->uccf; | 3255 | setbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS); |
3293 | uccm = in_be32(uccf->p_uccm); | ||
3294 | uccm |= UCCE_RX_EVENTS; | ||
3295 | out_be32(uccf->p_uccm, uccm); | ||
3296 | } | 3256 | } |
3297 | 3257 | ||
3298 | return howmany; | 3258 | return howmany; |
@@ -3332,7 +3292,7 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info) | |||
3332 | /* Tx event processing */ | 3292 | /* Tx event processing */ |
3333 | if (ucce & UCCE_TX_EVENTS) { | 3293 | if (ucce & UCCE_TX_EVENTS) { |
3334 | spin_lock(&ugeth->lock); | 3294 | spin_lock(&ugeth->lock); |
3335 | tx_mask = UCCE_TXBF_SINGLE_MASK; | 3295 | tx_mask = UCC_GETH_UCCE_TXB0; |
3336 | for (i = 0; i < ug_info->numQueuesTx; i++) { | 3296 | for (i = 0; i < ug_info->numQueuesTx; i++) { |
3337 | if (ucce & tx_mask) | 3297 | if (ucce & tx_mask) |
3338 | ucc_geth_tx(dev, i); | 3298 | ucc_geth_tx(dev, i); |
@@ -3344,12 +3304,10 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info) | |||
3344 | 3304 | ||
3345 | /* Errors and other events */ | 3305 | /* Errors and other events */ |
3346 | if (ucce & UCCE_OTHER) { | 3306 | if (ucce & UCCE_OTHER) { |
3347 | if (ucce & UCCE_BSY) { | 3307 | if (ucce & UCC_GETH_UCCE_BSY) |
3348 | dev->stats.rx_errors++; | 3308 | dev->stats.rx_errors++; |
3349 | } | 3309 | if (ucce & UCC_GETH_UCCE_TXE) |
3350 | if (ucce & UCCE_TXE) { | ||
3351 | dev->stats.tx_errors++; | 3310 | dev->stats.tx_errors++; |
3352 | } | ||
3353 | } | 3311 | } |
3354 | 3312 | ||
3355 | return IRQ_HANDLED; | 3313 | return IRQ_HANDLED; |
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h index d74d2f7cb739..8f699cb773ee 100644 --- a/drivers/net/ucc_geth.h +++ b/drivers/net/ucc_geth.h | |||
@@ -162,92 +162,27 @@ struct ucc_geth { | |||
162 | boundary */ | 162 | boundary */ |
163 | 163 | ||
164 | /* UCC GETH Event Register */ | 164 | /* UCC GETH Event Register */ |
165 | #define UCCE_MPD 0x80000000 /* Magic packet | 165 | #define UCCE_TXB (UCC_GETH_UCCE_TXB7 | UCC_GETH_UCCE_TXB6 | \ |
166 | detection */ | 166 | UCC_GETH_UCCE_TXB5 | UCC_GETH_UCCE_TXB4 | \ |
167 | #define UCCE_SCAR 0x40000000 | 167 | UCC_GETH_UCCE_TXB3 | UCC_GETH_UCCE_TXB2 | \ |
168 | #define UCCE_GRA 0x20000000 /* Tx graceful | 168 | UCC_GETH_UCCE_TXB1 | UCC_GETH_UCCE_TXB0) |
169 | stop | 169 | |
170 | complete */ | 170 | #define UCCE_RXB (UCC_GETH_UCCE_RXB7 | UCC_GETH_UCCE_RXB6 | \ |
171 | #define UCCE_CBPR 0x10000000 | 171 | UCC_GETH_UCCE_RXB5 | UCC_GETH_UCCE_RXB4 | \ |
172 | #define UCCE_BSY 0x08000000 | 172 | UCC_GETH_UCCE_RXB3 | UCC_GETH_UCCE_RXB2 | \ |
173 | #define UCCE_RXC 0x04000000 | 173 | UCC_GETH_UCCE_RXB1 | UCC_GETH_UCCE_RXB0) |
174 | #define UCCE_TXC 0x02000000 | 174 | |
175 | #define UCCE_TXE 0x01000000 | 175 | #define UCCE_RXF (UCC_GETH_UCCE_RXF7 | UCC_GETH_UCCE_RXF6 | \ |
176 | #define UCCE_TXB7 0x00800000 | 176 | UCC_GETH_UCCE_RXF5 | UCC_GETH_UCCE_RXF4 | \ |
177 | #define UCCE_TXB6 0x00400000 | 177 | UCC_GETH_UCCE_RXF3 | UCC_GETH_UCCE_RXF2 | \ |
178 | #define UCCE_TXB5 0x00200000 | 178 | UCC_GETH_UCCE_RXF1 | UCC_GETH_UCCE_RXF0) |
179 | #define UCCE_TXB4 0x00100000 | 179 | |
180 | #define UCCE_TXB3 0x00080000 | 180 | #define UCCE_OTHER (UCC_GETH_UCCE_SCAR | UCC_GETH_UCCE_GRA | \ |
181 | #define UCCE_TXB2 0x00040000 | 181 | UCC_GETH_UCCE_CBPR | UCC_GETH_UCCE_BSY | \ |
182 | #define UCCE_TXB1 0x00020000 | 182 | UCC_GETH_UCCE_RXC | UCC_GETH_UCCE_TXC | UCC_GETH_UCCE_TXE) |
183 | #define UCCE_TXB0 0x00010000 | 183 | |
184 | #define UCCE_RXB7 0x00008000 | 184 | #define UCCE_RX_EVENTS (UCCE_RXF | UCC_GETH_UCCE_BSY) |
185 | #define UCCE_RXB6 0x00004000 | 185 | #define UCCE_TX_EVENTS (UCCE_TXB | UCC_GETH_UCCE_TXE) |
186 | #define UCCE_RXB5 0x00002000 | ||
187 | #define UCCE_RXB4 0x00001000 | ||
188 | #define UCCE_RXB3 0x00000800 | ||
189 | #define UCCE_RXB2 0x00000400 | ||
190 | #define UCCE_RXB1 0x00000200 | ||
191 | #define UCCE_RXB0 0x00000100 | ||
192 | #define UCCE_RXF7 0x00000080 | ||
193 | #define UCCE_RXF6 0x00000040 | ||
194 | #define UCCE_RXF5 0x00000020 | ||
195 | #define UCCE_RXF4 0x00000010 | ||
196 | #define UCCE_RXF3 0x00000008 | ||
197 | #define UCCE_RXF2 0x00000004 | ||
198 | #define UCCE_RXF1 0x00000002 | ||
199 | #define UCCE_RXF0 0x00000001 | ||
200 | |||
201 | #define UCCE_RXBF_SINGLE_MASK (UCCE_RXF0) | ||
202 | #define UCCE_TXBF_SINGLE_MASK (UCCE_TXB0) | ||
203 | |||
204 | #define UCCE_TXB (UCCE_TXB7 | UCCE_TXB6 | UCCE_TXB5 | UCCE_TXB4 |\ | ||
205 | UCCE_TXB3 | UCCE_TXB2 | UCCE_TXB1 | UCCE_TXB0) | ||
206 | #define UCCE_RXB (UCCE_RXB7 | UCCE_RXB6 | UCCE_RXB5 | UCCE_RXB4 |\ | ||
207 | UCCE_RXB3 | UCCE_RXB2 | UCCE_RXB1 | UCCE_RXB0) | ||
208 | #define UCCE_RXF (UCCE_RXF7 | UCCE_RXF6 | UCCE_RXF5 | UCCE_RXF4 |\ | ||
209 | UCCE_RXF3 | UCCE_RXF2 | UCCE_RXF1 | UCCE_RXF0) | ||
210 | #define UCCE_OTHER (UCCE_SCAR | UCCE_GRA | UCCE_CBPR | UCCE_BSY |\ | ||
211 | UCCE_RXC | UCCE_TXC | UCCE_TXE) | ||
212 | |||
213 | #define UCCE_RX_EVENTS (UCCE_RXF | UCCE_BSY) | ||
214 | #define UCCE_TX_EVENTS (UCCE_TXB | UCCE_TXE) | ||
215 | |||
216 | /* UCC GETH UPSMR (Protocol Specific Mode Register) */ | ||
217 | #define UPSMR_ECM 0x04000000 /* Enable CAM | ||
218 | Miss or | ||
219 | Enable | ||
220 | Filtering | ||
221 | Miss */ | ||
222 | #define UPSMR_HSE 0x02000000 /* Hardware | ||
223 | Statistics | ||
224 | Enable */ | ||
225 | #define UPSMR_PRO 0x00400000 /* Promiscuous*/ | ||
226 | #define UPSMR_CAP 0x00200000 /* CAM polarity | ||
227 | */ | ||
228 | #define UPSMR_RSH 0x00100000 /* Receive | ||
229 | Short Frames | ||
230 | */ | ||
231 | #define UPSMR_RPM 0x00080000 /* Reduced Pin | ||
232 | Mode | ||
233 | interfaces */ | ||
234 | #define UPSMR_R10M 0x00040000 /* RGMII/RMII | ||
235 | 10 Mode */ | ||
236 | #define UPSMR_RLPB 0x00020000 /* RMII | ||
237 | Loopback | ||
238 | Mode */ | ||
239 | #define UPSMR_TBIM 0x00010000 /* Ten-bit | ||
240 | Interface | ||
241 | Mode */ | ||
242 | #define UPSMR_RMM 0x00001000 /* RMII/RGMII | ||
243 | Mode */ | ||
244 | #define UPSMR_CAM 0x00000400 /* CAM Address | ||
245 | Matching */ | ||
246 | #define UPSMR_BRO 0x00000200 /* Broadcast | ||
247 | Address */ | ||
248 | #define UPSMR_RES1 0x00002000 /* Reserved | ||
249 | feild - must | ||
250 | be 1 */ | ||
251 | 186 | ||
252 | /* UCC GETH MACCFG1 (MAC Configuration 1 Register) */ | 187 | /* UCC GETH MACCFG1 (MAC Configuration 1 Register) */ |
253 | #define MACCFG1_FLOW_RX 0x00000020 /* Flow Control | 188 | #define MACCFG1_FLOW_RX 0x00000020 /* Flow Control |
@@ -945,9 +880,10 @@ struct ucc_geth_hardware_statistics { | |||
945 | #define UCC_GETH_REMODER_INIT 0 /* bits that must be | 880 | #define UCC_GETH_REMODER_INIT 0 /* bits that must be |
946 | set */ | 881 | set */ |
947 | #define UCC_GETH_TEMODER_INIT 0xC000 /* bits that must */ | 882 | #define UCC_GETH_TEMODER_INIT 0xC000 /* bits that must */ |
948 | #define UCC_GETH_UPSMR_INIT (UPSMR_RES1) /* Start value | 883 | |
949 | for this | 884 | /* Initial value for UPSMR */ |
950 | register */ | 885 | #define UCC_GETH_UPSMR_INIT UCC_GETH_UPSMR_RES1 |
886 | |||
951 | #define UCC_GETH_MACCFG1_INIT 0 | 887 | #define UCC_GETH_MACCFG1_INIT 0 |
952 | #define UCC_GETH_MACCFG2_INIT (MACCFG2_RESERVED_1) | 888 | #define UCC_GETH_MACCFG2_INIT (MACCFG2_RESERVED_1) |
953 | 889 | ||
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index c4918b86ed19..0d0fa91c0251 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -1297,6 +1297,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) | |||
1297 | /* setup */ | 1297 | /* setup */ |
1298 | spin_lock_irq(&serial->serial_lock); | 1298 | spin_lock_irq(&serial->serial_lock); |
1299 | tty->driver_data = serial; | 1299 | tty->driver_data = serial; |
1300 | tty_kref_put(serial->tty); | ||
1300 | serial->tty = tty_kref_get(tty); | 1301 | serial->tty = tty_kref_get(tty); |
1301 | spin_unlock_irq(&serial->serial_lock); | 1302 | spin_unlock_irq(&serial->serial_lock); |
1302 | 1303 | ||
@@ -1792,8 +1793,8 @@ static int mux_device_request(struct hso_serial *serial, u8 type, u16 port, | |||
1792 | 1793 | ||
1793 | /* initialize */ | 1794 | /* initialize */ |
1794 | ctrl_req->wValue = 0; | 1795 | ctrl_req->wValue = 0; |
1795 | ctrl_req->wIndex = hso_port_to_mux(port); | 1796 | ctrl_req->wIndex = cpu_to_le16(hso_port_to_mux(port)); |
1796 | ctrl_req->wLength = size; | 1797 | ctrl_req->wLength = cpu_to_le16(size); |
1797 | 1798 | ||
1798 | if (type == USB_CDC_GET_ENCAPSULATED_RESPONSE) { | 1799 | if (type == USB_CDC_GET_ENCAPSULATED_RESPONSE) { |
1799 | /* Reading command */ | 1800 | /* Reading command */ |
@@ -2043,9 +2044,8 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial) | |||
2043 | return -2; | 2044 | return -2; |
2044 | } | 2045 | } |
2045 | 2046 | ||
2046 | spin_lock(&serial->serial_lock); | 2047 | /* All callers to put_rxbuf_data hold serial_lock */ |
2047 | tty = tty_kref_get(serial->tty); | 2048 | tty = tty_kref_get(serial->tty); |
2048 | spin_unlock(&serial->serial_lock); | ||
2049 | 2049 | ||
2050 | /* Push data to tty */ | 2050 | /* Push data to tty */ |
2051 | if (tty) { | 2051 | if (tty) { |
@@ -2053,8 +2053,10 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial) | |||
2053 | serial->curr_rx_urb_offset; | 2053 | serial->curr_rx_urb_offset; |
2054 | D1("data to push to tty"); | 2054 | D1("data to push to tty"); |
2055 | while (write_length_remaining) { | 2055 | while (write_length_remaining) { |
2056 | if (test_bit(TTY_THROTTLED, &tty->flags)) | 2056 | if (test_bit(TTY_THROTTLED, &tty->flags)) { |
2057 | tty_kref_put(tty); | ||
2057 | return -1; | 2058 | return -1; |
2059 | } | ||
2058 | curr_write_len = tty_insert_flip_string | 2060 | curr_write_len = tty_insert_flip_string |
2059 | (tty, urb->transfer_buffer + | 2061 | (tty, urb->transfer_buffer + |
2060 | serial->curr_rx_urb_offset, | 2062 | serial->curr_rx_urb_offset, |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index ac07cc6e3cb2..3b8e63254277 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -622,6 +622,7 @@ static const struct net_device_ops rhine_netdev_ops = { | |||
622 | .ndo_get_stats = rhine_get_stats, | 622 | .ndo_get_stats = rhine_get_stats, |
623 | .ndo_set_multicast_list = rhine_set_rx_mode, | 623 | .ndo_set_multicast_list = rhine_set_rx_mode, |
624 | .ndo_validate_addr = eth_validate_addr, | 624 | .ndo_validate_addr = eth_validate_addr, |
625 | .ndo_set_mac_address = eth_mac_addr, | ||
625 | .ndo_do_ioctl = netdev_ioctl, | 626 | .ndo_do_ioctl = netdev_ioctl, |
626 | .ndo_tx_timeout = rhine_tx_timeout, | 627 | .ndo_tx_timeout = rhine_tx_timeout, |
627 | #ifdef CONFIG_NET_POLL_CONTROLLER | 628 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 58e25d090ae0..a75f91dc3153 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -855,6 +855,7 @@ static const struct net_device_ops velocity_netdev_ops = { | |||
855 | .ndo_start_xmit = velocity_xmit, | 855 | .ndo_start_xmit = velocity_xmit, |
856 | .ndo_get_stats = velocity_get_stats, | 856 | .ndo_get_stats = velocity_get_stats, |
857 | .ndo_validate_addr = eth_validate_addr, | 857 | .ndo_validate_addr = eth_validate_addr, |
858 | .ndo_set_mac_address = eth_mac_addr, | ||
858 | .ndo_set_multicast_list = velocity_set_multi, | 859 | .ndo_set_multicast_list = velocity_set_multi, |
859 | .ndo_change_mtu = velocity_change_mtu, | 860 | .ndo_change_mtu = velocity_change_mtu, |
860 | .ndo_do_ioctl = velocity_ioctl, | 861 | .ndo_do_ioctl = velocity_ioctl, |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 2dc241689d37..0dbd85b0162d 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
@@ -622,7 +622,7 @@ static void hss_hdlc_rx_irq(void *pdev) | |||
622 | printk(KERN_DEBUG "%s: hss_hdlc_rx_irq\n", dev->name); | 622 | printk(KERN_DEBUG "%s: hss_hdlc_rx_irq\n", dev->name); |
623 | #endif | 623 | #endif |
624 | qmgr_disable_irq(queue_ids[port->id].rx); | 624 | qmgr_disable_irq(queue_ids[port->id].rx); |
625 | netif_rx_schedule(dev, &port->napi); | 625 | netif_rx_schedule(&port->napi); |
626 | } | 626 | } |
627 | 627 | ||
628 | static int hss_hdlc_poll(struct napi_struct *napi, int budget) | 628 | static int hss_hdlc_poll(struct napi_struct *napi, int budget) |
@@ -651,7 +651,7 @@ static int hss_hdlc_poll(struct napi_struct *napi, int budget) | |||
651 | printk(KERN_DEBUG "%s: hss_hdlc_poll" | 651 | printk(KERN_DEBUG "%s: hss_hdlc_poll" |
652 | " netif_rx_complete\n", dev->name); | 652 | " netif_rx_complete\n", dev->name); |
653 | #endif | 653 | #endif |
654 | netif_rx_complete(dev, napi); | 654 | netif_rx_complete(napi); |
655 | qmgr_enable_irq(rxq); | 655 | qmgr_enable_irq(rxq); |
656 | if (!qmgr_stat_empty(rxq) && | 656 | if (!qmgr_stat_empty(rxq) && |
657 | netif_rx_reschedule(napi)) { | 657 | netif_rx_reschedule(napi)) { |
@@ -1069,7 +1069,7 @@ static int hss_hdlc_open(struct net_device *dev) | |||
1069 | hss_start_hdlc(port); | 1069 | hss_start_hdlc(port); |
1070 | 1070 | ||
1071 | /* we may already have RX data, enables IRQ */ | 1071 | /* we may already have RX data, enables IRQ */ |
1072 | netif_rx_schedule(dev, &port->napi); | 1072 | netif_rx_schedule(&port->napi); |
1073 | return 0; | 1073 | return 0; |
1074 | 1074 | ||
1075 | err_unlock: | 1075 | err_unlock: |
diff --git a/drivers/net/wd.c b/drivers/net/wd.c index 3c1edda08d3d..d8322d2d1e29 100644 --- a/drivers/net/wd.c +++ b/drivers/net/wd.c | |||
@@ -155,6 +155,7 @@ static const struct net_device_ops wd_netdev_ops = { | |||
155 | .ndo_get_stats = ei_get_stats, | 155 | .ndo_get_stats = ei_get_stats, |
156 | .ndo_set_multicast_list = ei_set_multicast_list, | 156 | .ndo_set_multicast_list = ei_set_multicast_list, |
157 | .ndo_validate_addr = eth_validate_addr, | 157 | .ndo_validate_addr = eth_validate_addr, |
158 | .ndo_set_mac_address = eth_mac_addr, | ||
158 | .ndo_change_mtu = eth_change_mtu, | 159 | .ndo_change_mtu = eth_change_mtu, |
159 | #ifdef CONFIG_NET_POLL_CONTROLLER | 160 | #ifdef CONFIG_NET_POLL_CONTROLLER |
160 | .ndo_poll_controller = ei_poll, | 161 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index ea543fcf2687..e4f9f747de88 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -111,7 +111,7 @@ config WLAN_80211 | |||
111 | lets you choose drivers. | 111 | lets you choose drivers. |
112 | 112 | ||
113 | config PCMCIA_RAYCS | 113 | config PCMCIA_RAYCS |
114 | tristate "Aviator/Raytheon 2.4MHz wireless support" | 114 | tristate "Aviator/Raytheon 2.4GHz wireless support" |
115 | depends on PCMCIA && WLAN_80211 | 115 | depends on PCMCIA && WLAN_80211 |
116 | select WIRELESS_EXT | 116 | select WIRELESS_EXT |
117 | ---help--- | 117 | ---help--- |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 4af2607deec0..8ef87356e083 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -2644,7 +2644,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2644 | if (skb_headroom(skb) < padsize) { | 2644 | if (skb_headroom(skb) < padsize) { |
2645 | ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough" | 2645 | ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough" |
2646 | " headroom to pad %d\n", hdrlen, padsize); | 2646 | " headroom to pad %d\n", hdrlen, padsize); |
2647 | return -1; | 2647 | return NETDEV_TX_BUSY; |
2648 | } | 2648 | } |
2649 | skb_push(skb, padsize); | 2649 | skb_push(skb, padsize); |
2650 | memmove(skb->data, skb->data+padsize, hdrlen); | 2650 | memmove(skb->data, skb->data+padsize, hdrlen); |
@@ -2655,7 +2655,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2655 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); | 2655 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); |
2656 | spin_unlock_irqrestore(&sc->txbuflock, flags); | 2656 | spin_unlock_irqrestore(&sc->txbuflock, flags); |
2657 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); | 2657 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); |
2658 | return -1; | 2658 | return NETDEV_TX_BUSY; |
2659 | } | 2659 | } |
2660 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); | 2660 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); |
2661 | list_del(&bf->list); | 2661 | list_del(&bf->list); |
@@ -2673,10 +2673,10 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2673 | sc->txbuf_len++; | 2673 | sc->txbuf_len++; |
2674 | spin_unlock_irqrestore(&sc->txbuflock, flags); | 2674 | spin_unlock_irqrestore(&sc->txbuflock, flags); |
2675 | dev_kfree_skb_any(skb); | 2675 | dev_kfree_skb_any(skb); |
2676 | return 0; | 2676 | return NETDEV_TX_OK; |
2677 | } | 2677 | } |
2678 | 2678 | ||
2679 | return 0; | 2679 | return NETDEV_TX_OK; |
2680 | } | 2680 | } |
2681 | 2681 | ||
2682 | static int | 2682 | static int |
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c index 0cac05c6a9ce..75eb9f43c741 100644 --- a/drivers/net/wireless/ath5k/pcu.c +++ b/drivers/net/wireless/ath5k/pcu.c | |||
@@ -65,7 +65,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah) | |||
65 | if (ah->ah_version == AR5K_AR5210) | 65 | if (ah->ah_version == AR5K_AR5210) |
66 | pcu_reg |= AR5K_STA_ID1_NO_PSPOLL; | 66 | pcu_reg |= AR5K_STA_ID1_NO_PSPOLL; |
67 | else | 67 | else |
68 | AR5K_REG_DISABLE_BITS(ah, AR5K_CFG, AR5K_CFG_ADHOC); | 68 | AR5K_REG_ENABLE_BITS(ah, AR5K_CFG, AR5K_CFG_IBSS); |
69 | break; | 69 | break; |
70 | 70 | ||
71 | case NL80211_IFTYPE_AP: | 71 | case NL80211_IFTYPE_AP: |
@@ -75,7 +75,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah) | |||
75 | if (ah->ah_version == AR5K_AR5210) | 75 | if (ah->ah_version == AR5K_AR5210) |
76 | pcu_reg |= AR5K_STA_ID1_NO_PSPOLL; | 76 | pcu_reg |= AR5K_STA_ID1_NO_PSPOLL; |
77 | else | 77 | else |
78 | AR5K_REG_ENABLE_BITS(ah, AR5K_CFG, AR5K_CFG_ADHOC); | 78 | AR5K_REG_DISABLE_BITS(ah, AR5K_CFG, AR5K_CFG_IBSS); |
79 | break; | 79 | break; |
80 | 80 | ||
81 | case NL80211_IFTYPE_STATION: | 81 | case NL80211_IFTYPE_STATION: |
diff --git a/drivers/net/wireless/ath5k/reg.h b/drivers/net/wireless/ath5k/reg.h index 91aaeaf88199..9189ab13286c 100644 --- a/drivers/net/wireless/ath5k/reg.h +++ b/drivers/net/wireless/ath5k/reg.h | |||
@@ -73,7 +73,7 @@ | |||
73 | #define AR5K_CFG_SWRD 0x00000004 /* Byte-swap RX descriptor */ | 73 | #define AR5K_CFG_SWRD 0x00000004 /* Byte-swap RX descriptor */ |
74 | #define AR5K_CFG_SWRB 0x00000008 /* Byte-swap RX buffer */ | 74 | #define AR5K_CFG_SWRB 0x00000008 /* Byte-swap RX buffer */ |
75 | #define AR5K_CFG_SWRG 0x00000010 /* Byte-swap Register access */ | 75 | #define AR5K_CFG_SWRG 0x00000010 /* Byte-swap Register access */ |
76 | #define AR5K_CFG_ADHOC 0x00000020 /* AP/Adhoc indication [5211+] */ | 76 | #define AR5K_CFG_IBSS 0x00000020 /* 0-BSS, 1-IBSS [5211+] */ |
77 | #define AR5K_CFG_PHY_OK 0x00000100 /* [5211+] */ | 77 | #define AR5K_CFG_PHY_OK 0x00000100 /* [5211+] */ |
78 | #define AR5K_CFG_EEBS 0x00000200 /* EEPROM is busy */ | 78 | #define AR5K_CFG_EEBS 0x00000200 /* EEPROM is busy */ |
79 | #define AR5K_CFG_CLKGD 0x00000400 /* Clock gated (Disable dynamic clock) */ | 79 | #define AR5K_CFG_CLKGD 0x00000400 /* Clock gated (Disable dynamic clock) */ |
diff --git a/drivers/net/wireless/ath9k/Kconfig b/drivers/net/wireless/ath9k/Kconfig index c43bd321f97f..90a8dd873786 100644 --- a/drivers/net/wireless/ath9k/Kconfig +++ b/drivers/net/wireless/ath9k/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config ATH9K | 1 | config ATH9K |
2 | tristate "Atheros 802.11n wireless cards support" | 2 | tristate "Atheros 802.11n wireless cards support" |
3 | depends on PCI && MAC80211 && WLAN_80211 | 3 | depends on PCI && MAC80211 && WLAN_80211 |
4 | depends on RFKILL || RFKILL=n | ||
4 | select MAC80211_LEDS | 5 | select MAC80211_LEDS |
5 | select LEDS_CLASS | 6 | select LEDS_CLASS |
6 | select NEW_LEDS | 7 | select NEW_LEDS |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 191eec50dc75..727f067aca4f 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -2164,13 +2164,13 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
2164 | conf->ht.channel_type); | 2164 | conf->ht.channel_type); |
2165 | } | 2165 | } |
2166 | 2166 | ||
2167 | ath_update_chainmask(sc, conf->ht.enabled); | ||
2168 | |||
2167 | if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) { | 2169 | if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) { |
2168 | DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n"); | 2170 | DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n"); |
2169 | mutex_unlock(&sc->mutex); | 2171 | mutex_unlock(&sc->mutex); |
2170 | return -EINVAL; | 2172 | return -EINVAL; |
2171 | } | 2173 | } |
2172 | |||
2173 | ath_update_chainmask(sc, conf->ht.enabled); | ||
2174 | } | 2174 | } |
2175 | 2175 | ||
2176 | if (changed & IEEE80211_CONF_CHANGE_POWER) | 2176 | if (changed & IEEE80211_CONF_CHANGE_POWER) |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 3bfc3b90f256..c92f0c6e4adc 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -126,15 +126,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
126 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 126 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
127 | } | 127 | } |
128 | 128 | ||
129 | tx_info->status.rates[0].count = tx_status->retries; | 129 | tx_info->status.rates[0].count = tx_status->retries + 1; |
130 | if (tx_info->status.rates[0].flags & IEEE80211_TX_RC_MCS) { | ||
131 | /* Change idx from internal table index to MCS index */ | ||
132 | int idx = tx_info->status.rates[0].idx; | ||
133 | struct ath_rate_table *rate_table = sc->cur_rate_table; | ||
134 | if (idx >= 0 && idx < rate_table->rate_cnt) | ||
135 | tx_info->status.rates[0].idx = | ||
136 | rate_table->info[idx].ratecode & 0x7f; | ||
137 | } | ||
138 | 130 | ||
139 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 131 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
140 | padsize = hdrlen & 3; | 132 | padsize = hdrlen & 3; |
@@ -264,25 +256,22 @@ static void assign_aggr_tid_seqno(struct sk_buff *skb, | |||
264 | } | 256 | } |
265 | 257 | ||
266 | /* Get seqno */ | 258 | /* Get seqno */ |
267 | 259 | /* For HT capable stations, we save tidno for later use. | |
268 | if (ieee80211_is_data(fc) && !is_pae(skb)) { | 260 | * We also override seqno set by upper layer with the one |
269 | /* For HT capable stations, we save tidno for later use. | 261 | * in tx aggregation state. |
270 | * We also override seqno set by upper layer with the one | 262 | * |
271 | * in tx aggregation state. | 263 | * If fragmentation is on, the sequence number is |
272 | * | 264 | * not overridden, since it has been |
273 | * If fragmentation is on, the sequence number is | 265 | * incremented by the fragmentation routine. |
274 | * not overridden, since it has been | 266 | * |
275 | * incremented by the fragmentation routine. | 267 | * FIXME: check if the fragmentation threshold exceeds |
276 | * | 268 | * IEEE80211 max. |
277 | * FIXME: check if the fragmentation threshold exceeds | 269 | */ |
278 | * IEEE80211 max. | 270 | tid = ATH_AN_2_TID(an, bf->bf_tidno); |
279 | */ | 271 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << |
280 | tid = ATH_AN_2_TID(an, bf->bf_tidno); | 272 | IEEE80211_SEQ_SEQ_SHIFT); |
281 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << | 273 | bf->bf_seqno = tid->seq_next; |
282 | IEEE80211_SEQ_SEQ_SHIFT); | 274 | INCR(tid->seq_next, IEEE80211_SEQ_MAX); |
283 | bf->bf_seqno = tid->seq_next; | ||
284 | INCR(tid->seq_next, IEEE80211_SEQ_MAX); | ||
285 | } | ||
286 | } | 275 | } |
287 | 276 | ||
288 | static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb, | 277 | static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb, |
@@ -1718,11 +1707,10 @@ static int ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf, | |||
1718 | 1707 | ||
1719 | /* Assign seqno, tidno */ | 1708 | /* Assign seqno, tidno */ |
1720 | 1709 | ||
1721 | if (bf_isht(bf) && (sc->sc_flags & SC_OP_TXAGGR)) | 1710 | if (ieee80211_is_data_qos(fc) && (sc->sc_flags & SC_OP_TXAGGR)) |
1722 | assign_aggr_tid_seqno(skb, bf); | 1711 | assign_aggr_tid_seqno(skb, bf); |
1723 | 1712 | ||
1724 | /* DMA setup */ | 1713 | /* DMA setup */ |
1725 | |||
1726 | bf->bf_mpdu = skb; | 1714 | bf->bf_mpdu = skb; |
1727 | 1715 | ||
1728 | bf->bf_dmacontext = pci_map_single(sc->pdev, skb->data, | 1716 | bf->bf_dmacontext = pci_map_single(sc->pdev, skb->data, |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 7b31a327b24a..c788bad10661 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -3261,7 +3261,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan) | |||
3261 | struct b43_wldev *down_dev; | 3261 | struct b43_wldev *down_dev; |
3262 | struct b43_wldev *d; | 3262 | struct b43_wldev *d; |
3263 | int err; | 3263 | int err; |
3264 | bool gmode; | 3264 | bool uninitialized_var(gmode); |
3265 | int prev_status; | 3265 | int prev_status; |
3266 | 3266 | ||
3267 | /* Find a device and PHY which supports the band. */ | 3267 | /* Find a device and PHY which supports the band. */ |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index c1324e31d2f6..fb996c27a19b 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2465,7 +2465,7 @@ static void b43legacy_put_phy_into_reset(struct b43legacy_wldev *dev) | |||
2465 | static int b43legacy_switch_phymode(struct b43legacy_wl *wl, | 2465 | static int b43legacy_switch_phymode(struct b43legacy_wl *wl, |
2466 | unsigned int new_mode) | 2466 | unsigned int new_mode) |
2467 | { | 2467 | { |
2468 | struct b43legacy_wldev *up_dev; | 2468 | struct b43legacy_wldev *uninitialized_var(up_dev); |
2469 | struct b43legacy_wldev *down_dev; | 2469 | struct b43legacy_wldev *down_dev; |
2470 | int err; | 2470 | int err; |
2471 | bool gmode = 0; | 2471 | bool gmode = 0; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 8fdb34222c0a..45cfa1cf194a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -2219,7 +2219,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv) | |||
2219 | /* set tx power value for all OFDM rates */ | 2219 | /* set tx power value for all OFDM rates */ |
2220 | for (rate_index = 0; rate_index < IWL_OFDM_RATES; | 2220 | for (rate_index = 0; rate_index < IWL_OFDM_RATES; |
2221 | rate_index++) { | 2221 | rate_index++) { |
2222 | s32 power_idx; | 2222 | s32 uninitialized_var(power_idx); |
2223 | int rc; | 2223 | int rc; |
2224 | 2224 | ||
2225 | /* use channel group's clip-power table, | 2225 | /* use channel group's clip-power table, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 52966ffbef6e..ba997204c8d4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -255,7 +255,7 @@ struct iwl_cmd_header { | |||
255 | * 0x3) 54 Mbps | 255 | * 0x3) 54 Mbps |
256 | * | 256 | * |
257 | * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"): | 257 | * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"): |
258 | * 3-0: 10) 1 Mbps | 258 | * 6-0: 10) 1 Mbps |
259 | * 20) 2 Mbps | 259 | * 20) 2 Mbps |
260 | * 55) 5.5 Mbps | 260 | * 55) 5.5 Mbps |
261 | * 110) 11 Mbps | 261 | * 110) 11 Mbps |
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c index 01a2169cecec..8c71ad4f88c5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c | |||
@@ -51,6 +51,7 @@ const char *get_cmd_string(u8 cmd) | |||
51 | IWL_CMD(REPLY_REMOVE_STA); | 51 | IWL_CMD(REPLY_REMOVE_STA); |
52 | IWL_CMD(REPLY_REMOVE_ALL_STA); | 52 | IWL_CMD(REPLY_REMOVE_ALL_STA); |
53 | IWL_CMD(REPLY_WEPKEY); | 53 | IWL_CMD(REPLY_WEPKEY); |
54 | IWL_CMD(REPLY_3945_RX); | ||
54 | IWL_CMD(REPLY_TX); | 55 | IWL_CMD(REPLY_TX); |
55 | IWL_CMD(REPLY_RATE_SCALE); | 56 | IWL_CMD(REPLY_RATE_SCALE); |
56 | IWL_CMD(REPLY_LEDS_CMD); | 57 | IWL_CMD(REPLY_LEDS_CMD); |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 3dba83679444..4e0007d20030 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -1369,7 +1369,7 @@ EXPORT_SYMBOL_GPL(lbs_start_card); | |||
1369 | 1369 | ||
1370 | void lbs_stop_card(struct lbs_private *priv) | 1370 | void lbs_stop_card(struct lbs_private *priv) |
1371 | { | 1371 | { |
1372 | struct net_device *dev = priv->dev; | 1372 | struct net_device *dev; |
1373 | struct cmd_ctrl_node *cmdnode; | 1373 | struct cmd_ctrl_node *cmdnode; |
1374 | unsigned long flags; | 1374 | unsigned long flags; |
1375 | 1375 | ||
@@ -1377,9 +1377,10 @@ void lbs_stop_card(struct lbs_private *priv) | |||
1377 | 1377 | ||
1378 | if (!priv) | 1378 | if (!priv) |
1379 | goto out; | 1379 | goto out; |
1380 | dev = priv->dev; | ||
1380 | 1381 | ||
1381 | netif_stop_queue(priv->dev); | 1382 | netif_stop_queue(dev); |
1382 | netif_carrier_off(priv->dev); | 1383 | netif_carrier_off(dev); |
1383 | 1384 | ||
1384 | lbs_debugfs_remove_one(priv); | 1385 | lbs_debugfs_remove_one(priv); |
1385 | if (priv->mesh_tlv) { | 1386 | if (priv->mesh_tlv) { |
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c index d1fc305de5fe..e7289e2e7f16 100644 --- a/drivers/net/wireless/libertas_tf/main.c +++ b/drivers/net/wireless/libertas_tf/main.c | |||
@@ -206,7 +206,7 @@ static int lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
206 | * there are no buffered multicast frames to send | 206 | * there are no buffered multicast frames to send |
207 | */ | 207 | */ |
208 | ieee80211_stop_queues(priv->hw); | 208 | ieee80211_stop_queues(priv->hw); |
209 | return 0; | 209 | return NETDEV_TX_OK; |
210 | } | 210 | } |
211 | 211 | ||
212 | static void lbtf_tx_work(struct work_struct *work) | 212 | static void lbtf_tx_work(struct work_struct *work) |
diff --git a/drivers/net/wireless/orinoco/orinoco.c b/drivers/net/wireless/orinoco/orinoco.c index bc84e2792f8a..c3bb85e0251e 100644 --- a/drivers/net/wireless/orinoco/orinoco.c +++ b/drivers/net/wireless/orinoco/orinoco.c | |||
@@ -1610,6 +1610,16 @@ static void orinoco_rx_isr_tasklet(unsigned long data) | |||
1610 | struct orinoco_rx_data *rx_data, *temp; | 1610 | struct orinoco_rx_data *rx_data, *temp; |
1611 | struct hermes_rx_descriptor *desc; | 1611 | struct hermes_rx_descriptor *desc; |
1612 | struct sk_buff *skb; | 1612 | struct sk_buff *skb; |
1613 | unsigned long flags; | ||
1614 | |||
1615 | /* orinoco_rx requires the driver lock, and we also need to | ||
1616 | * protect priv->rx_list, so just hold the lock over the | ||
1617 | * lot. | ||
1618 | * | ||
1619 | * If orinoco_lock fails, we've unplugged the card. In this | ||
1620 | * case just abort. */ | ||
1621 | if (orinoco_lock(priv, &flags) != 0) | ||
1622 | return; | ||
1613 | 1623 | ||
1614 | /* extract desc and skb from queue */ | 1624 | /* extract desc and skb from queue */ |
1615 | list_for_each_entry_safe(rx_data, temp, &priv->rx_list, list) { | 1625 | list_for_each_entry_safe(rx_data, temp, &priv->rx_list, list) { |
@@ -1622,6 +1632,8 @@ static void orinoco_rx_isr_tasklet(unsigned long data) | |||
1622 | 1632 | ||
1623 | kfree(desc); | 1633 | kfree(desc); |
1624 | } | 1634 | } |
1635 | |||
1636 | orinoco_unlock(priv, &flags); | ||
1625 | } | 1637 | } |
1626 | 1638 | ||
1627 | /********************************************************************/ | 1639 | /********************************************************************/ |
@@ -3645,12 +3657,22 @@ struct net_device | |||
3645 | void free_orinocodev(struct net_device *dev) | 3657 | void free_orinocodev(struct net_device *dev) |
3646 | { | 3658 | { |
3647 | struct orinoco_private *priv = netdev_priv(dev); | 3659 | struct orinoco_private *priv = netdev_priv(dev); |
3660 | struct orinoco_rx_data *rx_data, *temp; | ||
3648 | 3661 | ||
3649 | /* No need to empty priv->rx_list: if the tasklet is scheduled | 3662 | /* If the tasklet is scheduled when we call tasklet_kill it |
3650 | * when we call tasklet_kill it will run one final time, | 3663 | * will run one final time. However the tasklet will only |
3651 | * emptying the list */ | 3664 | * drain priv->rx_list if the hw is still available. */ |
3652 | tasklet_kill(&priv->rx_tasklet); | 3665 | tasklet_kill(&priv->rx_tasklet); |
3653 | 3666 | ||
3667 | /* Explicitly drain priv->rx_list */ | ||
3668 | list_for_each_entry_safe(rx_data, temp, &priv->rx_list, list) { | ||
3669 | list_del(&rx_data->list); | ||
3670 | |||
3671 | dev_kfree_skb(rx_data->skb); | ||
3672 | kfree(rx_data->desc); | ||
3673 | kfree(rx_data); | ||
3674 | } | ||
3675 | |||
3654 | unregister_pm_notifier(&priv->pm_notifier); | 3676 | unregister_pm_notifier(&priv->pm_notifier); |
3655 | orinoco_uncache_fw(priv); | 3677 | orinoco_uncache_fw(priv); |
3656 | 3678 | ||
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c index f127602670ec..0b32215d3f5d 100644 --- a/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/orinoco/orinoco_cs.c | |||
@@ -435,6 +435,7 @@ static struct pcmcia_device_id orinoco_cs_ids[] = { | |||
435 | PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */ | 435 | PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */ |
436 | PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* AirWay 802.11 Adapter (PCMCIA) */ | 436 | PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* AirWay 802.11 Adapter (PCMCIA) */ |
437 | PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001), /* ARtem Onair */ | 437 | PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001), /* ARtem Onair */ |
438 | PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0003), /* ARtem Onair Comcard 11 */ | ||
438 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305), /* Buffalo WLI-PCM-S11 */ | 439 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305), /* Buffalo WLI-PCM-S11 */ |
439 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */ | 440 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */ |
440 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */ | 441 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */ |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 82354b974a04..c6a370fa9bcb 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -138,6 +138,7 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
138 | u8 *fw_version = NULL; | 138 | u8 *fw_version = NULL; |
139 | size_t len; | 139 | size_t len; |
140 | int i; | 140 | int i; |
141 | int maxlen; | ||
141 | 142 | ||
142 | if (priv->rx_start) | 143 | if (priv->rx_start) |
143 | return 0; | 144 | return 0; |
@@ -195,6 +196,16 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
195 | else | 196 | else |
196 | priv->rx_mtu = (size_t) | 197 | priv->rx_mtu = (size_t) |
197 | 0x620 - priv->tx_hdr_len; | 198 | 0x620 - priv->tx_hdr_len; |
199 | maxlen = priv->tx_hdr_len + /* USB devices */ | ||
200 | sizeof(struct p54_rx_data) + | ||
201 | 4 + /* rx alignment */ | ||
202 | IEEE80211_MAX_FRAG_THRESHOLD; | ||
203 | if (priv->rx_mtu > maxlen && PAGE_SIZE == 4096) { | ||
204 | printk(KERN_INFO "p54: rx_mtu reduced from %d " | ||
205 | "to %d\n", priv->rx_mtu, | ||
206 | maxlen); | ||
207 | priv->rx_mtu = maxlen; | ||
208 | } | ||
198 | break; | 209 | break; |
199 | } | 210 | } |
200 | case BR_CODE_EXPOSED_IF: | 211 | case BR_CODE_EXPOSED_IF: |
@@ -575,6 +586,7 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
575 | u16 freq = le16_to_cpu(hdr->freq); | 586 | u16 freq = le16_to_cpu(hdr->freq); |
576 | size_t header_len = sizeof(*hdr); | 587 | size_t header_len = sizeof(*hdr); |
577 | u32 tsf32; | 588 | u32 tsf32; |
589 | u8 rate = hdr->rate & 0xf; | ||
578 | 590 | ||
579 | /* | 591 | /* |
580 | * If the device is in a unspecified state we have to | 592 | * If the device is in a unspecified state we have to |
@@ -603,8 +615,11 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
603 | rx_status.qual = (100 * hdr->rssi) / 127; | 615 | rx_status.qual = (100 * hdr->rssi) / 127; |
604 | if (hdr->rate & 0x10) | 616 | if (hdr->rate & 0x10) |
605 | rx_status.flag |= RX_FLAG_SHORTPRE; | 617 | rx_status.flag |= RX_FLAG_SHORTPRE; |
606 | rx_status.rate_idx = (dev->conf.channel->band == IEEE80211_BAND_2GHZ ? | 618 | if (dev->conf.channel->band == IEEE80211_BAND_5GHZ) |
607 | hdr->rate : (hdr->rate - 4)) & 0xf; | 619 | rx_status.rate_idx = (rate < 4) ? 0 : rate - 4; |
620 | else | ||
621 | rx_status.rate_idx = rate; | ||
622 | |||
608 | rx_status.freq = freq; | 623 | rx_status.freq = freq; |
609 | rx_status.band = dev->conf.channel->band; | 624 | rx_status.band = dev->conf.channel->band; |
610 | rx_status.antenna = hdr->antenna; | 625 | rx_status.antenna = hdr->antenna; |
@@ -798,6 +813,16 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
798 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; | 813 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
799 | info->status.ack_signal = p54_rssi_to_dbm(dev, | 814 | info->status.ack_signal = p54_rssi_to_dbm(dev, |
800 | (int)payload->ack_rssi); | 815 | (int)payload->ack_rssi); |
816 | |||
817 | if (entry_data->key_type == P54_CRYPTO_TKIPMICHAEL) { | ||
818 | u8 *iv = (u8 *)(entry_data->align + pad + | ||
819 | entry_data->crypt_offset); | ||
820 | |||
821 | /* Restore the original TKIP IV. */ | ||
822 | iv[2] = iv[0]; | ||
823 | iv[0] = iv[1]; | ||
824 | iv[1] = (iv[0] | 0x20) & 0x7f; /* WEPSeed - 8.3.2.2 */ | ||
825 | } | ||
801 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); | 826 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); |
802 | ieee80211_tx_status_irqsafe(dev, entry); | 827 | ieee80211_tx_status_irqsafe(dev, entry); |
803 | goto out; | 828 | goto out; |
@@ -1383,7 +1408,6 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1383 | hdr->tries = ridx; | 1408 | hdr->tries = ridx; |
1384 | txhdr->rts_rate_idx = 0; | 1409 | txhdr->rts_rate_idx = 0; |
1385 | if (info->control.hw_key) { | 1410 | if (info->control.hw_key) { |
1386 | crypt_offset += info->control.hw_key->iv_len; | ||
1387 | txhdr->key_type = p54_convert_algo(info->control.hw_key->alg); | 1411 | txhdr->key_type = p54_convert_algo(info->control.hw_key->alg); |
1388 | txhdr->key_len = min((u8)16, info->control.hw_key->keylen); | 1412 | txhdr->key_len = min((u8)16, info->control.hw_key->keylen); |
1389 | memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len); | 1413 | memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len); |
@@ -1397,6 +1421,8 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1397 | } | 1421 | } |
1398 | /* reserve some space for ICV */ | 1422 | /* reserve some space for ICV */ |
1399 | len += info->control.hw_key->icv_len; | 1423 | len += info->control.hw_key->icv_len; |
1424 | memset(skb_put(skb, info->control.hw_key->icv_len), 0, | ||
1425 | info->control.hw_key->icv_len); | ||
1400 | } else { | 1426 | } else { |
1401 | txhdr->key_type = 0; | 1427 | txhdr->key_type = 0; |
1402 | txhdr->key_len = 0; | 1428 | txhdr->key_len = 0; |
@@ -1824,7 +1850,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev, | |||
1824 | 1850 | ||
1825 | static int p54_config(struct ieee80211_hw *dev, u32 changed) | 1851 | static int p54_config(struct ieee80211_hw *dev, u32 changed) |
1826 | { | 1852 | { |
1827 | int ret; | 1853 | int ret = 0; |
1828 | struct p54_common *priv = dev->priv; | 1854 | struct p54_common *priv = dev->priv; |
1829 | struct ieee80211_conf *conf = &dev->conf; | 1855 | struct ieee80211_conf *conf = &dev->conf; |
1830 | 1856 | ||
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index c44a200059d2..6a6a72f6f82c 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -56,6 +56,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
56 | {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */ | 56 | {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */ |
57 | {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */ | 57 | {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */ |
58 | {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */ | 58 | {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */ |
59 | {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ | ||
59 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ | 60 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ |
60 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ | 61 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ |
61 | {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */ | 62 | {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */ |
@@ -284,6 +285,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
284 | usb_fill_bulk_urb(data_urb, priv->udev, | 285 | usb_fill_bulk_urb(data_urb, priv->udev, |
285 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), | 286 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), |
286 | skb->data, skb->len, p54u_tx_cb, skb); | 287 | skb->data, skb->len, p54u_tx_cb, skb); |
288 | data_urb->transfer_flags |= URB_ZERO_PACKET; | ||
287 | 289 | ||
288 | usb_anchor_urb(data_urb, &priv->submitted); | 290 | usb_anchor_urb(data_urb, &priv->submitted); |
289 | if (usb_submit_urb(data_urb, GFP_ATOMIC)) { | 291 | if (usb_submit_urb(data_urb, GFP_ATOMIC)) { |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 30028e2422fc..af6b5847be5c 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -38,7 +38,7 @@ | |||
38 | /* | 38 | /* |
39 | * Allow hardware encryption to be disabled. | 39 | * Allow hardware encryption to be disabled. |
40 | */ | 40 | */ |
41 | static int modparam_nohwcrypt = 1; | 41 | static int modparam_nohwcrypt = 0; |
42 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); | 42 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); |
43 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); | 43 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); |
44 | 44 | ||
@@ -376,11 +376,11 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev, | |||
376 | 376 | ||
377 | /* | 377 | /* |
378 | * The driver does not support the IV/EIV generation | 378 | * The driver does not support the IV/EIV generation |
379 | * in hardware. However it doesn't support the IV/EIV | 379 | * in hardware. However it demands the data to be provided |
380 | * inside the ieee80211 frame either, but requires it | 380 | * both seperately as well as inside the frame. |
381 | * to be provided seperately for the descriptor. | 381 | * We already provided the CONFIG_CRYPTO_COPY_IV to rt2x00lib |
382 | * rt2x00lib will cut the IV/EIV data out of all frames | 382 | * to ensure rt2x00lib will not strip the data from the |
383 | * given to us by mac80211, but we must tell mac80211 | 383 | * frame after the copy, now we must tell mac80211 |
384 | * to generate the IV/EIV data. | 384 | * to generate the IV/EIV data. |
385 | */ | 385 | */ |
386 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | 386 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; |
@@ -1181,7 +1181,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1181 | test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)); | 1181 | test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)); |
1182 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | 1182 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); |
1183 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len); | 1183 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len); |
1184 | rt2x00_set_field32(&word, TXD_W0_CIPHER, txdesc->cipher); | 1184 | rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher); |
1185 | rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); | 1185 | rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); |
1186 | rt2x00_desc_write(txd, 0, word); | 1186 | rt2x00_desc_write(txd, 0, word); |
1187 | } | 1187 | } |
@@ -1334,14 +1334,7 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, | |||
1334 | 1334 | ||
1335 | /* ICV is located at the end of frame */ | 1335 | /* ICV is located at the end of frame */ |
1336 | 1336 | ||
1337 | /* | 1337 | rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; |
1338 | * Hardware has stripped IV/EIV data from 802.11 frame during | ||
1339 | * decryption. It has provided the data seperately but rt2x00lib | ||
1340 | * should decide if it should be reinserted. | ||
1341 | */ | ||
1342 | rxdesc->flags |= RX_FLAG_IV_STRIPPED; | ||
1343 | if (rxdesc->cipher != CIPHER_TKIP) | ||
1344 | rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; | ||
1345 | if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) | 1338 | if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) |
1346 | rxdesc->flags |= RX_FLAG_DECRYPTED; | 1339 | rxdesc->flags |= RX_FLAG_DECRYPTED; |
1347 | else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) | 1340 | else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 6d92542fcf0d..87c0f2c83077 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -807,13 +807,11 @@ static void rt2x00lib_rate(struct ieee80211_rate *entry, | |||
807 | { | 807 | { |
808 | entry->flags = 0; | 808 | entry->flags = 0; |
809 | entry->bitrate = rate->bitrate; | 809 | entry->bitrate = rate->bitrate; |
810 | entry->hw_value = rt2x00_create_rate_hw_value(index, 0); | 810 | entry->hw_value =index; |
811 | entry->hw_value_short = entry->hw_value; | 811 | entry->hw_value_short = index; |
812 | 812 | ||
813 | if (rate->flags & DEV_RATE_SHORT_PREAMBLE) { | 813 | if (rate->flags & DEV_RATE_SHORT_PREAMBLE) |
814 | entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE; | 814 | entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE; |
815 | entry->hw_value_short |= rt2x00_create_rate_hw_value(index, 1); | ||
816 | } | ||
817 | } | 815 | } |
818 | 816 | ||
819 | static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, | 817 | static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00leds.c b/drivers/net/wireless/rt2x00/rt2x00leds.c index 68f4e0fc35b9..a0cd35b6beb5 100644 --- a/drivers/net/wireless/rt2x00/rt2x00leds.c +++ b/drivers/net/wireless/rt2x00/rt2x00leds.c | |||
@@ -97,7 +97,7 @@ void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled) | |||
97 | 97 | ||
98 | void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled) | 98 | void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled) |
99 | { | 99 | { |
100 | if (rt2x00dev->led_radio.type == LED_TYPE_ASSOC) | 100 | if (rt2x00dev->led_radio.type == LED_TYPE_RADIO) |
101 | rt2x00led_led_simple(&rt2x00dev->led_radio, enabled); | 101 | rt2x00led_led_simple(&rt2x00dev->led_radio, enabled); |
102 | } | 102 | } |
103 | 103 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h index 03024327767b..86cd26fbf769 100644 --- a/drivers/net/wireless/rt2x00/rt2x00lib.h +++ b/drivers/net/wireless/rt2x00/rt2x00lib.h | |||
@@ -52,22 +52,11 @@ struct rt2x00_rate { | |||
52 | 52 | ||
53 | extern const struct rt2x00_rate rt2x00_supported_rates[12]; | 53 | extern const struct rt2x00_rate rt2x00_supported_rates[12]; |
54 | 54 | ||
55 | static inline u16 rt2x00_create_rate_hw_value(const u16 index, | ||
56 | const u16 short_preamble) | ||
57 | { | ||
58 | return (short_preamble << 8) | (index & 0xff); | ||
59 | } | ||
60 | |||
61 | static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value) | 55 | static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value) |
62 | { | 56 | { |
63 | return &rt2x00_supported_rates[hw_value & 0xff]; | 57 | return &rt2x00_supported_rates[hw_value & 0xff]; |
64 | } | 58 | } |
65 | 59 | ||
66 | static inline int rt2x00_get_rate_preamble(const u16 hw_value) | ||
67 | { | ||
68 | return (hw_value & 0xff00); | ||
69 | } | ||
70 | |||
71 | /* | 60 | /* |
72 | * Radio control handlers. | 61 | * Radio control handlers. |
73 | */ | 62 | */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index eaec6bd93ed5..746a8f36b931 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -313,7 +313,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
313 | * When preamble is enabled we should set the | 313 | * When preamble is enabled we should set the |
314 | * preamble bit for the signal. | 314 | * preamble bit for the signal. |
315 | */ | 315 | */ |
316 | if (rt2x00_get_rate_preamble(rate->hw_value)) | 316 | if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) |
317 | txdesc->signal |= 0x08; | 317 | txdesc->signal |= 0x08; |
318 | } | 318 | } |
319 | } | 319 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 83df312ac56f..0b29d767a258 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -434,11 +434,11 @@ static int rt2x00usb_find_endpoints(struct rt2x00_dev *rt2x00dev) | |||
434 | 434 | ||
435 | if (usb_endpoint_is_bulk_in(ep_desc)) { | 435 | if (usb_endpoint_is_bulk_in(ep_desc)) { |
436 | rt2x00usb_assign_endpoint(rt2x00dev->rx, ep_desc); | 436 | rt2x00usb_assign_endpoint(rt2x00dev->rx, ep_desc); |
437 | } else if (usb_endpoint_is_bulk_out(ep_desc)) { | 437 | } else if (usb_endpoint_is_bulk_out(ep_desc) && |
438 | (queue != queue_end(rt2x00dev))) { | ||
438 | rt2x00usb_assign_endpoint(queue, ep_desc); | 439 | rt2x00usb_assign_endpoint(queue, ep_desc); |
440 | queue = queue_next(queue); | ||
439 | 441 | ||
440 | if (queue != queue_end(rt2x00dev)) | ||
441 | queue = queue_next(queue); | ||
442 | tx_ep_desc = ep_desc; | 442 | tx_ep_desc = ep_desc; |
443 | } | 443 | } |
444 | } | 444 | } |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index d638a8a59370..96a8d69f8790 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2321,6 +2321,7 @@ static struct usb_device_id rt73usb_device_table[] = { | |||
2321 | /* Linksys */ | 2321 | /* Linksys */ |
2322 | { USB_DEVICE(0x13b1, 0x0020), USB_DEVICE_DATA(&rt73usb_ops) }, | 2322 | { USB_DEVICE(0x13b1, 0x0020), USB_DEVICE_DATA(&rt73usb_ops) }, |
2323 | { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, | 2323 | { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, |
2324 | { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2324 | /* MSI */ | 2325 | /* MSI */ |
2325 | { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, | 2326 | { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, |
2326 | { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, | 2327 | { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, |
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c index 5f887fb137a9..387c133ec0f2 100644 --- a/drivers/net/wireless/rtl818x/rtl8180_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c | |||
@@ -897,6 +897,7 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev, | |||
897 | dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | 897 | dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | |
898 | IEEE80211_HW_RX_INCLUDES_FCS | | 898 | IEEE80211_HW_RX_INCLUDES_FCS | |
899 | IEEE80211_HW_SIGNAL_UNSPEC; | 899 | IEEE80211_HW_SIGNAL_UNSPEC; |
900 | dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); | ||
900 | dev->queues = 1; | 901 | dev->queues = 1; |
901 | dev->max_signal = 65; | 902 | dev->max_signal = 65; |
902 | 903 | ||
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index 00ce3ef39abe..6ad6bac37706 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -213,7 +213,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
213 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 213 | urb = usb_alloc_urb(0, GFP_ATOMIC); |
214 | if (!urb) { | 214 | if (!urb) { |
215 | kfree_skb(skb); | 215 | kfree_skb(skb); |
216 | return -ENOMEM; | 216 | return NETDEV_TX_OK; |
217 | } | 217 | } |
218 | 218 | ||
219 | flags = skb->len; | 219 | flags = skb->len; |
@@ -281,7 +281,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
281 | } | 281 | } |
282 | usb_free_urb(urb); | 282 | usb_free_urb(urb); |
283 | 283 | ||
284 | return rc; | 284 | return NETDEV_TX_OK; |
285 | } | 285 | } |
286 | 286 | ||
287 | static void rtl8187_rx_cb(struct urb *urb) | 287 | static void rtl8187_rx_cb(struct urb *urb) |
@@ -1471,6 +1471,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf) | |||
1471 | ieee80211_unregister_hw(dev); | 1471 | ieee80211_unregister_hw(dev); |
1472 | 1472 | ||
1473 | priv = dev->priv; | 1473 | priv = dev->priv; |
1474 | usb_reset_device(priv->udev); | ||
1474 | usb_put_dev(interface_to_usbdev(intf)); | 1475 | usb_put_dev(interface_to_usbdev(intf)); |
1475 | ieee80211_free_hw(dev); | 1476 | ieee80211_free_hw(dev); |
1476 | } | 1477 | } |
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index cf9712922778..2f1645dcb8c8 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -362,6 +362,7 @@ static const struct net_device_ops netdev_ops = { | |||
362 | .ndo_set_multicast_list = set_rx_mode, | 362 | .ndo_set_multicast_list = set_rx_mode, |
363 | .ndo_change_mtu = eth_change_mtu, | 363 | .ndo_change_mtu = eth_change_mtu, |
364 | .ndo_validate_addr = eth_validate_addr, | 364 | .ndo_validate_addr = eth_validate_addr, |
365 | .ndo_set_mac_address = eth_mac_addr, | ||
365 | .ndo_do_ioctl = netdev_ioctl, | 366 | .ndo_do_ioctl = netdev_ioctl, |
366 | .ndo_tx_timeout = yellowfin_tx_timeout, | 367 | .ndo_tx_timeout = yellowfin_tx_timeout, |
367 | }; | 368 | }; |
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c index affd904deafc..37c84e3b8be0 100644 --- a/drivers/net/zorro8390.c +++ b/drivers/net/zorro8390.c | |||
@@ -147,6 +147,7 @@ static const struct net_device_ops zorro8390_netdev_ops = { | |||
147 | .ndo_get_stats = ei_get_stats, | 147 | .ndo_get_stats = ei_get_stats, |
148 | .ndo_set_multicast_list = ei_set_multicast_list, | 148 | .ndo_set_multicast_list = ei_set_multicast_list, |
149 | .ndo_validate_addr = eth_validate_addr, | 149 | .ndo_validate_addr = eth_validate_addr, |
150 | .ndo_set_mac_address = eth_mac_addr, | ||
150 | .ndo_change_mtu = eth_change_mtu, | 151 | .ndo_change_mtu = eth_change_mtu, |
151 | #ifdef CONFIG_NET_POLL_CONTROLLER | 152 | #ifdef CONFIG_NET_POLL_CONTROLLER |
152 | .ndo_poll_controller = ei_poll, | 153 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c index e1b0ad6e918f..fa65a2b2ae2e 100644 --- a/drivers/of/of_i2c.c +++ b/drivers/of/of_i2c.c | |||
@@ -66,4 +66,23 @@ void of_register_i2c_devices(struct i2c_adapter *adap, | |||
66 | } | 66 | } |
67 | EXPORT_SYMBOL(of_register_i2c_devices); | 67 | EXPORT_SYMBOL(of_register_i2c_devices); |
68 | 68 | ||
69 | static int of_dev_node_match(struct device *dev, void *data) | ||
70 | { | ||
71 | return dev_archdata_get_node(&dev->archdata) == data; | ||
72 | } | ||
73 | |||
74 | /* must call put_device() when done with returned i2c_client device */ | ||
75 | struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) | ||
76 | { | ||
77 | struct device *dev; | ||
78 | |||
79 | dev = bus_find_device(&i2c_bus_type, NULL, node, | ||
80 | of_dev_node_match); | ||
81 | if (!dev) | ||
82 | return NULL; | ||
83 | |||
84 | return to_i2c_client(dev); | ||
85 | } | ||
86 | EXPORT_SYMBOL(of_find_i2c_device_by_node); | ||
87 | |||
69 | MODULE_LICENSE("GPL"); | 88 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index 1e93c837514f..4fa3bb2ddfe4 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c | |||
@@ -405,7 +405,6 @@ static void __init superio_serial_init(void) | |||
405 | serial_port.type = PORT_16550A; | 405 | serial_port.type = PORT_16550A; |
406 | serial_port.uartclk = 115200*16; | 406 | serial_port.uartclk = 115200*16; |
407 | serial_port.fifosize = 16; | 407 | serial_port.fifosize = 16; |
408 | spin_lock_init(&serial_port.lock); | ||
409 | 408 | ||
410 | /* serial port #1 */ | 409 | /* serial port #1 */ |
411 | serial_port.iobase = sio_dev.sp1_base; | 410 | serial_port.iobase = sio_dev.sp1_base; |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index b9a562933903..c933980bf562 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -438,7 +438,8 @@ static struct intel_iommu *device_to_iommu(u8 bus, u8 devfn) | |||
438 | continue; | 438 | continue; |
439 | 439 | ||
440 | for (i = 0; i < drhd->devices_cnt; i++) | 440 | for (i = 0; i < drhd->devices_cnt; i++) |
441 | if (drhd->devices[i]->bus->number == bus && | 441 | if (drhd->devices[i] && |
442 | drhd->devices[i]->bus->number == bus && | ||
442 | drhd->devices[i]->devfn == devfn) | 443 | drhd->devices[i]->devfn == devfn) |
443 | return drhd->iommu; | 444 | return drhd->iommu; |
444 | 445 | ||
diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c index 645d7a60e412..ec22284eed30 100644 --- a/drivers/pci/syscall.c +++ b/drivers/pci/syscall.c | |||
@@ -14,10 +14,8 @@ | |||
14 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
15 | #include "pci.h" | 15 | #include "pci.h" |
16 | 16 | ||
17 | asmlinkage long | 17 | SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn, |
18 | sys_pciconfig_read(unsigned long bus, unsigned long dfn, | 18 | unsigned long, off, unsigned long, len, void __user *, buf) |
19 | unsigned long off, unsigned long len, | ||
20 | void __user *buf) | ||
21 | { | 19 | { |
22 | struct pci_dev *dev; | 20 | struct pci_dev *dev; |
23 | u8 byte; | 21 | u8 byte; |
@@ -86,10 +84,8 @@ error: | |||
86 | return err; | 84 | return err; |
87 | } | 85 | } |
88 | 86 | ||
89 | asmlinkage long | 87 | SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, |
90 | sys_pciconfig_write(unsigned long bus, unsigned long dfn, | 88 | unsigned long, off, unsigned long, len, void __user *, buf) |
91 | unsigned long off, unsigned long len, | ||
92 | void __user *buf) | ||
93 | { | 89 | { |
94 | struct pci_dev *dev; | 90 | struct pci_dev *dev; |
95 | u8 byte; | 91 | u8 byte; |
diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c index a34284b1482a..d187ba4c5e0e 100644 --- a/drivers/pcmcia/electra_cf.c +++ b/drivers/pcmcia/electra_cf.c | |||
@@ -297,7 +297,7 @@ static int __devinit electra_cf_probe(struct of_device *ofdev, | |||
297 | goto fail3; | 297 | goto fail3; |
298 | } | 298 | } |
299 | 299 | ||
300 | dev_info(device, "at mem 0x%lx io 0x%lx irq %d\n", | 300 | dev_info(device, "at mem 0x%lx io 0x%llx irq %d\n", |
301 | cf->mem_phys, io.start, cf->irq); | 301 | cf->mem_phys, io.start, cf->irq); |
302 | 302 | ||
303 | cf->active = 1; | 303 | cf->active = 1; |
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 668472405a57..33da1127992a 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig | |||
@@ -82,4 +82,10 @@ config BATTERY_DA9030 | |||
82 | Say Y here to enable support for batteries charger integrated into | 82 | Say Y here to enable support for batteries charger integrated into |
83 | DA9030 PMIC. | 83 | DA9030 PMIC. |
84 | 84 | ||
85 | config CHARGER_PCF50633 | ||
86 | tristate "NXP PCF50633 MBC" | ||
87 | depends on MFD_PCF50633 | ||
88 | help | ||
89 | Say Y to include support for NXP PCF50633 Main Battery Charger. | ||
90 | |||
85 | endif # POWER_SUPPLY | 91 | endif # POWER_SUPPLY |
diff --git a/drivers/power/Makefile b/drivers/power/Makefile index eebb15505a40..2fcf41d13e5c 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile | |||
@@ -25,3 +25,4 @@ obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o | |||
25 | obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o | 25 | obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o |
26 | obj-$(CONFIG_BATTERY_BQ27x00) += bq27x00_battery.o | 26 | obj-$(CONFIG_BATTERY_BQ27x00) += bq27x00_battery.o |
27 | obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o | 27 | obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o |
28 | obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o \ No newline at end of file | ||
diff --git a/drivers/power/pcf50633-charger.c b/drivers/power/pcf50633-charger.c new file mode 100644 index 000000000000..e988ec130fcd --- /dev/null +++ b/drivers/power/pcf50633-charger.c | |||
@@ -0,0 +1,358 @@ | |||
1 | /* NXP PCF50633 Main Battery Charger Driver | ||
2 | * | ||
3 | * (C) 2006-2008 by Openmoko, Inc. | ||
4 | * Author: Balaji Rao <balajirrao@openmoko.org> | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Broken down from monstrous PCF50633 driver mainly by | ||
8 | * Harald Welte, Andy Green and Werner Almesberger | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/types.h> | ||
21 | #include <linux/device.h> | ||
22 | #include <linux/sysfs.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/power_supply.h> | ||
25 | |||
26 | #include <linux/mfd/pcf50633/core.h> | ||
27 | #include <linux/mfd/pcf50633/mbc.h> | ||
28 | |||
29 | struct pcf50633_mbc { | ||
30 | struct pcf50633 *pcf; | ||
31 | |||
32 | int adapter_active; | ||
33 | int adapter_online; | ||
34 | int usb_active; | ||
35 | int usb_online; | ||
36 | |||
37 | struct power_supply usb; | ||
38 | struct power_supply adapter; | ||
39 | }; | ||
40 | |||
41 | int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma) | ||
42 | { | ||
43 | struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev); | ||
44 | int ret = 0; | ||
45 | u8 bits; | ||
46 | |||
47 | if (ma >= 1000) | ||
48 | bits = PCF50633_MBCC7_USB_1000mA; | ||
49 | else if (ma >= 500) | ||
50 | bits = PCF50633_MBCC7_USB_500mA; | ||
51 | else if (ma >= 100) | ||
52 | bits = PCF50633_MBCC7_USB_100mA; | ||
53 | else | ||
54 | bits = PCF50633_MBCC7_USB_SUSPEND; | ||
55 | |||
56 | ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC7, | ||
57 | PCF50633_MBCC7_USB_MASK, bits); | ||
58 | if (ret) | ||
59 | dev_err(pcf->dev, "error setting usb curlim to %d mA\n", ma); | ||
60 | else | ||
61 | dev_info(pcf->dev, "usb curlim to %d mA\n", ma); | ||
62 | |||
63 | power_supply_changed(&mbc->usb); | ||
64 | |||
65 | return ret; | ||
66 | } | ||
67 | EXPORT_SYMBOL_GPL(pcf50633_mbc_usb_curlim_set); | ||
68 | |||
69 | int pcf50633_mbc_get_status(struct pcf50633 *pcf) | ||
70 | { | ||
71 | struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev); | ||
72 | int status = 0; | ||
73 | |||
74 | if (mbc->usb_online) | ||
75 | status |= PCF50633_MBC_USB_ONLINE; | ||
76 | if (mbc->usb_active) | ||
77 | status |= PCF50633_MBC_USB_ACTIVE; | ||
78 | if (mbc->adapter_online) | ||
79 | status |= PCF50633_MBC_ADAPTER_ONLINE; | ||
80 | if (mbc->adapter_active) | ||
81 | status |= PCF50633_MBC_ADAPTER_ACTIVE; | ||
82 | |||
83 | return status; | ||
84 | } | ||
85 | EXPORT_SYMBOL_GPL(pcf50633_mbc_get_status); | ||
86 | |||
87 | void pcf50633_mbc_set_status(struct pcf50633 *pcf, int what, int status) | ||
88 | { | ||
89 | struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev); | ||
90 | |||
91 | if (what & PCF50633_MBC_USB_ONLINE) | ||
92 | mbc->usb_online = !!status; | ||
93 | if (what & PCF50633_MBC_USB_ACTIVE) | ||
94 | mbc->usb_active = !!status; | ||
95 | if (what & PCF50633_MBC_ADAPTER_ONLINE) | ||
96 | mbc->adapter_online = !!status; | ||
97 | if (what & PCF50633_MBC_ADAPTER_ACTIVE) | ||
98 | mbc->adapter_active = !!status; | ||
99 | } | ||
100 | EXPORT_SYMBOL_GPL(pcf50633_mbc_set_status); | ||
101 | |||
102 | static ssize_t | ||
103 | show_chgmode(struct device *dev, struct device_attribute *attr, char *buf) | ||
104 | { | ||
105 | struct pcf50633_mbc *mbc = dev_get_drvdata(dev); | ||
106 | |||
107 | u8 mbcs2 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2); | ||
108 | u8 chgmod = (mbcs2 & PCF50633_MBCS2_MBC_MASK); | ||
109 | |||
110 | return sprintf(buf, "%d\n", chgmod); | ||
111 | } | ||
112 | static DEVICE_ATTR(chgmode, S_IRUGO, show_chgmode, NULL); | ||
113 | |||
114 | static ssize_t | ||
115 | show_usblim(struct device *dev, struct device_attribute *attr, char *buf) | ||
116 | { | ||
117 | struct pcf50633_mbc *mbc = dev_get_drvdata(dev); | ||
118 | u8 usblim = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC7) & | ||
119 | PCF50633_MBCC7_USB_MASK; | ||
120 | unsigned int ma; | ||
121 | |||
122 | if (usblim == PCF50633_MBCC7_USB_1000mA) | ||
123 | ma = 1000; | ||
124 | else if (usblim == PCF50633_MBCC7_USB_500mA) | ||
125 | ma = 500; | ||
126 | else if (usblim == PCF50633_MBCC7_USB_100mA) | ||
127 | ma = 100; | ||
128 | else | ||
129 | ma = 0; | ||
130 | |||
131 | return sprintf(buf, "%u\n", ma); | ||
132 | } | ||
133 | |||
134 | static ssize_t set_usblim(struct device *dev, | ||
135 | struct device_attribute *attr, const char *buf, size_t count) | ||
136 | { | ||
137 | struct pcf50633_mbc *mbc = dev_get_drvdata(dev); | ||
138 | unsigned long ma; | ||
139 | int ret; | ||
140 | |||
141 | ret = strict_strtoul(buf, 10, &ma); | ||
142 | if (ret) | ||
143 | return -EINVAL; | ||
144 | |||
145 | pcf50633_mbc_usb_curlim_set(mbc->pcf, ma); | ||
146 | |||
147 | return count; | ||
148 | } | ||
149 | |||
150 | static DEVICE_ATTR(usb_curlim, S_IRUGO | S_IWUSR, show_usblim, set_usblim); | ||
151 | |||
152 | static struct attribute *pcf50633_mbc_sysfs_entries[] = { | ||
153 | &dev_attr_chgmode.attr, | ||
154 | &dev_attr_usb_curlim.attr, | ||
155 | NULL, | ||
156 | }; | ||
157 | |||
158 | static struct attribute_group mbc_attr_group = { | ||
159 | .name = NULL, /* put in device directory */ | ||
160 | .attrs = pcf50633_mbc_sysfs_entries, | ||
161 | }; | ||
162 | |||
163 | static void | ||
164 | pcf50633_mbc_irq_handler(int irq, void *data) | ||
165 | { | ||
166 | struct pcf50633_mbc *mbc = data; | ||
167 | |||
168 | /* USB */ | ||
169 | if (irq == PCF50633_IRQ_USBINS) { | ||
170 | mbc->usb_online = 1; | ||
171 | } else if (irq == PCF50633_IRQ_USBREM) { | ||
172 | mbc->usb_online = 0; | ||
173 | mbc->usb_active = 0; | ||
174 | pcf50633_mbc_usb_curlim_set(mbc->pcf, 0); | ||
175 | } | ||
176 | |||
177 | /* Adapter */ | ||
178 | if (irq == PCF50633_IRQ_ADPINS) { | ||
179 | mbc->adapter_online = 1; | ||
180 | mbc->adapter_active = 1; | ||
181 | } else if (irq == PCF50633_IRQ_ADPREM) { | ||
182 | mbc->adapter_online = 0; | ||
183 | mbc->adapter_active = 0; | ||
184 | } | ||
185 | |||
186 | if (irq == PCF50633_IRQ_BATFULL) { | ||
187 | mbc->usb_active = 0; | ||
188 | mbc->adapter_active = 0; | ||
189 | } | ||
190 | |||
191 | power_supply_changed(&mbc->usb); | ||
192 | power_supply_changed(&mbc->adapter); | ||
193 | |||
194 | if (mbc->pcf->pdata->mbc_event_callback) | ||
195 | mbc->pcf->pdata->mbc_event_callback(mbc->pcf, irq); | ||
196 | } | ||
197 | |||
198 | static int adapter_get_property(struct power_supply *psy, | ||
199 | enum power_supply_property psp, | ||
200 | union power_supply_propval *val) | ||
201 | { | ||
202 | struct pcf50633_mbc *mbc = container_of(psy, struct pcf50633_mbc, usb); | ||
203 | int ret = 0; | ||
204 | |||
205 | switch (psp) { | ||
206 | case POWER_SUPPLY_PROP_ONLINE: | ||
207 | val->intval = mbc->adapter_online; | ||
208 | break; | ||
209 | default: | ||
210 | ret = -EINVAL; | ||
211 | break; | ||
212 | } | ||
213 | return ret; | ||
214 | } | ||
215 | |||
216 | static int usb_get_property(struct power_supply *psy, | ||
217 | enum power_supply_property psp, | ||
218 | union power_supply_propval *val) | ||
219 | { | ||
220 | struct pcf50633_mbc *mbc = container_of(psy, struct pcf50633_mbc, usb); | ||
221 | int ret = 0; | ||
222 | |||
223 | switch (psp) { | ||
224 | case POWER_SUPPLY_PROP_ONLINE: | ||
225 | val->intval = mbc->usb_online; | ||
226 | break; | ||
227 | default: | ||
228 | ret = -EINVAL; | ||
229 | break; | ||
230 | } | ||
231 | return ret; | ||
232 | } | ||
233 | |||
234 | static enum power_supply_property power_props[] = { | ||
235 | POWER_SUPPLY_PROP_ONLINE, | ||
236 | }; | ||
237 | |||
238 | static const u8 mbc_irq_handlers[] = { | ||
239 | PCF50633_IRQ_ADPINS, | ||
240 | PCF50633_IRQ_ADPREM, | ||
241 | PCF50633_IRQ_USBINS, | ||
242 | PCF50633_IRQ_USBREM, | ||
243 | PCF50633_IRQ_BATFULL, | ||
244 | PCF50633_IRQ_CHGHALT, | ||
245 | PCF50633_IRQ_THLIMON, | ||
246 | PCF50633_IRQ_THLIMOFF, | ||
247 | PCF50633_IRQ_USBLIMON, | ||
248 | PCF50633_IRQ_USBLIMOFF, | ||
249 | PCF50633_IRQ_LOWSYS, | ||
250 | PCF50633_IRQ_LOWBAT, | ||
251 | }; | ||
252 | |||
253 | static int __devinit pcf50633_mbc_probe(struct platform_device *pdev) | ||
254 | { | ||
255 | struct pcf50633_mbc *mbc; | ||
256 | struct pcf50633_subdev_pdata *pdata = pdev->dev.platform_data; | ||
257 | int ret; | ||
258 | int i; | ||
259 | u8 mbcs1; | ||
260 | |||
261 | mbc = kzalloc(sizeof(*mbc), GFP_KERNEL); | ||
262 | if (!mbc) | ||
263 | return -ENOMEM; | ||
264 | |||
265 | platform_set_drvdata(pdev, mbc); | ||
266 | mbc->pcf = pdata->pcf; | ||
267 | |||
268 | /* Set up IRQ handlers */ | ||
269 | for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++) | ||
270 | pcf50633_register_irq(mbc->pcf, mbc_irq_handlers[i], | ||
271 | pcf50633_mbc_irq_handler, mbc); | ||
272 | |||
273 | /* Create power supplies */ | ||
274 | mbc->adapter.name = "adapter"; | ||
275 | mbc->adapter.type = POWER_SUPPLY_TYPE_MAINS; | ||
276 | mbc->adapter.properties = power_props; | ||
277 | mbc->adapter.num_properties = ARRAY_SIZE(power_props); | ||
278 | mbc->adapter.get_property = &adapter_get_property; | ||
279 | mbc->adapter.supplied_to = mbc->pcf->pdata->batteries; | ||
280 | mbc->adapter.num_supplicants = mbc->pcf->pdata->num_batteries; | ||
281 | |||
282 | mbc->usb.name = "usb"; | ||
283 | mbc->usb.type = POWER_SUPPLY_TYPE_USB; | ||
284 | mbc->usb.properties = power_props; | ||
285 | mbc->usb.num_properties = ARRAY_SIZE(power_props); | ||
286 | mbc->usb.get_property = usb_get_property; | ||
287 | mbc->usb.supplied_to = mbc->pcf->pdata->batteries; | ||
288 | mbc->usb.num_supplicants = mbc->pcf->pdata->num_batteries; | ||
289 | |||
290 | ret = power_supply_register(&pdev->dev, &mbc->adapter); | ||
291 | if (ret) { | ||
292 | dev_err(mbc->pcf->dev, "failed to register adapter\n"); | ||
293 | kfree(mbc); | ||
294 | return ret; | ||
295 | } | ||
296 | |||
297 | ret = power_supply_register(&pdev->dev, &mbc->usb); | ||
298 | if (ret) { | ||
299 | dev_err(mbc->pcf->dev, "failed to register usb\n"); | ||
300 | power_supply_unregister(&mbc->adapter); | ||
301 | kfree(mbc); | ||
302 | return ret; | ||
303 | } | ||
304 | |||
305 | ret = sysfs_create_group(&pdev->dev.kobj, &mbc_attr_group); | ||
306 | if (ret) | ||
307 | dev_err(mbc->pcf->dev, "failed to create sysfs entries\n"); | ||
308 | |||
309 | mbcs1 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS1); | ||
310 | if (mbcs1 & PCF50633_MBCS1_USBPRES) | ||
311 | pcf50633_mbc_irq_handler(PCF50633_IRQ_USBINS, mbc); | ||
312 | if (mbcs1 & PCF50633_MBCS1_ADAPTPRES) | ||
313 | pcf50633_mbc_irq_handler(PCF50633_IRQ_ADPINS, mbc); | ||
314 | |||
315 | return 0; | ||
316 | } | ||
317 | |||
318 | static int __devexit pcf50633_mbc_remove(struct platform_device *pdev) | ||
319 | { | ||
320 | struct pcf50633_mbc *mbc = platform_get_drvdata(pdev); | ||
321 | int i; | ||
322 | |||
323 | /* Remove IRQ handlers */ | ||
324 | for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++) | ||
325 | pcf50633_free_irq(mbc->pcf, mbc_irq_handlers[i]); | ||
326 | |||
327 | power_supply_unregister(&mbc->usb); | ||
328 | power_supply_unregister(&mbc->adapter); | ||
329 | |||
330 | kfree(mbc); | ||
331 | |||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | static struct platform_driver pcf50633_mbc_driver = { | ||
336 | .driver = { | ||
337 | .name = "pcf50633-mbc", | ||
338 | }, | ||
339 | .probe = pcf50633_mbc_probe, | ||
340 | .remove = __devexit_p(pcf50633_mbc_remove), | ||
341 | }; | ||
342 | |||
343 | static int __init pcf50633_mbc_init(void) | ||
344 | { | ||
345 | return platform_driver_register(&pcf50633_mbc_driver); | ||
346 | } | ||
347 | module_init(pcf50633_mbc_init); | ||
348 | |||
349 | static void __exit pcf50633_mbc_exit(void) | ||
350 | { | ||
351 | platform_driver_unregister(&pcf50633_mbc_driver); | ||
352 | } | ||
353 | module_exit(pcf50633_mbc_exit); | ||
354 | |||
355 | MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>"); | ||
356 | MODULE_DESCRIPTION("PCF50633 mbc driver"); | ||
357 | MODULE_LICENSE("GPL"); | ||
358 | MODULE_ALIAS("platform:pcf50633-mbc"); | ||
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 39360e2a4540..e7e0cf102d6d 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig | |||
@@ -73,4 +73,11 @@ config REGULATOR_DA903X | |||
73 | Say y here to support the BUCKs and LDOs regulators found on | 73 | Say y here to support the BUCKs and LDOs regulators found on |
74 | Dialog Semiconductor DA9030/DA9034 PMIC. | 74 | Dialog Semiconductor DA9030/DA9034 PMIC. |
75 | 75 | ||
76 | config REGULATOR_PCF50633 | ||
77 | tristate "PCF50633 regulator driver" | ||
78 | depends on MFD_PCF50633 | ||
79 | help | ||
80 | Say Y here to support the voltage regulators and convertors | ||
81 | on PCF50633 | ||
82 | |||
76 | endif | 83 | endif |
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 254d40c02ee8..61b30c6ddecc 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile | |||
@@ -11,5 +11,6 @@ obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o | |||
11 | obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o | 11 | obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o |
12 | obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o | 12 | obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o |
13 | obj-$(CONFIG_REGULATOR_DA903X) += da903x.o | 13 | obj-$(CONFIG_REGULATOR_DA903X) += da903x.o |
14 | obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o | ||
14 | 15 | ||
15 | ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG | 16 | ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG |
diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c new file mode 100644 index 000000000000..4cc85ec6e120 --- /dev/null +++ b/drivers/regulator/pcf50633-regulator.c | |||
@@ -0,0 +1,329 @@ | |||
1 | /* NXP PCF50633 PMIC Driver | ||
2 | * | ||
3 | * (C) 2006-2008 by Openmoko, Inc. | ||
4 | * Author: Balaji Rao <balajirrao@openmoko.org> | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Broken down from monstrous PCF50633 driver mainly by | ||
8 | * Harald Welte and Andy Green and Werner Almesberger | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/device.h> | ||
21 | #include <linux/err.h> | ||
22 | #include <linux/platform_device.h> | ||
23 | |||
24 | #include <linux/mfd/pcf50633/core.h> | ||
25 | #include <linux/mfd/pcf50633/pmic.h> | ||
26 | |||
27 | #define PCF50633_REGULATOR(_name, _id) \ | ||
28 | { \ | ||
29 | .name = _name, \ | ||
30 | .id = _id, \ | ||
31 | .ops = &pcf50633_regulator_ops, \ | ||
32 | .type = REGULATOR_VOLTAGE, \ | ||
33 | .owner = THIS_MODULE, \ | ||
34 | } | ||
35 | |||
36 | static const u8 pcf50633_regulator_registers[PCF50633_NUM_REGULATORS] = { | ||
37 | [PCF50633_REGULATOR_AUTO] = PCF50633_REG_AUTOOUT, | ||
38 | [PCF50633_REGULATOR_DOWN1] = PCF50633_REG_DOWN1OUT, | ||
39 | [PCF50633_REGULATOR_DOWN2] = PCF50633_REG_DOWN2OUT, | ||
40 | [PCF50633_REGULATOR_MEMLDO] = PCF50633_REG_MEMLDOOUT, | ||
41 | [PCF50633_REGULATOR_LDO1] = PCF50633_REG_LDO1OUT, | ||
42 | [PCF50633_REGULATOR_LDO2] = PCF50633_REG_LDO2OUT, | ||
43 | [PCF50633_REGULATOR_LDO3] = PCF50633_REG_LDO3OUT, | ||
44 | [PCF50633_REGULATOR_LDO4] = PCF50633_REG_LDO4OUT, | ||
45 | [PCF50633_REGULATOR_LDO5] = PCF50633_REG_LDO5OUT, | ||
46 | [PCF50633_REGULATOR_LDO6] = PCF50633_REG_LDO6OUT, | ||
47 | [PCF50633_REGULATOR_HCLDO] = PCF50633_REG_HCLDOOUT, | ||
48 | }; | ||
49 | |||
50 | /* Bits from voltage value */ | ||
51 | static u8 auto_voltage_bits(unsigned int millivolts) | ||
52 | { | ||
53 | if (millivolts < 1800) | ||
54 | return 0; | ||
55 | if (millivolts > 3800) | ||
56 | return 0xff; | ||
57 | |||
58 | millivolts -= 625; | ||
59 | |||
60 | return millivolts / 25; | ||
61 | } | ||
62 | |||
63 | static u8 down_voltage_bits(unsigned int millivolts) | ||
64 | { | ||
65 | if (millivolts < 625) | ||
66 | return 0; | ||
67 | else if (millivolts > 3000) | ||
68 | return 0xff; | ||
69 | |||
70 | millivolts -= 625; | ||
71 | |||
72 | return millivolts / 25; | ||
73 | } | ||
74 | |||
75 | static u8 ldo_voltage_bits(unsigned int millivolts) | ||
76 | { | ||
77 | if (millivolts < 900) | ||
78 | return 0; | ||
79 | else if (millivolts > 3600) | ||
80 | return 0x1f; | ||
81 | |||
82 | millivolts -= 900; | ||
83 | return millivolts / 100; | ||
84 | } | ||
85 | |||
86 | /* Obtain voltage value from bits */ | ||
87 | static unsigned int auto_voltage_value(u8 bits) | ||
88 | { | ||
89 | if (bits < 0x2f) | ||
90 | return 0; | ||
91 | |||
92 | return 625 + (bits * 25); | ||
93 | } | ||
94 | |||
95 | |||
96 | static unsigned int down_voltage_value(u8 bits) | ||
97 | { | ||
98 | return 625 + (bits * 25); | ||
99 | } | ||
100 | |||
101 | |||
102 | static unsigned int ldo_voltage_value(u8 bits) | ||
103 | { | ||
104 | bits &= 0x1f; | ||
105 | |||
106 | return 900 + (bits * 100); | ||
107 | } | ||
108 | |||
109 | static int pcf50633_regulator_set_voltage(struct regulator_dev *rdev, | ||
110 | int min_uV, int max_uV) | ||
111 | { | ||
112 | struct pcf50633 *pcf; | ||
113 | int regulator_id, millivolts; | ||
114 | u8 volt_bits, regnr; | ||
115 | |||
116 | pcf = rdev_get_drvdata(rdev); | ||
117 | |||
118 | regulator_id = rdev_get_id(rdev); | ||
119 | if (regulator_id >= PCF50633_NUM_REGULATORS) | ||
120 | return -EINVAL; | ||
121 | |||
122 | millivolts = min_uV / 1000; | ||
123 | |||
124 | regnr = pcf50633_regulator_registers[regulator_id]; | ||
125 | |||
126 | switch (regulator_id) { | ||
127 | case PCF50633_REGULATOR_AUTO: | ||
128 | volt_bits = auto_voltage_bits(millivolts); | ||
129 | break; | ||
130 | case PCF50633_REGULATOR_DOWN1: | ||
131 | volt_bits = down_voltage_bits(millivolts); | ||
132 | break; | ||
133 | case PCF50633_REGULATOR_DOWN2: | ||
134 | volt_bits = down_voltage_bits(millivolts); | ||
135 | break; | ||
136 | case PCF50633_REGULATOR_LDO1: | ||
137 | case PCF50633_REGULATOR_LDO2: | ||
138 | case PCF50633_REGULATOR_LDO3: | ||
139 | case PCF50633_REGULATOR_LDO4: | ||
140 | case PCF50633_REGULATOR_LDO5: | ||
141 | case PCF50633_REGULATOR_LDO6: | ||
142 | case PCF50633_REGULATOR_HCLDO: | ||
143 | volt_bits = ldo_voltage_bits(millivolts); | ||
144 | break; | ||
145 | default: | ||
146 | return -EINVAL; | ||
147 | } | ||
148 | |||
149 | return pcf50633_reg_write(pcf, regnr, volt_bits); | ||
150 | } | ||
151 | |||
152 | static int pcf50633_regulator_get_voltage(struct regulator_dev *rdev) | ||
153 | { | ||
154 | struct pcf50633 *pcf; | ||
155 | int regulator_id, millivolts, volt_bits; | ||
156 | u8 regnr; | ||
157 | |||
158 | pcf = rdev_get_drvdata(rdev);; | ||
159 | |||
160 | regulator_id = rdev_get_id(rdev); | ||
161 | if (regulator_id >= PCF50633_NUM_REGULATORS) | ||
162 | return -EINVAL; | ||
163 | |||
164 | regnr = pcf50633_regulator_registers[regulator_id]; | ||
165 | |||
166 | volt_bits = pcf50633_reg_read(pcf, regnr); | ||
167 | if (volt_bits < 0) | ||
168 | return -1; | ||
169 | |||
170 | switch (regulator_id) { | ||
171 | case PCF50633_REGULATOR_AUTO: | ||
172 | millivolts = auto_voltage_value(volt_bits); | ||
173 | break; | ||
174 | case PCF50633_REGULATOR_DOWN1: | ||
175 | millivolts = down_voltage_value(volt_bits); | ||
176 | break; | ||
177 | case PCF50633_REGULATOR_DOWN2: | ||
178 | millivolts = down_voltage_value(volt_bits); | ||
179 | break; | ||
180 | case PCF50633_REGULATOR_LDO1: | ||
181 | case PCF50633_REGULATOR_LDO2: | ||
182 | case PCF50633_REGULATOR_LDO3: | ||
183 | case PCF50633_REGULATOR_LDO4: | ||
184 | case PCF50633_REGULATOR_LDO5: | ||
185 | case PCF50633_REGULATOR_LDO6: | ||
186 | case PCF50633_REGULATOR_HCLDO: | ||
187 | millivolts = ldo_voltage_value(volt_bits); | ||
188 | break; | ||
189 | default: | ||
190 | return -EINVAL; | ||
191 | } | ||
192 | |||
193 | return millivolts * 1000; | ||
194 | } | ||
195 | |||
196 | static int pcf50633_regulator_enable(struct regulator_dev *rdev) | ||
197 | { | ||
198 | struct pcf50633 *pcf = rdev_get_drvdata(rdev); | ||
199 | int regulator_id; | ||
200 | u8 regnr; | ||
201 | |||
202 | regulator_id = rdev_get_id(rdev); | ||
203 | if (regulator_id >= PCF50633_NUM_REGULATORS) | ||
204 | return -EINVAL; | ||
205 | |||
206 | /* The *ENA register is always one after the *OUT register */ | ||
207 | regnr = pcf50633_regulator_registers[regulator_id] + 1; | ||
208 | |||
209 | return pcf50633_reg_set_bit_mask(pcf, regnr, PCF50633_REGULATOR_ON, | ||
210 | PCF50633_REGULATOR_ON); | ||
211 | } | ||
212 | |||
213 | static int pcf50633_regulator_disable(struct regulator_dev *rdev) | ||
214 | { | ||
215 | struct pcf50633 *pcf = rdev_get_drvdata(rdev); | ||
216 | int regulator_id; | ||
217 | u8 regnr; | ||
218 | |||
219 | regulator_id = rdev_get_id(rdev); | ||
220 | if (regulator_id >= PCF50633_NUM_REGULATORS) | ||
221 | return -EINVAL; | ||
222 | |||
223 | /* the *ENA register is always one after the *OUT register */ | ||
224 | regnr = pcf50633_regulator_registers[regulator_id] + 1; | ||
225 | |||
226 | return pcf50633_reg_set_bit_mask(pcf, regnr, | ||
227 | PCF50633_REGULATOR_ON, 0); | ||
228 | } | ||
229 | |||
230 | static int pcf50633_regulator_is_enabled(struct regulator_dev *rdev) | ||
231 | { | ||
232 | struct pcf50633 *pcf = rdev_get_drvdata(rdev); | ||
233 | int regulator_id = rdev_get_id(rdev); | ||
234 | u8 regnr; | ||
235 | |||
236 | regulator_id = rdev_get_id(rdev); | ||
237 | if (regulator_id >= PCF50633_NUM_REGULATORS) | ||
238 | return -EINVAL; | ||
239 | |||
240 | /* the *ENA register is always one after the *OUT register */ | ||
241 | regnr = pcf50633_regulator_registers[regulator_id] + 1; | ||
242 | |||
243 | return pcf50633_reg_read(pcf, regnr) & PCF50633_REGULATOR_ON; | ||
244 | } | ||
245 | |||
246 | static struct regulator_ops pcf50633_regulator_ops = { | ||
247 | .set_voltage = pcf50633_regulator_set_voltage, | ||
248 | .get_voltage = pcf50633_regulator_get_voltage, | ||
249 | .enable = pcf50633_regulator_enable, | ||
250 | .disable = pcf50633_regulator_disable, | ||
251 | .is_enabled = pcf50633_regulator_is_enabled, | ||
252 | }; | ||
253 | |||
254 | static struct regulator_desc regulators[] = { | ||
255 | [PCF50633_REGULATOR_AUTO] = | ||
256 | PCF50633_REGULATOR("auto", PCF50633_REGULATOR_AUTO), | ||
257 | [PCF50633_REGULATOR_DOWN1] = | ||
258 | PCF50633_REGULATOR("down1", PCF50633_REGULATOR_DOWN1), | ||
259 | [PCF50633_REGULATOR_DOWN2] = | ||
260 | PCF50633_REGULATOR("down2", PCF50633_REGULATOR_DOWN2), | ||
261 | [PCF50633_REGULATOR_LDO1] = | ||
262 | PCF50633_REGULATOR("ldo1", PCF50633_REGULATOR_LDO1), | ||
263 | [PCF50633_REGULATOR_LDO2] = | ||
264 | PCF50633_REGULATOR("ldo2", PCF50633_REGULATOR_LDO2), | ||
265 | [PCF50633_REGULATOR_LDO3] = | ||
266 | PCF50633_REGULATOR("ldo3", PCF50633_REGULATOR_LDO3), | ||
267 | [PCF50633_REGULATOR_LDO4] = | ||
268 | PCF50633_REGULATOR("ldo4", PCF50633_REGULATOR_LDO4), | ||
269 | [PCF50633_REGULATOR_LDO5] = | ||
270 | PCF50633_REGULATOR("ldo5", PCF50633_REGULATOR_LDO5), | ||
271 | [PCF50633_REGULATOR_LDO6] = | ||
272 | PCF50633_REGULATOR("ldo6", PCF50633_REGULATOR_LDO6), | ||
273 | [PCF50633_REGULATOR_HCLDO] = | ||
274 | PCF50633_REGULATOR("hcldo", PCF50633_REGULATOR_HCLDO), | ||
275 | [PCF50633_REGULATOR_MEMLDO] = | ||
276 | PCF50633_REGULATOR("memldo", PCF50633_REGULATOR_MEMLDO), | ||
277 | }; | ||
278 | |||
279 | static int __devinit pcf50633_regulator_probe(struct platform_device *pdev) | ||
280 | { | ||
281 | struct regulator_dev *rdev; | ||
282 | struct pcf50633 *pcf; | ||
283 | |||
284 | /* Already set by core driver */ | ||
285 | pcf = platform_get_drvdata(pdev); | ||
286 | |||
287 | rdev = regulator_register(®ulators[pdev->id], &pdev->dev, pcf); | ||
288 | if (IS_ERR(rdev)) | ||
289 | return PTR_ERR(rdev); | ||
290 | |||
291 | if (pcf->pdata->regulator_registered) | ||
292 | pcf->pdata->regulator_registered(pcf, pdev->id); | ||
293 | |||
294 | return 0; | ||
295 | } | ||
296 | |||
297 | static int __devexit pcf50633_regulator_remove(struct platform_device *pdev) | ||
298 | { | ||
299 | struct regulator_dev *rdev = platform_get_drvdata(pdev); | ||
300 | |||
301 | regulator_unregister(rdev); | ||
302 | |||
303 | return 0; | ||
304 | } | ||
305 | |||
306 | static struct platform_driver pcf50633_regulator_driver = { | ||
307 | .driver = { | ||
308 | .name = "pcf50633-regltr", | ||
309 | }, | ||
310 | .probe = pcf50633_regulator_probe, | ||
311 | .remove = __devexit_p(pcf50633_regulator_remove), | ||
312 | }; | ||
313 | |||
314 | static int __init pcf50633_regulator_init(void) | ||
315 | { | ||
316 | return platform_driver_register(&pcf50633_regulator_driver); | ||
317 | } | ||
318 | module_init(pcf50633_regulator_init); | ||
319 | |||
320 | static void __exit pcf50633_regulator_exit(void) | ||
321 | { | ||
322 | platform_driver_unregister(&pcf50633_regulator_driver); | ||
323 | } | ||
324 | module_exit(pcf50633_regulator_exit); | ||
325 | |||
326 | MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>"); | ||
327 | MODULE_DESCRIPTION("PCF50633 regulator driver"); | ||
328 | MODULE_LICENSE("GPL"); | ||
329 | MODULE_ALIAS("platform:pcf50633-regulator"); | ||
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 4ad831de41ad..cced4d108319 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
@@ -502,6 +502,13 @@ config RTC_DRV_WM8350 | |||
502 | This driver can also be built as a module. If so, the module | 502 | This driver can also be built as a module. If so, the module |
503 | will be called "rtc-wm8350". | 503 | will be called "rtc-wm8350". |
504 | 504 | ||
505 | config RTC_DRV_PCF50633 | ||
506 | depends on MFD_PCF50633 | ||
507 | tristate "NXP PCF50633 RTC" | ||
508 | help | ||
509 | If you say yes here you get support for the RTC subsystem of the | ||
510 | NXP PCF50633 used in embedded systems. | ||
511 | |||
505 | comment "on-CPU RTC drivers" | 512 | comment "on-CPU RTC drivers" |
506 | 513 | ||
507 | config RTC_DRV_OMAP | 514 | config RTC_DRV_OMAP |
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 9a4340d48f26..6e28021abb9d 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile | |||
@@ -74,3 +74,4 @@ obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o | |||
74 | obj-$(CONFIG_RTC_DRV_VR41XX) += rtc-vr41xx.o | 74 | obj-$(CONFIG_RTC_DRV_VR41XX) += rtc-vr41xx.o |
75 | obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o | 75 | obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o |
76 | obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o | 76 | obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o |
77 | obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o | ||
diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c new file mode 100644 index 000000000000..f4dd87e29075 --- /dev/null +++ b/drivers/rtc/rtc-pcf50633.c | |||
@@ -0,0 +1,344 @@ | |||
1 | /* NXP PCF50633 RTC Driver | ||
2 | * | ||
3 | * (C) 2006-2008 by Openmoko, Inc. | ||
4 | * Author: Balaji Rao <balajirrao@openmoko.org> | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Broken down from monstrous PCF50633 driver mainly by | ||
8 | * Harald Welte, Andy Green and Werner Almesberger | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/device.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/rtc.h> | ||
23 | #include <linux/bcd.h> | ||
24 | #include <linux/err.h> | ||
25 | |||
26 | #include <linux/mfd/pcf50633/core.h> | ||
27 | |||
28 | #define PCF50633_REG_RTCSC 0x59 /* Second */ | ||
29 | #define PCF50633_REG_RTCMN 0x5a /* Minute */ | ||
30 | #define PCF50633_REG_RTCHR 0x5b /* Hour */ | ||
31 | #define PCF50633_REG_RTCWD 0x5c /* Weekday */ | ||
32 | #define PCF50633_REG_RTCDT 0x5d /* Day */ | ||
33 | #define PCF50633_REG_RTCMT 0x5e /* Month */ | ||
34 | #define PCF50633_REG_RTCYR 0x5f /* Year */ | ||
35 | #define PCF50633_REG_RTCSCA 0x60 /* Alarm Second */ | ||
36 | #define PCF50633_REG_RTCMNA 0x61 /* Alarm Minute */ | ||
37 | #define PCF50633_REG_RTCHRA 0x62 /* Alarm Hour */ | ||
38 | #define PCF50633_REG_RTCWDA 0x63 /* Alarm Weekday */ | ||
39 | #define PCF50633_REG_RTCDTA 0x64 /* Alarm Day */ | ||
40 | #define PCF50633_REG_RTCMTA 0x65 /* Alarm Month */ | ||
41 | #define PCF50633_REG_RTCYRA 0x66 /* Alarm Year */ | ||
42 | |||
43 | enum pcf50633_time_indexes { | ||
44 | PCF50633_TI_SEC, | ||
45 | PCF50633_TI_MIN, | ||
46 | PCF50633_TI_HOUR, | ||
47 | PCF50633_TI_WKDAY, | ||
48 | PCF50633_TI_DAY, | ||
49 | PCF50633_TI_MONTH, | ||
50 | PCF50633_TI_YEAR, | ||
51 | PCF50633_TI_EXTENT /* always last */ | ||
52 | }; | ||
53 | |||
54 | struct pcf50633_time { | ||
55 | u_int8_t time[PCF50633_TI_EXTENT]; | ||
56 | }; | ||
57 | |||
58 | struct pcf50633_rtc { | ||
59 | int alarm_enabled; | ||
60 | int second_enabled; | ||
61 | |||
62 | struct pcf50633 *pcf; | ||
63 | struct rtc_device *rtc_dev; | ||
64 | }; | ||
65 | |||
66 | static void pcf2rtc_time(struct rtc_time *rtc, struct pcf50633_time *pcf) | ||
67 | { | ||
68 | rtc->tm_sec = bcd2bin(pcf->time[PCF50633_TI_SEC]); | ||
69 | rtc->tm_min = bcd2bin(pcf->time[PCF50633_TI_MIN]); | ||
70 | rtc->tm_hour = bcd2bin(pcf->time[PCF50633_TI_HOUR]); | ||
71 | rtc->tm_wday = bcd2bin(pcf->time[PCF50633_TI_WKDAY]); | ||
72 | rtc->tm_mday = bcd2bin(pcf->time[PCF50633_TI_DAY]); | ||
73 | rtc->tm_mon = bcd2bin(pcf->time[PCF50633_TI_MONTH]); | ||
74 | rtc->tm_year = bcd2bin(pcf->time[PCF50633_TI_YEAR]) + 100; | ||
75 | } | ||
76 | |||
77 | static void rtc2pcf_time(struct pcf50633_time *pcf, struct rtc_time *rtc) | ||
78 | { | ||
79 | pcf->time[PCF50633_TI_SEC] = bin2bcd(rtc->tm_sec); | ||
80 | pcf->time[PCF50633_TI_MIN] = bin2bcd(rtc->tm_min); | ||
81 | pcf->time[PCF50633_TI_HOUR] = bin2bcd(rtc->tm_hour); | ||
82 | pcf->time[PCF50633_TI_WKDAY] = bin2bcd(rtc->tm_wday); | ||
83 | pcf->time[PCF50633_TI_DAY] = bin2bcd(rtc->tm_mday); | ||
84 | pcf->time[PCF50633_TI_MONTH] = bin2bcd(rtc->tm_mon); | ||
85 | pcf->time[PCF50633_TI_YEAR] = bin2bcd(rtc->tm_year % 100); | ||
86 | } | ||
87 | |||
88 | static int | ||
89 | pcf50633_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) | ||
90 | { | ||
91 | struct pcf50633_rtc *rtc = dev_get_drvdata(dev); | ||
92 | int err; | ||
93 | |||
94 | if (enabled) | ||
95 | err = pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); | ||
96 | else | ||
97 | err = pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM); | ||
98 | |||
99 | if (err < 0) | ||
100 | return err; | ||
101 | |||
102 | rtc->alarm_enabled = enabled; | ||
103 | |||
104 | return 0; | ||
105 | } | ||
106 | |||
107 | static int | ||
108 | pcf50633_rtc_update_irq_enable(struct device *dev, unsigned int enabled) | ||
109 | { | ||
110 | struct pcf50633_rtc *rtc = dev_get_drvdata(dev); | ||
111 | int err; | ||
112 | |||
113 | if (enabled) | ||
114 | err = pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_SECOND); | ||
115 | else | ||
116 | err = pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_SECOND); | ||
117 | |||
118 | if (err < 0) | ||
119 | return err; | ||
120 | |||
121 | rtc->second_enabled = enabled; | ||
122 | |||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | static int pcf50633_rtc_read_time(struct device *dev, struct rtc_time *tm) | ||
127 | { | ||
128 | struct pcf50633_rtc *rtc; | ||
129 | struct pcf50633_time pcf_tm; | ||
130 | int ret; | ||
131 | |||
132 | rtc = dev_get_drvdata(dev); | ||
133 | |||
134 | ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSC, | ||
135 | PCF50633_TI_EXTENT, | ||
136 | &pcf_tm.time[0]); | ||
137 | if (ret != PCF50633_TI_EXTENT) { | ||
138 | dev_err(dev, "Failed to read time\n"); | ||
139 | return -EIO; | ||
140 | } | ||
141 | |||
142 | dev_dbg(dev, "PCF_TIME: %02x.%02x.%02x %02x:%02x:%02x\n", | ||
143 | pcf_tm.time[PCF50633_TI_DAY], | ||
144 | pcf_tm.time[PCF50633_TI_MONTH], | ||
145 | pcf_tm.time[PCF50633_TI_YEAR], | ||
146 | pcf_tm.time[PCF50633_TI_HOUR], | ||
147 | pcf_tm.time[PCF50633_TI_MIN], | ||
148 | pcf_tm.time[PCF50633_TI_SEC]); | ||
149 | |||
150 | pcf2rtc_time(tm, &pcf_tm); | ||
151 | |||
152 | dev_dbg(dev, "RTC_TIME: %u.%u.%u %u:%u:%u\n", | ||
153 | tm->tm_mday, tm->tm_mon, tm->tm_year, | ||
154 | tm->tm_hour, tm->tm_min, tm->tm_sec); | ||
155 | |||
156 | return rtc_valid_tm(tm); | ||
157 | } | ||
158 | |||
159 | static int pcf50633_rtc_set_time(struct device *dev, struct rtc_time *tm) | ||
160 | { | ||
161 | struct pcf50633_rtc *rtc; | ||
162 | struct pcf50633_time pcf_tm; | ||
163 | int second_masked, alarm_masked, ret = 0; | ||
164 | |||
165 | rtc = dev_get_drvdata(dev); | ||
166 | |||
167 | dev_dbg(dev, "RTC_TIME: %u.%u.%u %u:%u:%u\n", | ||
168 | tm->tm_mday, tm->tm_mon, tm->tm_year, | ||
169 | tm->tm_hour, tm->tm_min, tm->tm_sec); | ||
170 | |||
171 | rtc2pcf_time(&pcf_tm, tm); | ||
172 | |||
173 | dev_dbg(dev, "PCF_TIME: %02x.%02x.%02x %02x:%02x:%02x\n", | ||
174 | pcf_tm.time[PCF50633_TI_DAY], | ||
175 | pcf_tm.time[PCF50633_TI_MONTH], | ||
176 | pcf_tm.time[PCF50633_TI_YEAR], | ||
177 | pcf_tm.time[PCF50633_TI_HOUR], | ||
178 | pcf_tm.time[PCF50633_TI_MIN], | ||
179 | pcf_tm.time[PCF50633_TI_SEC]); | ||
180 | |||
181 | |||
182 | second_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_SECOND); | ||
183 | alarm_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_ALARM); | ||
184 | |||
185 | if (!second_masked) | ||
186 | pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_SECOND); | ||
187 | if (!alarm_masked) | ||
188 | pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM); | ||
189 | |||
190 | /* Returns 0 on success */ | ||
191 | ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSC, | ||
192 | PCF50633_TI_EXTENT, | ||
193 | &pcf_tm.time[0]); | ||
194 | |||
195 | if (!second_masked) | ||
196 | pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_SECOND); | ||
197 | if (!alarm_masked) | ||
198 | pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); | ||
199 | |||
200 | return ret; | ||
201 | } | ||
202 | |||
203 | static int pcf50633_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) | ||
204 | { | ||
205 | struct pcf50633_rtc *rtc; | ||
206 | struct pcf50633_time pcf_tm; | ||
207 | int ret = 0; | ||
208 | |||
209 | rtc = dev_get_drvdata(dev); | ||
210 | |||
211 | alrm->enabled = rtc->alarm_enabled; | ||
212 | |||
213 | ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSCA, | ||
214 | PCF50633_TI_EXTENT, &pcf_tm.time[0]); | ||
215 | if (ret != PCF50633_TI_EXTENT) { | ||
216 | dev_err(dev, "Failed to read time\n"); | ||
217 | return -EIO; | ||
218 | } | ||
219 | |||
220 | pcf2rtc_time(&alrm->time, &pcf_tm); | ||
221 | |||
222 | return rtc_valid_tm(&alrm->time); | ||
223 | } | ||
224 | |||
225 | static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) | ||
226 | { | ||
227 | struct pcf50633_rtc *rtc; | ||
228 | struct pcf50633_time pcf_tm; | ||
229 | int alarm_masked, ret = 0; | ||
230 | |||
231 | rtc = dev_get_drvdata(dev); | ||
232 | |||
233 | rtc2pcf_time(&pcf_tm, &alrm->time); | ||
234 | |||
235 | /* do like mktime does and ignore tm_wday */ | ||
236 | pcf_tm.time[PCF50633_TI_WKDAY] = 7; | ||
237 | |||
238 | alarm_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_ALARM); | ||
239 | |||
240 | /* disable alarm interrupt */ | ||
241 | if (!alarm_masked) | ||
242 | pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM); | ||
243 | |||
244 | /* Returns 0 on success */ | ||
245 | ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA, | ||
246 | PCF50633_TI_EXTENT, &pcf_tm.time[0]); | ||
247 | |||
248 | if (!alarm_masked) | ||
249 | pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); | ||
250 | |||
251 | return ret; | ||
252 | } | ||
253 | |||
254 | static struct rtc_class_ops pcf50633_rtc_ops = { | ||
255 | .read_time = pcf50633_rtc_read_time, | ||
256 | .set_time = pcf50633_rtc_set_time, | ||
257 | .read_alarm = pcf50633_rtc_read_alarm, | ||
258 | .set_alarm = pcf50633_rtc_set_alarm, | ||
259 | .alarm_irq_enable = pcf50633_rtc_alarm_irq_enable, | ||
260 | .update_irq_enable = pcf50633_rtc_update_irq_enable, | ||
261 | }; | ||
262 | |||
263 | static void pcf50633_rtc_irq(int irq, void *data) | ||
264 | { | ||
265 | struct pcf50633_rtc *rtc = data; | ||
266 | |||
267 | switch (irq) { | ||
268 | case PCF50633_IRQ_ALARM: | ||
269 | rtc_update_irq(rtc->rtc_dev, 1, RTC_AF | RTC_IRQF); | ||
270 | break; | ||
271 | case PCF50633_IRQ_SECOND: | ||
272 | rtc_update_irq(rtc->rtc_dev, 1, RTC_UF | RTC_IRQF); | ||
273 | break; | ||
274 | } | ||
275 | } | ||
276 | |||
277 | static int __devinit pcf50633_rtc_probe(struct platform_device *pdev) | ||
278 | { | ||
279 | struct pcf50633_subdev_pdata *pdata; | ||
280 | struct pcf50633_rtc *rtc; | ||
281 | |||
282 | |||
283 | rtc = kzalloc(sizeof(*rtc), GFP_KERNEL); | ||
284 | if (!rtc) | ||
285 | return -ENOMEM; | ||
286 | |||
287 | pdata = pdev->dev.platform_data; | ||
288 | rtc->pcf = pdata->pcf; | ||
289 | platform_set_drvdata(pdev, rtc); | ||
290 | rtc->rtc_dev = rtc_device_register("pcf50633-rtc", &pdev->dev, | ||
291 | &pcf50633_rtc_ops, THIS_MODULE); | ||
292 | |||
293 | if (IS_ERR(rtc->rtc_dev)) { | ||
294 | kfree(rtc); | ||
295 | return PTR_ERR(rtc->rtc_dev); | ||
296 | } | ||
297 | |||
298 | pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM, | ||
299 | pcf50633_rtc_irq, rtc); | ||
300 | pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_SECOND, | ||
301 | pcf50633_rtc_irq, rtc); | ||
302 | |||
303 | return 0; | ||
304 | } | ||
305 | |||
306 | static int __devexit pcf50633_rtc_remove(struct platform_device *pdev) | ||
307 | { | ||
308 | struct pcf50633_rtc *rtc; | ||
309 | |||
310 | rtc = platform_get_drvdata(pdev); | ||
311 | |||
312 | pcf50633_free_irq(rtc->pcf, PCF50633_IRQ_ALARM); | ||
313 | pcf50633_free_irq(rtc->pcf, PCF50633_IRQ_SECOND); | ||
314 | |||
315 | rtc_device_unregister(rtc->rtc_dev); | ||
316 | kfree(rtc); | ||
317 | |||
318 | return 0; | ||
319 | } | ||
320 | |||
321 | static struct platform_driver pcf50633_rtc_driver = { | ||
322 | .driver = { | ||
323 | .name = "pcf50633-rtc", | ||
324 | }, | ||
325 | .probe = pcf50633_rtc_probe, | ||
326 | .remove = __devexit_p(pcf50633_rtc_remove), | ||
327 | }; | ||
328 | |||
329 | static int __init pcf50633_rtc_init(void) | ||
330 | { | ||
331 | return platform_driver_register(&pcf50633_rtc_driver); | ||
332 | } | ||
333 | module_init(pcf50633_rtc_init); | ||
334 | |||
335 | static void __exit pcf50633_rtc_exit(void) | ||
336 | { | ||
337 | platform_driver_unregister(&pcf50633_rtc_driver); | ||
338 | } | ||
339 | module_exit(pcf50633_rtc_exit); | ||
340 | |||
341 | MODULE_DESCRIPTION("PCF50633 RTC driver"); | ||
342 | MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>"); | ||
343 | MODULE_LICENSE("GPL"); | ||
344 | |||
diff --git a/drivers/rtc/rtc-pxa.c b/drivers/rtc/rtc-pxa.c index cc7eb8767b82..bd56a033bfd0 100644 --- a/drivers/rtc/rtc-pxa.c +++ b/drivers/rtc/rtc-pxa.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | 29 | ||
30 | #include <mach/hardware.h> | ||
31 | |||
30 | #define TIMER_FREQ CLOCK_TICK_RATE | 32 | #define TIMER_FREQ CLOCK_TICK_RATE |
31 | #define RTC_DEF_DIVIDER (32768 - 1) | 33 | #define RTC_DEF_DIVIDER (32768 - 1) |
32 | #define RTC_DEF_TRIM 0 | 34 | #define RTC_DEF_TRIM 0 |
diff --git a/drivers/rtc/rtc-twl4030.c b/drivers/rtc/rtc-twl4030.c index 8ce5f74ee45b..ad35f76c46b7 100644 --- a/drivers/rtc/rtc-twl4030.c +++ b/drivers/rtc/rtc-twl4030.c | |||
@@ -120,7 +120,7 @@ static int twl4030_rtc_write_u8(u8 data, u8 reg) | |||
120 | static unsigned char rtc_irq_bits; | 120 | static unsigned char rtc_irq_bits; |
121 | 121 | ||
122 | /* | 122 | /* |
123 | * Enable timer and/or alarm interrupts. | 123 | * Enable 1/second update and/or alarm interrupts. |
124 | */ | 124 | */ |
125 | static int set_rtc_irq_bit(unsigned char bit) | 125 | static int set_rtc_irq_bit(unsigned char bit) |
126 | { | 126 | { |
@@ -128,6 +128,7 @@ static int set_rtc_irq_bit(unsigned char bit) | |||
128 | int ret; | 128 | int ret; |
129 | 129 | ||
130 | val = rtc_irq_bits | bit; | 130 | val = rtc_irq_bits | bit; |
131 | val &= ~BIT_RTC_INTERRUPTS_REG_EVERY_M; | ||
131 | ret = twl4030_rtc_write_u8(val, REG_RTC_INTERRUPTS_REG); | 132 | ret = twl4030_rtc_write_u8(val, REG_RTC_INTERRUPTS_REG); |
132 | if (ret == 0) | 133 | if (ret == 0) |
133 | rtc_irq_bits = val; | 134 | rtc_irq_bits = val; |
@@ -136,7 +137,7 @@ static int set_rtc_irq_bit(unsigned char bit) | |||
136 | } | 137 | } |
137 | 138 | ||
138 | /* | 139 | /* |
139 | * Disable timer and/or alarm interrupts. | 140 | * Disable update and/or alarm interrupts. |
140 | */ | 141 | */ |
141 | static int mask_rtc_irq_bit(unsigned char bit) | 142 | static int mask_rtc_irq_bit(unsigned char bit) |
142 | { | 143 | { |
@@ -151,7 +152,7 @@ static int mask_rtc_irq_bit(unsigned char bit) | |||
151 | return ret; | 152 | return ret; |
152 | } | 153 | } |
153 | 154 | ||
154 | static inline int twl4030_rtc_alarm_irq_set_state(int enabled) | 155 | static int twl4030_rtc_alarm_irq_enable(struct device *dev, unsigned enabled) |
155 | { | 156 | { |
156 | int ret; | 157 | int ret; |
157 | 158 | ||
@@ -163,7 +164,7 @@ static inline int twl4030_rtc_alarm_irq_set_state(int enabled) | |||
163 | return ret; | 164 | return ret; |
164 | } | 165 | } |
165 | 166 | ||
166 | static inline int twl4030_rtc_irq_set_state(int enabled) | 167 | static int twl4030_rtc_update_irq_enable(struct device *dev, unsigned enabled) |
167 | { | 168 | { |
168 | int ret; | 169 | int ret; |
169 | 170 | ||
@@ -292,7 +293,7 @@ static int twl4030_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) | |||
292 | unsigned char alarm_data[ALL_TIME_REGS + 1]; | 293 | unsigned char alarm_data[ALL_TIME_REGS + 1]; |
293 | int ret; | 294 | int ret; |
294 | 295 | ||
295 | ret = twl4030_rtc_alarm_irq_set_state(0); | 296 | ret = twl4030_rtc_alarm_irq_enable(dev, 0); |
296 | if (ret) | 297 | if (ret) |
297 | goto out; | 298 | goto out; |
298 | 299 | ||
@@ -312,35 +313,11 @@ static int twl4030_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) | |||
312 | } | 313 | } |
313 | 314 | ||
314 | if (alm->enabled) | 315 | if (alm->enabled) |
315 | ret = twl4030_rtc_alarm_irq_set_state(1); | 316 | ret = twl4030_rtc_alarm_irq_enable(dev, 1); |
316 | out: | 317 | out: |
317 | return ret; | 318 | return ret; |
318 | } | 319 | } |
319 | 320 | ||
320 | #ifdef CONFIG_RTC_INTF_DEV | ||
321 | |||
322 | static int twl4030_rtc_ioctl(struct device *dev, unsigned int cmd, | ||
323 | unsigned long arg) | ||
324 | { | ||
325 | switch (cmd) { | ||
326 | case RTC_AIE_OFF: | ||
327 | return twl4030_rtc_alarm_irq_set_state(0); | ||
328 | case RTC_AIE_ON: | ||
329 | return twl4030_rtc_alarm_irq_set_state(1); | ||
330 | case RTC_UIE_OFF: | ||
331 | return twl4030_rtc_irq_set_state(0); | ||
332 | case RTC_UIE_ON: | ||
333 | return twl4030_rtc_irq_set_state(1); | ||
334 | |||
335 | default: | ||
336 | return -ENOIOCTLCMD; | ||
337 | } | ||
338 | } | ||
339 | |||
340 | #else | ||
341 | #define twl4030_rtc_ioctl NULL | ||
342 | #endif | ||
343 | |||
344 | static irqreturn_t twl4030_rtc_interrupt(int irq, void *rtc) | 321 | static irqreturn_t twl4030_rtc_interrupt(int irq, void *rtc) |
345 | { | 322 | { |
346 | unsigned long events = 0; | 323 | unsigned long events = 0; |
@@ -400,11 +377,12 @@ out: | |||
400 | } | 377 | } |
401 | 378 | ||
402 | static struct rtc_class_ops twl4030_rtc_ops = { | 379 | static struct rtc_class_ops twl4030_rtc_ops = { |
403 | .ioctl = twl4030_rtc_ioctl, | ||
404 | .read_time = twl4030_rtc_read_time, | 380 | .read_time = twl4030_rtc_read_time, |
405 | .set_time = twl4030_rtc_set_time, | 381 | .set_time = twl4030_rtc_set_time, |
406 | .read_alarm = twl4030_rtc_read_alarm, | 382 | .read_alarm = twl4030_rtc_read_alarm, |
407 | .set_alarm = twl4030_rtc_set_alarm, | 383 | .set_alarm = twl4030_rtc_set_alarm, |
384 | .alarm_irq_enable = twl4030_rtc_alarm_irq_enable, | ||
385 | .update_irq_enable = twl4030_rtc_update_irq_enable, | ||
408 | }; | 386 | }; |
409 | 387 | ||
410 | /*----------------------------------------------------------------------*/ | 388 | /*----------------------------------------------------------------------*/ |
@@ -422,7 +400,7 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev) | |||
422 | rtc = rtc_device_register(pdev->name, | 400 | rtc = rtc_device_register(pdev->name, |
423 | &pdev->dev, &twl4030_rtc_ops, THIS_MODULE); | 401 | &pdev->dev, &twl4030_rtc_ops, THIS_MODULE); |
424 | if (IS_ERR(rtc)) { | 402 | if (IS_ERR(rtc)) { |
425 | ret = -EINVAL; | 403 | ret = PTR_ERR(rtc); |
426 | dev_err(&pdev->dev, "can't register RTC device, err %ld\n", | 404 | dev_err(&pdev->dev, "can't register RTC device, err %ld\n", |
427 | PTR_ERR(rtc)); | 405 | PTR_ERR(rtc)); |
428 | goto out0; | 406 | goto out0; |
@@ -432,7 +410,6 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev) | |||
432 | platform_set_drvdata(pdev, rtc); | 410 | platform_set_drvdata(pdev, rtc); |
433 | 411 | ||
434 | ret = twl4030_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG); | 412 | ret = twl4030_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG); |
435 | |||
436 | if (ret < 0) | 413 | if (ret < 0) |
437 | goto out1; | 414 | goto out1; |
438 | 415 | ||
@@ -475,7 +452,6 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev) | |||
475 | 452 | ||
476 | return ret; | 453 | return ret; |
477 | 454 | ||
478 | |||
479 | out2: | 455 | out2: |
480 | free_irq(irq, rtc); | 456 | free_irq(irq, rtc); |
481 | out1: | 457 | out1: |
@@ -506,8 +482,9 @@ static int __devexit twl4030_rtc_remove(struct platform_device *pdev) | |||
506 | 482 | ||
507 | static void twl4030_rtc_shutdown(struct platform_device *pdev) | 483 | static void twl4030_rtc_shutdown(struct platform_device *pdev) |
508 | { | 484 | { |
509 | mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M | | 485 | /* mask timer interrupts, but leave alarm interrupts on to enable |
510 | BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); | 486 | power-on when alarm is triggered */ |
487 | mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); | ||
511 | } | 488 | } |
512 | 489 | ||
513 | #ifdef CONFIG_PM | 490 | #ifdef CONFIG_PM |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index c4f1b046c3b1..07ab8a5c1c46 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -916,7 +916,7 @@ static struct ethtool_ops qeth_l2_osn_ops = { | |||
916 | .get_drvinfo = qeth_core_get_drvinfo, | 916 | .get_drvinfo = qeth_core_get_drvinfo, |
917 | }; | 917 | }; |
918 | 918 | ||
919 | static struct net_device_ops qeth_l2_netdev_ops = { | 919 | static const struct net_device_ops qeth_l2_netdev_ops = { |
920 | .ndo_open = qeth_l2_open, | 920 | .ndo_open = qeth_l2_open, |
921 | .ndo_stop = qeth_l2_stop, | 921 | .ndo_stop = qeth_l2_stop, |
922 | .ndo_get_stats = qeth_get_stats, | 922 | .ndo_get_stats = qeth_get_stats, |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 68d623ab7e6e..3d04920b9bb9 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -2894,7 +2894,7 @@ qeth_l3_neigh_setup(struct net_device *dev, struct neigh_parms *np) | |||
2894 | return 0; | 2894 | return 0; |
2895 | } | 2895 | } |
2896 | 2896 | ||
2897 | static struct net_device_ops qeth_l3_netdev_ops = { | 2897 | static const struct net_device_ops qeth_l3_netdev_ops = { |
2898 | .ndo_open = qeth_l3_open, | 2898 | .ndo_open = qeth_l3_open, |
2899 | .ndo_stop = qeth_l3_stop, | 2899 | .ndo_stop = qeth_l3_stop, |
2900 | .ndo_get_stats = qeth_get_stats, | 2900 | .ndo_get_stats = qeth_get_stats, |
@@ -2909,6 +2909,22 @@ static struct net_device_ops qeth_l3_netdev_ops = { | |||
2909 | .ndo_tx_timeout = qeth_tx_timeout, | 2909 | .ndo_tx_timeout = qeth_tx_timeout, |
2910 | }; | 2910 | }; |
2911 | 2911 | ||
2912 | static const struct net_device_ops qeth_l3_osa_netdev_ops = { | ||
2913 | .ndo_open = qeth_l3_open, | ||
2914 | .ndo_stop = qeth_l3_stop, | ||
2915 | .ndo_get_stats = qeth_get_stats, | ||
2916 | .ndo_start_xmit = qeth_l3_hard_start_xmit, | ||
2917 | .ndo_validate_addr = eth_validate_addr, | ||
2918 | .ndo_set_multicast_list = qeth_l3_set_multicast_list, | ||
2919 | .ndo_do_ioctl = qeth_l3_do_ioctl, | ||
2920 | .ndo_change_mtu = qeth_change_mtu, | ||
2921 | .ndo_vlan_rx_register = qeth_l3_vlan_rx_register, | ||
2922 | .ndo_vlan_rx_add_vid = qeth_l3_vlan_rx_add_vid, | ||
2923 | .ndo_vlan_rx_kill_vid = qeth_l3_vlan_rx_kill_vid, | ||
2924 | .ndo_tx_timeout = qeth_tx_timeout, | ||
2925 | .ndo_neigh_setup = qeth_l3_neigh_setup, | ||
2926 | }; | ||
2927 | |||
2912 | static int qeth_l3_setup_netdev(struct qeth_card *card) | 2928 | static int qeth_l3_setup_netdev(struct qeth_card *card) |
2913 | { | 2929 | { |
2914 | if (card->info.type == QETH_CARD_TYPE_OSAE) { | 2930 | if (card->info.type == QETH_CARD_TYPE_OSAE) { |
@@ -2919,12 +2935,12 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) | |||
2919 | #endif | 2935 | #endif |
2920 | if (!card->dev) | 2936 | if (!card->dev) |
2921 | return -ENODEV; | 2937 | return -ENODEV; |
2938 | card->dev->netdev_ops = &qeth_l3_netdev_ops; | ||
2922 | } else { | 2939 | } else { |
2923 | card->dev = alloc_etherdev(0); | 2940 | card->dev = alloc_etherdev(0); |
2924 | if (!card->dev) | 2941 | if (!card->dev) |
2925 | return -ENODEV; | 2942 | return -ENODEV; |
2926 | qeth_l3_netdev_ops.ndo_neigh_setup = | 2943 | card->dev->netdev_ops = &qeth_l3_osa_netdev_ops; |
2927 | qeth_l3_neigh_setup; | ||
2928 | 2944 | ||
2929 | /*IPv6 address autoconfiguration stuff*/ | 2945 | /*IPv6 address autoconfiguration stuff*/ |
2930 | qeth_l3_get_unique_id(card); | 2946 | qeth_l3_get_unique_id(card); |
@@ -2937,6 +2953,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) | |||
2937 | if (!card->dev) | 2953 | if (!card->dev) |
2938 | return -ENODEV; | 2954 | return -ENODEV; |
2939 | card->dev->flags |= IFF_NOARP; | 2955 | card->dev->flags |= IFF_NOARP; |
2956 | card->dev->netdev_ops = &qeth_l3_netdev_ops; | ||
2940 | qeth_l3_iqd_read_initial_mac(card); | 2957 | qeth_l3_iqd_read_initial_mac(card); |
2941 | } else | 2958 | } else |
2942 | return -ENODEV; | 2959 | return -ENODEV; |
@@ -2944,7 +2961,6 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) | |||
2944 | card->dev->ml_priv = card; | 2961 | card->dev->ml_priv = card; |
2945 | card->dev->watchdog_timeo = QETH_TX_TIMEOUT; | 2962 | card->dev->watchdog_timeo = QETH_TX_TIMEOUT; |
2946 | card->dev->mtu = card->info.initial_mtu; | 2963 | card->dev->mtu = card->info.initial_mtu; |
2947 | card->dev->netdev_ops = &qeth_l3_netdev_ops; | ||
2948 | SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops); | 2964 | SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops); |
2949 | card->dev->features |= NETIF_F_HW_VLAN_TX | | 2965 | card->dev->features |= NETIF_F_HW_VLAN_TX | |
2950 | NETIF_F_HW_VLAN_RX | | 2966 | NETIF_F_HW_VLAN_RX | |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 5c541f7850f9..74d07d137dae 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -1061,7 +1061,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) | |||
1061 | } | 1061 | } |
1062 | 1062 | ||
1063 | sdev_printk(KERN_INFO, cmd->device, | 1063 | sdev_printk(KERN_INFO, cmd->device, |
1064 | "aborting command. lun 0x%lx, tag 0x%lx\n", | 1064 | "aborting command. lun 0x%llx, tag 0x%llx\n", |
1065 | (((u64) lun) << 48), (u64) found_evt); | 1065 | (((u64) lun) << 48), (u64) found_evt); |
1066 | 1066 | ||
1067 | wait_for_completion(&evt->comp); | 1067 | wait_for_completion(&evt->comp); |
@@ -1082,7 +1082,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) | |||
1082 | if (rsp_rc) { | 1082 | if (rsp_rc) { |
1083 | if (printk_ratelimit()) | 1083 | if (printk_ratelimit()) |
1084 | sdev_printk(KERN_WARNING, cmd->device, | 1084 | sdev_printk(KERN_WARNING, cmd->device, |
1085 | "abort code %d for task tag 0x%lx\n", | 1085 | "abort code %d for task tag 0x%llx\n", |
1086 | rsp_rc, tsk_mgmt->task_tag); | 1086 | rsp_rc, tsk_mgmt->task_tag); |
1087 | return FAILED; | 1087 | return FAILED; |
1088 | } | 1088 | } |
@@ -1102,12 +1102,12 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) | |||
1102 | 1102 | ||
1103 | if (found_evt == NULL) { | 1103 | if (found_evt == NULL) { |
1104 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); | 1104 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); |
1105 | sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n", | 1105 | sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%llx completed\n", |
1106 | tsk_mgmt->task_tag); | 1106 | tsk_mgmt->task_tag); |
1107 | return SUCCESS; | 1107 | return SUCCESS; |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%lx\n", | 1110 | sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%llx\n", |
1111 | tsk_mgmt->task_tag); | 1111 | tsk_mgmt->task_tag); |
1112 | 1112 | ||
1113 | cmd->result = (DID_ABORT << 16); | 1113 | cmd->result = (DID_ABORT << 16); |
@@ -1182,7 +1182,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) | |||
1182 | return FAILED; | 1182 | return FAILED; |
1183 | } | 1183 | } |
1184 | 1184 | ||
1185 | sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%lx\n", | 1185 | sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%llx\n", |
1186 | (((u64) lun) << 48)); | 1186 | (((u64) lun) << 48)); |
1187 | 1187 | ||
1188 | wait_for_completion(&evt->comp); | 1188 | wait_for_completion(&evt->comp); |
@@ -1203,7 +1203,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) | |||
1203 | if (rsp_rc) { | 1203 | if (rsp_rc) { |
1204 | if (printk_ratelimit()) | 1204 | if (printk_ratelimit()) |
1205 | sdev_printk(KERN_WARNING, cmd->device, | 1205 | sdev_printk(KERN_WARNING, cmd->device, |
1206 | "reset code %d for task tag 0x%lx\n", | 1206 | "reset code %d for task tag 0x%llx\n", |
1207 | rsp_rc, tsk_mgmt->task_tag); | 1207 | rsp_rc, tsk_mgmt->task_tag); |
1208 | return FAILED; | 1208 | return FAILED; |
1209 | } | 1209 | } |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 1889a63ebc22..0d934bfbdd9b 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2839,6 +2839,8 @@ int __init early_serial_setup(struct uart_port *port) | |||
2839 | p->flags = port->flags; | 2839 | p->flags = port->flags; |
2840 | p->mapbase = port->mapbase; | 2840 | p->mapbase = port->mapbase; |
2841 | p->private_data = port->private_data; | 2841 | p->private_data = port->private_data; |
2842 | p->type = port->type; | ||
2843 | p->line = port->line; | ||
2842 | 2844 | ||
2843 | set_io_from_upio(p); | 2845 | set_io_from_upio(p); |
2844 | if (port->serial_in) | 2846 | if (port->serial_in) |
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index c088146b7513..2a3671233b15 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c | |||
@@ -602,6 +602,10 @@ static int pci_netmos_init(struct pci_dev *dev) | |||
602 | /* subdevice 0x00PS means <P> parallel, <S> serial */ | 602 | /* subdevice 0x00PS means <P> parallel, <S> serial */ |
603 | unsigned int num_serial = dev->subsystem_device & 0xf; | 603 | unsigned int num_serial = dev->subsystem_device & 0xf; |
604 | 604 | ||
605 | if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM && | ||
606 | dev->subsystem_device == 0x0299) | ||
607 | return 0; | ||
608 | |||
605 | if (num_serial == 0) | 609 | if (num_serial == 0) |
606 | return -ENODEV; | 610 | return -ENODEV; |
607 | return num_serial; | 611 | return num_serial; |
@@ -3096,6 +3100,10 @@ static struct pci_device_id serial_pci_tbl[] = { | |||
3096 | 0, | 3100 | 0, |
3097 | pbn_b0_8_115200 }, | 3101 | pbn_b0_8_115200 }, |
3098 | 3102 | ||
3103 | { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835, | ||
3104 | PCI_VENDOR_ID_IBM, 0x0299, | ||
3105 | 0, 0, pbn_b0_bt_2_115200 }, | ||
3106 | |||
3099 | /* | 3107 | /* |
3100 | * These entries match devices with class COMMUNICATION_SERIAL, | 3108 | * These entries match devices with class COMMUNICATION_SERIAL, |
3101 | * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL | 3109 | * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL |
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index fde7f9ccf57e..bbcfc26a3b6d 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c | |||
@@ -270,6 +270,8 @@ static const struct pnp_device_id pnp_dev_table[] = { | |||
270 | { "RSS0250", 0 }, | 270 | { "RSS0250", 0 }, |
271 | /* SupraExpress 28.8 Data/Fax PnP modem */ | 271 | /* SupraExpress 28.8 Data/Fax PnP modem */ |
272 | { "SUP1310", 0 }, | 272 | { "SUP1310", 0 }, |
273 | /* SupraExpress 336i PnP Voice Modem */ | ||
274 | { "SUP1381", 0 }, | ||
273 | /* SupraExpress 33.6 Data/Fax PnP modem */ | 275 | /* SupraExpress 33.6 Data/Fax PnP modem */ |
274 | { "SUP1421", 0 }, | 276 | { "SUP1421", 0 }, |
275 | /* SupraExpress 33.6 Data/Fax PnP modem */ | 277 | /* SupraExpress 33.6 Data/Fax PnP modem */ |
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index d5efd6c77904..89362d733d62 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -579,7 +579,7 @@ static void atmel_tx_dma(struct uart_port *port) | |||
579 | /* disable PDC transmit */ | 579 | /* disable PDC transmit */ |
580 | UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); | 580 | UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); |
581 | 581 | ||
582 | if (!uart_circ_empty(xmit)) { | 582 | if (!uart_circ_empty(xmit) && !uart_tx_stopped(port)) { |
583 | dma_sync_single_for_device(port->dev, | 583 | dma_sync_single_for_device(port->dev, |
584 | pdc->dma_addr, | 584 | pdc->dma_addr, |
585 | pdc->dma_size, | 585 | pdc->dma_size, |
diff --git a/drivers/serial/jsm/jsm_neo.c b/drivers/serial/jsm/jsm_neo.c index b7584ca55ade..e6390d023634 100644 --- a/drivers/serial/jsm/jsm_neo.c +++ b/drivers/serial/jsm/jsm_neo.c | |||
@@ -577,9 +577,6 @@ static void neo_parse_modem(struct jsm_channel *ch, u8 signals) | |||
577 | jsm_printk(MSIGS, INFO, &ch->ch_bd->pci_dev, | 577 | jsm_printk(MSIGS, INFO, &ch->ch_bd->pci_dev, |
578 | "neo_parse_modem: port: %d msignals: %x\n", ch->ch_portnum, msignals); | 578 | "neo_parse_modem: port: %d msignals: %x\n", ch->ch_portnum, msignals); |
579 | 579 | ||
580 | if (!ch) | ||
581 | return; | ||
582 | |||
583 | /* Scrub off lower bits. They signify delta's, which I don't care about */ | 580 | /* Scrub off lower bits. They signify delta's, which I don't care about */ |
584 | /* Keep DDCD and DDSR though */ | 581 | /* Keep DDCD and DDSR though */ |
585 | msignals &= 0xf8; | 582 | msignals &= 0xf8; |
diff --git a/drivers/serial/pnx8xxx_uart.c b/drivers/serial/pnx8xxx_uart.c index 22e30d21225e..1bb8f1b45767 100644 --- a/drivers/serial/pnx8xxx_uart.c +++ b/drivers/serial/pnx8xxx_uart.c | |||
@@ -187,7 +187,7 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) | |||
187 | status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) | | 187 | status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) | |
188 | ISTAT_TO_SM(serial_in(sport, PNX8XXX_ISTAT)); | 188 | ISTAT_TO_SM(serial_in(sport, PNX8XXX_ISTAT)); |
189 | while (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFIFO)) { | 189 | while (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFIFO)) { |
190 | ch = serial_in(sport, PNX8XXX_FIFO); | 190 | ch = serial_in(sport, PNX8XXX_FIFO) & 0xff; |
191 | 191 | ||
192 | sport->port.icount.rx++; | 192 | sport->port.icount.rx++; |
193 | 193 | ||
@@ -198,9 +198,16 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) | |||
198 | * out of the main execution path | 198 | * out of the main execution path |
199 | */ | 199 | */ |
200 | if (status & (FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE | | 200 | if (status & (FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE | |
201 | PNX8XXX_UART_FIFO_RXPAR) | | 201 | PNX8XXX_UART_FIFO_RXPAR | |
202 | PNX8XXX_UART_FIFO_RXBRK) | | ||
202 | ISTAT_TO_SM(PNX8XXX_UART_INT_RXOVRN))) { | 203 | ISTAT_TO_SM(PNX8XXX_UART_INT_RXOVRN))) { |
203 | if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR)) | 204 | if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXBRK)) { |
205 | status &= ~(FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) | | ||
206 | FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR)); | ||
207 | sport->port.icount.brk++; | ||
208 | if (uart_handle_break(&sport->port)) | ||
209 | goto ignore_char; | ||
210 | } else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR)) | ||
204 | sport->port.icount.parity++; | 211 | sport->port.icount.parity++; |
205 | else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE)) | 212 | else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE)) |
206 | sport->port.icount.frame++; | 213 | sport->port.icount.frame++; |
@@ -284,14 +291,8 @@ static irqreturn_t pnx8xxx_int(int irq, void *dev_id) | |||
284 | /* Get the interrupts */ | 291 | /* Get the interrupts */ |
285 | status = serial_in(sport, PNX8XXX_ISTAT) & serial_in(sport, PNX8XXX_IEN); | 292 | status = serial_in(sport, PNX8XXX_ISTAT) & serial_in(sport, PNX8XXX_IEN); |
286 | 293 | ||
287 | /* Break signal received */ | 294 | /* Byte or break signal received */ |
288 | if (status & PNX8XXX_UART_INT_BREAK) { | 295 | if (status & (PNX8XXX_UART_INT_RX | PNX8XXX_UART_INT_BREAK)) |
289 | sport->port.icount.brk++; | ||
290 | uart_handle_break(&sport->port); | ||
291 | } | ||
292 | |||
293 | /* Byte received */ | ||
294 | if (status & PNX8XXX_UART_INT_RX) | ||
295 | pnx8xxx_rx_chars(sport); | 296 | pnx8xxx_rx_chars(sport); |
296 | 297 | ||
297 | /* TX holding register empty - transmit a byte */ | 298 | /* TX holding register empty - transmit a byte */ |
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 5e39bac9c51b..56ff3e6864ea 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c | |||
@@ -670,8 +670,7 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg) | |||
670 | dev_dbg(controller, "new message %p submitted for %s\n", | 670 | dev_dbg(controller, "new message %p submitted for %s\n", |
671 | msg, spi->dev.bus_id); | 671 | msg, spi->dev.bus_id); |
672 | 672 | ||
673 | if (unlikely(list_empty(&msg->transfers) | 673 | if (unlikely(list_empty(&msg->transfers))) |
674 | || !spi->max_speed_hz)) | ||
675 | return -EINVAL; | 674 | return -EINVAL; |
676 | 675 | ||
677 | if (as->stopping) | 676 | if (as->stopping) |
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 68d6f4988fb5..fe7e5f35e5d0 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c | |||
@@ -15,12 +15,15 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | |||
19 | #include <linux/of_platform.h> | ||
20 | #include <linux/of_device.h> | ||
21 | #include <linux/of_spi.h> | ||
22 | |||
18 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
19 | #include <linux/spi/spi_bitbang.h> | 24 | #include <linux/spi/spi_bitbang.h> |
20 | #include <linux/io.h> | 25 | #include <linux/io.h> |
21 | 26 | ||
22 | #include <syslib/virtex_devices.h> | ||
23 | |||
24 | #define XILINX_SPI_NAME "xilinx_spi" | 27 | #define XILINX_SPI_NAME "xilinx_spi" |
25 | 28 | ||
26 | /* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e) | 29 | /* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e) |
@@ -144,23 +147,14 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi, | |||
144 | struct spi_transfer *t) | 147 | struct spi_transfer *t) |
145 | { | 148 | { |
146 | u8 bits_per_word; | 149 | u8 bits_per_word; |
147 | u32 hz; | ||
148 | struct xilinx_spi *xspi = spi_master_get_devdata(spi->master); | ||
149 | 150 | ||
150 | bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; | 151 | bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; |
151 | hz = (t) ? t->speed_hz : spi->max_speed_hz; | ||
152 | if (bits_per_word != 8) { | 152 | if (bits_per_word != 8) { |
153 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", | 153 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", |
154 | __func__, bits_per_word); | 154 | __func__, bits_per_word); |
155 | return -EINVAL; | 155 | return -EINVAL; |
156 | } | 156 | } |
157 | 157 | ||
158 | if (hz && xspi->speed_hz > hz) { | ||
159 | dev_err(&spi->dev, "%s, unsupported clock rate %uHz\n", | ||
160 | __func__, hz); | ||
161 | return -EINVAL; | ||
162 | } | ||
163 | |||
164 | return 0; | 158 | return 0; |
165 | } | 159 | } |
166 | 160 | ||
@@ -304,32 +298,38 @@ static irqreturn_t xilinx_spi_irq(int irq, void *dev_id) | |||
304 | return IRQ_HANDLED; | 298 | return IRQ_HANDLED; |
305 | } | 299 | } |
306 | 300 | ||
307 | static int __init xilinx_spi_probe(struct platform_device *dev) | 301 | static int __init xilinx_spi_of_probe(struct of_device *ofdev, |
302 | const struct of_device_id *match) | ||
308 | { | 303 | { |
309 | int ret = 0; | ||
310 | struct spi_master *master; | 304 | struct spi_master *master; |
311 | struct xilinx_spi *xspi; | 305 | struct xilinx_spi *xspi; |
312 | struct xspi_platform_data *pdata; | 306 | struct resource r_irq_struct; |
313 | struct resource *r; | 307 | struct resource r_mem_struct; |
308 | |||
309 | struct resource *r_irq = &r_irq_struct; | ||
310 | struct resource *r_mem = &r_mem_struct; | ||
311 | int rc = 0; | ||
312 | const u32 *prop; | ||
313 | int len; | ||
314 | 314 | ||
315 | /* Get resources(memory, IRQ) associated with the device */ | 315 | /* Get resources(memory, IRQ) associated with the device */ |
316 | master = spi_alloc_master(&dev->dev, sizeof(struct xilinx_spi)); | 316 | master = spi_alloc_master(&ofdev->dev, sizeof(struct xilinx_spi)); |
317 | 317 | ||
318 | if (master == NULL) { | 318 | if (master == NULL) { |
319 | return -ENOMEM; | 319 | return -ENOMEM; |
320 | } | 320 | } |
321 | 321 | ||
322 | platform_set_drvdata(dev, master); | 322 | dev_set_drvdata(&ofdev->dev, master); |
323 | pdata = dev->dev.platform_data; | ||
324 | 323 | ||
325 | if (pdata == NULL) { | 324 | rc = of_address_to_resource(ofdev->node, 0, r_mem); |
326 | ret = -ENODEV; | 325 | if (rc) { |
326 | dev_warn(&ofdev->dev, "invalid address\n"); | ||
327 | goto put_master; | 327 | goto put_master; |
328 | } | 328 | } |
329 | 329 | ||
330 | r = platform_get_resource(dev, IORESOURCE_MEM, 0); | 330 | rc = of_irq_to_resource(ofdev->node, 0, r_irq); |
331 | if (r == NULL) { | 331 | if (rc == NO_IRQ) { |
332 | ret = -ENODEV; | 332 | dev_warn(&ofdev->dev, "no IRQ found\n"); |
333 | goto put_master; | 333 | goto put_master; |
334 | } | 334 | } |
335 | 335 | ||
@@ -341,47 +341,57 @@ static int __init xilinx_spi_probe(struct platform_device *dev) | |||
341 | xspi->bitbang.master->setup = xilinx_spi_setup; | 341 | xspi->bitbang.master->setup = xilinx_spi_setup; |
342 | init_completion(&xspi->done); | 342 | init_completion(&xspi->done); |
343 | 343 | ||
344 | if (!request_mem_region(r->start, | 344 | xspi->irq = r_irq->start; |
345 | r->end - r->start + 1, XILINX_SPI_NAME)) { | 345 | |
346 | ret = -ENXIO; | 346 | if (!request_mem_region(r_mem->start, |
347 | r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) { | ||
348 | rc = -ENXIO; | ||
349 | dev_warn(&ofdev->dev, "memory request failure\n"); | ||
347 | goto put_master; | 350 | goto put_master; |
348 | } | 351 | } |
349 | 352 | ||
350 | xspi->regs = ioremap(r->start, r->end - r->start + 1); | 353 | xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1); |
351 | if (xspi->regs == NULL) { | 354 | if (xspi->regs == NULL) { |
352 | ret = -ENOMEM; | 355 | rc = -ENOMEM; |
356 | dev_warn(&ofdev->dev, "ioremap failure\n"); | ||
353 | goto put_master; | 357 | goto put_master; |
354 | } | 358 | } |
359 | xspi->irq = r_irq->start; | ||
355 | 360 | ||
356 | ret = platform_get_irq(dev, 0); | 361 | /* dynamic bus assignment */ |
357 | if (ret < 0) { | 362 | master->bus_num = -1; |
358 | ret = -ENXIO; | ||
359 | goto unmap_io; | ||
360 | } | ||
361 | xspi->irq = ret; | ||
362 | 363 | ||
363 | master->bus_num = pdata->bus_num; | 364 | /* number of slave select bits is required */ |
364 | master->num_chipselect = pdata->num_chipselect; | 365 | prop = of_get_property(ofdev->node, "xlnx,num-ss-bits", &len); |
365 | xspi->speed_hz = pdata->speed_hz; | 366 | if (!prop || len < sizeof(*prop)) { |
367 | dev_warn(&ofdev->dev, "no 'xlnx,num-ss-bits' property\n"); | ||
368 | goto put_master; | ||
369 | } | ||
370 | master->num_chipselect = *prop; | ||
366 | 371 | ||
367 | /* SPI controller initializations */ | 372 | /* SPI controller initializations */ |
368 | xspi_init_hw(xspi->regs); | 373 | xspi_init_hw(xspi->regs); |
369 | 374 | ||
370 | /* Register for SPI Interrupt */ | 375 | /* Register for SPI Interrupt */ |
371 | ret = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi); | 376 | rc = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi); |
372 | if (ret != 0) | 377 | if (rc != 0) { |
378 | dev_warn(&ofdev->dev, "irq request failure: %d\n", xspi->irq); | ||
373 | goto unmap_io; | 379 | goto unmap_io; |
380 | } | ||
374 | 381 | ||
375 | ret = spi_bitbang_start(&xspi->bitbang); | 382 | rc = spi_bitbang_start(&xspi->bitbang); |
376 | if (ret != 0) { | 383 | if (rc != 0) { |
377 | dev_err(&dev->dev, "spi_bitbang_start FAILED\n"); | 384 | dev_err(&ofdev->dev, "spi_bitbang_start FAILED\n"); |
378 | goto free_irq; | 385 | goto free_irq; |
379 | } | 386 | } |
380 | 387 | ||
381 | dev_info(&dev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n", | 388 | dev_info(&ofdev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n", |
382 | r->start, (u32)xspi->regs, xspi->irq); | 389 | (unsigned int)r_mem->start, (u32)xspi->regs, xspi->irq); |
383 | 390 | ||
384 | return ret; | 391 | /* Add any subnodes on the SPI bus */ |
392 | of_register_spi_devices(master, ofdev->node); | ||
393 | |||
394 | return rc; | ||
385 | 395 | ||
386 | free_irq: | 396 | free_irq: |
387 | free_irq(xspi->irq, xspi); | 397 | free_irq(xspi->irq, xspi); |
@@ -389,21 +399,21 @@ unmap_io: | |||
389 | iounmap(xspi->regs); | 399 | iounmap(xspi->regs); |
390 | put_master: | 400 | put_master: |
391 | spi_master_put(master); | 401 | spi_master_put(master); |
392 | return ret; | 402 | return rc; |
393 | } | 403 | } |
394 | 404 | ||
395 | static int __devexit xilinx_spi_remove(struct platform_device *dev) | 405 | static int __devexit xilinx_spi_remove(struct of_device *ofdev) |
396 | { | 406 | { |
397 | struct xilinx_spi *xspi; | 407 | struct xilinx_spi *xspi; |
398 | struct spi_master *master; | 408 | struct spi_master *master; |
399 | 409 | ||
400 | master = platform_get_drvdata(dev); | 410 | master = platform_get_drvdata(ofdev); |
401 | xspi = spi_master_get_devdata(master); | 411 | xspi = spi_master_get_devdata(master); |
402 | 412 | ||
403 | spi_bitbang_stop(&xspi->bitbang); | 413 | spi_bitbang_stop(&xspi->bitbang); |
404 | free_irq(xspi->irq, xspi); | 414 | free_irq(xspi->irq, xspi); |
405 | iounmap(xspi->regs); | 415 | iounmap(xspi->regs); |
406 | platform_set_drvdata(dev, 0); | 416 | dev_set_drvdata(&ofdev->dev, 0); |
407 | spi_master_put(xspi->bitbang.master); | 417 | spi_master_put(xspi->bitbang.master); |
408 | 418 | ||
409 | return 0; | 419 | return 0; |
@@ -412,27 +422,42 @@ static int __devexit xilinx_spi_remove(struct platform_device *dev) | |||
412 | /* work with hotplug and coldplug */ | 422 | /* work with hotplug and coldplug */ |
413 | MODULE_ALIAS("platform:" XILINX_SPI_NAME); | 423 | MODULE_ALIAS("platform:" XILINX_SPI_NAME); |
414 | 424 | ||
415 | static struct platform_driver xilinx_spi_driver = { | 425 | static int __exit xilinx_spi_of_remove(struct of_device *op) |
416 | .probe = xilinx_spi_probe, | 426 | { |
417 | .remove = __devexit_p(xilinx_spi_remove), | 427 | return xilinx_spi_remove(op); |
428 | } | ||
429 | |||
430 | static struct of_device_id xilinx_spi_of_match[] = { | ||
431 | { .compatible = "xlnx,xps-spi-2.00.a", }, | ||
432 | { .compatible = "xlnx,xps-spi-2.00.b", }, | ||
433 | {} | ||
434 | }; | ||
435 | |||
436 | MODULE_DEVICE_TABLE(of, xilinx_spi_of_match); | ||
437 | |||
438 | static struct of_platform_driver xilinx_spi_of_driver = { | ||
439 | .owner = THIS_MODULE, | ||
440 | .name = "xilinx-xps-spi", | ||
441 | .match_table = xilinx_spi_of_match, | ||
442 | .probe = xilinx_spi_of_probe, | ||
443 | .remove = __exit_p(xilinx_spi_of_remove), | ||
418 | .driver = { | 444 | .driver = { |
419 | .name = XILINX_SPI_NAME, | 445 | .name = "xilinx-xps-spi", |
420 | .owner = THIS_MODULE, | 446 | .owner = THIS_MODULE, |
421 | }, | 447 | }, |
422 | }; | 448 | }; |
423 | 449 | ||
424 | static int __init xilinx_spi_init(void) | 450 | static int __init xilinx_spi_init(void) |
425 | { | 451 | { |
426 | return platform_driver_register(&xilinx_spi_driver); | 452 | return of_register_platform_driver(&xilinx_spi_of_driver); |
427 | } | 453 | } |
428 | module_init(xilinx_spi_init); | 454 | module_init(xilinx_spi_init); |
429 | 455 | ||
430 | static void __exit xilinx_spi_exit(void) | 456 | static void __exit xilinx_spi_exit(void) |
431 | { | 457 | { |
432 | platform_driver_unregister(&xilinx_spi_driver); | 458 | of_unregister_platform_driver(&xilinx_spi_of_driver); |
433 | } | 459 | } |
434 | module_exit(xilinx_spi_exit); | 460 | module_exit(xilinx_spi_exit); |
435 | |||
436 | MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>"); | 461 | MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>"); |
437 | MODULE_DESCRIPTION("Xilinx SPI driver"); | 462 | MODULE_DESCRIPTION("Xilinx SPI driver"); |
438 | MODULE_LICENSE("GPL"); | 463 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d5d0e40b1e2d..94d5ee263c20 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1554,7 +1554,7 @@ static int usb_configure_device_otg(struct usb_device *udev) | |||
1554 | * (Includes HNP test device.) | 1554 | * (Includes HNP test device.) |
1555 | */ | 1555 | */ |
1556 | if (udev->bus->b_hnp_enable || udev->bus->is_b_host) { | 1556 | if (udev->bus->b_hnp_enable || udev->bus->is_b_host) { |
1557 | err = usb_port_suspend(udev); | 1557 | err = usb_port_suspend(udev, PMSG_SUSPEND); |
1558 | if (err < 0) | 1558 | if (err < 0) |
1559 | dev_dbg(&udev->dev, "HNP fail, %d\n", err); | 1559 | dev_dbg(&udev->dev, "HNP fail, %d\n", err); |
1560 | } | 1560 | } |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index ef6cfa5a447f..c70a8f667d85 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -2030,7 +2030,7 @@ static void ftdi_process_read(struct work_struct *work) | |||
2030 | spin_unlock_irqrestore(&priv->rx_lock, flags); | 2030 | spin_unlock_irqrestore(&priv->rx_lock, flags); |
2031 | dbg("%s - deferring remainder until unthrottled", | 2031 | dbg("%s - deferring remainder until unthrottled", |
2032 | __func__); | 2032 | __func__); |
2033 | return; | 2033 | goto out; |
2034 | } | 2034 | } |
2035 | spin_unlock_irqrestore(&priv->rx_lock, flags); | 2035 | spin_unlock_irqrestore(&priv->rx_lock, flags); |
2036 | /* if the port is closed stop trying to read */ | 2036 | /* if the port is closed stop trying to read */ |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 01d0c70d60e9..3cf41df302d7 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -145,7 +145,7 @@ static int ti_command_in_sync(struct ti_device *tdev, __u8 command, | |||
145 | static int ti_write_byte(struct ti_device *tdev, unsigned long addr, | 145 | static int ti_write_byte(struct ti_device *tdev, unsigned long addr, |
146 | __u8 mask, __u8 byte); | 146 | __u8 mask, __u8 byte); |
147 | 147 | ||
148 | static int ti_download_firmware(struct ti_device *tdev, int type); | 148 | static int ti_download_firmware(struct ti_device *tdev); |
149 | 149 | ||
150 | /* circular buffer */ | 150 | /* circular buffer */ |
151 | static struct circ_buf *ti_buf_alloc(void); | 151 | static struct circ_buf *ti_buf_alloc(void); |
@@ -176,9 +176,14 @@ static unsigned int product_5052_count; | |||
176 | /* the array dimension is the number of default entries plus */ | 176 | /* the array dimension is the number of default entries plus */ |
177 | /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ | 177 | /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ |
178 | /* null entry */ | 178 | /* null entry */ |
179 | static struct usb_device_id ti_id_table_3410[1+TI_EXTRA_VID_PID_COUNT+1] = { | 179 | static struct usb_device_id ti_id_table_3410[7+TI_EXTRA_VID_PID_COUNT+1] = { |
180 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, | 180 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, |
181 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, | 181 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, |
182 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, | ||
183 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_NO_FW_PRODUCT_ID) }, | ||
184 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, | ||
185 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, | ||
186 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, | ||
182 | }; | 187 | }; |
183 | 188 | ||
184 | static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = { | 189 | static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = { |
@@ -188,9 +193,14 @@ static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = { | |||
188 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, | 193 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, |
189 | }; | 194 | }; |
190 | 195 | ||
191 | static struct usb_device_id ti_id_table_combined[] = { | 196 | static struct usb_device_id ti_id_table_combined[6+2*TI_EXTRA_VID_PID_COUNT+1] = { |
192 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, | 197 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, |
193 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, | 198 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, |
199 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, | ||
200 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_NO_FW_PRODUCT_ID) }, | ||
201 | { USB_DEVICE(MTS_VENDOR_ID, MTS_CDMA_PRODUCT_ID) }, | ||
202 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) }, | ||
203 | { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) }, | ||
194 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) }, | 204 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) }, |
195 | { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, | 205 | { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, |
196 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, | 206 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, |
@@ -272,6 +282,9 @@ MODULE_LICENSE("GPL"); | |||
272 | 282 | ||
273 | MODULE_FIRMWARE("ti_3410.fw"); | 283 | MODULE_FIRMWARE("ti_3410.fw"); |
274 | MODULE_FIRMWARE("ti_5052.fw"); | 284 | MODULE_FIRMWARE("ti_5052.fw"); |
285 | MODULE_FIRMWARE("mts_cdma.fw"); | ||
286 | MODULE_FIRMWARE("mts_gsm.fw"); | ||
287 | MODULE_FIRMWARE("mts_edge.fw"); | ||
275 | 288 | ||
276 | module_param(debug, bool, S_IRUGO | S_IWUSR); | 289 | module_param(debug, bool, S_IRUGO | S_IWUSR); |
277 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); | 290 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); |
@@ -304,21 +317,28 @@ MODULE_DEVICE_TABLE(usb, ti_id_table_combined); | |||
304 | 317 | ||
305 | static int __init ti_init(void) | 318 | static int __init ti_init(void) |
306 | { | 319 | { |
307 | int i, j; | 320 | int i, j, c; |
308 | int ret; | 321 | int ret; |
309 | 322 | ||
310 | /* insert extra vendor and product ids */ | 323 | /* insert extra vendor and product ids */ |
324 | c = ARRAY_SIZE(ti_id_table_combined) - 2 * TI_EXTRA_VID_PID_COUNT - 1; | ||
311 | j = ARRAY_SIZE(ti_id_table_3410) - TI_EXTRA_VID_PID_COUNT - 1; | 325 | j = ARRAY_SIZE(ti_id_table_3410) - TI_EXTRA_VID_PID_COUNT - 1; |
312 | for (i = 0; i < min(vendor_3410_count, product_3410_count); i++, j++) { | 326 | for (i = 0; i < min(vendor_3410_count, product_3410_count); i++, j++, c++) { |
313 | ti_id_table_3410[j].idVendor = vendor_3410[i]; | 327 | ti_id_table_3410[j].idVendor = vendor_3410[i]; |
314 | ti_id_table_3410[j].idProduct = product_3410[i]; | 328 | ti_id_table_3410[j].idProduct = product_3410[i]; |
315 | ti_id_table_3410[j].match_flags = USB_DEVICE_ID_MATCH_DEVICE; | 329 | ti_id_table_3410[j].match_flags = USB_DEVICE_ID_MATCH_DEVICE; |
330 | ti_id_table_combined[c].idVendor = vendor_3410[i]; | ||
331 | ti_id_table_combined[c].idProduct = product_3410[i]; | ||
332 | ti_id_table_combined[c].match_flags = USB_DEVICE_ID_MATCH_DEVICE; | ||
316 | } | 333 | } |
317 | j = ARRAY_SIZE(ti_id_table_5052) - TI_EXTRA_VID_PID_COUNT - 1; | 334 | j = ARRAY_SIZE(ti_id_table_5052) - TI_EXTRA_VID_PID_COUNT - 1; |
318 | for (i = 0; i < min(vendor_5052_count, product_5052_count); i++, j++) { | 335 | for (i = 0; i < min(vendor_5052_count, product_5052_count); i++, j++, c++) { |
319 | ti_id_table_5052[j].idVendor = vendor_5052[i]; | 336 | ti_id_table_5052[j].idVendor = vendor_5052[i]; |
320 | ti_id_table_5052[j].idProduct = product_5052[i]; | 337 | ti_id_table_5052[j].idProduct = product_5052[i]; |
321 | ti_id_table_5052[j].match_flags = USB_DEVICE_ID_MATCH_DEVICE; | 338 | ti_id_table_5052[j].match_flags = USB_DEVICE_ID_MATCH_DEVICE; |
339 | ti_id_table_combined[c].idVendor = vendor_5052[i]; | ||
340 | ti_id_table_combined[c].idProduct = product_5052[i]; | ||
341 | ti_id_table_combined[c].match_flags = USB_DEVICE_ID_MATCH_DEVICE; | ||
322 | } | 342 | } |
323 | 343 | ||
324 | ret = usb_serial_register(&ti_1port_device); | 344 | ret = usb_serial_register(&ti_1port_device); |
@@ -390,11 +410,7 @@ static int ti_startup(struct usb_serial *serial) | |||
390 | 410 | ||
391 | /* if we have only 1 configuration, download firmware */ | 411 | /* if we have only 1 configuration, download firmware */ |
392 | if (dev->descriptor.bNumConfigurations == 1) { | 412 | if (dev->descriptor.bNumConfigurations == 1) { |
393 | if (tdev->td_is_3410) | 413 | if ((status = ti_download_firmware(tdev)) != 0) |
394 | status = ti_download_firmware(tdev, 3410); | ||
395 | else | ||
396 | status = ti_download_firmware(tdev, 5052); | ||
397 | if (status) | ||
398 | goto free_tdev; | 414 | goto free_tdev; |
399 | 415 | ||
400 | /* 3410 must be reset, 5052 resets itself */ | 416 | /* 3410 must be reset, 5052 resets itself */ |
@@ -1671,9 +1687,9 @@ static int ti_do_download(struct usb_device *dev, int pipe, | |||
1671 | return status; | 1687 | return status; |
1672 | } | 1688 | } |
1673 | 1689 | ||
1674 | static int ti_download_firmware(struct ti_device *tdev, int type) | 1690 | static int ti_download_firmware(struct ti_device *tdev) |
1675 | { | 1691 | { |
1676 | int status = -ENOMEM; | 1692 | int status; |
1677 | int buffer_size; | 1693 | int buffer_size; |
1678 | __u8 *buffer; | 1694 | __u8 *buffer; |
1679 | struct usb_device *dev = tdev->td_serial->dev; | 1695 | struct usb_device *dev = tdev->td_serial->dev; |
@@ -1681,9 +1697,34 @@ static int ti_download_firmware(struct ti_device *tdev, int type) | |||
1681 | tdev->td_serial->port[0]->bulk_out_endpointAddress); | 1697 | tdev->td_serial->port[0]->bulk_out_endpointAddress); |
1682 | const struct firmware *fw_p; | 1698 | const struct firmware *fw_p; |
1683 | char buf[32]; | 1699 | char buf[32]; |
1684 | sprintf(buf, "ti_usb-%d.bin", type); | ||
1685 | 1700 | ||
1686 | if (request_firmware(&fw_p, buf, &dev->dev)) { | 1701 | /* try ID specific firmware first, then try generic firmware */ |
1702 | sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor, | ||
1703 | dev->descriptor.idProduct); | ||
1704 | if ((status = request_firmware(&fw_p, buf, &dev->dev)) != 0) { | ||
1705 | buf[0] = '\0'; | ||
1706 | if (dev->descriptor.idVendor == MTS_VENDOR_ID) { | ||
1707 | switch (dev->descriptor.idProduct) { | ||
1708 | case MTS_CDMA_PRODUCT_ID: | ||
1709 | strcpy(buf, "mts_cdma.fw"); | ||
1710 | break; | ||
1711 | case MTS_GSM_PRODUCT_ID: | ||
1712 | strcpy(buf, "mts_gsm.fw"); | ||
1713 | break; | ||
1714 | case MTS_EDGE_PRODUCT_ID: | ||
1715 | strcpy(buf, "mts_edge.fw"); | ||
1716 | break; | ||
1717 | } | ||
1718 | } | ||
1719 | if (buf[0] == '\0') { | ||
1720 | if (tdev->td_is_3410) | ||
1721 | strcpy(buf, "ti_3410.fw"); | ||
1722 | else | ||
1723 | strcpy(buf, "ti_5052.fw"); | ||
1724 | } | ||
1725 | status = request_firmware(&fw_p, buf, &dev->dev); | ||
1726 | } | ||
1727 | if (status) { | ||
1687 | dev_err(&dev->dev, "%s - firmware not found\n", __func__); | 1728 | dev_err(&dev->dev, "%s - firmware not found\n", __func__); |
1688 | return -ENOENT; | 1729 | return -ENOENT; |
1689 | } | 1730 | } |
@@ -1699,6 +1740,8 @@ static int ti_download_firmware(struct ti_device *tdev, int type) | |||
1699 | memset(buffer + fw_p->size, 0xff, buffer_size - fw_p->size); | 1740 | memset(buffer + fw_p->size, 0xff, buffer_size - fw_p->size); |
1700 | status = ti_do_download(dev, pipe, buffer, fw_p->size); | 1741 | status = ti_do_download(dev, pipe, buffer, fw_p->size); |
1701 | kfree(buffer); | 1742 | kfree(buffer); |
1743 | } else { | ||
1744 | status = -ENOMEM; | ||
1702 | } | 1745 | } |
1703 | release_firmware(fw_p); | 1746 | release_firmware(fw_p); |
1704 | if (status) { | 1747 | if (status) { |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h index b5541bf991ba..7e4752fbf232 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.h +++ b/drivers/usb/serial/ti_usb_3410_5052.h | |||
@@ -34,6 +34,14 @@ | |||
34 | #define TI_5052_EEPROM_PRODUCT_ID 0x505A /* EEPROM, no firmware */ | 34 | #define TI_5052_EEPROM_PRODUCT_ID 0x505A /* EEPROM, no firmware */ |
35 | #define TI_5052_FIRMWARE_PRODUCT_ID 0x505F /* firmware is running */ | 35 | #define TI_5052_FIRMWARE_PRODUCT_ID 0x505F /* firmware is running */ |
36 | 36 | ||
37 | /* Multi-Tech vendor and product ids */ | ||
38 | #define MTS_VENDOR_ID 0x06E0 | ||
39 | #define MTS_GSM_NO_FW_PRODUCT_ID 0xF108 | ||
40 | #define MTS_CDMA_NO_FW_PRODUCT_ID 0xF109 | ||
41 | #define MTS_CDMA_PRODUCT_ID 0xF110 | ||
42 | #define MTS_GSM_PRODUCT_ID 0xF111 | ||
43 | #define MTS_EDGE_PRODUCT_ID 0xF112 | ||
44 | |||
37 | /* Commands */ | 45 | /* Commands */ |
38 | #define TI_GET_VERSION 0x01 | 46 | #define TI_GET_VERSION 0x01 |
39 | #define TI_GET_PORT_STATUS 0x02 | 47 | #define TI_GET_PORT_STATUS 0x02 |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 080ade223d53..cfcfd5ab06ce 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -511,9 +511,6 @@ static void usb_serial_port_work(struct work_struct *work) | |||
511 | 511 | ||
512 | dbg("%s - port %d", __func__, port->number); | 512 | dbg("%s - port %d", __func__, port->number); |
513 | 513 | ||
514 | if (!port) | ||
515 | return; | ||
516 | |||
517 | tty = tty_port_tty_get(&port->port); | 514 | tty = tty_port_tty_get(&port->port); |
518 | if (!tty) | 515 | if (!tty) |
519 | return; | 516 | return; |
diff --git a/drivers/video/Makefile b/drivers/video/Makefile index e39e33e797da..be2b657546ef 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile | |||
@@ -28,7 +28,7 @@ obj-$(CONFIG_FB_DDC) += fb_ddc.o | |||
28 | obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o | 28 | obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o |
29 | 29 | ||
30 | # Hardware specific drivers go first | 30 | # Hardware specific drivers go first |
31 | obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o | 31 | obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o |
32 | obj-$(CONFIG_FB_ARC) += arcfb.o | 32 | obj-$(CONFIG_FB_ARC) += arcfb.o |
33 | obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o | 33 | obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o |
34 | obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o | 34 | obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o |
@@ -72,7 +72,7 @@ obj-$(CONFIG_FB_TCX) += tcx.o sbuslib.o | |||
72 | obj-$(CONFIG_FB_LEO) += leo.o sbuslib.o | 72 | obj-$(CONFIG_FB_LEO) += leo.o sbuslib.o |
73 | obj-$(CONFIG_FB_SGIVW) += sgivwfb.o | 73 | obj-$(CONFIG_FB_SGIVW) += sgivwfb.o |
74 | obj-$(CONFIG_FB_ACORN) += acornfb.o | 74 | obj-$(CONFIG_FB_ACORN) += acornfb.o |
75 | obj-$(CONFIG_FB_ATARI) += atafb.o c2p.o atafb_mfb.o \ | 75 | obj-$(CONFIG_FB_ATARI) += atafb.o c2p_iplan2.o atafb_mfb.o \ |
76 | atafb_iplan2p2.o atafb_iplan2p4.o atafb_iplan2p8.o | 76 | atafb_iplan2p2.o atafb_iplan2p4.o atafb_iplan2p8.o |
77 | obj-$(CONFIG_FB_MAC) += macfb.o | 77 | obj-$(CONFIG_FB_MAC) += macfb.o |
78 | obj-$(CONFIG_FB_HECUBA) += hecubafb.o | 78 | obj-$(CONFIG_FB_HECUBA) += hecubafb.o |
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index b8e9a8682f2d..100f23661465 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c | |||
@@ -2159,9 +2159,9 @@ static void amifb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
2159 | src += pitch; | 2159 | src += pitch; |
2160 | } | 2160 | } |
2161 | } else { | 2161 | } else { |
2162 | c2p(info->screen_base, image->data, dx, dy, width, height, | 2162 | c2p_planar(info->screen_base, image->data, dx, dy, width, |
2163 | par->next_line, par->next_plane, image->width, | 2163 | height, par->next_line, par->next_plane, |
2164 | info->var.bits_per_pixel); | 2164 | image->width, info->var.bits_per_pixel); |
2165 | } | 2165 | } |
2166 | } | 2166 | } |
2167 | 2167 | ||
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index 77eb8b34fbfa..8058572a7428 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c | |||
@@ -122,7 +122,6 @@ static struct atafb_par { | |||
122 | void *screen_base; | 122 | void *screen_base; |
123 | int yres_virtual; | 123 | int yres_virtual; |
124 | u_long next_line; | 124 | u_long next_line; |
125 | u_long next_plane; | ||
126 | #if defined ATAFB_TT || defined ATAFB_STE | 125 | #if defined ATAFB_TT || defined ATAFB_STE |
127 | union { | 126 | union { |
128 | struct { | 127 | struct { |
@@ -149,6 +148,7 @@ static struct atafb_par { | |||
149 | short mono; | 148 | short mono; |
150 | short ste_mode; | 149 | short ste_mode; |
151 | short bpp; | 150 | short bpp; |
151 | u32 pseudo_palette[16]; | ||
152 | } falcon; | 152 | } falcon; |
153 | #endif | 153 | #endif |
154 | /* Nothing needed for external mode */ | 154 | /* Nothing needed for external mode */ |
@@ -614,7 +614,7 @@ static int tt_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) | |||
614 | fix->xpanstep = 0; | 614 | fix->xpanstep = 0; |
615 | fix->ypanstep = 1; | 615 | fix->ypanstep = 1; |
616 | fix->ywrapstep = 0; | 616 | fix->ywrapstep = 0; |
617 | fix->line_length = 0; | 617 | fix->line_length = par->next_line; |
618 | fix->accel = FB_ACCEL_ATARIBLITT; | 618 | fix->accel = FB_ACCEL_ATARIBLITT; |
619 | return 0; | 619 | return 0; |
620 | } | 620 | } |
@@ -691,6 +691,7 @@ static int tt_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par) | |||
691 | return -EINVAL; | 691 | return -EINVAL; |
692 | par->yres_virtual = yres_virtual; | 692 | par->yres_virtual = yres_virtual; |
693 | par->screen_base = screen_base + var->yoffset * linelen; | 693 | par->screen_base = screen_base + var->yoffset * linelen; |
694 | par->next_line = linelen; | ||
694 | return 0; | 695 | return 0; |
695 | } | 696 | } |
696 | 697 | ||
@@ -884,10 +885,6 @@ static int vdl_prescale[4][3] = { | |||
884 | /* Default hsync timing [mon_type] in picoseconds */ | 885 | /* Default hsync timing [mon_type] in picoseconds */ |
885 | static long h_syncs[4] = { 3000000, 4875000, 4000000, 4875000 }; | 886 | static long h_syncs[4] = { 3000000, 4875000, 4000000, 4875000 }; |
886 | 887 | ||
887 | #ifdef FBCON_HAS_CFB16 | ||
888 | static u16 fbcon_cfb16_cmap[16]; | ||
889 | #endif | ||
890 | |||
891 | static inline int hxx_prescale(struct falcon_hw *hw) | 888 | static inline int hxx_prescale(struct falcon_hw *hw) |
892 | { | 889 | { |
893 | return hw->ste_mode ? 16 | 890 | return hw->ste_mode ? 16 |
@@ -918,7 +915,7 @@ static int falcon_encode_fix(struct fb_fix_screeninfo *fix, | |||
918 | fix->visual = FB_VISUAL_TRUECOLOR; | 915 | fix->visual = FB_VISUAL_TRUECOLOR; |
919 | fix->xpanstep = 2; | 916 | fix->xpanstep = 2; |
920 | } | 917 | } |
921 | fix->line_length = 0; | 918 | fix->line_length = par->next_line; |
922 | fix->accel = FB_ACCEL_ATARIBLITT; | 919 | fix->accel = FB_ACCEL_ATARIBLITT; |
923 | return 0; | 920 | return 0; |
924 | } | 921 | } |
@@ -1394,14 +1391,7 @@ set_screen_base: | |||
1394 | par->screen_base = screen_base + var->yoffset * linelen; | 1391 | par->screen_base = screen_base + var->yoffset * linelen; |
1395 | par->hw.falcon.xoffset = 0; | 1392 | par->hw.falcon.xoffset = 0; |
1396 | 1393 | ||
1397 | // FIXME!!! sort of works, no crash | ||
1398 | //par->next_line = linelen; | ||
1399 | //par->next_plane = yres_virtual * linelen; | ||
1400 | par->next_line = linelen; | 1394 | par->next_line = linelen; |
1401 | par->next_plane = 2; | ||
1402 | // crashes | ||
1403 | //par->next_plane = linelen; | ||
1404 | //par->next_line = yres_virtual * linelen; | ||
1405 | 1395 | ||
1406 | return 0; | 1396 | return 0; |
1407 | } | 1397 | } |
@@ -1735,10 +1725,10 @@ static int falcon_setcolreg(unsigned int regno, unsigned int red, | |||
1735 | (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) | | 1725 | (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) | |
1736 | (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) | | 1726 | (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) | |
1737 | ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12); | 1727 | ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12); |
1738 | #ifdef FBCON_HAS_CFB16 | 1728 | #ifdef ATAFB_FALCON |
1739 | fbcon_cfb16_cmap[regno] = ((red & 0xf800) | | 1729 | ((u32 *)info->pseudo_palette)[regno] = ((red & 0xf800) | |
1740 | ((green & 0xfc00) >> 5) | | 1730 | ((green & 0xfc00) >> 5) | |
1741 | ((blue & 0xf800) >> 11)); | 1731 | ((blue & 0xf800) >> 11)); |
1742 | #endif | 1732 | #endif |
1743 | } | 1733 | } |
1744 | return 0; | 1734 | return 0; |
@@ -1852,7 +1842,7 @@ static int stste_encode_fix(struct fb_fix_screeninfo *fix, | |||
1852 | fix->ypanstep = 0; | 1842 | fix->ypanstep = 0; |
1853 | } | 1843 | } |
1854 | fix->ywrapstep = 0; | 1844 | fix->ywrapstep = 0; |
1855 | fix->line_length = 0; | 1845 | fix->line_length = par->next_line; |
1856 | fix->accel = FB_ACCEL_ATARIBLITT; | 1846 | fix->accel = FB_ACCEL_ATARIBLITT; |
1857 | return 0; | 1847 | return 0; |
1858 | } | 1848 | } |
@@ -1910,6 +1900,7 @@ static int stste_decode_var(struct fb_var_screeninfo *var, | |||
1910 | return -EINVAL; | 1900 | return -EINVAL; |
1911 | par->yres_virtual = yres_virtual; | 1901 | par->yres_virtual = yres_virtual; |
1912 | par->screen_base = screen_base + var->yoffset * linelen; | 1902 | par->screen_base = screen_base + var->yoffset * linelen; |
1903 | par->next_line = linelen; | ||
1913 | return 0; | 1904 | return 0; |
1914 | } | 1905 | } |
1915 | 1906 | ||
@@ -2169,7 +2160,7 @@ static int ext_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) | |||
2169 | fix->xpanstep = 0; | 2160 | fix->xpanstep = 0; |
2170 | fix->ypanstep = 0; | 2161 | fix->ypanstep = 0; |
2171 | fix->ywrapstep = 0; | 2162 | fix->ywrapstep = 0; |
2172 | fix->line_length = 0; | 2163 | fix->line_length = par->next_line; |
2173 | return 0; | 2164 | return 0; |
2174 | } | 2165 | } |
2175 | 2166 | ||
@@ -2184,6 +2175,8 @@ static int ext_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par) | |||
2184 | var->xoffset > 0 || | 2175 | var->xoffset > 0 || |
2185 | var->yoffset > 0) | 2176 | var->yoffset > 0) |
2186 | return -EINVAL; | 2177 | return -EINVAL; |
2178 | |||
2179 | par->next_line = external_xres_virtual * external_depth / 8; | ||
2187 | return 0; | 2180 | return 0; |
2188 | } | 2181 | } |
2189 | 2182 | ||
@@ -2443,42 +2436,6 @@ static void atafb_set_disp(struct fb_info *info) | |||
2443 | atafb_get_fix(&info->fix, info); | 2436 | atafb_get_fix(&info->fix, info); |
2444 | 2437 | ||
2445 | info->screen_base = (void *)info->fix.smem_start; | 2438 | info->screen_base = (void *)info->fix.smem_start; |
2446 | |||
2447 | switch (info->fix.type) { | ||
2448 | case FB_TYPE_INTERLEAVED_PLANES: | ||
2449 | switch (info->var.bits_per_pixel) { | ||
2450 | case 2: | ||
2451 | // display->dispsw = &fbcon_iplan2p2; | ||
2452 | break; | ||
2453 | case 4: | ||
2454 | // display->dispsw = &fbcon_iplan2p4; | ||
2455 | break; | ||
2456 | case 8: | ||
2457 | // display->dispsw = &fbcon_iplan2p8; | ||
2458 | break; | ||
2459 | } | ||
2460 | break; | ||
2461 | case FB_TYPE_PACKED_PIXELS: | ||
2462 | switch (info->var.bits_per_pixel) { | ||
2463 | #ifdef FBCON_HAS_MFB | ||
2464 | case 1: | ||
2465 | // display->dispsw = &fbcon_mfb; | ||
2466 | break; | ||
2467 | #endif | ||
2468 | #ifdef FBCON_HAS_CFB8 | ||
2469 | case 8: | ||
2470 | // display->dispsw = &fbcon_cfb8; | ||
2471 | break; | ||
2472 | #endif | ||
2473 | #ifdef FBCON_HAS_CFB16 | ||
2474 | case 16: | ||
2475 | // display->dispsw = &fbcon_cfb16; | ||
2476 | // display->dispsw_data = fbcon_cfb16_cmap; | ||
2477 | break; | ||
2478 | #endif | ||
2479 | } | ||
2480 | break; | ||
2481 | } | ||
2482 | } | 2439 | } |
2483 | 2440 | ||
2484 | static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | 2441 | static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, |
@@ -2549,6 +2506,13 @@ static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) | |||
2549 | if (!rect->width || !rect->height) | 2506 | if (!rect->width || !rect->height) |
2550 | return; | 2507 | return; |
2551 | 2508 | ||
2509 | #ifdef ATAFB_FALCON | ||
2510 | if (info->var.bits_per_pixel == 16) { | ||
2511 | cfb_fillrect(info, rect); | ||
2512 | return; | ||
2513 | } | ||
2514 | #endif | ||
2515 | |||
2552 | /* | 2516 | /* |
2553 | * We could use hardware clipping but on many cards you get around | 2517 | * We could use hardware clipping but on many cards you get around |
2554 | * hardware clipping by writing to framebuffer directly. | 2518 | * hardware clipping by writing to framebuffer directly. |
@@ -2583,6 +2547,13 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) | |||
2583 | u32 dx, dy, sx, sy, width, height; | 2547 | u32 dx, dy, sx, sy, width, height; |
2584 | int rev_copy = 0; | 2548 | int rev_copy = 0; |
2585 | 2549 | ||
2550 | #ifdef ATAFB_FALCON | ||
2551 | if (info->var.bits_per_pixel == 16) { | ||
2552 | cfb_copyarea(info, area); | ||
2553 | return; | ||
2554 | } | ||
2555 | #endif | ||
2556 | |||
2586 | /* clip the destination */ | 2557 | /* clip the destination */ |
2587 | x2 = area->dx + area->width; | 2558 | x2 = area->dx + area->width; |
2588 | y2 = area->dy + area->height; | 2559 | y2 = area->dy + area->height; |
@@ -2632,6 +2603,13 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
2632 | const char *src; | 2603 | const char *src; |
2633 | u32 dx, dy, width, height, pitch; | 2604 | u32 dx, dy, width, height, pitch; |
2634 | 2605 | ||
2606 | #ifdef ATAFB_FALCON | ||
2607 | if (info->var.bits_per_pixel == 16) { | ||
2608 | cfb_imageblit(info, image); | ||
2609 | return; | ||
2610 | } | ||
2611 | #endif | ||
2612 | |||
2635 | /* | 2613 | /* |
2636 | * We could use hardware clipping but on many cards you get around | 2614 | * We could use hardware clipping but on many cards you get around |
2637 | * hardware clipping by writing to framebuffer directly like we are | 2615 | * hardware clipping by writing to framebuffer directly like we are |
@@ -2676,10 +2654,9 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
2676 | src += pitch; | 2654 | src += pitch; |
2677 | } | 2655 | } |
2678 | } else { | 2656 | } else { |
2679 | // only used for logo; broken | 2657 | c2p_iplan2(info->screen_base, image->data, dx, dy, width, |
2680 | c2p(info->screen_base, image->data, dx, dy, width, height, | 2658 | height, par->next_line, image->width, |
2681 | par->next_line, par->next_plane, image->width, | 2659 | info->var.bits_per_pixel); |
2682 | info->var.bits_per_pixel); | ||
2683 | } | 2660 | } |
2684 | } | 2661 | } |
2685 | 2662 | ||
@@ -3098,8 +3075,7 @@ int __init atafb_setup(char *options) | |||
3098 | 3075 | ||
3099 | int __init atafb_init(void) | 3076 | int __init atafb_init(void) |
3100 | { | 3077 | { |
3101 | int pad; | 3078 | int pad, detected_mode, error; |
3102 | int detected_mode; | ||
3103 | unsigned int defmode = 0; | 3079 | unsigned int defmode = 0; |
3104 | unsigned long mem_req; | 3080 | unsigned long mem_req; |
3105 | 3081 | ||
@@ -3139,8 +3115,12 @@ int __init atafb_init(void) | |||
3139 | printk("atafb_init: initializing Falcon hw\n"); | 3115 | printk("atafb_init: initializing Falcon hw\n"); |
3140 | fbhw = &falcon_switch; | 3116 | fbhw = &falcon_switch; |
3141 | atafb_ops.fb_setcolreg = &falcon_setcolreg; | 3117 | atafb_ops.fb_setcolreg = &falcon_setcolreg; |
3142 | request_irq(IRQ_AUTO_4, falcon_vbl_switcher, IRQ_TYPE_PRIO, | 3118 | error = request_irq(IRQ_AUTO_4, falcon_vbl_switcher, |
3143 | "framebuffer/modeswitch", falcon_vbl_switcher); | 3119 | IRQ_TYPE_PRIO, |
3120 | "framebuffer/modeswitch", | ||
3121 | falcon_vbl_switcher); | ||
3122 | if (error) | ||
3123 | return error; | ||
3144 | defmode = DEFMODE_F30; | 3124 | defmode = DEFMODE_F30; |
3145 | break; | 3125 | break; |
3146 | } | 3126 | } |
@@ -3225,6 +3205,10 @@ int __init atafb_init(void) | |||
3225 | // tries to read from HW which may not be initialized yet | 3205 | // tries to read from HW which may not be initialized yet |
3226 | // so set sane var first, then call atafb_set_par | 3206 | // so set sane var first, then call atafb_set_par |
3227 | atafb_get_var(&fb_info.var, &fb_info); | 3207 | atafb_get_var(&fb_info.var, &fb_info); |
3208 | |||
3209 | #ifdef ATAFB_FALCON | ||
3210 | fb_info.pseudo_palette = current_par.hw.falcon.pseudo_palette; | ||
3211 | #endif | ||
3228 | fb_info.flags = FBINFO_FLAG_DEFAULT; | 3212 | fb_info.flags = FBINFO_FLAG_DEFAULT; |
3229 | 3213 | ||
3230 | if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, atafb_modedb, | 3214 | if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, atafb_modedb, |
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c index 7644ed249564..37e60b1d2ed9 100644 --- a/drivers/video/bf54x-lq043fb.c +++ b/drivers/video/bf54x-lq043fb.c | |||
@@ -335,7 +335,20 @@ static int bfin_bf54x_fb_check_var(struct fb_var_screeninfo *var, | |||
335 | struct fb_info *info) | 335 | struct fb_info *info) |
336 | { | 336 | { |
337 | 337 | ||
338 | if (var->bits_per_pixel != LCD_BPP) { | 338 | switch (var->bits_per_pixel) { |
339 | case 24:/* TRUECOLOUR, 16m */ | ||
340 | var->red.offset = 16; | ||
341 | var->green.offset = 8; | ||
342 | var->blue.offset = 0; | ||
343 | var->red.length = var->green.length = var->blue.length = 8; | ||
344 | var->transp.offset = 0; | ||
345 | var->transp.length = 0; | ||
346 | var->transp.msb_right = 0; | ||
347 | var->red.msb_right = 0; | ||
348 | var->green.msb_right = 0; | ||
349 | var->blue.msb_right = 0; | ||
350 | break; | ||
351 | default: | ||
339 | pr_debug("%s: depth not supported: %u BPP\n", __func__, | 352 | pr_debug("%s: depth not supported: %u BPP\n", __func__, |
340 | var->bits_per_pixel); | 353 | var->bits_per_pixel); |
341 | return -EINVAL; | 354 | return -EINVAL; |
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c index a9b3ada05d99..2a423d3a2a8e 100644 --- a/drivers/video/bfin-t350mcqb-fb.c +++ b/drivers/video/bfin-t350mcqb-fb.c | |||
@@ -254,7 +254,20 @@ static int bfin_t350mcqb_fb_check_var(struct fb_var_screeninfo *var, | |||
254 | struct fb_info *info) | 254 | struct fb_info *info) |
255 | { | 255 | { |
256 | 256 | ||
257 | if (var->bits_per_pixel != LCD_BPP) { | 257 | switch (var->bits_per_pixel) { |
258 | case 24:/* TRUECOLOUR, 16m */ | ||
259 | var->red.offset = 0; | ||
260 | var->green.offset = 8; | ||
261 | var->blue.offset = 16; | ||
262 | var->red.length = var->green.length = var->blue.length = 8; | ||
263 | var->transp.offset = 0; | ||
264 | var->transp.length = 0; | ||
265 | var->transp.msb_right = 0; | ||
266 | var->red.msb_right = 0; | ||
267 | var->green.msb_right = 0; | ||
268 | var->blue.msb_right = 0; | ||
269 | break; | ||
270 | default: | ||
258 | pr_debug("%s: depth not supported: %u BPP\n", __func__, | 271 | pr_debug("%s: depth not supported: %u BPP\n", __func__, |
259 | var->bits_per_pixel); | 272 | var->bits_per_pixel); |
260 | return -EINVAL; | 273 | return -EINVAL; |
diff --git a/drivers/video/c2p.c b/drivers/video/c2p.c deleted file mode 100644 index 376bc07ff952..000000000000 --- a/drivers/video/c2p.c +++ /dev/null | |||
@@ -1,232 +0,0 @@ | |||
1 | /* | ||
2 | * Fast C2P (Chunky-to-Planar) Conversion | ||
3 | * | ||
4 | * Copyright (C) 2003 Geert Uytterhoeven | ||
5 | * | ||
6 | * NOTES: | ||
7 | * - This code was inspired by Scout's C2P tutorial | ||
8 | * - It assumes to run on a big endian system | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file COPYING in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | |||
15 | #include <linux/module.h> | ||
16 | #include <linux/string.h> | ||
17 | #include "c2p.h" | ||
18 | |||
19 | |||
20 | /* | ||
21 | * Basic transpose step | ||
22 | */ | ||
23 | |||
24 | #define _transp(d, i1, i2, shift, mask) \ | ||
25 | do { \ | ||
26 | u32 t = (d[i1] ^ (d[i2] >> shift)) & mask; \ | ||
27 | d[i1] ^= t; \ | ||
28 | d[i2] ^= t << shift; \ | ||
29 | } while (0) | ||
30 | |||
31 | static inline u32 get_mask(int n) | ||
32 | { | ||
33 | switch (n) { | ||
34 | case 1: | ||
35 | return 0x55555555; | ||
36 | break; | ||
37 | |||
38 | case 2: | ||
39 | return 0x33333333; | ||
40 | break; | ||
41 | |||
42 | case 4: | ||
43 | return 0x0f0f0f0f; | ||
44 | break; | ||
45 | |||
46 | case 8: | ||
47 | return 0x00ff00ff; | ||
48 | break; | ||
49 | |||
50 | case 16: | ||
51 | return 0x0000ffff; | ||
52 | break; | ||
53 | } | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | #define transp_nx1(d, n) \ | ||
58 | do { \ | ||
59 | u32 mask = get_mask(n); \ | ||
60 | /* First block */ \ | ||
61 | _transp(d, 0, 1, n, mask); \ | ||
62 | /* Second block */ \ | ||
63 | _transp(d, 2, 3, n, mask); \ | ||
64 | /* Third block */ \ | ||
65 | _transp(d, 4, 5, n, mask); \ | ||
66 | /* Fourth block */ \ | ||
67 | _transp(d, 6, 7, n, mask); \ | ||
68 | } while (0) | ||
69 | |||
70 | #define transp_nx2(d, n) \ | ||
71 | do { \ | ||
72 | u32 mask = get_mask(n); \ | ||
73 | /* First block */ \ | ||
74 | _transp(d, 0, 2, n, mask); \ | ||
75 | _transp(d, 1, 3, n, mask); \ | ||
76 | /* Second block */ \ | ||
77 | _transp(d, 4, 6, n, mask); \ | ||
78 | _transp(d, 5, 7, n, mask); \ | ||
79 | } while (0) | ||
80 | |||
81 | #define transp_nx4(d, n) \ | ||
82 | do { \ | ||
83 | u32 mask = get_mask(n); \ | ||
84 | _transp(d, 0, 4, n, mask); \ | ||
85 | _transp(d, 1, 5, n, mask); \ | ||
86 | _transp(d, 2, 6, n, mask); \ | ||
87 | _transp(d, 3, 7, n, mask); \ | ||
88 | } while (0) | ||
89 | |||
90 | #define transp(d, n, m) transp_nx ## m(d, n) | ||
91 | |||
92 | |||
93 | /* | ||
94 | * Perform a full C2P step on 32 8-bit pixels, stored in 8 32-bit words | ||
95 | * containing | ||
96 | * - 32 8-bit chunky pixels on input | ||
97 | * - permuted planar data on output | ||
98 | */ | ||
99 | |||
100 | static void c2p_8bpp(u32 d[8]) | ||
101 | { | ||
102 | transp(d, 16, 4); | ||
103 | transp(d, 8, 2); | ||
104 | transp(d, 4, 1); | ||
105 | transp(d, 2, 4); | ||
106 | transp(d, 1, 2); | ||
107 | } | ||
108 | |||
109 | |||
110 | /* | ||
111 | * Array containing the permution indices of the planar data after c2p | ||
112 | */ | ||
113 | |||
114 | static const int perm_c2p_8bpp[8] = { 7, 5, 3, 1, 6, 4, 2, 0 }; | ||
115 | |||
116 | |||
117 | /* | ||
118 | * Compose two values, using a bitmask as decision value | ||
119 | * This is equivalent to (a & mask) | (b & ~mask) | ||
120 | */ | ||
121 | |||
122 | static inline unsigned long comp(unsigned long a, unsigned long b, | ||
123 | unsigned long mask) | ||
124 | { | ||
125 | return ((a ^ b) & mask) ^ b; | ||
126 | } | ||
127 | |||
128 | |||
129 | /* | ||
130 | * Store a full block of planar data after c2p conversion | ||
131 | */ | ||
132 | |||
133 | static inline void store_planar(char *dst, u32 dst_inc, u32 bpp, u32 d[8]) | ||
134 | { | ||
135 | int i; | ||
136 | |||
137 | for (i = 0; i < bpp; i++, dst += dst_inc) | ||
138 | *(u32 *)dst = d[perm_c2p_8bpp[i]]; | ||
139 | } | ||
140 | |||
141 | |||
142 | /* | ||
143 | * Store a partial block of planar data after c2p conversion | ||
144 | */ | ||
145 | |||
146 | static inline void store_planar_masked(char *dst, u32 dst_inc, u32 bpp, | ||
147 | u32 d[8], u32 mask) | ||
148 | { | ||
149 | int i; | ||
150 | |||
151 | for (i = 0; i < bpp; i++, dst += dst_inc) | ||
152 | *(u32 *)dst = comp(d[perm_c2p_8bpp[i]], *(u32 *)dst, mask); | ||
153 | } | ||
154 | |||
155 | |||
156 | /* | ||
157 | * c2p - Copy 8-bit chunky image data to a planar frame buffer | ||
158 | * @dst: Starting address of the planar frame buffer | ||
159 | * @dx: Horizontal destination offset (in pixels) | ||
160 | * @dy: Vertical destination offset (in pixels) | ||
161 | * @width: Image width (in pixels) | ||
162 | * @height: Image height (in pixels) | ||
163 | * @dst_nextline: Frame buffer offset to the next line (in bytes) | ||
164 | * @dst_nextplane: Frame buffer offset to the next plane (in bytes) | ||
165 | * @src_nextline: Image offset to the next line (in bytes) | ||
166 | * @bpp: Bits per pixel of the planar frame buffer (1-8) | ||
167 | */ | ||
168 | |||
169 | void c2p(u8 *dst, const u8 *src, u32 dx, u32 dy, u32 width, u32 height, | ||
170 | u32 dst_nextline, u32 dst_nextplane, u32 src_nextline, u32 bpp) | ||
171 | { | ||
172 | int dst_idx; | ||
173 | u32 d[8], first, last, w; | ||
174 | const u8 *c; | ||
175 | u8 *p; | ||
176 | |||
177 | dst += dy*dst_nextline+(dx & ~31); | ||
178 | dst_idx = dx % 32; | ||
179 | first = ~0UL >> dst_idx; | ||
180 | last = ~(~0UL >> ((dst_idx+width) % 32)); | ||
181 | while (height--) { | ||
182 | c = src; | ||
183 | p = dst; | ||
184 | w = width; | ||
185 | if (dst_idx+width <= 32) { | ||
186 | /* Single destination word */ | ||
187 | first &= last; | ||
188 | memset(d, 0, sizeof(d)); | ||
189 | memcpy((u8 *)d+dst_idx, c, width); | ||
190 | c += width; | ||
191 | c2p_8bpp(d); | ||
192 | store_planar_masked(p, dst_nextplane, bpp, d, first); | ||
193 | p += 4; | ||
194 | } else { | ||
195 | /* Multiple destination words */ | ||
196 | w = width; | ||
197 | /* Leading bits */ | ||
198 | if (dst_idx) { | ||
199 | w = 32 - dst_idx; | ||
200 | memset(d, 0, dst_idx); | ||
201 | memcpy((u8 *)d+dst_idx, c, w); | ||
202 | c += w; | ||
203 | c2p_8bpp(d); | ||
204 | store_planar_masked(p, dst_nextplane, bpp, d, first); | ||
205 | p += 4; | ||
206 | w = width-w; | ||
207 | } | ||
208 | /* Main chunk */ | ||
209 | while (w >= 32) { | ||
210 | memcpy(d, c, 32); | ||
211 | c += 32; | ||
212 | c2p_8bpp(d); | ||
213 | store_planar(p, dst_nextplane, bpp, d); | ||
214 | p += 4; | ||
215 | w -= 32; | ||
216 | } | ||
217 | /* Trailing bits */ | ||
218 | w %= 32; | ||
219 | if (w > 0) { | ||
220 | memcpy(d, c, w); | ||
221 | memset((u8 *)d+w, 0, 32-w); | ||
222 | c2p_8bpp(d); | ||
223 | store_planar_masked(p, dst_nextplane, bpp, d, last); | ||
224 | } | ||
225 | } | ||
226 | src += src_nextline; | ||
227 | dst += dst_nextline; | ||
228 | } | ||
229 | } | ||
230 | EXPORT_SYMBOL_GPL(c2p); | ||
231 | |||
232 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/c2p.h b/drivers/video/c2p.h index c77cbf17e043..6c38d40427d8 100644 --- a/drivers/video/c2p.h +++ b/drivers/video/c2p.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Fast C2P (Chunky-to-Planar) Conversion | 2 | * Fast C2P (Chunky-to-Planar) Conversion |
3 | * | 3 | * |
4 | * Copyright (C) 2003 Geert Uytterhoeven | 4 | * Copyright (C) 2003-2008 Geert Uytterhoeven |
5 | * | 5 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | 6 | * This file is subject to the terms and conditions of the GNU General Public |
7 | * License. See the file COPYING in the main directory of this archive | 7 | * License. See the file COPYING in the main directory of this archive |
@@ -10,7 +10,10 @@ | |||
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | 12 | ||
13 | extern void c2p(u8 *dst, const u8 *src, u32 dx, u32 dy, u32 width, u32 height, | 13 | extern void c2p_planar(void *dst, const void *src, u32 dx, u32 dy, u32 width, |
14 | u32 dst_nextline, u32 dst_nextplane, u32 src_nextline, | 14 | u32 height, u32 dst_nextline, u32 dst_nextplane, |
15 | u32 bpp); | 15 | u32 src_nextline, u32 bpp); |
16 | 16 | ||
17 | extern void c2p_iplan2(void *dst, const void *src, u32 dx, u32 dy, u32 width, | ||
18 | u32 height, u32 dst_nextline, u32 src_nextline, | ||
19 | u32 bpp); | ||
diff --git a/drivers/video/c2p_core.h b/drivers/video/c2p_core.h new file mode 100644 index 000000000000..e1035a865fb9 --- /dev/null +++ b/drivers/video/c2p_core.h | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * Fast C2P (Chunky-to-Planar) Conversion | ||
3 | * | ||
4 | * Copyright (C) 2003-2008 Geert Uytterhoeven | ||
5 | * | ||
6 | * NOTES: | ||
7 | * - This code was inspired by Scout's C2P tutorial | ||
8 | * - It assumes to run on a big endian system | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file COPYING in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | |||
15 | |||
16 | /* | ||
17 | * Basic transpose step | ||
18 | */ | ||
19 | |||
20 | static inline void _transp(u32 d[], unsigned int i1, unsigned int i2, | ||
21 | unsigned int shift, u32 mask) | ||
22 | { | ||
23 | u32 t = (d[i1] ^ (d[i2] >> shift)) & mask; | ||
24 | |||
25 | d[i1] ^= t; | ||
26 | d[i2] ^= t << shift; | ||
27 | } | ||
28 | |||
29 | |||
30 | extern void c2p_unsupported(void); | ||
31 | |||
32 | static inline u32 get_mask(unsigned int n) | ||
33 | { | ||
34 | switch (n) { | ||
35 | case 1: | ||
36 | return 0x55555555; | ||
37 | |||
38 | case 2: | ||
39 | return 0x33333333; | ||
40 | |||
41 | case 4: | ||
42 | return 0x0f0f0f0f; | ||
43 | |||
44 | case 8: | ||
45 | return 0x00ff00ff; | ||
46 | |||
47 | case 16: | ||
48 | return 0x0000ffff; | ||
49 | } | ||
50 | |||
51 | c2p_unsupported(); | ||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | |||
56 | /* | ||
57 | * Transpose operations on 8 32-bit words | ||
58 | */ | ||
59 | |||
60 | static inline void transp8(u32 d[], unsigned int n, unsigned int m) | ||
61 | { | ||
62 | u32 mask = get_mask(n); | ||
63 | |||
64 | switch (m) { | ||
65 | case 1: | ||
66 | /* First n x 1 block */ | ||
67 | _transp(d, 0, 1, n, mask); | ||
68 | /* Second n x 1 block */ | ||
69 | _transp(d, 2, 3, n, mask); | ||
70 | /* Third n x 1 block */ | ||
71 | _transp(d, 4, 5, n, mask); | ||
72 | /* Fourth n x 1 block */ | ||
73 | _transp(d, 6, 7, n, mask); | ||
74 | return; | ||
75 | |||
76 | case 2: | ||
77 | /* First n x 2 block */ | ||
78 | _transp(d, 0, 2, n, mask); | ||
79 | _transp(d, 1, 3, n, mask); | ||
80 | /* Second n x 2 block */ | ||
81 | _transp(d, 4, 6, n, mask); | ||
82 | _transp(d, 5, 7, n, mask); | ||
83 | return; | ||
84 | |||
85 | case 4: | ||
86 | /* Single n x 4 block */ | ||
87 | _transp(d, 0, 4, n, mask); | ||
88 | _transp(d, 1, 5, n, mask); | ||
89 | _transp(d, 2, 6, n, mask); | ||
90 | _transp(d, 3, 7, n, mask); | ||
91 | return; | ||
92 | } | ||
93 | |||
94 | c2p_unsupported(); | ||
95 | } | ||
96 | |||
97 | |||
98 | /* | ||
99 | * Transpose operations on 4 32-bit words | ||
100 | */ | ||
101 | |||
102 | static inline void transp4(u32 d[], unsigned int n, unsigned int m) | ||
103 | { | ||
104 | u32 mask = get_mask(n); | ||
105 | |||
106 | switch (m) { | ||
107 | case 1: | ||
108 | /* First n x 1 block */ | ||
109 | _transp(d, 0, 1, n, mask); | ||
110 | /* Second n x 1 block */ | ||
111 | _transp(d, 2, 3, n, mask); | ||
112 | return; | ||
113 | |||
114 | case 2: | ||
115 | /* Single n x 2 block */ | ||
116 | _transp(d, 0, 2, n, mask); | ||
117 | _transp(d, 1, 3, n, mask); | ||
118 | return; | ||
119 | } | ||
120 | |||
121 | c2p_unsupported(); | ||
122 | } | ||
123 | |||
124 | |||
125 | /* | ||
126 | * Transpose operations on 4 32-bit words (reverse order) | ||
127 | */ | ||
128 | |||
129 | static inline void transp4x(u32 d[], unsigned int n, unsigned int m) | ||
130 | { | ||
131 | u32 mask = get_mask(n); | ||
132 | |||
133 | switch (m) { | ||
134 | case 2: | ||
135 | /* Single n x 2 block */ | ||
136 | _transp(d, 2, 0, n, mask); | ||
137 | _transp(d, 3, 1, n, mask); | ||
138 | return; | ||
139 | } | ||
140 | |||
141 | c2p_unsupported(); | ||
142 | } | ||
143 | |||
144 | |||
145 | /* | ||
146 | * Compose two values, using a bitmask as decision value | ||
147 | * This is equivalent to (a & mask) | (b & ~mask) | ||
148 | */ | ||
149 | |||
150 | static inline u32 comp(u32 a, u32 b, u32 mask) | ||
151 | { | ||
152 | return ((a ^ b) & mask) ^ b; | ||
153 | } | ||
diff --git a/drivers/video/c2p_iplan2.c b/drivers/video/c2p_iplan2.c new file mode 100644 index 000000000000..19156dc6158c --- /dev/null +++ b/drivers/video/c2p_iplan2.c | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * Fast C2P (Chunky-to-Planar) Conversion | ||
3 | * | ||
4 | * Copyright (C) 2003-2008 Geert Uytterhoeven | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file COPYING in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/string.h> | ||
13 | |||
14 | #include <asm/unaligned.h> | ||
15 | |||
16 | #include "c2p.h" | ||
17 | #include "c2p_core.h" | ||
18 | |||
19 | |||
20 | /* | ||
21 | * Perform a full C2P step on 16 8-bit pixels, stored in 4 32-bit words | ||
22 | * containing | ||
23 | * - 16 8-bit chunky pixels on input | ||
24 | * - permutated planar data (2 planes per 32-bit word) on output | ||
25 | */ | ||
26 | |||
27 | static void c2p_16x8(u32 d[4]) | ||
28 | { | ||
29 | transp4(d, 8, 2); | ||
30 | transp4(d, 1, 2); | ||
31 | transp4x(d, 16, 2); | ||
32 | transp4x(d, 2, 2); | ||
33 | transp4(d, 4, 1); | ||
34 | } | ||
35 | |||
36 | |||
37 | /* | ||
38 | * Array containing the permutation indices of the planar data after c2p | ||
39 | */ | ||
40 | |||
41 | static const int perm_c2p_16x8[4] = { 1, 3, 0, 2 }; | ||
42 | |||
43 | |||
44 | /* | ||
45 | * Store a full block of iplan2 data after c2p conversion | ||
46 | */ | ||
47 | |||
48 | static inline void store_iplan2(void *dst, u32 bpp, u32 d[4]) | ||
49 | { | ||
50 | int i; | ||
51 | |||
52 | for (i = 0; i < bpp/2; i++, dst += 4) | ||
53 | put_unaligned_be32(d[perm_c2p_16x8[i]], dst); | ||
54 | } | ||
55 | |||
56 | |||
57 | /* | ||
58 | * Store a partial block of iplan2 data after c2p conversion | ||
59 | */ | ||
60 | |||
61 | static inline void store_iplan2_masked(void *dst, u32 bpp, u32 d[4], u32 mask) | ||
62 | { | ||
63 | int i; | ||
64 | |||
65 | for (i = 0; i < bpp/2; i++, dst += 4) | ||
66 | put_unaligned_be32(comp(d[perm_c2p_16x8[i]], | ||
67 | get_unaligned_be32(dst), mask), | ||
68 | dst); | ||
69 | } | ||
70 | |||
71 | |||
72 | /* | ||
73 | * c2p_iplan2 - Copy 8-bit chunky image data to an interleaved planar | ||
74 | * frame buffer with 2 bytes of interleave | ||
75 | * @dst: Starting address of the planar frame buffer | ||
76 | * @dx: Horizontal destination offset (in pixels) | ||
77 | * @dy: Vertical destination offset (in pixels) | ||
78 | * @width: Image width (in pixels) | ||
79 | * @height: Image height (in pixels) | ||
80 | * @dst_nextline: Frame buffer offset to the next line (in bytes) | ||
81 | * @src_nextline: Image offset to the next line (in bytes) | ||
82 | * @bpp: Bits per pixel of the planar frame buffer (2, 4, or 8) | ||
83 | */ | ||
84 | |||
85 | void c2p_iplan2(void *dst, const void *src, u32 dx, u32 dy, u32 width, | ||
86 | u32 height, u32 dst_nextline, u32 src_nextline, u32 bpp) | ||
87 | { | ||
88 | union { | ||
89 | u8 pixels[16]; | ||
90 | u32 words[4]; | ||
91 | } d; | ||
92 | u32 dst_idx, first, last, w; | ||
93 | const u8 *c; | ||
94 | void *p; | ||
95 | |||
96 | dst += dy*dst_nextline+(dx & ~15)*bpp; | ||
97 | dst_idx = dx % 16; | ||
98 | first = 0xffffU >> dst_idx; | ||
99 | first |= first << 16; | ||
100 | last = 0xffffU ^ (0xffffU >> ((dst_idx+width) % 16)); | ||
101 | last |= last << 16; | ||
102 | while (height--) { | ||
103 | c = src; | ||
104 | p = dst; | ||
105 | w = width; | ||
106 | if (dst_idx+width <= 16) { | ||
107 | /* Single destination word */ | ||
108 | first &= last; | ||
109 | memset(d.pixels, 0, sizeof(d)); | ||
110 | memcpy(d.pixels+dst_idx, c, width); | ||
111 | c += width; | ||
112 | c2p_16x8(d.words); | ||
113 | store_iplan2_masked(p, bpp, d.words, first); | ||
114 | p += bpp*2; | ||
115 | } else { | ||
116 | /* Multiple destination words */ | ||
117 | w = width; | ||
118 | /* Leading bits */ | ||
119 | if (dst_idx) { | ||
120 | w = 16 - dst_idx; | ||
121 | memset(d.pixels, 0, dst_idx); | ||
122 | memcpy(d.pixels+dst_idx, c, w); | ||
123 | c += w; | ||
124 | c2p_16x8(d.words); | ||
125 | store_iplan2_masked(p, bpp, d.words, first); | ||
126 | p += bpp*2; | ||
127 | w = width-w; | ||
128 | } | ||
129 | /* Main chunk */ | ||
130 | while (w >= 16) { | ||
131 | memcpy(d.pixels, c, 16); | ||
132 | c += 16; | ||
133 | c2p_16x8(d.words); | ||
134 | store_iplan2(p, bpp, d.words); | ||
135 | p += bpp*2; | ||
136 | w -= 16; | ||
137 | } | ||
138 | /* Trailing bits */ | ||
139 | w %= 16; | ||
140 | if (w > 0) { | ||
141 | memcpy(d.pixels, c, w); | ||
142 | memset(d.pixels+w, 0, 16-w); | ||
143 | c2p_16x8(d.words); | ||
144 | store_iplan2_masked(p, bpp, d.words, last); | ||
145 | } | ||
146 | } | ||
147 | src += src_nextline; | ||
148 | dst += dst_nextline; | ||
149 | } | ||
150 | } | ||
151 | EXPORT_SYMBOL_GPL(c2p_iplan2); | ||
152 | |||
153 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/c2p_planar.c b/drivers/video/c2p_planar.c new file mode 100644 index 000000000000..ec7ac8526f06 --- /dev/null +++ b/drivers/video/c2p_planar.c | |||
@@ -0,0 +1,156 @@ | |||
1 | /* | ||
2 | * Fast C2P (Chunky-to-Planar) Conversion | ||
3 | * | ||
4 | * Copyright (C) 2003-2008 Geert Uytterhoeven | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file COPYING in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/string.h> | ||
13 | |||
14 | #include <asm/unaligned.h> | ||
15 | |||
16 | #include "c2p.h" | ||
17 | #include "c2p_core.h" | ||
18 | |||
19 | |||
20 | /* | ||
21 | * Perform a full C2P step on 32 8-bit pixels, stored in 8 32-bit words | ||
22 | * containing | ||
23 | * - 32 8-bit chunky pixels on input | ||
24 | * - permutated planar data (1 plane per 32-bit word) on output | ||
25 | */ | ||
26 | |||
27 | static void c2p_32x8(u32 d[8]) | ||
28 | { | ||
29 | transp8(d, 16, 4); | ||
30 | transp8(d, 8, 2); | ||
31 | transp8(d, 4, 1); | ||
32 | transp8(d, 2, 4); | ||
33 | transp8(d, 1, 2); | ||
34 | } | ||
35 | |||
36 | |||
37 | /* | ||
38 | * Array containing the permutation indices of the planar data after c2p | ||
39 | */ | ||
40 | |||
41 | static const int perm_c2p_32x8[8] = { 7, 5, 3, 1, 6, 4, 2, 0 }; | ||
42 | |||
43 | |||
44 | /* | ||
45 | * Store a full block of planar data after c2p conversion | ||
46 | */ | ||
47 | |||
48 | static inline void store_planar(void *dst, u32 dst_inc, u32 bpp, u32 d[8]) | ||
49 | { | ||
50 | int i; | ||
51 | |||
52 | for (i = 0; i < bpp; i++, dst += dst_inc) | ||
53 | put_unaligned_be32(d[perm_c2p_32x8[i]], dst); | ||
54 | } | ||
55 | |||
56 | |||
57 | /* | ||
58 | * Store a partial block of planar data after c2p conversion | ||
59 | */ | ||
60 | |||
61 | static inline void store_planar_masked(void *dst, u32 dst_inc, u32 bpp, | ||
62 | u32 d[8], u32 mask) | ||
63 | { | ||
64 | int i; | ||
65 | |||
66 | for (i = 0; i < bpp; i++, dst += dst_inc) | ||
67 | put_unaligned_be32(comp(d[perm_c2p_32x8[i]], | ||
68 | get_unaligned_be32(dst), mask), | ||
69 | dst); | ||
70 | } | ||
71 | |||
72 | |||
73 | /* | ||
74 | * c2p_planar - Copy 8-bit chunky image data to a planar frame buffer | ||
75 | * @dst: Starting address of the planar frame buffer | ||
76 | * @dx: Horizontal destination offset (in pixels) | ||
77 | * @dy: Vertical destination offset (in pixels) | ||
78 | * @width: Image width (in pixels) | ||
79 | * @height: Image height (in pixels) | ||
80 | * @dst_nextline: Frame buffer offset to the next line (in bytes) | ||
81 | * @dst_nextplane: Frame buffer offset to the next plane (in bytes) | ||
82 | * @src_nextline: Image offset to the next line (in bytes) | ||
83 | * @bpp: Bits per pixel of the planar frame buffer (1-8) | ||
84 | */ | ||
85 | |||
86 | void c2p_planar(void *dst, const void *src, u32 dx, u32 dy, u32 width, | ||
87 | u32 height, u32 dst_nextline, u32 dst_nextplane, | ||
88 | u32 src_nextline, u32 bpp) | ||
89 | { | ||
90 | union { | ||
91 | u8 pixels[32]; | ||
92 | u32 words[8]; | ||
93 | } d; | ||
94 | u32 dst_idx, first, last, w; | ||
95 | const u8 *c; | ||
96 | void *p; | ||
97 | |||
98 | dst += dy*dst_nextline+(dx & ~31); | ||
99 | dst_idx = dx % 32; | ||
100 | first = 0xffffffffU >> dst_idx; | ||
101 | last = ~(0xffffffffU >> ((dst_idx+width) % 32)); | ||
102 | while (height--) { | ||
103 | c = src; | ||
104 | p = dst; | ||
105 | w = width; | ||
106 | if (dst_idx+width <= 32) { | ||
107 | /* Single destination word */ | ||
108 | first &= last; | ||
109 | memset(d.pixels, 0, sizeof(d)); | ||
110 | memcpy(d.pixels+dst_idx, c, width); | ||
111 | c += width; | ||
112 | c2p_32x8(d.words); | ||
113 | store_planar_masked(p, dst_nextplane, bpp, d.words, | ||
114 | first); | ||
115 | p += 4; | ||
116 | } else { | ||
117 | /* Multiple destination words */ | ||
118 | w = width; | ||
119 | /* Leading bits */ | ||
120 | if (dst_idx) { | ||
121 | w = 32 - dst_idx; | ||
122 | memset(d.pixels, 0, dst_idx); | ||
123 | memcpy(d.pixels+dst_idx, c, w); | ||
124 | c += w; | ||
125 | c2p_32x8(d.words); | ||
126 | store_planar_masked(p, dst_nextplane, bpp, | ||
127 | d.words, first); | ||
128 | p += 4; | ||
129 | w = width-w; | ||
130 | } | ||
131 | /* Main chunk */ | ||
132 | while (w >= 32) { | ||
133 | memcpy(d.pixels, c, 32); | ||
134 | c += 32; | ||
135 | c2p_32x8(d.words); | ||
136 | store_planar(p, dst_nextplane, bpp, d.words); | ||
137 | p += 4; | ||
138 | w -= 32; | ||
139 | } | ||
140 | /* Trailing bits */ | ||
141 | w %= 32; | ||
142 | if (w > 0) { | ||
143 | memcpy(d.pixels, c, w); | ||
144 | memset(d.pixels+w, 0, 32-w); | ||
145 | c2p_32x8(d.words); | ||
146 | store_planar_masked(p, dst_nextplane, bpp, | ||
147 | d.words, last); | ||
148 | } | ||
149 | } | ||
150 | src += src_nextline; | ||
151 | dst += dst_nextline; | ||
152 | } | ||
153 | } | ||
154 | EXPORT_SYMBOL_GPL(c2p_planar); | ||
155 | |||
156 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 4bcff81b50e0..1657b9608b04 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -78,13 +78,6 @@ | |||
78 | #include <asm/fb.h> | 78 | #include <asm/fb.h> |
79 | #include <asm/irq.h> | 79 | #include <asm/irq.h> |
80 | #include <asm/system.h> | 80 | #include <asm/system.h> |
81 | #ifdef CONFIG_ATARI | ||
82 | #include <asm/atariints.h> | ||
83 | #endif | ||
84 | #if defined(__mc68000__) | ||
85 | #include <asm/machdep.h> | ||
86 | #include <asm/setup.h> | ||
87 | #endif | ||
88 | 81 | ||
89 | #include "fbcon.h" | 82 | #include "fbcon.h" |
90 | 83 | ||
@@ -155,9 +148,6 @@ static int fbcon_set_origin(struct vc_data *); | |||
155 | 148 | ||
156 | #define CURSOR_DRAW_DELAY (1) | 149 | #define CURSOR_DRAW_DELAY (1) |
157 | 150 | ||
158 | /* # VBL ints between cursor state changes */ | ||
159 | #define ATARI_CURSOR_BLINK_RATE (42) | ||
160 | |||
161 | static int vbl_cursor_cnt; | 151 | static int vbl_cursor_cnt; |
162 | static int fbcon_cursor_noblink; | 152 | static int fbcon_cursor_noblink; |
163 | 153 | ||
@@ -403,20 +393,6 @@ static void fb_flashcursor(struct work_struct *work) | |||
403 | release_console_sem(); | 393 | release_console_sem(); |
404 | } | 394 | } |
405 | 395 | ||
406 | #ifdef CONFIG_ATARI | ||
407 | static int cursor_blink_rate; | ||
408 | static irqreturn_t fb_vbl_handler(int irq, void *dev_id) | ||
409 | { | ||
410 | struct fb_info *info = dev_id; | ||
411 | |||
412 | if (vbl_cursor_cnt && --vbl_cursor_cnt == 0) { | ||
413 | schedule_work(&info->queue); | ||
414 | vbl_cursor_cnt = cursor_blink_rate; | ||
415 | } | ||
416 | return IRQ_HANDLED; | ||
417 | } | ||
418 | #endif | ||
419 | |||
420 | static void cursor_timer_handler(unsigned long dev_addr) | 396 | static void cursor_timer_handler(unsigned long dev_addr) |
421 | { | 397 | { |
422 | struct fb_info *info = (struct fb_info *) dev_addr; | 398 | struct fb_info *info = (struct fb_info *) dev_addr; |
@@ -1017,15 +993,6 @@ static const char *fbcon_startup(void) | |||
1017 | info->var.yres, | 993 | info->var.yres, |
1018 | info->var.bits_per_pixel); | 994 | info->var.bits_per_pixel); |
1019 | 995 | ||
1020 | #ifdef CONFIG_ATARI | ||
1021 | if (MACH_IS_ATARI) { | ||
1022 | cursor_blink_rate = ATARI_CURSOR_BLINK_RATE; | ||
1023 | (void)request_irq(IRQ_AUTO_4, fb_vbl_handler, | ||
1024 | IRQ_TYPE_PRIO, "framebuffer vbl", | ||
1025 | info); | ||
1026 | } | ||
1027 | #endif /* CONFIG_ATARI */ | ||
1028 | |||
1029 | fbcon_add_cursor_timer(info); | 996 | fbcon_add_cursor_timer(info); |
1030 | fbcon_has_exited = 0; | 997 | fbcon_has_exited = 0; |
1031 | return display_desc; | 998 | return display_desc; |
@@ -3454,11 +3421,6 @@ static void fbcon_exit(void) | |||
3454 | if (fbcon_has_exited) | 3421 | if (fbcon_has_exited) |
3455 | return; | 3422 | return; |
3456 | 3423 | ||
3457 | #ifdef CONFIG_ATARI | ||
3458 | if (MACH_IS_ATARI) | ||
3459 | free_irq(IRQ_AUTO_4, fb_vbl_handler); | ||
3460 | #endif | ||
3461 | |||
3462 | kfree((void *)softback_buf); | 3424 | kfree((void *)softback_buf); |
3463 | softback_buf = 0UL; | 3425 | softback_buf = 0UL; |
3464 | 3426 | ||
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index ec68c741b564..3efa12f9ee50 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -770,6 +770,12 @@ config TXX9_WDT | |||
770 | 770 | ||
771 | # POWERPC Architecture | 771 | # POWERPC Architecture |
772 | 772 | ||
773 | config GEF_WDT | ||
774 | tristate "GE Fanuc Watchdog Timer" | ||
775 | depends on GEF_SBC610 | ||
776 | ---help--- | ||
777 | Watchdog timer found in a number of GE Fanuc single board computers. | ||
778 | |||
773 | config MPC5200_WDT | 779 | config MPC5200_WDT |
774 | tristate "MPC5200 Watchdog Timer" | 780 | tristate "MPC5200 Watchdog Timer" |
775 | depends on PPC_MPC52xx | 781 | depends on PPC_MPC52xx |
@@ -790,6 +796,14 @@ config MV64X60_WDT | |||
790 | tristate "MV64X60 (Marvell Discovery) Watchdog Timer" | 796 | tristate "MV64X60 (Marvell Discovery) Watchdog Timer" |
791 | depends on MV64X60 | 797 | depends on MV64X60 |
792 | 798 | ||
799 | config PIKA_WDT | ||
800 | tristate "PIKA FPGA Watchdog" | ||
801 | depends on WARP | ||
802 | default y | ||
803 | help | ||
804 | This enables the watchdog in the PIKA FPGA. Currently used on | ||
805 | the Warp platform. | ||
806 | |||
793 | config BOOKE_WDT | 807 | config BOOKE_WDT |
794 | bool "PowerPC Book-E Watchdog Timer" | 808 | bool "PowerPC Book-E Watchdog Timer" |
795 | depends on BOOKE || 4xx | 809 | depends on BOOKE || 4xx |
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index c19b866f5ed1..806b3eb08536 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile | |||
@@ -111,9 +111,11 @@ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o | |||
111 | # PARISC Architecture | 111 | # PARISC Architecture |
112 | 112 | ||
113 | # POWERPC Architecture | 113 | # POWERPC Architecture |
114 | obj-$(CONFIG_GEF_WDT) += gef_wdt.o | ||
114 | obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o | 115 | obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o |
115 | obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o | 116 | obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o |
116 | obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o | 117 | obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o |
118 | obj-$(CONFIG_PIKA_WDT) += pika_wdt.o | ||
117 | obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o | 119 | obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o |
118 | 120 | ||
119 | # PPC64 Architecture | 121 | # PPC64 Architecture |
diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c new file mode 100644 index 000000000000..f0c2b7a1a175 --- /dev/null +++ b/drivers/watchdog/gef_wdt.c | |||
@@ -0,0 +1,330 @@ | |||
1 | /* | ||
2 | * GE Fanuc watchdog userspace interface | ||
3 | * | ||
4 | * Author: Martyn Welch <martyn.welch@gefanuc.com> | ||
5 | * | ||
6 | * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * Based on: mv64x60_wdt.c (MV64X60 watchdog userspace interface) | ||
14 | * Author: James Chapman <jchapman@katalix.com> | ||
15 | */ | ||
16 | |||
17 | /* TODO: | ||
18 | * This driver does not provide support for the hardwares capability of sending | ||
19 | * an interrupt at a programmable threshold. | ||
20 | * | ||
21 | * This driver currently can only support 1 watchdog - there are 2 in the | ||
22 | * hardware that this driver supports. Thus one could be configured as a | ||
23 | * process-based watchdog (via /dev/watchdog), the second (using the interrupt | ||
24 | * capabilities) a kernel-based watchdog. | ||
25 | */ | ||
26 | |||
27 | #include <linux/kernel.h> | ||
28 | #include <linux/compiler.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/module.h> | ||
31 | #include <linux/miscdevice.h> | ||
32 | #include <linux/watchdog.h> | ||
33 | #include <linux/of.h> | ||
34 | #include <linux/of_platform.h> | ||
35 | #include <linux/io.h> | ||
36 | #include <linux/uaccess.h> | ||
37 | |||
38 | #include <sysdev/fsl_soc.h> | ||
39 | |||
40 | /* | ||
41 | * The watchdog configuration register contains a pair of 2-bit fields, | ||
42 | * 1. a reload field, bits 27-26, which triggers a reload of | ||
43 | * the countdown register, and | ||
44 | * 2. an enable field, bits 25-24, which toggles between | ||
45 | * enabling and disabling the watchdog timer. | ||
46 | * Bit 31 is a read-only field which indicates whether the | ||
47 | * watchdog timer is currently enabled. | ||
48 | * | ||
49 | * The low 24 bits contain the timer reload value. | ||
50 | */ | ||
51 | #define GEF_WDC_ENABLE_SHIFT 24 | ||
52 | #define GEF_WDC_SERVICE_SHIFT 26 | ||
53 | #define GEF_WDC_ENABLED_SHIFT 31 | ||
54 | |||
55 | #define GEF_WDC_ENABLED_TRUE 1 | ||
56 | #define GEF_WDC_ENABLED_FALSE 0 | ||
57 | |||
58 | /* Flags bits */ | ||
59 | #define GEF_WDOG_FLAG_OPENED 0 | ||
60 | |||
61 | static unsigned long wdt_flags; | ||
62 | static int wdt_status; | ||
63 | static void __iomem *gef_wdt_regs; | ||
64 | static int gef_wdt_timeout; | ||
65 | static int gef_wdt_count; | ||
66 | static unsigned int bus_clk; | ||
67 | static char expect_close; | ||
68 | static DEFINE_SPINLOCK(gef_wdt_spinlock); | ||
69 | |||
70 | static int nowayout = WATCHDOG_NOWAYOUT; | ||
71 | module_param(nowayout, int, 0); | ||
72 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | ||
73 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | ||
74 | |||
75 | |||
76 | static int gef_wdt_toggle_wdc(int enabled_predicate, int field_shift) | ||
77 | { | ||
78 | u32 data; | ||
79 | u32 enabled; | ||
80 | int ret = 0; | ||
81 | |||
82 | spin_lock(&gef_wdt_spinlock); | ||
83 | data = ioread32be(gef_wdt_regs); | ||
84 | enabled = (data >> GEF_WDC_ENABLED_SHIFT) & 1; | ||
85 | |||
86 | /* only toggle the requested field if enabled state matches predicate */ | ||
87 | if ((enabled ^ enabled_predicate) == 0) { | ||
88 | /* We write a 1, then a 2 -- to the appropriate field */ | ||
89 | data = (1 << field_shift) | gef_wdt_count; | ||
90 | iowrite32be(data, gef_wdt_regs); | ||
91 | |||
92 | data = (2 << field_shift) | gef_wdt_count; | ||
93 | iowrite32be(data, gef_wdt_regs); | ||
94 | ret = 1; | ||
95 | } | ||
96 | spin_unlock(&gef_wdt_spinlock); | ||
97 | |||
98 | return ret; | ||
99 | } | ||
100 | |||
101 | static void gef_wdt_service(void) | ||
102 | { | ||
103 | gef_wdt_toggle_wdc(GEF_WDC_ENABLED_TRUE, | ||
104 | GEF_WDC_SERVICE_SHIFT); | ||
105 | } | ||
106 | |||
107 | static void gef_wdt_handler_enable(void) | ||
108 | { | ||
109 | if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_FALSE, | ||
110 | GEF_WDC_ENABLE_SHIFT)) { | ||
111 | gef_wdt_service(); | ||
112 | printk(KERN_NOTICE "gef_wdt: watchdog activated\n"); | ||
113 | } | ||
114 | } | ||
115 | |||
116 | static void gef_wdt_handler_disable(void) | ||
117 | { | ||
118 | if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_TRUE, | ||
119 | GEF_WDC_ENABLE_SHIFT)) | ||
120 | printk(KERN_NOTICE "gef_wdt: watchdog deactivated\n"); | ||
121 | } | ||
122 | |||
123 | static void gef_wdt_set_timeout(unsigned int timeout) | ||
124 | { | ||
125 | /* maximum bus cycle count is 0xFFFFFFFF */ | ||
126 | if (timeout > 0xFFFFFFFF / bus_clk) | ||
127 | timeout = 0xFFFFFFFF / bus_clk; | ||
128 | |||
129 | /* Register only holds upper 24 bits, bit shifted into lower 24 */ | ||
130 | gef_wdt_count = (timeout * bus_clk) >> 8; | ||
131 | gef_wdt_timeout = timeout; | ||
132 | } | ||
133 | |||
134 | |||
135 | static ssize_t gef_wdt_write(struct file *file, const char __user *data, | ||
136 | size_t len, loff_t *ppos) | ||
137 | { | ||
138 | if (len) { | ||
139 | if (!nowayout) { | ||
140 | size_t i; | ||
141 | |||
142 | expect_close = 0; | ||
143 | |||
144 | for (i = 0; i != len; i++) { | ||
145 | char c; | ||
146 | if (get_user(c, data + i)) | ||
147 | return -EFAULT; | ||
148 | if (c == 'V') | ||
149 | expect_close = 42; | ||
150 | } | ||
151 | } | ||
152 | gef_wdt_service(); | ||
153 | } | ||
154 | |||
155 | return len; | ||
156 | } | ||
157 | |||
158 | static long gef_wdt_ioctl(struct file *file, unsigned int cmd, | ||
159 | unsigned long arg) | ||
160 | { | ||
161 | int timeout; | ||
162 | int options; | ||
163 | void __user *argp = (void __user *)arg; | ||
164 | static struct watchdog_info info = { | ||
165 | .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | | ||
166 | WDIOF_KEEPALIVEPING, | ||
167 | .firmware_version = 0, | ||
168 | .identity = "GE Fanuc watchdog", | ||
169 | }; | ||
170 | |||
171 | switch (cmd) { | ||
172 | case WDIOC_GETSUPPORT: | ||
173 | if (copy_to_user(argp, &info, sizeof(info))) | ||
174 | return -EFAULT; | ||
175 | break; | ||
176 | |||
177 | case WDIOC_GETSTATUS: | ||
178 | case WDIOC_GETBOOTSTATUS: | ||
179 | if (put_user(wdt_status, (int __user *)argp)) | ||
180 | return -EFAULT; | ||
181 | wdt_status &= ~WDIOF_KEEPALIVEPING; | ||
182 | break; | ||
183 | |||
184 | case WDIOC_SETOPTIONS: | ||
185 | if (get_user(options, (int __user *)argp)) | ||
186 | return -EFAULT; | ||
187 | |||
188 | if (options & WDIOS_DISABLECARD) | ||
189 | gef_wdt_handler_disable(); | ||
190 | |||
191 | if (options & WDIOS_ENABLECARD) | ||
192 | gef_wdt_handler_enable(); | ||
193 | break; | ||
194 | |||
195 | case WDIOC_KEEPALIVE: | ||
196 | gef_wdt_service(); | ||
197 | wdt_status |= WDIOF_KEEPALIVEPING; | ||
198 | break; | ||
199 | |||
200 | case WDIOC_SETTIMEOUT: | ||
201 | if (get_user(timeout, (int __user *)argp)) | ||
202 | return -EFAULT; | ||
203 | gef_wdt_set_timeout(timeout); | ||
204 | /* Fall through */ | ||
205 | |||
206 | case WDIOC_GETTIMEOUT: | ||
207 | if (put_user(gef_wdt_timeout, (int __user *)argp)) | ||
208 | return -EFAULT; | ||
209 | break; | ||
210 | |||
211 | default: | ||
212 | return -ENOTTY; | ||
213 | } | ||
214 | |||
215 | return 0; | ||
216 | } | ||
217 | |||
218 | static int gef_wdt_open(struct inode *inode, struct file *file) | ||
219 | { | ||
220 | if (test_and_set_bit(GEF_WDOG_FLAG_OPENED, &wdt_flags)) | ||
221 | return -EBUSY; | ||
222 | |||
223 | if (nowayout) | ||
224 | __module_get(THIS_MODULE); | ||
225 | |||
226 | gef_wdt_handler_enable(); | ||
227 | |||
228 | return nonseekable_open(inode, file); | ||
229 | } | ||
230 | |||
231 | static int gef_wdt_release(struct inode *inode, struct file *file) | ||
232 | { | ||
233 | if (expect_close == 42) | ||
234 | gef_wdt_handler_disable(); | ||
235 | else { | ||
236 | printk(KERN_CRIT | ||
237 | "gef_wdt: unexpected close, not stopping timer!\n"); | ||
238 | gef_wdt_service(); | ||
239 | } | ||
240 | expect_close = 0; | ||
241 | |||
242 | clear_bit(GEF_WDOG_FLAG_OPENED, &wdt_flags); | ||
243 | |||
244 | return 0; | ||
245 | } | ||
246 | |||
247 | static const struct file_operations gef_wdt_fops = { | ||
248 | .owner = THIS_MODULE, | ||
249 | .llseek = no_llseek, | ||
250 | .write = gef_wdt_write, | ||
251 | .unlocked_ioctl = gef_wdt_ioctl, | ||
252 | .open = gef_wdt_open, | ||
253 | .release = gef_wdt_release, | ||
254 | }; | ||
255 | |||
256 | static struct miscdevice gef_wdt_miscdev = { | ||
257 | .minor = WATCHDOG_MINOR, | ||
258 | .name = "watchdog", | ||
259 | .fops = &gef_wdt_fops, | ||
260 | }; | ||
261 | |||
262 | |||
263 | static int __devinit gef_wdt_probe(struct of_device *dev, | ||
264 | const struct of_device_id *match) | ||
265 | { | ||
266 | int timeout = 10; | ||
267 | u32 freq; | ||
268 | |||
269 | bus_clk = 133; /* in MHz */ | ||
270 | |||
271 | freq = fsl_get_sys_freq(); | ||
272 | if (freq > 0) | ||
273 | bus_clk = freq; | ||
274 | |||
275 | /* Map devices registers into memory */ | ||
276 | gef_wdt_regs = of_iomap(dev->node, 0); | ||
277 | if (gef_wdt_regs == NULL) | ||
278 | return -ENOMEM; | ||
279 | |||
280 | gef_wdt_set_timeout(timeout); | ||
281 | |||
282 | gef_wdt_handler_disable(); /* in case timer was already running */ | ||
283 | |||
284 | return misc_register(&gef_wdt_miscdev); | ||
285 | } | ||
286 | |||
287 | static int __devexit gef_wdt_remove(struct platform_device *dev) | ||
288 | { | ||
289 | misc_deregister(&gef_wdt_miscdev); | ||
290 | |||
291 | gef_wdt_handler_disable(); | ||
292 | |||
293 | iounmap(gef_wdt_regs); | ||
294 | |||
295 | return 0; | ||
296 | } | ||
297 | |||
298 | static const struct of_device_id gef_wdt_ids[] = { | ||
299 | { | ||
300 | .compatible = "gef,fpga-wdt", | ||
301 | }, | ||
302 | {}, | ||
303 | }; | ||
304 | |||
305 | static struct of_platform_driver gef_wdt_driver = { | ||
306 | .owner = THIS_MODULE, | ||
307 | .name = "gef_wdt", | ||
308 | .match_table = gef_wdt_ids, | ||
309 | .probe = gef_wdt_probe, | ||
310 | }; | ||
311 | |||
312 | static int __init gef_wdt_init(void) | ||
313 | { | ||
314 | printk(KERN_INFO "GE Fanuc watchdog driver\n"); | ||
315 | return of_register_platform_driver(&gef_wdt_driver); | ||
316 | } | ||
317 | |||
318 | static void __exit gef_wdt_exit(void) | ||
319 | { | ||
320 | of_unregister_platform_driver(&gef_wdt_driver); | ||
321 | } | ||
322 | |||
323 | module_init(gef_wdt_init); | ||
324 | module_exit(gef_wdt_exit); | ||
325 | |||
326 | MODULE_AUTHOR("Martyn Welch <martyn.welch@gefanuc.com>"); | ||
327 | MODULE_DESCRIPTION("GE Fanuc watchdog driver"); | ||
328 | MODULE_LICENSE("GPL"); | ||
329 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
330 | MODULE_ALIAS("platform: gef_wdt"); | ||
diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c new file mode 100644 index 000000000000..2d22e996e996 --- /dev/null +++ b/drivers/watchdog/pika_wdt.c | |||
@@ -0,0 +1,301 @@ | |||
1 | /* | ||
2 | * PIKA FPGA based Watchdog Timer | ||
3 | * | ||
4 | * Copyright (c) 2008 PIKA Technologies | ||
5 | * Sean MacLennan <smaclennan@pikatech.com> | ||
6 | */ | ||
7 | |||
8 | #include <linux/init.h> | ||
9 | #include <linux/errno.h> | ||
10 | #include <linux/module.h> | ||
11 | #include <linux/moduleparam.h> | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/fs.h> | ||
15 | #include <linux/miscdevice.h> | ||
16 | #include <linux/watchdog.h> | ||
17 | #include <linux/reboot.h> | ||
18 | #include <linux/jiffies.h> | ||
19 | #include <linux/timer.h> | ||
20 | #include <linux/bitops.h> | ||
21 | #include <linux/uaccess.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/of_platform.h> | ||
24 | |||
25 | #define DRV_NAME "PIKA-WDT" | ||
26 | #define PFX DRV_NAME ": " | ||
27 | |||
28 | /* Hardware timeout in seconds */ | ||
29 | #define WDT_HW_TIMEOUT 2 | ||
30 | |||
31 | /* Timer heartbeat (500ms) */ | ||
32 | #define WDT_TIMEOUT (HZ/2) | ||
33 | |||
34 | /* User land timeout */ | ||
35 | #define WDT_HEARTBEAT 15 | ||
36 | static int heartbeat = WDT_HEARTBEAT; | ||
37 | module_param(heartbeat, int, 0); | ||
38 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. " | ||
39 | "(default = " __MODULE_STRING(WDT_HEARTBEAT) ")"); | ||
40 | |||
41 | static int nowayout = WATCHDOG_NOWAYOUT; | ||
42 | module_param(nowayout, int, 0); | ||
43 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " | ||
44 | "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | ||
45 | |||
46 | static struct { | ||
47 | void __iomem *fpga; | ||
48 | unsigned long next_heartbeat; /* the next_heartbeat for the timer */ | ||
49 | unsigned long open; | ||
50 | char expect_close; | ||
51 | int bootstatus; | ||
52 | struct timer_list timer; /* The timer that pings the watchdog */ | ||
53 | } pikawdt_private; | ||
54 | |||
55 | static struct watchdog_info ident = { | ||
56 | .identity = DRV_NAME, | ||
57 | .options = WDIOF_CARDRESET | | ||
58 | WDIOF_SETTIMEOUT | | ||
59 | WDIOF_KEEPALIVEPING | | ||
60 | WDIOF_MAGICCLOSE, | ||
61 | }; | ||
62 | |||
63 | /* | ||
64 | * Reload the watchdog timer. (ie, pat the watchdog) | ||
65 | */ | ||
66 | static inline void pikawdt_reset(void) | ||
67 | { | ||
68 | /* -- FPGA: Reset Control Register (32bit R/W) (Offset: 0x14) -- | ||
69 | * Bit 7, WTCHDG_EN: When set to 1, the watchdog timer is enabled. | ||
70 | * Once enabled, it cannot be disabled. The watchdog can be | ||
71 | * kicked by performing any write access to the reset | ||
72 | * control register (this register). | ||
73 | * Bit 8-11, WTCHDG_TIMEOUT_SEC: Sets the watchdog timeout value in | ||
74 | * seconds. Valid ranges are 1 to 15 seconds. The value can | ||
75 | * be modified dynamically. | ||
76 | */ | ||
77 | unsigned reset = in_be32(pikawdt_private.fpga + 0x14); | ||
78 | /* enable with max timeout - 15 seconds */ | ||
79 | reset |= (1 << 7) + (WDT_HW_TIMEOUT << 8); | ||
80 | out_be32(pikawdt_private.fpga + 0x14, reset); | ||
81 | } | ||
82 | |||
83 | /* | ||
84 | * Timer tick | ||
85 | */ | ||
86 | static void pikawdt_ping(unsigned long data) | ||
87 | { | ||
88 | if (time_before(jiffies, pikawdt_private.next_heartbeat) || | ||
89 | (!nowayout && !pikawdt_private.open)) { | ||
90 | pikawdt_reset(); | ||
91 | mod_timer(&pikawdt_private.timer, jiffies + WDT_TIMEOUT); | ||
92 | } else | ||
93 | printk(KERN_CRIT PFX "I will reset your machine !\n"); | ||
94 | } | ||
95 | |||
96 | |||
97 | static void pikawdt_keepalive(void) | ||
98 | { | ||
99 | pikawdt_private.next_heartbeat = jiffies + heartbeat * HZ; | ||
100 | } | ||
101 | |||
102 | static void pikawdt_start(void) | ||
103 | { | ||
104 | pikawdt_keepalive(); | ||
105 | mod_timer(&pikawdt_private.timer, jiffies + WDT_TIMEOUT); | ||
106 | } | ||
107 | |||
108 | /* | ||
109 | * Watchdog device is opened, and watchdog starts running. | ||
110 | */ | ||
111 | static int pikawdt_open(struct inode *inode, struct file *file) | ||
112 | { | ||
113 | /* /dev/watchdog can only be opened once */ | ||
114 | if (test_and_set_bit(0, &pikawdt_private.open)) | ||
115 | return -EBUSY; | ||
116 | |||
117 | pikawdt_start(); | ||
118 | |||
119 | return nonseekable_open(inode, file); | ||
120 | } | ||
121 | |||
122 | /* | ||
123 | * Close the watchdog device. | ||
124 | */ | ||
125 | static int pikawdt_release(struct inode *inode, struct file *file) | ||
126 | { | ||
127 | /* stop internal ping */ | ||
128 | if (!pikawdt_private.expect_close) | ||
129 | del_timer(&pikawdt_private.timer); | ||
130 | |||
131 | clear_bit(0, &pikawdt_private.open); | ||
132 | pikawdt_private.expect_close = 0; | ||
133 | return 0; | ||
134 | } | ||
135 | |||
136 | /* | ||
137 | * Pat the watchdog whenever device is written to. | ||
138 | */ | ||
139 | static ssize_t pikawdt_write(struct file *file, const char __user *data, | ||
140 | size_t len, loff_t *ppos) | ||
141 | { | ||
142 | if (!len) | ||
143 | return 0; | ||
144 | |||
145 | /* Scan for magic character */ | ||
146 | if (!nowayout) { | ||
147 | size_t i; | ||
148 | |||
149 | pikawdt_private.expect_close = 0; | ||
150 | |||
151 | for (i = 0; i < len; i++) { | ||
152 | char c; | ||
153 | if (get_user(c, data + i)) | ||
154 | return -EFAULT; | ||
155 | if (c == 'V') { | ||
156 | pikawdt_private.expect_close = 42; | ||
157 | break; | ||
158 | } | ||
159 | } | ||
160 | } | ||
161 | |||
162 | pikawdt_keepalive(); | ||
163 | |||
164 | return len; | ||
165 | } | ||
166 | |||
167 | /* | ||
168 | * Handle commands from user-space. | ||
169 | */ | ||
170 | static long pikawdt_ioctl(struct file *file, | ||
171 | unsigned int cmd, unsigned long arg) | ||
172 | { | ||
173 | void __user *argp = (void __user *)arg; | ||
174 | int __user *p = argp; | ||
175 | int new_value; | ||
176 | |||
177 | switch (cmd) { | ||
178 | case WDIOC_GETSUPPORT: | ||
179 | return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; | ||
180 | |||
181 | case WDIOC_GETSTATUS: | ||
182 | return put_user(0, p); | ||
183 | |||
184 | case WDIOC_GETBOOTSTATUS: | ||
185 | return put_user(pikawdt_private.bootstatus, p); | ||
186 | |||
187 | case WDIOC_KEEPALIVE: | ||
188 | pikawdt_keepalive(); | ||
189 | return 0; | ||
190 | |||
191 | case WDIOC_SETTIMEOUT: | ||
192 | if (get_user(new_value, p)) | ||
193 | return -EFAULT; | ||
194 | |||
195 | heartbeat = new_value; | ||
196 | pikawdt_keepalive(); | ||
197 | |||
198 | return put_user(new_value, p); /* return current value */ | ||
199 | |||
200 | case WDIOC_GETTIMEOUT: | ||
201 | return put_user(heartbeat, p); | ||
202 | } | ||
203 | return -ENOTTY; | ||
204 | } | ||
205 | |||
206 | |||
207 | static const struct file_operations pikawdt_fops = { | ||
208 | .owner = THIS_MODULE, | ||
209 | .llseek = no_llseek, | ||
210 | .open = pikawdt_open, | ||
211 | .release = pikawdt_release, | ||
212 | .write = pikawdt_write, | ||
213 | .unlocked_ioctl = pikawdt_ioctl, | ||
214 | }; | ||
215 | |||
216 | static struct miscdevice pikawdt_miscdev = { | ||
217 | .minor = WATCHDOG_MINOR, | ||
218 | .name = "watchdog", | ||
219 | .fops = &pikawdt_fops, | ||
220 | }; | ||
221 | |||
222 | static int __init pikawdt_init(void) | ||
223 | { | ||
224 | struct device_node *np; | ||
225 | void __iomem *fpga; | ||
226 | static u32 post1; | ||
227 | int ret; | ||
228 | |||
229 | np = of_find_compatible_node(NULL, NULL, "pika,fpga"); | ||
230 | if (np == NULL) { | ||
231 | printk(KERN_ERR PFX "Unable to find fpga.\n"); | ||
232 | return -ENOENT; | ||
233 | } | ||
234 | |||
235 | pikawdt_private.fpga = of_iomap(np, 0); | ||
236 | of_node_put(np); | ||
237 | if (pikawdt_private.fpga == NULL) { | ||
238 | printk(KERN_ERR PFX "Unable to map fpga.\n"); | ||
239 | return -ENOMEM; | ||
240 | } | ||
241 | |||
242 | ident.firmware_version = in_be32(pikawdt_private.fpga + 0x1c) & 0xffff; | ||
243 | |||
244 | /* POST information is in the sd area. */ | ||
245 | np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); | ||
246 | if (np == NULL) { | ||
247 | printk(KERN_ERR PFX "Unable to find fpga-sd.\n"); | ||
248 | ret = -ENOENT; | ||
249 | goto out; | ||
250 | } | ||
251 | |||
252 | fpga = of_iomap(np, 0); | ||
253 | of_node_put(np); | ||
254 | if (fpga == NULL) { | ||
255 | printk(KERN_ERR PFX "Unable to map fpga-sd.\n"); | ||
256 | ret = -ENOMEM; | ||
257 | goto out; | ||
258 | } | ||
259 | |||
260 | /* -- FPGA: POST Test Results Register 1 (32bit R/W) (Offset: 0x4040) -- | ||
261 | * Bit 31, WDOG: Set to 1 when the last reset was caused by a watchdog | ||
262 | * timeout. | ||
263 | */ | ||
264 | post1 = in_be32(fpga + 0x40); | ||
265 | if (post1 & 0x80000000) | ||
266 | pikawdt_private.bootstatus = WDIOF_CARDRESET; | ||
267 | |||
268 | iounmap(fpga); | ||
269 | |||
270 | setup_timer(&pikawdt_private.timer, pikawdt_ping, 0); | ||
271 | |||
272 | ret = misc_register(&pikawdt_miscdev); | ||
273 | if (ret) { | ||
274 | printk(KERN_ERR PFX "Unable to register miscdev.\n"); | ||
275 | goto out; | ||
276 | } | ||
277 | |||
278 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | ||
279 | heartbeat, nowayout); | ||
280 | return 0; | ||
281 | |||
282 | out: | ||
283 | iounmap(pikawdt_private.fpga); | ||
284 | return ret; | ||
285 | } | ||
286 | |||
287 | static void __exit pikawdt_exit(void) | ||
288 | { | ||
289 | misc_deregister(&pikawdt_miscdev); | ||
290 | |||
291 | iounmap(pikawdt_private.fpga); | ||
292 | } | ||
293 | |||
294 | module_init(pikawdt_init); | ||
295 | module_exit(pikawdt_exit); | ||
296 | |||
297 | MODULE_AUTHOR("Sean MacLennan <smaclennan@pikatech.com>"); | ||
298 | MODULE_DESCRIPTION("PIKA FPGA based Watchdog Timer"); | ||
299 | MODULE_LICENSE("GPL"); | ||
300 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
301 | |||
diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c index 2bc0d4d4b415..a2d2e8eb2282 100644 --- a/drivers/watchdog/wm8350_wdt.c +++ b/drivers/watchdog/wm8350_wdt.c | |||
@@ -279,7 +279,7 @@ static struct miscdevice wm8350_wdt_miscdev = { | |||
279 | .fops = &wm8350_wdt_fops, | 279 | .fops = &wm8350_wdt_fops, |
280 | }; | 280 | }; |
281 | 281 | ||
282 | static int wm8350_wdt_probe(struct platform_device *pdev) | 282 | static int __devinit wm8350_wdt_probe(struct platform_device *pdev) |
283 | { | 283 | { |
284 | struct wm8350 *wm8350 = platform_get_drvdata(pdev); | 284 | struct wm8350 *wm8350 = platform_get_drvdata(pdev); |
285 | 285 | ||
@@ -296,7 +296,7 @@ static int wm8350_wdt_probe(struct platform_device *pdev) | |||
296 | return misc_register(&wm8350_wdt_miscdev); | 296 | return misc_register(&wm8350_wdt_miscdev); |
297 | } | 297 | } |
298 | 298 | ||
299 | static int __exit wm8350_wdt_remove(struct platform_device *pdev) | 299 | static int __devexit wm8350_wdt_remove(struct platform_device *pdev) |
300 | { | 300 | { |
301 | misc_deregister(&wm8350_wdt_miscdev); | 301 | misc_deregister(&wm8350_wdt_miscdev); |
302 | 302 | ||
@@ -305,7 +305,7 @@ static int __exit wm8350_wdt_remove(struct platform_device *pdev) | |||
305 | 305 | ||
306 | static struct platform_driver wm8350_wdt_driver = { | 306 | static struct platform_driver wm8350_wdt_driver = { |
307 | .probe = wm8350_wdt_probe, | 307 | .probe = wm8350_wdt_probe, |
308 | .remove = wm8350_wdt_remove, | 308 | .remove = __devexit_p(wm8350_wdt_remove), |
309 | .driver = { | 309 | .driver = { |
310 | .name = "wm8350-wdt", | 310 | .name = "wm8350-wdt", |
311 | }, | 311 | }, |
diff --git a/drivers/zorro/.gitignore b/drivers/zorro/.gitignore new file mode 100644 index 000000000000..34f980bd8ff6 --- /dev/null +++ b/drivers/zorro/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | devlist.h | ||
2 | gen-devlist | ||
diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c index 5290552d2ef7..1d2a772ea14c 100644 --- a/drivers/zorro/zorro-sysfs.c +++ b/drivers/zorro/zorro-sysfs.c | |||
@@ -77,17 +77,21 @@ static struct bin_attribute zorro_config_attr = { | |||
77 | .read = zorro_read_config, | 77 | .read = zorro_read_config, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | void zorro_create_sysfs_dev_files(struct zorro_dev *z) | 80 | int zorro_create_sysfs_dev_files(struct zorro_dev *z) |
81 | { | 81 | { |
82 | struct device *dev = &z->dev; | 82 | struct device *dev = &z->dev; |
83 | int error; | ||
83 | 84 | ||
84 | /* current configuration's attributes */ | 85 | /* current configuration's attributes */ |
85 | device_create_file(dev, &dev_attr_id); | 86 | if ((error = device_create_file(dev, &dev_attr_id)) || |
86 | device_create_file(dev, &dev_attr_type); | 87 | (error = device_create_file(dev, &dev_attr_type)) || |
87 | device_create_file(dev, &dev_attr_serial); | 88 | (error = device_create_file(dev, &dev_attr_serial)) || |
88 | device_create_file(dev, &dev_attr_slotaddr); | 89 | (error = device_create_file(dev, &dev_attr_slotaddr)) || |
89 | device_create_file(dev, &dev_attr_slotsize); | 90 | (error = device_create_file(dev, &dev_attr_slotsize)) || |
90 | device_create_file(dev, &dev_attr_resource); | 91 | (error = device_create_file(dev, &dev_attr_resource)) || |
91 | sysfs_create_bin_file(&dev->kobj, &zorro_config_attr); | 92 | (error = sysfs_create_bin_file(&dev->kobj, &zorro_config_attr))) |
93 | return error; | ||
94 | |||
95 | return 0; | ||
92 | } | 96 | } |
93 | 97 | ||
diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c index dff16d9767d8..a1585d6f6486 100644 --- a/drivers/zorro/zorro.c +++ b/drivers/zorro/zorro.c | |||
@@ -130,6 +130,7 @@ static int __init zorro_init(void) | |||
130 | { | 130 | { |
131 | struct zorro_dev *z; | 131 | struct zorro_dev *z; |
132 | unsigned int i; | 132 | unsigned int i; |
133 | int error; | ||
133 | 134 | ||
134 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) | 135 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) |
135 | return 0; | 136 | return 0; |
@@ -140,7 +141,11 @@ static int __init zorro_init(void) | |||
140 | /* Initialize the Zorro bus */ | 141 | /* Initialize the Zorro bus */ |
141 | INIT_LIST_HEAD(&zorro_bus.devices); | 142 | INIT_LIST_HEAD(&zorro_bus.devices); |
142 | strcpy(zorro_bus.dev.bus_id, "zorro"); | 143 | strcpy(zorro_bus.dev.bus_id, "zorro"); |
143 | device_register(&zorro_bus.dev); | 144 | error = device_register(&zorro_bus.dev); |
145 | if (error) { | ||
146 | pr_err("Zorro: Error registering zorro_bus\n"); | ||
147 | return error; | ||
148 | } | ||
144 | 149 | ||
145 | /* Request the resources */ | 150 | /* Request the resources */ |
146 | zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2; | 151 | zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2; |
@@ -160,15 +165,19 @@ static int __init zorro_init(void) | |||
160 | zorro_name_device(z); | 165 | zorro_name_device(z); |
161 | z->resource.name = z->name; | 166 | z->resource.name = z->name; |
162 | if (request_resource(zorro_find_parent_resource(z), &z->resource)) | 167 | if (request_resource(zorro_find_parent_resource(z), &z->resource)) |
163 | printk(KERN_ERR "Zorro: Address space collision on device %s " | 168 | pr_err("Zorro: Address space collision on device %s %pR\n", |
164 | "[%lx:%lx]\n", | 169 | z->name, &z->resource); |
165 | z->name, (unsigned long)zorro_resource_start(z), | ||
166 | (unsigned long)zorro_resource_end(z)); | ||
167 | sprintf(z->dev.bus_id, "%02x", i); | 170 | sprintf(z->dev.bus_id, "%02x", i); |
168 | z->dev.parent = &zorro_bus.dev; | 171 | z->dev.parent = &zorro_bus.dev; |
169 | z->dev.bus = &zorro_bus_type; | 172 | z->dev.bus = &zorro_bus_type; |
170 | device_register(&z->dev); | 173 | error = device_register(&z->dev); |
171 | zorro_create_sysfs_dev_files(z); | 174 | if (error) { |
175 | pr_err("Zorro: Error registering device %s\n", z->name); | ||
176 | continue; | ||
177 | } | ||
178 | error = zorro_create_sysfs_dev_files(z); | ||
179 | if (error) | ||
180 | dev_err(&z->dev, "Error creating sysfs files\n"); | ||
172 | } | 181 | } |
173 | 182 | ||
174 | /* Mark all available Zorro II memory */ | 183 | /* Mark all available Zorro II memory */ |
diff --git a/drivers/zorro/zorro.h b/drivers/zorro/zorro.h index 5c91adac4df1..b682d5ccd63f 100644 --- a/drivers/zorro/zorro.h +++ b/drivers/zorro/zorro.h | |||
@@ -1,4 +1,4 @@ | |||
1 | 1 | ||
2 | extern void zorro_name_device(struct zorro_dev *z); | 2 | extern void zorro_name_device(struct zorro_dev *z); |
3 | extern void zorro_create_sysfs_dev_files(struct zorro_dev *z); | 3 | extern int zorro_create_sysfs_dev_files(struct zorro_dev *z); |
4 | 4 | ||
diff --git a/firmware/Makefile b/firmware/Makefile index ea1d28f9b44c..466106fa2146 100644 --- a/firmware/Makefile +++ b/firmware/Makefile | |||
@@ -78,7 +78,8 @@ fw-shipped- += keyspan/mpr.fw keyspan/usa18x.fw keyspan/usa19.fw \ | |||
78 | keyspan/usa28.fw keyspan/usa28xa.fw keyspan/usa28xb.fw \ | 78 | keyspan/usa28.fw keyspan/usa28xa.fw keyspan/usa28xb.fw \ |
79 | keyspan/usa28x.fw keyspan/usa49w.fw keyspan/usa49wlc.fw | 79 | keyspan/usa28x.fw keyspan/usa49w.fw keyspan/usa49wlc.fw |
80 | endif | 80 | endif |
81 | fw-shipped-$(CONFIG_USB_SERIAL_TI) += ti_3410.fw ti_5052.fw | 81 | fw-shipped-$(CONFIG_USB_SERIAL_TI) += ti_3410.fw ti_5052.fw \ |
82 | mts_cdma.fw mts_gsm.fw mts_edge.fw | ||
82 | fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT) += edgeport/boot.fw edgeport/boot2.fw \ | 83 | fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT) += edgeport/boot.fw edgeport/boot2.fw \ |
83 | edgeport/down.fw edgeport/down2.fw | 84 | edgeport/down.fw edgeport/down2.fw |
84 | fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += edgeport/down3.bin | 85 | fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += edgeport/down3.bin |
diff --git a/firmware/WHENCE b/firmware/WHENCE index 8b5651347791..524113f9bea3 100644 --- a/firmware/WHENCE +++ b/firmware/WHENCE | |||
@@ -191,7 +191,7 @@ Original licence information: None | |||
191 | 191 | ||
192 | -------------------------------------------------------------------------- | 192 | -------------------------------------------------------------------------- |
193 | 193 | ||
194 | Driver: tu_usb_3410_5052 -- USB TI 3410/5052 serial device | 194 | Driver: ti_usb_3410_5052 -- USB TI 3410/5052 serial device |
195 | 195 | ||
196 | File: ti_3410.fw | 196 | File: ti_3410.fw |
197 | Info: firmware 9/10/04 FW3410_Special_StartWdogOnStartPort | 197 | Info: firmware 9/10/04 FW3410_Special_StartWdogOnStartPort |
@@ -206,6 +206,20 @@ Found in hex form in kernel source. | |||
206 | 206 | ||
207 | -------------------------------------------------------------------------- | 207 | -------------------------------------------------------------------------- |
208 | 208 | ||
209 | Driver: ti_usb_3410_5052 -- Multi-Tech USB cell modems | ||
210 | |||
211 | File: mts_cdma.fw | ||
212 | File: mts_gsm.fw | ||
213 | File: mts_edge.fw | ||
214 | |||
215 | Licence: "all firmware components are redistributable in binary form" | ||
216 | per support@multitech.com | ||
217 | Copyright (C) 2005 Multi-Tech Systems, Inc. | ||
218 | |||
219 | Found in hex form in ftp://ftp.multitech.com/wireless/wireless_linux.zip | ||
220 | |||
221 | -------------------------------------------------------------------------- | ||
222 | |||
209 | Driver: whiteheat -- USB ConnectTech WhiteHEAT serial device | 223 | Driver: whiteheat -- USB ConnectTech WhiteHEAT serial device |
210 | 224 | ||
211 | File: whiteheat.fw | 225 | File: whiteheat.fw |
diff --git a/firmware/mts_cdma.fw.ihex b/firmware/mts_cdma.fw.ihex new file mode 100644 index 000000000000..f6ad0cbd30cb --- /dev/null +++ b/firmware/mts_cdma.fw.ihex | |||
@@ -0,0 +1,867 @@ | |||
1 | :1000000014360002001E021AF9FFFFFFFFFF023341 | ||
2 | :100010001DFFFFFFFFFFFFFFFFFFFFFFFFFF02339B | ||
3 | :10002000C87581CE90FDE88583A012353CEC4D600B | ||
4 | :100030007378AB8003760018B89CFA787F800376DB | ||
5 | :100040000018B865FA78208003760018B820FA788E | ||
6 | :10005000208003760018B81FFA90FDDDAE83AF82D2 | ||
7 | :1000600090FBF81200AA6005E4F0A380F690FDE88A | ||
8 | :10007000A88290FDE8A982E8696005E4F20880F7AB | ||
9 | :100080009001081200B390010C1200B390011012FD | ||
10 | :1000900000B39001141200D190011A1200D1900106 | ||
11 | :1000A000201200D175D00012341A020126EF6582A9 | ||
12 | :1000B0007003EE658322E493F8740193F97402935C | ||
13 | :1000C000FE740393F5828E83E869700122E493F64F | ||
14 | :1000D000A30880F4E493FC740193FD740293FE740E | ||
15 | :1000E0000393FF740493F8740593F58288831200D8 | ||
16 | :1000F000AA700122E493A3A883A9828C838D82F045 | ||
17 | :10010000A3AC83AD828883898280E32121049B8014 | ||
18 | :1001100080049BACAE049BFDE8049D049DFBF304AE | ||
19 | :10012000A2049DFBF30502050280FED0F030F00929 | ||
20 | :1001300020F303F68010F7800D30F10920F303F26D | ||
21 | :100140008004F38001F020F404FCD0E0CC22CCC089 | ||
22 | :10015000E0120163020154BC0005D0F0ACF022C3F0 | ||
23 | :1001600013DCFC02012ABF0009ED258275F001F8BD | ||
24 | :10017000E622BF010FED2582F582EE3583F583750A | ||
25 | :10018000F004E022ED258275F002F8E222D083D05F | ||
26 | :1001900082F5F0C3E493A3C5F095F0C0E0C3D0F0BE | ||
27 | :1001A000E493A395F04012A3A3C3E5F033500205F6 | ||
28 | :1001B000832582F58250020583740193C0E0E493A5 | ||
29 | :1001C000C0E022D083D082F5F0E4937009740193EB | ||
30 | :1001D0007004A3A3800C74029365F06005A3A3A32D | ||
31 | :1001E00080E7740193C0E0E493C0E022120264024D | ||
32 | :1001F00001FB1202B80201FB1202DC0201FB30E03B | ||
33 | :100200000720E302E622E72230E10720E302E222B0 | ||
34 | :10021000E32230E202E022E493221202DC02022313 | ||
35 | :100220001202B8020223ABF012022DCBC5F0CB2292 | ||
36 | :1002300030E01020E306E6F5F008E622E7F5F009E5 | ||
37 | :10024000E7192230E11020E306E2F5F008E222E3AC | ||
38 | :10025000F5F009E3192230E206E0F5F0A3E022E42C | ||
39 | :1002600093F5F074019322BB0003740922BB0107CC | ||
40 | :1002700089828A83740422BB020789828A8374106C | ||
41 | :1002800022740A22020284BB0007E92582F8740165 | ||
42 | :1002900022BB010DE92582F582EA3583F5837404DA | ||
43 | :1002A00022BB020DE92582F582EA3583F5837410BD | ||
44 | :1002B00022E92582F87402220202B8BF0005EDF897 | ||
45 | :1002C000740122BF01078D828E83740422BF02074E | ||
46 | :1002D0008D828E83741022EDF87402220202DCBF3C | ||
47 | :1002E0000007ED2582F8740122BF010DED2582F58E | ||
48 | :1002F00082EE3583F583740422BF020DED2582F56D | ||
49 | :1003000082EE3583F583741022ED2582F874022283 | ||
50 | :10031000020310C0E0120264020328C0E01202B817 | ||
51 | :10032000020328C0E01202DC02032830E00B20E3C5 | ||
52 | :1003300004D0E0F622D0E0F72230E10B20E304D035 | ||
53 | :10034000E0F222D0E0F322D0E0F022C9CDC9CACE3B | ||
54 | :10035000CACBCFCB12035BEDF9EEFAEFFB22BB0069 | ||
55 | :100360002FBF000AFAEDF8E7F60809DAFA22BF0112 | ||
56 | :10037000128D828E83F802037809A3E7F0D8FA225F | ||
57 | :10038000020383FAEDF8E7F20809DAFA2202038D94 | ||
58 | :10039000BB014DBF001489828A83F9EDF802039FE7 | ||
59 | :1003A00008A3E0F6D9FA220203B0BF01228D828EA3 | ||
60 | :1003B00083FB08C9C582C9CAC583CAE0A3C9C5826F | ||
61 | :1003C000C9CAC583CAF0A3DBEAD8E8220203D38DE9 | ||
62 | :1003D000828E83F9EDF8E0F208A3D9FA220203DD58 | ||
63 | :1003E000BB024DBF001289828A83F9EDF80203EF48 | ||
64 | :1003F00008A3E493F6D9F922BF01238D828E83FBF3 | ||
65 | :1004000008C9C582C9CAC583CAE493A3C9C582C93C | ||
66 | :10041000CAC583CAF0A3DBE9D8E722020422898295 | ||
67 | :100420008A83F9EDF8E493F208A3D9F922020433A0 | ||
68 | :10043000BF000DFAEDF8E3F60809DAFA2202043DEE | ||
69 | :10044000BF01128D828E83F802044A09A3E3F0D81B | ||
70 | :10045000FA22020455FAEDF8E3F20809DAFA220268 | ||
71 | :10046000045FE6FB08E6FA08E6F904F618700106F0 | ||
72 | :1004700022E6FF08E6FE08E6FD22EFF0A3EEF0A379 | ||
73 | :10048000EDF022EBF0A3EAF0A3E9F022E0FFA3E015 | ||
74 | :10049000FEA3E0FD22E0FBA3E0FAA3E0F9220000C6 | ||
75 | :1004A00000000000000502006105710026059800AB | ||
76 | :1004B000330A0900610A750066154400610CF900F1 | ||
77 | :1004C0006109A9006109E000610DC000610BF10044 | ||
78 | :1004D000610A1C00610A510061173C0033174F008C | ||
79 | :1004E000341E1400431EBF0044202C0044201A0078 | ||
80 | :1004F000471EE600471F8B004D1FDC004F1F080002 | ||
81 | :100500005832A800617CCC7DFF121CC52290FFFCF4 | ||
82 | :10051000E020E72DC2AFAE59AF58755A20E55A1406 | ||
83 | :10052000C55A6019E4FE7F05EE4FCE24FFCECF34CE | ||
84 | :10053000FFCF6007E490FF92F080ED80E08E598F4E | ||
85 | :10054000582212050A7D077CB71232C47D0F7C6EDB | ||
86 | :100550001232DE789D7A06E4F608DAFC7A06120595 | ||
87 | :10056000CD7C03120E55122168E4FEFF7C0F12327F | ||
88 | :100570004DD2A822123138E490FC38F090FFF0E020 | ||
89 | :1005800030E408740190FC39F08005E490FC39F007 | ||
90 | :100590007D0A7C001225461231BB2212313890FCB4 | ||
91 | :1005A00039E014700E90FFF0E04410F07C0012254A | ||
92 | :1005B000DF801990FC39E0700E90FFF0E054EFF00E | ||
93 | :1005C0007C001225DF80057C171225DF1231BB224B | ||
94 | :1005D00090FFF0E054ABF090FFF0E04420F0228C6C | ||
95 | :1005E000378D367882EDF608ECF6EDFEECFD7F01F6 | ||
96 | :1005F0009000051201F57880F67882E6FD08E6FCA9 | ||
97 | :10060000EDFEECFD7F019000041201F5540FFC7D1E | ||
98 | :100610008012176D7880E6700DAD3AAE39AF38E4D0 | ||
99 | :100620001203187C082290FFF0E054FEF090FFF0D7 | ||
100 | :10063000E054FDF0801E7882E6FD08E6FCEDFEEC5D | ||
101 | :10064000FD7F0190000812021725E0440190FFF39E | ||
102 | :10065000F00206D97882E6FD08E6FCEDFEECFD7FAF | ||
103 | :100660000190000612021754FE90FFF3F0802B78E1 | ||
104 | :1006700082E6FD08E6FCEDFEECFD7F01900008122D | ||
105 | :100680000217FAEB90FFF1F01208C8400DAD3AAE38 | ||
106 | :1006900039AF38E41203187C18227882E6FD08E6A8 | ||
107 | :1006A000FCEDFEECFD7F0190000812021790FFF1B7 | ||
108 | :1006B000F01208C8400DAD3AAE39AF38E412031855 | ||
109 | :1006C0007C18227882E6FD08E6FCEDFEECFD7F0159 | ||
110 | :1006D000900006120217440190FFF3F07883E6249D | ||
111 | :1006E00003F618E63400F67880E624FE500990FF01 | ||
112 | :1006F000F0E054FDF0800790FFF0E04402F0E49059 | ||
113 | :10070000FFF1F0788176007880E624FFFCE434FF86 | ||
114 | :10071000FD7881E67F00FEECD39EEF6480CD64809F | ||
115 | :100720009D402F1208AD400F7881E6AD3AAE39AF4B | ||
116 | :10073000381203187C182290FFF2E0FC788286833E | ||
117 | :10074000088682ECF0788106A37882A68308A682C8 | ||
118 | :1007500080B51208AD400F7881E6AD3AAE39AF38BA | ||
119 | :100760001203187C182290FFF2E0FC78828683083E | ||
120 | :100770008682ECF07880E6AD3AAE39AF38120318D5 | ||
121 | :100780007C00228C378D367882EDF608ECF6EDFE93 | ||
122 | :10079000ECFD7F019000051201F57881F67882E684 | ||
123 | :1007A000FD08E6FCEDFEECFD7F019000041201F572 | ||
124 | :1007B000540FFC7D8112176D7881E670037C08224E | ||
125 | :1007C00090FFF0E054FEF090FFF0E054FDF0801B4D | ||
126 | :1007D0007882E6FD08E6FCEDFEECFD7F0190000866 | ||
127 | :1007E00012021725E090FFF3F0805B7882E6FD08A7 | ||
128 | :1007F000E6FCEDFEECFD7F0190000612021754FEB0 | ||
129 | :1008000090FFF3F080217882E6FD08E6FCEDFEEC37 | ||
130 | :10081000FD7F01900008120217FAEB90FFF1F01231 | ||
131 | :1008200008C840037C18227882E6FD08E6FCEDFE4D | ||
132 | :10083000ECFD7F0190000812021790FFF1F0120802 | ||
133 | :10084000C840037C18227883E6240AF618E63400B0 | ||
134 | :10085000F6788076007881E624FFFCE434FFFD78AA | ||
135 | :1008600080E67F00FEECD39EEF6480CD64809D40E7 | ||
136 | :100870002178828683088682E090FFF1F01208C812 | ||
137 | :1008800040037C1822788006788306E618700106FB | ||
138 | :1008900080C390FFF0E04401F0788286830886826E | ||
139 | :1008A000E090FFF1F01208C840037C18227C00227F | ||
140 | :1008B00090FFF0E020E71290FFF0E030E50990FFB4 | ||
141 | :1008C000F0E04420F0C32280E7D32290FFF0E02044 | ||
142 | :1008D000E31290FFF0E030E50990FFF0E04420F0F3 | ||
143 | :1008E000C32280E7D3228C428D417C00ED54F0FD81 | ||
144 | :1008F000EC7003ED64307005753E038003753E04B3 | ||
145 | :10090000AC3E120F72758300858340E541540FF5AC | ||
146 | :100910003FE5407004E53F64037035E53E24FD7516 | ||
147 | :10092000F00AA42402F582E434FCF583E030E60505 | ||
148 | :100930001210598019E53E249DF8E654FBF678A97B | ||
149 | :10094000E62405F58218E63400F583740FF080592B | ||
150 | :10095000E5407004E53F64047048E53E24FD75F011 | ||
151 | :100960000AA42402F582E434FCF583E030E507AC08 | ||
152 | :1009700042AD41121C5AE54230E21578ADE630E056 | ||
153 | :100980000F78ADE630E109E4FF04FE7C0412324D3D | ||
154 | :1009900078A9E62406F58218E63400F583740FF092 | ||
155 | :1009A0008007E4FC7DEE121C5AC203221231381279 | ||
156 | :1009B0000F7278A9E62406F58218E63400F583E084 | ||
157 | :1009C00090FC38F078A9E62405F58218E63400F5A5 | ||
158 | :1009D00083E090FC39F0C2037D027C0012254612B0 | ||
159 | :1009E00031BB221231387895ECF6EC249DF8E630D4 | ||
160 | :1009F000E1077C131225DF800F90FC39E0FD78952C | ||
161 | :100A0000E6FC1213EF1225DF1231BB2212313878C7 | ||
162 | :100A100095ECF67D00120F121225DF1231BB221267 | ||
163 | :100A200031387895ECF6EC249DF8E630E2077C133B | ||
164 | :100A30001225DF801B7895E6249DF8E620E1077CEF | ||
165 | :100A4000121225DF800A7895E6FC1214131225DFB6 | ||
166 | :100A50001231BB221231387895ECF6EC249DF8E681 | ||
167 | :100A600020E2077C111225DF800A7895E6FC12153A | ||
168 | :100A7000141225DF1231BB221231387895ECF612B0 | ||
169 | :100A80000F7278A9E62409F58218E63400F583E0B0 | ||
170 | :100A900090FC3FF078A9E6240AF58218E63400F5C8 | ||
171 | :100AA00083E090FC40F078A9E62403F58218E63450 | ||
172 | :100AB00000F583E0FC78A9E62404F58218E634000A | ||
173 | :100AC000F583E0F56278A9E62402F58218E63400A1 | ||
174 | :100AD000F583E0F5638C61E4EC333354017895F6EB | ||
175 | :100AE0006008E56230E1037895067895E690FC4170 | ||
176 | :100AF000F078A7E62402F58218E63400F583E0FDDD | ||
177 | :100B0000A3E0540CFCED54E68C65F564E56130E53A | ||
178 | :100B100003436501E56220E50EE561547F7008E559 | ||
179 | :100B20006120E703436502E56130E303436510E5B7 | ||
180 | :100B30006130E203436520E561540360034365408F | ||
181 | :100B4000E56130E103436580E56130E4034364011E | ||
182 | :100B5000E56130E603436408E56220E40EE5615494 | ||
183 | :100B60007F7008E56120E7034364105365FB53641D | ||
184 | :100B7000F9AD64E56590FC3ACDF0A3CDF0E56330C6 | ||
185 | :100B8000E30DE5635430C4540F90FC3DF08005E460 | ||
186 | :100B900090FC3DF0E563540390FC3CF0E5635404A5 | ||
187 | :100BA000C31390FC3EF090FC3CE0700E7D357EFC63 | ||
188 | :100BB0007F01740190000912014B78A9E62408F521 | ||
189 | :100BC0008218E63400F583E07C00FD78A9E624076E | ||
190 | :100BD000F58218E63400F583E07F004CFEEF4D907F | ||
191 | :100BE000FC38F0A3CEF0CEC2037D0A7C001225466D | ||
192 | :100BF0001231BB221231387895ECF6789A760108DA | ||
193 | :100C000076FC0876387897760C789A12046E120281 | ||
194 | :100C10001D7898CBF6CB08F67F00EF24EA401FE45E | ||
195 | :100C2000EF25E090357EFD93CD04937899667003AF | ||
196 | :100C3000ED186670067897760080030F80DC789652 | ||
197 | :100C4000EFF6789A12046E9000021202177898CB91 | ||
198 | :100C5000F6CB08F65404CB54064B60047897760B19 | ||
199 | :100C60007899E630E313789A12046E900005120129 | ||
200 | :100C7000F524FB50047897760D7899E654C07D00F2 | ||
201 | :100C800064C04D70047897760B789A12046E9000C9 | ||
202 | :100C9000041201F524FC50047897760F789A120418 | ||
203 | :100CA0006E9000061201F524FD50047897760E78B8 | ||
204 | :100CB0009A12046E9000091201F524FD50047897F1 | ||
205 | :100CC000760A7897E6702A7895E6FC120F72789A81 | ||
206 | :100CD00012046E78A7E6F978A6E6FA7B01740A7822 | ||
207 | :100CE00000120348C2037895E6FC1211157897ECC0 | ||
208 | :100CF000F67897E6FC1225DF1231BB2212313878E4 | ||
209 | :100D000095ECF6120F727895E624FD75F00AA4248E | ||
210 | :100D100014F582E434FCF583AC82AD8378A6868337 | ||
211 | :100D2000088682ECF9EDFA7B0A78011203B0C2035F | ||
212 | :100D30007895E6FC1211151231BB228D2B8C2AED11 | ||
213 | :100D400060407527017529487528FFE52A24FDFCB8 | ||
214 | :100D5000E434FFFDEC7C0325E0CD33CDDCF9FCE58C | ||
215 | :100D6000292CF529E5283DF528AD29AE28AF2774B3 | ||
216 | :100D7000809000061203207480900002120320125B | ||
217 | :100D80000FC5E52B14603B7527017529087528FFF1 | ||
218 | :100D9000E52A24FDFCE434FFFDEC7C0325E0CD33A3 | ||
219 | :100DA000CDDCF9FCE5292CF529E5283DF528AD2910 | ||
220 | :100DB000AE28AF27E4900006120320E49000021250 | ||
221 | :100DC0000320221231387895ECF6EC249DF8E630B9 | ||
222 | :100DD000E2097895E6FC121514D2007895E6FC122B | ||
223 | :100DE0000F727896760090FC39E030E704789676BA | ||
224 | :100DF000017896E6FD7895E6FC120D38C2033000C6 | ||
225 | :100E0000077895E6FC1214137C001225DF1231BB23 | ||
226 | :100E10002278A9E62404F58218E63400F583E0443C | ||
227 | :100E200001F078A9E62404F58218E63400F583E0A1 | ||
228 | :100E300030E00280ED78A9E6240BF58218E6340054 | ||
229 | :100E4000F583E054F8F078A9E62402F58218E63438 | ||
230 | :100E500000F583E04480F022C2038C58120F7278B0 | ||
231 | :100E6000A6868308868279AF7A357B0A78011203D9 | ||
232 | :100E7000FE120E0EAC587D02120D38C203AC581291 | ||
233 | :100E80001115228D538E528F518C50120F72754F47 | ||
234 | :100E90000078A9E62405F58218E63400F583E02001 | ||
235 | :100EA000E41FE54F24F64019054FC2037C181232A7 | ||
236 | :100EB000FB90FF93E04401F0B2B3AC50120F72808C | ||
237 | :100EC000D078A9E62405F58218E63400F583E02001 | ||
238 | :100ED000E405C2037C022278A9E62405F58218E61F | ||
239 | :100EE0003400F583E0540F601678A9E62405F582F6 | ||
240 | :100EF00018E63400F583E0540FF0C2037C01227839 | ||
241 | :100F0000A88683088682E0AD53AE52AF5112031813 | ||
242 | :100F1000C2037C00228D318C30121514E531600F34 | ||
243 | :100F2000E530B4030A7C0112250E7C8112250EAC3B | ||
244 | :100F300030120F72E531601A78AA8683088682E043 | ||
245 | :100F400054E7F0A3A3A3A3E054E7F0AC307D021272 | ||
246 | :100F50000D3878A6868308868279B97A357B0A7837 | ||
247 | :100F6000011203FEC203E530249DF8E654FDF6AC01 | ||
248 | :100F700030121115228C2630030512329A80F87C2B | ||
249 | :100F80000A1231ADD203E52624FD78A3F670077866 | ||
250 | :100F9000AA76FF0876E078A3E67D007C0425E0CD04 | ||
251 | :100FA00033CDDCF9FC24A078A9F6ED34FF18F678EF | ||
252 | :100FB000A3E675F00AA42400FCE434FCFD78A6ED59 | ||
253 | :100FC000F608ECF61232462278A9E62402F58218D9 | ||
254 | :100FD000E63400F583E030E72278A9E62402F582C2 | ||
255 | :100FE00018E63400F583E0547FF078A9E62402F592 | ||
256 | :100FF0008218E63400F583E04480F02278AA8683E4 | ||
257 | :10100000088682E0547FF0AD83E5822404FCE43D51 | ||
258 | :101010008C82F583E0547FF078A9E6240BF58218E2 | ||
259 | :10102000E63400F583E054F8F078ABE62401F5826D | ||
260 | :1010300018E63400F583E04403F078ABE62405F5C8 | ||
261 | :101040008218E63400F583E04403F078A9E624052D | ||
262 | :10105000F58218E63400F583740FF02278AA8683AF | ||
263 | :10106000088682E0543FF0AD83E5822404FCE43D31 | ||
264 | :101070008C82F583E0543FF078A3E624A4F8E6FCE4 | ||
265 | :1010800078ABE62401F58218E63400F583ECF078BD | ||
266 | :10109000A3E624A4F8E6FC78ABE62405F58218E67E | ||
267 | :1010A0003400F583ECF078A9E6240BF58218E634D9 | ||
268 | :1010B00000F583E054FB4402F52678A7E62402F508 | ||
269 | :1010C0008218E63400F583E030E50343260178A971 | ||
270 | :1010D000E62405F58218E63400F583E030E00312DB | ||
271 | :1010E0000FC5E526FC78A9E6240BF58218E6340046 | ||
272 | :1010F000F583ECF078A9E62405F58218E63400F5CE | ||
273 | :1011000083740FF078AA8683088682E04480F0A377 | ||
274 | :10111000A3A3A3E04480F0228C2A120F7278A7E6E2 | ||
275 | :101120002408F58218E63400F583E0FC78A9E6246B | ||
276 | :101130000AF58218E63400F583ECF078A7E6240778 | ||
277 | :10114000F58218E63400F583E0FC78A9E62409F579 | ||
278 | :101150008218E63400F583ECF078A6868308868250 | ||
279 | :10116000E0FDA3E0FCEDFE78A9E62408F58218E690 | ||
280 | :101170003400F583EEF0ECFE78A9E62407F582183A | ||
281 | :10118000E63400F583EEF08C298D28C3EC9405ED50 | ||
282 | :10119000940C400575277C8033D3E5299401E5281C | ||
283 | :1011A0009403400575273C8023D3E5299481E528E5 | ||
284 | :1011B000940140057527188013D3E5299460E5282C | ||
285 | :1011C0009400400575270C8003752708AF27E4EFCE | ||
286 | :1011D000547C4483FF8F27E527FC78ABE62401F598 | ||
287 | :1011E0008218E63400F583ECF0E527FC78ABE624C2 | ||
288 | :1011F00005F58218E63400F583ECF0E527FC78A3CA | ||
289 | :10120000E624A4F8ECF678A9E62402F58218E63480 | ||
290 | :1012100000F583E0F52778A7E62402F58218E63486 | ||
291 | :1012200000F583A3E030E3175327C778A7E624052A | ||
292 | :10123000F58218E63400F583E09035AA93422778CA | ||
293 | :10124000A7E62402F58218E63400F583E030E705CE | ||
294 | :1012500043274080035327BF5327FB78A7E6240684 | ||
295 | :10126000F58218E63400F583E06003432704532732 | ||
296 | :10127000FC78A7E62404F58218E63400F583E04202 | ||
297 | :1012800027432780E527FC78A9E62402F58218E6A3 | ||
298 | :101290003400F583ECF078A9E62404F58218E634EE | ||
299 | :1012A00000F583E0F52778A7E62402F58218E634F6 | ||
300 | :1012B00000F583A3E030E1055327DF8003432720B7 | ||
301 | :1012C00078A7E62402F58218E63400F583E030E4DE | ||
302 | :1012D000055327EF800343271078A7E62409F582FA | ||
303 | :1012E00018E63400F583E0B40203432702E527FC47 | ||
304 | :1012F00078A9E62404F58218E63400F583ECF0784A | ||
305 | :10130000A9E62403F58218E63400F583E0F5277892 | ||
306 | :10131000A7E62409F58218E63400F583E07005534A | ||
307 | :10132000277F800343278078A7E62402F58218E60A | ||
308 | :101330003400F583A3E030E00543272080035327E2 | ||
309 | :10134000DF78A7E62402F58218E63400F583E03062 | ||
310 | :10135000E30543274080035327BF78A7E62402F51F | ||
311 | :101360008218E63400F583E030E00543271080035F | ||
312 | :101370005327EF78A7E62402F58218E63400F583B8 | ||
313 | :10138000A3E030E40543270880035327F778A7E656 | ||
314 | :101390002402F58218E63400F583A3E030E5054326 | ||
315 | :1013A000270480035327FB78A7E62402F58218E67A | ||
316 | :1013B0003400F583A3E030E605432701800353277B | ||
317 | :1013C000FE78A7E62402F58218E63400F583A3E050 | ||
318 | :1013D00030E70543270280035327FDE527FC78A962 | ||
319 | :1013E000E62403F58218E63400F583ECF0C2037CB2 | ||
320 | :1013F00000228D278C26ED54031460037C1022E517 | ||
321 | :1014000027547C24FC40037C0B22E526249DF8E62F | ||
322 | :101410004402F67C00228C30120F72E530249DF8D5 | ||
323 | :10142000E620E24FAC307D02120D38E53024FE4458 | ||
324 | :1014300028FC78AA8683088682ECF0AF83E58224B4 | ||
325 | :1014400004FEE43FFFEC8E828F83F07C038C2CE55E | ||
326 | :101450002CFC78ABE62401F58218E63400F583EC29 | ||
327 | :10146000F0E52CFC78ABE62405F58218E63400F5AF | ||
328 | :1014700083ECF0752D01752F48752EFFE53024FDA6 | ||
329 | :10148000FCE434FFFDEC7C0325E0CD33CDDCF9FC3E | ||
330 | :10149000E52F2CF52FE52E3DF52E78ABE62404F54F | ||
331 | :1014A0008218E63400F583E054E7F52CAD2FAE2E1C | ||
332 | :1014B000AF2DE4900002120320E4900006120320F6 | ||
333 | :1014C0001201EF30E503432C10E52CFC78ABE62449 | ||
334 | :1014D00004F58218E63400F583ECF012105978A96F | ||
335 | :1014E000E62406F58218E63400F583E0C203FCE545 | ||
336 | :1014F00030249DF8E64404F68C2CE530540FC45497 | ||
337 | :10150000F07E00FFEEEF44047D00FFEC4EFCED4F5B | ||
338 | :10151000FD121CC57C00228C2F120F72120FF9785D | ||
339 | :10152000AA8683088682E05408F0A3A3A3A3E0540C | ||
340 | :1015300008F0AC2F7D02120D38C203E52F249DF870 | ||
341 | :10154000E654FBF67C00221231387896ECF6EC2457 | ||
342 | :101550009DF8E630E10A7D007C131225461231BB6E | ||
343 | :101560007896E6249DF8E64401F67896E6FC120F9C | ||
344 | :10157000727896E624FD75F00AA42414F582E4340A | ||
345 | :10158000FCF58378A6E6FA08E6F97B0A78011203EF | ||
346 | :10159000B078A6868308868279B97A357B0A780185 | ||
347 | :1015A0001203FE120FC5C2037896E6FC12111578DD | ||
348 | :1015B00095ECF6EC600A7D007C081225461231BBE2 | ||
349 | :1015C0007896E6FC120F7278A9E62404F58218E6F4 | ||
350 | :1015D0003400F583E0441054DFFC78A9E62404F5D8 | ||
351 | :1015E0008218E63400F583ECF07895ECF6C2037CC3 | ||
352 | :1015F000C81232FB7896E6FC120F7278A9E6240432 | ||
353 | :10160000F58218E63400F583E054EFF0C2037CC89D | ||
354 | :101610001232FB7896E6FC120F7278A9E62404F5E4 | ||
355 | :101620008218E63400F583E04410F0C2037CC8124F | ||
356 | :1016300032FB7896E6FC120F7278A9E62404F58254 | ||
357 | :1016400018E63400F583E04420F0C2037CF0123247 | ||
358 | :10165000FB7896E6FC120F7278A9E62405F582184D | ||
359 | :10166000E63400F583E030E415C2037896E64410D2 | ||
360 | :101670007F00FE7C0712324D1231BB02173B78A966 | ||
361 | :10168000E62404F58218E63400F583E054CFF0C276 | ||
362 | :10169000037CC81232FB7896E6FC120F7278A9E63A | ||
363 | :1016A0002404F58218E63400F583E04430F0C203E8 | ||
364 | :1016B0007CF01232FB7896E6FC120F7278A9E624D1 | ||
365 | :1016C00005F58218E63400F583E030E414C20378AF | ||
366 | :1016D00096E644107F00FE7C0712324D1231BB802B | ||
367 | :1016E0005D78A9E62404F58218E63400F583E05419 | ||
368 | :1016F000EFF078A9E62404F58218E63400F583E0DB | ||
369 | :1017000054DFF07896E624FD75F00AA42414F582DF | ||
370 | :10171000E434FCF583AC82AD8378A68683088682A8 | ||
371 | :10172000ECF9EDFA7B0A78011203B0C2037896E671 | ||
372 | :10173000FC1211157D007C0B1225461231BB2212C2 | ||
373 | :101740003138E490FC39F07D027C001225461231DC | ||
374 | :10175000BB221231387C001225DF1231BB22743CCF | ||
375 | :1017600090FBE0F0743E90FBE0F0E490FC28F02267 | ||
376 | :101770008D358C34ECB401028003D340028028B450 | ||
377 | :1017800002028003D34008A835E625E0F68018B4AD | ||
378 | :1017900004028003D3400AA835E625E025E0F68060 | ||
379 | :1017A00006A83576008000228C3C8D3BEDFEECFDDA | ||
380 | :1017B0007F0175660675670090FC29120477120197 | ||
381 | :1017C000EFB480028006D3500302186E90FC2912F9 | ||
382 | :1017D00004899000031201F554F0B430028003D361 | ||
383 | :1017E000405F90FC29120489900008120217FAFD4C | ||
384 | :1017F000EBFE7F0190FC2C120477EECD9035C3FCFC | ||
385 | :10180000E493FF740193FEF9EFFA7B01EAFFE9FE2E | ||
386 | :10181000ECC39EED9F40259035C5E493FD74019384 | ||
387 | :10182000FCEDFEECFD7F01EECDFC90FC2EE0D39CA8 | ||
388 | :1018300090FC2DE09D5005756680803312198C80D8 | ||
389 | :101840002EB460028003D3400BAC3CAD3B1207804A | ||
390 | :101850008C66801BB41003B34010C3B42003B340A4 | ||
391 | :1018600009C3B440028003D34000756681800080C4 | ||
392 | :1018700075B481028003D3406B90FC2912048990D7 | ||
393 | :1018800000031201F554F0B430028003D3401D90E0 | ||
394 | :10189000FC29120489900008120217FAFDEBFE7F62 | ||
395 | :1018A0000190FC2F1204771218F68036B460028083 | ||
396 | :1018B00003D34013753A67E4F539F538AC3CAD3BDA | ||
397 | :1018C0001205DC8C66801BB41003B34010C3B42037 | ||
398 | :1018D00003B34009C3B440028003D340007566815E | ||
399 | :1018E000800080028000E566FC90FC29120489ECEF | ||
400 | :1018F000900002120320AC672290FC291204899008 | ||
401 | :1019000000041201F5600474018001E4A2E0920178 | ||
402 | :1019100090FC29120489ED2403FD50010E90FC2C4B | ||
403 | :1019200012047790FC291204899000051201F5F544 | ||
404 | :10193000679000041201F5540FFC7D6712176DE5E6 | ||
405 | :10194000677004756608227566007884760078846E | ||
406 | :10195000E6C39567503890FC2F1204891201EFFC02 | ||
407 | :1019600090FC2C120489EC12031830010E90FC310B | ||
408 | :10197000E004F090FC307003E004F078840690FC02 | ||
409 | :101980002EE004F090FC2D7003E004F080C0229063 | ||
410 | :10199000FC2AE0FDA3E0FCEDFEECFD7F01ED240A56 | ||
411 | :1019A000FD50010E90FC3212047790FC291204893C | ||
412 | :1019B0009000041201F5540FB401028003D34017C4 | ||
413 | :1019C00090FC321204890DED70010E90FC2F120470 | ||
414 | :1019D0007778887601804EB402028003D340199054 | ||
415 | :1019E000FC32120489ED2402FD50010E90FC2F12EE | ||
416 | :1019F000047778887602802DB404028003D34019DE | ||
417 | :101A000090FC32120489ED2404FD50010E90FC2F4D | ||
418 | :101A100012047778887604800CB400028003D340E7 | ||
419 | :101A2000007566082290FC291204899000051201B5 | ||
420 | :101A3000F5F567788576007885E6C39567400302FB | ||
421 | :101A40001AF4788676007886E6C378889650769081 | ||
422 | :101A5000FC2C1204891201EFFC90FC321204921249 | ||
423 | :101A600001E9F45CFC1201E9F890FC2F120489E80A | ||
424 | :101A7000C0E01201EFC8D0E0C8584CFC90FC2C121A | ||
425 | :101A80000489EC1203187887ECF690FC31E004F03E | ||
426 | :101A900090FC307003E004F009E970010A90FC3218 | ||
427 | :101AA00012048090FC291204899000041201F53080 | ||
428 | :101AB000E40E90FC2EE004F090FC2D7003E004F0A6 | ||
429 | :101AC00078860680817888E6FDE4FEFFEECDFC9006 | ||
430 | :101AD000FC31E02CF090FC30E03DF07888E6FDE44D | ||
431 | :101AE000FEFFEECDFC90FC34E02CF090FC33E03DAA | ||
432 | :101AF000F0788506021A347566002222C0E0C0F034 | ||
433 | :101B0000C082C083C0D0E8C0E0E9C0E0EAC0E0EB3A | ||
434 | :101B1000C0E0ECC0E0EDC0E0EEC0E0EFC0E090FF60 | ||
435 | :101B200092E01201C01B47301B47321B56381B681E | ||
436 | :101B30003A1B7A3E1B92441B86461B9E501BE0526A | ||
437 | :101B40001BBF541C015600001C2290FF92E07F0036 | ||
438 | :101B5000FE7C0112324D021C32E4FF04FE7C0312B3 | ||
439 | :101B6000324D742090FFFEF0021C32E4FF04FE7C34 | ||
440 | :101B70000212324D744090FFFEF0021C32E4FF046A | ||
441 | :101B8000FE7C0412324D021C32E4FF04FE7C05127E | ||
442 | :101B9000324D021C32E4FF04FE7C0612324D021C60 | ||
443 | :101BA0003290FFA5E07D0090FBF8CDF0A3CDF09042 | ||
444 | :101BB000FBF9E0FCF58390FBF8E04433FD121CC513 | ||
445 | :101BC000807390FFB5E07D0090FBFACDF0A3CDF0DF | ||
446 | :101BD00090FBFBE0FCF58390FBFAE04443FD121C14 | ||
447 | :101BE000C5805290FFA6E07D0090FBFCCDF0A3CD18 | ||
448 | :101BF000F090FBFDE0FCF58390FBFCE04434FD122B | ||
449 | :101C00001CC5803190FFB6E07D0090FBFECDF0A3B7 | ||
450 | :101C1000CDF090FBFFE0FCF58390FBFEE04444FD3B | ||
451 | :101C2000121CC5801090FF92E07D00FCED44AAFDDF | ||
452 | :101C3000121CC58000E490FF92F0D0E0FFD0E0FEDF | ||
453 | :101C4000D0E0FDD0E0FCD0E0FBD0E0FAD0E0F9D06D | ||
454 | :101C5000E0F8D0D0D083D082D0F0D0E0320581053A | ||
455 | :101C60008105810581A881181818EDF608ECF69019 | ||
456 | :101C7000FF5AE020E70280F790FF59E07D00A8813D | ||
457 | :101C800018CDF6CD08F67D03A881E618FCE6CC2534 | ||
458 | :101C9000E0CC33CCDDF9CCF6CC08F6A88118E644CC | ||
459 | :101CA000F8F6A881181818E6FD08E6FCA881188641 | ||
460 | :101CB00083088682EDF0A3ECF0740290FF5AF015D1 | ||
461 | :101CC0008115811581158122E5812405F581E4A81E | ||
462 | :101CD0008118F6A88118181818EDF608ECF690FB94 | ||
463 | :101CE000F5E024F85003021DE6E4A8811818F6A8D0 | ||
464 | :101CF0008118E6FEA88118181818E6FD08E6FC7F92 | ||
465 | :101D000000EF24F8404DE4EF25E0247DF582E43433 | ||
466 | :101D1000FCF583E0FBA3E06C7003FAEB6D700974D3 | ||
467 | :101D200001A8811818F6802BE4EF25E0247DF582C8 | ||
468 | :101D3000E434FCF5837A00E054F0CCF8CCCDF9CD56 | ||
469 | :101D4000FB7800E954F0F9EA687002EB6970010E63 | ||
470 | :101D50000F80AEA88118EEF6A88118181818EDF6B5 | ||
471 | :101D600008ECF6A881EFF6A8811818E67079A8812A | ||
472 | :101D700018E624F74071A88118181818E6540FA81F | ||
473 | :101D800081F664046017A881E664036010A88118D6 | ||
474 | :101D9000181818E6FD08E6FC121C5A804A7C0A1244 | ||
475 | :101DA00031ADA88118181818E6FD08E6FC90FBF480 | ||
476 | :101DB000E025E0247DF582E434FCF583EDF0A3EC2E | ||
477 | :101DC000F090FBF4E0FFE4EF045407FF90FBF4F025 | ||
478 | :101DD00090FBF5E004F012324690FBF6E07008E468 | ||
479 | :101DE000FEFF7C0F12324D802790FBF7E004F05489 | ||
480 | :101DF0003F701D90FBF7E044FE7D00FC90FBF4E09B | ||
481 | :101E000025E0247DF582E434FCF583EDF0A3ECF0CD | ||
482 | :101E1000E58124FBF58122788B7600788C7600743E | ||
483 | :101E20000190FBF6F012313890FBF5E060577C0A28 | ||
484 | :101E30001231AD90FBF3E025E0247DF582E434FC23 | ||
485 | :101E4000F583E0FDA3E0FC90FBF3E025E0247DF5C5 | ||
486 | :101E500082E434FCF583E4F0A3F090FBF3E0FFE4CC | ||
487 | :101E6000EF045407FF90FBF3F090FBF5E014F078DB | ||
488 | :101E700089EDF608ECF61232467889E6FD08E6FCB4 | ||
489 | :101E80001208E380A312329A90FF93E04401F0B26B | ||
490 | :101E9000B3788B06B60011788B7600788CE6F40464 | ||
491 | :101EA00004A2E092B4788CF6021E25E490FBF6F0D2 | ||
492 | :101EB00090FBF5E07D00FCED44CFFD121C5A123181 | ||
493 | :101EC000BB22123138E5706449456F601590FF837D | ||
494 | :101ED000E0540F7D00D39570ED956F5005122F8162 | ||
495 | :101EE00080031230511231BB22123138E57064493F | ||
496 | :101EF000456F600512308B800E90FF80E04408F043 | ||
497 | :101F000090FF83E0547FF01231BB221231388C54A1 | ||
498 | :101F1000EC54F0B41015756A357569FC756801E507 | ||
499 | :101F20006A2403F56AE5693400F569E4F557F55666 | ||
500 | :101F3000E556C394015027E554540FFCAD6AAE69D1 | ||
501 | :101F4000AF68120E808C55EC60028012056AE56A5B | ||
502 | :101F5000700205690557E5577002055680D2E554B1 | ||
503 | :101F6000540F249DF8E654FEF6E554540F7F00FE0E | ||
504 | :101F70007C1212324DE5551470097D007C09122542 | ||
505 | :101F8000468007AD577C001225461231BB22123124 | ||
506 | :101F90003890FFFCE04402F090FF00E030E713903F | ||
507 | :101FA000FF83E04480F0436D8090FFFCE04401F04B | ||
508 | :101FB000801190FF82E04408F0536D7F90FFFCE0B9 | ||
509 | :101FC00054FEF090FF81E04480F01225F990FFFE6E | ||
510 | :101FD000E04405F090FFFCE054FDF01231BB22120A | ||
511 | :101FE00031387C011232FB78ADE64402F674FEFC17 | ||
512 | :101FF00004FD121CC590FF5AE030E70280F7E4F5BB | ||
513 | :102000004E754D10AC4EAD4DE54E154E7002154D52 | ||
514 | :10201000EC4D600280EE4387011231BB2212313851 | ||
515 | :102020007C021231C778ADE654FDF61231BB2212A4 | ||
516 | :10203000313878ADE630E02C78ADE630E12678AD89 | ||
517 | :10204000E6FCF58318E644F0FD121C5A90FFFCE014 | ||
518 | :102050004420F07C021232FB78ADE654FDF6741A8F | ||
519 | :1020600090FFFEF078ADE6FCF58318E644F1FD1232 | ||
520 | :102070001C5A1231BB22756D0090FFFFE0600343D4 | ||
521 | :102080006D01756E00E4F56CF56BE4F56F757049E4 | ||
522 | :10209000748490FF82F0748490FF80F0748090FFCD | ||
523 | :1020A00058F0748090FF5AF0AD46AF457E00EE24A4 | ||
524 | :1020B000FE5003022142E4EE75F007A4247FF5826E | ||
525 | :1020C000E434F8F583E0FFE4EF5480FDE4EF540FCF | ||
526 | :1020D00014FFED6038E4EF75F008A42448F582E4BD | ||
527 | :1020E00034FFF5837490F0E4EF75F008A4244AF50A | ||
528 | :1020F00082E434FFF5837480F0E4EF75F008A424E3 | ||
529 | :102100004EF582E434FFF5837480F08034E4EF759B | ||
530 | :10211000F008A42408F582E434FFF5837490F0E419 | ||
531 | :10212000EF75F008A4240AF582E434FFF583E4F0A7 | ||
532 | :10213000E4EF75F008A4240EF582E434FFF583E49F | ||
533 | :10214000F00E0220AB8D468E448F45747F90FFFDCC | ||
534 | :10215000F0749090FFFCF0228C58EC24F65006E5C9 | ||
535 | :10216000582437FC22E5582430FC22D2B0122543F3 | ||
536 | :10217000EC700302227E755C03AE5B7F00E55C15AC | ||
537 | :102180005C6480247F5035EF2400F582E434FBF555 | ||
538 | :1021900083E0FE24FE501EEF7D00FCE4FB7474C35C | ||
539 | :1021A0009CFAEB9DFBEE7D00FCEAC39CED6480CBCA | ||
540 | :1021B00064809B50028005EF2EFF80C18E5B8F5A9A | ||
541 | :1021C000E55C6480247F500302227EE55A248E5011 | ||
542 | :1021D0000302227E855A5D755B00AE5AAF5B903577 | ||
543 | :1021E000EEE493F55CE55C155C6480247F5018EEAA | ||
544 | :1021F0002400F582E434FBF583E0FCEF9035EE93A8 | ||
545 | :102200006C70040E0F80DE8E5A8F5BE55C64802458 | ||
546 | :102210007F406E755E017560E8755FFFE55D2402C5 | ||
547 | :10222000F55A755C07E55C334057AD60AE5FAF5E55 | ||
548 | :10223000E55CF5823395E0F5831201F5C4540FFC9B | ||
549 | :10224000122155E55A2400F582E434FBF583ECF0C5 | ||
550 | :10225000055A055AAD60AE5FAF5EE55CF582339519 | ||
551 | :10226000E0F5831201F5540FFC122155E55A2400C4 | ||
552 | :10227000F582E434FBF583ECF0055A055A155C80D1 | ||
553 | :10228000A4740290F851F090F86B79C77A357B27E7 | ||
554 | :1022900078011203FE756A357569FC756801E49072 | ||
555 | :1022A000FF83F0748090FF81F0755902E55975F055 | ||
556 | :1022B00007A4247FF582E434F8F583E0788FF6FCF8 | ||
557 | :1022C000540F14FC788FECF6E55975F007A42481BF | ||
558 | :1022D000F582E434F8F583E0789276FD0876E8FC40 | ||
559 | :1022E000788FE675F008A42448F582E434FFF5837E | ||
560 | :1022F000E4F0788FE675F008A4244FF582E434FF0B | ||
561 | :10230000F583ECF07892E6FF08E67E03CFC313CFA7 | ||
562 | :1023100013DEF9FE788FE675F008A42449F582E40F | ||
563 | :1023200034FFF583EEF0788FE675F008A4244AF5C3 | ||
564 | :1023300082E434FFF5837480F07890ECF67D0078C9 | ||
565 | :1023400093E62CF618E63DF67892E6FD08E67C0367 | ||
566 | :10235000CDC313CD13DCF9FC788FE675F008A42407 | ||
567 | :102360004DF582E434FFF583ECF0788FE675F008E4 | ||
568 | :10237000A4244EF582E434FFF583E4F07892E6FD80 | ||
569 | :1023800008E6FC788FE6FF7E00EE24FE5003022470 | ||
570 | :10239000FDE4EE75F007A4247FF582E434F8F583BC | ||
571 | :1023A000E0FFE4EF5480FAE4EF540F14FFE4EE751D | ||
572 | :1023B000F007A42481F582E434F8F583E07890F600 | ||
573 | :1023C000E4EE1313548024F0F8E434FDF9E8FCE95A | ||
574 | :1023D000FD8A5AEA700302246AE4EF75F008A42427 | ||
575 | :1023E00048F582E434FFF583E4F07890E6FAE4EF10 | ||
576 | :1023F00075F008A4244FF582E434FFF583EAF0ED8C | ||
577 | :10240000FBEC7A03CBC313CB13DAF9FAE4EF75F0E4 | ||
578 | :1024100008A42449F582E434FFF583EAF07890E6D5 | ||
579 | :102420007B00FAEC2AFCED3BFDFBEC7A03CBC313FB | ||
580 | :10243000CB13DAF9FAE4EF75F008A4244DF582E441 | ||
581 | :1024400034FFF583EAF0E4EF75F008A4244AF5823E | ||
582 | :10245000E434FFF5837480F0E4EF75F008A4244EB3 | ||
583 | :10246000F582E434FFF5837480F00224F9E4EF751B | ||
584 | :10247000F008A42408F582E434FFF583E4F07890B2 | ||
585 | :10248000E6FAE4EF75F008A4240FF582E434FFF5D2 | ||
586 | :1024900083EAF0EDFBEC7A03CBC313CB13DAF9FA42 | ||
587 | :1024A000E4EF75F008A42409F582E434FFF583EA2B | ||
588 | :1024B000F07890E67B00FAEC2AFCED3BFDFBEC7A31 | ||
589 | :1024C00003CBC313CB13DAF9FAE4EF75F008A424B5 | ||
590 | :1024D0000DF582E434FFF583EAF0E4EF75F008A42B | ||
591 | :1024E000240AF582E434FFF583E4F0E4EF75F008A4 | ||
592 | :1024F000A4240EF582E434FFF583E4F00E02238673 | ||
593 | :102500008E597892EDF608ECF6788FEFF61220737C | ||
594 | :10251000228C26EC30E718E526540F1475F008A439 | ||
595 | :102520002448F582E434FFF583E054DFF08016E5BB | ||
596 | :1025300026540F1475F008A42408F582E434FFF53E | ||
597 | :1025400083E054DFF0227C0022EC90FC37F08C24F6 | ||
598 | :10255000ED2403F5257D00D39572ED95714003853B | ||
599 | :102560007225E52524B75009752503740290FC37C0 | ||
600 | :10257000F0AC2512307622E4F56CF56B12257D2245 | ||
601 | :1025800090FC35E06573600E740490FC37F0E4F560 | ||
602 | :102590006B756C0380467D73E4FEFF79357AFC7BB6 | ||
603 | :1025A0000174057800120348E56C2403F56CE56BB3 | ||
604 | :1025B0003400F56BE56CD39572E56B95714006853B | ||
605 | :1025C000726C85716BD3E56C9448E56B9400400C9C | ||
606 | :1025D000740290FC37F0E4F56B756C03AC6C123050 | ||
607 | :1025E0007622EC90FC37F0E4F56CF56B8C32EC6005 | ||
608 | :1025F0000512306780057C001230762290FF93E050 | ||
609 | :102600004401F0B2B390FF04E0F54A90FF06E0FD0C | ||
610 | :10261000A3E0ED7D00FC7D00FC90FF06E0FFA3E061 | ||
611 | :102620007E00FFE4FEEC4EFCED4FFDC3EC9448ED64 | ||
612 | :102630009400502290FF06E0FDA3E0ED7D00FC7DBC | ||
613 | :1026400000FC90FF06E0FFA3E07E00FFE4FEEC4EFE | ||
614 | :10265000FCED4FFD8004E4FD7C488C728D7190FF91 | ||
615 | :1026600002E0FDA3E0ED7D00FC7D00FC90FF02E0B8 | ||
616 | :10267000FFA3E07E00FFE4FEEC4EF54CED4FF54B82 | ||
617 | :10268000756A357569FC7568017D357EFC7F017959 | ||
618 | :1026900073E4FAFB74057800120348754900E549B4 | ||
619 | :1026A00024FE4019AD6AAE69AF68E412031805490B | ||
620 | :1026B0000DED70010E8D6A8E698F6880E1756A3547 | ||
621 | :1026C0007569FC75680190FF00E05460B4000280F9 | ||
622 | :1026D00006D35003022CBFE54A540FF549E54A548E | ||
623 | :1026E00080A2E0920290FF01E012018A000B2CBA56 | ||
624 | :1026F000270528232CBA292F2CBA2A122A462BADBB | ||
625 | :102700002BB02BF02C632C91E56D30E70EE54C459A | ||
626 | :102710004B7008E572640245716003022CBC90FFA7 | ||
627 | :1027200000E0541FB400028003D34029E54A60034F | ||
628 | :10273000022820AD6AAE69AF68740112031878AD43 | ||
629 | :10274000E630E00BAD6AAE69AF6874021203187C24 | ||
630 | :102750000212307622B401028003D3401BE56D20C3 | ||
631 | :10276000E107E54A6003022820E54A24FE500302FF | ||
632 | :1027700028207C0212307622B402028006D3500355 | ||
633 | :1027800002281EE56D20E10DE54A6009E54A6480F6 | ||
634 | :102790006003022820AC4A1230FD4003022820E5E5 | ||
635 | :1027A00049702530021190FF80E05408AD6AAE698F | ||
636 | :1027B000AF68120318800F90FF82E05408AD6AAE34 | ||
637 | :1027C00069AF68120318803D154930021DE549754F | ||
638 | :1027D000F008A42448F582E434FFF583E05408AD02 | ||
639 | :1027E0006AAE69AF68120318801BE54975F008A44A | ||
640 | :1027F0002408F582E434FFF583E05408AD6AAE693D | ||
641 | :10280000AF68120318AD6AAE69AF681201EF600BD2 | ||
642 | :10281000AD6AAE69AF6874011203187C021230769B | ||
643 | :10282000228000022CBCE56D20E706E57245716050 | ||
644 | :1028300003022CBC90FF00E0541FB400028003D3BD | ||
645 | :10284000401AE54C14454B7004E54A600302292CFC | ||
646 | :1028500078ADE654FEF67C0012307622B401028098 | ||
647 | :1028600003D3402AE56D20E108E56D20E00302294D | ||
648 | :102870002CE56D30E004E54A700BE56D30E109E5CB | ||
649 | :102880004A24FE500302292C7C0012307622B40226 | ||
650 | :10289000028006D3500302292AE54C454B6003020F | ||
651 | :1028A000292CAC4A1230FD400302292CE56D20E1B1 | ||
652 | :1028B00007E56D20E0028077E56D30E006E54960D0 | ||
653 | :1028C00002806CE549700F90FF82E054F7F090FFB2 | ||
654 | :1028D00080E054F7F022E549B401028003D34009B7 | ||
655 | :1028E0007D017C03120F128011B402028003D340D9 | ||
656 | :1028F000097D017C04120F1280001549300215E594 | ||
657 | :102900004975F008A42448F582E434FFF583E054C7 | ||
658 | :10291000F7F08013E54975F008A42408F582E43443 | ||
659 | :10292000FFF583E054F7F07C00123076228000023D | ||
660 | :102930002CBCE56D20E706E57245716003022CBCF6 | ||
661 | :1029400090FF00E0541FB400028003D3401AE54C0E | ||
662 | :1029500014454B7004E54A6003022A0F78ADE64443 | ||
663 | :1029600001F67C0012307622B401028003D34029A4 | ||
664 | :10297000E56D20E108E56D20E003022A0FE56D30EA | ||
665 | :10298000E004E549700BE56D30E108E54924FE50AF | ||
666 | :1029900002807F7C0012307622B402028003D34092 | ||
667 | :1029A0006FE54C454B60028069AC4A1230FD400235 | ||
668 | :1029B0008060E56D20E107E56D20E0028054E54987 | ||
669 | :1029C000701430020990FF80E04408F0800790FF07 | ||
670 | :1029D00082E04408F022E56D30E1331549300215FC | ||
671 | :1029E000E54975F008A42448F582E434FFF583E056 | ||
672 | :1029F0004408F08013E54975F008A42408F582E442 | ||
673 | :102A000034FFF583E04408F07C0012307622800227 | ||
674 | :102A10008000022CBCE56D20E712E5724571700C58 | ||
675 | :102A2000E54A700890FF00E0541F6003022CBCE5EB | ||
676 | :102A30004C90FFFFF090FFFFE06005436D018003C5 | ||
677 | :102A4000536DFE7C0012307622E56D30E70EE572A4 | ||
678 | :102A50004571600890FF00E0541F6003022CBCAD7C | ||
679 | :102A60004BE54CED7D00FC7D00FCBD0002800302C7 | ||
680 | :102A70002BA8B401028003D34032E54A7005E54C2F | ||
681 | :102A8000FC6003022BAA756A407569F8756801D36A | ||
682 | :102A9000E5729412E57194004006E4FD7C12800416 | ||
683 | :102AA000AC72AD718C708D6F12308B22B4020280CB | ||
684 | :102AB00003D34059E54A6003022BAAE54CFC70277A | ||
685 | :102AC000756A527569F8756801D3E5729419E571F4 | ||
686 | :102AD00094004006E4FD7C198004AC72AD718C70EA | ||
687 | :102AE0008D6F12308B8025756A6B7569F87568017A | ||
688 | :102AF000D3E5729427E57194004006E4FD7C2780BD | ||
689 | :102B000004AC72AD718C708D6F12308B22B40302E5 | ||
690 | :102B10008006D35003022BA8E54CF549700F90FFB7 | ||
691 | :102B200004E0FDA3E04D6003022BAA801890FB0295 | ||
692 | :102B3000E0FDA3E0FC90FF05E06C700790FF04E06F | ||
693 | :102B40006D60028068E4F570F56F7F00E54914C59B | ||
694 | :102B500049600FEF2400F582E434FBF583E02FFF9A | ||
695 | :102B600080EA8F4AE54A2400F582E434FBF583E0ED | ||
696 | :102B70007D00D39572ED95714006AC72AD71800FFA | ||
697 | :102B8000E54A2400F582E434FBF583E07D00FC8C0B | ||
698 | :102B9000708D6FE54A2400FCE434FBFDFEECFD7F04 | ||
699 | :102BA000018D6A8E698F6812308B228000022CBCE6 | ||
700 | :102BB000022CBCE56D30E719E5721445717012E521 | ||
701 | :102BC0004A700EE54C454B700890FF00E0541F60C2 | ||
702 | :102BD00003022CBCE56D20E008E56D20E103022C2A | ||
703 | :102BE000BC756A6EE4F569F568E4F56F04F570127A | ||
704 | :102BF000308B22E56D20E727E57245717021E54AAB | ||
705 | :102C0000701DE54C6402454B600DE54C14454B606E | ||
706 | :102C100006E54C454B700890FF00E0541F6003022E | ||
707 | :102C20002CBCE56D20E008E56D20E103022CBC859D | ||
708 | :102C30004C6EE56E700A436D01536DFDD2B080207D | ||
709 | :102C4000E56E64026007E56E1460028072536DFEEB | ||
710 | :102C5000436D02E56E64026005E56E147002C2B059 | ||
711 | :102C60007C0012307622E56D30E71AE5721445716A | ||
712 | :102C70007013E54A700FE54C454B700990FF00E07A | ||
713 | :102C8000541F1460028038E56D20E10280317C0120 | ||
714 | :102C900012307622E56D20E715E5724571700FE57B | ||
715 | :102CA0004C454B700990FF00E0541F146002800FE8 | ||
716 | :102CB000E56D20E10280087C00123076228000025F | ||
717 | :102CC0002F7DB440028006D35003022F7390FF0182 | ||
718 | :102CD000E090FC35F0E54A90FC36F0E490FC37F0EB | ||
719 | :102CE000E56A2403F56AE5693400F569AD4BE54C06 | ||
720 | :102CF000856A82856983CDF0A3CDF090FF01E01253 | ||
721 | :102D000001C02D2A012D50022D7A032DA4042DF28D | ||
722 | :102D1000052E2F062E55072E7B082EA7092ECD0B2C | ||
723 | :102D20002EF30C2F02802F028100002F60E56D2012 | ||
724 | :102D3000E7067C051225DF227D767E357F02793815 | ||
725 | :102D40007AFC7B01740878001203487D087C00122D | ||
726 | :102D5000254622E56D20E7067C051225DF22E54A9F | ||
727 | :102D6000B403004010B40500500BE54A7F00FE7C20 | ||
728 | :102D70001012324D227D007C0712254622E56D207F | ||
729 | :102D8000E7067C051225DF22E54AB403004010B4B3 | ||
730 | :102D90000500500BE54A7F00FE7C1112324D227D6A | ||
731 | :102DA000007C0712254622E56D20E7067C051225EA | ||
732 | :102DB000DF22E54AB405028003D3400AE4FF04FEA3 | ||
733 | :102DC0007C0A12324D22B401028003D3400AE4FF90 | ||
734 | :102DD00004FE7C0812324D22B403004010B40500FA | ||
735 | :102DE000500BE54A7F00FE7C1312324D227D007CA1 | ||
736 | :102DF0000712254622E56D20E734D3E5729448E5B5 | ||
737 | :102E00007194005006E572457170067C021225DF50 | ||
738 | :102E100022E54AB40103B3400BC3B403004009B434 | ||
739 | :102E200006005004123123227C071225DF221225CE | ||
740 | :102E30007D22E56D20E71DE54AB403004010B4058E | ||
741 | :102E400000500BE54A7F00FE7C1612324D227C07B3 | ||
742 | :102E50001225DF2212257D22E56D20E71DE54AB40B | ||
743 | :102E600003004010B40500500BE54A7F00FE7C19BA | ||
744 | :102E700012324D227C071225DF2212257D22E56DBC | ||
745 | :102E800020E723748190FF93F0E54AB403004010DB | ||
746 | :102E9000B40500500BE54A7F00FE7C1712324D222C | ||
747 | :102EA0007C071225DF2212257D22E56D20E71DE536 | ||
748 | :102EB0004AB403004010B40500500BE54A7F00FE01 | ||
749 | :102EC0007C1812324D227C071225DF2212257D222A | ||
750 | :102ED000E56D20E71DE54AB403004010B40500503D | ||
751 | :102EE0000BE54A7F00FE7C1512324D227C0712252D | ||
752 | :102EF000DF2212257D22E56D20E7067C071225DF03 | ||
753 | :102F00002212257D22E56D30E72090FF00E0541F5E | ||
754 | :102F1000701090FF01E0B480051225748003122523 | ||
755 | :102F20007D227D007C051225462290FF00E0541F83 | ||
756 | :102F300060067C051225DF22D3E5729448E5719482 | ||
757 | :102F400000500BC3E5729407E571940050067C03B2 | ||
758 | :102F50001225DF22E54AB40504123123227C071230 | ||
759 | :102F600025DF22E56D30E7087D007C05122546222D | ||
760 | :102F70007C051225DF22B420028003D340008000AC | ||
761 | :102F80001230512275430090FF83E0540FD39543D4 | ||
762 | :102F90004024E54324F0F582E434FEF583E0AD6A95 | ||
763 | :102FA000AE69AF6812031805430DED70010E8D6A0E | ||
764 | :102FB0008E698F6880D1E5437D00FCC3E5709CF588 | ||
765 | :102FC00070E56F9DF56FE570456F6006E490FF83D7 | ||
766 | :102FD000F02290FF82E04408F0E4F56F75704990AC | ||
767 | :102FE000FC35E0B405028003D3404090FC36E0F5A8 | ||
768 | :102FF00043B405028003D3400AE4FF04FE7C0B12B5 | ||
769 | :10300000324D22B401028003D3400AE4FF04FE7C67 | ||
770 | :103010000912324D22B403004010B40500500BE5F4 | ||
771 | :10302000437F00FE7C1412324D2222B480004023E4 | ||
772 | :10303000B48200501E7C357DFC1217A57D008C6C7F | ||
773 | :103040008D6B90FC37E0600512305180057C0012DA | ||
774 | :103050003076222290FF83E0547FF090FF82E0449C | ||
775 | :1030600008F090FF80E04408F02290FF82E04408DE | ||
776 | :10307000F090FF80E04408F0228C237D008C708D5E | ||
777 | :103080006F756A357569FC75680112308B2290FF87 | ||
778 | :1030900083E0547FF0E5706449456F700122C3E519 | ||
779 | :1030A000709408E56F94004015752108E5217D00B6 | ||
780 | :1030B000FCC3E5709CF570E56F9DF56F8009857028 | ||
781 | :1030C00021E4F56F757049752200E522C395215002 | ||
782 | :1030D00026AD6AAE69AF681201EFFCE52224F8F56F | ||
783 | :1030E00082E434FEF583ECF005220DED70010E8DC7 | ||
784 | :1030F0006A8E698F6880D3E521547F90FF81F0222A | ||
785 | :103100008C487F00EF24FD4019E4EF75F007A424FC | ||
786 | :103110007FF582E434F8F583E065487002D3220F2E | ||
787 | :1031200080E28F47C32285727085716F90FF82E0C5 | ||
788 | :1031300054F7F090FF83E0547FF022C000C001C03C | ||
789 | :1031400002C006C007E5782408F8860653067F7C8F | ||
790 | :10315000FF1231AD7C007D00E57B6046FF90FD9560 | ||
791 | :10316000E0547F6E700FC083C082A3E0FDA3E0FC3B | ||
792 | :10317000A3157B8007A3A3A3DFE68026DF06D0820A | ||
793 | :10318000D083801EE0F8A3E0F9A3E0FAD082D083D8 | ||
794 | :10319000E8F0A3E9F0A3EAF0A3C083C082A3A3A34D | ||
795 | :1031A00080DA123246D007D006D002D001D00022F9 | ||
796 | :1031B00085A87A75A888EC70027C3F8C7922E57826 | ||
797 | :1031C0002408F8760012329A80FBC000C001C002C9 | ||
798 | :1031D000C006C007AE047CFF1231ADE57B6042FF44 | ||
799 | :1031E00090FD95E0547F6E700BC083C082A3A3A3B3 | ||
800 | :1031F000157B8007A3A3A3DFEA8026DF06D082D059 | ||
801 | :103200008380D8E0F8A3E0F9A3E0FAD082D083E885 | ||
802 | :10321000F0A3E9F0A3EAF0A3C083C082A3A3A38034 | ||
803 | :10322000DA7808087918097C01E6547F6E70067612 | ||
804 | :10323000007700800608090CBC08EE123246D00761 | ||
805 | :10324000D006D002D001D00022757900857AA8225C | ||
806 | :10325000C0F0C082C083C3E57B24E8500512329AD7 | ||
807 | :1032600080F4EC6031903575E493C39C4028C00431 | ||
808 | :103270007CFF1231ADD004430480E57B75F003A4DC | ||
809 | :103280002495F582E434FDF583ECF0EFA3F0EEA392 | ||
810 | :10329000F0057B123246D083D082D0F022C0047C6D | ||
811 | :1032A00020D28CD28DD504FDD0042275A80075885B | ||
812 | :1032B0000075B80075F00075D000E4F8900000F6D5 | ||
813 | :1032C00008B800FB020000C3ED940250047D037CAB | ||
814 | :1032D000E8ECF4FCEDF4FD0CBC00010D8C7F8D7E60 | ||
815 | :1032E00022C3EC94BCED940250047D077CD0ECF436 | ||
816 | :1032F000FCEDF4FD0CBC00010D8C7D8D7C22EC708E | ||
817 | :103300000122C000E5782418F8A604E5782408F81E | ||
818 | :10331000C6547FF6E630E703D0002212329A80F4DA | ||
819 | :10332000C28C857C8C857D8AD28CC0E0C0D0C0F0F8 | ||
820 | :10333000C082C083C000C001C002C003C004C00579 | ||
821 | :10334000C006C007121AF8E5782408F8E66024E5FC | ||
822 | :10335000782410F8A681E57875F021A4248DF582F3 | ||
823 | :10336000E434FCF58378AEE58104C398F9E6F0080F | ||
824 | :10337000A3D9FA74082578F8057808E65480700C0B | ||
825 | :10338000E578B407F3780875780080EFE5782410C5 | ||
826 | :10339000F88681E57875F021A4248DF582E434FC6B | ||
827 | :1033A000F58378AEE58104C398F9E0F608A3D9FA6D | ||
828 | :1033B000D007D006D005D004D003D002D001D00071 | ||
829 | :1033C000D083D082D0F0D0D0D0E032C0E0C0D0C026 | ||
830 | :1033D00000C001C002C28E857E8D857F8BD28E7823 | ||
831 | :1033E0001979097A07E77004A600800BE6600816D1 | ||
832 | :1033F000E67004E74480F70809DAEAE57960131417 | ||
833 | :10340000F579700EE5782408F87600123246D28CF1 | ||
834 | :10341000D28DD002D001D000D0D0D0E0327581ADB5 | ||
835 | :10342000742A90FF93F0757F30757EF8757D607516 | ||
836 | :103430007CF012053F1234CE12175B90FF93E044EC | ||
837 | :1034400001F0B2B31234F81232A880DA22C0007C44 | ||
838 | :1034500001EC2408F8E660090CBC08F512329A80E9 | ||
839 | :10346000EED00022C0F0C082C083C000C006C007FA | ||
840 | :10347000ED2410F876BCED75F021A4248DF582E4DE | ||
841 | :1034800034FCF583C082C083A3A3E4780DF0A3D8F5 | ||
842 | :10349000FCEC547F75F002A42441F582E5F034354C | ||
843 | :1034A000F583E493FE740193F5828E83E493FE74B6 | ||
844 | :1034B0000193FFD083D082EFF0A3EEF0ED2408F863 | ||
845 | :1034C000EC4480F6D007D006D000D083D082D0F074 | ||
846 | :1034D00022757800757B007A08791878087600776D | ||
847 | :1034E000000809DAF8E478087480447FF67401442F | ||
848 | :1034F00010F58975B808D2ABD2A9227581ADD28EEC | ||
849 | :10350000D28CD2AFE57B6032FF90FD95E0548060B5 | ||
850 | :103510002478087908E0547FFA7B00E6547FB502EE | ||
851 | :10352000027BFF08D9F5EB700CEAF012344AAD04C7 | ||
852 | :10353000AC02123461A3A3A3DFD212329A80C57CFD | ||
853 | :10354000017D002204FE04F204F604EA04E604E22B | ||
854 | :1035500004EE04FA04A604AA04D604DA04A204A21F | ||
855 | :1035600004A204DE04BE04B604BA04B204CA04C64B | ||
856 | :1035700004C204CE04D204AE1901030022004802A2 | ||
857 | :1035800000480E301420C81AD0180A0C0506020391 | ||
858 | :1035900001020001CE0181010000C0008000600036 | ||
859 | :1035A0003000180010000800040002000100081894 | ||
860 | :1035B00028380C05100A0200000000000301100A60 | ||
861 | :1035C000020000000000FBE0FBF2090227000102FC | ||
862 | :1035D00000A0FA0904000003FF00000007058102B3 | ||
863 | :1035E00040000007050102400000070583030200B8 | ||
864 | :1035F00001220354005500530042003300340031CF | ||
865 | :1036000000300020002000200020002000200020AA | ||
866 | :073610000020000000000093 | ||
867 | :00000001FF | ||
diff --git a/firmware/mts_edge.fw.ihex b/firmware/mts_edge.fw.ihex new file mode 100644 index 000000000000..d14ebd647846 --- /dev/null +++ b/firmware/mts_edge.fw.ihex | |||
@@ -0,0 +1,881 @@ | |||
1 | :10000000F0360002001E021AFBFFFFFFFFFF023363 | ||
2 | :10001000F9FFFFFFFFFFFFFFFFFFFFFFFFFF0234BE | ||
3 | :10002000A47581D490FDE88583A0123618EC4D604C | ||
4 | :100030007378AF8003760018B8A0FA787F800376D3 | ||
5 | :100040000018B865FA78208003760018B820FA788E | ||
6 | :10005000208003760018B81FFA90FDDDAE83AF82D2 | ||
7 | :1000600090FBF81200AA6005E4F0A380F690FDE88A | ||
8 | :10007000A88290FDE8A982E8696005E4F20880F7AB | ||
9 | :100080009001081200B390010C1200B390011012FD | ||
10 | :1000900000B39001141200D190011A1200D1900106 | ||
11 | :1000A000201200D175D0001234F6020126EF6582CD | ||
12 | :1000B0007003EE658322E493F8740193F97402935C | ||
13 | :1000C000FE740393F5828E83E869700122E493F64F | ||
14 | :1000D000A30880F4E493FC740193FD740293FE740E | ||
15 | :1000E0000393FF740493F8740593F58288831200D8 | ||
16 | :1000F000AA700122E493A3A883A9828C838D82F045 | ||
17 | :10010000A3AC83AD828883898280E32121049B8014 | ||
18 | :1001100080049BB0B4049BFDE8049F049FFBF304A0 | ||
19 | :10012000A4049FFBF30504050480FED0F030F00921 | ||
20 | :1001300020F303F68010F7800D30F10920F303F26D | ||
21 | :100140008004F38001F020F404FCD0E0CC22CCC089 | ||
22 | :10015000E0120163020154BC0005D0F0ACF022C3F0 | ||
23 | :1001600013DCFC02012ABF0009ED258275F001F8BD | ||
24 | :10017000E622BF010FED2582F582EE3583F583750A | ||
25 | :10018000F004E022ED258275F002F8E222D083D05F | ||
26 | :1001900082F5F0C3E493A3C5F095F0C0E0C3D0F0BE | ||
27 | :1001A000E493A395F04012A3A3C3E5F033500205F6 | ||
28 | :1001B000832582F58250020583740193C0E0E493A5 | ||
29 | :1001C000C0E022D083D082F5F0E4937009740193EB | ||
30 | :1001D0007004A3A3800C74029365F06005A3A3A32D | ||
31 | :1001E00080E7740193C0E0E493C0E022120264024D | ||
32 | :1001F00001FB1202B80201FB1202DC0201FB30E03B | ||
33 | :100200000720E302E622E72230E10720E302E222B0 | ||
34 | :10021000E32230E202E022E493221202DC02022313 | ||
35 | :100220001202B8020223ABF012022DCBC5F0CB2292 | ||
36 | :1002300030E01020E306E6F5F008E622E7F5F009E5 | ||
37 | :10024000E7192230E11020E306E2F5F008E222E3AC | ||
38 | :10025000F5F009E3192230E206E0F5F0A3E022E42C | ||
39 | :1002600093F5F074019322BB0003740922BB0107CC | ||
40 | :1002700089828A83740422BB020789828A8374106C | ||
41 | :1002800022740A22020284BB0007E92582F8740165 | ||
42 | :1002900022BB010DE92582F582EA3583F5837404DA | ||
43 | :1002A00022BB020DE92582F582EA3583F5837410BD | ||
44 | :1002B00022E92582F87402220202B8BF0005EDF897 | ||
45 | :1002C000740122BF01078D828E83740422BF02074E | ||
46 | :1002D0008D828E83741022EDF87402220202DCBF3C | ||
47 | :1002E0000007ED2582F8740122BF010DED2582F58E | ||
48 | :1002F00082EE3583F583740422BF020DED2582F56D | ||
49 | :1003000082EE3583F583741022ED2582F874022283 | ||
50 | :10031000020310C0E0120264020328C0E01202B817 | ||
51 | :10032000020328C0E01202DC02032830E00B20E3C5 | ||
52 | :1003300004D0E0F622D0E0F72230E10B20E304D035 | ||
53 | :10034000E0F222D0E0F322D0E0F022C9CDC9CACE3B | ||
54 | :10035000CACBCFCB12035BEDF9EEFAEFFB22BB0069 | ||
55 | :100360002FBF000AFAEDF8E7F60809DAFA22BF0112 | ||
56 | :10037000128D828E83F802037809A3E7F0D8FA225F | ||
57 | :10038000020383FAEDF8E7F20809DAFA2202038D94 | ||
58 | :10039000BB014DBF001489828A83F9EDF802039FE7 | ||
59 | :1003A00008A3E0F6D9FA220203B0BF01228D828EA3 | ||
60 | :1003B00083FB08C9C582C9CAC583CAE0A3C9C5826F | ||
61 | :1003C000C9CAC583CAF0A3DBEAD8E8220203D38DE9 | ||
62 | :1003D000828E83F9EDF8E0F208A3D9FA220203DD58 | ||
63 | :1003E000BB024DBF001289828A83F9EDF80203EF48 | ||
64 | :1003F00008A3E493F6D9F922BF01238D828E83FBF3 | ||
65 | :1004000008C9C582C9CAC583CAE493A3C9C582C93C | ||
66 | :10041000CAC583CAF0A3DBE9D8E722020422898295 | ||
67 | :100420008A83F9EDF8E493F208A3D9F922020433A0 | ||
68 | :10043000BF000DFAEDF8E3F60809DAFA2202043DEE | ||
69 | :10044000BF01128D828E83F802044A09A3E3F0D81B | ||
70 | :10045000FA22020455FAEDF8E3F20809DAFA220268 | ||
71 | :10046000045FE6FB08E6FA08E6F904F618700106F0 | ||
72 | :1004700022E6FF08E6FE08E6FD22EFF0A3EEF0A379 | ||
73 | :10048000EDF022EBF0A3EAF0A3E9F022E0FFA3E015 | ||
74 | :10049000FEA3E0FD22E0FBA3E0FAA3E0F9220000C6 | ||
75 | :1004A000000000000000000504006105730026053F | ||
76 | :1004B0009A00330A0B00610A770066154600610C4A | ||
77 | :1004C000FB006109AB006109E200610DC200610B34 | ||
78 | :1004D000F300610A1E00610A530061173E003317E2 | ||
79 | :1004E0005100341E1600431EBC0044202900442045 | ||
80 | :1004F0001700471EE300471F88004D1FD9004F1FFC | ||
81 | :10050000050058338400617CCC7DFF121CC722900B | ||
82 | :10051000FFFCE020E72DC2AFAE59AF58755A20E579 | ||
83 | :100520005A14C55A6019E4FE7F05EE4FCE24FFCE63 | ||
84 | :10053000CF34FFCF6007E490FF92F080ED80E08E33 | ||
85 | :10054000598F582212050C7D077CB71233A07D0FFE | ||
86 | :100550007C6E1233BA78A17A06E4F608DAFC7A06E1 | ||
87 | :100560001205CF7C03120E57122165E4FEFF7C0FAB | ||
88 | :10057000123329D2A822123214E490FC38F090FFF2 | ||
89 | :10058000F0E030E408740190FC39F08005E490FC60 | ||
90 | :1005900039F07D0A7C00122547123297221232145C | ||
91 | :1005A00090FC39E014700E90FFF0E04410F07C00F5 | ||
92 | :1005B0001225E0801990FC39E0700E90FFF0E054B5 | ||
93 | :1005C000EFF07C001225E080057C171225E0123246 | ||
94 | :1005D000972290FFF0E054ABF090FFF0E04420F061 | ||
95 | :1005E000228C378D367882EDF608ECF6EDFEECFDC8 | ||
96 | :1005F0007F019000051201F57880F67882E6FD080B | ||
97 | :10060000E6FCEDFEECFD7F019000041201F5540FB5 | ||
98 | :10061000FC7D8012176F7880E6700DAD3AAE39AF71 | ||
99 | :1006200038E41203187C082290FFF0E054FEF090AA | ||
100 | :10063000FFF0E054FDF0801E7882E6FD08E6FCED58 | ||
101 | :10064000FEECFD7F0190000812021725E0440190A6 | ||
102 | :10065000FFF3F00206DB7882E6FD08E6FCEDFEEC37 | ||
103 | :10066000FD7F0190000612021754FE90FFF3F08008 | ||
104 | :100670002B7882E6FD08E6FCEDFEECFD7F019000A4 | ||
105 | :1006800008120217FAEB90FFF1F01208CA400DAD04 | ||
106 | :100690003AAE39AF38E41203187C18227882E6FDAE | ||
107 | :1006A00008E6FCEDFEECFD7F0190000812021790B9 | ||
108 | :1006B000FFF1F01208CA400DAD3AAE39AF38E4127E | ||
109 | :1006C00003187C18227882E6FD08E6FCEDFEECFDBE | ||
110 | :1006D0007F01900006120217440190FFF3F0788327 | ||
111 | :1006E000E62403F618E63400F67880E624FE500986 | ||
112 | :1006F00090FFF0E054FDF0800790FFF0E04402F03E | ||
113 | :10070000E490FFF1F0788176007880E624FFFCE445 | ||
114 | :1007100034FFFD7881E67F00FEECD39EEF6480CD50 | ||
115 | :1007200064809D402F1208AF400F7881E6AD3AAE4D | ||
116 | :1007300039AF381203187C182290FFF2E0FC78825F | ||
117 | :100740008683088682ECF0788106A37882A68308E7 | ||
118 | :10075000A68280B51208AF400F7881E6AD3AAE3977 | ||
119 | :10076000AF381203187C182290FFF2E0FC788286E2 | ||
120 | :1007700083088682ECF07880E6AD3AAE39AF381265 | ||
121 | :1007800003187C00228C378D367882EDF608ECF663 | ||
122 | :10079000EDFEECFD7F019000051201F57881F67801 | ||
123 | :1007A00082E6FD08E6FCEDFEECFD7F019000041200 | ||
124 | :1007B00001F5540FFC7D8112176F7881E670037C80 | ||
125 | :1007C000082290FFF0E054FEF090FFF0E054FDF0BE | ||
126 | :1007D000801B7882E6FD08E6FCEDFEECFD7F0190D3 | ||
127 | :1007E000000812021725E090FFF3F0805B7882E6A4 | ||
128 | :1007F000FD08E6FCEDFEECFD7F01900006120217FD | ||
129 | :1008000054FE90FFF3F080217882E6FD08E6FCEDCF | ||
130 | :10081000FEECFD7F01900008120217FAEB90FFF149 | ||
131 | :10082000F01208CA40037C18227882E6FD08E6FC34 | ||
132 | :10083000EDFEECFD7F0190000812021790FFF1F031 | ||
133 | :100840001208CA40037C18227883E6240AF618E6C8 | ||
134 | :100850003400F6788076007881E624FFFCE434FFEB | ||
135 | :10086000FD7880E67F00FEECD39EEF6480CD64804F | ||
136 | :100870009D402178828683088682E090FFF1F01205 | ||
137 | :1008800008CA40037C1822788006788306E6187030 | ||
138 | :10089000010680C390FFF0E04401F078828683086F | ||
139 | :1008A0008682E090FFF1F01208CA40037C18227C97 | ||
140 | :1008B000002290FFF0E020E71290FFF0E030E50921 | ||
141 | :1008C00090FFF0E04420F0C32280E7D32290FFF0B5 | ||
142 | :1008D000E020E31290FFF0E030E50990FFF0E04403 | ||
143 | :1008E00020F0C32280E7D3228C428D417C00ED545E | ||
144 | :1008F000F0FDEC7003ED64307005753E0380037508 | ||
145 | :100900003E04AC3E120F74758300858340E541546C | ||
146 | :100910000FF53FE5407004E53F64037035E53E2484 | ||
147 | :10092000FD75F00AA42402F582E434FCF583E0307E | ||
148 | :10093000E60512105B8019E53E24A1F8E654FBF6AB | ||
149 | :1009400078ADE62405F58218E63400F583740FF0DF | ||
150 | :100950008059E5407004E53F64047048E53E24FD9D | ||
151 | :1009600075F00AA42402F582E434FCF583E030E556 | ||
152 | :1009700007AC42AD41121C5CE54230E21578B1E6AD | ||
153 | :1009800030E00F78B1E630E109E4FF04FE7C0412A8 | ||
154 | :10099000332978ADE62406F58218E63400F5837431 | ||
155 | :1009A0000FF08007E4FC7DEE121C5CC203221232C1 | ||
156 | :1009B00014120F7478ADE62406F58218E63400F5BB | ||
157 | :1009C00083E090FC38F078ADE62405F58218E63433 | ||
158 | :1009D00000F583E090FC39F0C2037D027C00122513 | ||
159 | :1009E00047123297221232147899ECF6EC24A1F8CF | ||
160 | :1009F000E630E1077C131225E0800F90FC39E0FD22 | ||
161 | :100A00007899E6FC1213F11225E012329722123285 | ||
162 | :100A1000147899ECF67D00120F141225E01232972B | ||
163 | :100A2000221232147899ECF6EC24A1F8E630E207B1 | ||
164 | :100A30007C131225E0801B7899E624A1F8E620E1DA | ||
165 | :100A4000077C121225E0800A7899E6FC1214151230 | ||
166 | :100A500025E0123297221232147899ECF6EC24A198 | ||
167 | :100A6000F8E620E2077C111225E0800A7899E6FC7E | ||
168 | :100A70001215161225E0123297221232147899ECD0 | ||
169 | :100A8000F6120F7478ADE62409F58218E63400F505 | ||
170 | :100A900083E090FC3FF078ADE6240AF58218E63456 | ||
171 | :100AA00000F583E090FC40F078ADE62403F5821871 | ||
172 | :100AB000E63400F583E0FC78ADE62404F58218E620 | ||
173 | :100AC0003400F583E0F56278ADE62402F58218E69D | ||
174 | :100AD0003400F583E0F5638C61E4EC333354017842 | ||
175 | :100AE00099F66008E56230E1037899067899E69016 | ||
176 | :100AF000FC41F078ABE62402F58218E63400F58379 | ||
177 | :100B0000E0FDA3E0540CFCED54E68C65F564E56172 | ||
178 | :100B100030E503436501E56220E50EE561547F7031 | ||
179 | :100B200008E56120E703436502E56130E3034365BF | ||
180 | :100B300010E56130E203436520E56154036003433F | ||
181 | :100B40006540E56130E103436580E56130E40343DE | ||
182 | :100B50006401E56130E603436408E56220E40EE5E4 | ||
183 | :100B600061547F7008E56120E7034364105365FB1F | ||
184 | :100B70005364F9AD64E56590FC3ACDF0A3CDF0E5A2 | ||
185 | :100B80006330E30DE5635430C4540F90FC3DF080B6 | ||
186 | :100B900005E490FC3DF0E563540390FC3CF0E56314 | ||
187 | :100BA0005404C31390FC3EF090FC3CE0700E7D3585 | ||
188 | :100BB0007EFC7F01740190000912014B78ADE624A0 | ||
189 | :100BC00008F58218E63400F583E07C00FD78ADE698 | ||
190 | :100BD0002407F58218E63400F583E07F004CFEEF31 | ||
191 | :100BE0004D90FC38F0A3CEF0CEC2037D0A7C0012FB | ||
192 | :100BF0002547123297221232147899ECF6789E76B5 | ||
193 | :100C0000010876FC087638789B760C789E12046E84 | ||
194 | :100C100012021D789CCBF6CB08F67F00EF24EA4049 | ||
195 | :100C20001FE4EF25E090365AFD93CD0493789D663E | ||
196 | :100C30007003ED18667006789B760080030F80DCE9 | ||
197 | :100C4000789AEFF6789E12046E90000212021778DE | ||
198 | :100C50009CCBF6CB08F65404CB54064B6004789B2F | ||
199 | :100C6000760B789DE630E313789E12046E900005B3 | ||
200 | :100C70001201F524FB5004789B760D789DE654C054 | ||
201 | :100C80007D0064C04D7004789B760B789E12046ED4 | ||
202 | :100C90009000041201F524FC5004789B760F789E96 | ||
203 | :100CA00012046E9000061201F524FD5004789B7624 | ||
204 | :100CB0000E789E12046E9000091201F524FD500476 | ||
205 | :100CC000789B760A789BE6702A7899E6FC120F7476 | ||
206 | :100CD000789E12046E78ABE6F978AAE6FA7B017486 | ||
207 | :100CE0000A7800120348C2037899E6FC12111778BB | ||
208 | :100CF0009BECF6789BE6FC1225E01232972212322A | ||
209 | :100D0000147899ECF6120F747899E624FD75F00AC0 | ||
210 | :100D1000A42414F582E434FCF583AC82AD8378AA74 | ||
211 | :100D20008683088682ECF9EDFA7B0A78011203B01B | ||
212 | :100D3000C2037899E6FC121117123297228D2B8C80 | ||
213 | :100D40002AED60407527017529487528FFE52A249A | ||
214 | :100D5000FDFCE434FFFDEC7C0325E0CD33CDDCF974 | ||
215 | :100D6000FCE5292CF529E5283DF528AD29AE28AF6D | ||
216 | :100D700027748090000612032074809000021203F2 | ||
217 | :100D800020120FC7E52B14603B75270175290875E4 | ||
218 | :100D900028FFE52A24FDFCE434FFFDEC7C0325E07C | ||
219 | :100DA000CD33CDDCF9FCE5292CF529E5283DF528E6 | ||
220 | :100DB000AD29AE28AF27E4900006120320E490008E | ||
221 | :100DC00002120320221232147899ECF6EC24A1F8D6 | ||
222 | :100DD000E630E2097899E6FC121516D2007899E619 | ||
223 | :100DE000FC120F74789A760090FC39E030E70478B2 | ||
224 | :100DF0009A7601789AE6FD7899E6FC120D3AC203DC | ||
225 | :100E00003000077899E6FC1214157C001225E012D8 | ||
226 | :100E100032972278ADE62404F58218E63400F58393 | ||
227 | :100E2000E04401F078ADE62404F58218E63400F5DC | ||
228 | :100E300083E030E00280ED78ADE6240BF58218E621 | ||
229 | :100E40003400F583E054F8F078ADE62402F582181A | ||
230 | :100E5000E63400F583E04480F022C2038C58120F80 | ||
231 | :100E60007478AA8683088682798B7A367B0A780121 | ||
232 | :100E70001203FE120E10AC587D02120D3AC203ACE2 | ||
233 | :100E800058121117228D538E528F518C50120F749D | ||
234 | :100E9000754F0078ADE62405F58218E63400F58339 | ||
235 | :100EA000E020E41FE54F24F64019054FC2037C18EB | ||
236 | :100EB0001233D790FF93E04401F0B2B3AC50120F5D | ||
237 | :100EC0007480D078ADE62405F58218E63400F58309 | ||
238 | :100ED000E020E405C2037C022278ADE62405F58219 | ||
239 | :100EE00018E63400F583E0540F601678ADE624056B | ||
240 | :100EF000F58218E63400F583E0540FF0C2037C015C | ||
241 | :100F00002278AC8683088682E0AD53AE52AF511290 | ||
242 | :100F10000318C2037C00228D318C30121516E53186 | ||
243 | :100F2000600FE530B4030A7C0112250F7C81122585 | ||
244 | :100F30000FAC30120F74E531601A78AE86830886E4 | ||
245 | :100F400082E054E7F0A3A3A3A3E054E7F0AC307D24 | ||
246 | :100F500002120D3A78AA868308868279957A367BC2 | ||
247 | :100F60000A78011203FEC203E53024A1F8E654FD1D | ||
248 | :100F7000F6AC30121117228C26300305123376801E | ||
249 | :100F8000F87C0A123289D203E52624FD78A7F67090 | ||
250 | :100F90000778AE76FF0876E078A7E67D007C04252A | ||
251 | :100FA000E0CD33CDDCF9FC24A078ADF6ED34FF18AC | ||
252 | :100FB000F678A7E675F00AA42400FCE434FCFD787A | ||
253 | :100FC000AAEDF608ECF61233222278ADE62402F5FB | ||
254 | :100FD0008218E63400F583E030E72278ADE624029B | ||
255 | :100FE000F58218E63400F583E0547FF078ADE6240E | ||
256 | :100FF00002F58218E63400F583E04480F02278AEF2 | ||
257 | :101000008683088682E0547FF0AD83E5822404FC69 | ||
258 | :10101000E43D8C82F583E0547FF078ADE6240BF557 | ||
259 | :101020008218E63400F583E054F8F078AFE6240146 | ||
260 | :10103000F58218E63400F583E04403F078AFE62447 | ||
261 | :1010400005F58218E63400F583E04403F078ADE658 | ||
262 | :101050002405F58218E63400F583740FF02278AE8B | ||
263 | :101060008683088682E0543FF0AD83E5822404FC49 | ||
264 | :10107000E43D8C82F583E0543FF078A7E624A8F89D | ||
265 | :10108000E6FC78AFE62401F58218E63400F583EC3F | ||
266 | :10109000F078A7E624A8F8E6FC78AFE62405F58208 | ||
267 | :1010A00018E63400F583ECF078ADE6240BF58218F1 | ||
268 | :1010B000E63400F583E054FB4402F52678ABE624E1 | ||
269 | :1010C00002F58218E63400F583E030E5034326019B | ||
270 | :1010D00078ADE62405F58218E63400F583E030E0CB | ||
271 | :1010E00003120FC7E526FC78ADE6240BF58218E65F | ||
272 | :1010F0003400F583ECF078ADE62405F58218E6348B | ||
273 | :1011000000F583740FF078AE8683088682E0448011 | ||
274 | :10111000F0A3A3A3A3E04480F0228C2A120F7478DA | ||
275 | :10112000ABE62408F58218E63400F583E0FC78ADE0 | ||
276 | :10113000E6240AF58218E63400F583ECF078ABE695 | ||
277 | :101140002407F58218E63400F583E0FC78ADE62448 | ||
278 | :1011500009F58218E63400F583ECF078AA86830856 | ||
279 | :101160008682E0FDA3E0FCEDFE78ADE62408F58282 | ||
280 | :1011700018E63400F583EEF0ECFE78ADE62407F5D2 | ||
281 | :101180008218E63400F583EEF08C298D28C3EC94A8 | ||
282 | :1011900005ED940C400575277C8033D3E529940137 | ||
283 | :1011A000E5289403400575273C8023D3E5299481E5 | ||
284 | :1011B000E528940140057527188013D3E52994602C | ||
285 | :1011C000E5289400400575270C8003752708AF2794 | ||
286 | :1011D000E4EF547C4483FF8F27E527FC78AFE624B7 | ||
287 | :1011E00001F58218E63400F583ECF0E527FC78AFD2 | ||
288 | :1011F000E62405F58218E63400F583ECF0E527FCDB | ||
289 | :1012000078A7E624A8F8ECF678ADE62402F5821873 | ||
290 | :10121000E63400F583E0F52778ABE62402F5821882 | ||
291 | :10122000E63400F583A3E030E3175327C778ABE635 | ||
292 | :101230002405F58218E63400F583E0903686934263 | ||
293 | :101240002778ABE62402F58218E63400F583E03017 | ||
294 | :10125000E70543274080035327BF5327FB78ABE6BE | ||
295 | :101260002406F58218E63400F583E0600343270482 | ||
296 | :101270005327FC78ABE62404F58218E63400F583A6 | ||
297 | :10128000E04227432780E527FC78ADE62402F5827B | ||
298 | :1012900018E63400F583ECF078ADE62404F5821806 | ||
299 | :1012A000E63400F583E0F52778ABE62402F58218F2 | ||
300 | :1012B000E63400F583A3E030E1055327DF800343E4 | ||
301 | :1012C000272078ABE62402F58218E63400F583E0A7 | ||
302 | :1012D00030E4055327EF800343271078ABE6240959 | ||
303 | :1012E000F58218E63400F583E0B40203432702E5F3 | ||
304 | :1012F00027FC78ADE62404F58218E63400F583EC8B | ||
305 | :10130000F078ADE62403F58218E63400F583E0F5C5 | ||
306 | :101310002778ABE62409F58218E63400F583E070FF | ||
307 | :101320000553277F800343278078ABE62402F582AC | ||
308 | :1013300018E63400F583A3E030E00543272080035E | ||
309 | :101340005327DF78ABE62402F58218E63400F583F4 | ||
310 | :10135000E030E30543274080035327BF78ABE62402 | ||
311 | :1013600002F58218E63400F583E030E005432710EB | ||
312 | :1013700080035327EF78ABE62402F58218E63400A9 | ||
313 | :10138000F583A3E030E40543270880035327F7786B | ||
314 | :10139000ABE62402F58218E63400F583A3E030E5DD | ||
315 | :1013A0000543270480035327FB78ABE62402F5822C | ||
316 | :1013B00018E63400F583A3E030E6054327018003F7 | ||
317 | :1013C0005327FE78ABE62402F58218E63400F58355 | ||
318 | :1013D000A3E030E70543270280035327FDE527FC00 | ||
319 | :1013E00078ADE62403F58218E63400F583ECF0C20C | ||
320 | :1013F000037C00228D278C26ED54031460037C109F | ||
321 | :1014000022E527547C24FC40037C0B22E52624A102 | ||
322 | :10141000F8E64402F67C00228C30120F74E530248A | ||
323 | :10142000A1F8E620E24FAC307D02120D3AE53024FF | ||
324 | :10143000FE4428FC78AE8683088682ECF0AF83E514 | ||
325 | :10144000822404FEE43FFFEC8E828F83F07C038CC9 | ||
326 | :101450002CE52CFC78AFE62401F58218E63400F583 | ||
327 | :1014600083ECF0E52CFC78AFE62405F58218E63431 | ||
328 | :1014700000F583ECF0752D01752F48752EFFE530D2 | ||
329 | :1014800024FDFCE434FFFDEC7C0325E0CD33CDDC12 | ||
330 | :10149000F9FCE52F2CF52FE52E3DF52E78AFE6244F | ||
331 | :1014A00004F58218E63400F583E054E7F52CAD2FFF | ||
332 | :1014B000AE2EAF2DE4900002120320E4900006123D | ||
333 | :1014C00003201201EF30E503432C10E52CFC78AF2C | ||
334 | :1014D000E62404F58218E63400F583ECF012105B84 | ||
335 | :1014E00078ADE62406F58218E63400F583E0C20301 | ||
336 | :1014F000FCE53024A1F8E64404F68C2CE530540FCA | ||
337 | :10150000C454F07E00FFEEEF44047D00FFEC4EFC7F | ||
338 | :10151000ED4FFD121CC77C00228C2F120F74120F8E | ||
339 | :10152000FB78AE8683088682E05408F0A3A3A3A3C9 | ||
340 | :10153000E05408F0AC2F7D02120D3AC203E52F24CF | ||
341 | :10154000A1F8E654FBF67C0022123214789AECF6ED | ||
342 | :10155000EC24A1F8E630E10A7D007C131225471245 | ||
343 | :101560003297789AE624A1F8E64401F6789AE6FCE8 | ||
344 | :10157000120F74789AE624FD75F00AA42414F582FB | ||
345 | :10158000E434FCF58378AAE6FA08E6F97B0A7801E8 | ||
346 | :101590001203B078AA868308868279957A367B0A08 | ||
347 | :1015A00078011203FE120FC7C203789AE6FC1211EB | ||
348 | :1015B000177899ECF6EC600A7D007C08122547123A | ||
349 | :1015C0003297789AE6FC120F7478ADE62404F5821F | ||
350 | :1015D00018E63400F583E0441054DFFC78ADE624CF | ||
351 | :1015E00004F58218E63400F583ECF07899ECF6C245 | ||
352 | :1015F000037CC81233D7789AE6FC120F7478ADE6F4 | ||
353 | :101600002404F58218E63400F583E054EFF0C203B9 | ||
354 | :101610007CC81233D7789AE6FC120F7478ADE624B2 | ||
355 | :1016200004F58218E63400F583E04410F0C2037C30 | ||
356 | :10163000C81233D7789AE6FC120F7478ADE624040A | ||
357 | :10164000F58218E63400F583E04420F0C2037CF014 | ||
358 | :101650001233D7789AE6FC120F7478ADE62405F5BC | ||
359 | :101660008218E63400F583E030E415C203789AE688 | ||
360 | :1016700044107F00FE7C0712332912329702173D77 | ||
361 | :1016800078ADE62404F58218E63400F583E054CF03 | ||
362 | :10169000F0C2037CC81233D7789AE6FC120F747834 | ||
363 | :1016A000ADE62404F58218E63400F583E04430F01A | ||
364 | :1016B000C2037CF01233D7789AE6FC120F7478AD2F | ||
365 | :1016C000E62405F58218E63400F583E030E414C220 | ||
366 | :1016D00003789AE644107F00FE7C07123329123209 | ||
367 | :1016E00097805D78ADE62404F58218E63400F58332 | ||
368 | :1016F000E054EFF078ADE62404F58218E63400F506 | ||
369 | :1017000083E054DFF0789AE624FD75F00AA42414EF | ||
370 | :10171000F582E434FCF583AC82AD8378AA86830835 | ||
371 | :101720008682ECF9EDFA7B0A78011203B0C20378E5 | ||
372 | :101730009AE6FC1211177D007C0B12254712329796 | ||
373 | :1017400022123214E490FC39F07D027C001225470D | ||
374 | :10175000123297221232147C001225E012329722A4 | ||
375 | :10176000743C90FBE0F0743E90FBE0F0E490FC28C9 | ||
376 | :10177000F0228D358C34ECB401028003D34002801A | ||
377 | :1017800028B402028003D34008A835E625E0F6809D | ||
378 | :1017900018B404028003D3400AA835E625E025E00A | ||
379 | :1017A000F68006A83576008000228C3C8D3BEDFE4D | ||
380 | :1017B000ECFD7F0175660675670090FC29120477C1 | ||
381 | :1017C0001201EFB480028006D3500302187090FC1F | ||
382 | :1017D000291204899000031201F554F0B4300280FC | ||
383 | :1017E00003D3405F90FC291204899000081202176D | ||
384 | :1017F000FAFDEBFE7F0190FC2C120477EECD9036C3 | ||
385 | :101800009FFCE493FF740193FEF9EFFA7B01EAFF7A | ||
386 | :10181000E9FEECC39EED9F40259036A1E493FD7454 | ||
387 | :101820000193FCEDFEECFD7F01EECDFC90FC2EE083 | ||
388 | :10183000D39C90FC2DE09D50057566808033121975 | ||
389 | :101840008E802EB460028003D3400BAC3CAD3B12C3 | ||
390 | :1018500007828C66801BB41003B34010C3B420030E | ||
391 | :10186000B34009C3B440028003D340007566818051 | ||
392 | :10187000008075B481028003D3406B90FC29120470 | ||
393 | :10188000899000031201F554F0B430028003D34074 | ||
394 | :101890001D90FC29120489900008120217FAFDEB32 | ||
395 | :1018A000FE7F0190FC2F1204771218F88036B46086 | ||
396 | :1018B000028003D34013753A67E4F539F538AC3C40 | ||
397 | :1018C000AD3B1205DE8C66801BB41003B34010C321 | ||
398 | :1018D000B42003B34009C3B440028003D340007571 | ||
399 | :1018E0006681800080028000E566FC90FC2912047D | ||
400 | :1018F00089EC900002120320AC672290FC291204AC | ||
401 | :10190000899000041201F5600474018001E4A2E0F2 | ||
402 | :10191000920190FC29120489ED2403FD50010E90E0 | ||
403 | :10192000FC2C12047790FC29120489900005120106 | ||
404 | :10193000F5F5679000041201F5540FFC7D6712174E | ||
405 | :101940006FE5677004756608227566007884760016 | ||
406 | :101950007884E6C39567503890FC2F1204891201F1 | ||
407 | :10196000EFFC90FC2C120489EC12031830010E904D | ||
408 | :10197000FC31E004F090FC307003E004F078840661 | ||
409 | :1019800090FC2EE004F090FC2D7003E004F080C089 | ||
410 | :101990002290FC2AE0FDA3E0FCEDFEECFD7F01EDD2 | ||
411 | :1019A000240AFD50010E90FC3212047790FC29129B | ||
412 | :1019B00004899000041201F5540FB401028003D38E | ||
413 | :1019C000401790FC321204890DED70010E90FC2F2F | ||
414 | :1019D00012047778887601804EB402028003D340E7 | ||
415 | :1019E0001990FC32120489ED2402FD50010E90FC86 | ||
416 | :1019F0002F12047778887602802DB404028003D3F6 | ||
417 | :101A0000401990FC32120489ED2404FD50010E901F | ||
418 | :101A1000FC2F12047778887604800CB400028003CF | ||
419 | :101A2000D340007566082290FC29120489900005B5 | ||
420 | :101A30001201F5F567788576007885E6C3956740ED | ||
421 | :101A400003021AF6788676007886E6C37888965080 | ||
422 | :101A50007690FC2C1204891201EFFC90FC321204E7 | ||
423 | :101A6000921201E9F45CFC1201E9F890FC2F1204D7 | ||
424 | :101A700089E8C0E01201EFC8D0E0C8584CFC90FCE7 | ||
425 | :101A80002C120489EC1203187887ECF690FC31E0F4 | ||
426 | :101A900004F090FC307003E004F009E970010A9052 | ||
427 | :101AA000FC3212048090FC29120489900004120177 | ||
428 | :101AB000F530E40E90FC2EE004F090FC2D7003E075 | ||
429 | :101AC00004F078860680817888E6FDE4FEFFEECD9E | ||
430 | :101AD000FC90FC31E02CF090FC30E03DF07888E6A2 | ||
431 | :101AE000FDE4FEFFEECDFC90FC34E02CF090FC33E6 | ||
432 | :101AF000E03DF0788506021A367566002222C0E0C5 | ||
433 | :101B0000C0F0C082C083C0D0E8C0E0E9C0E0EAC055 | ||
434 | :101B1000E0EBC0E0ECC0E0EDC0E0EEC0E0EFC0E024 | ||
435 | :101B200090FF92E01201C01B49301B49321B58380C | ||
436 | :101B30001B6A3A1B7C3E1B94441B88461BA0501B0F | ||
437 | :101B4000E2521BC1541C035600001C2490FF92E07B | ||
438 | :101B50007F00FE7C01123329021C34E4FF04FE7C6A | ||
439 | :101B600003123329742090FFFEF0021C34E4FF04BA | ||
440 | :101B7000FE7C02123329744090FFFEF0021C34E414 | ||
441 | :101B8000FF04FE7C04123329021C34E4FF04FE7CB3 | ||
442 | :101B900005123329021C34E4FF04FE7C06123329AB | ||
443 | :101BA000021C3490FFA5E07D0090FBF8CDF0A3CDA2 | ||
444 | :101BB000F090FBF9E0FCF58390FBF8E04433FD1274 | ||
445 | :101BC0001CC7807390FFB5E07D0090FBFACDF0A3B9 | ||
446 | :101BD000CDF090FBFBE0FCF58390FBFAE04443FD85 | ||
447 | :101BE000121CC7805290FFA6E07D0090FBFCCDF058 | ||
448 | :101BF000A3CDF090FBFDE0FCF58390FBFCE04434CA | ||
449 | :101C0000FD121CC7803190FFB6E07D0090FBFECD39 | ||
450 | :101C1000F0A3CDF090FBFFE0FCF58390FBFEE044E9 | ||
451 | :101C200044FD121CC7801090FF92E07D00FCED4443 | ||
452 | :101C3000AAFD121CC78000E490FF92F0D0E0FFD014 | ||
453 | :101C4000E0FED0E0FDD0E0FCD0E0FBD0E0FAD0E058 | ||
454 | :101C5000F9D0E0F8D0D0D083D082D0F0D0E03205F7 | ||
455 | :101C600081058105810581A881181818EDF608EC19 | ||
456 | :101C7000F690FF5AE020E70280F790FF59E07D00E0 | ||
457 | :101C8000A88118CDF6CD08F67D03A881E618FCE6FC | ||
458 | :101C9000CC25E0CC33CCDDF9CCF6CC08F6A8811805 | ||
459 | :101CA000E644F8F6A881181818E6FD08E6FCA881B5 | ||
460 | :101CB000188683088682EDF0A3ECF0740290FF5A38 | ||
461 | :101CC000F0158115811581158122E5812405F581A5 | ||
462 | :101CD000E4A88118F6A88118181818EDF608ECF693 | ||
463 | :101CE00090FBF5E024F85003021DE8E4A8811818E1 | ||
464 | :101CF000F6A88118E6FEA88118181818E6FD08E66F | ||
465 | :101D0000FC7F00EF24F8404DE4EF25E0247DF582D0 | ||
466 | :101D1000E434FCF583E0FBA3E06C7003FAEB6D7038 | ||
467 | :101D2000097401A8811818F6802BE4EF25E0247DC2 | ||
468 | :101D3000F582E434FCF5837A00E054F0CCF8CCCDA5 | ||
469 | :101D4000F9CDFB7800E954F0F9EA687002EB6970AC | ||
470 | :101D5000010E0F80AEA88118EEF6A8811818181889 | ||
471 | :101D6000EDF608ECF6A881EFF6A8811818E6707970 | ||
472 | :101D7000A88118E624F74071A88118181818E654AD | ||
473 | :101D80000FA881F664046017A881E664036010A8B8 | ||
474 | :101D90008118181818E6FD08E6FC121C5C804A7CC5 | ||
475 | :101DA0000A123289A88118181818E6FD08E6FC9076 | ||
476 | :101DB000FBF4E025E0247DF582E434FCF583EDF0CE | ||
477 | :101DC000A3ECF090FBF4E0FFE4EF045407FF90FB7A | ||
478 | :101DD000F4F090FBF5E004F012332290FBF6E07093 | ||
479 | :101DE00008E4FEFF7C0F123329802790FBF7E00404 | ||
480 | :101DF000F0543F701D90FBF7E044FE7D00FC90FB2B | ||
481 | :101E0000F4E025E0247DF582E434FCF583EDF0A3D5 | ||
482 | :101E1000ECF0E58124FBF58122788B7600788C76D6 | ||
483 | :101E200000740190FBF6F012321490FBF5E060575D | ||
484 | :101E30007C0A12328990FBF3E025E0247DF582E4F0 | ||
485 | :101E400034FCF583E0FDA3E0FC90FBF3E025E02407 | ||
486 | :101E50007DF582E434FCF583E4F0A3F090FBF3E03D | ||
487 | :101E6000FFE4EF045407FF90FBF3F090FBF5E01460 | ||
488 | :101E7000F07889EDF608ECF61233227889E6FD0851 | ||
489 | :101E8000E6FC1208E580A312337690FF93E044014C | ||
490 | :101E9000F0B2B3788B06B6000D788B7600788CE6BE | ||
491 | :101EA000F40404788CF68082E490FBF6F090FBF565 | ||
492 | :101EB000E07D00FCED44CFFD121C5C123297221233 | ||
493 | :101EC0003214E5706449456F601590FF83E0540F4C | ||
494 | :101ED0007D00D39570ED956F500512305D80031233 | ||
495 | :101EE000312D12329722123214E5706449456F6029 | ||
496 | :101EF00005123167800E90FF80E04408F090FF8368 | ||
497 | :101F0000E0547FF0123297221232148C54EC54F0C9 | ||
498 | :101F1000B41015756A357569FC756801E56A2403A6 | ||
499 | :101F2000F56AE5693400F569E4F557F556E556C3F9 | ||
500 | :101F300094015027E554540FFCAD6AAE69AF6812A6 | ||
501 | :101F40000E828C55EC60028012056AE56A7002050B | ||
502 | :101F5000690557E5577002055680D2E554540F24A1 | ||
503 | :101F6000A1F8E654FEF6E554540F7F00FE7C1212F1 | ||
504 | :101F70003329E5551470097D007C09122547800737 | ||
505 | :101F8000AD577C001225471232972212321490FF6F | ||
506 | :101F9000FCE04402F090FF00E030E71390FF83E0A4 | ||
507 | :101FA0004480F0436D8090FFFCE04401F08011908C | ||
508 | :101FB000FF82E04408F0536D7F90FFFCE054FEF098 | ||
509 | :101FC00090FF81E04480F01225FA90FFFEE0440586 | ||
510 | :101FD000F090FFFCE054FDF0123297221232147C94 | ||
511 | :101FE000011233D778B1E64402F674FEFC04FD1208 | ||
512 | :101FF0001CC790FF5AE030E70280F7E4F54E754DBC | ||
513 | :1020000010AC4EAD4DE54E154E7002154DEC4D60C9 | ||
514 | :102010000280EE438701123297221232147C0212A0 | ||
515 | :1020200032A378B1E654FDF61232972212321478B8 | ||
516 | :10203000B1E630E02C78B1E630E12678B1E6FCF587 | ||
517 | :102040008318E644F0FD121C5C90FFFCE04420F095 | ||
518 | :102050007C021233D778B1E654FDF6741A90FFFE75 | ||
519 | :10206000F078B1E6FCF58318E644F1FD121C5C1231 | ||
520 | :10207000329722756D0090FFFFE06003436D01759C | ||
521 | :102080006E00E4F56CF56BE4F56F7570497484903F | ||
522 | :10209000FF82F0748490FF80F0748090FF58F07499 | ||
523 | :1020A0008090FF5AF0AD46AF457E00EE24FE50030F | ||
524 | :1020B00002213FE4EE75F007A4247FF582E434F8B2 | ||
525 | :1020C000F583E0FFE4EF5480FDE4EF540F14FFEDDF | ||
526 | :1020D0006038E4EF75F008A42448F582E434FFF595 | ||
527 | :1020E000837490F0E4EF75F008A4244AF582E43498 | ||
528 | :1020F000FFF5837480F0E4EF75F008A4244EF582B8 | ||
529 | :10210000E434FFF5837480F08034E4EF75F008A4C4 | ||
530 | :102110002408F582E434FFF5837490F0E4EF75F061 | ||
531 | :1021200008A4240AF582E434FFF583E4F0E4EF75B3 | ||
532 | :10213000F008A4240EF582E434FFF583E4F00E02E7 | ||
533 | :1021400020A88D468E448F45747F90FFFDF07490DB | ||
534 | :1021500090FFFCF0228C58EC24F65006E55824370A | ||
535 | :10216000FC22E5582430FC22D2B0D2B1C2B41225F0 | ||
536 | :1021700044EC700302227F755C03AE5B7F00E55C7C | ||
537 | :10218000155C6480247F5035EF2400F582E434FB35 | ||
538 | :10219000F583E0FE24FE501EEF7D00FCE4FB74742A | ||
539 | :1021A000C39CFAEB9DFBEE7D00FCEAC39CED6480D2 | ||
540 | :1021B000CB64809B50028005EF2EFF80C18E5B8F29 | ||
541 | :1021C0005AE55C6480247F500302227FE55A248E06 | ||
542 | :1021D000500302227F855A5D755B00AE5AAF5B905B | ||
543 | :1021E00036CAE493F55CE55C155C6480247F501886 | ||
544 | :1021F000EE2400F582E434FBF583E0FCEF9036CA70 | ||
545 | :10220000936C70040E0F80DE8E5A8F5BE55C6480E9 | ||
546 | :10221000247F406E755E017560E8755FFFE55D24A3 | ||
547 | :1022200002F55A755C07E55C334057AD60AE5FAFB1 | ||
548 | :102230005EE55CF5823395E0F5831201F5C4540F39 | ||
549 | :10224000FC122152E55A2400F582E434FBF583ECBC | ||
550 | :10225000F0055A055AAD60AE5FAF5EE55CF58233BE | ||
551 | :1022600095E0F5831201F5540FFC122152E55A2432 | ||
552 | :1022700000F582E434FBF583ECF0055A055A155C51 | ||
553 | :1022800080A4740290F851F090F86B79A37A367BB1 | ||
554 | :102290002778011203FE756A357569FC756801E4DB | ||
555 | :1022A00090FF83F0748090FF81F0755902E55975B5 | ||
556 | :1022B000F007A4247FF582E434F8F583E07893F600 | ||
557 | :1022C000FC540F14FC7893ECF6E55975F007A42440 | ||
558 | :1022D00081F582E434F8F583E0789676FD0876E8B7 | ||
559 | :1022E000FC7893E675F008A42448F582E434FFF501 | ||
560 | :1022F00083E4F07893E675F008A4244FF582E43483 | ||
561 | :10230000FFF583ECF07896E6FF08E67E03CFC31373 | ||
562 | :10231000CF13DEF9FE7893E675F008A42449F58220 | ||
563 | :10232000E434FFF583EEF07893E675F008A4244AD0 | ||
564 | :10233000F582E434FFF5837480F07894ECF67D0048 | ||
565 | :102340007897E62CF618E63DF67896E6FD08E67CEA | ||
566 | :1023500003CDC313CD13DCF9FC7893E675F008A424 | ||
567 | :10236000244DF582E434FFF583ECF07893E675F0C4 | ||
568 | :1023700008A4244EF582E434FFF583E4F07896E671 | ||
569 | :10238000FD08E6FC7893E6FF7E00EE24FE50030293 | ||
570 | :1023900024FEE4EE75F007A4247FF582E434F8F51A | ||
571 | :1023A00083E0FFE4EF5480FAE4EF540F14FFE4EE0F | ||
572 | :1023B00075F007A42481F582E434F8F583E078947D | ||
573 | :1023C000F6E4EE1313548024F0F8E434FDF9E8FC4D | ||
574 | :1023D000E9FD8A5AEA700302246BE4EF75F008A461 | ||
575 | :1023E0002448F582E434FFF583E4F07894E6FAE4D7 | ||
576 | :1023F000EF75F008A4244FF582E434FFF583EAF08A | ||
577 | :10240000EDFBEC7A03CBC313CB13DAF9FAE4EF75E7 | ||
578 | :10241000F008A42449F582E434FFF583EAF07894C7 | ||
579 | :10242000E67B00FAEC2AFCED3BFDFBEC7A03CBC328 | ||
580 | :1024300013CB13DAF9FAE4EF75F008A4244DF58212 | ||
581 | :10244000E434FFF583EAF0E4EF75F008A4244AF5DC | ||
582 | :1024500082E434FFF5837480F0E4EF75F008A4247F | ||
583 | :102460004EF582E434FFF5837480F00224FAE4EF41 | ||
584 | :1024700075F008A42408F582E434FFF583E4F078CD | ||
585 | :1024800094E6FAE4EF75F008A4240FF582E434FF33 | ||
586 | :10249000F583EAF0EDFBEC7A03CBC313CB13DAF947 | ||
587 | :1024A000FAE4EF75F008A42409F582E434FFF5831B | ||
588 | :1024B000EAF07894E67B00FAEC2AFCED3BFDFBECBD | ||
589 | :1024C0007A03CBC313CB13DAF9FAE4EF75F008A45F | ||
590 | :1024D000240DF582E434FFF583EAF0E4EF75F008AB | ||
591 | :1024E000A4240AF582E434FFF583E4F0E4EF75F008 | ||
592 | :1024F00008A4240EF582E434FFF583E4F00E0223F1 | ||
593 | :10250000878E597896EDF608ECF67893EFF6122060 | ||
594 | :1025100070228C26EC30E718E526540F1475F0086D | ||
595 | :10252000A42448F582E434FFF583E054DFF08016FC | ||
596 | :10253000E526540F1475F008A42408F582E434FF4E | ||
597 | :10254000F583E054DFF0227C0022EC90FC37F08C25 | ||
598 | :1025500024ED2403F5257D00D39572ED957140039C | ||
599 | :10256000857225E52524B75009752503740290FC72 | ||
600 | :1025700037F0AC2512315222E4F56CF56B12257E52 | ||
601 | :102580002290FC35E06573600E740490FC37F0E433 | ||
602 | :10259000F56B756C0380467D73E4FEFF79357AFC3C | ||
603 | :1025A0007B0174057800120348E56C2403F56CE5A3 | ||
604 | :1025B0006B3400F56BE56CD39572E56B9571400655 | ||
605 | :1025C00085726C85716BD3E56C9448E56B94004023 | ||
606 | :1025D0000C740290FC37F0E4F56B756C03AC6C1274 | ||
607 | :1025E000315222EC90FC37F0E4F56CF56B8C32EC58 | ||
608 | :1025F000600512314380057C001231522290FF9316 | ||
609 | :10260000E04401F0B2B390FF04E0F54A90FF06E029 | ||
610 | :10261000FDA3E0ED7D00FC7D00FC90FF06E0FFA344 | ||
611 | :10262000E07E00FFE4FEEC4EFCED4FFDC3EC944871 | ||
612 | :10263000ED9400502290FF06E0FDA3E0ED7D00FC4C | ||
613 | :102640007D00FC90FF06E0FFA3E07E00FFE4FEECCF | ||
614 | :102650004EFCED4FFD8004E4FD7C488C728D719042 | ||
615 | :10266000FF02E0FDA3E0ED7D00FC7D00FC90FF0299 | ||
616 | :10267000E0FFA3E07E00FFE4FEEC4EF54CED4FF5ED | ||
617 | :102680004B756A357569FC7568017D357EFC7F0187 | ||
618 | :102690007973E4FAFB74057800120348754900E584 | ||
619 | :1026A0004924FE4019AD6AAE69AF68E4120318050B | ||
620 | :1026B000490DED70010E8D6A8E698F6880E1756A33 | ||
621 | :1026C000357569FC75680178B3E614184660030235 | ||
622 | :1026D00027927890E6FF08E6FE788EE4F608F6C3C7 | ||
623 | :1026E000788FE6940218E69400501DE4FEFFC3EED6 | ||
624 | :1026F00094E8EF940350070EBE00010F80F0788F2E | ||
625 | :1027000006E61870010680D77890EFF608EEF6D24C | ||
626 | :10271000B47890E6FF08E6FE788EE4F608F6C37813 | ||
627 | :102720008FE6941E18E69400501DE4FEFFC3EE945D | ||
628 | :10273000E8EF940350070EBE00010F80F0788F067B | ||
629 | :10274000E61870010680D77890EFF608EEF6C2B171 | ||
630 | :102750007890E6FF08E6FE788EE4F608F6C3788FF8 | ||
631 | :10276000E6943A18E69400501DE4FEFFC3EE94E8A8 | ||
632 | :10277000EF940350070EBE00010F80F0788F06E63D | ||
633 | :102780001870010680D77890EFF608EEF6D2B1788F | ||
634 | :10279000B2E4F608F690FF00E05460B40002800650 | ||
635 | :1027A000D35003022D9BE54A540FF549E54A548066 | ||
636 | :1027B000A2E0920290FF01E012018A000B2D962701 | ||
637 | :1027C000D428F22D9629FE2D962AE12B152C7C2C4F | ||
638 | :1027D0007F2CBF2D3F2D6DE56D30E70EE54C454B51 | ||
639 | :1027E0007008E572640245716003022D9890FF0045 | ||
640 | :1027F000E0541FB400028003D34029E54A6003027D | ||
641 | :1028000028EFAD6AAE69AF68740112031878B1E6BB | ||
642 | :1028100030E00BAD6AAE69AF6874021203187C0237 | ||
643 | :1028200012315222B401028003D3401BE56D20E136 | ||
644 | :1028300007E54A60030228EFE54A24FE5003022818 | ||
645 | :10284000EF7C0212315222B402028006D3500302FE | ||
646 | :1028500028EDE56D20E10DE54A6009E54A648060F8 | ||
647 | :10286000030228EFAC4A1231D940030228EFE549B0 | ||
648 | :10287000702530021190FF80E05408AD6AAE69AF58 | ||
649 | :1028800068120318800F90FF82E05408AD6AAE69A9 | ||
650 | :10289000AF68120318803D154930021DE54975F0F7 | ||
651 | :1028A00008A42448F582E434FFF583E05408AD6AB7 | ||
652 | :1028B000AE69AF68120318801BE54975F008A424BF | ||
653 | :1028C00008F582E434FFF583E05408AD6AAE69AFE1 | ||
654 | :1028D00068120318AD6AAE69AF681201EF600BAD04 | ||
655 | :1028E0006AAE69AF6874011203187C021231522279 | ||
656 | :1028F0008000022D98E56D20E706E57245716003C2 | ||
657 | :10290000022D9890FF00E0541FB400028003D340D2 | ||
658 | :102910001AE54C14454B7004E54A60030229FB7824 | ||
659 | :10292000B1E654FEF67C0012315222B4010280035B | ||
660 | :10293000D3402AE56D20E108E56D20E0030229FB84 | ||
661 | :10294000E56D30E004E54A700BE56D30E109E54ADC | ||
662 | :1029500024FE50030229FB7C0012315222B40202F1 | ||
663 | :102960008006D350030229F9E54C454B6003022948 | ||
664 | :10297000FBAC4A1231D940030229FBE56D20E10787 | ||
665 | :10298000E56D20E0028077E56D30E006E549600204 | ||
666 | :10299000806CE549700F90FF82E054F7F090FF8063 | ||
667 | :1029A000E054F7F022E549B401028003D340097DE9 | ||
668 | :1029B000017C03120F148011B402028003D340097A | ||
669 | :1029C0007D017C04120F1480001549300215E54981 | ||
670 | :1029D00075F008A42448F582E434FFF583E054F749 | ||
671 | :1029E000F08013E54975F008A42408F582E434FF6B | ||
672 | :1029F000F583E054F7F07C00123152228000022D62 | ||
673 | :102A000098E56D20E706E57245716003022D989008 | ||
674 | :102A1000FF00E0541FB400028003D3401AE54C14B9 | ||
675 | :102A2000454B7004E54A6003022ADE78B1E64401B2 | ||
676 | :102A3000F67C0012315222B401028003D34029E512 | ||
677 | :102A40006D20E108E56D20E003022ADEE56D30E04F | ||
678 | :102A500004E549700BE56D30E108E54924FE5002BC | ||
679 | :102A6000807F7C0012315222B402028003D3406F77 | ||
680 | :102A7000E54C454B60028069AC4A1231D940028076 | ||
681 | :102A800060E56D20E107E56D20E0028054E54970C6 | ||
682 | :102A90001430020990FF80E04408F0800790FF8224 | ||
683 | :102AA000E04408F022E56D30E1331549300215E5C8 | ||
684 | :102AB0004975F008A42448F582E434FFF583E04426 | ||
685 | :102AC00008F08013E54975F008A42408F582E43481 | ||
686 | :102AD000FFF583E04408F07C00123152228002802E | ||
687 | :102AE00000022D98E56D20E712E5724571700CE546 | ||
688 | :102AF0004A700890FF00E0541F6003022D98E54CD7 | ||
689 | :102B000090FFFFF090FFFFE06005436D01800353ED | ||
690 | :102B10006DFE7C0012315222E56D30E70EE5724504 | ||
691 | :102B200071600890FF00E0541F6003022D98AD4BC8 | ||
692 | :102B3000E54CED7D00FC7D00FCBD00028003022C15 | ||
693 | :102B400077B401028003D34032E54A7005E54CFCBE | ||
694 | :102B50006003022C79756A407569F8756801D3E5E0 | ||
695 | :102B6000729412E57194004006E4FD7C128004AC7E | ||
696 | :102B700072AD718C708D6F12316722B402028003C6 | ||
697 | :102B8000D34059E54A6003022C79E54CFC70277567 | ||
698 | :102B90006A527569F8756801D3E5729419E5719404 | ||
699 | :102BA000004006E4FD7C198004AC72AD718C708D20 | ||
700 | :102BB0006F1231678025756A6B7569F8756801D386 | ||
701 | :102BC000E5729427E57194004006E4FD7C278004BB | ||
702 | :102BD000AC72AD718C708D6F12316722B4030280BC | ||
703 | :102BE00006D35003022C77E54CF549700F90FF0493 | ||
704 | :102BF000E0FDA3E04D6003022C79801890FB02E019 | ||
705 | :102C0000FDA3E0FC90FF05E06C700790FF04E06D11 | ||
706 | :102C100060028068E4F570F56F7F00E54914C549EE | ||
707 | :102C2000600FEF2400F582E434FBF583E02FFF8092 | ||
708 | :102C3000EA8F4AE54A2400F582E434FBF583E07D1F | ||
709 | :102C400000D39572ED95714006AC72AD71800FE5C1 | ||
710 | :102C50004A2400F582E434FBF583E07D00FC8C70AF | ||
711 | :102C60008D6FE54A2400FCE434FBFDFEECFD7F01A2 | ||
712 | :102C70008D6A8E698F68123167228000022D98025A | ||
713 | :102C80002D98E56D30E719E5721445717012E54A2B | ||
714 | :102C9000700EE54C454B700890FF00E0541F600338 | ||
715 | :102CA000022D98E56D20E008E56D20E103022D98E6 | ||
716 | :102CB000756A6EE4F569F568E4F56F04F570123134 | ||
717 | :102CC0006722E56D20E727E57245717021E54A70BE | ||
718 | :102CD0001DE54C6402454B600DE54C14454B600608 | ||
719 | :102CE000E54C454B700890FF00E0541F6003022D37 | ||
720 | :102CF00098E56D20E008E56D20E103022D98854CF4 | ||
721 | :102D00006EE56E7010436D01536DFDD2B078B2E484 | ||
722 | :102D1000F608F68027E56E64026007E56E1460022F | ||
723 | :102D20008079536DFE436D02E56E64026005E56EC9 | ||
724 | :102D300014700978B2E4F60804F6C2B07C001231CF | ||
725 | :102D40005222E56D30E71AE5721445717013E54AB9 | ||
726 | :102D5000700FE54C454B700990FF00E0541F146064 | ||
727 | :102D6000028038E56D20E10280317C01123152226F | ||
728 | :102D7000E56D20E715E5724571700FE54C454B7028 | ||
729 | :102D80000990FF00E0541F146002800FE56D20E100 | ||
730 | :102D90000280087C00123152228000023059B44077 | ||
731 | :102DA000028006D3500302304F90FF01E090FC35C3 | ||
732 | :102DB000F0E54A90FC36F0E490FC37F0E56A240335 | ||
733 | :102DC000F56AE5693400F569AD4BE54C856A8285A5 | ||
734 | :102DD0006983CDF0A3CDF090FF01E01201C02E0673 | ||
735 | :102DE000012E2C022E56032E80042ECE052F0B060C | ||
736 | :102DF0002F31072F57082F83092FA90B2FCF0C2F07 | ||
737 | :102E0000DE802FDE810000303CE56D20E7067C058A | ||
738 | :102E10001225E0227D527E367F0279387AFC7B01D2 | ||
739 | :102E2000740878001203487D087C0012254722E5CB | ||
740 | :102E30006D20E7067C051225E022E54AB403004038 | ||
741 | :102E400010B40500500BE54A7F00FE7C10123329B8 | ||
742 | :102E5000227D007C0712254722E56D20E7067C05D0 | ||
743 | :102E60001225E022E54AB403004010B40500500BDF | ||
744 | :102E7000E54A7F00FE7C11123329227D007C071277 | ||
745 | :102E8000254722E56D20E7067C051225E022E54A6C | ||
746 | :102E9000B405028003D3400AE4FF04FE7C0A123327 | ||
747 | :102EA0002922B401028003D3400AE4FF04FE7C0817 | ||
748 | :102EB00012332922B403004010B40500500BE54A38 | ||
749 | :102EC0007F00FE7C13123329227D007C07122547E8 | ||
750 | :102ED00022E56D20E734D3E5729448E57194005003 | ||
751 | :102EE00006E572457170067C021225E022E54AB4BF | ||
752 | :102EF0000103B3400BC3B403004009B406005004FF | ||
753 | :102F00001231FF227C071225E02212257E22E56D78 | ||
754 | :102F100020E71DE54AB403004010B40500500BE55E | ||
755 | :102F20004A7F00FE7C16123329227C071225E022FC | ||
756 | :102F300012257E22E56D20E71DE54AB4030040100E | ||
757 | :102F4000B40500500BE54A7F00FE7C19123329229C | ||
758 | :102F50007C071225E02212257E22E56D20E72374EE | ||
759 | :102F60008190FF93F0E54AB403004010B40500508F | ||
760 | :102F70000BE54A7F00FE7C17123329227C071225BD | ||
761 | :102F8000E02212257E22E56D20E71DE54AB403000C | ||
762 | :102F90004010B40500500BE54A7F00FE7C18123348 | ||
763 | :102FA00029227C071225E02212257E22E56D20E7EA | ||
764 | :102FB0001DE54AB403004010B40500500BE54A7FFC | ||
765 | :102FC00000FE7C15123329227C071225E0221225EF | ||
766 | :102FD0007E22E56D20E7067C071225E02212257E81 | ||
767 | :102FE00022E56D30E72090FF00E0541F701090FF45 | ||
768 | :102FF00001E0B48005122575800312257E227D0034 | ||
769 | :103000007C051225472290FF00E0541F60067C05D6 | ||
770 | :103010001225E022D3E5729448E5719400500BC369 | ||
771 | :10302000E5729407E571940050067C031225E022B6 | ||
772 | :10303000E54AB405041231FF227C071225E022E59F | ||
773 | :103040006D30E7087D007C05122547227C0512259E | ||
774 | :10305000E022B420028003D34000800012312D22F0 | ||
775 | :1030600075430090FF83E0540FD395434024E5431C | ||
776 | :1030700024F0F582E434FEF583E0AD6AAE69AF6812 | ||
777 | :1030800012031805430DED70010E8D6A8E698F686D | ||
778 | :1030900080D1E5437D00FCC3E5709CF570E56F9D34 | ||
779 | :1030A000F56FE570456F6006E490FF83F02290FFB6 | ||
780 | :1030B00082E04408F0E4F56F75704990FC35E0B4A7 | ||
781 | :1030C00005028003D3404090FC36E0F543B405028E | ||
782 | :1030D0008003D3400AE4FF04FE7C0B12332922B4A0 | ||
783 | :1030E00001028003D3400AE4FF04FE7C0912332965 | ||
784 | :1030F00022B403004010B40500500BE5437F00FEEE | ||
785 | :103100007C141233292222B480004023B482005060 | ||
786 | :103110001E7C357DFC1217A77D008C6C8D6B90FC9E | ||
787 | :1031200037E0600512312D80057C001231522222D9 | ||
788 | :1031300090FF83E0547FF090FF82E04408F090FF1E | ||
789 | :1031400080E04408F02290FF82E04408F090FF8085 | ||
790 | :10315000E04408F0228C237D008C708D6F756A35F9 | ||
791 | :103160007569FC7568011231672290FF83E0547F16 | ||
792 | :10317000F0E5706449456F700122C3E5709408E57D | ||
793 | :103180006F94004015752108E5217D00FCC3E570B2 | ||
794 | :103190009CF570E56F9DF56F8009857021E4F56FF2 | ||
795 | :1031A000757049752200E522C395215026AD6AAE9F | ||
796 | :1031B00069AF681201EFFCE52224F8F582E434FEE1 | ||
797 | :1031C000F583ECF005220DED70010E8D6A8E698F8E | ||
798 | :1031D0006880D3E521547F90FF81F0228C487F00E6 | ||
799 | :1031E000EF24FD4019E4EF75F007A4247FF582E495 | ||
800 | :1031F00034F8F583E065487002D3220F80E28F47F0 | ||
801 | :10320000C32285727085716F90FF82E054F7F09051 | ||
802 | :10321000FF83E0547FF022C000C001C002C006C09E | ||
803 | :1032200007E5782408F8860653067F7CFF1232896A | ||
804 | :103230007C007D00E57B6046FF90FD95E0547F6E4D | ||
805 | :10324000700FC083C082A3E0FDA3E0FCA3157B80C8 | ||
806 | :1032500007A3A3A3DFE68026DF06D082D083801EEB | ||
807 | :10326000E0F8A3E0F9A3E0FAD082D083E8F0A3E984 | ||
808 | :10327000F0A3EAF0A3C083C082A3A3A380DA123331 | ||
809 | :1032800022D007D006D002D001D0002285A87A75BE | ||
810 | :10329000A888EC70027C3F8C7922E5782408F876C7 | ||
811 | :1032A0000012337680FBC000C001C002C006C00718 | ||
812 | :1032B000AE047CFF123289E57B6042FF90FD95E011 | ||
813 | :1032C000547F6E700BC083C082A3A3A3157B8007BD | ||
814 | :1032D000A3A3A3DFEA8026DF06D082D08380D8E0D4 | ||
815 | :1032E000F8A3E0F9A3E0FAD082D083E8F0A3E9F0F4 | ||
816 | :1032F000A3EAF0A3C083C082A3A3A380DA7808085E | ||
817 | :103300007918097C01E6547F6E700676007700809C | ||
818 | :103310000608090CBC08EE123322D007D006D002F2 | ||
819 | :10332000D001D00022757900857AA822C0F0C08231 | ||
820 | :10333000C083C3E57B24E8500512337680F4EC604B | ||
821 | :1033400031903651E493C39C4028C0047CFF123274 | ||
822 | :1033500089D004430480E57B75F003A42495F582AD | ||
823 | :10336000E434FDF583ECF0EFA3F0EEA3F0057B125F | ||
824 | :103370003322D083D082D0F022C0047C20D28CD2E1 | ||
825 | :103380008DD504FDD0042275A80075880075B8009D | ||
826 | :1033900075F00075D000E4F8900000F608B800FB66 | ||
827 | :1033A000020000C3ED940250047D037CE8ECF4FCC1 | ||
828 | :1033B000EDF4FD0CBC00010D8C7F8D7E22C3EC94DE | ||
829 | :1033C000BCED940250047D077CD0ECF4FCEDF4FDE0 | ||
830 | :1033D0000CBC00010D8C7D8D7C22EC700122C000A4 | ||
831 | :1033E000E5782418F8A604E5782408F8C6547FF692 | ||
832 | :1033F000E630E703D0002212337680F4C28C857C5D | ||
833 | :103400008C857D8AD28CC0E0C0D0C0F0C082C083E1 | ||
834 | :10341000C000C001C002C003C004C005C006C00790 | ||
835 | :10342000121AFAE5782408F8E66024E5782410F802 | ||
836 | :10343000A681E57875F021A4248DF582E434FCF5AD | ||
837 | :103440008378B4E58104C398F9E6F008A3D9FA7447 | ||
838 | :10345000082578F8057808E65480700CE578B407FC | ||
839 | :10346000F3780875780080EFE5782410F88681E518 | ||
840 | :103470007875F021A4248DF582E434FCF58378B4CA | ||
841 | :10348000E58104C398F9E0F608A3D9FAD007D0067D | ||
842 | :10349000D005D004D003D002D001D000D083D08298 | ||
843 | :1034A000D0F0D0D0D0E032C0E0C0D0C000C001C069 | ||
844 | :1034B00002C28E857E8D857F8BD28E781979097AAE | ||
845 | :1034C00007E77004A600800BE6600816E67004E7C4 | ||
846 | :1034D0004480F70809DAEAE579601314F579700E8B | ||
847 | :1034E000E5782408F87600123322D28CD28DD002EF | ||
848 | :1034F000D001D000D0D0D0E0327581B3742A90FFD3 | ||
849 | :1035000093F0757F30757EF8757D60757CF01205DF | ||
850 | :10351000411235AA12175D90FF93E04401F0B2B357 | ||
851 | :103520001235D412338480DA22C0007C01EC2408E6 | ||
852 | :10353000F8E660090CBC08F512337680EED0002264 | ||
853 | :10354000C0F0C082C083C000C006C007ED2410F8E0 | ||
854 | :1035500076C2ED75F021A4248DF582E434FCF58368 | ||
855 | :10356000C082C083A3A3E4780DF0A3D8FCEC547F01 | ||
856 | :1035700075F002A4241DF582E5F03436F583E4935A | ||
857 | :10358000FE740193F5828E83E493FE740193FFD061 | ||
858 | :1035900083D082EFF0A3EEF0ED2408F8EC4480F63F | ||
859 | :1035A000D007D006D000D083D082D0F0227578002A | ||
860 | :1035B000757B007A0879187808760077000809DAB0 | ||
861 | :1035C000F8E478087480447FF674014410F5897536 | ||
862 | :1035D000B808D2ABD2A9227581B3D28ED28CD2AF29 | ||
863 | :1035E000E57B6032FF90FD95E05480602478087997 | ||
864 | :1035F00008E0547FFA7B00E6547FB502027BFF08A7 | ||
865 | :10360000D9F5EB700CEAF0123526AD04AC02123598 | ||
866 | :103610003DA3A3A3DFD212337680C57C017D0022B7 | ||
867 | :10362000050004F404F804EC04E804E404F004FCE9 | ||
868 | :1036300004A804AC04D804DC04A404A404A404E096 | ||
869 | :1036400004C004B804BC04B404CC04C804C404D04A | ||
870 | :1036500004D404B0190103002200480200480E30CF | ||
871 | :103660001420C81AD0180A0C050602030102000132 | ||
872 | :10367000CE0181010000C000800060003000180011 | ||
873 | :1036800010000800040002000100081828380C058A | ||
874 | :10369000100A0200000000000301100A02000000EE | ||
875 | :1036A0000000FBE0FBF209022700010200A0FA097A | ||
876 | :1036B00004000003FF00000007058102400000072E | ||
877 | :1036C00005010240000007058303020001220354A4 | ||
878 | :1036D0000055005300420033003400310030002018 | ||
879 | :1036E00000200020002000200020002000200000FA | ||
880 | :0336F000000000D7 | ||
881 | :00000001FF | ||
diff --git a/firmware/mts_gsm.fw.ihex b/firmware/mts_gsm.fw.ihex new file mode 100644 index 000000000000..f6ad0cbd30cb --- /dev/null +++ b/firmware/mts_gsm.fw.ihex | |||
@@ -0,0 +1,867 @@ | |||
1 | :1000000014360002001E021AF9FFFFFFFFFF023341 | ||
2 | :100010001DFFFFFFFFFFFFFFFFFFFFFFFFFF02339B | ||
3 | :10002000C87581CE90FDE88583A012353CEC4D600B | ||
4 | :100030007378AB8003760018B89CFA787F800376DB | ||
5 | :100040000018B865FA78208003760018B820FA788E | ||
6 | :10005000208003760018B81FFA90FDDDAE83AF82D2 | ||
7 | :1000600090FBF81200AA6005E4F0A380F690FDE88A | ||
8 | :10007000A88290FDE8A982E8696005E4F20880F7AB | ||
9 | :100080009001081200B390010C1200B390011012FD | ||
10 | :1000900000B39001141200D190011A1200D1900106 | ||
11 | :1000A000201200D175D00012341A020126EF6582A9 | ||
12 | :1000B0007003EE658322E493F8740193F97402935C | ||
13 | :1000C000FE740393F5828E83E869700122E493F64F | ||
14 | :1000D000A30880F4E493FC740193FD740293FE740E | ||
15 | :1000E0000393FF740493F8740593F58288831200D8 | ||
16 | :1000F000AA700122E493A3A883A9828C838D82F045 | ||
17 | :10010000A3AC83AD828883898280E32121049B8014 | ||
18 | :1001100080049BACAE049BFDE8049D049DFBF304AE | ||
19 | :10012000A2049DFBF30502050280FED0F030F00929 | ||
20 | :1001300020F303F68010F7800D30F10920F303F26D | ||
21 | :100140008004F38001F020F404FCD0E0CC22CCC089 | ||
22 | :10015000E0120163020154BC0005D0F0ACF022C3F0 | ||
23 | :1001600013DCFC02012ABF0009ED258275F001F8BD | ||
24 | :10017000E622BF010FED2582F582EE3583F583750A | ||
25 | :10018000F004E022ED258275F002F8E222D083D05F | ||
26 | :1001900082F5F0C3E493A3C5F095F0C0E0C3D0F0BE | ||
27 | :1001A000E493A395F04012A3A3C3E5F033500205F6 | ||
28 | :1001B000832582F58250020583740193C0E0E493A5 | ||
29 | :1001C000C0E022D083D082F5F0E4937009740193EB | ||
30 | :1001D0007004A3A3800C74029365F06005A3A3A32D | ||
31 | :1001E00080E7740193C0E0E493C0E022120264024D | ||
32 | :1001F00001FB1202B80201FB1202DC0201FB30E03B | ||
33 | :100200000720E302E622E72230E10720E302E222B0 | ||
34 | :10021000E32230E202E022E493221202DC02022313 | ||
35 | :100220001202B8020223ABF012022DCBC5F0CB2292 | ||
36 | :1002300030E01020E306E6F5F008E622E7F5F009E5 | ||
37 | :10024000E7192230E11020E306E2F5F008E222E3AC | ||
38 | :10025000F5F009E3192230E206E0F5F0A3E022E42C | ||
39 | :1002600093F5F074019322BB0003740922BB0107CC | ||
40 | :1002700089828A83740422BB020789828A8374106C | ||
41 | :1002800022740A22020284BB0007E92582F8740165 | ||
42 | :1002900022BB010DE92582F582EA3583F5837404DA | ||
43 | :1002A00022BB020DE92582F582EA3583F5837410BD | ||
44 | :1002B00022E92582F87402220202B8BF0005EDF897 | ||
45 | :1002C000740122BF01078D828E83740422BF02074E | ||
46 | :1002D0008D828E83741022EDF87402220202DCBF3C | ||
47 | :1002E0000007ED2582F8740122BF010DED2582F58E | ||
48 | :1002F00082EE3583F583740422BF020DED2582F56D | ||
49 | :1003000082EE3583F583741022ED2582F874022283 | ||
50 | :10031000020310C0E0120264020328C0E01202B817 | ||
51 | :10032000020328C0E01202DC02032830E00B20E3C5 | ||
52 | :1003300004D0E0F622D0E0F72230E10B20E304D035 | ||
53 | :10034000E0F222D0E0F322D0E0F022C9CDC9CACE3B | ||
54 | :10035000CACBCFCB12035BEDF9EEFAEFFB22BB0069 | ||
55 | :100360002FBF000AFAEDF8E7F60809DAFA22BF0112 | ||
56 | :10037000128D828E83F802037809A3E7F0D8FA225F | ||
57 | :10038000020383FAEDF8E7F20809DAFA2202038D94 | ||
58 | :10039000BB014DBF001489828A83F9EDF802039FE7 | ||
59 | :1003A00008A3E0F6D9FA220203B0BF01228D828EA3 | ||
60 | :1003B00083FB08C9C582C9CAC583CAE0A3C9C5826F | ||
61 | :1003C000C9CAC583CAF0A3DBEAD8E8220203D38DE9 | ||
62 | :1003D000828E83F9EDF8E0F208A3D9FA220203DD58 | ||
63 | :1003E000BB024DBF001289828A83F9EDF80203EF48 | ||
64 | :1003F00008A3E493F6D9F922BF01238D828E83FBF3 | ||
65 | :1004000008C9C582C9CAC583CAE493A3C9C582C93C | ||
66 | :10041000CAC583CAF0A3DBE9D8E722020422898295 | ||
67 | :100420008A83F9EDF8E493F208A3D9F922020433A0 | ||
68 | :10043000BF000DFAEDF8E3F60809DAFA2202043DEE | ||
69 | :10044000BF01128D828E83F802044A09A3E3F0D81B | ||
70 | :10045000FA22020455FAEDF8E3F20809DAFA220268 | ||
71 | :10046000045FE6FB08E6FA08E6F904F618700106F0 | ||
72 | :1004700022E6FF08E6FE08E6FD22EFF0A3EEF0A379 | ||
73 | :10048000EDF022EBF0A3EAF0A3E9F022E0FFA3E015 | ||
74 | :10049000FEA3E0FD22E0FBA3E0FAA3E0F9220000C6 | ||
75 | :1004A00000000000000502006105710026059800AB | ||
76 | :1004B000330A0900610A750066154400610CF900F1 | ||
77 | :1004C0006109A9006109E000610DC000610BF10044 | ||
78 | :1004D000610A1C00610A510061173C0033174F008C | ||
79 | :1004E000341E1400431EBF0044202C0044201A0078 | ||
80 | :1004F000471EE600471F8B004D1FDC004F1F080002 | ||
81 | :100500005832A800617CCC7DFF121CC52290FFFCF4 | ||
82 | :10051000E020E72DC2AFAE59AF58755A20E55A1406 | ||
83 | :10052000C55A6019E4FE7F05EE4FCE24FFCECF34CE | ||
84 | :10053000FFCF6007E490FF92F080ED80E08E598F4E | ||
85 | :10054000582212050A7D077CB71232C47D0F7C6EDB | ||
86 | :100550001232DE789D7A06E4F608DAFC7A06120595 | ||
87 | :10056000CD7C03120E55122168E4FEFF7C0F12327F | ||
88 | :100570004DD2A822123138E490FC38F090FFF0E020 | ||
89 | :1005800030E408740190FC39F08005E490FC39F007 | ||
90 | :100590007D0A7C001225461231BB2212313890FCB4 | ||
91 | :1005A00039E014700E90FFF0E04410F07C0012254A | ||
92 | :1005B000DF801990FC39E0700E90FFF0E054EFF00E | ||
93 | :1005C0007C001225DF80057C171225DF1231BB224B | ||
94 | :1005D00090FFF0E054ABF090FFF0E04420F0228C6C | ||
95 | :1005E000378D367882EDF608ECF6EDFEECFD7F01F6 | ||
96 | :1005F0009000051201F57880F67882E6FD08E6FCA9 | ||
97 | :10060000EDFEECFD7F019000041201F5540FFC7D1E | ||
98 | :100610008012176D7880E6700DAD3AAE39AF38E4D0 | ||
99 | :100620001203187C082290FFF0E054FEF090FFF0D7 | ||
100 | :10063000E054FDF0801E7882E6FD08E6FCEDFEEC5D | ||
101 | :10064000FD7F0190000812021725E0440190FFF39E | ||
102 | :10065000F00206D97882E6FD08E6FCEDFEECFD7FAF | ||
103 | :100660000190000612021754FE90FFF3F0802B78E1 | ||
104 | :1006700082E6FD08E6FCEDFEECFD7F01900008122D | ||
105 | :100680000217FAEB90FFF1F01208C8400DAD3AAE38 | ||
106 | :1006900039AF38E41203187C18227882E6FD08E6A8 | ||
107 | :1006A000FCEDFEECFD7F0190000812021790FFF1B7 | ||
108 | :1006B000F01208C8400DAD3AAE39AF38E412031855 | ||
109 | :1006C0007C18227882E6FD08E6FCEDFEECFD7F0159 | ||
110 | :1006D000900006120217440190FFF3F07883E6249D | ||
111 | :1006E00003F618E63400F67880E624FE500990FF01 | ||
112 | :1006F000F0E054FDF0800790FFF0E04402F0E49059 | ||
113 | :10070000FFF1F0788176007880E624FFFCE434FF86 | ||
114 | :10071000FD7881E67F00FEECD39EEF6480CD64809F | ||
115 | :100720009D402F1208AD400F7881E6AD3AAE39AF4B | ||
116 | :10073000381203187C182290FFF2E0FC788286833E | ||
117 | :10074000088682ECF0788106A37882A68308A682C8 | ||
118 | :1007500080B51208AD400F7881E6AD3AAE39AF38BA | ||
119 | :100760001203187C182290FFF2E0FC78828683083E | ||
120 | :100770008682ECF07880E6AD3AAE39AF38120318D5 | ||
121 | :100780007C00228C378D367882EDF608ECF6EDFE93 | ||
122 | :10079000ECFD7F019000051201F57881F67882E684 | ||
123 | :1007A000FD08E6FCEDFEECFD7F019000041201F572 | ||
124 | :1007B000540FFC7D8112176D7881E670037C08224E | ||
125 | :1007C00090FFF0E054FEF090FFF0E054FDF0801B4D | ||
126 | :1007D0007882E6FD08E6FCEDFEECFD7F0190000866 | ||
127 | :1007E00012021725E090FFF3F0805B7882E6FD08A7 | ||
128 | :1007F000E6FCEDFEECFD7F0190000612021754FEB0 | ||
129 | :1008000090FFF3F080217882E6FD08E6FCEDFEEC37 | ||
130 | :10081000FD7F01900008120217FAEB90FFF1F01231 | ||
131 | :1008200008C840037C18227882E6FD08E6FCEDFE4D | ||
132 | :10083000ECFD7F0190000812021790FFF1F0120802 | ||
133 | :10084000C840037C18227883E6240AF618E63400B0 | ||
134 | :10085000F6788076007881E624FFFCE434FFFD78AA | ||
135 | :1008600080E67F00FEECD39EEF6480CD64809D40E7 | ||
136 | :100870002178828683088682E090FFF1F01208C812 | ||
137 | :1008800040037C1822788006788306E618700106FB | ||
138 | :1008900080C390FFF0E04401F0788286830886826E | ||
139 | :1008A000E090FFF1F01208C840037C18227C00227F | ||
140 | :1008B00090FFF0E020E71290FFF0E030E50990FFB4 | ||
141 | :1008C000F0E04420F0C32280E7D32290FFF0E02044 | ||
142 | :1008D000E31290FFF0E030E50990FFF0E04420F0F3 | ||
143 | :1008E000C32280E7D3228C428D417C00ED54F0FD81 | ||
144 | :1008F000EC7003ED64307005753E038003753E04B3 | ||
145 | :10090000AC3E120F72758300858340E541540FF5AC | ||
146 | :100910003FE5407004E53F64037035E53E24FD7516 | ||
147 | :10092000F00AA42402F582E434FCF583E030E60505 | ||
148 | :100930001210598019E53E249DF8E654FBF678A97B | ||
149 | :10094000E62405F58218E63400F583740FF080592B | ||
150 | :10095000E5407004E53F64047048E53E24FD75F011 | ||
151 | :100960000AA42402F582E434FCF583E030E507AC08 | ||
152 | :1009700042AD41121C5AE54230E21578ADE630E056 | ||
153 | :100980000F78ADE630E109E4FF04FE7C0412324D3D | ||
154 | :1009900078A9E62406F58218E63400F583740FF092 | ||
155 | :1009A0008007E4FC7DEE121C5AC203221231381279 | ||
156 | :1009B0000F7278A9E62406F58218E63400F583E084 | ||
157 | :1009C00090FC38F078A9E62405F58218E63400F5A5 | ||
158 | :1009D00083E090FC39F0C2037D027C0012254612B0 | ||
159 | :1009E00031BB221231387895ECF6EC249DF8E630D4 | ||
160 | :1009F000E1077C131225DF800F90FC39E0FD78952C | ||
161 | :100A0000E6FC1213EF1225DF1231BB2212313878C7 | ||
162 | :100A100095ECF67D00120F121225DF1231BB221267 | ||
163 | :100A200031387895ECF6EC249DF8E630E2077C133B | ||
164 | :100A30001225DF801B7895E6249DF8E620E1077CEF | ||
165 | :100A4000121225DF800A7895E6FC1214131225DFB6 | ||
166 | :100A50001231BB221231387895ECF6EC249DF8E681 | ||
167 | :100A600020E2077C111225DF800A7895E6FC12153A | ||
168 | :100A7000141225DF1231BB221231387895ECF612B0 | ||
169 | :100A80000F7278A9E62409F58218E63400F583E0B0 | ||
170 | :100A900090FC3FF078A9E6240AF58218E63400F5C8 | ||
171 | :100AA00083E090FC40F078A9E62403F58218E63450 | ||
172 | :100AB00000F583E0FC78A9E62404F58218E634000A | ||
173 | :100AC000F583E0F56278A9E62402F58218E63400A1 | ||
174 | :100AD000F583E0F5638C61E4EC333354017895F6EB | ||
175 | :100AE0006008E56230E1037895067895E690FC4170 | ||
176 | :100AF000F078A7E62402F58218E63400F583E0FDDD | ||
177 | :100B0000A3E0540CFCED54E68C65F564E56130E53A | ||
178 | :100B100003436501E56220E50EE561547F7008E559 | ||
179 | :100B20006120E703436502E56130E303436510E5B7 | ||
180 | :100B30006130E203436520E561540360034365408F | ||
181 | :100B4000E56130E103436580E56130E4034364011E | ||
182 | :100B5000E56130E603436408E56220E40EE5615494 | ||
183 | :100B60007F7008E56120E7034364105365FB53641D | ||
184 | :100B7000F9AD64E56590FC3ACDF0A3CDF0E56330C6 | ||
185 | :100B8000E30DE5635430C4540F90FC3DF08005E460 | ||
186 | :100B900090FC3DF0E563540390FC3CF0E5635404A5 | ||
187 | :100BA000C31390FC3EF090FC3CE0700E7D357EFC63 | ||
188 | :100BB0007F01740190000912014B78A9E62408F521 | ||
189 | :100BC0008218E63400F583E07C00FD78A9E624076E | ||
190 | :100BD000F58218E63400F583E07F004CFEEF4D907F | ||
191 | :100BE000FC38F0A3CEF0CEC2037D0A7C001225466D | ||
192 | :100BF0001231BB221231387895ECF6789A760108DA | ||
193 | :100C000076FC0876387897760C789A12046E120281 | ||
194 | :100C10001D7898CBF6CB08F67F00EF24EA401FE45E | ||
195 | :100C2000EF25E090357EFD93CD04937899667003AF | ||
196 | :100C3000ED186670067897760080030F80DC789652 | ||
197 | :100C4000EFF6789A12046E9000021202177898CB91 | ||
198 | :100C5000F6CB08F65404CB54064B60047897760B19 | ||
199 | :100C60007899E630E313789A12046E900005120129 | ||
200 | :100C7000F524FB50047897760D7899E654C07D00F2 | ||
201 | :100C800064C04D70047897760B789A12046E9000C9 | ||
202 | :100C9000041201F524FC50047897760F789A120418 | ||
203 | :100CA0006E9000061201F524FD50047897760E78B8 | ||
204 | :100CB0009A12046E9000091201F524FD50047897F1 | ||
205 | :100CC000760A7897E6702A7895E6FC120F72789A81 | ||
206 | :100CD00012046E78A7E6F978A6E6FA7B01740A7822 | ||
207 | :100CE00000120348C2037895E6FC1211157897ECC0 | ||
208 | :100CF000F67897E6FC1225DF1231BB2212313878E4 | ||
209 | :100D000095ECF6120F727895E624FD75F00AA4248E | ||
210 | :100D100014F582E434FCF583AC82AD8378A6868337 | ||
211 | :100D2000088682ECF9EDFA7B0A78011203B0C2035F | ||
212 | :100D30007895E6FC1211151231BB228D2B8C2AED11 | ||
213 | :100D400060407527017529487528FFE52A24FDFCB8 | ||
214 | :100D5000E434FFFDEC7C0325E0CD33CDDCF9FCE58C | ||
215 | :100D6000292CF529E5283DF528AD29AE28AF2774B3 | ||
216 | :100D7000809000061203207480900002120320125B | ||
217 | :100D80000FC5E52B14603B7527017529087528FFF1 | ||
218 | :100D9000E52A24FDFCE434FFFDEC7C0325E0CD33A3 | ||
219 | :100DA000CDDCF9FCE5292CF529E5283DF528AD2910 | ||
220 | :100DB000AE28AF27E4900006120320E49000021250 | ||
221 | :100DC0000320221231387895ECF6EC249DF8E630B9 | ||
222 | :100DD000E2097895E6FC121514D2007895E6FC122B | ||
223 | :100DE0000F727896760090FC39E030E704789676BA | ||
224 | :100DF000017896E6FD7895E6FC120D38C2033000C6 | ||
225 | :100E0000077895E6FC1214137C001225DF1231BB23 | ||
226 | :100E10002278A9E62404F58218E63400F583E0443C | ||
227 | :100E200001F078A9E62404F58218E63400F583E0A1 | ||
228 | :100E300030E00280ED78A9E6240BF58218E6340054 | ||
229 | :100E4000F583E054F8F078A9E62402F58218E63438 | ||
230 | :100E500000F583E04480F022C2038C58120F7278B0 | ||
231 | :100E6000A6868308868279AF7A357B0A78011203D9 | ||
232 | :100E7000FE120E0EAC587D02120D38C203AC581291 | ||
233 | :100E80001115228D538E528F518C50120F72754F47 | ||
234 | :100E90000078A9E62405F58218E63400F583E02001 | ||
235 | :100EA000E41FE54F24F64019054FC2037C181232A7 | ||
236 | :100EB000FB90FF93E04401F0B2B3AC50120F72808C | ||
237 | :100EC000D078A9E62405F58218E63400F583E02001 | ||
238 | :100ED000E405C2037C022278A9E62405F58218E61F | ||
239 | :100EE0003400F583E0540F601678A9E62405F582F6 | ||
240 | :100EF00018E63400F583E0540FF0C2037C01227839 | ||
241 | :100F0000A88683088682E0AD53AE52AF5112031813 | ||
242 | :100F1000C2037C00228D318C30121514E531600F34 | ||
243 | :100F2000E530B4030A7C0112250E7C8112250EAC3B | ||
244 | :100F300030120F72E531601A78AA8683088682E043 | ||
245 | :100F400054E7F0A3A3A3A3E054E7F0AC307D021272 | ||
246 | :100F50000D3878A6868308868279B97A357B0A7837 | ||
247 | :100F6000011203FEC203E530249DF8E654FDF6AC01 | ||
248 | :100F700030121115228C2630030512329A80F87C2B | ||
249 | :100F80000A1231ADD203E52624FD78A3F670077866 | ||
250 | :100F9000AA76FF0876E078A3E67D007C0425E0CD04 | ||
251 | :100FA00033CDDCF9FC24A078A9F6ED34FF18F678EF | ||
252 | :100FB000A3E675F00AA42400FCE434FCFD78A6ED59 | ||
253 | :100FC000F608ECF61232462278A9E62402F58218D9 | ||
254 | :100FD000E63400F583E030E72278A9E62402F582C2 | ||
255 | :100FE00018E63400F583E0547FF078A9E62402F592 | ||
256 | :100FF0008218E63400F583E04480F02278AA8683E4 | ||
257 | :10100000088682E0547FF0AD83E5822404FCE43D51 | ||
258 | :101010008C82F583E0547FF078A9E6240BF58218E2 | ||
259 | :10102000E63400F583E054F8F078ABE62401F5826D | ||
260 | :1010300018E63400F583E04403F078ABE62405F5C8 | ||
261 | :101040008218E63400F583E04403F078A9E624052D | ||
262 | :10105000F58218E63400F583740FF02278AA8683AF | ||
263 | :10106000088682E0543FF0AD83E5822404FCE43D31 | ||
264 | :101070008C82F583E0543FF078A3E624A4F8E6FCE4 | ||
265 | :1010800078ABE62401F58218E63400F583ECF078BD | ||
266 | :10109000A3E624A4F8E6FC78ABE62405F58218E67E | ||
267 | :1010A0003400F583ECF078A9E6240BF58218E634D9 | ||
268 | :1010B00000F583E054FB4402F52678A7E62402F508 | ||
269 | :1010C0008218E63400F583E030E50343260178A971 | ||
270 | :1010D000E62405F58218E63400F583E030E00312DB | ||
271 | :1010E0000FC5E526FC78A9E6240BF58218E6340046 | ||
272 | :1010F000F583ECF078A9E62405F58218E63400F5CE | ||
273 | :1011000083740FF078AA8683088682E04480F0A377 | ||
274 | :10111000A3A3A3E04480F0228C2A120F7278A7E6E2 | ||
275 | :101120002408F58218E63400F583E0FC78A9E6246B | ||
276 | :101130000AF58218E63400F583ECF078A7E6240778 | ||
277 | :10114000F58218E63400F583E0FC78A9E62409F579 | ||
278 | :101150008218E63400F583ECF078A6868308868250 | ||
279 | :10116000E0FDA3E0FCEDFE78A9E62408F58218E690 | ||
280 | :101170003400F583EEF0ECFE78A9E62407F582183A | ||
281 | :10118000E63400F583EEF08C298D28C3EC9405ED50 | ||
282 | :10119000940C400575277C8033D3E5299401E5281C | ||
283 | :1011A0009403400575273C8023D3E5299481E528E5 | ||
284 | :1011B000940140057527188013D3E5299460E5282C | ||
285 | :1011C0009400400575270C8003752708AF27E4EFCE | ||
286 | :1011D000547C4483FF8F27E527FC78ABE62401F598 | ||
287 | :1011E0008218E63400F583ECF0E527FC78ABE624C2 | ||
288 | :1011F00005F58218E63400F583ECF0E527FC78A3CA | ||
289 | :10120000E624A4F8ECF678A9E62402F58218E63480 | ||
290 | :1012100000F583E0F52778A7E62402F58218E63486 | ||
291 | :1012200000F583A3E030E3175327C778A7E624052A | ||
292 | :10123000F58218E63400F583E09035AA93422778CA | ||
293 | :10124000A7E62402F58218E63400F583E030E705CE | ||
294 | :1012500043274080035327BF5327FB78A7E6240684 | ||
295 | :10126000F58218E63400F583E06003432704532732 | ||
296 | :10127000FC78A7E62404F58218E63400F583E04202 | ||
297 | :1012800027432780E527FC78A9E62402F58218E6A3 | ||
298 | :101290003400F583ECF078A9E62404F58218E634EE | ||
299 | :1012A00000F583E0F52778A7E62402F58218E634F6 | ||
300 | :1012B00000F583A3E030E1055327DF8003432720B7 | ||
301 | :1012C00078A7E62402F58218E63400F583E030E4DE | ||
302 | :1012D000055327EF800343271078A7E62409F582FA | ||
303 | :1012E00018E63400F583E0B40203432702E527FC47 | ||
304 | :1012F00078A9E62404F58218E63400F583ECF0784A | ||
305 | :10130000A9E62403F58218E63400F583E0F5277892 | ||
306 | :10131000A7E62409F58218E63400F583E07005534A | ||
307 | :10132000277F800343278078A7E62402F58218E60A | ||
308 | :101330003400F583A3E030E00543272080035327E2 | ||
309 | :10134000DF78A7E62402F58218E63400F583E03062 | ||
310 | :10135000E30543274080035327BF78A7E62402F51F | ||
311 | :101360008218E63400F583E030E00543271080035F | ||
312 | :101370005327EF78A7E62402F58218E63400F583B8 | ||
313 | :10138000A3E030E40543270880035327F778A7E656 | ||
314 | :101390002402F58218E63400F583A3E030E5054326 | ||
315 | :1013A000270480035327FB78A7E62402F58218E67A | ||
316 | :1013B0003400F583A3E030E605432701800353277B | ||
317 | :1013C000FE78A7E62402F58218E63400F583A3E050 | ||
318 | :1013D00030E70543270280035327FDE527FC78A962 | ||
319 | :1013E000E62403F58218E63400F583ECF0C2037CB2 | ||
320 | :1013F00000228D278C26ED54031460037C1022E517 | ||
321 | :1014000027547C24FC40037C0B22E526249DF8E62F | ||
322 | :101410004402F67C00228C30120F72E530249DF8D5 | ||
323 | :10142000E620E24FAC307D02120D38E53024FE4458 | ||
324 | :1014300028FC78AA8683088682ECF0AF83E58224B4 | ||
325 | :1014400004FEE43FFFEC8E828F83F07C038C2CE55E | ||
326 | :101450002CFC78ABE62401F58218E63400F583EC29 | ||
327 | :10146000F0E52CFC78ABE62405F58218E63400F5AF | ||
328 | :1014700083ECF0752D01752F48752EFFE53024FDA6 | ||
329 | :10148000FCE434FFFDEC7C0325E0CD33CDDCF9FC3E | ||
330 | :10149000E52F2CF52FE52E3DF52E78ABE62404F54F | ||
331 | :1014A0008218E63400F583E054E7F52CAD2FAE2E1C | ||
332 | :1014B000AF2DE4900002120320E4900006120320F6 | ||
333 | :1014C0001201EF30E503432C10E52CFC78ABE62449 | ||
334 | :1014D00004F58218E63400F583ECF012105978A96F | ||
335 | :1014E000E62406F58218E63400F583E0C203FCE545 | ||
336 | :1014F00030249DF8E64404F68C2CE530540FC45497 | ||
337 | :10150000F07E00FFEEEF44047D00FFEC4EFCED4F5B | ||
338 | :10151000FD121CC57C00228C2F120F72120FF9785D | ||
339 | :10152000AA8683088682E05408F0A3A3A3A3E0540C | ||
340 | :1015300008F0AC2F7D02120D38C203E52F249DF870 | ||
341 | :10154000E654FBF67C00221231387896ECF6EC2457 | ||
342 | :101550009DF8E630E10A7D007C131225461231BB6E | ||
343 | :101560007896E6249DF8E64401F67896E6FC120F9C | ||
344 | :10157000727896E624FD75F00AA42414F582E4340A | ||
345 | :10158000FCF58378A6E6FA08E6F97B0A78011203EF | ||
346 | :10159000B078A6868308868279B97A357B0A780185 | ||
347 | :1015A0001203FE120FC5C2037896E6FC12111578DD | ||
348 | :1015B00095ECF6EC600A7D007C081225461231BBE2 | ||
349 | :1015C0007896E6FC120F7278A9E62404F58218E6F4 | ||
350 | :1015D0003400F583E0441054DFFC78A9E62404F5D8 | ||
351 | :1015E0008218E63400F583ECF07895ECF6C2037CC3 | ||
352 | :1015F000C81232FB7896E6FC120F7278A9E6240432 | ||
353 | :10160000F58218E63400F583E054EFF0C2037CC89D | ||
354 | :101610001232FB7896E6FC120F7278A9E62404F5E4 | ||
355 | :101620008218E63400F583E04410F0C2037CC8124F | ||
356 | :1016300032FB7896E6FC120F7278A9E62404F58254 | ||
357 | :1016400018E63400F583E04420F0C2037CF0123247 | ||
358 | :10165000FB7896E6FC120F7278A9E62405F582184D | ||
359 | :10166000E63400F583E030E415C2037896E64410D2 | ||
360 | :101670007F00FE7C0712324D1231BB02173B78A966 | ||
361 | :10168000E62404F58218E63400F583E054CFF0C276 | ||
362 | :10169000037CC81232FB7896E6FC120F7278A9E63A | ||
363 | :1016A0002404F58218E63400F583E04430F0C203E8 | ||
364 | :1016B0007CF01232FB7896E6FC120F7278A9E624D1 | ||
365 | :1016C00005F58218E63400F583E030E414C20378AF | ||
366 | :1016D00096E644107F00FE7C0712324D1231BB802B | ||
367 | :1016E0005D78A9E62404F58218E63400F583E05419 | ||
368 | :1016F000EFF078A9E62404F58218E63400F583E0DB | ||
369 | :1017000054DFF07896E624FD75F00AA42414F582DF | ||
370 | :10171000E434FCF583AC82AD8378A68683088682A8 | ||
371 | :10172000ECF9EDFA7B0A78011203B0C2037896E671 | ||
372 | :10173000FC1211157D007C0B1225461231BB2212C2 | ||
373 | :101740003138E490FC39F07D027C001225461231DC | ||
374 | :10175000BB221231387C001225DF1231BB22743CCF | ||
375 | :1017600090FBE0F0743E90FBE0F0E490FC28F02267 | ||
376 | :101770008D358C34ECB401028003D340028028B450 | ||
377 | :1017800002028003D34008A835E625E0F68018B4AD | ||
378 | :1017900004028003D3400AA835E625E025E0F68060 | ||
379 | :1017A00006A83576008000228C3C8D3BEDFEECFDDA | ||
380 | :1017B0007F0175660675670090FC29120477120197 | ||
381 | :1017C000EFB480028006D3500302186E90FC2912F9 | ||
382 | :1017D00004899000031201F554F0B430028003D361 | ||
383 | :1017E000405F90FC29120489900008120217FAFD4C | ||
384 | :1017F000EBFE7F0190FC2C120477EECD9035C3FCFC | ||
385 | :10180000E493FF740193FEF9EFFA7B01EAFFE9FE2E | ||
386 | :10181000ECC39EED9F40259035C5E493FD74019384 | ||
387 | :10182000FCEDFEECFD7F01EECDFC90FC2EE0D39CA8 | ||
388 | :1018300090FC2DE09D5005756680803312198C80D8 | ||
389 | :101840002EB460028003D3400BAC3CAD3B1207804A | ||
390 | :101850008C66801BB41003B34010C3B42003B340A4 | ||
391 | :1018600009C3B440028003D34000756681800080C4 | ||
392 | :1018700075B481028003D3406B90FC2912048990D7 | ||
393 | :1018800000031201F554F0B430028003D3401D90E0 | ||
394 | :10189000FC29120489900008120217FAFDEBFE7F62 | ||
395 | :1018A0000190FC2F1204771218F68036B460028083 | ||
396 | :1018B00003D34013753A67E4F539F538AC3CAD3BDA | ||
397 | :1018C0001205DC8C66801BB41003B34010C3B42037 | ||
398 | :1018D00003B34009C3B440028003D340007566815E | ||
399 | :1018E000800080028000E566FC90FC29120489ECEF | ||
400 | :1018F000900002120320AC672290FC291204899008 | ||
401 | :1019000000041201F5600474018001E4A2E0920178 | ||
402 | :1019100090FC29120489ED2403FD50010E90FC2C4B | ||
403 | :1019200012047790FC291204899000051201F5F544 | ||
404 | :10193000679000041201F5540FFC7D6712176DE5E6 | ||
405 | :10194000677004756608227566007884760078846E | ||
406 | :10195000E6C39567503890FC2F1204891201EFFC02 | ||
407 | :1019600090FC2C120489EC12031830010E90FC310B | ||
408 | :10197000E004F090FC307003E004F078840690FC02 | ||
409 | :101980002EE004F090FC2D7003E004F080C0229063 | ||
410 | :10199000FC2AE0FDA3E0FCEDFEECFD7F01ED240A56 | ||
411 | :1019A000FD50010E90FC3212047790FC291204893C | ||
412 | :1019B0009000041201F5540FB401028003D34017C4 | ||
413 | :1019C00090FC321204890DED70010E90FC2F120470 | ||
414 | :1019D0007778887601804EB402028003D340199054 | ||
415 | :1019E000FC32120489ED2402FD50010E90FC2F12EE | ||
416 | :1019F000047778887602802DB404028003D34019DE | ||
417 | :101A000090FC32120489ED2404FD50010E90FC2F4D | ||
418 | :101A100012047778887604800CB400028003D340E7 | ||
419 | :101A2000007566082290FC291204899000051201B5 | ||
420 | :101A3000F5F567788576007885E6C39567400302FB | ||
421 | :101A40001AF4788676007886E6C378889650769081 | ||
422 | :101A5000FC2C1204891201EFFC90FC321204921249 | ||
423 | :101A600001E9F45CFC1201E9F890FC2F120489E80A | ||
424 | :101A7000C0E01201EFC8D0E0C8584CFC90FC2C121A | ||
425 | :101A80000489EC1203187887ECF690FC31E004F03E | ||
426 | :101A900090FC307003E004F009E970010A90FC3218 | ||
427 | :101AA00012048090FC291204899000041201F53080 | ||
428 | :101AB000E40E90FC2EE004F090FC2D7003E004F0A6 | ||
429 | :101AC00078860680817888E6FDE4FEFFEECDFC9006 | ||
430 | :101AD000FC31E02CF090FC30E03DF07888E6FDE44D | ||
431 | :101AE000FEFFEECDFC90FC34E02CF090FC33E03DAA | ||
432 | :101AF000F0788506021A347566002222C0E0C0F034 | ||
433 | :101B0000C082C083C0D0E8C0E0E9C0E0EAC0E0EB3A | ||
434 | :101B1000C0E0ECC0E0EDC0E0EEC0E0EFC0E090FF60 | ||
435 | :101B200092E01201C01B47301B47321B56381B681E | ||
436 | :101B30003A1B7A3E1B92441B86461B9E501BE0526A | ||
437 | :101B40001BBF541C015600001C2290FF92E07F0036 | ||
438 | :101B5000FE7C0112324D021C32E4FF04FE7C0312B3 | ||
439 | :101B6000324D742090FFFEF0021C32E4FF04FE7C34 | ||
440 | :101B70000212324D744090FFFEF0021C32E4FF046A | ||
441 | :101B8000FE7C0412324D021C32E4FF04FE7C05127E | ||
442 | :101B9000324D021C32E4FF04FE7C0612324D021C60 | ||
443 | :101BA0003290FFA5E07D0090FBF8CDF0A3CDF09042 | ||
444 | :101BB000FBF9E0FCF58390FBF8E04433FD121CC513 | ||
445 | :101BC000807390FFB5E07D0090FBFACDF0A3CDF0DF | ||
446 | :101BD00090FBFBE0FCF58390FBFAE04443FD121C14 | ||
447 | :101BE000C5805290FFA6E07D0090FBFCCDF0A3CD18 | ||
448 | :101BF000F090FBFDE0FCF58390FBFCE04434FD122B | ||
449 | :101C00001CC5803190FFB6E07D0090FBFECDF0A3B7 | ||
450 | :101C1000CDF090FBFFE0FCF58390FBFEE04444FD3B | ||
451 | :101C2000121CC5801090FF92E07D00FCED44AAFDDF | ||
452 | :101C3000121CC58000E490FF92F0D0E0FFD0E0FEDF | ||
453 | :101C4000D0E0FDD0E0FCD0E0FBD0E0FAD0E0F9D06D | ||
454 | :101C5000E0F8D0D0D083D082D0F0D0E0320581053A | ||
455 | :101C60008105810581A881181818EDF608ECF69019 | ||
456 | :101C7000FF5AE020E70280F790FF59E07D00A8813D | ||
457 | :101C800018CDF6CD08F67D03A881E618FCE6CC2534 | ||
458 | :101C9000E0CC33CCDDF9CCF6CC08F6A88118E644CC | ||
459 | :101CA000F8F6A881181818E6FD08E6FCA881188641 | ||
460 | :101CB00083088682EDF0A3ECF0740290FF5AF015D1 | ||
461 | :101CC0008115811581158122E5812405F581E4A81E | ||
462 | :101CD0008118F6A88118181818EDF608ECF690FB94 | ||
463 | :101CE000F5E024F85003021DE6E4A8811818F6A8D0 | ||
464 | :101CF0008118E6FEA88118181818E6FD08E6FC7F92 | ||
465 | :101D000000EF24F8404DE4EF25E0247DF582E43433 | ||
466 | :101D1000FCF583E0FBA3E06C7003FAEB6D700974D3 | ||
467 | :101D200001A8811818F6802BE4EF25E0247DF582C8 | ||
468 | :101D3000E434FCF5837A00E054F0CCF8CCCDF9CD56 | ||
469 | :101D4000FB7800E954F0F9EA687002EB6970010E63 | ||
470 | :101D50000F80AEA88118EEF6A88118181818EDF6B5 | ||
471 | :101D600008ECF6A881EFF6A8811818E67079A8812A | ||
472 | :101D700018E624F74071A88118181818E6540FA81F | ||
473 | :101D800081F664046017A881E664036010A88118D6 | ||
474 | :101D9000181818E6FD08E6FC121C5A804A7C0A1244 | ||
475 | :101DA00031ADA88118181818E6FD08E6FC90FBF480 | ||
476 | :101DB000E025E0247DF582E434FCF583EDF0A3EC2E | ||
477 | :101DC000F090FBF4E0FFE4EF045407FF90FBF4F025 | ||
478 | :101DD00090FBF5E004F012324690FBF6E07008E468 | ||
479 | :101DE000FEFF7C0F12324D802790FBF7E004F05489 | ||
480 | :101DF0003F701D90FBF7E044FE7D00FC90FBF4E09B | ||
481 | :101E000025E0247DF582E434FCF583EDF0A3ECF0CD | ||
482 | :101E1000E58124FBF58122788B7600788C7600743E | ||
483 | :101E20000190FBF6F012313890FBF5E060577C0A28 | ||
484 | :101E30001231AD90FBF3E025E0247DF582E434FC23 | ||
485 | :101E4000F583E0FDA3E0FC90FBF3E025E0247DF5C5 | ||
486 | :101E500082E434FCF583E4F0A3F090FBF3E0FFE4CC | ||
487 | :101E6000EF045407FF90FBF3F090FBF5E014F078DB | ||
488 | :101E700089EDF608ECF61232467889E6FD08E6FCB4 | ||
489 | :101E80001208E380A312329A90FF93E04401F0B26B | ||
490 | :101E9000B3788B06B60011788B7600788CE6F40464 | ||
491 | :101EA00004A2E092B4788CF6021E25E490FBF6F0D2 | ||
492 | :101EB00090FBF5E07D00FCED44CFFD121C5A123181 | ||
493 | :101EC000BB22123138E5706449456F601590FF837D | ||
494 | :101ED000E0540F7D00D39570ED956F5005122F8162 | ||
495 | :101EE00080031230511231BB22123138E57064493F | ||
496 | :101EF000456F600512308B800E90FF80E04408F043 | ||
497 | :101F000090FF83E0547FF01231BB221231388C54A1 | ||
498 | :101F1000EC54F0B41015756A357569FC756801E507 | ||
499 | :101F20006A2403F56AE5693400F569E4F557F55666 | ||
500 | :101F3000E556C394015027E554540FFCAD6AAE69D1 | ||
501 | :101F4000AF68120E808C55EC60028012056AE56A5B | ||
502 | :101F5000700205690557E5577002055680D2E554B1 | ||
503 | :101F6000540F249DF8E654FEF6E554540F7F00FE0E | ||
504 | :101F70007C1212324DE5551470097D007C09122542 | ||
505 | :101F8000468007AD577C001225461231BB22123124 | ||
506 | :101F90003890FFFCE04402F090FF00E030E713903F | ||
507 | :101FA000FF83E04480F0436D8090FFFCE04401F04B | ||
508 | :101FB000801190FF82E04408F0536D7F90FFFCE0B9 | ||
509 | :101FC00054FEF090FF81E04480F01225F990FFFE6E | ||
510 | :101FD000E04405F090FFFCE054FDF01231BB22120A | ||
511 | :101FE00031387C011232FB78ADE64402F674FEFC17 | ||
512 | :101FF00004FD121CC590FF5AE030E70280F7E4F5BB | ||
513 | :102000004E754D10AC4EAD4DE54E154E7002154D52 | ||
514 | :10201000EC4D600280EE4387011231BB2212313851 | ||
515 | :102020007C021231C778ADE654FDF61231BB2212A4 | ||
516 | :10203000313878ADE630E02C78ADE630E12678AD89 | ||
517 | :10204000E6FCF58318E644F0FD121C5A90FFFCE014 | ||
518 | :102050004420F07C021232FB78ADE654FDF6741A8F | ||
519 | :1020600090FFFEF078ADE6FCF58318E644F1FD1232 | ||
520 | :102070001C5A1231BB22756D0090FFFFE0600343D4 | ||
521 | :102080006D01756E00E4F56CF56BE4F56F757049E4 | ||
522 | :10209000748490FF82F0748490FF80F0748090FFCD | ||
523 | :1020A00058F0748090FF5AF0AD46AF457E00EE24A4 | ||
524 | :1020B000FE5003022142E4EE75F007A4247FF5826E | ||
525 | :1020C000E434F8F583E0FFE4EF5480FDE4EF540FCF | ||
526 | :1020D00014FFED6038E4EF75F008A42448F582E4BD | ||
527 | :1020E00034FFF5837490F0E4EF75F008A4244AF50A | ||
528 | :1020F00082E434FFF5837480F0E4EF75F008A424E3 | ||
529 | :102100004EF582E434FFF5837480F08034E4EF759B | ||
530 | :10211000F008A42408F582E434FFF5837490F0E419 | ||
531 | :10212000EF75F008A4240AF582E434FFF583E4F0A7 | ||
532 | :10213000E4EF75F008A4240EF582E434FFF583E49F | ||
533 | :10214000F00E0220AB8D468E448F45747F90FFFDCC | ||
534 | :10215000F0749090FFFCF0228C58EC24F65006E5C9 | ||
535 | :10216000582437FC22E5582430FC22D2B0122543F3 | ||
536 | :10217000EC700302227E755C03AE5B7F00E55C15AC | ||
537 | :102180005C6480247F5035EF2400F582E434FBF555 | ||
538 | :1021900083E0FE24FE501EEF7D00FCE4FB7474C35C | ||
539 | :1021A0009CFAEB9DFBEE7D00FCEAC39CED6480CBCA | ||
540 | :1021B00064809B50028005EF2EFF80C18E5B8F5A9A | ||
541 | :1021C000E55C6480247F500302227EE55A248E5011 | ||
542 | :1021D0000302227E855A5D755B00AE5AAF5B903577 | ||
543 | :1021E000EEE493F55CE55C155C6480247F5018EEAA | ||
544 | :1021F0002400F582E434FBF583E0FCEF9035EE93A8 | ||
545 | :102200006C70040E0F80DE8E5A8F5BE55C64802458 | ||
546 | :102210007F406E755E017560E8755FFFE55D2402C5 | ||
547 | :10222000F55A755C07E55C334057AD60AE5FAF5E55 | ||
548 | :10223000E55CF5823395E0F5831201F5C4540FFC9B | ||
549 | :10224000122155E55A2400F582E434FBF583ECF0C5 | ||
550 | :10225000055A055AAD60AE5FAF5EE55CF582339519 | ||
551 | :10226000E0F5831201F5540FFC122155E55A2400C4 | ||
552 | :10227000F582E434FBF583ECF0055A055A155C80D1 | ||
553 | :10228000A4740290F851F090F86B79C77A357B27E7 | ||
554 | :1022900078011203FE756A357569FC756801E49072 | ||
555 | :1022A000FF83F0748090FF81F0755902E55975F055 | ||
556 | :1022B00007A4247FF582E434F8F583E0788FF6FCF8 | ||
557 | :1022C000540F14FC788FECF6E55975F007A42481BF | ||
558 | :1022D000F582E434F8F583E0789276FD0876E8FC40 | ||
559 | :1022E000788FE675F008A42448F582E434FFF5837E | ||
560 | :1022F000E4F0788FE675F008A4244FF582E434FF0B | ||
561 | :10230000F583ECF07892E6FF08E67E03CFC313CFA7 | ||
562 | :1023100013DEF9FE788FE675F008A42449F582E40F | ||
563 | :1023200034FFF583EEF0788FE675F008A4244AF5C3 | ||
564 | :1023300082E434FFF5837480F07890ECF67D0078C9 | ||
565 | :1023400093E62CF618E63DF67892E6FD08E67C0367 | ||
566 | :10235000CDC313CD13DCF9FC788FE675F008A42407 | ||
567 | :102360004DF582E434FFF583ECF0788FE675F008E4 | ||
568 | :10237000A4244EF582E434FFF583E4F07892E6FD80 | ||
569 | :1023800008E6FC788FE6FF7E00EE24FE5003022470 | ||
570 | :10239000FDE4EE75F007A4247FF582E434F8F583BC | ||
571 | :1023A000E0FFE4EF5480FAE4EF540F14FFE4EE751D | ||
572 | :1023B000F007A42481F582E434F8F583E07890F600 | ||
573 | :1023C000E4EE1313548024F0F8E434FDF9E8FCE95A | ||
574 | :1023D000FD8A5AEA700302246AE4EF75F008A42427 | ||
575 | :1023E00048F582E434FFF583E4F07890E6FAE4EF10 | ||
576 | :1023F00075F008A4244FF582E434FFF583EAF0ED8C | ||
577 | :10240000FBEC7A03CBC313CB13DAF9FAE4EF75F0E4 | ||
578 | :1024100008A42449F582E434FFF583EAF07890E6D5 | ||
579 | :102420007B00FAEC2AFCED3BFDFBEC7A03CBC313FB | ||
580 | :10243000CB13DAF9FAE4EF75F008A4244DF582E441 | ||
581 | :1024400034FFF583EAF0E4EF75F008A4244AF5823E | ||
582 | :10245000E434FFF5837480F0E4EF75F008A4244EB3 | ||
583 | :10246000F582E434FFF5837480F00224F9E4EF751B | ||
584 | :10247000F008A42408F582E434FFF583E4F07890B2 | ||
585 | :10248000E6FAE4EF75F008A4240FF582E434FFF5D2 | ||
586 | :1024900083EAF0EDFBEC7A03CBC313CB13DAF9FA42 | ||
587 | :1024A000E4EF75F008A42409F582E434FFF583EA2B | ||
588 | :1024B000F07890E67B00FAEC2AFCED3BFDFBEC7A31 | ||
589 | :1024C00003CBC313CB13DAF9FAE4EF75F008A424B5 | ||
590 | :1024D0000DF582E434FFF583EAF0E4EF75F008A42B | ||
591 | :1024E000240AF582E434FFF583E4F0E4EF75F008A4 | ||
592 | :1024F000A4240EF582E434FFF583E4F00E02238673 | ||
593 | :102500008E597892EDF608ECF6788FEFF61220737C | ||
594 | :10251000228C26EC30E718E526540F1475F008A439 | ||
595 | :102520002448F582E434FFF583E054DFF08016E5BB | ||
596 | :1025300026540F1475F008A42408F582E434FFF53E | ||
597 | :1025400083E054DFF0227C0022EC90FC37F08C24F6 | ||
598 | :10255000ED2403F5257D00D39572ED95714003853B | ||
599 | :102560007225E52524B75009752503740290FC37C0 | ||
600 | :10257000F0AC2512307622E4F56CF56B12257D2245 | ||
601 | :1025800090FC35E06573600E740490FC37F0E4F560 | ||
602 | :102590006B756C0380467D73E4FEFF79357AFC7BB6 | ||
603 | :1025A0000174057800120348E56C2403F56CE56BB3 | ||
604 | :1025B0003400F56BE56CD39572E56B95714006853B | ||
605 | :1025C000726C85716BD3E56C9448E56B9400400C9C | ||
606 | :1025D000740290FC37F0E4F56B756C03AC6C123050 | ||
607 | :1025E0007622EC90FC37F0E4F56CF56B8C32EC6005 | ||
608 | :1025F0000512306780057C001230762290FF93E050 | ||
609 | :102600004401F0B2B390FF04E0F54A90FF06E0FD0C | ||
610 | :10261000A3E0ED7D00FC7D00FC90FF06E0FFA3E061 | ||
611 | :102620007E00FFE4FEEC4EFCED4FFDC3EC9448ED64 | ||
612 | :102630009400502290FF06E0FDA3E0ED7D00FC7DBC | ||
613 | :1026400000FC90FF06E0FFA3E07E00FFE4FEEC4EFE | ||
614 | :10265000FCED4FFD8004E4FD7C488C728D7190FF91 | ||
615 | :1026600002E0FDA3E0ED7D00FC7D00FC90FF02E0B8 | ||
616 | :10267000FFA3E07E00FFE4FEEC4EF54CED4FF54B82 | ||
617 | :10268000756A357569FC7568017D357EFC7F017959 | ||
618 | :1026900073E4FAFB74057800120348754900E549B4 | ||
619 | :1026A00024FE4019AD6AAE69AF68E412031805490B | ||
620 | :1026B0000DED70010E8D6A8E698F6880E1756A3547 | ||
621 | :1026C0007569FC75680190FF00E05460B4000280F9 | ||
622 | :1026D00006D35003022CBFE54A540FF549E54A548E | ||
623 | :1026E00080A2E0920290FF01E012018A000B2CBA56 | ||
624 | :1026F000270528232CBA292F2CBA2A122A462BADBB | ||
625 | :102700002BB02BF02C632C91E56D30E70EE54C459A | ||
626 | :102710004B7008E572640245716003022CBC90FFA7 | ||
627 | :1027200000E0541FB400028003D34029E54A60034F | ||
628 | :10273000022820AD6AAE69AF68740112031878AD43 | ||
629 | :10274000E630E00BAD6AAE69AF6874021203187C24 | ||
630 | :102750000212307622B401028003D3401BE56D20C3 | ||
631 | :10276000E107E54A6003022820E54A24FE500302FF | ||
632 | :1027700028207C0212307622B402028006D3500355 | ||
633 | :1027800002281EE56D20E10DE54A6009E54A6480F6 | ||
634 | :102790006003022820AC4A1230FD4003022820E5E5 | ||
635 | :1027A00049702530021190FF80E05408AD6AAE698F | ||
636 | :1027B000AF68120318800F90FF82E05408AD6AAE34 | ||
637 | :1027C00069AF68120318803D154930021DE549754F | ||
638 | :1027D000F008A42448F582E434FFF583E05408AD02 | ||
639 | :1027E0006AAE69AF68120318801BE54975F008A44A | ||
640 | :1027F0002408F582E434FFF583E05408AD6AAE693D | ||
641 | :10280000AF68120318AD6AAE69AF681201EF600BD2 | ||
642 | :10281000AD6AAE69AF6874011203187C021230769B | ||
643 | :10282000228000022CBCE56D20E706E57245716050 | ||
644 | :1028300003022CBC90FF00E0541FB400028003D3BD | ||
645 | :10284000401AE54C14454B7004E54A600302292CFC | ||
646 | :1028500078ADE654FEF67C0012307622B401028098 | ||
647 | :1028600003D3402AE56D20E108E56D20E00302294D | ||
648 | :102870002CE56D30E004E54A700BE56D30E109E5CB | ||
649 | :102880004A24FE500302292C7C0012307622B40226 | ||
650 | :10289000028006D3500302292AE54C454B6003020F | ||
651 | :1028A000292CAC4A1230FD400302292CE56D20E1B1 | ||
652 | :1028B00007E56D20E0028077E56D30E006E54960D0 | ||
653 | :1028C00002806CE549700F90FF82E054F7F090FFB2 | ||
654 | :1028D00080E054F7F022E549B401028003D34009B7 | ||
655 | :1028E0007D017C03120F128011B402028003D340D9 | ||
656 | :1028F000097D017C04120F1280001549300215E594 | ||
657 | :102900004975F008A42448F582E434FFF583E054C7 | ||
658 | :10291000F7F08013E54975F008A42408F582E43443 | ||
659 | :10292000FFF583E054F7F07C00123076228000023D | ||
660 | :102930002CBCE56D20E706E57245716003022CBCF6 | ||
661 | :1029400090FF00E0541FB400028003D3401AE54C0E | ||
662 | :1029500014454B7004E54A6003022A0F78ADE64443 | ||
663 | :1029600001F67C0012307622B401028003D34029A4 | ||
664 | :10297000E56D20E108E56D20E003022A0FE56D30EA | ||
665 | :10298000E004E549700BE56D30E108E54924FE50AF | ||
666 | :1029900002807F7C0012307622B402028003D34092 | ||
667 | :1029A0006FE54C454B60028069AC4A1230FD400235 | ||
668 | :1029B0008060E56D20E107E56D20E0028054E54987 | ||
669 | :1029C000701430020990FF80E04408F0800790FF07 | ||
670 | :1029D00082E04408F022E56D30E1331549300215FC | ||
671 | :1029E000E54975F008A42448F582E434FFF583E056 | ||
672 | :1029F0004408F08013E54975F008A42408F582E442 | ||
673 | :102A000034FFF583E04408F07C0012307622800227 | ||
674 | :102A10008000022CBCE56D20E712E5724571700C58 | ||
675 | :102A2000E54A700890FF00E0541F6003022CBCE5EB | ||
676 | :102A30004C90FFFFF090FFFFE06005436D018003C5 | ||
677 | :102A4000536DFE7C0012307622E56D30E70EE572A4 | ||
678 | :102A50004571600890FF00E0541F6003022CBCAD7C | ||
679 | :102A60004BE54CED7D00FC7D00FCBD0002800302C7 | ||
680 | :102A70002BA8B401028003D34032E54A7005E54C2F | ||
681 | :102A8000FC6003022BAA756A407569F8756801D36A | ||
682 | :102A9000E5729412E57194004006E4FD7C12800416 | ||
683 | :102AA000AC72AD718C708D6F12308B22B4020280CB | ||
684 | :102AB00003D34059E54A6003022BAAE54CFC70277A | ||
685 | :102AC000756A527569F8756801D3E5729419E571F4 | ||
686 | :102AD00094004006E4FD7C198004AC72AD718C70EA | ||
687 | :102AE0008D6F12308B8025756A6B7569F87568017A | ||
688 | :102AF000D3E5729427E57194004006E4FD7C2780BD | ||
689 | :102B000004AC72AD718C708D6F12308B22B40302E5 | ||
690 | :102B10008006D35003022BA8E54CF549700F90FFB7 | ||
691 | :102B200004E0FDA3E04D6003022BAA801890FB0295 | ||
692 | :102B3000E0FDA3E0FC90FF05E06C700790FF04E06F | ||
693 | :102B40006D60028068E4F570F56F7F00E54914C59B | ||
694 | :102B500049600FEF2400F582E434FBF583E02FFF9A | ||
695 | :102B600080EA8F4AE54A2400F582E434FBF583E0ED | ||
696 | :102B70007D00D39572ED95714006AC72AD71800FFA | ||
697 | :102B8000E54A2400F582E434FBF583E07D00FC8C0B | ||
698 | :102B9000708D6FE54A2400FCE434FBFDFEECFD7F04 | ||
699 | :102BA000018D6A8E698F6812308B228000022CBCE6 | ||
700 | :102BB000022CBCE56D30E719E5721445717012E521 | ||
701 | :102BC0004A700EE54C454B700890FF00E0541F60C2 | ||
702 | :102BD00003022CBCE56D20E008E56D20E103022C2A | ||
703 | :102BE000BC756A6EE4F569F568E4F56F04F570127A | ||
704 | :102BF000308B22E56D20E727E57245717021E54AAB | ||
705 | :102C0000701DE54C6402454B600DE54C14454B606E | ||
706 | :102C100006E54C454B700890FF00E0541F6003022E | ||
707 | :102C20002CBCE56D20E008E56D20E103022CBC859D | ||
708 | :102C30004C6EE56E700A436D01536DFDD2B080207D | ||
709 | :102C4000E56E64026007E56E1460028072536DFEEB | ||
710 | :102C5000436D02E56E64026005E56E147002C2B059 | ||
711 | :102C60007C0012307622E56D30E71AE5721445716A | ||
712 | :102C70007013E54A700FE54C454B700990FF00E07A | ||
713 | :102C8000541F1460028038E56D20E10280317C0120 | ||
714 | :102C900012307622E56D20E715E5724571700FE57B | ||
715 | :102CA0004C454B700990FF00E0541F146002800FE8 | ||
716 | :102CB000E56D20E10280087C00123076228000025F | ||
717 | :102CC0002F7DB440028006D35003022F7390FF0182 | ||
718 | :102CD000E090FC35F0E54A90FC36F0E490FC37F0EB | ||
719 | :102CE000E56A2403F56AE5693400F569AD4BE54C06 | ||
720 | :102CF000856A82856983CDF0A3CDF090FF01E01253 | ||
721 | :102D000001C02D2A012D50022D7A032DA4042DF28D | ||
722 | :102D1000052E2F062E55072E7B082EA7092ECD0B2C | ||
723 | :102D20002EF30C2F02802F028100002F60E56D2012 | ||
724 | :102D3000E7067C051225DF227D767E357F02793815 | ||
725 | :102D40007AFC7B01740878001203487D087C00122D | ||
726 | :102D5000254622E56D20E7067C051225DF22E54A9F | ||
727 | :102D6000B403004010B40500500BE54A7F00FE7C20 | ||
728 | :102D70001012324D227D007C0712254622E56D207F | ||
729 | :102D8000E7067C051225DF22E54AB403004010B4B3 | ||
730 | :102D90000500500BE54A7F00FE7C1112324D227D6A | ||
731 | :102DA000007C0712254622E56D20E7067C051225EA | ||
732 | :102DB000DF22E54AB405028003D3400AE4FF04FEA3 | ||
733 | :102DC0007C0A12324D22B401028003D3400AE4FF90 | ||
734 | :102DD00004FE7C0812324D22B403004010B40500FA | ||
735 | :102DE000500BE54A7F00FE7C1312324D227D007CA1 | ||
736 | :102DF0000712254622E56D20E734D3E5729448E5B5 | ||
737 | :102E00007194005006E572457170067C021225DF50 | ||
738 | :102E100022E54AB40103B3400BC3B403004009B434 | ||
739 | :102E200006005004123123227C071225DF221225CE | ||
740 | :102E30007D22E56D20E71DE54AB403004010B4058E | ||
741 | :102E400000500BE54A7F00FE7C1612324D227C07B3 | ||
742 | :102E50001225DF2212257D22E56D20E71DE54AB40B | ||
743 | :102E600003004010B40500500BE54A7F00FE7C19BA | ||
744 | :102E700012324D227C071225DF2212257D22E56DBC | ||
745 | :102E800020E723748190FF93F0E54AB403004010DB | ||
746 | :102E9000B40500500BE54A7F00FE7C1712324D222C | ||
747 | :102EA0007C071225DF2212257D22E56D20E71DE536 | ||
748 | :102EB0004AB403004010B40500500BE54A7F00FE01 | ||
749 | :102EC0007C1812324D227C071225DF2212257D222A | ||
750 | :102ED000E56D20E71DE54AB403004010B40500503D | ||
751 | :102EE0000BE54A7F00FE7C1512324D227C0712252D | ||
752 | :102EF000DF2212257D22E56D20E7067C071225DF03 | ||
753 | :102F00002212257D22E56D30E72090FF00E0541F5E | ||
754 | :102F1000701090FF01E0B480051225748003122523 | ||
755 | :102F20007D227D007C051225462290FF00E0541F83 | ||
756 | :102F300060067C051225DF22D3E5729448E5719482 | ||
757 | :102F400000500BC3E5729407E571940050067C03B2 | ||
758 | :102F50001225DF22E54AB40504123123227C071230 | ||
759 | :102F600025DF22E56D30E7087D007C05122546222D | ||
760 | :102F70007C051225DF22B420028003D340008000AC | ||
761 | :102F80001230512275430090FF83E0540FD39543D4 | ||
762 | :102F90004024E54324F0F582E434FEF583E0AD6A95 | ||
763 | :102FA000AE69AF6812031805430DED70010E8D6A0E | ||
764 | :102FB0008E698F6880D1E5437D00FCC3E5709CF588 | ||
765 | :102FC00070E56F9DF56FE570456F6006E490FF83D7 | ||
766 | :102FD000F02290FF82E04408F0E4F56F75704990AC | ||
767 | :102FE000FC35E0B405028003D3404090FC36E0F5A8 | ||
768 | :102FF00043B405028003D3400AE4FF04FE7C0B12B5 | ||
769 | :10300000324D22B401028003D3400AE4FF04FE7C67 | ||
770 | :103010000912324D22B403004010B40500500BE5F4 | ||
771 | :10302000437F00FE7C1412324D2222B480004023E4 | ||
772 | :10303000B48200501E7C357DFC1217A57D008C6C7F | ||
773 | :103040008D6B90FC37E0600512305180057C0012DA | ||
774 | :103050003076222290FF83E0547FF090FF82E0449C | ||
775 | :1030600008F090FF80E04408F02290FF82E04408DE | ||
776 | :10307000F090FF80E04408F0228C237D008C708D5E | ||
777 | :103080006F756A357569FC75680112308B2290FF87 | ||
778 | :1030900083E0547FF0E5706449456F700122C3E519 | ||
779 | :1030A000709408E56F94004015752108E5217D00B6 | ||
780 | :1030B000FCC3E5709CF570E56F9DF56F8009857028 | ||
781 | :1030C00021E4F56F757049752200E522C395215002 | ||
782 | :1030D00026AD6AAE69AF681201EFFCE52224F8F56F | ||
783 | :1030E00082E434FEF583ECF005220DED70010E8DC7 | ||
784 | :1030F0006A8E698F6880D3E521547F90FF81F0222A | ||
785 | :103100008C487F00EF24FD4019E4EF75F007A424FC | ||
786 | :103110007FF582E434F8F583E065487002D3220F2E | ||
787 | :1031200080E28F47C32285727085716F90FF82E0C5 | ||
788 | :1031300054F7F090FF83E0547FF022C000C001C03C | ||
789 | :1031400002C006C007E5782408F8860653067F7C8F | ||
790 | :10315000FF1231AD7C007D00E57B6046FF90FD9560 | ||
791 | :10316000E0547F6E700FC083C082A3E0FDA3E0FC3B | ||
792 | :10317000A3157B8007A3A3A3DFE68026DF06D0820A | ||
793 | :10318000D083801EE0F8A3E0F9A3E0FAD082D083D8 | ||
794 | :10319000E8F0A3E9F0A3EAF0A3C083C082A3A3A34D | ||
795 | :1031A00080DA123246D007D006D002D001D00022F9 | ||
796 | :1031B00085A87A75A888EC70027C3F8C7922E57826 | ||
797 | :1031C0002408F8760012329A80FBC000C001C002C9 | ||
798 | :1031D000C006C007AE047CFF1231ADE57B6042FF44 | ||
799 | :1031E00090FD95E0547F6E700BC083C082A3A3A3B3 | ||
800 | :1031F000157B8007A3A3A3DFEA8026DF06D082D059 | ||
801 | :103200008380D8E0F8A3E0F9A3E0FAD082D083E885 | ||
802 | :10321000F0A3E9F0A3EAF0A3C083C082A3A3A38034 | ||
803 | :10322000DA7808087918097C01E6547F6E70067612 | ||
804 | :10323000007700800608090CBC08EE123246D00761 | ||
805 | :10324000D006D002D001D00022757900857AA8225C | ||
806 | :10325000C0F0C082C083C3E57B24E8500512329AD7 | ||
807 | :1032600080F4EC6031903575E493C39C4028C00431 | ||
808 | :103270007CFF1231ADD004430480E57B75F003A4DC | ||
809 | :103280002495F582E434FDF583ECF0EFA3F0EEA392 | ||
810 | :10329000F0057B123246D083D082D0F022C0047C6D | ||
811 | :1032A00020D28CD28DD504FDD0042275A80075885B | ||
812 | :1032B0000075B80075F00075D000E4F8900000F6D5 | ||
813 | :1032C00008B800FB020000C3ED940250047D037CAB | ||
814 | :1032D000E8ECF4FCEDF4FD0CBC00010D8C7F8D7E60 | ||
815 | :1032E00022C3EC94BCED940250047D077CD0ECF436 | ||
816 | :1032F000FCEDF4FD0CBC00010D8C7D8D7C22EC708E | ||
817 | :103300000122C000E5782418F8A604E5782408F81E | ||
818 | :10331000C6547FF6E630E703D0002212329A80F4DA | ||
819 | :10332000C28C857C8C857D8AD28CC0E0C0D0C0F0F8 | ||
820 | :10333000C082C083C000C001C002C003C004C00579 | ||
821 | :10334000C006C007121AF8E5782408F8E66024E5FC | ||
822 | :10335000782410F8A681E57875F021A4248DF582F3 | ||
823 | :10336000E434FCF58378AEE58104C398F9E6F0080F | ||
824 | :10337000A3D9FA74082578F8057808E65480700C0B | ||
825 | :10338000E578B407F3780875780080EFE5782410C5 | ||
826 | :10339000F88681E57875F021A4248DF582E434FC6B | ||
827 | :1033A000F58378AEE58104C398F9E0F608A3D9FA6D | ||
828 | :1033B000D007D006D005D004D003D002D001D00071 | ||
829 | :1033C000D083D082D0F0D0D0D0E032C0E0C0D0C026 | ||
830 | :1033D00000C001C002C28E857E8D857F8BD28E7823 | ||
831 | :1033E0001979097A07E77004A600800BE6600816D1 | ||
832 | :1033F000E67004E74480F70809DAEAE57960131417 | ||
833 | :10340000F579700EE5782408F87600123246D28CF1 | ||
834 | :10341000D28DD002D001D000D0D0D0E0327581ADB5 | ||
835 | :10342000742A90FF93F0757F30757EF8757D607516 | ||
836 | :103430007CF012053F1234CE12175B90FF93E044EC | ||
837 | :1034400001F0B2B31234F81232A880DA22C0007C44 | ||
838 | :1034500001EC2408F8E660090CBC08F512329A80E9 | ||
839 | :10346000EED00022C0F0C082C083C000C006C007FA | ||
840 | :10347000ED2410F876BCED75F021A4248DF582E4DE | ||
841 | :1034800034FCF583C082C083A3A3E4780DF0A3D8F5 | ||
842 | :10349000FCEC547F75F002A42441F582E5F034354C | ||
843 | :1034A000F583E493FE740193F5828E83E493FE74B6 | ||
844 | :1034B0000193FFD083D082EFF0A3EEF0ED2408F863 | ||
845 | :1034C000EC4480F6D007D006D000D083D082D0F074 | ||
846 | :1034D00022757800757B007A08791878087600776D | ||
847 | :1034E000000809DAF8E478087480447FF67401442F | ||
848 | :1034F00010F58975B808D2ABD2A9227581ADD28EEC | ||
849 | :10350000D28CD2AFE57B6032FF90FD95E0548060B5 | ||
850 | :103510002478087908E0547FFA7B00E6547FB502EE | ||
851 | :10352000027BFF08D9F5EB700CEAF012344AAD04C7 | ||
852 | :10353000AC02123461A3A3A3DFD212329A80C57CFD | ||
853 | :10354000017D002204FE04F204F604EA04E604E22B | ||
854 | :1035500004EE04FA04A604AA04D604DA04A204A21F | ||
855 | :1035600004A204DE04BE04B604BA04B204CA04C64B | ||
856 | :1035700004C204CE04D204AE1901030022004802A2 | ||
857 | :1035800000480E301420C81AD0180A0C0506020391 | ||
858 | :1035900001020001CE0181010000C0008000600036 | ||
859 | :1035A0003000180010000800040002000100081894 | ||
860 | :1035B00028380C05100A0200000000000301100A60 | ||
861 | :1035C000020000000000FBE0FBF2090227000102FC | ||
862 | :1035D00000A0FA0904000003FF00000007058102B3 | ||
863 | :1035E00040000007050102400000070583030200B8 | ||
864 | :1035F00001220354005500530042003300340031CF | ||
865 | :1036000000300020002000200020002000200020AA | ||
866 | :073610000020000000000093 | ||
867 | :00000001FF | ||
@@ -1270,7 +1270,7 @@ static void io_destroy(struct kioctx *ioctx) | |||
1270 | * pointer is passed for ctxp. Will fail with -ENOSYS if not | 1270 | * pointer is passed for ctxp. Will fail with -ENOSYS if not |
1271 | * implemented. | 1271 | * implemented. |
1272 | */ | 1272 | */ |
1273 | asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t __user *ctxp) | 1273 | SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) |
1274 | { | 1274 | { |
1275 | struct kioctx *ioctx = NULL; | 1275 | struct kioctx *ioctx = NULL; |
1276 | unsigned long ctx; | 1276 | unsigned long ctx; |
@@ -1308,7 +1308,7 @@ out: | |||
1308 | * implemented. May fail with -EFAULT if the context pointed to | 1308 | * implemented. May fail with -EFAULT if the context pointed to |
1309 | * is invalid. | 1309 | * is invalid. |
1310 | */ | 1310 | */ |
1311 | asmlinkage long sys_io_destroy(aio_context_t ctx) | 1311 | SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx) |
1312 | { | 1312 | { |
1313 | struct kioctx *ioctx = lookup_ioctx(ctx); | 1313 | struct kioctx *ioctx = lookup_ioctx(ctx); |
1314 | if (likely(NULL != ioctx)) { | 1314 | if (likely(NULL != ioctx)) { |
@@ -1662,8 +1662,8 @@ out_put_req: | |||
1662 | * are available to queue any iocbs. Will return 0 if nr is 0. Will | 1662 | * are available to queue any iocbs. Will return 0 if nr is 0. Will |
1663 | * fail with -ENOSYS if not implemented. | 1663 | * fail with -ENOSYS if not implemented. |
1664 | */ | 1664 | */ |
1665 | asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr, | 1665 | SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, long, nr, |
1666 | struct iocb __user * __user *iocbpp) | 1666 | struct iocb __user * __user *, iocbpp) |
1667 | { | 1667 | { |
1668 | struct kioctx *ctx; | 1668 | struct kioctx *ctx; |
1669 | long ret = 0; | 1669 | long ret = 0; |
@@ -1737,8 +1737,8 @@ static struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, | |||
1737 | * invalid. May fail with -EAGAIN if the iocb specified was not | 1737 | * invalid. May fail with -EAGAIN if the iocb specified was not |
1738 | * cancelled. Will fail with -ENOSYS if not implemented. | 1738 | * cancelled. Will fail with -ENOSYS if not implemented. |
1739 | */ | 1739 | */ |
1740 | asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | 1740 | SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, |
1741 | struct io_event __user *result) | 1741 | struct io_event __user *, result) |
1742 | { | 1742 | { |
1743 | int (*cancel)(struct kiocb *iocb, struct io_event *res); | 1743 | int (*cancel)(struct kiocb *iocb, struct io_event *res); |
1744 | struct kioctx *ctx; | 1744 | struct kioctx *ctx; |
@@ -1799,11 +1799,11 @@ asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | |||
1799 | * will be updated if not NULL and the operation blocks. Will fail | 1799 | * will be updated if not NULL and the operation blocks. Will fail |
1800 | * with -ENOSYS if not implemented. | 1800 | * with -ENOSYS if not implemented. |
1801 | */ | 1801 | */ |
1802 | asmlinkage long sys_io_getevents(aio_context_t ctx_id, | 1802 | SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id, |
1803 | long min_nr, | 1803 | long, min_nr, |
1804 | long nr, | 1804 | long, nr, |
1805 | struct io_event __user *events, | 1805 | struct io_event __user *, events, |
1806 | struct timespec __user *timeout) | 1806 | struct timespec __user *, timeout) |
1807 | { | 1807 | { |
1808 | struct kioctx *ioctx = lookup_ioctx(ctx_id); | 1808 | struct kioctx *ioctx = lookup_ioctx(ctx_id); |
1809 | long ret = -EINVAL; | 1809 | long ret = -EINVAL; |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 0a14b495532f..7256cf242eb0 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/namei.h> | 38 | #include <linux/namei.h> |
39 | #include <linux/miscdevice.h> | 39 | #include <linux/miscdevice.h> |
40 | #include <linux/version.h> | 40 | #include <linux/version.h> |
41 | #include <linux/magic.h> | ||
41 | #include "compat.h" | 42 | #include "compat.h" |
42 | #include "ctree.h" | 43 | #include "ctree.h" |
43 | #include "disk-io.h" | 44 | #include "disk-io.h" |
@@ -51,7 +52,6 @@ | |||
51 | #include "export.h" | 52 | #include "export.h" |
52 | #include "compression.h" | 53 | #include "compression.h" |
53 | 54 | ||
54 | #define BTRFS_SUPER_MAGIC 0x9123683E | ||
55 | 55 | ||
56 | static struct super_operations btrfs_super_ops; | 56 | static struct super_operations btrfs_super_ops; |
57 | 57 | ||
diff --git a/fs/buffer.c b/fs/buffer.c index b6e8b8632e2f..b58208f1640a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -3243,7 +3243,7 @@ void block_sync_page(struct page *page) | |||
3243 | * Use of bdflush() is deprecated and will be removed in a future kernel. | 3243 | * Use of bdflush() is deprecated and will be removed in a future kernel. |
3244 | * The `pdflush' kernel threads fully replace bdflush daemons and this call. | 3244 | * The `pdflush' kernel threads fully replace bdflush daemons and this call. |
3245 | */ | 3245 | */ |
3246 | asmlinkage long sys_bdflush(int func, long data) | 3246 | SYSCALL_DEFINE2(bdflush, int, func, long, data) |
3247 | { | 3247 | { |
3248 | static int msg_count; | 3248 | static int msg_count; |
3249 | 3249 | ||
diff --git a/fs/compat.c b/fs/compat.c index 30f2faa22f5c..65a070e705ab 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1709,7 +1709,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |||
1709 | } | 1709 | } |
1710 | 1710 | ||
1711 | #ifdef HAVE_SET_RESTORE_SIGMASK | 1711 | #ifdef HAVE_SET_RESTORE_SIGMASK |
1712 | asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, | 1712 | static long do_compat_pselect(int n, compat_ulong_t __user *inp, |
1713 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 1713 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
1714 | struct compat_timespec __user *tsp, compat_sigset_t __user *sigmask, | 1714 | struct compat_timespec __user *tsp, compat_sigset_t __user *sigmask, |
1715 | compat_size_t sigsetsize) | 1715 | compat_size_t sigsetsize) |
@@ -1775,8 +1775,8 @@ asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, | |||
1775 | (compat_size_t __user *)(sig+sizeof(up)))) | 1775 | (compat_size_t __user *)(sig+sizeof(up)))) |
1776 | return -EFAULT; | 1776 | return -EFAULT; |
1777 | } | 1777 | } |
1778 | return compat_sys_pselect7(n, inp, outp, exp, tsp, compat_ptr(up), | 1778 | return do_compat_pselect(n, inp, outp, exp, tsp, compat_ptr(up), |
1779 | sigsetsize); | 1779 | sigsetsize); |
1780 | } | 1780 | } |
1781 | 1781 | ||
1782 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, | 1782 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, |
diff --git a/fs/dcache.c b/fs/dcache.c index 4547f66884a0..937df0fb0da5 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -2092,7 +2092,7 @@ Elong: | |||
2092 | * return NULL; | 2092 | * return NULL; |
2093 | * } | 2093 | * } |
2094 | */ | 2094 | */ |
2095 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size) | 2095 | SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size) |
2096 | { | 2096 | { |
2097 | int error; | 2097 | int error; |
2098 | struct path pwd, root; | 2098 | struct path pwd, root; |
diff --git a/fs/dcookies.c b/fs/dcookies.c index 180e9fec4ad8..a21cabdbd87b 100644 --- a/fs/dcookies.c +++ b/fs/dcookies.c | |||
@@ -145,7 +145,7 @@ out: | |||
145 | /* And here is where the userspace process can look up the cookie value | 145 | /* And here is where the userspace process can look up the cookie value |
146 | * to retrieve the path. | 146 | * to retrieve the path. |
147 | */ | 147 | */ |
148 | asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user * buf, size_t len) | 148 | SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) |
149 | { | 149 | { |
150 | unsigned long cookie = (unsigned long)cookie64; | 150 | unsigned long cookie = (unsigned long)cookie64; |
151 | int err = -EINVAL; | 151 | int err = -EINVAL; |
@@ -198,7 +198,13 @@ out: | |||
198 | mutex_unlock(&dcookie_mutex); | 198 | mutex_unlock(&dcookie_mutex); |
199 | return err; | 199 | return err; |
200 | } | 200 | } |
201 | 201 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | |
202 | asmlinkage long SyS_lookup_dcookie(u64 cookie64, long buf, long len) | ||
203 | { | ||
204 | return SYSC_lookup_dcookie(cookie64, (char __user *) buf, (size_t) len); | ||
205 | } | ||
206 | SYSCALL_ALIAS(sys_lookup_dcookie, SyS_lookup_dcookie); | ||
207 | #endif | ||
202 | 208 | ||
203 | static int dcookie_init(void) | 209 | static int dcookie_init(void) |
204 | { | 210 | { |
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index 2f107d1a6a45..1d1d27442235 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | ******************************************************************************* | 2 | ******************************************************************************* |
3 | ** | 3 | ** |
4 | ** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved. | 4 | ** Copyright (C) 2005-2009 Red Hat, Inc. All rights reserved. |
5 | ** | 5 | ** |
6 | ** This copyrighted material is made available to anyone wishing to use, | 6 | ** This copyrighted material is made available to anyone wishing to use, |
7 | ** modify, copy, or redistribute it subject to the terms and conditions | 7 | ** modify, copy, or redistribute it subject to the terms and conditions |
@@ -25,19 +25,6 @@ static struct mutex debug_buf_lock; | |||
25 | 25 | ||
26 | static struct dentry *dlm_root; | 26 | static struct dentry *dlm_root; |
27 | 27 | ||
28 | struct rsb_iter { | ||
29 | int entry; | ||
30 | int format; | ||
31 | int header; | ||
32 | struct dlm_ls *ls; | ||
33 | struct list_head *next; | ||
34 | struct dlm_rsb *rsb; | ||
35 | }; | ||
36 | |||
37 | /* | ||
38 | * dump all rsb's in the lockspace hash table | ||
39 | */ | ||
40 | |||
41 | static char *print_lockmode(int mode) | 28 | static char *print_lockmode(int mode) |
42 | { | 29 | { |
43 | switch (mode) { | 30 | switch (mode) { |
@@ -60,13 +47,13 @@ static char *print_lockmode(int mode) | |||
60 | } | 47 | } |
61 | } | 48 | } |
62 | 49 | ||
63 | static void print_format1_lock(struct seq_file *s, struct dlm_lkb *lkb, | 50 | static int print_format1_lock(struct seq_file *s, struct dlm_lkb *lkb, |
64 | struct dlm_rsb *res) | 51 | struct dlm_rsb *res) |
65 | { | 52 | { |
66 | seq_printf(s, "%08x %s", lkb->lkb_id, print_lockmode(lkb->lkb_grmode)); | 53 | seq_printf(s, "%08x %s", lkb->lkb_id, print_lockmode(lkb->lkb_grmode)); |
67 | 54 | ||
68 | if (lkb->lkb_status == DLM_LKSTS_CONVERT | 55 | if (lkb->lkb_status == DLM_LKSTS_CONVERT || |
69 | || lkb->lkb_status == DLM_LKSTS_WAITING) | 56 | lkb->lkb_status == DLM_LKSTS_WAITING) |
70 | seq_printf(s, " (%s)", print_lockmode(lkb->lkb_rqmode)); | 57 | seq_printf(s, " (%s)", print_lockmode(lkb->lkb_rqmode)); |
71 | 58 | ||
72 | if (lkb->lkb_nodeid) { | 59 | if (lkb->lkb_nodeid) { |
@@ -80,33 +67,42 @@ static void print_format1_lock(struct seq_file *s, struct dlm_lkb *lkb, | |||
80 | if (lkb->lkb_wait_type) | 67 | if (lkb->lkb_wait_type) |
81 | seq_printf(s, " wait_type: %d", lkb->lkb_wait_type); | 68 | seq_printf(s, " wait_type: %d", lkb->lkb_wait_type); |
82 | 69 | ||
83 | seq_printf(s, "\n"); | 70 | return seq_printf(s, "\n"); |
84 | } | 71 | } |
85 | 72 | ||
86 | static int print_format1(struct dlm_rsb *res, struct seq_file *s) | 73 | static int print_format1(struct dlm_rsb *res, struct seq_file *s) |
87 | { | 74 | { |
88 | struct dlm_lkb *lkb; | 75 | struct dlm_lkb *lkb; |
89 | int i, lvblen = res->res_ls->ls_lvblen, recover_list, root_list; | 76 | int i, lvblen = res->res_ls->ls_lvblen, recover_list, root_list; |
77 | int rv; | ||
90 | 78 | ||
91 | lock_rsb(res); | 79 | lock_rsb(res); |
92 | 80 | ||
93 | seq_printf(s, "\nResource %p Name (len=%d) \"", res, res->res_length); | 81 | rv = seq_printf(s, "\nResource %p Name (len=%d) \"", |
82 | res, res->res_length); | ||
83 | if (rv) | ||
84 | goto out; | ||
85 | |||
94 | for (i = 0; i < res->res_length; i++) { | 86 | for (i = 0; i < res->res_length; i++) { |
95 | if (isprint(res->res_name[i])) | 87 | if (isprint(res->res_name[i])) |
96 | seq_printf(s, "%c", res->res_name[i]); | 88 | seq_printf(s, "%c", res->res_name[i]); |
97 | else | 89 | else |
98 | seq_printf(s, "%c", '.'); | 90 | seq_printf(s, "%c", '.'); |
99 | } | 91 | } |
92 | |||
100 | if (res->res_nodeid > 0) | 93 | if (res->res_nodeid > 0) |
101 | seq_printf(s, "\" \nLocal Copy, Master is node %d\n", | 94 | rv = seq_printf(s, "\" \nLocal Copy, Master is node %d\n", |
102 | res->res_nodeid); | 95 | res->res_nodeid); |
103 | else if (res->res_nodeid == 0) | 96 | else if (res->res_nodeid == 0) |
104 | seq_printf(s, "\" \nMaster Copy\n"); | 97 | rv = seq_printf(s, "\" \nMaster Copy\n"); |
105 | else if (res->res_nodeid == -1) | 98 | else if (res->res_nodeid == -1) |
106 | seq_printf(s, "\" \nLooking up master (lkid %x)\n", | 99 | rv = seq_printf(s, "\" \nLooking up master (lkid %x)\n", |
107 | res->res_first_lkid); | 100 | res->res_first_lkid); |
108 | else | 101 | else |
109 | seq_printf(s, "\" \nInvalid master %d\n", res->res_nodeid); | 102 | rv = seq_printf(s, "\" \nInvalid master %d\n", |
103 | res->res_nodeid); | ||
104 | if (rv) | ||
105 | goto out; | ||
110 | 106 | ||
111 | /* Print the LVB: */ | 107 | /* Print the LVB: */ |
112 | if (res->res_lvbptr) { | 108 | if (res->res_lvbptr) { |
@@ -119,52 +115,66 @@ static int print_format1(struct dlm_rsb *res, struct seq_file *s) | |||
119 | } | 115 | } |
120 | if (rsb_flag(res, RSB_VALNOTVALID)) | 116 | if (rsb_flag(res, RSB_VALNOTVALID)) |
121 | seq_printf(s, " (INVALID)"); | 117 | seq_printf(s, " (INVALID)"); |
122 | seq_printf(s, "\n"); | 118 | rv = seq_printf(s, "\n"); |
119 | if (rv) | ||
120 | goto out; | ||
123 | } | 121 | } |
124 | 122 | ||
125 | root_list = !list_empty(&res->res_root_list); | 123 | root_list = !list_empty(&res->res_root_list); |
126 | recover_list = !list_empty(&res->res_recover_list); | 124 | recover_list = !list_empty(&res->res_recover_list); |
127 | 125 | ||
128 | if (root_list || recover_list) { | 126 | if (root_list || recover_list) { |
129 | seq_printf(s, "Recovery: root %d recover %d flags %lx " | 127 | rv = seq_printf(s, "Recovery: root %d recover %d flags %lx " |
130 | "count %d\n", root_list, recover_list, | 128 | "count %d\n", root_list, recover_list, |
131 | res->res_flags, res->res_recover_locks_count); | 129 | res->res_flags, res->res_recover_locks_count); |
130 | if (rv) | ||
131 | goto out; | ||
132 | } | 132 | } |
133 | 133 | ||
134 | /* Print the locks attached to this resource */ | 134 | /* Print the locks attached to this resource */ |
135 | seq_printf(s, "Granted Queue\n"); | 135 | seq_printf(s, "Granted Queue\n"); |
136 | list_for_each_entry(lkb, &res->res_grantqueue, lkb_statequeue) | 136 | list_for_each_entry(lkb, &res->res_grantqueue, lkb_statequeue) { |
137 | print_format1_lock(s, lkb, res); | 137 | rv = print_format1_lock(s, lkb, res); |
138 | if (rv) | ||
139 | goto out; | ||
140 | } | ||
138 | 141 | ||
139 | seq_printf(s, "Conversion Queue\n"); | 142 | seq_printf(s, "Conversion Queue\n"); |
140 | list_for_each_entry(lkb, &res->res_convertqueue, lkb_statequeue) | 143 | list_for_each_entry(lkb, &res->res_convertqueue, lkb_statequeue) { |
141 | print_format1_lock(s, lkb, res); | 144 | rv = print_format1_lock(s, lkb, res); |
145 | if (rv) | ||
146 | goto out; | ||
147 | } | ||
142 | 148 | ||
143 | seq_printf(s, "Waiting Queue\n"); | 149 | seq_printf(s, "Waiting Queue\n"); |
144 | list_for_each_entry(lkb, &res->res_waitqueue, lkb_statequeue) | 150 | list_for_each_entry(lkb, &res->res_waitqueue, lkb_statequeue) { |
145 | print_format1_lock(s, lkb, res); | 151 | rv = print_format1_lock(s, lkb, res); |
152 | if (rv) | ||
153 | goto out; | ||
154 | } | ||
146 | 155 | ||
147 | if (list_empty(&res->res_lookup)) | 156 | if (list_empty(&res->res_lookup)) |
148 | goto out; | 157 | goto out; |
149 | 158 | ||
150 | seq_printf(s, "Lookup Queue\n"); | 159 | seq_printf(s, "Lookup Queue\n"); |
151 | list_for_each_entry(lkb, &res->res_lookup, lkb_rsb_lookup) { | 160 | list_for_each_entry(lkb, &res->res_lookup, lkb_rsb_lookup) { |
152 | seq_printf(s, "%08x %s", lkb->lkb_id, | 161 | rv = seq_printf(s, "%08x %s", lkb->lkb_id, |
153 | print_lockmode(lkb->lkb_rqmode)); | 162 | print_lockmode(lkb->lkb_rqmode)); |
154 | if (lkb->lkb_wait_type) | 163 | if (lkb->lkb_wait_type) |
155 | seq_printf(s, " wait_type: %d", lkb->lkb_wait_type); | 164 | seq_printf(s, " wait_type: %d", lkb->lkb_wait_type); |
156 | seq_printf(s, "\n"); | 165 | rv = seq_printf(s, "\n"); |
157 | } | 166 | } |
158 | out: | 167 | out: |
159 | unlock_rsb(res); | 168 | unlock_rsb(res); |
160 | return 0; | 169 | return rv; |
161 | } | 170 | } |
162 | 171 | ||
163 | static void print_format2_lock(struct seq_file *s, struct dlm_lkb *lkb, | 172 | static int print_format2_lock(struct seq_file *s, struct dlm_lkb *lkb, |
164 | struct dlm_rsb *r) | 173 | struct dlm_rsb *r) |
165 | { | 174 | { |
166 | u64 xid = 0; | 175 | u64 xid = 0; |
167 | u64 us; | 176 | u64 us; |
177 | int rv; | ||
168 | 178 | ||
169 | if (lkb->lkb_flags & DLM_IFL_USER) { | 179 | if (lkb->lkb_flags & DLM_IFL_USER) { |
170 | if (lkb->lkb_ua) | 180 | if (lkb->lkb_ua) |
@@ -177,69 +187,82 @@ static void print_format2_lock(struct seq_file *s, struct dlm_lkb *lkb, | |||
177 | /* id nodeid remid pid xid exflags flags sts grmode rqmode time_us | 187 | /* id nodeid remid pid xid exflags flags sts grmode rqmode time_us |
178 | r_nodeid r_len r_name */ | 188 | r_nodeid r_len r_name */ |
179 | 189 | ||
180 | seq_printf(s, "%x %d %x %u %llu %x %x %d %d %d %llu %u %d \"%s\"\n", | 190 | rv = seq_printf(s, "%x %d %x %u %llu %x %x %d %d %d %llu %u %d \"%s\"\n", |
181 | lkb->lkb_id, | 191 | lkb->lkb_id, |
182 | lkb->lkb_nodeid, | 192 | lkb->lkb_nodeid, |
183 | lkb->lkb_remid, | 193 | lkb->lkb_remid, |
184 | lkb->lkb_ownpid, | 194 | lkb->lkb_ownpid, |
185 | (unsigned long long)xid, | 195 | (unsigned long long)xid, |
186 | lkb->lkb_exflags, | 196 | lkb->lkb_exflags, |
187 | lkb->lkb_flags, | 197 | lkb->lkb_flags, |
188 | lkb->lkb_status, | 198 | lkb->lkb_status, |
189 | lkb->lkb_grmode, | 199 | lkb->lkb_grmode, |
190 | lkb->lkb_rqmode, | 200 | lkb->lkb_rqmode, |
191 | (unsigned long long)us, | 201 | (unsigned long long)us, |
192 | r->res_nodeid, | 202 | r->res_nodeid, |
193 | r->res_length, | 203 | r->res_length, |
194 | r->res_name); | 204 | r->res_name); |
205 | return rv; | ||
195 | } | 206 | } |
196 | 207 | ||
197 | static int print_format2(struct dlm_rsb *r, struct seq_file *s) | 208 | static int print_format2(struct dlm_rsb *r, struct seq_file *s) |
198 | { | 209 | { |
199 | struct dlm_lkb *lkb; | 210 | struct dlm_lkb *lkb; |
211 | int rv = 0; | ||
200 | 212 | ||
201 | lock_rsb(r); | 213 | lock_rsb(r); |
202 | 214 | ||
203 | list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue) | 215 | list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue) { |
204 | print_format2_lock(s, lkb, r); | 216 | rv = print_format2_lock(s, lkb, r); |
205 | 217 | if (rv) | |
206 | list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue) | 218 | goto out; |
207 | print_format2_lock(s, lkb, r); | 219 | } |
208 | 220 | ||
209 | list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue) | 221 | list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue) { |
210 | print_format2_lock(s, lkb, r); | 222 | rv = print_format2_lock(s, lkb, r); |
223 | if (rv) | ||
224 | goto out; | ||
225 | } | ||
211 | 226 | ||
227 | list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue) { | ||
228 | rv = print_format2_lock(s, lkb, r); | ||
229 | if (rv) | ||
230 | goto out; | ||
231 | } | ||
232 | out: | ||
212 | unlock_rsb(r); | 233 | unlock_rsb(r); |
213 | return 0; | 234 | return rv; |
214 | } | 235 | } |
215 | 236 | ||
216 | static void print_format3_lock(struct seq_file *s, struct dlm_lkb *lkb, | 237 | static int print_format3_lock(struct seq_file *s, struct dlm_lkb *lkb, |
217 | int rsb_lookup) | 238 | int rsb_lookup) |
218 | { | 239 | { |
219 | u64 xid = 0; | 240 | u64 xid = 0; |
241 | int rv; | ||
220 | 242 | ||
221 | if (lkb->lkb_flags & DLM_IFL_USER) { | 243 | if (lkb->lkb_flags & DLM_IFL_USER) { |
222 | if (lkb->lkb_ua) | 244 | if (lkb->lkb_ua) |
223 | xid = lkb->lkb_ua->xid; | 245 | xid = lkb->lkb_ua->xid; |
224 | } | 246 | } |
225 | 247 | ||
226 | seq_printf(s, "lkb %x %d %x %u %llu %x %x %d %d %d %d %d %d %u %llu %llu\n", | 248 | rv = seq_printf(s, "lkb %x %d %x %u %llu %x %x %d %d %d %d %d %d %u %llu %llu\n", |
227 | lkb->lkb_id, | 249 | lkb->lkb_id, |
228 | lkb->lkb_nodeid, | 250 | lkb->lkb_nodeid, |
229 | lkb->lkb_remid, | 251 | lkb->lkb_remid, |
230 | lkb->lkb_ownpid, | 252 | lkb->lkb_ownpid, |
231 | (unsigned long long)xid, | 253 | (unsigned long long)xid, |
232 | lkb->lkb_exflags, | 254 | lkb->lkb_exflags, |
233 | lkb->lkb_flags, | 255 | lkb->lkb_flags, |
234 | lkb->lkb_status, | 256 | lkb->lkb_status, |
235 | lkb->lkb_grmode, | 257 | lkb->lkb_grmode, |
236 | lkb->lkb_rqmode, | 258 | lkb->lkb_rqmode, |
237 | lkb->lkb_highbast, | 259 | lkb->lkb_highbast, |
238 | rsb_lookup, | 260 | rsb_lookup, |
239 | lkb->lkb_wait_type, | 261 | lkb->lkb_wait_type, |
240 | lkb->lkb_lvbseq, | 262 | lkb->lkb_lvbseq, |
241 | (unsigned long long)ktime_to_ns(lkb->lkb_timestamp), | 263 | (unsigned long long)ktime_to_ns(lkb->lkb_timestamp), |
242 | (unsigned long long)ktime_to_ns(lkb->lkb_time_bast)); | 264 | (unsigned long long)ktime_to_ns(lkb->lkb_time_bast)); |
265 | return rv; | ||
243 | } | 266 | } |
244 | 267 | ||
245 | static int print_format3(struct dlm_rsb *r, struct seq_file *s) | 268 | static int print_format3(struct dlm_rsb *r, struct seq_file *s) |
@@ -247,18 +270,21 @@ static int print_format3(struct dlm_rsb *r, struct seq_file *s) | |||
247 | struct dlm_lkb *lkb; | 270 | struct dlm_lkb *lkb; |
248 | int i, lvblen = r->res_ls->ls_lvblen; | 271 | int i, lvblen = r->res_ls->ls_lvblen; |
249 | int print_name = 1; | 272 | int print_name = 1; |
273 | int rv; | ||
250 | 274 | ||
251 | lock_rsb(r); | 275 | lock_rsb(r); |
252 | 276 | ||
253 | seq_printf(s, "rsb %p %d %x %lx %d %d %u %d ", | 277 | rv = seq_printf(s, "rsb %p %d %x %lx %d %d %u %d ", |
254 | r, | 278 | r, |
255 | r->res_nodeid, | 279 | r->res_nodeid, |
256 | r->res_first_lkid, | 280 | r->res_first_lkid, |
257 | r->res_flags, | 281 | r->res_flags, |
258 | !list_empty(&r->res_root_list), | 282 | !list_empty(&r->res_root_list), |
259 | !list_empty(&r->res_recover_list), | 283 | !list_empty(&r->res_recover_list), |
260 | r->res_recover_locks_count, | 284 | r->res_recover_locks_count, |
261 | r->res_length); | 285 | r->res_length); |
286 | if (rv) | ||
287 | goto out; | ||
262 | 288 | ||
263 | for (i = 0; i < r->res_length; i++) { | 289 | for (i = 0; i < r->res_length; i++) { |
264 | if (!isascii(r->res_name[i]) || !isprint(r->res_name[i])) | 290 | if (!isascii(r->res_name[i]) || !isprint(r->res_name[i])) |
@@ -273,7 +299,9 @@ static int print_format3(struct dlm_rsb *r, struct seq_file *s) | |||
273 | else | 299 | else |
274 | seq_printf(s, " %02x", (unsigned char)r->res_name[i]); | 300 | seq_printf(s, " %02x", (unsigned char)r->res_name[i]); |
275 | } | 301 | } |
276 | seq_printf(s, "\n"); | 302 | rv = seq_printf(s, "\n"); |
303 | if (rv) | ||
304 | goto out; | ||
277 | 305 | ||
278 | if (!r->res_lvbptr) | 306 | if (!r->res_lvbptr) |
279 | goto do_locks; | 307 | goto do_locks; |
@@ -282,344 +310,294 @@ static int print_format3(struct dlm_rsb *r, struct seq_file *s) | |||
282 | 310 | ||
283 | for (i = 0; i < lvblen; i++) | 311 | for (i = 0; i < lvblen; i++) |
284 | seq_printf(s, " %02x", (unsigned char)r->res_lvbptr[i]); | 312 | seq_printf(s, " %02x", (unsigned char)r->res_lvbptr[i]); |
285 | seq_printf(s, "\n"); | 313 | rv = seq_printf(s, "\n"); |
314 | if (rv) | ||
315 | goto out; | ||
286 | 316 | ||
287 | do_locks: | 317 | do_locks: |
288 | list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue) | 318 | list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue) { |
289 | print_format3_lock(s, lkb, 0); | 319 | rv = print_format3_lock(s, lkb, 0); |
290 | 320 | if (rv) | |
291 | list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue) | 321 | goto out; |
292 | print_format3_lock(s, lkb, 0); | ||
293 | |||
294 | list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue) | ||
295 | print_format3_lock(s, lkb, 0); | ||
296 | |||
297 | list_for_each_entry(lkb, &r->res_lookup, lkb_rsb_lookup) | ||
298 | print_format3_lock(s, lkb, 1); | ||
299 | |||
300 | unlock_rsb(r); | ||
301 | return 0; | ||
302 | } | ||
303 | |||
304 | static int rsb_iter_next(struct rsb_iter *ri) | ||
305 | { | ||
306 | struct dlm_ls *ls = ri->ls; | ||
307 | int i; | ||
308 | |||
309 | if (!ri->next) { | ||
310 | top: | ||
311 | /* Find the next non-empty hash bucket */ | ||
312 | for (i = ri->entry; i < ls->ls_rsbtbl_size; i++) { | ||
313 | read_lock(&ls->ls_rsbtbl[i].lock); | ||
314 | if (!list_empty(&ls->ls_rsbtbl[i].list)) { | ||
315 | ri->next = ls->ls_rsbtbl[i].list.next; | ||
316 | ri->rsb = list_entry(ri->next, struct dlm_rsb, | ||
317 | res_hashchain); | ||
318 | dlm_hold_rsb(ri->rsb); | ||
319 | read_unlock(&ls->ls_rsbtbl[i].lock); | ||
320 | break; | ||
321 | } | ||
322 | read_unlock(&ls->ls_rsbtbl[i].lock); | ||
323 | } | ||
324 | ri->entry = i; | ||
325 | |||
326 | if (ri->entry >= ls->ls_rsbtbl_size) | ||
327 | return 1; | ||
328 | } else { | ||
329 | struct dlm_rsb *old = ri->rsb; | ||
330 | i = ri->entry; | ||
331 | read_lock(&ls->ls_rsbtbl[i].lock); | ||
332 | ri->next = ri->next->next; | ||
333 | if (ri->next->next == ls->ls_rsbtbl[i].list.next) { | ||
334 | /* End of list - move to next bucket */ | ||
335 | ri->next = NULL; | ||
336 | ri->entry++; | ||
337 | read_unlock(&ls->ls_rsbtbl[i].lock); | ||
338 | dlm_put_rsb(old); | ||
339 | goto top; | ||
340 | } | ||
341 | ri->rsb = list_entry(ri->next, struct dlm_rsb, res_hashchain); | ||
342 | dlm_hold_rsb(ri->rsb); | ||
343 | read_unlock(&ls->ls_rsbtbl[i].lock); | ||
344 | dlm_put_rsb(old); | ||
345 | } | 322 | } |
346 | 323 | ||
347 | return 0; | 324 | list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue) { |
348 | } | 325 | rv = print_format3_lock(s, lkb, 0); |
349 | 326 | if (rv) | |
350 | static void rsb_iter_free(struct rsb_iter *ri) | 327 | goto out; |
351 | { | ||
352 | kfree(ri); | ||
353 | } | ||
354 | |||
355 | static struct rsb_iter *rsb_iter_init(struct dlm_ls *ls) | ||
356 | { | ||
357 | struct rsb_iter *ri; | ||
358 | |||
359 | ri = kzalloc(sizeof *ri, GFP_KERNEL); | ||
360 | if (!ri) | ||
361 | return NULL; | ||
362 | |||
363 | ri->ls = ls; | ||
364 | ri->entry = 0; | ||
365 | ri->next = NULL; | ||
366 | ri->format = 1; | ||
367 | |||
368 | if (rsb_iter_next(ri)) { | ||
369 | rsb_iter_free(ri); | ||
370 | return NULL; | ||
371 | } | 328 | } |
372 | 329 | ||
373 | return ri; | 330 | list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue) { |
374 | } | 331 | rv = print_format3_lock(s, lkb, 0); |
375 | 332 | if (rv) | |
376 | static void *rsb_seq_start(struct seq_file *file, loff_t *pos) | 333 | goto out; |
377 | { | ||
378 | struct rsb_iter *ri; | ||
379 | loff_t n = *pos; | ||
380 | |||
381 | ri = rsb_iter_init(file->private); | ||
382 | if (!ri) | ||
383 | return NULL; | ||
384 | |||
385 | while (n--) { | ||
386 | if (rsb_iter_next(ri)) { | ||
387 | rsb_iter_free(ri); | ||
388 | return NULL; | ||
389 | } | ||
390 | } | 334 | } |
391 | 335 | ||
392 | return ri; | 336 | list_for_each_entry(lkb, &r->res_lookup, lkb_rsb_lookup) { |
393 | } | 337 | rv = print_format3_lock(s, lkb, 1); |
394 | 338 | if (rv) | |
395 | static void *rsb_seq_next(struct seq_file *file, void *iter_ptr, loff_t *pos) | 339 | goto out; |
396 | { | ||
397 | struct rsb_iter *ri = iter_ptr; | ||
398 | |||
399 | (*pos)++; | ||
400 | |||
401 | if (rsb_iter_next(ri)) { | ||
402 | rsb_iter_free(ri); | ||
403 | return NULL; | ||
404 | } | 340 | } |
405 | 341 | out: | |
406 | return ri; | 342 | unlock_rsb(r); |
343 | return rv; | ||
407 | } | 344 | } |
408 | 345 | ||
409 | static void rsb_seq_stop(struct seq_file *file, void *iter_ptr) | 346 | struct rsbtbl_iter { |
410 | { | 347 | struct dlm_rsb *rsb; |
411 | /* nothing for now */ | 348 | unsigned bucket; |
412 | } | 349 | int format; |
350 | int header; | ||
351 | }; | ||
413 | 352 | ||
414 | static int rsb_seq_show(struct seq_file *file, void *iter_ptr) | 353 | /* seq_printf returns -1 if the buffer is full, and 0 otherwise. |
354 | If the buffer is full, seq_printf can be called again, but it | ||
355 | does nothing and just returns -1. So, the these printing routines | ||
356 | periodically check the return value to avoid wasting too much time | ||
357 | trying to print to a full buffer. */ | ||
358 | |||
359 | static int table_seq_show(struct seq_file *seq, void *iter_ptr) | ||
415 | { | 360 | { |
416 | struct rsb_iter *ri = iter_ptr; | 361 | struct rsbtbl_iter *ri = iter_ptr; |
362 | int rv = 0; | ||
417 | 363 | ||
418 | switch (ri->format) { | 364 | switch (ri->format) { |
419 | case 1: | 365 | case 1: |
420 | print_format1(ri->rsb, file); | 366 | rv = print_format1(ri->rsb, seq); |
421 | break; | 367 | break; |
422 | case 2: | 368 | case 2: |
423 | if (ri->header) { | 369 | if (ri->header) { |
424 | seq_printf(file, "id nodeid remid pid xid exflags " | 370 | seq_printf(seq, "id nodeid remid pid xid exflags " |
425 | "flags sts grmode rqmode time_ms " | 371 | "flags sts grmode rqmode time_ms " |
426 | "r_nodeid r_len r_name\n"); | 372 | "r_nodeid r_len r_name\n"); |
427 | ri->header = 0; | 373 | ri->header = 0; |
428 | } | 374 | } |
429 | print_format2(ri->rsb, file); | 375 | rv = print_format2(ri->rsb, seq); |
430 | break; | 376 | break; |
431 | case 3: | 377 | case 3: |
432 | if (ri->header) { | 378 | if (ri->header) { |
433 | seq_printf(file, "version rsb 1.1 lvb 1.1 lkb 1.1\n"); | 379 | seq_printf(seq, "version rsb 1.1 lvb 1.1 lkb 1.1\n"); |
434 | ri->header = 0; | 380 | ri->header = 0; |
435 | } | 381 | } |
436 | print_format3(ri->rsb, file); | 382 | rv = print_format3(ri->rsb, seq); |
437 | break; | 383 | break; |
438 | } | 384 | } |
439 | 385 | ||
440 | return 0; | 386 | return rv; |
441 | } | 387 | } |
442 | 388 | ||
443 | static struct seq_operations rsb_seq_ops = { | 389 | static struct seq_operations format1_seq_ops; |
444 | .start = rsb_seq_start, | 390 | static struct seq_operations format2_seq_ops; |
445 | .next = rsb_seq_next, | 391 | static struct seq_operations format3_seq_ops; |
446 | .stop = rsb_seq_stop, | ||
447 | .show = rsb_seq_show, | ||
448 | }; | ||
449 | 392 | ||
450 | static int rsb_open(struct inode *inode, struct file *file) | 393 | static void *table_seq_start(struct seq_file *seq, loff_t *pos) |
451 | { | 394 | { |
452 | struct seq_file *seq; | 395 | struct dlm_ls *ls = seq->private; |
453 | int ret; | 396 | struct rsbtbl_iter *ri; |
454 | 397 | struct dlm_rsb *r; | |
455 | ret = seq_open(file, &rsb_seq_ops); | 398 | loff_t n = *pos; |
456 | if (ret) | 399 | unsigned bucket, entry; |
457 | return ret; | ||
458 | |||
459 | seq = file->private_data; | ||
460 | seq->private = inode->i_private; | ||
461 | |||
462 | return 0; | ||
463 | } | ||
464 | |||
465 | static const struct file_operations rsb_fops = { | ||
466 | .owner = THIS_MODULE, | ||
467 | .open = rsb_open, | ||
468 | .read = seq_read, | ||
469 | .llseek = seq_lseek, | ||
470 | .release = seq_release | ||
471 | }; | ||
472 | 400 | ||
473 | /* | 401 | bucket = n >> 32; |
474 | * Dump state in compact per-lock listing | 402 | entry = n & ((1LL << 32) - 1); |
475 | */ | ||
476 | 403 | ||
477 | static struct rsb_iter *locks_iter_init(struct dlm_ls *ls, loff_t *pos) | 404 | if (bucket >= ls->ls_rsbtbl_size) |
478 | { | 405 | return NULL; |
479 | struct rsb_iter *ri; | ||
480 | 406 | ||
481 | ri = kzalloc(sizeof *ri, GFP_KERNEL); | 407 | ri = kzalloc(sizeof(struct rsbtbl_iter), GFP_KERNEL); |
482 | if (!ri) | 408 | if (!ri) |
483 | return NULL; | 409 | return NULL; |
484 | 410 | if (n == 0) | |
485 | ri->ls = ls; | ||
486 | ri->entry = 0; | ||
487 | ri->next = NULL; | ||
488 | ri->format = 2; | ||
489 | |||
490 | if (*pos == 0) | ||
491 | ri->header = 1; | 411 | ri->header = 1; |
492 | 412 | if (seq->op == &format1_seq_ops) | |
493 | if (rsb_iter_next(ri)) { | 413 | ri->format = 1; |
494 | rsb_iter_free(ri); | 414 | if (seq->op == &format2_seq_ops) |
495 | return NULL; | 415 | ri->format = 2; |
416 | if (seq->op == &format3_seq_ops) | ||
417 | ri->format = 3; | ||
418 | |||
419 | spin_lock(&ls->ls_rsbtbl[bucket].lock); | ||
420 | if (!list_empty(&ls->ls_rsbtbl[bucket].list)) { | ||
421 | list_for_each_entry(r, &ls->ls_rsbtbl[bucket].list, | ||
422 | res_hashchain) { | ||
423 | if (!entry--) { | ||
424 | dlm_hold_rsb(r); | ||
425 | ri->rsb = r; | ||
426 | ri->bucket = bucket; | ||
427 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); | ||
428 | return ri; | ||
429 | } | ||
430 | } | ||
496 | } | 431 | } |
432 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); | ||
497 | 433 | ||
498 | return ri; | 434 | /* |
499 | } | 435 | * move to the first rsb in the next non-empty bucket |
436 | */ | ||
500 | 437 | ||
501 | static void *locks_seq_start(struct seq_file *file, loff_t *pos) | 438 | /* zero the entry */ |
502 | { | 439 | n &= ~((1LL << 32) - 1); |
503 | struct rsb_iter *ri; | ||
504 | loff_t n = *pos; | ||
505 | 440 | ||
506 | ri = locks_iter_init(file->private, pos); | 441 | while (1) { |
507 | if (!ri) | 442 | bucket++; |
508 | return NULL; | 443 | n += 1LL << 32; |
509 | 444 | ||
510 | while (n--) { | 445 | if (bucket >= ls->ls_rsbtbl_size) { |
511 | if (rsb_iter_next(ri)) { | 446 | kfree(ri); |
512 | rsb_iter_free(ri); | ||
513 | return NULL; | 447 | return NULL; |
514 | } | 448 | } |
515 | } | ||
516 | 449 | ||
517 | return ri; | 450 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
451 | if (!list_empty(&ls->ls_rsbtbl[bucket].list)) { | ||
452 | r = list_first_entry(&ls->ls_rsbtbl[bucket].list, | ||
453 | struct dlm_rsb, res_hashchain); | ||
454 | dlm_hold_rsb(r); | ||
455 | ri->rsb = r; | ||
456 | ri->bucket = bucket; | ||
457 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); | ||
458 | *pos = n; | ||
459 | return ri; | ||
460 | } | ||
461 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); | ||
462 | } | ||
518 | } | 463 | } |
519 | 464 | ||
520 | static struct seq_operations locks_seq_ops = { | 465 | static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos) |
521 | .start = locks_seq_start, | ||
522 | .next = rsb_seq_next, | ||
523 | .stop = rsb_seq_stop, | ||
524 | .show = rsb_seq_show, | ||
525 | }; | ||
526 | |||
527 | static int locks_open(struct inode *inode, struct file *file) | ||
528 | { | 466 | { |
529 | struct seq_file *seq; | 467 | struct dlm_ls *ls = seq->private; |
530 | int ret; | 468 | struct rsbtbl_iter *ri = iter_ptr; |
531 | 469 | struct list_head *next; | |
532 | ret = seq_open(file, &locks_seq_ops); | 470 | struct dlm_rsb *r, *rp; |
533 | if (ret) | 471 | loff_t n = *pos; |
534 | return ret; | 472 | unsigned bucket; |
535 | 473 | ||
536 | seq = file->private_data; | 474 | bucket = n >> 32; |
537 | seq->private = inode->i_private; | 475 | |
538 | 476 | /* | |
539 | return 0; | 477 | * move to the next rsb in the same bucket |
540 | } | 478 | */ |
541 | 479 | ||
542 | static const struct file_operations locks_fops = { | 480 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
543 | .owner = THIS_MODULE, | 481 | rp = ri->rsb; |
544 | .open = locks_open, | 482 | next = rp->res_hashchain.next; |
545 | .read = seq_read, | 483 | |
546 | .llseek = seq_lseek, | 484 | if (next != &ls->ls_rsbtbl[bucket].list) { |
547 | .release = seq_release | 485 | r = list_entry(next, struct dlm_rsb, res_hashchain); |
548 | }; | 486 | dlm_hold_rsb(r); |
549 | 487 | ri->rsb = r; | |
550 | /* | 488 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
551 | * Dump all rsb/lvb/lkb state in compact listing, more complete than _locks | 489 | dlm_put_rsb(rp); |
552 | * This can replace both formats 1 and 2 eventually. | 490 | ++*pos; |
553 | */ | 491 | return ri; |
492 | } | ||
493 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); | ||
494 | dlm_put_rsb(rp); | ||
554 | 495 | ||
555 | static struct rsb_iter *all_iter_init(struct dlm_ls *ls, loff_t *pos) | 496 | /* |
556 | { | 497 | * move to the first rsb in the next non-empty bucket |
557 | struct rsb_iter *ri; | 498 | */ |
558 | 499 | ||
559 | ri = kzalloc(sizeof *ri, GFP_KERNEL); | 500 | /* zero the entry */ |
560 | if (!ri) | 501 | n &= ~((1LL << 32) - 1); |
561 | return NULL; | ||
562 | 502 | ||
563 | ri->ls = ls; | 503 | while (1) { |
564 | ri->entry = 0; | 504 | bucket++; |
565 | ri->next = NULL; | 505 | n += 1LL << 32; |
566 | ri->format = 3; | ||
567 | 506 | ||
568 | if (*pos == 0) | 507 | if (bucket >= ls->ls_rsbtbl_size) { |
569 | ri->header = 1; | 508 | kfree(ri); |
509 | return NULL; | ||
510 | } | ||
570 | 511 | ||
571 | if (rsb_iter_next(ri)) { | 512 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
572 | rsb_iter_free(ri); | 513 | if (!list_empty(&ls->ls_rsbtbl[bucket].list)) { |
573 | return NULL; | 514 | r = list_first_entry(&ls->ls_rsbtbl[bucket].list, |
515 | struct dlm_rsb, res_hashchain); | ||
516 | dlm_hold_rsb(r); | ||
517 | ri->rsb = r; | ||
518 | ri->bucket = bucket; | ||
519 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); | ||
520 | *pos = n; | ||
521 | return ri; | ||
522 | } | ||
523 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); | ||
574 | } | 524 | } |
575 | |||
576 | return ri; | ||
577 | } | 525 | } |
578 | 526 | ||
579 | static void *all_seq_start(struct seq_file *file, loff_t *pos) | 527 | static void table_seq_stop(struct seq_file *seq, void *iter_ptr) |
580 | { | 528 | { |
581 | struct rsb_iter *ri; | 529 | struct rsbtbl_iter *ri = iter_ptr; |
582 | loff_t n = *pos; | ||
583 | |||
584 | ri = all_iter_init(file->private, pos); | ||
585 | if (!ri) | ||
586 | return NULL; | ||
587 | 530 | ||
588 | while (n--) { | 531 | if (ri) { |
589 | if (rsb_iter_next(ri)) { | 532 | dlm_put_rsb(ri->rsb); |
590 | rsb_iter_free(ri); | 533 | kfree(ri); |
591 | return NULL; | ||
592 | } | ||
593 | } | 534 | } |
594 | |||
595 | return ri; | ||
596 | } | 535 | } |
597 | 536 | ||
598 | static struct seq_operations all_seq_ops = { | 537 | static struct seq_operations format1_seq_ops = { |
599 | .start = all_seq_start, | 538 | .start = table_seq_start, |
600 | .next = rsb_seq_next, | 539 | .next = table_seq_next, |
601 | .stop = rsb_seq_stop, | 540 | .stop = table_seq_stop, |
602 | .show = rsb_seq_show, | 541 | .show = table_seq_show, |
603 | }; | 542 | }; |
604 | 543 | ||
605 | static int all_open(struct inode *inode, struct file *file) | 544 | static struct seq_operations format2_seq_ops = { |
545 | .start = table_seq_start, | ||
546 | .next = table_seq_next, | ||
547 | .stop = table_seq_stop, | ||
548 | .show = table_seq_show, | ||
549 | }; | ||
550 | |||
551 | static struct seq_operations format3_seq_ops = { | ||
552 | .start = table_seq_start, | ||
553 | .next = table_seq_next, | ||
554 | .stop = table_seq_stop, | ||
555 | .show = table_seq_show, | ||
556 | }; | ||
557 | |||
558 | static const struct file_operations format1_fops; | ||
559 | static const struct file_operations format2_fops; | ||
560 | static const struct file_operations format3_fops; | ||
561 | |||
562 | static int table_open(struct inode *inode, struct file *file) | ||
606 | { | 563 | { |
607 | struct seq_file *seq; | 564 | struct seq_file *seq; |
608 | int ret; | 565 | int ret = -1; |
566 | |||
567 | if (file->f_op == &format1_fops) | ||
568 | ret = seq_open(file, &format1_seq_ops); | ||
569 | else if (file->f_op == &format2_fops) | ||
570 | ret = seq_open(file, &format2_seq_ops); | ||
571 | else if (file->f_op == &format3_fops) | ||
572 | ret = seq_open(file, &format3_seq_ops); | ||
609 | 573 | ||
610 | ret = seq_open(file, &all_seq_ops); | ||
611 | if (ret) | 574 | if (ret) |
612 | return ret; | 575 | return ret; |
613 | 576 | ||
614 | seq = file->private_data; | 577 | seq = file->private_data; |
615 | seq->private = inode->i_private; | 578 | seq->private = inode->i_private; /* the dlm_ls */ |
616 | |||
617 | return 0; | 579 | return 0; |
618 | } | 580 | } |
619 | 581 | ||
620 | static const struct file_operations all_fops = { | 582 | static const struct file_operations format1_fops = { |
583 | .owner = THIS_MODULE, | ||
584 | .open = table_open, | ||
585 | .read = seq_read, | ||
586 | .llseek = seq_lseek, | ||
587 | .release = seq_release | ||
588 | }; | ||
589 | |||
590 | static const struct file_operations format2_fops = { | ||
591 | .owner = THIS_MODULE, | ||
592 | .open = table_open, | ||
593 | .read = seq_read, | ||
594 | .llseek = seq_lseek, | ||
595 | .release = seq_release | ||
596 | }; | ||
597 | |||
598 | static const struct file_operations format3_fops = { | ||
621 | .owner = THIS_MODULE, | 599 | .owner = THIS_MODULE, |
622 | .open = all_open, | 600 | .open = table_open, |
623 | .read = seq_read, | 601 | .read = seq_read, |
624 | .llseek = seq_lseek, | 602 | .llseek = seq_lseek, |
625 | .release = seq_release | 603 | .release = seq_release |
@@ -689,7 +667,7 @@ int dlm_create_debug_file(struct dlm_ls *ls) | |||
689 | S_IFREG | S_IRUGO, | 667 | S_IFREG | S_IRUGO, |
690 | dlm_root, | 668 | dlm_root, |
691 | ls, | 669 | ls, |
692 | &rsb_fops); | 670 | &format1_fops); |
693 | if (!ls->ls_debug_rsb_dentry) | 671 | if (!ls->ls_debug_rsb_dentry) |
694 | goto fail; | 672 | goto fail; |
695 | 673 | ||
@@ -702,7 +680,7 @@ int dlm_create_debug_file(struct dlm_ls *ls) | |||
702 | S_IFREG | S_IRUGO, | 680 | S_IFREG | S_IRUGO, |
703 | dlm_root, | 681 | dlm_root, |
704 | ls, | 682 | ls, |
705 | &locks_fops); | 683 | &format2_fops); |
706 | if (!ls->ls_debug_locks_dentry) | 684 | if (!ls->ls_debug_locks_dentry) |
707 | goto fail; | 685 | goto fail; |
708 | 686 | ||
@@ -715,7 +693,7 @@ int dlm_create_debug_file(struct dlm_ls *ls) | |||
715 | S_IFREG | S_IRUGO, | 693 | S_IFREG | S_IRUGO, |
716 | dlm_root, | 694 | dlm_root, |
717 | ls, | 695 | ls, |
718 | &all_fops); | 696 | &format3_fops); |
719 | if (!ls->ls_debug_all_dentry) | 697 | if (!ls->ls_debug_all_dentry) |
720 | goto fail; | 698 | goto fail; |
721 | 699 | ||
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index ef2f1e353966..076e86f38bc8 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h | |||
@@ -105,7 +105,7 @@ struct dlm_dirtable { | |||
105 | struct dlm_rsbtable { | 105 | struct dlm_rsbtable { |
106 | struct list_head list; | 106 | struct list_head list; |
107 | struct list_head toss; | 107 | struct list_head toss; |
108 | rwlock_t lock; | 108 | spinlock_t lock; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | struct dlm_lkbtable { | 111 | struct dlm_lkbtable { |
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 6cfe65bbf4a2..01e7d39c5fba 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c | |||
@@ -412,9 +412,9 @@ static int search_rsb(struct dlm_ls *ls, char *name, int len, int b, | |||
412 | unsigned int flags, struct dlm_rsb **r_ret) | 412 | unsigned int flags, struct dlm_rsb **r_ret) |
413 | { | 413 | { |
414 | int error; | 414 | int error; |
415 | write_lock(&ls->ls_rsbtbl[b].lock); | 415 | spin_lock(&ls->ls_rsbtbl[b].lock); |
416 | error = _search_rsb(ls, name, len, b, flags, r_ret); | 416 | error = _search_rsb(ls, name, len, b, flags, r_ret); |
417 | write_unlock(&ls->ls_rsbtbl[b].lock); | 417 | spin_unlock(&ls->ls_rsbtbl[b].lock); |
418 | return error; | 418 | return error; |
419 | } | 419 | } |
420 | 420 | ||
@@ -478,16 +478,16 @@ static int find_rsb(struct dlm_ls *ls, char *name, int namelen, | |||
478 | r->res_nodeid = nodeid; | 478 | r->res_nodeid = nodeid; |
479 | } | 479 | } |
480 | 480 | ||
481 | write_lock(&ls->ls_rsbtbl[bucket].lock); | 481 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
482 | error = _search_rsb(ls, name, namelen, bucket, 0, &tmp); | 482 | error = _search_rsb(ls, name, namelen, bucket, 0, &tmp); |
483 | if (!error) { | 483 | if (!error) { |
484 | write_unlock(&ls->ls_rsbtbl[bucket].lock); | 484 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
485 | dlm_free_rsb(r); | 485 | dlm_free_rsb(r); |
486 | r = tmp; | 486 | r = tmp; |
487 | goto out; | 487 | goto out; |
488 | } | 488 | } |
489 | list_add(&r->res_hashchain, &ls->ls_rsbtbl[bucket].list); | 489 | list_add(&r->res_hashchain, &ls->ls_rsbtbl[bucket].list); |
490 | write_unlock(&ls->ls_rsbtbl[bucket].lock); | 490 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
491 | error = 0; | 491 | error = 0; |
492 | out: | 492 | out: |
493 | *r_ret = r; | 493 | *r_ret = r; |
@@ -530,9 +530,9 @@ static void put_rsb(struct dlm_rsb *r) | |||
530 | struct dlm_ls *ls = r->res_ls; | 530 | struct dlm_ls *ls = r->res_ls; |
531 | uint32_t bucket = r->res_bucket; | 531 | uint32_t bucket = r->res_bucket; |
532 | 532 | ||
533 | write_lock(&ls->ls_rsbtbl[bucket].lock); | 533 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
534 | kref_put(&r->res_ref, toss_rsb); | 534 | kref_put(&r->res_ref, toss_rsb); |
535 | write_unlock(&ls->ls_rsbtbl[bucket].lock); | 535 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
536 | } | 536 | } |
537 | 537 | ||
538 | void dlm_put_rsb(struct dlm_rsb *r) | 538 | void dlm_put_rsb(struct dlm_rsb *r) |
@@ -967,7 +967,7 @@ static int shrink_bucket(struct dlm_ls *ls, int b) | |||
967 | 967 | ||
968 | for (;;) { | 968 | for (;;) { |
969 | found = 0; | 969 | found = 0; |
970 | write_lock(&ls->ls_rsbtbl[b].lock); | 970 | spin_lock(&ls->ls_rsbtbl[b].lock); |
971 | list_for_each_entry_reverse(r, &ls->ls_rsbtbl[b].toss, | 971 | list_for_each_entry_reverse(r, &ls->ls_rsbtbl[b].toss, |
972 | res_hashchain) { | 972 | res_hashchain) { |
973 | if (!time_after_eq(jiffies, r->res_toss_time + | 973 | if (!time_after_eq(jiffies, r->res_toss_time + |
@@ -978,20 +978,20 @@ static int shrink_bucket(struct dlm_ls *ls, int b) | |||
978 | } | 978 | } |
979 | 979 | ||
980 | if (!found) { | 980 | if (!found) { |
981 | write_unlock(&ls->ls_rsbtbl[b].lock); | 981 | spin_unlock(&ls->ls_rsbtbl[b].lock); |
982 | break; | 982 | break; |
983 | } | 983 | } |
984 | 984 | ||
985 | if (kref_put(&r->res_ref, kill_rsb)) { | 985 | if (kref_put(&r->res_ref, kill_rsb)) { |
986 | list_del(&r->res_hashchain); | 986 | list_del(&r->res_hashchain); |
987 | write_unlock(&ls->ls_rsbtbl[b].lock); | 987 | spin_unlock(&ls->ls_rsbtbl[b].lock); |
988 | 988 | ||
989 | if (is_master(r)) | 989 | if (is_master(r)) |
990 | dir_remove(r); | 990 | dir_remove(r); |
991 | dlm_free_rsb(r); | 991 | dlm_free_rsb(r); |
992 | count++; | 992 | count++; |
993 | } else { | 993 | } else { |
994 | write_unlock(&ls->ls_rsbtbl[b].lock); | 994 | spin_unlock(&ls->ls_rsbtbl[b].lock); |
995 | log_error(ls, "tossed rsb in use %s", r->res_name); | 995 | log_error(ls, "tossed rsb in use %s", r->res_name); |
996 | } | 996 | } |
997 | } | 997 | } |
@@ -4224,7 +4224,7 @@ static struct dlm_rsb *find_purged_rsb(struct dlm_ls *ls, int bucket) | |||
4224 | { | 4224 | { |
4225 | struct dlm_rsb *r, *r_ret = NULL; | 4225 | struct dlm_rsb *r, *r_ret = NULL; |
4226 | 4226 | ||
4227 | read_lock(&ls->ls_rsbtbl[bucket].lock); | 4227 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
4228 | list_for_each_entry(r, &ls->ls_rsbtbl[bucket].list, res_hashchain) { | 4228 | list_for_each_entry(r, &ls->ls_rsbtbl[bucket].list, res_hashchain) { |
4229 | if (!rsb_flag(r, RSB_LOCKS_PURGED)) | 4229 | if (!rsb_flag(r, RSB_LOCKS_PURGED)) |
4230 | continue; | 4230 | continue; |
@@ -4233,7 +4233,7 @@ static struct dlm_rsb *find_purged_rsb(struct dlm_ls *ls, int bucket) | |||
4233 | r_ret = r; | 4233 | r_ret = r; |
4234 | break; | 4234 | break; |
4235 | } | 4235 | } |
4236 | read_unlock(&ls->ls_rsbtbl[bucket].lock); | 4236 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
4237 | return r_ret; | 4237 | return r_ret; |
4238 | } | 4238 | } |
4239 | 4239 | ||
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index 8d86b7960f0d..aa32e5f02493 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c | |||
@@ -464,7 +464,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace, | |||
464 | for (i = 0; i < size; i++) { | 464 | for (i = 0; i < size; i++) { |
465 | INIT_LIST_HEAD(&ls->ls_rsbtbl[i].list); | 465 | INIT_LIST_HEAD(&ls->ls_rsbtbl[i].list); |
466 | INIT_LIST_HEAD(&ls->ls_rsbtbl[i].toss); | 466 | INIT_LIST_HEAD(&ls->ls_rsbtbl[i].toss); |
467 | rwlock_init(&ls->ls_rsbtbl[i].lock); | 467 | spin_lock_init(&ls->ls_rsbtbl[i].lock); |
468 | } | 468 | } |
469 | 469 | ||
470 | size = dlm_config.ci_lkbtbl_size; | 470 | size = dlm_config.ci_lkbtbl_size; |
diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c index 80aba5bdd4a4..eda43f362616 100644 --- a/fs/dlm/recover.c +++ b/fs/dlm/recover.c | |||
@@ -726,7 +726,7 @@ int dlm_create_root_list(struct dlm_ls *ls) | |||
726 | } | 726 | } |
727 | 727 | ||
728 | for (i = 0; i < ls->ls_rsbtbl_size; i++) { | 728 | for (i = 0; i < ls->ls_rsbtbl_size; i++) { |
729 | read_lock(&ls->ls_rsbtbl[i].lock); | 729 | spin_lock(&ls->ls_rsbtbl[i].lock); |
730 | list_for_each_entry(r, &ls->ls_rsbtbl[i].list, res_hashchain) { | 730 | list_for_each_entry(r, &ls->ls_rsbtbl[i].list, res_hashchain) { |
731 | list_add(&r->res_root_list, &ls->ls_root_list); | 731 | list_add(&r->res_root_list, &ls->ls_root_list); |
732 | dlm_hold_rsb(r); | 732 | dlm_hold_rsb(r); |
@@ -737,7 +737,7 @@ int dlm_create_root_list(struct dlm_ls *ls) | |||
737 | but no other recovery steps should do anything with them. */ | 737 | but no other recovery steps should do anything with them. */ |
738 | 738 | ||
739 | if (dlm_no_directory(ls)) { | 739 | if (dlm_no_directory(ls)) { |
740 | read_unlock(&ls->ls_rsbtbl[i].lock); | 740 | spin_unlock(&ls->ls_rsbtbl[i].lock); |
741 | continue; | 741 | continue; |
742 | } | 742 | } |
743 | 743 | ||
@@ -745,7 +745,7 @@ int dlm_create_root_list(struct dlm_ls *ls) | |||
745 | list_add(&r->res_root_list, &ls->ls_root_list); | 745 | list_add(&r->res_root_list, &ls->ls_root_list); |
746 | dlm_hold_rsb(r); | 746 | dlm_hold_rsb(r); |
747 | } | 747 | } |
748 | read_unlock(&ls->ls_rsbtbl[i].lock); | 748 | spin_unlock(&ls->ls_rsbtbl[i].lock); |
749 | } | 749 | } |
750 | out: | 750 | out: |
751 | up_write(&ls->ls_root_sem); | 751 | up_write(&ls->ls_root_sem); |
@@ -775,7 +775,7 @@ void dlm_clear_toss_list(struct dlm_ls *ls) | |||
775 | int i; | 775 | int i; |
776 | 776 | ||
777 | for (i = 0; i < ls->ls_rsbtbl_size; i++) { | 777 | for (i = 0; i < ls->ls_rsbtbl_size; i++) { |
778 | write_lock(&ls->ls_rsbtbl[i].lock); | 778 | spin_lock(&ls->ls_rsbtbl[i].lock); |
779 | list_for_each_entry_safe(r, safe, &ls->ls_rsbtbl[i].toss, | 779 | list_for_each_entry_safe(r, safe, &ls->ls_rsbtbl[i].toss, |
780 | res_hashchain) { | 780 | res_hashchain) { |
781 | if (dlm_no_directory(ls) || !is_master(r)) { | 781 | if (dlm_no_directory(ls) || !is_master(r)) { |
@@ -783,7 +783,7 @@ void dlm_clear_toss_list(struct dlm_ls *ls) | |||
783 | dlm_free_rsb(r); | 783 | dlm_free_rsb(r); |
784 | } | 784 | } |
785 | } | 785 | } |
786 | write_unlock(&ls->ls_rsbtbl[i].lock); | 786 | spin_unlock(&ls->ls_rsbtbl[i].lock); |
787 | } | 787 | } |
788 | } | 788 | } |
789 | 789 | ||
diff --git a/fs/eventfd.c b/fs/eventfd.c index 08bf558d0408..5de2c2db3aa2 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c | |||
@@ -198,7 +198,7 @@ struct file *eventfd_fget(int fd) | |||
198 | return file; | 198 | return file; |
199 | } | 199 | } |
200 | 200 | ||
201 | asmlinkage long sys_eventfd2(unsigned int count, int flags) | 201 | SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) |
202 | { | 202 | { |
203 | int fd; | 203 | int fd; |
204 | struct eventfd_ctx *ctx; | 204 | struct eventfd_ctx *ctx; |
@@ -228,8 +228,7 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags) | |||
228 | return fd; | 228 | return fd; |
229 | } | 229 | } |
230 | 230 | ||
231 | asmlinkage long sys_eventfd(unsigned int count) | 231 | SYSCALL_DEFINE1(eventfd, unsigned int, count) |
232 | { | 232 | { |
233 | return sys_eventfd2(count, 0); | 233 | return sys_eventfd2(count, 0); |
234 | } | 234 | } |
235 | |||
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 96355d505347..ba2f9ec71192 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1110,7 +1110,7 @@ retry: | |||
1110 | /* | 1110 | /* |
1111 | * Open an eventpoll file descriptor. | 1111 | * Open an eventpoll file descriptor. |
1112 | */ | 1112 | */ |
1113 | asmlinkage long sys_epoll_create1(int flags) | 1113 | SYSCALL_DEFINE1(epoll_create1, int, flags) |
1114 | { | 1114 | { |
1115 | int error, fd = -1; | 1115 | int error, fd = -1; |
1116 | struct eventpoll *ep; | 1116 | struct eventpoll *ep; |
@@ -1150,7 +1150,7 @@ error_return: | |||
1150 | return fd; | 1150 | return fd; |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | asmlinkage long sys_epoll_create(int size) | 1153 | SYSCALL_DEFINE1(epoll_create, int, size) |
1154 | { | 1154 | { |
1155 | if (size < 0) | 1155 | if (size < 0) |
1156 | return -EINVAL; | 1156 | return -EINVAL; |
@@ -1163,8 +1163,8 @@ asmlinkage long sys_epoll_create(int size) | |||
1163 | * the eventpoll file that enables the insertion/removal/change of | 1163 | * the eventpoll file that enables the insertion/removal/change of |
1164 | * file descriptors inside the interest set. | 1164 | * file descriptors inside the interest set. |
1165 | */ | 1165 | */ |
1166 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, | 1166 | SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, |
1167 | struct epoll_event __user *event) | 1167 | struct epoll_event __user *, event) |
1168 | { | 1168 | { |
1169 | int error; | 1169 | int error; |
1170 | struct file *file, *tfile; | 1170 | struct file *file, *tfile; |
@@ -1261,8 +1261,8 @@ error_return: | |||
1261 | * Implement the event wait interface for the eventpoll file. It is the kernel | 1261 | * Implement the event wait interface for the eventpoll file. It is the kernel |
1262 | * part of the user space epoll_wait(2). | 1262 | * part of the user space epoll_wait(2). |
1263 | */ | 1263 | */ |
1264 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, | 1264 | SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, |
1265 | int maxevents, int timeout) | 1265 | int, maxevents, int, timeout) |
1266 | { | 1266 | { |
1267 | int error; | 1267 | int error; |
1268 | struct file *file; | 1268 | struct file *file; |
@@ -1319,9 +1319,9 @@ error_return: | |||
1319 | * Implement the event wait interface for the eventpoll file. It is the kernel | 1319 | * Implement the event wait interface for the eventpoll file. It is the kernel |
1320 | * part of the user space epoll_pwait(2). | 1320 | * part of the user space epoll_pwait(2). |
1321 | */ | 1321 | */ |
1322 | asmlinkage long sys_epoll_pwait(int epfd, struct epoll_event __user *events, | 1322 | SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events, |
1323 | int maxevents, int timeout, const sigset_t __user *sigmask, | 1323 | int, maxevents, int, timeout, const sigset_t __user *, sigmask, |
1324 | size_t sigsetsize) | 1324 | size_t, sigsetsize) |
1325 | { | 1325 | { |
1326 | int error; | 1326 | int error; |
1327 | sigset_t ksigmask, sigsaved; | 1327 | sigset_t ksigmask, sigsaved; |
@@ -99,7 +99,7 @@ static inline void put_binfmt(struct linux_binfmt * fmt) | |||
99 | * | 99 | * |
100 | * Also note that we take the address to load from from the file itself. | 100 | * Also note that we take the address to load from from the file itself. |
101 | */ | 101 | */ |
102 | asmlinkage long sys_uselib(const char __user * library) | 102 | SYSCALL_DEFINE1(uselib, const char __user *, library) |
103 | { | 103 | { |
104 | struct file *file; | 104 | struct file *file; |
105 | struct nameidata nd; | 105 | struct nameidata nd; |
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 9a0fc400f91c..2999d72153b7 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c | |||
@@ -95,10 +95,13 @@ static int ext2_commit_chunk(struct page *page, loff_t pos, unsigned len) | |||
95 | mark_inode_dirty(dir); | 95 | mark_inode_dirty(dir); |
96 | } | 96 | } |
97 | 97 | ||
98 | if (IS_DIRSYNC(dir)) | 98 | if (IS_DIRSYNC(dir)) { |
99 | err = write_one_page(page, 1); | 99 | err = write_one_page(page, 1); |
100 | else | 100 | if (!err) |
101 | err = ext2_sync_inode(dir); | ||
102 | } else { | ||
101 | unlock_page(page); | 103 | unlock_page(page); |
104 | } | ||
102 | 105 | ||
103 | return err; | 106 | return err; |
104 | } | 107 | } |
diff --git a/fs/fcntl.c b/fs/fcntl.c index cdc141946724..bd215cc791da 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -50,7 +50,7 @@ static int get_close_on_exec(unsigned int fd) | |||
50 | return res; | 50 | return res; |
51 | } | 51 | } |
52 | 52 | ||
53 | asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags) | 53 | SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags) |
54 | { | 54 | { |
55 | int err = -EBADF; | 55 | int err = -EBADF; |
56 | struct file * file, *tofree; | 56 | struct file * file, *tofree; |
@@ -113,7 +113,7 @@ out_unlock: | |||
113 | return err; | 113 | return err; |
114 | } | 114 | } |
115 | 115 | ||
116 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) | 116 | SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd) |
117 | { | 117 | { |
118 | if (unlikely(newfd == oldfd)) { /* corner case */ | 118 | if (unlikely(newfd == oldfd)) { /* corner case */ |
119 | struct files_struct *files = current->files; | 119 | struct files_struct *files = current->files; |
@@ -126,7 +126,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) | |||
126 | return sys_dup3(oldfd, newfd, 0); | 126 | return sys_dup3(oldfd, newfd, 0); |
127 | } | 127 | } |
128 | 128 | ||
129 | asmlinkage long sys_dup(unsigned int fildes) | 129 | SYSCALL_DEFINE1(dup, unsigned int, fildes) |
130 | { | 130 | { |
131 | int ret = -EBADF; | 131 | int ret = -EBADF; |
132 | struct file *file = fget(fildes); | 132 | struct file *file = fget(fildes); |
@@ -335,7 +335,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg, | |||
335 | return err; | 335 | return err; |
336 | } | 336 | } |
337 | 337 | ||
338 | asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) | 338 | SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) |
339 | { | 339 | { |
340 | struct file *filp; | 340 | struct file *filp; |
341 | long err = -EBADF; | 341 | long err = -EBADF; |
@@ -358,7 +358,8 @@ out: | |||
358 | } | 358 | } |
359 | 359 | ||
360 | #if BITS_PER_LONG == 32 | 360 | #if BITS_PER_LONG == 32 |
361 | asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) | 361 | SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, |
362 | unsigned long, arg) | ||
362 | { | 363 | { |
363 | struct file * filp; | 364 | struct file * filp; |
364 | long err; | 365 | long err; |
diff --git a/fs/filesystems.c b/fs/filesystems.c index d488dcd7f2bb..1aa70260e6d1 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c | |||
@@ -179,7 +179,7 @@ static int fs_maxindex(void) | |||
179 | /* | 179 | /* |
180 | * Whee.. Weird sysv syscall. | 180 | * Whee.. Weird sysv syscall. |
181 | */ | 181 | */ |
182 | asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2) | 182 | SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2) |
183 | { | 183 | { |
184 | int retval = -EINVAL; | 184 | int retval = -EINVAL; |
185 | 185 | ||
diff --git a/fs/ioctl.c b/fs/ioctl.c index 20b0a8a24c6b..240ec63984cb 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
@@ -542,7 +542,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
542 | return error; | 542 | return error; |
543 | } | 543 | } |
544 | 544 | ||
545 | asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) | 545 | SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) |
546 | { | 546 | { |
547 | struct file *filp; | 547 | struct file *filp; |
548 | int error = -EBADF; | 548 | int error = -EBADF; |
diff --git a/fs/ioprio.c b/fs/ioprio.c index 1a39ac370942..c7c0b28d7d21 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c | |||
@@ -72,7 +72,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio) | |||
72 | } | 72 | } |
73 | EXPORT_SYMBOL_GPL(set_task_ioprio); | 73 | EXPORT_SYMBOL_GPL(set_task_ioprio); |
74 | 74 | ||
75 | asmlinkage long sys_ioprio_set(int which, int who, int ioprio) | 75 | SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio) |
76 | { | 76 | { |
77 | int class = IOPRIO_PRIO_CLASS(ioprio); | 77 | int class = IOPRIO_PRIO_CLASS(ioprio); |
78 | int data = IOPRIO_PRIO_DATA(ioprio); | 78 | int data = IOPRIO_PRIO_DATA(ioprio); |
@@ -188,7 +188,7 @@ int ioprio_best(unsigned short aprio, unsigned short bprio) | |||
188 | return aprio; | 188 | return aprio; |
189 | } | 189 | } |
190 | 190 | ||
191 | asmlinkage long sys_ioprio_get(int which, int who) | 191 | SYSCALL_DEFINE2(ioprio_get, int, which, int, who) |
192 | { | 192 | { |
193 | struct task_struct *g, *p; | 193 | struct task_struct *g, *p; |
194 | struct user_struct *user; | 194 | struct user_struct *user; |
@@ -252,4 +252,3 @@ asmlinkage long sys_ioprio_get(int which, int who) | |||
252 | read_unlock(&tasklist_lock); | 252 | read_unlock(&tasklist_lock); |
253 | return ret; | 253 | return ret; |
254 | } | 254 | } |
255 | |||
diff --git a/fs/locks.c b/fs/locks.c index 46a2e12f7d42..ec3deea29e37 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1564,7 +1564,7 @@ EXPORT_SYMBOL(flock_lock_file_wait); | |||
1564 | * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other | 1564 | * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other |
1565 | * processes read and write access respectively. | 1565 | * processes read and write access respectively. |
1566 | */ | 1566 | */ |
1567 | asmlinkage long sys_flock(unsigned int fd, unsigned int cmd) | 1567 | SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) |
1568 | { | 1568 | { |
1569 | struct file *filp; | 1569 | struct file *filp; |
1570 | struct file_lock *lock; | 1570 | struct file_lock *lock; |
diff --git a/fs/namei.c b/fs/namei.c index f05bed242422..bbc15c237558 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1962,8 +1962,8 @@ static int may_mknod(mode_t mode) | |||
1962 | } | 1962 | } |
1963 | } | 1963 | } |
1964 | 1964 | ||
1965 | asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode, | 1965 | SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode, |
1966 | unsigned dev) | 1966 | unsigned, dev) |
1967 | { | 1967 | { |
1968 | int error; | 1968 | int error; |
1969 | char *tmp; | 1969 | char *tmp; |
@@ -2017,7 +2017,7 @@ out_unlock: | |||
2017 | return error; | 2017 | return error; |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | asmlinkage long sys_mknod(const char __user *filename, int mode, unsigned dev) | 2020 | SYSCALL_DEFINE3(mknod, const char __user *, filename, int, mode, unsigned, dev) |
2021 | { | 2021 | { |
2022 | return sys_mknodat(AT_FDCWD, filename, mode, dev); | 2022 | return sys_mknodat(AT_FDCWD, filename, mode, dev); |
2023 | } | 2023 | } |
@@ -2044,7 +2044,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
2044 | return error; | 2044 | return error; |
2045 | } | 2045 | } |
2046 | 2046 | ||
2047 | asmlinkage long sys_mkdirat(int dfd, const char __user *pathname, int mode) | 2047 | SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode) |
2048 | { | 2048 | { |
2049 | int error = 0; | 2049 | int error = 0; |
2050 | char * tmp; | 2050 | char * tmp; |
@@ -2081,7 +2081,7 @@ out_err: | |||
2081 | return error; | 2081 | return error; |
2082 | } | 2082 | } |
2083 | 2083 | ||
2084 | asmlinkage long sys_mkdir(const char __user *pathname, int mode) | 2084 | SYSCALL_DEFINE2(mkdir, const char __user *, pathname, int, mode) |
2085 | { | 2085 | { |
2086 | return sys_mkdirat(AT_FDCWD, pathname, mode); | 2086 | return sys_mkdirat(AT_FDCWD, pathname, mode); |
2087 | } | 2087 | } |
@@ -2195,7 +2195,7 @@ exit1: | |||
2195 | return error; | 2195 | return error; |
2196 | } | 2196 | } |
2197 | 2197 | ||
2198 | asmlinkage long sys_rmdir(const char __user *pathname) | 2198 | SYSCALL_DEFINE1(rmdir, const char __user *, pathname) |
2199 | { | 2199 | { |
2200 | return do_rmdir(AT_FDCWD, pathname); | 2200 | return do_rmdir(AT_FDCWD, pathname); |
2201 | } | 2201 | } |
@@ -2291,7 +2291,7 @@ slashes: | |||
2291 | goto exit2; | 2291 | goto exit2; |
2292 | } | 2292 | } |
2293 | 2293 | ||
2294 | asmlinkage long sys_unlinkat(int dfd, const char __user *pathname, int flag) | 2294 | SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag) |
2295 | { | 2295 | { |
2296 | if ((flag & ~AT_REMOVEDIR) != 0) | 2296 | if ((flag & ~AT_REMOVEDIR) != 0) |
2297 | return -EINVAL; | 2297 | return -EINVAL; |
@@ -2302,7 +2302,7 @@ asmlinkage long sys_unlinkat(int dfd, const char __user *pathname, int flag) | |||
2302 | return do_unlinkat(dfd, pathname); | 2302 | return do_unlinkat(dfd, pathname); |
2303 | } | 2303 | } |
2304 | 2304 | ||
2305 | asmlinkage long sys_unlink(const char __user *pathname) | 2305 | SYSCALL_DEFINE1(unlink, const char __user *, pathname) |
2306 | { | 2306 | { |
2307 | return do_unlinkat(AT_FDCWD, pathname); | 2307 | return do_unlinkat(AT_FDCWD, pathname); |
2308 | } | 2308 | } |
@@ -2328,8 +2328,8 @@ int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname) | |||
2328 | return error; | 2328 | return error; |
2329 | } | 2329 | } |
2330 | 2330 | ||
2331 | asmlinkage long sys_symlinkat(const char __user *oldname, | 2331 | SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, |
2332 | int newdfd, const char __user *newname) | 2332 | int, newdfd, const char __user *, newname) |
2333 | { | 2333 | { |
2334 | int error; | 2334 | int error; |
2335 | char *from; | 2335 | char *from; |
@@ -2370,7 +2370,7 @@ out_putname: | |||
2370 | return error; | 2370 | return error; |
2371 | } | 2371 | } |
2372 | 2372 | ||
2373 | asmlinkage long sys_symlink(const char __user *oldname, const char __user *newname) | 2373 | SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newname) |
2374 | { | 2374 | { |
2375 | return sys_symlinkat(oldname, AT_FDCWD, newname); | 2375 | return sys_symlinkat(oldname, AT_FDCWD, newname); |
2376 | } | 2376 | } |
@@ -2422,9 +2422,8 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de | |||
2422 | * with linux 2.0, and to avoid hard-linking to directories | 2422 | * with linux 2.0, and to avoid hard-linking to directories |
2423 | * and other special files. --ADM | 2423 | * and other special files. --ADM |
2424 | */ | 2424 | */ |
2425 | asmlinkage long sys_linkat(int olddfd, const char __user *oldname, | 2425 | SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, |
2426 | int newdfd, const char __user *newname, | 2426 | int, newdfd, const char __user *, newname, int, flags) |
2427 | int flags) | ||
2428 | { | 2427 | { |
2429 | struct dentry *new_dentry; | 2428 | struct dentry *new_dentry; |
2430 | struct nameidata nd; | 2429 | struct nameidata nd; |
@@ -2473,7 +2472,7 @@ out: | |||
2473 | return error; | 2472 | return error; |
2474 | } | 2473 | } |
2475 | 2474 | ||
2476 | asmlinkage long sys_link(const char __user *oldname, const char __user *newname) | 2475 | SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname) |
2477 | { | 2476 | { |
2478 | return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); | 2477 | return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); |
2479 | } | 2478 | } |
@@ -2624,8 +2623,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2624 | return error; | 2623 | return error; |
2625 | } | 2624 | } |
2626 | 2625 | ||
2627 | asmlinkage long sys_renameat(int olddfd, const char __user *oldname, | 2626 | SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, |
2628 | int newdfd, const char __user *newname) | 2627 | int, newdfd, const char __user *, newname) |
2629 | { | 2628 | { |
2630 | struct dentry *old_dir, *new_dir; | 2629 | struct dentry *old_dir, *new_dir; |
2631 | struct dentry *old_dentry, *new_dentry; | 2630 | struct dentry *old_dentry, *new_dentry; |
@@ -2718,7 +2717,7 @@ exit: | |||
2718 | return error; | 2717 | return error; |
2719 | } | 2718 | } |
2720 | 2719 | ||
2721 | asmlinkage long sys_rename(const char __user *oldname, const char __user *newname) | 2720 | SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname) |
2722 | { | 2721 | { |
2723 | return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname); | 2722 | return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname); |
2724 | } | 2723 | } |
diff --git a/fs/namespace.c b/fs/namespace.c index a40685d800a8..228d8c4bfd18 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1128,7 +1128,7 @@ static int do_umount(struct vfsmount *mnt, int flags) | |||
1128 | * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD | 1128 | * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD |
1129 | */ | 1129 | */ |
1130 | 1130 | ||
1131 | asmlinkage long sys_umount(char __user * name, int flags) | 1131 | SYSCALL_DEFINE2(umount, char __user *, name, int, flags) |
1132 | { | 1132 | { |
1133 | struct path path; | 1133 | struct path path; |
1134 | int retval; | 1134 | int retval; |
@@ -1160,7 +1160,7 @@ out: | |||
1160 | /* | 1160 | /* |
1161 | * The 2.0 compatible umount. No flags. | 1161 | * The 2.0 compatible umount. No flags. |
1162 | */ | 1162 | */ |
1163 | asmlinkage long sys_oldumount(char __user * name) | 1163 | SYSCALL_DEFINE1(oldumount, char __user *, name) |
1164 | { | 1164 | { |
1165 | return sys_umount(name, 0); | 1165 | return sys_umount(name, 0); |
1166 | } | 1166 | } |
@@ -2045,9 +2045,8 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns, | |||
2045 | return new_ns; | 2045 | return new_ns; |
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | asmlinkage long sys_mount(char __user * dev_name, char __user * dir_name, | 2048 | SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, |
2049 | char __user * type, unsigned long flags, | 2049 | char __user *, type, unsigned long, flags, void __user *, data) |
2050 | void __user * data) | ||
2051 | { | 2050 | { |
2052 | int retval; | 2051 | int retval; |
2053 | unsigned long data_page; | 2052 | unsigned long data_page; |
@@ -2172,8 +2171,8 @@ static void chroot_fs_refs(struct path *old_root, struct path *new_root) | |||
2172 | * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root | 2171 | * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root |
2173 | * first. | 2172 | * first. |
2174 | */ | 2173 | */ |
2175 | asmlinkage long sys_pivot_root(const char __user * new_root, | 2174 | SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, |
2176 | const char __user * put_old) | 2175 | const char __user *, put_old) |
2177 | { | 2176 | { |
2178 | struct vfsmount *tmp; | 2177 | struct vfsmount *tmp; |
2179 | struct path new, old, parent_path, root_parent, root; | 2178 | struct path new, old, parent_path, root_parent, root; |
diff --git a/fs/nfsctl.c b/fs/nfsctl.c index b27451909dff..8f9a20556f79 100644 --- a/fs/nfsctl.c +++ b/fs/nfsctl.c | |||
@@ -86,8 +86,8 @@ static struct { | |||
86 | }, | 86 | }, |
87 | }; | 87 | }; |
88 | 88 | ||
89 | long | 89 | SYSCALL_DEFINE3(nfsservctl, int, cmd, struct nfsctl_arg __user *, arg, |
90 | asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *res) | 90 | void __user *, res) |
91 | { | 91 | { |
92 | struct file *file; | 92 | struct file *file; |
93 | void __user *p = &arg->u; | 93 | void __user *p = &arg->u; |
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 81b8644b0136..d53a1838d6e8 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
@@ -576,7 +576,7 @@ static const struct inotify_operations inotify_user_ops = { | |||
576 | .destroy_watch = free_inotify_user_watch, | 576 | .destroy_watch = free_inotify_user_watch, |
577 | }; | 577 | }; |
578 | 578 | ||
579 | asmlinkage long sys_inotify_init1(int flags) | 579 | SYSCALL_DEFINE1(inotify_init1, int, flags) |
580 | { | 580 | { |
581 | struct inotify_device *dev; | 581 | struct inotify_device *dev; |
582 | struct inotify_handle *ih; | 582 | struct inotify_handle *ih; |
@@ -655,12 +655,13 @@ out_put_fd: | |||
655 | return ret; | 655 | return ret; |
656 | } | 656 | } |
657 | 657 | ||
658 | asmlinkage long sys_inotify_init(void) | 658 | SYSCALL_DEFINE0(inotify_init) |
659 | { | 659 | { |
660 | return sys_inotify_init1(0); | 660 | return sys_inotify_init1(0); |
661 | } | 661 | } |
662 | 662 | ||
663 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *pathname, u32 mask) | 663 | SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, |
664 | u32, mask) | ||
664 | { | 665 | { |
665 | struct inode *inode; | 666 | struct inode *inode; |
666 | struct inotify_device *dev; | 667 | struct inotify_device *dev; |
@@ -704,7 +705,7 @@ fput_and_out: | |||
704 | return ret; | 705 | return ret; |
705 | } | 706 | } |
706 | 707 | ||
707 | asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd) | 708 | SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd) |
708 | { | 709 | { |
709 | struct file *filp; | 710 | struct file *filp; |
710 | struct inotify_device *dev; | 711 | struct inotify_device *dev; |
@@ -122,7 +122,7 @@ static int vfs_statfs64(struct dentry *dentry, struct statfs64 *buf) | |||
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||
125 | asmlinkage long sys_statfs(const char __user *pathname, struct statfs __user * buf) | 125 | SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf) |
126 | { | 126 | { |
127 | struct path path; | 127 | struct path path; |
128 | int error; | 128 | int error; |
@@ -138,8 +138,7 @@ asmlinkage long sys_statfs(const char __user *pathname, struct statfs __user * b | |||
138 | return error; | 138 | return error; |
139 | } | 139 | } |
140 | 140 | ||
141 | 141 | SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf) | |
142 | asmlinkage long sys_statfs64(const char __user *pathname, size_t sz, struct statfs64 __user *buf) | ||
143 | { | 142 | { |
144 | struct path path; | 143 | struct path path; |
145 | long error; | 144 | long error; |
@@ -157,8 +156,7 @@ asmlinkage long sys_statfs64(const char __user *pathname, size_t sz, struct stat | |||
157 | return error; | 156 | return error; |
158 | } | 157 | } |
159 | 158 | ||
160 | 159 | SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) | |
161 | asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user * buf) | ||
162 | { | 160 | { |
163 | struct file * file; | 161 | struct file * file; |
164 | struct statfs tmp; | 162 | struct statfs tmp; |
@@ -176,7 +174,7 @@ out: | |||
176 | return error; | 174 | return error; |
177 | } | 175 | } |
178 | 176 | ||
179 | asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz, struct statfs64 __user *buf) | 177 | SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) |
180 | { | 178 | { |
181 | struct file * file; | 179 | struct file * file; |
182 | struct statfs64 tmp; | 180 | struct statfs64 tmp; |
@@ -289,7 +287,7 @@ out: | |||
289 | return error; | 287 | return error; |
290 | } | 288 | } |
291 | 289 | ||
292 | asmlinkage long sys_truncate(const char __user * path, unsigned long length) | 290 | SYSCALL_DEFINE2(truncate, const char __user *, path, unsigned long, length) |
293 | { | 291 | { |
294 | /* on 32-bit boxen it will cut the range 2^31--2^32-1 off */ | 292 | /* on 32-bit boxen it will cut the range 2^31--2^32-1 off */ |
295 | return do_sys_truncate(path, (long)length); | 293 | return do_sys_truncate(path, (long)length); |
@@ -341,7 +339,7 @@ out: | |||
341 | return error; | 339 | return error; |
342 | } | 340 | } |
343 | 341 | ||
344 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) | 342 | SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length) |
345 | { | 343 | { |
346 | long ret = do_sys_ftruncate(fd, length, 1); | 344 | long ret = do_sys_ftruncate(fd, length, 1); |
347 | /* avoid REGPARM breakage on x86: */ | 345 | /* avoid REGPARM breakage on x86: */ |
@@ -351,21 +349,35 @@ asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) | |||
351 | 349 | ||
352 | /* LFS versions of truncate are only needed on 32 bit machines */ | 350 | /* LFS versions of truncate are only needed on 32 bit machines */ |
353 | #if BITS_PER_LONG == 32 | 351 | #if BITS_PER_LONG == 32 |
354 | asmlinkage long sys_truncate64(const char __user * path, loff_t length) | 352 | SYSCALL_DEFINE(truncate64)(const char __user * path, loff_t length) |
355 | { | 353 | { |
356 | return do_sys_truncate(path, length); | 354 | return do_sys_truncate(path, length); |
357 | } | 355 | } |
356 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
357 | asmlinkage long SyS_truncate64(long path, loff_t length) | ||
358 | { | ||
359 | return SYSC_truncate64((const char __user *) path, length); | ||
360 | } | ||
361 | SYSCALL_ALIAS(sys_truncate64, SyS_truncate64); | ||
362 | #endif | ||
358 | 363 | ||
359 | asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length) | 364 | SYSCALL_DEFINE(ftruncate64)(unsigned int fd, loff_t length) |
360 | { | 365 | { |
361 | long ret = do_sys_ftruncate(fd, length, 0); | 366 | long ret = do_sys_ftruncate(fd, length, 0); |
362 | /* avoid REGPARM breakage on x86: */ | 367 | /* avoid REGPARM breakage on x86: */ |
363 | asmlinkage_protect(2, ret, fd, length); | 368 | asmlinkage_protect(2, ret, fd, length); |
364 | return ret; | 369 | return ret; |
365 | } | 370 | } |
371 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
372 | asmlinkage long SyS_ftruncate64(long fd, loff_t length) | ||
373 | { | ||
374 | return SYSC_ftruncate64((unsigned int) fd, length); | ||
375 | } | ||
376 | SYSCALL_ALIAS(sys_ftruncate64, SyS_ftruncate64); | ||
366 | #endif | 377 | #endif |
378 | #endif /* BITS_PER_LONG == 32 */ | ||
367 | 379 | ||
368 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len) | 380 | SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len) |
369 | { | 381 | { |
370 | struct file *file; | 382 | struct file *file; |
371 | struct inode *inode; | 383 | struct inode *inode; |
@@ -422,13 +434,20 @@ out_fput: | |||
422 | out: | 434 | out: |
423 | return ret; | 435 | return ret; |
424 | } | 436 | } |
437 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
438 | asmlinkage long SyS_fallocate(long fd, long mode, loff_t offset, loff_t len) | ||
439 | { | ||
440 | return SYSC_fallocate((int)fd, (int)mode, offset, len); | ||
441 | } | ||
442 | SYSCALL_ALIAS(sys_fallocate, SyS_fallocate); | ||
443 | #endif | ||
425 | 444 | ||
426 | /* | 445 | /* |
427 | * access() needs to use the real uid/gid, not the effective uid/gid. | 446 | * access() needs to use the real uid/gid, not the effective uid/gid. |
428 | * We do this by temporarily clearing all FS-related capabilities and | 447 | * We do this by temporarily clearing all FS-related capabilities and |
429 | * switching the fsuid/fsgid around to the real ones. | 448 | * switching the fsuid/fsgid around to the real ones. |
430 | */ | 449 | */ |
431 | asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode) | 450 | SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) |
432 | { | 451 | { |
433 | const struct cred *old_cred; | 452 | const struct cred *old_cred; |
434 | struct cred *override_cred; | 453 | struct cred *override_cred; |
@@ -498,12 +517,12 @@ out: | |||
498 | return res; | 517 | return res; |
499 | } | 518 | } |
500 | 519 | ||
501 | asmlinkage long sys_access(const char __user *filename, int mode) | 520 | SYSCALL_DEFINE2(access, const char __user *, filename, int, mode) |
502 | { | 521 | { |
503 | return sys_faccessat(AT_FDCWD, filename, mode); | 522 | return sys_faccessat(AT_FDCWD, filename, mode); |
504 | } | 523 | } |
505 | 524 | ||
506 | asmlinkage long sys_chdir(const char __user * filename) | 525 | SYSCALL_DEFINE1(chdir, const char __user *, filename) |
507 | { | 526 | { |
508 | struct path path; | 527 | struct path path; |
509 | int error; | 528 | int error; |
@@ -524,7 +543,7 @@ out: | |||
524 | return error; | 543 | return error; |
525 | } | 544 | } |
526 | 545 | ||
527 | asmlinkage long sys_fchdir(unsigned int fd) | 546 | SYSCALL_DEFINE1(fchdir, unsigned int, fd) |
528 | { | 547 | { |
529 | struct file *file; | 548 | struct file *file; |
530 | struct inode *inode; | 549 | struct inode *inode; |
@@ -550,7 +569,7 @@ out: | |||
550 | return error; | 569 | return error; |
551 | } | 570 | } |
552 | 571 | ||
553 | asmlinkage long sys_chroot(const char __user * filename) | 572 | SYSCALL_DEFINE1(chroot, const char __user *, filename) |
554 | { | 573 | { |
555 | struct path path; | 574 | struct path path; |
556 | int error; | 575 | int error; |
@@ -575,7 +594,7 @@ out: | |||
575 | return error; | 594 | return error; |
576 | } | 595 | } |
577 | 596 | ||
578 | asmlinkage long sys_fchmod(unsigned int fd, mode_t mode) | 597 | SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode) |
579 | { | 598 | { |
580 | struct inode * inode; | 599 | struct inode * inode; |
581 | struct dentry * dentry; | 600 | struct dentry * dentry; |
@@ -609,8 +628,7 @@ out: | |||
609 | return err; | 628 | return err; |
610 | } | 629 | } |
611 | 630 | ||
612 | asmlinkage long sys_fchmodat(int dfd, const char __user *filename, | 631 | SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode) |
613 | mode_t mode) | ||
614 | { | 632 | { |
615 | struct path path; | 633 | struct path path; |
616 | struct inode *inode; | 634 | struct inode *inode; |
@@ -639,7 +657,7 @@ out: | |||
639 | return error; | 657 | return error; |
640 | } | 658 | } |
641 | 659 | ||
642 | asmlinkage long sys_chmod(const char __user *filename, mode_t mode) | 660 | SYSCALL_DEFINE2(chmod, const char __user *, filename, mode_t, mode) |
643 | { | 661 | { |
644 | return sys_fchmodat(AT_FDCWD, filename, mode); | 662 | return sys_fchmodat(AT_FDCWD, filename, mode); |
645 | } | 663 | } |
@@ -669,7 +687,7 @@ static int chown_common(struct dentry * dentry, uid_t user, gid_t group) | |||
669 | return error; | 687 | return error; |
670 | } | 688 | } |
671 | 689 | ||
672 | asmlinkage long sys_chown(const char __user * filename, uid_t user, gid_t group) | 690 | SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group) |
673 | { | 691 | { |
674 | struct path path; | 692 | struct path path; |
675 | int error; | 693 | int error; |
@@ -688,8 +706,8 @@ out: | |||
688 | return error; | 706 | return error; |
689 | } | 707 | } |
690 | 708 | ||
691 | asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, | 709 | SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user, |
692 | gid_t group, int flag) | 710 | gid_t, group, int, flag) |
693 | { | 711 | { |
694 | struct path path; | 712 | struct path path; |
695 | int error = -EINVAL; | 713 | int error = -EINVAL; |
@@ -713,7 +731,7 @@ out: | |||
713 | return error; | 731 | return error; |
714 | } | 732 | } |
715 | 733 | ||
716 | asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group) | 734 | SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group) |
717 | { | 735 | { |
718 | struct path path; | 736 | struct path path; |
719 | int error; | 737 | int error; |
@@ -732,8 +750,7 @@ out: | |||
732 | return error; | 750 | return error; |
733 | } | 751 | } |
734 | 752 | ||
735 | 753 | SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) | |
736 | asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group) | ||
737 | { | 754 | { |
738 | struct file * file; | 755 | struct file * file; |
739 | int error = -EBADF; | 756 | int error = -EBADF; |
@@ -1029,7 +1046,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode) | |||
1029 | return fd; | 1046 | return fd; |
1030 | } | 1047 | } |
1031 | 1048 | ||
1032 | asmlinkage long sys_open(const char __user *filename, int flags, int mode) | 1049 | SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) |
1033 | { | 1050 | { |
1034 | long ret; | 1051 | long ret; |
1035 | 1052 | ||
@@ -1042,8 +1059,8 @@ asmlinkage long sys_open(const char __user *filename, int flags, int mode) | |||
1042 | return ret; | 1059 | return ret; |
1043 | } | 1060 | } |
1044 | 1061 | ||
1045 | asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | 1062 | SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, |
1046 | int mode) | 1063 | int, mode) |
1047 | { | 1064 | { |
1048 | long ret; | 1065 | long ret; |
1049 | 1066 | ||
@@ -1062,7 +1079,7 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | |||
1062 | * For backward compatibility? Maybe this should be moved | 1079 | * For backward compatibility? Maybe this should be moved |
1063 | * into arch/i386 instead? | 1080 | * into arch/i386 instead? |
1064 | */ | 1081 | */ |
1065 | asmlinkage long sys_creat(const char __user * pathname, int mode) | 1082 | SYSCALL_DEFINE2(creat, const char __user *, pathname, int, mode) |
1066 | { | 1083 | { |
1067 | return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); | 1084 | return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); |
1068 | } | 1085 | } |
@@ -1098,7 +1115,7 @@ EXPORT_SYMBOL(filp_close); | |||
1098 | * releasing the fd. This ensures that one clone task can't release | 1115 | * releasing the fd. This ensures that one clone task can't release |
1099 | * an fd while another clone is opening it. | 1116 | * an fd while another clone is opening it. |
1100 | */ | 1117 | */ |
1101 | asmlinkage long sys_close(unsigned int fd) | 1118 | SYSCALL_DEFINE1(close, unsigned int, fd) |
1102 | { | 1119 | { |
1103 | struct file * filp; | 1120 | struct file * filp; |
1104 | struct files_struct *files = current->files; | 1121 | struct files_struct *files = current->files; |
@@ -1131,14 +1148,13 @@ out_unlock: | |||
1131 | spin_unlock(&files->file_lock); | 1148 | spin_unlock(&files->file_lock); |
1132 | return -EBADF; | 1149 | return -EBADF; |
1133 | } | 1150 | } |
1134 | |||
1135 | EXPORT_SYMBOL(sys_close); | 1151 | EXPORT_SYMBOL(sys_close); |
1136 | 1152 | ||
1137 | /* | 1153 | /* |
1138 | * This routine simulates a hangup on the tty, to arrange that users | 1154 | * This routine simulates a hangup on the tty, to arrange that users |
1139 | * are given clean terminals at login time. | 1155 | * are given clean terminals at login time. |
1140 | */ | 1156 | */ |
1141 | asmlinkage long sys_vhangup(void) | 1157 | SYSCALL_DEFINE0(vhangup) |
1142 | { | 1158 | { |
1143 | if (capable(CAP_SYS_TTY_CONFIG)) { | 1159 | if (capable(CAP_SYS_TTY_CONFIG)) { |
1144 | tty_vhangup_self(); | 1160 | tty_vhangup_self(); |
@@ -1043,7 +1043,7 @@ int do_pipe(int *fd) | |||
1043 | * sys_pipe() is the normal C calling standard for creating | 1043 | * sys_pipe() is the normal C calling standard for creating |
1044 | * a pipe. It's not the way Unix traditionally does this, though. | 1044 | * a pipe. It's not the way Unix traditionally does this, though. |
1045 | */ | 1045 | */ |
1046 | asmlinkage long __weak sys_pipe2(int __user *fildes, int flags) | 1046 | SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags) |
1047 | { | 1047 | { |
1048 | int fd[2]; | 1048 | int fd[2]; |
1049 | int error; | 1049 | int error; |
@@ -1059,7 +1059,7 @@ asmlinkage long __weak sys_pipe2(int __user *fildes, int flags) | |||
1059 | return error; | 1059 | return error; |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | asmlinkage long __weak sys_pipe(int __user *fildes) | 1062 | SYSCALL_DEFINE1(pipe, int __user *, fildes) |
1063 | { | 1063 | { |
1064 | return sys_pipe2(fildes, 0); | 1064 | return sys_pipe2(fildes, 0); |
1065 | } | 1065 | } |
diff --git a/fs/quota.c b/fs/quota.c index 4a8c94f05f76..d76ada914f98 100644 --- a/fs/quota.c +++ b/fs/quota.c | |||
@@ -371,7 +371,8 @@ static inline struct super_block *quotactl_block(const char __user *special) | |||
371 | * calls. Maybe we need to add the process quotas etc. in the future, | 371 | * calls. Maybe we need to add the process quotas etc. in the future, |
372 | * but we probably should use rlimits for that. | 372 | * but we probably should use rlimits for that. |
373 | */ | 373 | */ |
374 | asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t id, void __user *addr) | 374 | SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special, |
375 | qid_t, id, void __user *, addr) | ||
375 | { | 376 | { |
376 | uint cmds, type; | 377 | uint cmds, type; |
377 | struct super_block *sb = NULL; | 378 | struct super_block *sb = NULL; |
diff --git a/fs/read_write.c b/fs/read_write.c index 5cc6924eb158..400fe81c973e 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -147,7 +147,7 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int origin) | |||
147 | } | 147 | } |
148 | EXPORT_SYMBOL(vfs_llseek); | 148 | EXPORT_SYMBOL(vfs_llseek); |
149 | 149 | ||
150 | asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) | 150 | SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin) |
151 | { | 151 | { |
152 | off_t retval; | 152 | off_t retval; |
153 | struct file * file; | 153 | struct file * file; |
@@ -171,9 +171,9 @@ bad: | |||
171 | } | 171 | } |
172 | 172 | ||
173 | #ifdef __ARCH_WANT_SYS_LLSEEK | 173 | #ifdef __ARCH_WANT_SYS_LLSEEK |
174 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, | 174 | SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high, |
175 | unsigned long offset_low, loff_t __user * result, | 175 | unsigned long, offset_low, loff_t __user *, result, |
176 | unsigned int origin) | 176 | unsigned int, origin) |
177 | { | 177 | { |
178 | int retval; | 178 | int retval; |
179 | struct file * file; | 179 | struct file * file; |
@@ -369,7 +369,7 @@ static inline void file_pos_write(struct file *file, loff_t pos) | |||
369 | file->f_pos = pos; | 369 | file->f_pos = pos; |
370 | } | 370 | } |
371 | 371 | ||
372 | asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) | 372 | SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) |
373 | { | 373 | { |
374 | struct file *file; | 374 | struct file *file; |
375 | ssize_t ret = -EBADF; | 375 | ssize_t ret = -EBADF; |
@@ -386,7 +386,8 @@ asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) | |||
386 | return ret; | 386 | return ret; |
387 | } | 387 | } |
388 | 388 | ||
389 | asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count) | 389 | SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf, |
390 | size_t, count) | ||
390 | { | 391 | { |
391 | struct file *file; | 392 | struct file *file; |
392 | ssize_t ret = -EBADF; | 393 | ssize_t ret = -EBADF; |
@@ -403,8 +404,8 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t co | |||
403 | return ret; | 404 | return ret; |
404 | } | 405 | } |
405 | 406 | ||
406 | asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | 407 | SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf, |
407 | size_t count, loff_t pos) | 408 | size_t count, loff_t pos) |
408 | { | 409 | { |
409 | struct file *file; | 410 | struct file *file; |
410 | ssize_t ret = -EBADF; | 411 | ssize_t ret = -EBADF; |
@@ -423,9 +424,17 @@ asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | |||
423 | 424 | ||
424 | return ret; | 425 | return ret; |
425 | } | 426 | } |
427 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
428 | asmlinkage long SyS_pread64(long fd, long buf, long count, loff_t pos) | ||
429 | { | ||
430 | return SYSC_pread64((unsigned int) fd, (char __user *) buf, | ||
431 | (size_t) count, pos); | ||
432 | } | ||
433 | SYSCALL_ALIAS(sys_pread64, SyS_pread64); | ||
434 | #endif | ||
426 | 435 | ||
427 | asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | 436 | SYSCALL_DEFINE(pwrite64)(unsigned int fd, const char __user *buf, |
428 | size_t count, loff_t pos) | 437 | size_t count, loff_t pos) |
429 | { | 438 | { |
430 | struct file *file; | 439 | struct file *file; |
431 | ssize_t ret = -EBADF; | 440 | ssize_t ret = -EBADF; |
@@ -444,6 +453,14 @@ asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | |||
444 | 453 | ||
445 | return ret; | 454 | return ret; |
446 | } | 455 | } |
456 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
457 | asmlinkage long SyS_pwrite64(long fd, long buf, long count, loff_t pos) | ||
458 | { | ||
459 | return SYSC_pwrite64((unsigned int) fd, (const char __user *) buf, | ||
460 | (size_t) count, pos); | ||
461 | } | ||
462 | SYSCALL_ALIAS(sys_pwrite64, SyS_pwrite64); | ||
463 | #endif | ||
447 | 464 | ||
448 | /* | 465 | /* |
449 | * Reduce an iovec's length in-place. Return the resulting number of segments | 466 | * Reduce an iovec's length in-place. Return the resulting number of segments |
@@ -672,8 +689,8 @@ ssize_t vfs_writev(struct file *file, const struct iovec __user *vec, | |||
672 | 689 | ||
673 | EXPORT_SYMBOL(vfs_writev); | 690 | EXPORT_SYMBOL(vfs_writev); |
674 | 691 | ||
675 | asmlinkage ssize_t | 692 | SYSCALL_DEFINE3(readv, unsigned long, fd, const struct iovec __user *, vec, |
676 | sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | 693 | unsigned long, vlen) |
677 | { | 694 | { |
678 | struct file *file; | 695 | struct file *file; |
679 | ssize_t ret = -EBADF; | 696 | ssize_t ret = -EBADF; |
@@ -693,8 +710,8 @@ sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | |||
693 | return ret; | 710 | return ret; |
694 | } | 711 | } |
695 | 712 | ||
696 | asmlinkage ssize_t | 713 | SYSCALL_DEFINE3(writev, unsigned long, fd, const struct iovec __user *, vec, |
697 | sys_writev(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | 714 | unsigned long, vlen) |
698 | { | 715 | { |
699 | struct file *file; | 716 | struct file *file; |
700 | ssize_t ret = -EBADF; | 717 | ssize_t ret = -EBADF; |
@@ -812,7 +829,7 @@ out: | |||
812 | return retval; | 829 | return retval; |
813 | } | 830 | } |
814 | 831 | ||
815 | asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, size_t count) | 832 | SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count) |
816 | { | 833 | { |
817 | loff_t pos; | 834 | loff_t pos; |
818 | off_t off; | 835 | off_t off; |
@@ -831,7 +848,7 @@ asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, siz | |||
831 | return do_sendfile(out_fd, in_fd, NULL, count, 0); | 848 | return do_sendfile(out_fd, in_fd, NULL, count, 0); |
832 | } | 849 | } |
833 | 850 | ||
834 | asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t __user *offset, size_t count) | 851 | SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count) |
835 | { | 852 | { |
836 | loff_t pos; | 853 | loff_t pos; |
837 | ssize_t ret; | 854 | ssize_t ret; |
diff --git a/fs/readdir.c b/fs/readdir.c index b318d9b5af2e..7723401f8d8b 100644 --- a/fs/readdir.c +++ b/fs/readdir.c | |||
@@ -102,7 +102,8 @@ efault: | |||
102 | return -EFAULT; | 102 | return -EFAULT; |
103 | } | 103 | } |
104 | 104 | ||
105 | asmlinkage long old_readdir(unsigned int fd, struct old_linux_dirent __user * dirent, unsigned int count) | 105 | SYSCALL_DEFINE3(old_readdir, unsigned int, fd, |
106 | struct old_linux_dirent __user *, dirent, unsigned int, count) | ||
106 | { | 107 | { |
107 | int error; | 108 | int error; |
108 | struct file * file; | 109 | struct file * file; |
@@ -187,7 +188,8 @@ efault: | |||
187 | return -EFAULT; | 188 | return -EFAULT; |
188 | } | 189 | } |
189 | 190 | ||
190 | asmlinkage long sys_getdents(unsigned int fd, struct linux_dirent __user * dirent, unsigned int count) | 191 | SYSCALL_DEFINE3(getdents, unsigned int, fd, |
192 | struct linux_dirent __user *, dirent, unsigned int, count) | ||
191 | { | 193 | { |
192 | struct file * file; | 194 | struct file * file; |
193 | struct linux_dirent __user * lastdirent; | 195 | struct linux_dirent __user * lastdirent; |
@@ -268,7 +270,8 @@ efault: | |||
268 | return -EFAULT; | 270 | return -EFAULT; |
269 | } | 271 | } |
270 | 272 | ||
271 | asmlinkage long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count) | 273 | SYSCALL_DEFINE3(getdents64, unsigned int, fd, |
274 | struct linux_dirent64 __user *, dirent, unsigned int, count) | ||
272 | { | 275 | { |
273 | struct file * file; | 276 | struct file * file; |
274 | struct linux_dirent64 __user * lastdirent; | 277 | struct linux_dirent64 __user * lastdirent; |
diff --git a/fs/select.c b/fs/select.c index 08b91beed806..0fe0e1469df3 100644 --- a/fs/select.c +++ b/fs/select.c | |||
@@ -557,8 +557,8 @@ out_nofds: | |||
557 | return ret; | 557 | return ret; |
558 | } | 558 | } |
559 | 559 | ||
560 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | 560 | SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp, |
561 | fd_set __user *exp, struct timeval __user *tvp) | 561 | fd_set __user *, exp, struct timeval __user *, tvp) |
562 | { | 562 | { |
563 | struct timespec end_time, *to = NULL; | 563 | struct timespec end_time, *to = NULL; |
564 | struct timeval tv; | 564 | struct timeval tv; |
@@ -582,9 +582,9 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | |||
582 | } | 582 | } |
583 | 583 | ||
584 | #ifdef HAVE_SET_RESTORE_SIGMASK | 584 | #ifdef HAVE_SET_RESTORE_SIGMASK |
585 | asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, | 585 | static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp, |
586 | fd_set __user *exp, struct timespec __user *tsp, | 586 | fd_set __user *exp, struct timespec __user *tsp, |
587 | const sigset_t __user *sigmask, size_t sigsetsize) | 587 | const sigset_t __user *sigmask, size_t sigsetsize) |
588 | { | 588 | { |
589 | sigset_t ksigmask, sigsaved; | 589 | sigset_t ksigmask, sigsaved; |
590 | struct timespec ts, end_time, *to = NULL; | 590 | struct timespec ts, end_time, *to = NULL; |
@@ -610,7 +610,7 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, | |||
610 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); | 610 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); |
611 | } | 611 | } |
612 | 612 | ||
613 | ret = core_sys_select(n, inp, outp, exp, &end_time); | 613 | ret = core_sys_select(n, inp, outp, exp, to); |
614 | ret = poll_select_copy_remaining(&end_time, tsp, 0, ret); | 614 | ret = poll_select_copy_remaining(&end_time, tsp, 0, ret); |
615 | 615 | ||
616 | if (ret == -ERESTARTNOHAND) { | 616 | if (ret == -ERESTARTNOHAND) { |
@@ -636,8 +636,9 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, | |||
636 | * which has a pointer to the sigset_t itself followed by a size_t containing | 636 | * which has a pointer to the sigset_t itself followed by a size_t containing |
637 | * the sigset size. | 637 | * the sigset size. |
638 | */ | 638 | */ |
639 | asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp, | 639 | SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp, |
640 | fd_set __user *exp, struct timespec __user *tsp, void __user *sig) | 640 | fd_set __user *, exp, struct timespec __user *, tsp, |
641 | void __user *, sig) | ||
641 | { | 642 | { |
642 | size_t sigsetsize = 0; | 643 | size_t sigsetsize = 0; |
643 | sigset_t __user *up = NULL; | 644 | sigset_t __user *up = NULL; |
@@ -650,7 +651,7 @@ asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp, | |||
650 | return -EFAULT; | 651 | return -EFAULT; |
651 | } | 652 | } |
652 | 653 | ||
653 | return sys_pselect7(n, inp, outp, exp, tsp, up, sigsetsize); | 654 | return do_pselect(n, inp, outp, exp, tsp, up, sigsetsize); |
654 | } | 655 | } |
655 | #endif /* HAVE_SET_RESTORE_SIGMASK */ | 656 | #endif /* HAVE_SET_RESTORE_SIGMASK */ |
656 | 657 | ||
@@ -854,8 +855,8 @@ static long do_restart_poll(struct restart_block *restart_block) | |||
854 | return ret; | 855 | return ret; |
855 | } | 856 | } |
856 | 857 | ||
857 | asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | 858 | SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, |
858 | long timeout_msecs) | 859 | long, timeout_msecs) |
859 | { | 860 | { |
860 | struct timespec end_time, *to = NULL; | 861 | struct timespec end_time, *to = NULL; |
861 | int ret; | 862 | int ret; |
@@ -889,9 +890,9 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | |||
889 | } | 890 | } |
890 | 891 | ||
891 | #ifdef HAVE_SET_RESTORE_SIGMASK | 892 | #ifdef HAVE_SET_RESTORE_SIGMASK |
892 | asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, | 893 | SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, unsigned int, nfds, |
893 | struct timespec __user *tsp, const sigset_t __user *sigmask, | 894 | struct timespec __user *, tsp, const sigset_t __user *, sigmask, |
894 | size_t sigsetsize) | 895 | size_t, sigsetsize) |
895 | { | 896 | { |
896 | sigset_t ksigmask, sigsaved; | 897 | sigset_t ksigmask, sigsaved; |
897 | struct timespec ts, end_time, *to = NULL; | 898 | struct timespec ts, end_time, *to = NULL; |
diff --git a/fs/signalfd.c b/fs/signalfd.c index 9c39bc7f8431..b07565c94386 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c | |||
@@ -205,8 +205,8 @@ static const struct file_operations signalfd_fops = { | |||
205 | .read = signalfd_read, | 205 | .read = signalfd_read, |
206 | }; | 206 | }; |
207 | 207 | ||
208 | asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, | 208 | SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, |
209 | size_t sizemask, int flags) | 209 | size_t, sizemask, int, flags) |
210 | { | 210 | { |
211 | sigset_t sigmask; | 211 | sigset_t sigmask; |
212 | struct signalfd_ctx *ctx; | 212 | struct signalfd_ctx *ctx; |
@@ -259,8 +259,8 @@ asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, | |||
259 | return ufd; | 259 | return ufd; |
260 | } | 260 | } |
261 | 261 | ||
262 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, | 262 | SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask, |
263 | size_t sizemask) | 263 | size_t, sizemask) |
264 | { | 264 | { |
265 | return sys_signalfd4(ufd, user_mask, sizemask, 0); | 265 | return sys_signalfd4(ufd, user_mask, sizemask, 0); |
266 | } | 266 | } |
diff --git a/fs/splice.c b/fs/splice.c index a54b3e3f10a7..4ed0ba44a966 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1435,8 +1435,8 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov, | |||
1435 | * Currently we punt and implement it as a normal copy, see pipe_to_user(). | 1435 | * Currently we punt and implement it as a normal copy, see pipe_to_user(). |
1436 | * | 1436 | * |
1437 | */ | 1437 | */ |
1438 | asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, | 1438 | SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, iov, |
1439 | unsigned long nr_segs, unsigned int flags) | 1439 | unsigned long, nr_segs, unsigned int, flags) |
1440 | { | 1440 | { |
1441 | struct file *file; | 1441 | struct file *file; |
1442 | long error; | 1442 | long error; |
@@ -1461,9 +1461,9 @@ asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, | |||
1461 | return error; | 1461 | return error; |
1462 | } | 1462 | } |
1463 | 1463 | ||
1464 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, | 1464 | SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in, |
1465 | int fd_out, loff_t __user *off_out, | 1465 | int, fd_out, loff_t __user *, off_out, |
1466 | size_t len, unsigned int flags) | 1466 | size_t, len, unsigned int, flags) |
1467 | { | 1467 | { |
1468 | long error; | 1468 | long error; |
1469 | struct file *in, *out; | 1469 | struct file *in, *out; |
@@ -1685,7 +1685,7 @@ static long do_tee(struct file *in, struct file *out, size_t len, | |||
1685 | return ret; | 1685 | return ret; |
1686 | } | 1686 | } |
1687 | 1687 | ||
1688 | asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags) | 1688 | SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags) |
1689 | { | 1689 | { |
1690 | struct file *in; | 1690 | struct file *in; |
1691 | int error, fput_in; | 1691 | int error, fput_in; |
diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h index 6840da1bf21e..283daafc568e 100644 --- a/fs/squashfs/squashfs_fs.h +++ b/fs/squashfs/squashfs_fs.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE | 26 | #define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE |
27 | #define SQUASHFS_MAJOR 4 | 27 | #define SQUASHFS_MAJOR 4 |
28 | #define SQUASHFS_MINOR 0 | 28 | #define SQUASHFS_MINOR 0 |
29 | #define SQUASHFS_MAGIC 0x73717368 | ||
30 | #define SQUASHFS_START 0 | 29 | #define SQUASHFS_START 0 |
31 | 30 | ||
32 | /* size of metadata (inode and directory) blocks */ | 31 | /* size of metadata (inode and directory) blocks */ |
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index a0466d7467b2..071df5b5b491 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/module.h> | 36 | #include <linux/module.h> |
37 | #include <linux/zlib.h> | 37 | #include <linux/zlib.h> |
38 | #include <linux/magic.h> | ||
38 | 39 | ||
39 | #include "squashfs_fs.h" | 40 | #include "squashfs_fs.h" |
40 | #include "squashfs_fs_sb.h" | 41 | #include "squashfs_fs_sb.h" |
@@ -152,7 +152,7 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta | |||
152 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; | 152 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; |
153 | } | 153 | } |
154 | 154 | ||
155 | asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user * statbuf) | 155 | SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) |
156 | { | 156 | { |
157 | struct kstat stat; | 157 | struct kstat stat; |
158 | int error = vfs_stat_fd(AT_FDCWD, filename, &stat); | 158 | int error = vfs_stat_fd(AT_FDCWD, filename, &stat); |
@@ -162,7 +162,8 @@ asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user | |||
162 | 162 | ||
163 | return error; | 163 | return error; |
164 | } | 164 | } |
165 | asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf) | 165 | |
166 | SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) | ||
166 | { | 167 | { |
167 | struct kstat stat; | 168 | struct kstat stat; |
168 | int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); | 169 | int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); |
@@ -172,7 +173,8 @@ asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __use | |||
172 | 173 | ||
173 | return error; | 174 | return error; |
174 | } | 175 | } |
175 | asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat __user * statbuf) | 176 | |
177 | SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, statbuf) | ||
176 | { | 178 | { |
177 | struct kstat stat; | 179 | struct kstat stat; |
178 | int error = vfs_fstat(fd, &stat); | 180 | int error = vfs_fstat(fd, &stat); |
@@ -235,7 +237,7 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf) | |||
235 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; | 237 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; |
236 | } | 238 | } |
237 | 239 | ||
238 | asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf) | 240 | SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) |
239 | { | 241 | { |
240 | struct kstat stat; | 242 | struct kstat stat; |
241 | int error = vfs_stat_fd(AT_FDCWD, filename, &stat); | 243 | int error = vfs_stat_fd(AT_FDCWD, filename, &stat); |
@@ -246,7 +248,7 @@ asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf) | |||
246 | return error; | 248 | return error; |
247 | } | 249 | } |
248 | 250 | ||
249 | asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf) | 251 | SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf) |
250 | { | 252 | { |
251 | struct kstat stat; | 253 | struct kstat stat; |
252 | int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); | 254 | int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); |
@@ -258,8 +260,8 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf) | |||
258 | } | 260 | } |
259 | 261 | ||
260 | #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) | 262 | #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) |
261 | asmlinkage long sys_newfstatat(int dfd, char __user *filename, | 263 | SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename, |
262 | struct stat __user *statbuf, int flag) | 264 | struct stat __user *, statbuf, int, flag) |
263 | { | 265 | { |
264 | struct kstat stat; | 266 | struct kstat stat; |
265 | int error = -EINVAL; | 267 | int error = -EINVAL; |
@@ -280,7 +282,7 @@ out: | |||
280 | } | 282 | } |
281 | #endif | 283 | #endif |
282 | 284 | ||
283 | asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) | 285 | SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf) |
284 | { | 286 | { |
285 | struct kstat stat; | 287 | struct kstat stat; |
286 | int error = vfs_fstat(fd, &stat); | 288 | int error = vfs_fstat(fd, &stat); |
@@ -291,8 +293,8 @@ asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) | |||
291 | return error; | 293 | return error; |
292 | } | 294 | } |
293 | 295 | ||
294 | asmlinkage long sys_readlinkat(int dfd, const char __user *pathname, | 296 | SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname, |
295 | char __user *buf, int bufsiz) | 297 | char __user *, buf, int, bufsiz) |
296 | { | 298 | { |
297 | struct path path; | 299 | struct path path; |
298 | int error; | 300 | int error; |
@@ -318,8 +320,8 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *pathname, | |||
318 | return error; | 320 | return error; |
319 | } | 321 | } |
320 | 322 | ||
321 | asmlinkage long sys_readlink(const char __user *path, char __user *buf, | 323 | SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf, |
322 | int bufsiz) | 324 | int, bufsiz) |
323 | { | 325 | { |
324 | return sys_readlinkat(AT_FDCWD, path, buf, bufsiz); | 326 | return sys_readlinkat(AT_FDCWD, path, buf, bufsiz); |
325 | } | 327 | } |
@@ -365,7 +367,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf) | |||
365 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; | 367 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; |
366 | } | 368 | } |
367 | 369 | ||
368 | asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf) | 370 | SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf) |
369 | { | 371 | { |
370 | struct kstat stat; | 372 | struct kstat stat; |
371 | int error = vfs_stat(filename, &stat); | 373 | int error = vfs_stat(filename, &stat); |
@@ -375,7 +377,8 @@ asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbu | |||
375 | 377 | ||
376 | return error; | 378 | return error; |
377 | } | 379 | } |
378 | asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf) | 380 | |
381 | SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf) | ||
379 | { | 382 | { |
380 | struct kstat stat; | 383 | struct kstat stat; |
381 | int error = vfs_lstat(filename, &stat); | 384 | int error = vfs_lstat(filename, &stat); |
@@ -385,7 +388,8 @@ asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statb | |||
385 | 388 | ||
386 | return error; | 389 | return error; |
387 | } | 390 | } |
388 | asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf) | 391 | |
392 | SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf) | ||
389 | { | 393 | { |
390 | struct kstat stat; | 394 | struct kstat stat; |
391 | int error = vfs_fstat(fd, &stat); | 395 | int error = vfs_fstat(fd, &stat); |
@@ -396,8 +400,8 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf) | |||
396 | return error; | 400 | return error; |
397 | } | 401 | } |
398 | 402 | ||
399 | asmlinkage long sys_fstatat64(int dfd, char __user *filename, | 403 | SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename, |
400 | struct stat64 __user *statbuf, int flag) | 404 | struct stat64 __user *, statbuf, int, flag) |
401 | { | 405 | { |
402 | struct kstat stat; | 406 | struct kstat stat; |
403 | int error = -EINVAL; | 407 | int error = -EINVAL; |
diff --git a/fs/super.c b/fs/super.c index ed080c417167..645e5403f2a0 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -544,7 +544,7 @@ rescan: | |||
544 | return NULL; | 544 | return NULL; |
545 | } | 545 | } |
546 | 546 | ||
547 | asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf) | 547 | SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf) |
548 | { | 548 | { |
549 | struct super_block *s; | 549 | struct super_block *s; |
550 | struct ustat tmp; | 550 | struct ustat tmp; |
@@ -36,7 +36,7 @@ static void do_sync(unsigned long wait) | |||
36 | laptop_sync_completion(); | 36 | laptop_sync_completion(); |
37 | } | 37 | } |
38 | 38 | ||
39 | asmlinkage long sys_sync(void) | 39 | SYSCALL_DEFINE0(sync) |
40 | { | 40 | { |
41 | do_sync(1); | 41 | do_sync(1); |
42 | return 0; | 42 | return 0; |
@@ -144,12 +144,12 @@ static int do_fsync(unsigned int fd, int datasync) | |||
144 | return ret; | 144 | return ret; |
145 | } | 145 | } |
146 | 146 | ||
147 | asmlinkage long sys_fsync(unsigned int fd) | 147 | SYSCALL_DEFINE1(fsync, unsigned int, fd) |
148 | { | 148 | { |
149 | return do_fsync(fd, 0); | 149 | return do_fsync(fd, 0); |
150 | } | 150 | } |
151 | 151 | ||
152 | asmlinkage long sys_fdatasync(unsigned int fd) | 152 | SYSCALL_DEFINE1(fdatasync, unsigned int, fd) |
153 | { | 153 | { |
154 | return do_fsync(fd, 1); | 154 | return do_fsync(fd, 1); |
155 | } | 155 | } |
@@ -201,8 +201,8 @@ asmlinkage long sys_fdatasync(unsigned int fd) | |||
201 | * already-instantiated disk blocks, there are no guarantees here that the data | 201 | * already-instantiated disk blocks, there are no guarantees here that the data |
202 | * will be available after a crash. | 202 | * will be available after a crash. |
203 | */ | 203 | */ |
204 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | 204 | SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, |
205 | unsigned int flags) | 205 | unsigned int flags) |
206 | { | 206 | { |
207 | int ret; | 207 | int ret; |
208 | struct file *file; | 208 | struct file *file; |
@@ -262,14 +262,32 @@ out_put: | |||
262 | out: | 262 | out: |
263 | return ret; | 263 | return ret; |
264 | } | 264 | } |
265 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
266 | asmlinkage long SyS_sync_file_range(long fd, loff_t offset, loff_t nbytes, | ||
267 | long flags) | ||
268 | { | ||
269 | return SYSC_sync_file_range((int) fd, offset, nbytes, | ||
270 | (unsigned int) flags); | ||
271 | } | ||
272 | SYSCALL_ALIAS(sys_sync_file_range, SyS_sync_file_range); | ||
273 | #endif | ||
265 | 274 | ||
266 | /* It would be nice if people remember that not all the world's an i386 | 275 | /* It would be nice if people remember that not all the world's an i386 |
267 | when they introduce new system calls */ | 276 | when they introduce new system calls */ |
268 | asmlinkage long sys_sync_file_range2(int fd, unsigned int flags, | 277 | SYSCALL_DEFINE(sync_file_range2)(int fd, unsigned int flags, |
269 | loff_t offset, loff_t nbytes) | 278 | loff_t offset, loff_t nbytes) |
270 | { | 279 | { |
271 | return sys_sync_file_range(fd, offset, nbytes, flags); | 280 | return sys_sync_file_range(fd, offset, nbytes, flags); |
272 | } | 281 | } |
282 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
283 | asmlinkage long SyS_sync_file_range2(long fd, long flags, | ||
284 | loff_t offset, loff_t nbytes) | ||
285 | { | ||
286 | return SYSC_sync_file_range2((int) fd, (unsigned int) flags, | ||
287 | offset, nbytes); | ||
288 | } | ||
289 | SYSCALL_ALIAS(sys_sync_file_range2, SyS_sync_file_range2); | ||
290 | #endif | ||
273 | 291 | ||
274 | /* | 292 | /* |
275 | * `endbyte' is inclusive | 293 | * `endbyte' is inclusive |
diff --git a/fs/timerfd.c b/fs/timerfd.c index 0862f0e49d0c..6a123b8ff3f5 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c | |||
@@ -177,7 +177,7 @@ static struct file *timerfd_fget(int fd) | |||
177 | return file; | 177 | return file; |
178 | } | 178 | } |
179 | 179 | ||
180 | asmlinkage long sys_timerfd_create(int clockid, int flags) | 180 | SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) |
181 | { | 181 | { |
182 | int ufd; | 182 | int ufd; |
183 | struct timerfd_ctx *ctx; | 183 | struct timerfd_ctx *ctx; |
@@ -208,9 +208,9 @@ asmlinkage long sys_timerfd_create(int clockid, int flags) | |||
208 | return ufd; | 208 | return ufd; |
209 | } | 209 | } |
210 | 210 | ||
211 | asmlinkage long sys_timerfd_settime(int ufd, int flags, | 211 | SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags, |
212 | const struct itimerspec __user *utmr, | 212 | const struct itimerspec __user *, utmr, |
213 | struct itimerspec __user *otmr) | 213 | struct itimerspec __user *, otmr) |
214 | { | 214 | { |
215 | struct file *file; | 215 | struct file *file; |
216 | struct timerfd_ctx *ctx; | 216 | struct timerfd_ctx *ctx; |
@@ -265,7 +265,7 @@ asmlinkage long sys_timerfd_settime(int ufd, int flags, | |||
265 | return 0; | 265 | return 0; |
266 | } | 266 | } |
267 | 267 | ||
268 | asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr) | 268 | SYSCALL_DEFINE2(timerfd_gettime, int, ufd, struct itimerspec __user *, otmr) |
269 | { | 269 | { |
270 | struct file *file; | 270 | struct file *file; |
271 | struct timerfd_ctx *ctx; | 271 | struct timerfd_ctx *ctx; |
diff --git a/fs/utimes.c b/fs/utimes.c index 6929e3e91d05..e4c75db5d373 100644 --- a/fs/utimes.c +++ b/fs/utimes.c | |||
@@ -24,7 +24,7 @@ | |||
24 | * must be owner or have write permission. | 24 | * must be owner or have write permission. |
25 | * Else, update from *times, must be owner or super user. | 25 | * Else, update from *times, must be owner or super user. |
26 | */ | 26 | */ |
27 | asmlinkage long sys_utime(char __user *filename, struct utimbuf __user *times) | 27 | SYSCALL_DEFINE2(utime, char __user *, filename, struct utimbuf __user *, times) |
28 | { | 28 | { |
29 | struct timespec tv[2]; | 29 | struct timespec tv[2]; |
30 | 30 | ||
@@ -170,7 +170,8 @@ out: | |||
170 | return error; | 170 | return error; |
171 | } | 171 | } |
172 | 172 | ||
173 | asmlinkage long sys_utimensat(int dfd, char __user *filename, struct timespec __user *utimes, int flags) | 173 | SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, |
174 | struct timespec __user *, utimes, int, flags) | ||
174 | { | 175 | { |
175 | struct timespec tstimes[2]; | 176 | struct timespec tstimes[2]; |
176 | 177 | ||
@@ -187,7 +188,8 @@ asmlinkage long sys_utimensat(int dfd, char __user *filename, struct timespec __ | |||
187 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); | 188 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); |
188 | } | 189 | } |
189 | 190 | ||
190 | asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __user *utimes) | 191 | SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename, |
192 | struct timeval __user *, utimes) | ||
191 | { | 193 | { |
192 | struct timeval times[2]; | 194 | struct timeval times[2]; |
193 | struct timespec tstimes[2]; | 195 | struct timespec tstimes[2]; |
@@ -214,7 +216,8 @@ asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __u | |||
214 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0); | 216 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0); |
215 | } | 217 | } |
216 | 218 | ||
217 | asmlinkage long sys_utimes(char __user *filename, struct timeval __user *utimes) | 219 | SYSCALL_DEFINE2(utimes, char __user *, filename, |
220 | struct timeval __user *, utimes) | ||
218 | { | 221 | { |
219 | return sys_futimesat(AT_FDCWD, filename, utimes); | 222 | return sys_futimesat(AT_FDCWD, filename, utimes); |
220 | } | 223 | } |
diff --git a/fs/xattr.c b/fs/xattr.c index 237804cd6b56..197c4fcac032 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -251,9 +251,9 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value, | |||
251 | return error; | 251 | return error; |
252 | } | 252 | } |
253 | 253 | ||
254 | asmlinkage long | 254 | SYSCALL_DEFINE5(setxattr, const char __user *, pathname, |
255 | sys_setxattr(const char __user *pathname, const char __user *name, | 255 | const char __user *, name, const void __user *, value, |
256 | const void __user *value, size_t size, int flags) | 256 | size_t, size, int, flags) |
257 | { | 257 | { |
258 | struct path path; | 258 | struct path path; |
259 | int error; | 259 | int error; |
@@ -270,9 +270,9 @@ sys_setxattr(const char __user *pathname, const char __user *name, | |||
270 | return error; | 270 | return error; |
271 | } | 271 | } |
272 | 272 | ||
273 | asmlinkage long | 273 | SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname, |
274 | sys_lsetxattr(const char __user *pathname, const char __user *name, | 274 | const char __user *, name, const void __user *, value, |
275 | const void __user *value, size_t size, int flags) | 275 | size_t, size, int, flags) |
276 | { | 276 | { |
277 | struct path path; | 277 | struct path path; |
278 | int error; | 278 | int error; |
@@ -289,9 +289,8 @@ sys_lsetxattr(const char __user *pathname, const char __user *name, | |||
289 | return error; | 289 | return error; |
290 | } | 290 | } |
291 | 291 | ||
292 | asmlinkage long | 292 | SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, |
293 | sys_fsetxattr(int fd, const char __user *name, const void __user *value, | 293 | const void __user *,value, size_t, size, int, flags) |
294 | size_t size, int flags) | ||
295 | { | 294 | { |
296 | struct file *f; | 295 | struct file *f; |
297 | struct dentry *dentry; | 296 | struct dentry *dentry; |
@@ -349,9 +348,8 @@ getxattr(struct dentry *d, const char __user *name, void __user *value, | |||
349 | return error; | 348 | return error; |
350 | } | 349 | } |
351 | 350 | ||
352 | asmlinkage ssize_t | 351 | SYSCALL_DEFINE4(getxattr, const char __user *, pathname, |
353 | sys_getxattr(const char __user *pathname, const char __user *name, | 352 | const char __user *, name, void __user *, value, size_t, size) |
354 | void __user *value, size_t size) | ||
355 | { | 353 | { |
356 | struct path path; | 354 | struct path path; |
357 | ssize_t error; | 355 | ssize_t error; |
@@ -364,9 +362,8 @@ sys_getxattr(const char __user *pathname, const char __user *name, | |||
364 | return error; | 362 | return error; |
365 | } | 363 | } |
366 | 364 | ||
367 | asmlinkage ssize_t | 365 | SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname, |
368 | sys_lgetxattr(const char __user *pathname, const char __user *name, void __user *value, | 366 | const char __user *, name, void __user *, value, size_t, size) |
369 | size_t size) | ||
370 | { | 367 | { |
371 | struct path path; | 368 | struct path path; |
372 | ssize_t error; | 369 | ssize_t error; |
@@ -379,8 +376,8 @@ sys_lgetxattr(const char __user *pathname, const char __user *name, void __user | |||
379 | return error; | 376 | return error; |
380 | } | 377 | } |
381 | 378 | ||
382 | asmlinkage ssize_t | 379 | SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name, |
383 | sys_fgetxattr(int fd, const char __user *name, void __user *value, size_t size) | 380 | void __user *, value, size_t, size) |
384 | { | 381 | { |
385 | struct file *f; | 382 | struct file *f; |
386 | ssize_t error = -EBADF; | 383 | ssize_t error = -EBADF; |
@@ -424,8 +421,8 @@ listxattr(struct dentry *d, char __user *list, size_t size) | |||
424 | return error; | 421 | return error; |
425 | } | 422 | } |
426 | 423 | ||
427 | asmlinkage ssize_t | 424 | SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list, |
428 | sys_listxattr(const char __user *pathname, char __user *list, size_t size) | 425 | size_t, size) |
429 | { | 426 | { |
430 | struct path path; | 427 | struct path path; |
431 | ssize_t error; | 428 | ssize_t error; |
@@ -438,8 +435,8 @@ sys_listxattr(const char __user *pathname, char __user *list, size_t size) | |||
438 | return error; | 435 | return error; |
439 | } | 436 | } |
440 | 437 | ||
441 | asmlinkage ssize_t | 438 | SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list, |
442 | sys_llistxattr(const char __user *pathname, char __user *list, size_t size) | 439 | size_t, size) |
443 | { | 440 | { |
444 | struct path path; | 441 | struct path path; |
445 | ssize_t error; | 442 | ssize_t error; |
@@ -452,8 +449,7 @@ sys_llistxattr(const char __user *pathname, char __user *list, size_t size) | |||
452 | return error; | 449 | return error; |
453 | } | 450 | } |
454 | 451 | ||
455 | asmlinkage ssize_t | 452 | SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size) |
456 | sys_flistxattr(int fd, char __user *list, size_t size) | ||
457 | { | 453 | { |
458 | struct file *f; | 454 | struct file *f; |
459 | ssize_t error = -EBADF; | 455 | ssize_t error = -EBADF; |
@@ -485,8 +481,8 @@ removexattr(struct dentry *d, const char __user *name) | |||
485 | return vfs_removexattr(d, kname); | 481 | return vfs_removexattr(d, kname); |
486 | } | 482 | } |
487 | 483 | ||
488 | asmlinkage long | 484 | SYSCALL_DEFINE2(removexattr, const char __user *, pathname, |
489 | sys_removexattr(const char __user *pathname, const char __user *name) | 485 | const char __user *, name) |
490 | { | 486 | { |
491 | struct path path; | 487 | struct path path; |
492 | int error; | 488 | int error; |
@@ -503,8 +499,8 @@ sys_removexattr(const char __user *pathname, const char __user *name) | |||
503 | return error; | 499 | return error; |
504 | } | 500 | } |
505 | 501 | ||
506 | asmlinkage long | 502 | SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname, |
507 | sys_lremovexattr(const char __user *pathname, const char __user *name) | 503 | const char __user *, name) |
508 | { | 504 | { |
509 | struct path path; | 505 | struct path path; |
510 | int error; | 506 | int error; |
@@ -521,8 +517,7 @@ sys_lremovexattr(const char __user *pathname, const char __user *name) | |||
521 | return error; | 517 | return error; |
522 | } | 518 | } |
523 | 519 | ||
524 | asmlinkage long | 520 | SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name) |
525 | sys_fremovexattr(int fd, const char __user *name) | ||
526 | { | 521 | { |
527 | struct file *f; | 522 | struct file *f; |
528 | struct dentry *dentry; | 523 | struct dentry *dentry; |
diff --git a/fs/xfs/linux-2.6/xfs_aops.h b/fs/xfs/linux-2.6/xfs_aops.h index 7b26f5ff9692..1dd528849755 100644 --- a/fs/xfs/linux-2.6/xfs_aops.h +++ b/fs/xfs/linux-2.6/xfs_aops.h | |||
@@ -21,8 +21,6 @@ | |||
21 | extern struct workqueue_struct *xfsdatad_workqueue; | 21 | extern struct workqueue_struct *xfsdatad_workqueue; |
22 | extern mempool_t *xfs_ioend_pool; | 22 | extern mempool_t *xfs_ioend_pool; |
23 | 23 | ||
24 | typedef void (*xfs_ioend_func_t)(void *); | ||
25 | |||
26 | /* | 24 | /* |
27 | * xfs_ioend struct manages large extent writes for XFS. | 25 | * xfs_ioend struct manages large extent writes for XFS. |
28 | * It can manage several multi-page bio's at once. | 26 | * It can manage several multi-page bio's at once. |
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index cb329edc925b..d71dc44e21ed 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -166,75 +166,6 @@ test_page_region( | |||
166 | } | 166 | } |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * Mapping of multi-page buffers into contiguous virtual space | ||
170 | */ | ||
171 | |||
172 | typedef struct a_list { | ||
173 | void *vm_addr; | ||
174 | struct a_list *next; | ||
175 | } a_list_t; | ||
176 | |||
177 | static a_list_t *as_free_head; | ||
178 | static int as_list_len; | ||
179 | static DEFINE_SPINLOCK(as_lock); | ||
180 | |||
181 | /* | ||
182 | * Try to batch vunmaps because they are costly. | ||
183 | */ | ||
184 | STATIC void | ||
185 | free_address( | ||
186 | void *addr) | ||
187 | { | ||
188 | a_list_t *aentry; | ||
189 | |||
190 | #ifdef CONFIG_XEN | ||
191 | /* | ||
192 | * Xen needs to be able to make sure it can get an exclusive | ||
193 | * RO mapping of pages it wants to turn into a pagetable. If | ||
194 | * a newly allocated page is also still being vmap()ed by xfs, | ||
195 | * it will cause pagetable construction to fail. This is a | ||
196 | * quick workaround to always eagerly unmap pages so that Xen | ||
197 | * is happy. | ||
198 | */ | ||
199 | vunmap(addr); | ||
200 | return; | ||
201 | #endif | ||
202 | |||
203 | aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT); | ||
204 | if (likely(aentry)) { | ||
205 | spin_lock(&as_lock); | ||
206 | aentry->next = as_free_head; | ||
207 | aentry->vm_addr = addr; | ||
208 | as_free_head = aentry; | ||
209 | as_list_len++; | ||
210 | spin_unlock(&as_lock); | ||
211 | } else { | ||
212 | vunmap(addr); | ||
213 | } | ||
214 | } | ||
215 | |||
216 | STATIC void | ||
217 | purge_addresses(void) | ||
218 | { | ||
219 | a_list_t *aentry, *old; | ||
220 | |||
221 | if (as_free_head == NULL) | ||
222 | return; | ||
223 | |||
224 | spin_lock(&as_lock); | ||
225 | aentry = as_free_head; | ||
226 | as_free_head = NULL; | ||
227 | as_list_len = 0; | ||
228 | spin_unlock(&as_lock); | ||
229 | |||
230 | while ((old = aentry) != NULL) { | ||
231 | vunmap(aentry->vm_addr); | ||
232 | aentry = aentry->next; | ||
233 | kfree(old); | ||
234 | } | ||
235 | } | ||
236 | |||
237 | /* | ||
238 | * Internal xfs_buf_t object manipulation | 169 | * Internal xfs_buf_t object manipulation |
239 | */ | 170 | */ |
240 | 171 | ||
@@ -333,7 +264,7 @@ xfs_buf_free( | |||
333 | uint i; | 264 | uint i; |
334 | 265 | ||
335 | if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) | 266 | if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) |
336 | free_address(bp->b_addr - bp->b_offset); | 267 | vm_unmap_ram(bp->b_addr - bp->b_offset, bp->b_page_count); |
337 | 268 | ||
338 | for (i = 0; i < bp->b_page_count; i++) { | 269 | for (i = 0; i < bp->b_page_count; i++) { |
339 | struct page *page = bp->b_pages[i]; | 270 | struct page *page = bp->b_pages[i]; |
@@ -455,10 +386,8 @@ _xfs_buf_map_pages( | |||
455 | bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset; | 386 | bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset; |
456 | bp->b_flags |= XBF_MAPPED; | 387 | bp->b_flags |= XBF_MAPPED; |
457 | } else if (flags & XBF_MAPPED) { | 388 | } else if (flags & XBF_MAPPED) { |
458 | if (as_list_len > 64) | 389 | bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count, |
459 | purge_addresses(); | 390 | -1, PAGE_KERNEL); |
460 | bp->b_addr = vmap(bp->b_pages, bp->b_page_count, | ||
461 | VM_MAP, PAGE_KERNEL); | ||
462 | if (unlikely(bp->b_addr == NULL)) | 391 | if (unlikely(bp->b_addr == NULL)) |
463 | return -ENOMEM; | 392 | return -ENOMEM; |
464 | bp->b_addr += bp->b_offset; | 393 | bp->b_addr += bp->b_offset; |
@@ -1743,8 +1672,6 @@ xfsbufd( | |||
1743 | count++; | 1672 | count++; |
1744 | } | 1673 | } |
1745 | 1674 | ||
1746 | if (as_list_len > 0) | ||
1747 | purge_addresses(); | ||
1748 | if (count) | 1675 | if (count) |
1749 | blk_run_address_space(target->bt_mapping); | 1676 | blk_run_address_space(target->bt_mapping); |
1750 | 1677 | ||
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 595751f78350..87b8cbd23d4b 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c | |||
@@ -126,11 +126,26 @@ xfs_nfs_get_inode( | |||
126 | if (ino == 0) | 126 | if (ino == 0) |
127 | return ERR_PTR(-ESTALE); | 127 | return ERR_PTR(-ESTALE); |
128 | 128 | ||
129 | error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0); | 129 | /* |
130 | if (error) | 130 | * The XFS_IGET_BULKSTAT means that an invalid inode number is just |
131 | * fine and not an indication of a corrupted filesystem. Because | ||
132 | * clients can send any kind of invalid file handle, e.g. after | ||
133 | * a restore on the server we have to deal with this case gracefully. | ||
134 | */ | ||
135 | error = xfs_iget(mp, NULL, ino, XFS_IGET_BULKSTAT, | ||
136 | XFS_ILOCK_SHARED, &ip, 0); | ||
137 | if (error) { | ||
138 | /* | ||
139 | * EINVAL means the inode cluster doesn't exist anymore. | ||
140 | * This implies the filehandle is stale, so we should | ||
141 | * translate it here. | ||
142 | * We don't use ESTALE directly down the chain to not | ||
143 | * confuse applications using bulkstat that expect EINVAL. | ||
144 | */ | ||
145 | if (error == EINVAL) | ||
146 | error = ESTALE; | ||
131 | return ERR_PTR(-error); | 147 | return ERR_PTR(-error); |
132 | if (!ip) | 148 | } |
133 | return ERR_PTR(-EIO); | ||
134 | 149 | ||
135 | if (ip->i_d.di_gen != generation) { | 150 | if (ip->i_d.di_gen != generation) { |
136 | xfs_iput_new(ip, XFS_ILOCK_SHARED); | 151 | xfs_iput_new(ip, XFS_ILOCK_SHARED); |
diff --git a/fs/xfs/xfs_acl.h b/fs/xfs/xfs_acl.h index a4e293b93efa..642f1db4def4 100644 --- a/fs/xfs/xfs_acl.h +++ b/fs/xfs/xfs_acl.h | |||
@@ -22,7 +22,6 @@ | |||
22 | * Access Control Lists | 22 | * Access Control Lists |
23 | */ | 23 | */ |
24 | typedef __uint16_t xfs_acl_perm_t; | 24 | typedef __uint16_t xfs_acl_perm_t; |
25 | typedef __int32_t xfs_acl_type_t; | ||
26 | typedef __int32_t xfs_acl_tag_t; | 25 | typedef __int32_t xfs_acl_tag_t; |
27 | typedef __int32_t xfs_acl_id_t; | 26 | typedef __int32_t xfs_acl_id_t; |
28 | 27 | ||
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h index f2e21817a226..d3b3cf742999 100644 --- a/fs/xfs/xfs_ag.h +++ b/fs/xfs/xfs_ag.h | |||
@@ -231,7 +231,7 @@ typedef struct xfs_perag | |||
231 | #define XFS_FSB_TO_AGNO(mp,fsbno) \ | 231 | #define XFS_FSB_TO_AGNO(mp,fsbno) \ |
232 | ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog)) | 232 | ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog)) |
233 | #define XFS_FSB_TO_AGBNO(mp,fsbno) \ | 233 | #define XFS_FSB_TO_AGBNO(mp,fsbno) \ |
234 | ((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog))) | 234 | ((xfs_agblock_t)((fsbno) & xfs_mask32lo((mp)->m_sb.sb_agblklog))) |
235 | #define XFS_AGB_TO_DADDR(mp,agno,agbno) \ | 235 | #define XFS_AGB_TO_DADDR(mp,agno,agbno) \ |
236 | ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \ | 236 | ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \ |
237 | (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))) | 237 | (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))) |
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 79da6b2ea99e..6c323f8a4cd1 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -736,7 +736,7 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bp, xfs_inode_t *dp) | |||
736 | continue; /* don't copy partial entries */ | 736 | continue; /* don't copy partial entries */ |
737 | if (!(entry->flags & XFS_ATTR_LOCAL)) | 737 | if (!(entry->flags & XFS_ATTR_LOCAL)) |
738 | return(0); | 738 | return(0); |
739 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); | 739 | name_loc = xfs_attr_leaf_name_local(leaf, i); |
740 | if (name_loc->namelen >= XFS_ATTR_SF_ENTSIZE_MAX) | 740 | if (name_loc->namelen >= XFS_ATTR_SF_ENTSIZE_MAX) |
741 | return(0); | 741 | return(0); |
742 | if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX) | 742 | if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX) |
@@ -823,7 +823,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff) | |||
823 | if (!entry->nameidx) | 823 | if (!entry->nameidx) |
824 | continue; | 824 | continue; |
825 | ASSERT(entry->flags & XFS_ATTR_LOCAL); | 825 | ASSERT(entry->flags & XFS_ATTR_LOCAL); |
826 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); | 826 | name_loc = xfs_attr_leaf_name_local(leaf, i); |
827 | nargs.name = (char *)name_loc->nameval; | 827 | nargs.name = (char *)name_loc->nameval; |
828 | nargs.namelen = name_loc->namelen; | 828 | nargs.namelen = name_loc->namelen; |
829 | nargs.value = (char *)&name_loc->nameval[nargs.namelen]; | 829 | nargs.value = (char *)&name_loc->nameval[nargs.namelen]; |
@@ -1141,14 +1141,14 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex) | |||
1141 | * as part of this transaction (a split operation for example). | 1141 | * as part of this transaction (a split operation for example). |
1142 | */ | 1142 | */ |
1143 | if (entry->flags & XFS_ATTR_LOCAL) { | 1143 | if (entry->flags & XFS_ATTR_LOCAL) { |
1144 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index); | 1144 | name_loc = xfs_attr_leaf_name_local(leaf, args->index); |
1145 | name_loc->namelen = args->namelen; | 1145 | name_loc->namelen = args->namelen; |
1146 | name_loc->valuelen = cpu_to_be16(args->valuelen); | 1146 | name_loc->valuelen = cpu_to_be16(args->valuelen); |
1147 | memcpy((char *)name_loc->nameval, args->name, args->namelen); | 1147 | memcpy((char *)name_loc->nameval, args->name, args->namelen); |
1148 | memcpy((char *)&name_loc->nameval[args->namelen], args->value, | 1148 | memcpy((char *)&name_loc->nameval[args->namelen], args->value, |
1149 | be16_to_cpu(name_loc->valuelen)); | 1149 | be16_to_cpu(name_loc->valuelen)); |
1150 | } else { | 1150 | } else { |
1151 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 1151 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
1152 | name_rmt->namelen = args->namelen; | 1152 | name_rmt->namelen = args->namelen; |
1153 | memcpy((char *)name_rmt->name, args->name, args->namelen); | 1153 | memcpy((char *)name_rmt->name, args->name, args->namelen); |
1154 | entry->flags |= XFS_ATTR_INCOMPLETE; | 1154 | entry->flags |= XFS_ATTR_INCOMPLETE; |
@@ -1159,7 +1159,7 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex) | |||
1159 | args->rmtblkcnt = XFS_B_TO_FSB(mp, args->valuelen); | 1159 | args->rmtblkcnt = XFS_B_TO_FSB(mp, args->valuelen); |
1160 | } | 1160 | } |
1161 | xfs_da_log_buf(args->trans, bp, | 1161 | xfs_da_log_buf(args->trans, bp, |
1162 | XFS_DA_LOGRANGE(leaf, XFS_ATTR_LEAF_NAME(leaf, args->index), | 1162 | XFS_DA_LOGRANGE(leaf, xfs_attr_leaf_name(leaf, args->index), |
1163 | xfs_attr_leaf_entsize(leaf, args->index))); | 1163 | xfs_attr_leaf_entsize(leaf, args->index))); |
1164 | 1164 | ||
1165 | /* | 1165 | /* |
@@ -1749,10 +1749,10 @@ xfs_attr_leaf_remove(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
1749 | /* | 1749 | /* |
1750 | * Compress the remaining entries and zero out the removed stuff. | 1750 | * Compress the remaining entries and zero out the removed stuff. |
1751 | */ | 1751 | */ |
1752 | memset(XFS_ATTR_LEAF_NAME(leaf, args->index), 0, entsize); | 1752 | memset(xfs_attr_leaf_name(leaf, args->index), 0, entsize); |
1753 | be16_add_cpu(&hdr->usedbytes, -entsize); | 1753 | be16_add_cpu(&hdr->usedbytes, -entsize); |
1754 | xfs_da_log_buf(args->trans, bp, | 1754 | xfs_da_log_buf(args->trans, bp, |
1755 | XFS_DA_LOGRANGE(leaf, XFS_ATTR_LEAF_NAME(leaf, args->index), | 1755 | XFS_DA_LOGRANGE(leaf, xfs_attr_leaf_name(leaf, args->index), |
1756 | entsize)); | 1756 | entsize)); |
1757 | 1757 | ||
1758 | tmp = (be16_to_cpu(hdr->count) - args->index) | 1758 | tmp = (be16_to_cpu(hdr->count) - args->index) |
@@ -1985,7 +1985,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
1985 | continue; | 1985 | continue; |
1986 | } | 1986 | } |
1987 | if (entry->flags & XFS_ATTR_LOCAL) { | 1987 | if (entry->flags & XFS_ATTR_LOCAL) { |
1988 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe); | 1988 | name_loc = xfs_attr_leaf_name_local(leaf, probe); |
1989 | if (name_loc->namelen != args->namelen) | 1989 | if (name_loc->namelen != args->namelen) |
1990 | continue; | 1990 | continue; |
1991 | if (memcmp(args->name, (char *)name_loc->nameval, args->namelen) != 0) | 1991 | if (memcmp(args->name, (char *)name_loc->nameval, args->namelen) != 0) |
@@ -1995,7 +1995,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
1995 | args->index = probe; | 1995 | args->index = probe; |
1996 | return(XFS_ERROR(EEXIST)); | 1996 | return(XFS_ERROR(EEXIST)); |
1997 | } else { | 1997 | } else { |
1998 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, probe); | 1998 | name_rmt = xfs_attr_leaf_name_remote(leaf, probe); |
1999 | if (name_rmt->namelen != args->namelen) | 1999 | if (name_rmt->namelen != args->namelen) |
2000 | continue; | 2000 | continue; |
2001 | if (memcmp(args->name, (char *)name_rmt->name, | 2001 | if (memcmp(args->name, (char *)name_rmt->name, |
@@ -2035,7 +2035,7 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
2035 | 2035 | ||
2036 | entry = &leaf->entries[args->index]; | 2036 | entry = &leaf->entries[args->index]; |
2037 | if (entry->flags & XFS_ATTR_LOCAL) { | 2037 | if (entry->flags & XFS_ATTR_LOCAL) { |
2038 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index); | 2038 | name_loc = xfs_attr_leaf_name_local(leaf, args->index); |
2039 | ASSERT(name_loc->namelen == args->namelen); | 2039 | ASSERT(name_loc->namelen == args->namelen); |
2040 | ASSERT(memcmp(args->name, name_loc->nameval, args->namelen) == 0); | 2040 | ASSERT(memcmp(args->name, name_loc->nameval, args->namelen) == 0); |
2041 | valuelen = be16_to_cpu(name_loc->valuelen); | 2041 | valuelen = be16_to_cpu(name_loc->valuelen); |
@@ -2050,7 +2050,7 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
2050 | args->valuelen = valuelen; | 2050 | args->valuelen = valuelen; |
2051 | memcpy(args->value, &name_loc->nameval[args->namelen], valuelen); | 2051 | memcpy(args->value, &name_loc->nameval[args->namelen], valuelen); |
2052 | } else { | 2052 | } else { |
2053 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 2053 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
2054 | ASSERT(name_rmt->namelen == args->namelen); | 2054 | ASSERT(name_rmt->namelen == args->namelen); |
2055 | ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0); | 2055 | ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0); |
2056 | valuelen = be32_to_cpu(name_rmt->valuelen); | 2056 | valuelen = be32_to_cpu(name_rmt->valuelen); |
@@ -2143,7 +2143,7 @@ xfs_attr_leaf_moveents(xfs_attr_leafblock_t *leaf_s, int start_s, | |||
2143 | * off for 6.2, should be revisited later. | 2143 | * off for 6.2, should be revisited later. |
2144 | */ | 2144 | */ |
2145 | if (entry_s->flags & XFS_ATTR_INCOMPLETE) { /* skip partials? */ | 2145 | if (entry_s->flags & XFS_ATTR_INCOMPLETE) { /* skip partials? */ |
2146 | memset(XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), 0, tmp); | 2146 | memset(xfs_attr_leaf_name(leaf_s, start_s + i), 0, tmp); |
2147 | be16_add_cpu(&hdr_s->usedbytes, -tmp); | 2147 | be16_add_cpu(&hdr_s->usedbytes, -tmp); |
2148 | be16_add_cpu(&hdr_s->count, -1); | 2148 | be16_add_cpu(&hdr_s->count, -1); |
2149 | entry_d--; /* to compensate for ++ in loop hdr */ | 2149 | entry_d--; /* to compensate for ++ in loop hdr */ |
@@ -2160,11 +2160,11 @@ xfs_attr_leaf_moveents(xfs_attr_leafblock_t *leaf_s, int start_s, | |||
2160 | entry_d->flags = entry_s->flags; | 2160 | entry_d->flags = entry_s->flags; |
2161 | ASSERT(be16_to_cpu(entry_d->nameidx) + tmp | 2161 | ASSERT(be16_to_cpu(entry_d->nameidx) + tmp |
2162 | <= XFS_LBSIZE(mp)); | 2162 | <= XFS_LBSIZE(mp)); |
2163 | memmove(XFS_ATTR_LEAF_NAME(leaf_d, desti), | 2163 | memmove(xfs_attr_leaf_name(leaf_d, desti), |
2164 | XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), tmp); | 2164 | xfs_attr_leaf_name(leaf_s, start_s + i), tmp); |
2165 | ASSERT(be16_to_cpu(entry_s->nameidx) + tmp | 2165 | ASSERT(be16_to_cpu(entry_s->nameidx) + tmp |
2166 | <= XFS_LBSIZE(mp)); | 2166 | <= XFS_LBSIZE(mp)); |
2167 | memset(XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), 0, tmp); | 2167 | memset(xfs_attr_leaf_name(leaf_s, start_s + i), 0, tmp); |
2168 | be16_add_cpu(&hdr_s->usedbytes, -tmp); | 2168 | be16_add_cpu(&hdr_s->usedbytes, -tmp); |
2169 | be16_add_cpu(&hdr_d->usedbytes, tmp); | 2169 | be16_add_cpu(&hdr_d->usedbytes, tmp); |
2170 | be16_add_cpu(&hdr_s->count, -1); | 2170 | be16_add_cpu(&hdr_s->count, -1); |
@@ -2276,12 +2276,12 @@ xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index) | |||
2276 | 2276 | ||
2277 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC); | 2277 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC); |
2278 | if (leaf->entries[index].flags & XFS_ATTR_LOCAL) { | 2278 | if (leaf->entries[index].flags & XFS_ATTR_LOCAL) { |
2279 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, index); | 2279 | name_loc = xfs_attr_leaf_name_local(leaf, index); |
2280 | size = XFS_ATTR_LEAF_ENTSIZE_LOCAL(name_loc->namelen, | 2280 | size = xfs_attr_leaf_entsize_local(name_loc->namelen, |
2281 | be16_to_cpu(name_loc->valuelen)); | 2281 | be16_to_cpu(name_loc->valuelen)); |
2282 | } else { | 2282 | } else { |
2283 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, index); | 2283 | name_rmt = xfs_attr_leaf_name_remote(leaf, index); |
2284 | size = XFS_ATTR_LEAF_ENTSIZE_REMOTE(name_rmt->namelen); | 2284 | size = xfs_attr_leaf_entsize_remote(name_rmt->namelen); |
2285 | } | 2285 | } |
2286 | return(size); | 2286 | return(size); |
2287 | } | 2287 | } |
@@ -2297,13 +2297,13 @@ xfs_attr_leaf_newentsize(int namelen, int valuelen, int blocksize, int *local) | |||
2297 | { | 2297 | { |
2298 | int size; | 2298 | int size; |
2299 | 2299 | ||
2300 | size = XFS_ATTR_LEAF_ENTSIZE_LOCAL(namelen, valuelen); | 2300 | size = xfs_attr_leaf_entsize_local(namelen, valuelen); |
2301 | if (size < XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX(blocksize)) { | 2301 | if (size < xfs_attr_leaf_entsize_local_max(blocksize)) { |
2302 | if (local) { | 2302 | if (local) { |
2303 | *local = 1; | 2303 | *local = 1; |
2304 | } | 2304 | } |
2305 | } else { | 2305 | } else { |
2306 | size = XFS_ATTR_LEAF_ENTSIZE_REMOTE(namelen); | 2306 | size = xfs_attr_leaf_entsize_remote(namelen); |
2307 | if (local) { | 2307 | if (local) { |
2308 | *local = 0; | 2308 | *local = 0; |
2309 | } | 2309 | } |
@@ -2372,7 +2372,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context) | |||
2372 | 2372 | ||
2373 | if (entry->flags & XFS_ATTR_LOCAL) { | 2373 | if (entry->flags & XFS_ATTR_LOCAL) { |
2374 | xfs_attr_leaf_name_local_t *name_loc = | 2374 | xfs_attr_leaf_name_local_t *name_loc = |
2375 | XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); | 2375 | xfs_attr_leaf_name_local(leaf, i); |
2376 | 2376 | ||
2377 | retval = context->put_listent(context, | 2377 | retval = context->put_listent(context, |
2378 | entry->flags, | 2378 | entry->flags, |
@@ -2384,7 +2384,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context) | |||
2384 | return retval; | 2384 | return retval; |
2385 | } else { | 2385 | } else { |
2386 | xfs_attr_leaf_name_remote_t *name_rmt = | 2386 | xfs_attr_leaf_name_remote_t *name_rmt = |
2387 | XFS_ATTR_LEAF_NAME_REMOTE(leaf, i); | 2387 | xfs_attr_leaf_name_remote(leaf, i); |
2388 | 2388 | ||
2389 | int valuelen = be32_to_cpu(name_rmt->valuelen); | 2389 | int valuelen = be32_to_cpu(name_rmt->valuelen); |
2390 | 2390 | ||
@@ -2468,11 +2468,11 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args) | |||
2468 | 2468 | ||
2469 | #ifdef DEBUG | 2469 | #ifdef DEBUG |
2470 | if (entry->flags & XFS_ATTR_LOCAL) { | 2470 | if (entry->flags & XFS_ATTR_LOCAL) { |
2471 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index); | 2471 | name_loc = xfs_attr_leaf_name_local(leaf, args->index); |
2472 | namelen = name_loc->namelen; | 2472 | namelen = name_loc->namelen; |
2473 | name = (char *)name_loc->nameval; | 2473 | name = (char *)name_loc->nameval; |
2474 | } else { | 2474 | } else { |
2475 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 2475 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
2476 | namelen = name_rmt->namelen; | 2476 | namelen = name_rmt->namelen; |
2477 | name = (char *)name_rmt->name; | 2477 | name = (char *)name_rmt->name; |
2478 | } | 2478 | } |
@@ -2487,7 +2487,7 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args) | |||
2487 | 2487 | ||
2488 | if (args->rmtblkno) { | 2488 | if (args->rmtblkno) { |
2489 | ASSERT((entry->flags & XFS_ATTR_LOCAL) == 0); | 2489 | ASSERT((entry->flags & XFS_ATTR_LOCAL) == 0); |
2490 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 2490 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
2491 | name_rmt->valueblk = cpu_to_be32(args->rmtblkno); | 2491 | name_rmt->valueblk = cpu_to_be32(args->rmtblkno); |
2492 | name_rmt->valuelen = cpu_to_be32(args->valuelen); | 2492 | name_rmt->valuelen = cpu_to_be32(args->valuelen); |
2493 | xfs_da_log_buf(args->trans, bp, | 2493 | xfs_da_log_buf(args->trans, bp, |
@@ -2534,7 +2534,7 @@ xfs_attr_leaf_setflag(xfs_da_args_t *args) | |||
2534 | xfs_da_log_buf(args->trans, bp, | 2534 | xfs_da_log_buf(args->trans, bp, |
2535 | XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); | 2535 | XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); |
2536 | if ((entry->flags & XFS_ATTR_LOCAL) == 0) { | 2536 | if ((entry->flags & XFS_ATTR_LOCAL) == 0) { |
2537 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 2537 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
2538 | name_rmt->valueblk = 0; | 2538 | name_rmt->valueblk = 0; |
2539 | name_rmt->valuelen = 0; | 2539 | name_rmt->valuelen = 0; |
2540 | xfs_da_log_buf(args->trans, bp, | 2540 | xfs_da_log_buf(args->trans, bp, |
@@ -2607,20 +2607,20 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args) | |||
2607 | 2607 | ||
2608 | #ifdef DEBUG | 2608 | #ifdef DEBUG |
2609 | if (entry1->flags & XFS_ATTR_LOCAL) { | 2609 | if (entry1->flags & XFS_ATTR_LOCAL) { |
2610 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf1, args->index); | 2610 | name_loc = xfs_attr_leaf_name_local(leaf1, args->index); |
2611 | namelen1 = name_loc->namelen; | 2611 | namelen1 = name_loc->namelen; |
2612 | name1 = (char *)name_loc->nameval; | 2612 | name1 = (char *)name_loc->nameval; |
2613 | } else { | 2613 | } else { |
2614 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf1, args->index); | 2614 | name_rmt = xfs_attr_leaf_name_remote(leaf1, args->index); |
2615 | namelen1 = name_rmt->namelen; | 2615 | namelen1 = name_rmt->namelen; |
2616 | name1 = (char *)name_rmt->name; | 2616 | name1 = (char *)name_rmt->name; |
2617 | } | 2617 | } |
2618 | if (entry2->flags & XFS_ATTR_LOCAL) { | 2618 | if (entry2->flags & XFS_ATTR_LOCAL) { |
2619 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf2, args->index2); | 2619 | name_loc = xfs_attr_leaf_name_local(leaf2, args->index2); |
2620 | namelen2 = name_loc->namelen; | 2620 | namelen2 = name_loc->namelen; |
2621 | name2 = (char *)name_loc->nameval; | 2621 | name2 = (char *)name_loc->nameval; |
2622 | } else { | 2622 | } else { |
2623 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf2, args->index2); | 2623 | name_rmt = xfs_attr_leaf_name_remote(leaf2, args->index2); |
2624 | namelen2 = name_rmt->namelen; | 2624 | namelen2 = name_rmt->namelen; |
2625 | name2 = (char *)name_rmt->name; | 2625 | name2 = (char *)name_rmt->name; |
2626 | } | 2626 | } |
@@ -2637,7 +2637,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args) | |||
2637 | XFS_DA_LOGRANGE(leaf1, entry1, sizeof(*entry1))); | 2637 | XFS_DA_LOGRANGE(leaf1, entry1, sizeof(*entry1))); |
2638 | if (args->rmtblkno) { | 2638 | if (args->rmtblkno) { |
2639 | ASSERT((entry1->flags & XFS_ATTR_LOCAL) == 0); | 2639 | ASSERT((entry1->flags & XFS_ATTR_LOCAL) == 0); |
2640 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf1, args->index); | 2640 | name_rmt = xfs_attr_leaf_name_remote(leaf1, args->index); |
2641 | name_rmt->valueblk = cpu_to_be32(args->rmtblkno); | 2641 | name_rmt->valueblk = cpu_to_be32(args->rmtblkno); |
2642 | name_rmt->valuelen = cpu_to_be32(args->valuelen); | 2642 | name_rmt->valuelen = cpu_to_be32(args->valuelen); |
2643 | xfs_da_log_buf(args->trans, bp1, | 2643 | xfs_da_log_buf(args->trans, bp1, |
@@ -2648,7 +2648,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args) | |||
2648 | xfs_da_log_buf(args->trans, bp2, | 2648 | xfs_da_log_buf(args->trans, bp2, |
2649 | XFS_DA_LOGRANGE(leaf2, entry2, sizeof(*entry2))); | 2649 | XFS_DA_LOGRANGE(leaf2, entry2, sizeof(*entry2))); |
2650 | if ((entry2->flags & XFS_ATTR_LOCAL) == 0) { | 2650 | if ((entry2->flags & XFS_ATTR_LOCAL) == 0) { |
2651 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf2, args->index2); | 2651 | name_rmt = xfs_attr_leaf_name_remote(leaf2, args->index2); |
2652 | name_rmt->valueblk = 0; | 2652 | name_rmt->valueblk = 0; |
2653 | name_rmt->valuelen = 0; | 2653 | name_rmt->valuelen = 0; |
2654 | xfs_da_log_buf(args->trans, bp2, | 2654 | xfs_da_log_buf(args->trans, bp2, |
@@ -2855,7 +2855,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp) | |||
2855 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { | 2855 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { |
2856 | if (be16_to_cpu(entry->nameidx) && | 2856 | if (be16_to_cpu(entry->nameidx) && |
2857 | ((entry->flags & XFS_ATTR_LOCAL) == 0)) { | 2857 | ((entry->flags & XFS_ATTR_LOCAL) == 0)) { |
2858 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i); | 2858 | name_rmt = xfs_attr_leaf_name_remote(leaf, i); |
2859 | if (name_rmt->valueblk) | 2859 | if (name_rmt->valueblk) |
2860 | count++; | 2860 | count++; |
2861 | } | 2861 | } |
@@ -2883,7 +2883,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp) | |||
2883 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { | 2883 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { |
2884 | if (be16_to_cpu(entry->nameidx) && | 2884 | if (be16_to_cpu(entry->nameidx) && |
2885 | ((entry->flags & XFS_ATTR_LOCAL) == 0)) { | 2885 | ((entry->flags & XFS_ATTR_LOCAL) == 0)) { |
2886 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i); | 2886 | name_rmt = xfs_attr_leaf_name_remote(leaf, i); |
2887 | if (name_rmt->valueblk) { | 2887 | if (name_rmt->valueblk) { |
2888 | lp->valueblk = be32_to_cpu(name_rmt->valueblk); | 2888 | lp->valueblk = be32_to_cpu(name_rmt->valueblk); |
2889 | lp->valuelen = XFS_B_TO_FSB(dp->i_mount, | 2889 | lp->valuelen = XFS_B_TO_FSB(dp->i_mount, |
diff --git a/fs/xfs/xfs_attr_leaf.h b/fs/xfs/xfs_attr_leaf.h index 83e9af417ca2..9c7d22fdcf4d 100644 --- a/fs/xfs/xfs_attr_leaf.h +++ b/fs/xfs/xfs_attr_leaf.h | |||
@@ -151,8 +151,6 @@ typedef struct xfs_attr_leafblock { | |||
151 | /* | 151 | /* |
152 | * Cast typed pointers for "local" and "remote" name/value structs. | 152 | * Cast typed pointers for "local" and "remote" name/value structs. |
153 | */ | 153 | */ |
154 | #define XFS_ATTR_LEAF_NAME_REMOTE(leafp,idx) \ | ||
155 | xfs_attr_leaf_name_remote(leafp,idx) | ||
156 | static inline xfs_attr_leaf_name_remote_t * | 154 | static inline xfs_attr_leaf_name_remote_t * |
157 | xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) | 155 | xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) |
158 | { | 156 | { |
@@ -160,8 +158,6 @@ xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) | |||
160 | &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; | 158 | &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; |
161 | } | 159 | } |
162 | 160 | ||
163 | #define XFS_ATTR_LEAF_NAME_LOCAL(leafp,idx) \ | ||
164 | xfs_attr_leaf_name_local(leafp,idx) | ||
165 | static inline xfs_attr_leaf_name_local_t * | 161 | static inline xfs_attr_leaf_name_local_t * |
166 | xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) | 162 | xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) |
167 | { | 163 | { |
@@ -169,8 +165,6 @@ xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) | |||
169 | &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; | 165 | &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; |
170 | } | 166 | } |
171 | 167 | ||
172 | #define XFS_ATTR_LEAF_NAME(leafp,idx) \ | ||
173 | xfs_attr_leaf_name(leafp,idx) | ||
174 | static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx) | 168 | static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx) |
175 | { | 169 | { |
176 | return &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; | 170 | return &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; |
@@ -181,24 +175,18 @@ static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx) | |||
181 | * a "local" name/value structure, a "remote" name/value structure, and | 175 | * a "local" name/value structure, a "remote" name/value structure, and |
182 | * a pointer which might be either. | 176 | * a pointer which might be either. |
183 | */ | 177 | */ |
184 | #define XFS_ATTR_LEAF_ENTSIZE_REMOTE(nlen) \ | ||
185 | xfs_attr_leaf_entsize_remote(nlen) | ||
186 | static inline int xfs_attr_leaf_entsize_remote(int nlen) | 178 | static inline int xfs_attr_leaf_entsize_remote(int nlen) |
187 | { | 179 | { |
188 | return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \ | 180 | return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \ |
189 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); | 181 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); |
190 | } | 182 | } |
191 | 183 | ||
192 | #define XFS_ATTR_LEAF_ENTSIZE_LOCAL(nlen,vlen) \ | ||
193 | xfs_attr_leaf_entsize_local(nlen,vlen) | ||
194 | static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen) | 184 | static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen) |
195 | { | 185 | { |
196 | return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) + | 186 | return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) + |
197 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); | 187 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); |
198 | } | 188 | } |
199 | 189 | ||
200 | #define XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX(bsize) \ | ||
201 | xfs_attr_leaf_entsize_local_max(bsize) | ||
202 | static inline int xfs_attr_leaf_entsize_local_max(int bsize) | 190 | static inline int xfs_attr_leaf_entsize_local_max(int bsize) |
203 | { | 191 | { |
204 | return (((bsize) >> 1) + ((bsize) >> 2)); | 192 | return (((bsize) >> 1) + ((bsize) >> 2)); |
diff --git a/fs/xfs/xfs_bit.h b/fs/xfs/xfs_bit.h index bca7b243c319..f1e3c907044d 100644 --- a/fs/xfs/xfs_bit.h +++ b/fs/xfs/xfs_bit.h | |||
@@ -23,24 +23,16 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * masks with n high/low bits set, 32-bit values & 64-bit values | 26 | * masks with n high/low bits set, 64-bit values |
27 | */ | 27 | */ |
28 | #define XFS_MASK32HI(n) xfs_mask32hi(n) | ||
29 | static inline __uint32_t xfs_mask32hi(int n) | ||
30 | { | ||
31 | return (__uint32_t)-1 << (32 - (n)); | ||
32 | } | ||
33 | #define XFS_MASK64HI(n) xfs_mask64hi(n) | ||
34 | static inline __uint64_t xfs_mask64hi(int n) | 28 | static inline __uint64_t xfs_mask64hi(int n) |
35 | { | 29 | { |
36 | return (__uint64_t)-1 << (64 - (n)); | 30 | return (__uint64_t)-1 << (64 - (n)); |
37 | } | 31 | } |
38 | #define XFS_MASK32LO(n) xfs_mask32lo(n) | ||
39 | static inline __uint32_t xfs_mask32lo(int n) | 32 | static inline __uint32_t xfs_mask32lo(int n) |
40 | { | 33 | { |
41 | return ((__uint32_t)1 << (n)) - 1; | 34 | return ((__uint32_t)1 << (n)) - 1; |
42 | } | 35 | } |
43 | #define XFS_MASK64LO(n) xfs_mask64lo(n) | ||
44 | static inline __uint64_t xfs_mask64lo(int n) | 36 | static inline __uint64_t xfs_mask64lo(int n) |
45 | { | 37 | { |
46 | return ((__uint64_t)1 << (n)) - 1; | 38 | return ((__uint64_t)1 << (n)) - 1; |
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c index 8f1ec73725d3..ba6b08c2fb02 100644 --- a/fs/xfs/xfs_bmap_btree.c +++ b/fs/xfs/xfs_bmap_btree.c | |||
@@ -110,16 +110,16 @@ __xfs_bmbt_get_all( | |||
110 | 110 | ||
111 | ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN)); | 111 | ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN)); |
112 | s->br_startoff = ((xfs_fileoff_t)l0 & | 112 | s->br_startoff = ((xfs_fileoff_t)l0 & |
113 | XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; | 113 | xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; |
114 | #if XFS_BIG_BLKNOS | 114 | #if XFS_BIG_BLKNOS |
115 | s->br_startblock = (((xfs_fsblock_t)l0 & XFS_MASK64LO(9)) << 43) | | 115 | s->br_startblock = (((xfs_fsblock_t)l0 & xfs_mask64lo(9)) << 43) | |
116 | (((xfs_fsblock_t)l1) >> 21); | 116 | (((xfs_fsblock_t)l1) >> 21); |
117 | #else | 117 | #else |
118 | #ifdef DEBUG | 118 | #ifdef DEBUG |
119 | { | 119 | { |
120 | xfs_dfsbno_t b; | 120 | xfs_dfsbno_t b; |
121 | 121 | ||
122 | b = (((xfs_dfsbno_t)l0 & XFS_MASK64LO(9)) << 43) | | 122 | b = (((xfs_dfsbno_t)l0 & xfs_mask64lo(9)) << 43) | |
123 | (((xfs_dfsbno_t)l1) >> 21); | 123 | (((xfs_dfsbno_t)l1) >> 21); |
124 | ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); | 124 | ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); |
125 | s->br_startblock = (xfs_fsblock_t)b; | 125 | s->br_startblock = (xfs_fsblock_t)b; |
@@ -128,7 +128,7 @@ __xfs_bmbt_get_all( | |||
128 | s->br_startblock = (xfs_fsblock_t)(((xfs_dfsbno_t)l1) >> 21); | 128 | s->br_startblock = (xfs_fsblock_t)(((xfs_dfsbno_t)l1) >> 21); |
129 | #endif /* DEBUG */ | 129 | #endif /* DEBUG */ |
130 | #endif /* XFS_BIG_BLKNOS */ | 130 | #endif /* XFS_BIG_BLKNOS */ |
131 | s->br_blockcount = (xfs_filblks_t)(l1 & XFS_MASK64LO(21)); | 131 | s->br_blockcount = (xfs_filblks_t)(l1 & xfs_mask64lo(21)); |
132 | /* This is xfs_extent_state() in-line */ | 132 | /* This is xfs_extent_state() in-line */ |
133 | if (ext_flag) { | 133 | if (ext_flag) { |
134 | ASSERT(s->br_blockcount != 0); /* saved for DMIG */ | 134 | ASSERT(s->br_blockcount != 0); /* saved for DMIG */ |
@@ -153,7 +153,7 @@ xfs_filblks_t | |||
153 | xfs_bmbt_get_blockcount( | 153 | xfs_bmbt_get_blockcount( |
154 | xfs_bmbt_rec_host_t *r) | 154 | xfs_bmbt_rec_host_t *r) |
155 | { | 155 | { |
156 | return (xfs_filblks_t)(r->l1 & XFS_MASK64LO(21)); | 156 | return (xfs_filblks_t)(r->l1 & xfs_mask64lo(21)); |
157 | } | 157 | } |
158 | 158 | ||
159 | /* | 159 | /* |
@@ -164,13 +164,13 @@ xfs_bmbt_get_startblock( | |||
164 | xfs_bmbt_rec_host_t *r) | 164 | xfs_bmbt_rec_host_t *r) |
165 | { | 165 | { |
166 | #if XFS_BIG_BLKNOS | 166 | #if XFS_BIG_BLKNOS |
167 | return (((xfs_fsblock_t)r->l0 & XFS_MASK64LO(9)) << 43) | | 167 | return (((xfs_fsblock_t)r->l0 & xfs_mask64lo(9)) << 43) | |
168 | (((xfs_fsblock_t)r->l1) >> 21); | 168 | (((xfs_fsblock_t)r->l1) >> 21); |
169 | #else | 169 | #else |
170 | #ifdef DEBUG | 170 | #ifdef DEBUG |
171 | xfs_dfsbno_t b; | 171 | xfs_dfsbno_t b; |
172 | 172 | ||
173 | b = (((xfs_dfsbno_t)r->l0 & XFS_MASK64LO(9)) << 43) | | 173 | b = (((xfs_dfsbno_t)r->l0 & xfs_mask64lo(9)) << 43) | |
174 | (((xfs_dfsbno_t)r->l1) >> 21); | 174 | (((xfs_dfsbno_t)r->l1) >> 21); |
175 | ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); | 175 | ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); |
176 | return (xfs_fsblock_t)b; | 176 | return (xfs_fsblock_t)b; |
@@ -188,7 +188,7 @@ xfs_bmbt_get_startoff( | |||
188 | xfs_bmbt_rec_host_t *r) | 188 | xfs_bmbt_rec_host_t *r) |
189 | { | 189 | { |
190 | return ((xfs_fileoff_t)r->l0 & | 190 | return ((xfs_fileoff_t)r->l0 & |
191 | XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; | 191 | xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; |
192 | } | 192 | } |
193 | 193 | ||
194 | xfs_exntst_t | 194 | xfs_exntst_t |
@@ -219,7 +219,7 @@ xfs_filblks_t | |||
219 | xfs_bmbt_disk_get_blockcount( | 219 | xfs_bmbt_disk_get_blockcount( |
220 | xfs_bmbt_rec_t *r) | 220 | xfs_bmbt_rec_t *r) |
221 | { | 221 | { |
222 | return (xfs_filblks_t)(be64_to_cpu(r->l1) & XFS_MASK64LO(21)); | 222 | return (xfs_filblks_t)(be64_to_cpu(r->l1) & xfs_mask64lo(21)); |
223 | } | 223 | } |
224 | 224 | ||
225 | /* | 225 | /* |
@@ -230,7 +230,7 @@ xfs_bmbt_disk_get_startoff( | |||
230 | xfs_bmbt_rec_t *r) | 230 | xfs_bmbt_rec_t *r) |
231 | { | 231 | { |
232 | return ((xfs_fileoff_t)be64_to_cpu(r->l0) & | 232 | return ((xfs_fileoff_t)be64_to_cpu(r->l0) & |
233 | XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; | 233 | xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
@@ -248,33 +248,33 @@ xfs_bmbt_set_allf( | |||
248 | int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; | 248 | int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; |
249 | 249 | ||
250 | ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); | 250 | ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); |
251 | ASSERT((startoff & XFS_MASK64HI(64-BMBT_STARTOFF_BITLEN)) == 0); | 251 | ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); |
252 | ASSERT((blockcount & XFS_MASK64HI(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); | 252 | ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); |
253 | 253 | ||
254 | #if XFS_BIG_BLKNOS | 254 | #if XFS_BIG_BLKNOS |
255 | ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0); | 255 | ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); |
256 | 256 | ||
257 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 257 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
258 | ((xfs_bmbt_rec_base_t)startoff << 9) | | 258 | ((xfs_bmbt_rec_base_t)startoff << 9) | |
259 | ((xfs_bmbt_rec_base_t)startblock >> 43); | 259 | ((xfs_bmbt_rec_base_t)startblock >> 43); |
260 | r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | | 260 | r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | |
261 | ((xfs_bmbt_rec_base_t)blockcount & | 261 | ((xfs_bmbt_rec_base_t)blockcount & |
262 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 262 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
263 | #else /* !XFS_BIG_BLKNOS */ | 263 | #else /* !XFS_BIG_BLKNOS */ |
264 | if (ISNULLSTARTBLOCK(startblock)) { | 264 | if (ISNULLSTARTBLOCK(startblock)) { |
265 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 265 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
266 | ((xfs_bmbt_rec_base_t)startoff << 9) | | 266 | ((xfs_bmbt_rec_base_t)startoff << 9) | |
267 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(9); | 267 | (xfs_bmbt_rec_base_t)xfs_mask64lo(9); |
268 | r->l1 = XFS_MASK64HI(11) | | 268 | r->l1 = xfs_mask64hi(11) | |
269 | ((xfs_bmbt_rec_base_t)startblock << 21) | | 269 | ((xfs_bmbt_rec_base_t)startblock << 21) | |
270 | ((xfs_bmbt_rec_base_t)blockcount & | 270 | ((xfs_bmbt_rec_base_t)blockcount & |
271 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 271 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
272 | } else { | 272 | } else { |
273 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 273 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
274 | ((xfs_bmbt_rec_base_t)startoff << 9); | 274 | ((xfs_bmbt_rec_base_t)startoff << 9); |
275 | r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | | 275 | r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | |
276 | ((xfs_bmbt_rec_base_t)blockcount & | 276 | ((xfs_bmbt_rec_base_t)blockcount & |
277 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 277 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
278 | } | 278 | } |
279 | #endif /* XFS_BIG_BLKNOS */ | 279 | #endif /* XFS_BIG_BLKNOS */ |
280 | } | 280 | } |
@@ -306,11 +306,11 @@ xfs_bmbt_disk_set_allf( | |||
306 | int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; | 306 | int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; |
307 | 307 | ||
308 | ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); | 308 | ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); |
309 | ASSERT((startoff & XFS_MASK64HI(64-BMBT_STARTOFF_BITLEN)) == 0); | 309 | ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); |
310 | ASSERT((blockcount & XFS_MASK64HI(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); | 310 | ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); |
311 | 311 | ||
312 | #if XFS_BIG_BLKNOS | 312 | #if XFS_BIG_BLKNOS |
313 | ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0); | 313 | ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); |
314 | 314 | ||
315 | r->l0 = cpu_to_be64( | 315 | r->l0 = cpu_to_be64( |
316 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 316 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
@@ -319,17 +319,17 @@ xfs_bmbt_disk_set_allf( | |||
319 | r->l1 = cpu_to_be64( | 319 | r->l1 = cpu_to_be64( |
320 | ((xfs_bmbt_rec_base_t)startblock << 21) | | 320 | ((xfs_bmbt_rec_base_t)startblock << 21) | |
321 | ((xfs_bmbt_rec_base_t)blockcount & | 321 | ((xfs_bmbt_rec_base_t)blockcount & |
322 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); | 322 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); |
323 | #else /* !XFS_BIG_BLKNOS */ | 323 | #else /* !XFS_BIG_BLKNOS */ |
324 | if (ISNULLSTARTBLOCK(startblock)) { | 324 | if (ISNULLSTARTBLOCK(startblock)) { |
325 | r->l0 = cpu_to_be64( | 325 | r->l0 = cpu_to_be64( |
326 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 326 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
327 | ((xfs_bmbt_rec_base_t)startoff << 9) | | 327 | ((xfs_bmbt_rec_base_t)startoff << 9) | |
328 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(9)); | 328 | (xfs_bmbt_rec_base_t)xfs_mask64lo(9)); |
329 | r->l1 = cpu_to_be64(XFS_MASK64HI(11) | | 329 | r->l1 = cpu_to_be64(xfs_mask64hi(11) | |
330 | ((xfs_bmbt_rec_base_t)startblock << 21) | | 330 | ((xfs_bmbt_rec_base_t)startblock << 21) | |
331 | ((xfs_bmbt_rec_base_t)blockcount & | 331 | ((xfs_bmbt_rec_base_t)blockcount & |
332 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); | 332 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); |
333 | } else { | 333 | } else { |
334 | r->l0 = cpu_to_be64( | 334 | r->l0 = cpu_to_be64( |
335 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 335 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
@@ -337,7 +337,7 @@ xfs_bmbt_disk_set_allf( | |||
337 | r->l1 = cpu_to_be64( | 337 | r->l1 = cpu_to_be64( |
338 | ((xfs_bmbt_rec_base_t)startblock << 21) | | 338 | ((xfs_bmbt_rec_base_t)startblock << 21) | |
339 | ((xfs_bmbt_rec_base_t)blockcount & | 339 | ((xfs_bmbt_rec_base_t)blockcount & |
340 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); | 340 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); |
341 | } | 341 | } |
342 | #endif /* XFS_BIG_BLKNOS */ | 342 | #endif /* XFS_BIG_BLKNOS */ |
343 | } | 343 | } |
@@ -362,9 +362,9 @@ xfs_bmbt_set_blockcount( | |||
362 | xfs_bmbt_rec_host_t *r, | 362 | xfs_bmbt_rec_host_t *r, |
363 | xfs_filblks_t v) | 363 | xfs_filblks_t v) |
364 | { | 364 | { |
365 | ASSERT((v & XFS_MASK64HI(43)) == 0); | 365 | ASSERT((v & xfs_mask64hi(43)) == 0); |
366 | r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64HI(43)) | | 366 | r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64hi(43)) | |
367 | (xfs_bmbt_rec_base_t)(v & XFS_MASK64LO(21)); | 367 | (xfs_bmbt_rec_base_t)(v & xfs_mask64lo(21)); |
368 | } | 368 | } |
369 | 369 | ||
370 | /* | 370 | /* |
@@ -376,21 +376,21 @@ xfs_bmbt_set_startblock( | |||
376 | xfs_fsblock_t v) | 376 | xfs_fsblock_t v) |
377 | { | 377 | { |
378 | #if XFS_BIG_BLKNOS | 378 | #if XFS_BIG_BLKNOS |
379 | ASSERT((v & XFS_MASK64HI(12)) == 0); | 379 | ASSERT((v & xfs_mask64hi(12)) == 0); |
380 | r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)XFS_MASK64HI(55)) | | 380 | r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64hi(55)) | |
381 | (xfs_bmbt_rec_base_t)(v >> 43); | 381 | (xfs_bmbt_rec_base_t)(v >> 43); |
382 | r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)) | | 382 | r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)) | |
383 | (xfs_bmbt_rec_base_t)(v << 21); | 383 | (xfs_bmbt_rec_base_t)(v << 21); |
384 | #else /* !XFS_BIG_BLKNOS */ | 384 | #else /* !XFS_BIG_BLKNOS */ |
385 | if (ISNULLSTARTBLOCK(v)) { | 385 | if (ISNULLSTARTBLOCK(v)) { |
386 | r->l0 |= (xfs_bmbt_rec_base_t)XFS_MASK64LO(9); | 386 | r->l0 |= (xfs_bmbt_rec_base_t)xfs_mask64lo(9); |
387 | r->l1 = (xfs_bmbt_rec_base_t)XFS_MASK64HI(11) | | 387 | r->l1 = (xfs_bmbt_rec_base_t)xfs_mask64hi(11) | |
388 | ((xfs_bmbt_rec_base_t)v << 21) | | 388 | ((xfs_bmbt_rec_base_t)v << 21) | |
389 | (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 389 | (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
390 | } else { | 390 | } else { |
391 | r->l0 &= ~(xfs_bmbt_rec_base_t)XFS_MASK64LO(9); | 391 | r->l0 &= ~(xfs_bmbt_rec_base_t)xfs_mask64lo(9); |
392 | r->l1 = ((xfs_bmbt_rec_base_t)v << 21) | | 392 | r->l1 = ((xfs_bmbt_rec_base_t)v << 21) | |
393 | (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 393 | (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
394 | } | 394 | } |
395 | #endif /* XFS_BIG_BLKNOS */ | 395 | #endif /* XFS_BIG_BLKNOS */ |
396 | } | 396 | } |
@@ -403,10 +403,10 @@ xfs_bmbt_set_startoff( | |||
403 | xfs_bmbt_rec_host_t *r, | 403 | xfs_bmbt_rec_host_t *r, |
404 | xfs_fileoff_t v) | 404 | xfs_fileoff_t v) |
405 | { | 405 | { |
406 | ASSERT((v & XFS_MASK64HI(9)) == 0); | 406 | ASSERT((v & xfs_mask64hi(9)) == 0); |
407 | r->l0 = (r->l0 & (xfs_bmbt_rec_base_t) XFS_MASK64HI(1)) | | 407 | r->l0 = (r->l0 & (xfs_bmbt_rec_base_t) xfs_mask64hi(1)) | |
408 | ((xfs_bmbt_rec_base_t)v << 9) | | 408 | ((xfs_bmbt_rec_base_t)v << 9) | |
409 | (r->l0 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(9)); | 409 | (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64lo(9)); |
410 | } | 410 | } |
411 | 411 | ||
412 | /* | 412 | /* |
@@ -419,9 +419,9 @@ xfs_bmbt_set_state( | |||
419 | { | 419 | { |
420 | ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN); | 420 | ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN); |
421 | if (v == XFS_EXT_NORM) | 421 | if (v == XFS_EXT_NORM) |
422 | r->l0 &= XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN); | 422 | r->l0 &= xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN); |
423 | else | 423 | else |
424 | r->l0 |= XFS_MASK64HI(BMBT_EXNTFLAG_BITLEN); | 424 | r->l0 |= xfs_mask64hi(BMBT_EXNTFLAG_BITLEN); |
425 | } | 425 | } |
426 | 426 | ||
427 | /* | 427 | /* |
diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c index 7ed59267420d..2c3ef20f8842 100644 --- a/fs/xfs/xfs_btree.c +++ b/fs/xfs/xfs_btree.c | |||
@@ -730,8 +730,8 @@ xfs_btree_readahead_lblock( | |||
730 | struct xfs_btree_block *block) | 730 | struct xfs_btree_block *block) |
731 | { | 731 | { |
732 | int rval = 0; | 732 | int rval = 0; |
733 | xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); | 733 | xfs_dfsbno_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); |
734 | xfs_fsblock_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); | 734 | xfs_dfsbno_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); |
735 | 735 | ||
736 | if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { | 736 | if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { |
737 | xfs_btree_reada_bufl(cur->bc_mp, left, 1); | 737 | xfs_btree_reada_bufl(cur->bc_mp, left, 1); |
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index e2fa0a1d8e96..e1f0a06aaf04 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -517,9 +517,9 @@ xfs_dir2_block_getdents( | |||
517 | /* | 517 | /* |
518 | * If it didn't fit, set the final offset to here & return. | 518 | * If it didn't fit, set the final offset to here & return. |
519 | */ | 519 | */ |
520 | if (filldir(dirent, dep->name, dep->namelen, cook, | 520 | if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff, |
521 | ino, DT_UNKNOWN)) { | 521 | ino, DT_UNKNOWN)) { |
522 | *offset = cook; | 522 | *offset = cook & 0x7fffffff; |
523 | xfs_da_brelse(NULL, bp); | 523 | xfs_da_brelse(NULL, bp); |
524 | return 0; | 524 | return 0; |
525 | } | 525 | } |
@@ -529,7 +529,8 @@ xfs_dir2_block_getdents( | |||
529 | * Reached the end of the block. | 529 | * Reached the end of the block. |
530 | * Set the offset to a non-existent block 1 and return. | 530 | * Set the offset to a non-existent block 1 and return. |
531 | */ | 531 | */ |
532 | *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); | 532 | *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) & |
533 | 0x7fffffff; | ||
533 | xfs_da_brelse(NULL, bp); | 534 | xfs_da_brelse(NULL, bp); |
534 | return 0; | 535 | return 0; |
535 | } | 536 | } |
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index 93535992cb60..ef805a374eec 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c | |||
@@ -1092,7 +1092,7 @@ xfs_dir2_leaf_getdents( | |||
1092 | * Won't fit. Return to caller. | 1092 | * Won't fit. Return to caller. |
1093 | */ | 1093 | */ |
1094 | if (filldir(dirent, dep->name, dep->namelen, | 1094 | if (filldir(dirent, dep->name, dep->namelen, |
1095 | xfs_dir2_byte_to_dataptr(mp, curoff), | 1095 | xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff, |
1096 | ino, DT_UNKNOWN)) | 1096 | ino, DT_UNKNOWN)) |
1097 | break; | 1097 | break; |
1098 | 1098 | ||
@@ -1108,9 +1108,9 @@ xfs_dir2_leaf_getdents( | |||
1108 | * All done. Set output offset value to current offset. | 1108 | * All done. Set output offset value to current offset. |
1109 | */ | 1109 | */ |
1110 | if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR)) | 1110 | if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR)) |
1111 | *offset = XFS_DIR2_MAX_DATAPTR; | 1111 | *offset = XFS_DIR2_MAX_DATAPTR & 0x7fffffff; |
1112 | else | 1112 | else |
1113 | *offset = xfs_dir2_byte_to_dataptr(mp, curoff); | 1113 | *offset = xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff; |
1114 | kmem_free(map); | 1114 | kmem_free(map); |
1115 | if (bp) | 1115 | if (bp) |
1116 | xfs_da_brelse(NULL, bp); | 1116 | xfs_da_brelse(NULL, bp); |
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index b46af0013ec9..a8a8a6efad5b 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c | |||
@@ -752,8 +752,8 @@ xfs_dir2_sf_getdents( | |||
752 | #if XFS_BIG_INUMS | 752 | #if XFS_BIG_INUMS |
753 | ino += mp->m_inoadd; | 753 | ino += mp->m_inoadd; |
754 | #endif | 754 | #endif |
755 | if (filldir(dirent, ".", 1, dot_offset, ino, DT_DIR)) { | 755 | if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, ino, DT_DIR)) { |
756 | *offset = dot_offset; | 756 | *offset = dot_offset & 0x7fffffff; |
757 | return 0; | 757 | return 0; |
758 | } | 758 | } |
759 | } | 759 | } |
@@ -766,8 +766,8 @@ xfs_dir2_sf_getdents( | |||
766 | #if XFS_BIG_INUMS | 766 | #if XFS_BIG_INUMS |
767 | ino += mp->m_inoadd; | 767 | ino += mp->m_inoadd; |
768 | #endif | 768 | #endif |
769 | if (filldir(dirent, "..", 2, dotdot_offset, ino, DT_DIR)) { | 769 | if (filldir(dirent, "..", 2, dotdot_offset & 0x7fffffff, ino, DT_DIR)) { |
770 | *offset = dotdot_offset; | 770 | *offset = dotdot_offset & 0x7fffffff; |
771 | return 0; | 771 | return 0; |
772 | } | 772 | } |
773 | } | 773 | } |
@@ -791,14 +791,15 @@ xfs_dir2_sf_getdents( | |||
791 | #endif | 791 | #endif |
792 | 792 | ||
793 | if (filldir(dirent, sfep->name, sfep->namelen, | 793 | if (filldir(dirent, sfep->name, sfep->namelen, |
794 | off, ino, DT_UNKNOWN)) { | 794 | off & 0x7fffffff, ino, DT_UNKNOWN)) { |
795 | *offset = off; | 795 | *offset = off & 0x7fffffff; |
796 | return 0; | 796 | return 0; |
797 | } | 797 | } |
798 | sfep = xfs_dir2_sf_nextentry(sfp, sfep); | 798 | sfep = xfs_dir2_sf_nextentry(sfp, sfep); |
799 | } | 799 | } |
800 | 800 | ||
801 | *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); | 801 | *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) & |
802 | 0x7fffffff; | ||
802 | return 0; | 803 | return 0; |
803 | } | 804 | } |
804 | 805 | ||
diff --git a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h index 0f5191644ab2..b2f724502f1b 100644 --- a/fs/xfs/xfs_types.h +++ b/fs/xfs/xfs_types.h | |||
@@ -45,7 +45,7 @@ typedef __uint32_t prid_t; /* project ID */ | |||
45 | typedef __uint32_t inst_t; /* an instruction */ | 45 | typedef __uint32_t inst_t; /* an instruction */ |
46 | 46 | ||
47 | typedef __s64 xfs_off_t; /* <file offset> type */ | 47 | typedef __s64 xfs_off_t; /* <file offset> type */ |
48 | typedef __u64 xfs_ino_t; /* <inode> type */ | 48 | typedef unsigned long long xfs_ino_t; /* <inode> type */ |
49 | typedef __s64 xfs_daddr_t; /* <disk address> type */ | 49 | typedef __s64 xfs_daddr_t; /* <disk address> type */ |
50 | typedef char * xfs_caddr_t; /* <core address> type */ | 50 | typedef char * xfs_caddr_t; /* <core address> type */ |
51 | typedef __u32 xfs_dev_t; | 51 | typedef __u32 xfs_dev_t; |
@@ -111,8 +111,6 @@ typedef __uint64_t xfs_fileoff_t; /* block number in a file */ | |||
111 | typedef __int64_t xfs_sfiloff_t; /* signed block number in a file */ | 111 | typedef __int64_t xfs_sfiloff_t; /* signed block number in a file */ |
112 | typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */ | 112 | typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */ |
113 | 113 | ||
114 | typedef __uint8_t xfs_arch_t; /* architecture of an xfs fs */ | ||
115 | |||
116 | /* | 114 | /* |
117 | * Null values for the types. | 115 | * Null values for the types. |
118 | */ | 116 | */ |
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild index 1f44e7c76995..0f8956def738 100644 --- a/include/asm-frv/Kbuild +++ b/include/asm-frv/Kbuild | |||
@@ -3,4 +3,3 @@ include include/asm-generic/Kbuild.asm | |||
3 | header-y += registers.h | 3 | header-y += registers.h |
4 | 4 | ||
5 | unifdef-y += termios.h | 5 | unifdef-y += termios.h |
6 | unifdef-y += swab.h | ||
diff --git a/include/asm-frv/byteorder.h b/include/asm-frv/byteorder.h index 1187e51ecd13..f29b7593e088 100644 --- a/include/asm-frv/byteorder.h +++ b/include/asm-frv/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_BYTEORDER_H | 1 | #ifndef _ASM_BYTEORDER_H |
2 | #define _ASM_BYTEORDER_H | 2 | #define _ASM_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_BYTEORDER_H */ | 6 | #endif /* _ASM_BYTEORDER_H */ |
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index 1870d5e05f1c..70d185534b9d 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm | |||
@@ -31,6 +31,7 @@ unifdef-y += socket.h | |||
31 | unifdef-y += sockios.h | 31 | unifdef-y += sockios.h |
32 | unifdef-y += stat.h | 32 | unifdef-y += stat.h |
33 | unifdef-y += statfs.h | 33 | unifdef-y += statfs.h |
34 | unifdef-y += swab.h | ||
34 | unifdef-y += termbits.h | 35 | unifdef-y += termbits.h |
35 | unifdef-y += termios.h | 36 | unifdef-y += termios.h |
36 | unifdef-y += types.h | 37 | unifdef-y += types.h |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 72ebe91005a8..8e6d0ca70aba 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -301,7 +301,7 @@ static inline void ptep_modify_prot_commit(struct mm_struct *mm, | |||
301 | * track_pfn_vma_new is called when a _new_ pfn mapping is being established | 301 | * track_pfn_vma_new is called when a _new_ pfn mapping is being established |
302 | * for physical range indicated by pfn and size. | 302 | * for physical range indicated by pfn and size. |
303 | */ | 303 | */ |
304 | static inline int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot, | 304 | static inline int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot, |
305 | unsigned long pfn, unsigned long size) | 305 | unsigned long pfn, unsigned long size) |
306 | { | 306 | { |
307 | return 0; | 307 | return 0; |
@@ -332,7 +332,7 @@ static inline void untrack_pfn_vma(struct vm_area_struct *vma, | |||
332 | { | 332 | { |
333 | } | 333 | } |
334 | #else | 334 | #else |
335 | extern int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot, | 335 | extern int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot, |
336 | unsigned long pfn, unsigned long size); | 336 | unsigned long pfn, unsigned long size); |
337 | extern int track_pfn_vma_copy(struct vm_area_struct *vma); | 337 | extern int track_pfn_vma_copy(struct vm_area_struct *vma); |
338 | extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn, | 338 | extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn, |
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h index 89061c1a67d4..763e3b060f43 100644 --- a/include/asm-generic/rtc.h +++ b/include/asm-generic/rtc.h | |||
@@ -42,7 +42,7 @@ static inline unsigned char rtc_is_updating(void) | |||
42 | return uip; | 42 | return uip; |
43 | } | 43 | } |
44 | 44 | ||
45 | static inline unsigned int get_rtc_time(struct rtc_time *time) | 45 | static inline unsigned int __get_rtc_time(struct rtc_time *time) |
46 | { | 46 | { |
47 | unsigned char ctrl; | 47 | unsigned char ctrl; |
48 | unsigned long flags; | 48 | unsigned long flags; |
@@ -108,8 +108,12 @@ static inline unsigned int get_rtc_time(struct rtc_time *time) | |||
108 | return RTC_24H; | 108 | return RTC_24H; |
109 | } | 109 | } |
110 | 110 | ||
111 | #ifndef get_rtc_time | ||
112 | #define get_rtc_time __get_rtc_time | ||
113 | #endif | ||
114 | |||
111 | /* Set the current date and time in the real time clock. */ | 115 | /* Set the current date and time in the real time clock. */ |
112 | static inline int set_rtc_time(struct rtc_time *time) | 116 | static inline int __set_rtc_time(struct rtc_time *time) |
113 | { | 117 | { |
114 | unsigned long flags; | 118 | unsigned long flags; |
115 | unsigned char mon, day, hrs, min, sec; | 119 | unsigned char mon, day, hrs, min, sec; |
@@ -190,11 +194,15 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
190 | return 0; | 194 | return 0; |
191 | } | 195 | } |
192 | 196 | ||
197 | #ifndef set_rtc_time | ||
198 | #define set_rtc_time __set_rtc_time | ||
199 | #endif | ||
200 | |||
193 | static inline unsigned int get_rtc_ss(void) | 201 | static inline unsigned int get_rtc_ss(void) |
194 | { | 202 | { |
195 | struct rtc_time h; | 203 | struct rtc_time h; |
196 | 204 | ||
197 | get_rtc_time(&h); | 205 | __get_rtc_time(&h); |
198 | return h.tm_sec; | 206 | return h.tm_sec; |
199 | } | 207 | } |
200 | 208 | ||
diff --git a/include/asm-m32r/Kbuild b/include/asm-m32r/Kbuild index 27b108a86b39..c68e1680da01 100644 --- a/include/asm-m32r/Kbuild +++ b/include/asm-m32r/Kbuild | |||
@@ -1,2 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | unifdef-y += swab.h | ||
diff --git a/include/asm-m32r/byteorder.h b/include/asm-m32r/byteorder.h index 61ff9cfd8451..21855d8b028b 100644 --- a/include/asm-m32r/byteorder.h +++ b/include/asm-m32r/byteorder.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ASM_M32R_BYTEORDER_H | 1 | #ifndef _ASM_M32R_BYTEORDER_H |
2 | #define _ASM_M32R_BYTEORDER_H | 2 | #define _ASM_M32R_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | |||
6 | #if defined(__LITTLE_ENDIAN__) | 4 | #if defined(__LITTLE_ENDIAN__) |
7 | # include <linux/byteorder/little_endian.h> | 5 | # include <linux/byteorder/little_endian.h> |
8 | #else | 6 | #else |
diff --git a/include/asm-m68k/Kbuild b/include/asm-m68k/Kbuild index 52fd96b4142a..1a922fad76f7 100644 --- a/include/asm-m68k/Kbuild +++ b/include/asm-m68k/Kbuild | |||
@@ -1,3 +1,2 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | header-y += cachectl.h | 2 | header-y += cachectl.h |
3 | unifdef-y += swab.h | ||
diff --git a/include/asm-m68k/byteorder.h b/include/asm-m68k/byteorder.h index 300866523b86..31b260a88803 100644 --- a/include/asm-m68k/byteorder.h +++ b/include/asm-m68k/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _M68K_BYTEORDER_H | 1 | #ifndef _M68K_BYTEORDER_H |
2 | #define _M68K_BYTEORDER_H | 2 | #define _M68K_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _M68K_BYTEORDER_H */ | 6 | #endif /* _M68K_BYTEORDER_H */ |
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index 965abb8bc7ff..3c19027331fa 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h | |||
@@ -5,6 +5,7 @@ | |||
5 | * This file contains the system call numbers. | 5 | * This file contains the system call numbers. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define __NR_restart_syscall 0 | ||
8 | #define __NR_exit 1 | 9 | #define __NR_exit 1 |
9 | #define __NR_fork 2 | 10 | #define __NR_fork 2 |
10 | #define __NR_read 3 | 11 | #define __NR_read 3 |
@@ -359,9 +360,6 @@ | |||
359 | #define __ARCH_WANT_SYS_SIGPROCMASK | 360 | #define __ARCH_WANT_SYS_SIGPROCMASK |
360 | #define __ARCH_WANT_SYS_RT_SIGACTION | 361 | #define __ARCH_WANT_SYS_RT_SIGACTION |
361 | 362 | ||
362 | /* whitelist for checksyscalls */ | ||
363 | #define __IGNORE_restart_syscall | ||
364 | |||
365 | /* | 363 | /* |
366 | * "Conditional" syscalls | 364 | * "Conditional" syscalls |
367 | * | 365 | * |
diff --git a/include/asm-mn10300/Kbuild b/include/asm-mn10300/Kbuild index 27b108a86b39..c68e1680da01 100644 --- a/include/asm-mn10300/Kbuild +++ b/include/asm-mn10300/Kbuild | |||
@@ -1,2 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | unifdef-y += swab.h | ||
diff --git a/include/asm-mn10300/byteorder.h b/include/asm-mn10300/byteorder.h index 45b18ded19e6..5dd0bdd9feee 100644 --- a/include/asm-mn10300/byteorder.h +++ b/include/asm-mn10300/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_BYTEORDER_H | 1 | #ifndef _ASM_BYTEORDER_H |
2 | #define _ASM_BYTEORDER_H | 2 | #define _ASM_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_BYTEORDER_H */ | 6 | #endif /* _ASM_BYTEORDER_H */ |
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h index c8fdb6e658e1..110c600c885f 100644 --- a/include/linux/agpgart.h +++ b/include/linux/agpgart.h | |||
@@ -52,7 +52,6 @@ | |||
52 | 52 | ||
53 | #ifndef __KERNEL__ | 53 | #ifndef __KERNEL__ |
54 | #include <linux/types.h> | 54 | #include <linux/types.h> |
55 | #include <asm/types.h> | ||
56 | 55 | ||
57 | struct agp_version { | 56 | struct agp_version { |
58 | __u16 major; | 57 | __u16 major; |
diff --git a/include/linux/atm_idt77105.h b/include/linux/atm_idt77105.h index 05621cf20709..8b724000aa50 100644 --- a/include/linux/atm_idt77105.h +++ b/include/linux/atm_idt77105.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #ifndef LINUX_ATM_IDT77105_H | 7 | #ifndef LINUX_ATM_IDT77105_H |
8 | #define LINUX_ATM_IDT77105_H | 8 | #define LINUX_ATM_IDT77105_H |
9 | 9 | ||
10 | #include <asm/types.h> | 10 | #include <linux/types.h> |
11 | #include <linux/atmioc.h> | 11 | #include <linux/atmioc.h> |
12 | #include <linux/atmdev.h> | 12 | #include <linux/atmdev.h> |
13 | 13 | ||
diff --git a/include/linux/capi.h b/include/linux/capi.h index fdebaaa9f66e..65100d6cb89b 100644 --- a/include/linux/capi.h +++ b/include/linux/capi.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #ifndef __LINUX_CAPI_H__ | 12 | #ifndef __LINUX_CAPI_H__ |
13 | #define __LINUX_CAPI_H__ | 13 | #define __LINUX_CAPI_H__ |
14 | 14 | ||
15 | #include <asm/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/ioctl.h> | 16 | #include <linux/ioctl.h> |
17 | #ifndef __KERNEL__ | 17 | #ifndef __KERNEL__ |
18 | #include <linux/kernelcapi.h> | 18 | #include <linux/kernelcapi.h> |
diff --git a/include/linux/compat.h b/include/linux/compat.h index e88f3ecf38b4..3fd2194ff573 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -280,5 +280,18 @@ asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, | |||
280 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | 280 | asmlinkage long compat_sys_timerfd_gettime(int ufd, |
281 | struct compat_itimerspec __user *otmr); | 281 | struct compat_itimerspec __user *otmr); |
282 | 282 | ||
283 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | ||
284 | __u32 __user *pages, | ||
285 | const int __user *nodes, | ||
286 | int __user *status, | ||
287 | int flags); | ||
288 | asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, | ||
289 | struct compat_timeval __user *t); | ||
290 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | ||
291 | struct compat_stat __user *statbuf, | ||
292 | int flag); | ||
293 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | ||
294 | int flags, int mode); | ||
295 | |||
283 | #endif /* CONFIG_COMPAT */ | 296 | #endif /* CONFIG_COMPAT */ |
284 | #endif /* _LINUX_COMPAT_H */ | 297 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 5c7f9468f753..34f2789d9b9b 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #ifndef __CONNECTOR_H | 22 | #ifndef __CONNECTOR_H |
23 | #define __CONNECTOR_H | 23 | #define __CONNECTOR_H |
24 | 24 | ||
25 | #include <asm/types.h> | 25 | #include <linux/types.h> |
26 | 26 | ||
27 | #define CN_IDX_CONNECTOR 0xffffffff | 27 | #define CN_IDX_CONNECTOR 0xffffffff |
28 | #define CN_VAL_CONNECTOR 0xffffffff | 28 | #define CN_VAL_CONNECTOR 0xffffffff |
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 2d3d1e04ba92..d06fbf286346 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h | |||
@@ -150,8 +150,6 @@ struct CYZ_BOOT_CTRL { | |||
150 | * architectures and compilers. | 150 | * architectures and compilers. |
151 | */ | 151 | */ |
152 | 152 | ||
153 | #include <asm/types.h> | ||
154 | |||
155 | typedef __u64 ucdouble; /* 64 bits, unsigned */ | 153 | typedef __u64 ucdouble; /* 64 bits, unsigned */ |
156 | typedef __u32 uclong; /* 32 bits, unsigned */ | 154 | typedef __u32 uclong; /* 32 bits, unsigned */ |
157 | typedef __u16 ucshort; /* 16 bits, unsigned */ | 155 | typedef __u16 ucshort; /* 16 bits, unsigned */ |
diff --git a/include/linux/dio.h b/include/linux/dio.h index 1e65ebc2a3db..b2dd31ca1710 100644 --- a/include/linux/dio.h +++ b/include/linux/dio.h | |||
@@ -241,7 +241,7 @@ struct dio_driver { | |||
241 | 241 | ||
242 | extern int dio_find(int deviceid); | 242 | extern int dio_find(int deviceid); |
243 | extern unsigned long dio_scodetophysaddr(int scode); | 243 | extern unsigned long dio_scodetophysaddr(int scode); |
244 | extern void dio_create_sysfs_dev_files(struct dio_dev *); | 244 | extern int dio_create_sysfs_dev_files(struct dio_dev *); |
245 | 245 | ||
246 | /* New-style probing */ | 246 | /* New-style probing */ |
247 | extern int dio_register_driver(struct dio_driver *); | 247 | extern int dio_register_driver(struct dio_driver *); |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 64dea2ab326c..c73f1e2b59b7 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -270,8 +270,18 @@ struct dma_device { | |||
270 | 270 | ||
271 | /* --- public DMA engine API --- */ | 271 | /* --- public DMA engine API --- */ |
272 | 272 | ||
273 | #ifdef CONFIG_DMA_ENGINE | ||
273 | void dmaengine_get(void); | 274 | void dmaengine_get(void); |
274 | void dmaengine_put(void); | 275 | void dmaengine_put(void); |
276 | #else | ||
277 | static inline void dmaengine_get(void) | ||
278 | { | ||
279 | } | ||
280 | static inline void dmaengine_put(void) | ||
281 | { | ||
282 | } | ||
283 | #endif | ||
284 | |||
275 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | 285 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, |
276 | void *dest, void *src, size_t len); | 286 | void *dest, void *src, size_t len); |
277 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, | 287 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 1ee63df5be92..818fe21257e8 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_FB_H | 1 | #ifndef _LINUX_FB_H |
2 | #define _LINUX_FB_H | 2 | #define _LINUX_FB_H |
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/i2c.h> | 5 | #include <linux/i2c.h> |
6 | 6 | ||
7 | struct dentry; | 7 | struct dentry; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 3644f6323384..194da5a4b0d6 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -871,7 +871,7 @@ struct ide_host { | |||
871 | ide_hwif_t *cur_port; /* for hosts requiring serialization */ | 871 | ide_hwif_t *cur_port; /* for hosts requiring serialization */ |
872 | 872 | ||
873 | /* used for hosts requiring serialization */ | 873 | /* used for hosts requiring serialization */ |
874 | volatile long host_busy; | 874 | volatile unsigned long host_busy; |
875 | }; | 875 | }; |
876 | 876 | ||
877 | #define IDE_HOST_BUSY 0 | 877 | #define IDE_HOST_BUSY 0 |
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h index a7d6a2234b31..c7a66882b6d0 100644 --- a/include/linux/if_pppol2tp.h +++ b/include/linux/if_pppol2tp.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #ifndef __LINUX_IF_PPPOL2TP_H | 15 | #ifndef __LINUX_IF_PPPOL2TP_H |
16 | #define __LINUX_IF_PPPOL2TP_H | 16 | #define __LINUX_IF_PPPOL2TP_H |
17 | 17 | ||
18 | #include <asm/types.h> | 18 | #include <linux/types.h> |
19 | 19 | ||
20 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
21 | #include <linux/in.h> | 21 | #include <linux/in.h> |
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 6fb7f1788570..30c88b2245ff 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #define __LINUX_IF_PPPOX_H | 17 | #define __LINUX_IF_PPPOX_H |
18 | 18 | ||
19 | 19 | ||
20 | #include <asm/types.h> | 20 | #include <linux/types.h> |
21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
22 | 22 | ||
23 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
diff --git a/include/linux/input.h b/include/linux/input.h index 9a6355f74db2..1249a0c20a38 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <sys/time.h> | 16 | #include <sys/time.h> |
17 | #include <sys/ioctl.h> | 17 | #include <sys/ioctl.h> |
18 | #include <sys/types.h> | 18 | #include <sys/types.h> |
19 | #include <asm/types.h> | 19 | #include <linux/types.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | /* | 22 | /* |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index f6bb2ca8e3ba..32e4b2f72294 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -143,7 +143,8 @@ static inline unsigned long resource_type(struct resource *res) | |||
143 | 143 | ||
144 | extern struct resource * __request_region(struct resource *, | 144 | extern struct resource * __request_region(struct resource *, |
145 | resource_size_t start, | 145 | resource_size_t start, |
146 | resource_size_t n, const char *name, int relaxed); | 146 | resource_size_t n, |
147 | const char *name, int flags); | ||
147 | 148 | ||
148 | /* Compatibility cruft */ | 149 | /* Compatibility cruft */ |
149 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) | 150 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 6384b19efe64..64246dce5663 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -614,6 +614,8 @@ struct transaction_s | |||
614 | * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the | 614 | * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the |
615 | * number that will fit in j_blocksize | 615 | * number that will fit in j_blocksize |
616 | * @j_last_sync_writer: most recent pid which did a synchronous write | 616 | * @j_last_sync_writer: most recent pid which did a synchronous write |
617 | * @j_average_commit_time: the average amount of time in nanoseconds it | ||
618 | * takes to commit a transaction to the disk. | ||
617 | * @j_private: An opaque pointer to fs-private information. | 619 | * @j_private: An opaque pointer to fs-private information. |
618 | */ | 620 | */ |
619 | 621 | ||
diff --git a/include/linux/joystick.h b/include/linux/joystick.h index b5e051295a67..9e20c29c1e14 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h | |||
@@ -27,7 +27,7 @@ | |||
27 | * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic | 27 | * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <asm/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/input.h> | 31 | #include <linux/input.h> |
32 | 32 | ||
33 | /* | 33 | /* |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 35525ac63337..5715f1907601 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * Note: you must update KVM_API_VERSION if you change this interface. | 7 | * Note: you must update KVM_API_VERSION if you change this interface. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <asm/types.h> | 10 | #include <linux/types.h> |
11 | #include <linux/compiler.h> | 11 | #include <linux/compiler.h> |
12 | #include <linux/ioctl.h> | 12 | #include <linux/ioctl.h> |
13 | #include <asm/kvm.h> | 13 | #include <asm/kvm.h> |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 4f7c8fb4d3fe..b6b8a7f3ec66 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -239,6 +239,7 @@ enum { | |||
239 | /* host set flags */ | 239 | /* host set flags */ |
240 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ | 240 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ |
241 | ATA_HOST_STARTED = (1 << 1), /* Host started */ | 241 | ATA_HOST_STARTED = (1 << 1), /* Host started */ |
242 | ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */ | ||
242 | 243 | ||
243 | /* bits 24:31 of host->flags are reserved for LLD specific flags */ | 244 | /* bits 24:31 of host->flags are reserved for LLD specific flags */ |
244 | 245 | ||
diff --git a/include/linux/loop.h b/include/linux/loop.h index 46169a7b559b..6ffd6db5bb0d 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -80,7 +80,7 @@ enum { | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | #include <asm/posix_types.h> /* for __kernel_old_dev_t */ | 82 | #include <asm/posix_types.h> /* for __kernel_old_dev_t */ |
83 | #include <asm/types.h> /* for __u64 */ | 83 | #include <linux/types.h> /* for __u64 */ |
84 | 84 | ||
85 | /* Backwards compatibility version */ | 85 | /* Backwards compatibility version */ |
86 | struct loop_info { | 86 | struct loop_info { |
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 557477ac3d5b..5da3d95b27f1 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
@@ -559,7 +559,10 @@ extern void mISDN_unregister_clock(struct mISDNclock *); | |||
559 | 559 | ||
560 | static inline struct mISDNdevice *dev_to_mISDN(struct device *dev) | 560 | static inline struct mISDNdevice *dev_to_mISDN(struct device *dev) |
561 | { | 561 | { |
562 | return dev_get_drvdata(dev); | 562 | if (dev) |
563 | return dev_get_drvdata(dev); | ||
564 | else | ||
565 | return NULL; | ||
563 | } | 566 | } |
564 | 567 | ||
565 | extern void set_channel_address(struct mISDNchannel *, u_int, u_int); | 568 | extern void set_channel_address(struct mISDNchannel *, u_int, u_int); |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 439f6f3cb0c4..0b4df7eba852 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -10,11 +10,13 @@ | |||
10 | #define SYSFS_MAGIC 0x62656572 | 10 | #define SYSFS_MAGIC 0x62656572 |
11 | #define SECURITYFS_MAGIC 0x73636673 | 11 | #define SECURITYFS_MAGIC 0x73636673 |
12 | #define TMPFS_MAGIC 0x01021994 | 12 | #define TMPFS_MAGIC 0x01021994 |
13 | #define SQUASHFS_MAGIC 0x73717368 | ||
13 | #define EFS_SUPER_MAGIC 0x414A53 | 14 | #define EFS_SUPER_MAGIC 0x414A53 |
14 | #define EXT2_SUPER_MAGIC 0xEF53 | 15 | #define EXT2_SUPER_MAGIC 0xEF53 |
15 | #define EXT3_SUPER_MAGIC 0xEF53 | 16 | #define EXT3_SUPER_MAGIC 0xEF53 |
16 | #define XENFS_SUPER_MAGIC 0xabba1974 | 17 | #define XENFS_SUPER_MAGIC 0xabba1974 |
17 | #define EXT4_SUPER_MAGIC 0xEF53 | 18 | #define EXT4_SUPER_MAGIC 0xEF53 |
19 | #define BTRFS_SUPER_MAGIC 0x9123683E | ||
18 | #define HPFS_SUPER_MAGIC 0xf995e849 | 20 | #define HPFS_SUPER_MAGIC 0xf995e849 |
19 | #define ISOFS_SUPER_MAGIC 0x9660 | 21 | #define ISOFS_SUPER_MAGIC 0x9660 |
20 | #define JFFS2_SUPER_MAGIC 0x72b6 | 22 | #define JFFS2_SUPER_MAGIC 0x72b6 |
diff --git a/include/linux/matroxfb.h b/include/linux/matroxfb.h index ae5b09493062..404f678e734b 100644 --- a/include/linux/matroxfb.h +++ b/include/linux/matroxfb.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __LINUX_MATROXFB_H__ | 2 | #define __LINUX_MATROXFB_H__ |
3 | 3 | ||
4 | #include <asm/ioctl.h> | 4 | #include <asm/ioctl.h> |
5 | #include <asm/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/videodev2.h> | 6 | #include <linux/videodev2.h> |
7 | 7 | ||
8 | struct matroxioc_output_mode { | 8 | struct matroxioc_output_mode { |
diff --git a/include/linux/mfd/pcf50633/adc.h b/include/linux/mfd/pcf50633/adc.h new file mode 100644 index 000000000000..56669b4183ad --- /dev/null +++ b/include/linux/mfd/pcf50633/adc.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * adc.h -- Driver for NXP PCF50633 ADC | ||
3 | * | ||
4 | * (C) 2006-2008 by Openmoko, Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_PCF50633_ADC_H | ||
14 | #define __LINUX_MFD_PCF50633_ADC_H | ||
15 | |||
16 | #include <linux/mfd/pcf50633/core.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | |||
19 | /* ADC Registers */ | ||
20 | #define PCF50633_REG_ADCC3 0x52 | ||
21 | #define PCF50633_REG_ADCC2 0x53 | ||
22 | #define PCF50633_REG_ADCC1 0x54 | ||
23 | #define PCF50633_REG_ADCS1 0x55 | ||
24 | #define PCF50633_REG_ADCS2 0x56 | ||
25 | #define PCF50633_REG_ADCS3 0x57 | ||
26 | |||
27 | #define PCF50633_ADCC1_ADCSTART 0x01 | ||
28 | #define PCF50633_ADCC1_RES_10BIT 0x02 | ||
29 | #define PCF50633_ADCC1_AVERAGE_NO 0x00 | ||
30 | #define PCF50633_ADCC1_AVERAGE_4 0x04 | ||
31 | #define PCF50633_ADCC1_AVERAGE_8 0x08 | ||
32 | #define PCF50633_ADCC1_AVERAGE_16 0x0c | ||
33 | #define PCF50633_ADCC1_MUX_BATSNS_RES 0x00 | ||
34 | #define PCF50633_ADCC1_MUX_BATSNS_SUBTR 0x10 | ||
35 | #define PCF50633_ADCC1_MUX_ADCIN2_RES 0x20 | ||
36 | #define PCF50633_ADCC1_MUX_ADCIN2_SUBTR 0x30 | ||
37 | #define PCF50633_ADCC1_MUX_BATTEMP 0x60 | ||
38 | #define PCF50633_ADCC1_MUX_ADCIN1 0x70 | ||
39 | #define PCF50633_ADCC1_AVERAGE_MASK 0x0c | ||
40 | #define PCF50633_ADCC1_ADCMUX_MASK 0xf0 | ||
41 | |||
42 | #define PCF50633_ADCC2_RATIO_NONE 0x00 | ||
43 | #define PCF50633_ADCC2_RATIO_BATTEMP 0x01 | ||
44 | #define PCF50633_ADCC2_RATIO_ADCIN1 0x02 | ||
45 | #define PCF50633_ADCC2_RATIO_BOTH 0x03 | ||
46 | #define PCF50633_ADCC2_RATIOSETTL_100US 0x04 | ||
47 | |||
48 | #define PCF50633_ADCC3_ACCSW_EN 0x01 | ||
49 | #define PCF50633_ADCC3_NTCSW_EN 0x04 | ||
50 | #define PCF50633_ADCC3_RES_DIV_TWO 0x10 | ||
51 | #define PCF50633_ADCC3_RES_DIV_THREE 0x00 | ||
52 | |||
53 | #define PCF50633_ADCS3_REF_NTCSW 0x00 | ||
54 | #define PCF50633_ADCS3_REF_ACCSW 0x10 | ||
55 | #define PCF50633_ADCS3_REF_2V0 0x20 | ||
56 | #define PCF50633_ADCS3_REF_VISA 0x30 | ||
57 | #define PCF50633_ADCS3_REF_2V0_2 0x70 | ||
58 | #define PCF50633_ADCS3_ADCRDY 0x80 | ||
59 | |||
60 | #define PCF50633_ADCS3_ADCDAT1L_MASK 0x03 | ||
61 | #define PCF50633_ADCS3_ADCDAT2L_MASK 0x0c | ||
62 | #define PCF50633_ADCS3_ADCDAT2L_SHIFT 2 | ||
63 | #define PCF50633_ASCS3_REF_MASK 0x70 | ||
64 | |||
65 | extern int | ||
66 | pcf50633_adc_async_read(struct pcf50633 *pcf, int mux, int avg, | ||
67 | void (*callback)(struct pcf50633 *, void *, int), | ||
68 | void *callback_param); | ||
69 | extern int | ||
70 | pcf50633_adc_sync_read(struct pcf50633 *pcf, int mux, int avg); | ||
71 | |||
72 | #endif /* __LINUX_PCF50633_ADC_H */ | ||
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h new file mode 100644 index 000000000000..4455b212d75a --- /dev/null +++ b/include/linux/mfd/pcf50633/core.h | |||
@@ -0,0 +1,218 @@ | |||
1 | /* | ||
2 | * core.h -- Core driver for NXP PCF50633 | ||
3 | * | ||
4 | * (C) 2006-2008 by Openmoko, Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_PCF50633_CORE_H | ||
14 | #define __LINUX_MFD_PCF50633_CORE_H | ||
15 | |||
16 | #include <linux/i2c.h> | ||
17 | #include <linux/workqueue.h> | ||
18 | #include <linux/regulator/driver.h> | ||
19 | #include <linux/regulator/machine.h> | ||
20 | #include <linux/power_supply.h> | ||
21 | |||
22 | struct pcf50633; | ||
23 | |||
24 | #define PCF50633_NUM_REGULATORS 11 | ||
25 | |||
26 | struct pcf50633_platform_data { | ||
27 | struct regulator_init_data reg_init_data[PCF50633_NUM_REGULATORS]; | ||
28 | |||
29 | char **batteries; | ||
30 | int num_batteries; | ||
31 | |||
32 | /* Callbacks */ | ||
33 | void (*probe_done)(struct pcf50633 *); | ||
34 | void (*mbc_event_callback)(struct pcf50633 *, int); | ||
35 | void (*regulator_registered)(struct pcf50633 *, int); | ||
36 | void (*force_shutdown)(struct pcf50633 *); | ||
37 | |||
38 | u8 resumers[5]; | ||
39 | }; | ||
40 | |||
41 | struct pcf50633_subdev_pdata { | ||
42 | struct pcf50633 *pcf; | ||
43 | }; | ||
44 | |||
45 | struct pcf50633_irq { | ||
46 | void (*handler) (int, void *); | ||
47 | void *data; | ||
48 | }; | ||
49 | |||
50 | int pcf50633_register_irq(struct pcf50633 *pcf, int irq, | ||
51 | void (*handler) (int, void *), void *data); | ||
52 | int pcf50633_free_irq(struct pcf50633 *pcf, int irq); | ||
53 | |||
54 | int pcf50633_irq_mask(struct pcf50633 *pcf, int irq); | ||
55 | int pcf50633_irq_unmask(struct pcf50633 *pcf, int irq); | ||
56 | int pcf50633_irq_mask_get(struct pcf50633 *pcf, int irq); | ||
57 | |||
58 | int pcf50633_read_block(struct pcf50633 *, u8 reg, | ||
59 | int nr_regs, u8 *data); | ||
60 | int pcf50633_write_block(struct pcf50633 *pcf, u8 reg, | ||
61 | int nr_regs, u8 *data); | ||
62 | u8 pcf50633_reg_read(struct pcf50633 *, u8 reg); | ||
63 | int pcf50633_reg_write(struct pcf50633 *pcf, u8 reg, u8 val); | ||
64 | |||
65 | int pcf50633_reg_set_bit_mask(struct pcf50633 *pcf, u8 reg, u8 mask, u8 val); | ||
66 | int pcf50633_reg_clear_bits(struct pcf50633 *pcf, u8 reg, u8 bits); | ||
67 | |||
68 | /* Interrupt registers */ | ||
69 | |||
70 | #define PCF50633_REG_INT1 0x02 | ||
71 | #define PCF50633_REG_INT2 0x03 | ||
72 | #define PCF50633_REG_INT3 0x04 | ||
73 | #define PCF50633_REG_INT4 0x05 | ||
74 | #define PCF50633_REG_INT5 0x06 | ||
75 | |||
76 | #define PCF50633_REG_INT1M 0x07 | ||
77 | #define PCF50633_REG_INT2M 0x08 | ||
78 | #define PCF50633_REG_INT3M 0x09 | ||
79 | #define PCF50633_REG_INT4M 0x0a | ||
80 | #define PCF50633_REG_INT5M 0x0b | ||
81 | |||
82 | enum { | ||
83 | /* Chip IRQs */ | ||
84 | PCF50633_IRQ_ADPINS, | ||
85 | PCF50633_IRQ_ADPREM, | ||
86 | PCF50633_IRQ_USBINS, | ||
87 | PCF50633_IRQ_USBREM, | ||
88 | PCF50633_IRQ_RESERVED1, | ||
89 | PCF50633_IRQ_RESERVED2, | ||
90 | PCF50633_IRQ_ALARM, | ||
91 | PCF50633_IRQ_SECOND, | ||
92 | PCF50633_IRQ_ONKEYR, | ||
93 | PCF50633_IRQ_ONKEYF, | ||
94 | PCF50633_IRQ_EXTON1R, | ||
95 | PCF50633_IRQ_EXTON1F, | ||
96 | PCF50633_IRQ_EXTON2R, | ||
97 | PCF50633_IRQ_EXTON2F, | ||
98 | PCF50633_IRQ_EXTON3R, | ||
99 | PCF50633_IRQ_EXTON3F, | ||
100 | PCF50633_IRQ_BATFULL, | ||
101 | PCF50633_IRQ_CHGHALT, | ||
102 | PCF50633_IRQ_THLIMON, | ||
103 | PCF50633_IRQ_THLIMOFF, | ||
104 | PCF50633_IRQ_USBLIMON, | ||
105 | PCF50633_IRQ_USBLIMOFF, | ||
106 | PCF50633_IRQ_ADCRDY, | ||
107 | PCF50633_IRQ_ONKEY1S, | ||
108 | PCF50633_IRQ_LOWSYS, | ||
109 | PCF50633_IRQ_LOWBAT, | ||
110 | PCF50633_IRQ_HIGHTMP, | ||
111 | PCF50633_IRQ_AUTOPWRFAIL, | ||
112 | PCF50633_IRQ_DWN1PWRFAIL, | ||
113 | PCF50633_IRQ_DWN2PWRFAIL, | ||
114 | PCF50633_IRQ_LEDPWRFAIL, | ||
115 | PCF50633_IRQ_LEDOVP, | ||
116 | PCF50633_IRQ_LDO1PWRFAIL, | ||
117 | PCF50633_IRQ_LDO2PWRFAIL, | ||
118 | PCF50633_IRQ_LDO3PWRFAIL, | ||
119 | PCF50633_IRQ_LDO4PWRFAIL, | ||
120 | PCF50633_IRQ_LDO5PWRFAIL, | ||
121 | PCF50633_IRQ_LDO6PWRFAIL, | ||
122 | PCF50633_IRQ_HCLDOPWRFAIL, | ||
123 | PCF50633_IRQ_HCLDOOVL, | ||
124 | |||
125 | /* Always last */ | ||
126 | PCF50633_NUM_IRQ, | ||
127 | }; | ||
128 | |||
129 | struct pcf50633 { | ||
130 | struct device *dev; | ||
131 | struct i2c_client *i2c_client; | ||
132 | |||
133 | struct pcf50633_platform_data *pdata; | ||
134 | int irq; | ||
135 | struct pcf50633_irq irq_handler[PCF50633_NUM_IRQ]; | ||
136 | struct work_struct irq_work; | ||
137 | struct mutex lock; | ||
138 | |||
139 | u8 mask_regs[5]; | ||
140 | |||
141 | u8 suspend_irq_masks[5]; | ||
142 | u8 resume_reason[5]; | ||
143 | int is_suspended; | ||
144 | |||
145 | int onkey1s_held; | ||
146 | |||
147 | struct platform_device *rtc_pdev; | ||
148 | struct platform_device *mbc_pdev; | ||
149 | struct platform_device *adc_pdev; | ||
150 | struct platform_device *input_pdev; | ||
151 | struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS]; | ||
152 | }; | ||
153 | |||
154 | enum pcf50633_reg_int1 { | ||
155 | PCF50633_INT1_ADPINS = 0x01, /* Adapter inserted */ | ||
156 | PCF50633_INT1_ADPREM = 0x02, /* Adapter removed */ | ||
157 | PCF50633_INT1_USBINS = 0x04, /* USB inserted */ | ||
158 | PCF50633_INT1_USBREM = 0x08, /* USB removed */ | ||
159 | /* reserved */ | ||
160 | PCF50633_INT1_ALARM = 0x40, /* RTC alarm time is reached */ | ||
161 | PCF50633_INT1_SECOND = 0x80, /* RTC periodic second interrupt */ | ||
162 | }; | ||
163 | |||
164 | enum pcf50633_reg_int2 { | ||
165 | PCF50633_INT2_ONKEYR = 0x01, /* ONKEY rising edge */ | ||
166 | PCF50633_INT2_ONKEYF = 0x02, /* ONKEY falling edge */ | ||
167 | PCF50633_INT2_EXTON1R = 0x04, /* EXTON1 rising edge */ | ||
168 | PCF50633_INT2_EXTON1F = 0x08, /* EXTON1 falling edge */ | ||
169 | PCF50633_INT2_EXTON2R = 0x10, /* EXTON2 rising edge */ | ||
170 | PCF50633_INT2_EXTON2F = 0x20, /* EXTON2 falling edge */ | ||
171 | PCF50633_INT2_EXTON3R = 0x40, /* EXTON3 rising edge */ | ||
172 | PCF50633_INT2_EXTON3F = 0x80, /* EXTON3 falling edge */ | ||
173 | }; | ||
174 | |||
175 | enum pcf50633_reg_int3 { | ||
176 | PCF50633_INT3_BATFULL = 0x01, /* Battery full */ | ||
177 | PCF50633_INT3_CHGHALT = 0x02, /* Charger halt */ | ||
178 | PCF50633_INT3_THLIMON = 0x04, | ||
179 | PCF50633_INT3_THLIMOFF = 0x08, | ||
180 | PCF50633_INT3_USBLIMON = 0x10, | ||
181 | PCF50633_INT3_USBLIMOFF = 0x20, | ||
182 | PCF50633_INT3_ADCRDY = 0x40, /* ADC result ready */ | ||
183 | PCF50633_INT3_ONKEY1S = 0x80, /* ONKEY pressed 1 second */ | ||
184 | }; | ||
185 | |||
186 | enum pcf50633_reg_int4 { | ||
187 | PCF50633_INT4_LOWSYS = 0x01, | ||
188 | PCF50633_INT4_LOWBAT = 0x02, | ||
189 | PCF50633_INT4_HIGHTMP = 0x04, | ||
190 | PCF50633_INT4_AUTOPWRFAIL = 0x08, | ||
191 | PCF50633_INT4_DWN1PWRFAIL = 0x10, | ||
192 | PCF50633_INT4_DWN2PWRFAIL = 0x20, | ||
193 | PCF50633_INT4_LEDPWRFAIL = 0x40, | ||
194 | PCF50633_INT4_LEDOVP = 0x80, | ||
195 | }; | ||
196 | |||
197 | enum pcf50633_reg_int5 { | ||
198 | PCF50633_INT5_LDO1PWRFAIL = 0x01, | ||
199 | PCF50633_INT5_LDO2PWRFAIL = 0x02, | ||
200 | PCF50633_INT5_LDO3PWRFAIL = 0x04, | ||
201 | PCF50633_INT5_LDO4PWRFAIL = 0x08, | ||
202 | PCF50633_INT5_LDO5PWRFAIL = 0x10, | ||
203 | PCF50633_INT5_LDO6PWRFAIL = 0x20, | ||
204 | PCF50633_INT5_HCLDOPWRFAIL = 0x40, | ||
205 | PCF50633_INT5_HCLDOOVL = 0x80, | ||
206 | }; | ||
207 | |||
208 | /* misc. registers */ | ||
209 | #define PCF50633_REG_OOCSHDWN 0x0c | ||
210 | |||
211 | /* LED registers */ | ||
212 | #define PCF50633_REG_LEDOUT 0x28 | ||
213 | #define PCF50633_REG_LEDENA 0x29 | ||
214 | #define PCF50633_REG_LEDCTL 0x2a | ||
215 | #define PCF50633_REG_LEDDIM 0x2b | ||
216 | |||
217 | #endif | ||
218 | |||
diff --git a/include/linux/mfd/pcf50633/gpio.h b/include/linux/mfd/pcf50633/gpio.h new file mode 100644 index 000000000000..a42b845efc54 --- /dev/null +++ b/include/linux/mfd/pcf50633/gpio.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * gpio.h -- GPIO driver for NXP PCF50633 | ||
3 | * | ||
4 | * (C) 2006-2008 by Openmoko, Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_PCF50633_GPIO_H | ||
14 | #define __LINUX_MFD_PCF50633_GPIO_H | ||
15 | |||
16 | #include <linux/mfd/pcf50633/core.h> | ||
17 | |||
18 | #define PCF50633_GPIO1 1 | ||
19 | #define PCF50633_GPIO2 2 | ||
20 | #define PCF50633_GPIO3 3 | ||
21 | #define PCF50633_GPO 4 | ||
22 | |||
23 | #define PCF50633_REG_GPIO1CFG 0x14 | ||
24 | #define PCF50633_REG_GPIO2CFG 0x15 | ||
25 | #define PCF50633_REG_GPIO3CFG 0x16 | ||
26 | #define PCF50633_REG_GPOCFG 0x17 | ||
27 | |||
28 | #define PCF50633_GPOCFG_GPOSEL_MASK 0x07 | ||
29 | |||
30 | enum pcf50633_reg_gpocfg { | ||
31 | PCF50633_GPOCFG_GPOSEL_0 = 0x00, | ||
32 | PCF50633_GPOCFG_GPOSEL_LED_NFET = 0x01, | ||
33 | PCF50633_GPOCFG_GPOSEL_SYSxOK = 0x02, | ||
34 | PCF50633_GPOCFG_GPOSEL_CLK32K = 0x03, | ||
35 | PCF50633_GPOCFG_GPOSEL_ADAPUSB = 0x04, | ||
36 | PCF50633_GPOCFG_GPOSEL_USBxOK = 0x05, | ||
37 | PCF50633_GPOCFG_GPOSEL_ACTPH4 = 0x06, | ||
38 | PCF50633_GPOCFG_GPOSEL_1 = 0x07, | ||
39 | PCF50633_GPOCFG_GPOSEL_INVERSE = 0x08, | ||
40 | }; | ||
41 | |||
42 | int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val); | ||
43 | u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio); | ||
44 | |||
45 | int pcf50633_gpio_invert_set(struct pcf50633 *, int gpio, int invert); | ||
46 | int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio); | ||
47 | |||
48 | int pcf50633_gpio_power_supply_set(struct pcf50633 *, | ||
49 | int gpio, int regulator, int on); | ||
50 | #endif /* __LINUX_MFD_PCF50633_GPIO_H */ | ||
51 | |||
52 | |||
diff --git a/include/linux/mfd/pcf50633/mbc.h b/include/linux/mfd/pcf50633/mbc.h new file mode 100644 index 000000000000..6e17619b773a --- /dev/null +++ b/include/linux/mfd/pcf50633/mbc.h | |||
@@ -0,0 +1,134 @@ | |||
1 | /* | ||
2 | * mbc.h -- Driver for NXP PCF50633 Main Battery Charger | ||
3 | * | ||
4 | * (C) 2006-2008 by Openmoko, Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_PCF50633_MBC_H | ||
14 | #define __LINUX_MFD_PCF50633_MBC_H | ||
15 | |||
16 | #include <linux/mfd/pcf50633/core.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | |||
19 | #define PCF50633_REG_MBCC1 0x43 | ||
20 | #define PCF50633_REG_MBCC2 0x44 | ||
21 | #define PCF50633_REG_MBCC3 0x45 | ||
22 | #define PCF50633_REG_MBCC4 0x46 | ||
23 | #define PCF50633_REG_MBCC5 0x47 | ||
24 | #define PCF50633_REG_MBCC6 0x48 | ||
25 | #define PCF50633_REG_MBCC7 0x49 | ||
26 | #define PCF50633_REG_MBCC8 0x4a | ||
27 | #define PCF50633_REG_MBCS1 0x4b | ||
28 | #define PCF50633_REG_MBCS2 0x4c | ||
29 | #define PCF50633_REG_MBCS3 0x4d | ||
30 | |||
31 | enum pcf50633_reg_mbcc1 { | ||
32 | PCF50633_MBCC1_CHGENA = 0x01, /* Charger enable */ | ||
33 | PCF50633_MBCC1_AUTOSTOP = 0x02, | ||
34 | PCF50633_MBCC1_AUTORES = 0x04, /* automatic resume */ | ||
35 | PCF50633_MBCC1_RESUME = 0x08, /* explicit resume cmd */ | ||
36 | PCF50633_MBCC1_RESTART = 0x10, /* restart charging */ | ||
37 | PCF50633_MBCC1_PREWDTIME_60M = 0x20, /* max. precharging time */ | ||
38 | PCF50633_MBCC1_WDTIME_1H = 0x00, | ||
39 | PCF50633_MBCC1_WDTIME_2H = 0x40, | ||
40 | PCF50633_MBCC1_WDTIME_4H = 0x80, | ||
41 | PCF50633_MBCC1_WDTIME_6H = 0xc0, | ||
42 | }; | ||
43 | #define PCF50633_MBCC1_WDTIME_MASK 0xc0 | ||
44 | |||
45 | enum pcf50633_reg_mbcc2 { | ||
46 | PCF50633_MBCC2_VBATCOND_2V7 = 0x00, | ||
47 | PCF50633_MBCC2_VBATCOND_2V85 = 0x01, | ||
48 | PCF50633_MBCC2_VBATCOND_3V0 = 0x02, | ||
49 | PCF50633_MBCC2_VBATCOND_3V15 = 0x03, | ||
50 | PCF50633_MBCC2_VMAX_4V = 0x00, | ||
51 | PCF50633_MBCC2_VMAX_4V20 = 0x28, | ||
52 | PCF50633_MBCC2_VRESDEBTIME_64S = 0x80, /* debounce time (32/64sec) */ | ||
53 | }; | ||
54 | |||
55 | enum pcf50633_reg_mbcc7 { | ||
56 | PCF50633_MBCC7_USB_100mA = 0x00, | ||
57 | PCF50633_MBCC7_USB_500mA = 0x01, | ||
58 | PCF50633_MBCC7_USB_1000mA = 0x02, | ||
59 | PCF50633_MBCC7_USB_SUSPEND = 0x03, | ||
60 | PCF50633_MBCC7_BATTEMP_EN = 0x04, | ||
61 | PCF50633_MBCC7_BATSYSIMAX_1A6 = 0x00, | ||
62 | PCF50633_MBCC7_BATSYSIMAX_1A8 = 0x40, | ||
63 | PCF50633_MBCC7_BATSYSIMAX_2A0 = 0x80, | ||
64 | PCF50633_MBCC7_BATSYSIMAX_2A2 = 0xc0, | ||
65 | }; | ||
66 | #define PCF50633_MBCC7_USB_MASK 0x03 | ||
67 | |||
68 | enum pcf50633_reg_mbcc8 { | ||
69 | PCF50633_MBCC8_USBENASUS = 0x10, | ||
70 | }; | ||
71 | |||
72 | enum pcf50633_reg_mbcs1 { | ||
73 | PCF50633_MBCS1_USBPRES = 0x01, | ||
74 | PCF50633_MBCS1_USBOK = 0x02, | ||
75 | PCF50633_MBCS1_ADAPTPRES = 0x04, | ||
76 | PCF50633_MBCS1_ADAPTOK = 0x08, | ||
77 | PCF50633_MBCS1_TBAT_OK = 0x00, | ||
78 | PCF50633_MBCS1_TBAT_ABOVE = 0x10, | ||
79 | PCF50633_MBCS1_TBAT_BELOW = 0x20, | ||
80 | PCF50633_MBCS1_TBAT_UNDEF = 0x30, | ||
81 | PCF50633_MBCS1_PREWDTEXP = 0x40, | ||
82 | PCF50633_MBCS1_WDTEXP = 0x80, | ||
83 | }; | ||
84 | |||
85 | enum pcf50633_reg_mbcs2_mbcmod { | ||
86 | PCF50633_MBCS2_MBC_PLAY = 0x00, | ||
87 | PCF50633_MBCS2_MBC_USB_PRE = 0x01, | ||
88 | PCF50633_MBCS2_MBC_USB_PRE_WAIT = 0x02, | ||
89 | PCF50633_MBCS2_MBC_USB_FAST = 0x03, | ||
90 | PCF50633_MBCS2_MBC_USB_FAST_WAIT = 0x04, | ||
91 | PCF50633_MBCS2_MBC_USB_SUSPEND = 0x05, | ||
92 | PCF50633_MBCS2_MBC_ADP_PRE = 0x06, | ||
93 | PCF50633_MBCS2_MBC_ADP_PRE_WAIT = 0x07, | ||
94 | PCF50633_MBCS2_MBC_ADP_FAST = 0x08, | ||
95 | PCF50633_MBCS2_MBC_ADP_FAST_WAIT = 0x09, | ||
96 | PCF50633_MBCS2_MBC_BAT_FULL = 0x0a, | ||
97 | PCF50633_MBCS2_MBC_HALT = 0x0b, | ||
98 | }; | ||
99 | #define PCF50633_MBCS2_MBC_MASK 0x0f | ||
100 | enum pcf50633_reg_mbcs2_chgstat { | ||
101 | PCF50633_MBCS2_CHGS_NONE = 0x00, | ||
102 | PCF50633_MBCS2_CHGS_ADAPTER = 0x10, | ||
103 | PCF50633_MBCS2_CHGS_USB = 0x20, | ||
104 | PCF50633_MBCS2_CHGS_BOTH = 0x30, | ||
105 | }; | ||
106 | #define PCF50633_MBCS2_RESSTAT_AUTO 0x40 | ||
107 | |||
108 | enum pcf50633_reg_mbcs3 { | ||
109 | PCF50633_MBCS3_USBLIM_PLAY = 0x01, | ||
110 | PCF50633_MBCS3_USBLIM_CGH = 0x02, | ||
111 | PCF50633_MBCS3_TLIM_PLAY = 0x04, | ||
112 | PCF50633_MBCS3_TLIM_CHG = 0x08, | ||
113 | PCF50633_MBCS3_ILIM = 0x10, /* 1: Ibat > Icutoff */ | ||
114 | PCF50633_MBCS3_VLIM = 0x20, /* 1: Vbat == Vmax */ | ||
115 | PCF50633_MBCS3_VBATSTAT = 0x40, /* 1: Vbat > Vbatcond */ | ||
116 | PCF50633_MBCS3_VRES = 0x80, /* 1: Vbat > Vth(RES) */ | ||
117 | }; | ||
118 | |||
119 | #define PCF50633_MBCC2_VBATCOND_MASK 0x03 | ||
120 | #define PCF50633_MBCC2_VMAX_MASK 0x3c | ||
121 | |||
122 | /* Charger status */ | ||
123 | #define PCF50633_MBC_USB_ONLINE 0x01 | ||
124 | #define PCF50633_MBC_USB_ACTIVE 0x02 | ||
125 | #define PCF50633_MBC_ADAPTER_ONLINE 0x04 | ||
126 | #define PCF50633_MBC_ADAPTER_ACTIVE 0x08 | ||
127 | |||
128 | int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma); | ||
129 | |||
130 | int pcf50633_mbc_get_status(struct pcf50633 *); | ||
131 | void pcf50633_mbc_set_status(struct pcf50633 *, int what, int status); | ||
132 | |||
133 | #endif | ||
134 | |||
diff --git a/include/linux/mfd/pcf50633/pmic.h b/include/linux/mfd/pcf50633/pmic.h new file mode 100644 index 000000000000..2d3dbe53b235 --- /dev/null +++ b/include/linux/mfd/pcf50633/pmic.h | |||
@@ -0,0 +1,67 @@ | |||
1 | #ifndef __LINUX_MFD_PCF50633_PMIC_H | ||
2 | #define __LINUX_MFD_PCF50633_PMIC_H | ||
3 | |||
4 | #include <linux/mfd/pcf50633/core.h> | ||
5 | #include <linux/platform_device.h> | ||
6 | |||
7 | #define PCF50633_REG_AUTOOUT 0x1a | ||
8 | #define PCF50633_REG_AUTOENA 0x1b | ||
9 | #define PCF50633_REG_AUTOCTL 0x1c | ||
10 | #define PCF50633_REG_AUTOMXC 0x1d | ||
11 | #define PCF50633_REG_DOWN1OUT 0x1e | ||
12 | #define PCF50633_REG_DOWN1ENA 0x1f | ||
13 | #define PCF50633_REG_DOWN1CTL 0x20 | ||
14 | #define PCF50633_REG_DOWN1MXC 0x21 | ||
15 | #define PCF50633_REG_DOWN2OUT 0x22 | ||
16 | #define PCF50633_REG_DOWN2ENA 0x23 | ||
17 | #define PCF50633_REG_DOWN2CTL 0x24 | ||
18 | #define PCF50633_REG_DOWN2MXC 0x25 | ||
19 | #define PCF50633_REG_MEMLDOOUT 0x26 | ||
20 | #define PCF50633_REG_MEMLDOENA 0x27 | ||
21 | #define PCF50633_REG_LDO1OUT 0x2d | ||
22 | #define PCF50633_REG_LDO1ENA 0x2e | ||
23 | #define PCF50633_REG_LDO2OUT 0x2f | ||
24 | #define PCF50633_REG_LDO2ENA 0x30 | ||
25 | #define PCF50633_REG_LDO3OUT 0x31 | ||
26 | #define PCF50633_REG_LDO3ENA 0x32 | ||
27 | #define PCF50633_REG_LDO4OUT 0x33 | ||
28 | #define PCF50633_REG_LDO4ENA 0x34 | ||
29 | #define PCF50633_REG_LDO5OUT 0x35 | ||
30 | #define PCF50633_REG_LDO5ENA 0x36 | ||
31 | #define PCF50633_REG_LDO6OUT 0x37 | ||
32 | #define PCF50633_REG_LDO6ENA 0x38 | ||
33 | #define PCF50633_REG_HCLDOOUT 0x39 | ||
34 | #define PCF50633_REG_HCLDOENA 0x3a | ||
35 | #define PCF50633_REG_HCLDOOVL 0x40 | ||
36 | |||
37 | enum pcf50633_regulator_enable { | ||
38 | PCF50633_REGULATOR_ON = 0x01, | ||
39 | PCF50633_REGULATOR_ON_GPIO1 = 0x02, | ||
40 | PCF50633_REGULATOR_ON_GPIO2 = 0x04, | ||
41 | PCF50633_REGULATOR_ON_GPIO3 = 0x08, | ||
42 | }; | ||
43 | #define PCF50633_REGULATOR_ON_MASK 0x0f | ||
44 | |||
45 | enum pcf50633_regulator_phase { | ||
46 | PCF50633_REGULATOR_ACTPH1 = 0x00, | ||
47 | PCF50633_REGULATOR_ACTPH2 = 0x10, | ||
48 | PCF50633_REGULATOR_ACTPH3 = 0x20, | ||
49 | PCF50633_REGULATOR_ACTPH4 = 0x30, | ||
50 | }; | ||
51 | #define PCF50633_REGULATOR_ACTPH_MASK 0x30 | ||
52 | |||
53 | enum pcf50633_regulator_id { | ||
54 | PCF50633_REGULATOR_AUTO, | ||
55 | PCF50633_REGULATOR_DOWN1, | ||
56 | PCF50633_REGULATOR_DOWN2, | ||
57 | PCF50633_REGULATOR_LDO1, | ||
58 | PCF50633_REGULATOR_LDO2, | ||
59 | PCF50633_REGULATOR_LDO3, | ||
60 | PCF50633_REGULATOR_LDO4, | ||
61 | PCF50633_REGULATOR_LDO5, | ||
62 | PCF50633_REGULATOR_LDO6, | ||
63 | PCF50633_REGULATOR_HCLDO, | ||
64 | PCF50633_REGULATOR_MEMLDO, | ||
65 | }; | ||
66 | #endif | ||
67 | |||
diff --git a/include/linux/mm.h b/include/linux/mm.h index b91a73fd1bcc..e8ddc98b8405 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -260,7 +260,6 @@ static inline int put_page_testzero(struct page *page) | |||
260 | */ | 260 | */ |
261 | static inline int get_page_unless_zero(struct page *page) | 261 | static inline int get_page_unless_zero(struct page *page) |
262 | { | 262 | { |
263 | VM_BUG_ON(PageTail(page)); | ||
264 | return atomic_inc_not_zero(&page->_count); | 263 | return atomic_inc_not_zero(&page->_count); |
265 | } | 264 | } |
266 | 265 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f24556813375..ec54785d34f9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -467,7 +467,7 @@ struct netdev_queue { | |||
467 | * This function is called when network device transistions to the down | 467 | * This function is called when network device transistions to the down |
468 | * state. | 468 | * state. |
469 | * | 469 | * |
470 | * int (*ndo_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev); | 470 | * int (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev); |
471 | * Called when a packet needs to be transmitted. | 471 | * Called when a packet needs to be transmitted. |
472 | * Must return NETDEV_TX_OK , NETDEV_TX_BUSY, or NETDEV_TX_LOCKED, | 472 | * Must return NETDEV_TX_OK , NETDEV_TX_BUSY, or NETDEV_TX_LOCKED, |
473 | * Required can not be NULL. | 473 | * Required can not be NULL. |
@@ -795,6 +795,7 @@ struct net_device | |||
795 | NETREG_UNREGISTERING, /* called unregister_netdevice */ | 795 | NETREG_UNREGISTERING, /* called unregister_netdevice */ |
796 | NETREG_UNREGISTERED, /* completed unregister todo */ | 796 | NETREG_UNREGISTERED, /* completed unregister todo */ |
797 | NETREG_RELEASED, /* called free_netdev */ | 797 | NETREG_RELEASED, /* called free_netdev */ |
798 | NETREG_DUMMY, /* dummy device for NAPI poll */ | ||
798 | } reg_state; | 799 | } reg_state; |
799 | 800 | ||
800 | /* Called from unregister, can be used to call free_netdev */ | 801 | /* Called from unregister, can be used to call free_netdev */ |
@@ -1077,6 +1078,8 @@ extern void free_netdev(struct net_device *dev); | |||
1077 | extern void synchronize_net(void); | 1078 | extern void synchronize_net(void); |
1078 | extern int register_netdevice_notifier(struct notifier_block *nb); | 1079 | extern int register_netdevice_notifier(struct notifier_block *nb); |
1079 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | 1080 | extern int unregister_netdevice_notifier(struct notifier_block *nb); |
1081 | extern int init_dummy_netdev(struct net_device *dev); | ||
1082 | |||
1080 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1083 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
1081 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1084 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
1082 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 1085 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index e52ce475d19f..c7ee8744d26b 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -270,6 +270,7 @@ struct xt_match | |||
270 | struct list_head list; | 270 | struct list_head list; |
271 | 271 | ||
272 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 272 | const char name[XT_FUNCTION_MAXNAMELEN-1]; |
273 | u_int8_t revision; | ||
273 | 274 | ||
274 | /* Return true or false: return FALSE and set *hotdrop = 1 to | 275 | /* Return true or false: return FALSE and set *hotdrop = 1 to |
275 | force immediate packet drop. */ | 276 | force immediate packet drop. */ |
@@ -302,7 +303,6 @@ struct xt_match | |||
302 | unsigned short proto; | 303 | unsigned short proto; |
303 | 304 | ||
304 | unsigned short family; | 305 | unsigned short family; |
305 | u_int8_t revision; | ||
306 | }; | 306 | }; |
307 | 307 | ||
308 | /* Registration hooks for targets. */ | 308 | /* Registration hooks for targets. */ |
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h index bd2a870ec296..34974b5a76f7 100644 --- a/include/linux/of_i2c.h +++ b/include/linux/of_i2c.h | |||
@@ -17,4 +17,7 @@ | |||
17 | void of_register_i2c_devices(struct i2c_adapter *adap, | 17 | void of_register_i2c_devices(struct i2c_adapter *adap, |
18 | struct device_node *adap_node); | 18 | struct device_node *adap_node); |
19 | 19 | ||
20 | /* must call put_device() when done with returned i2c_client device */ | ||
21 | struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); | ||
22 | |||
20 | #endif /* __LINUX_OF_I2C_H */ | 23 | #endif /* __LINUX_OF_I2C_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d543365518ab..d56ad9c21c09 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2174,6 +2174,7 @@ | |||
2174 | #define PCI_DEVICE_ID_RDC_R6040 0x6040 | 2174 | #define PCI_DEVICE_ID_RDC_R6040 0x6040 |
2175 | #define PCI_DEVICE_ID_RDC_R6060 0x6060 | 2175 | #define PCI_DEVICE_ID_RDC_R6060 0x6060 |
2176 | #define PCI_DEVICE_ID_RDC_R6061 0x6061 | 2176 | #define PCI_DEVICE_ID_RDC_R6061 0x6061 |
2177 | #define PCI_DEVICE_ID_RDC_D1010 0x1010 | ||
2177 | 2178 | ||
2178 | #define PCI_VENDOR_ID_LENOVO 0x17aa | 2179 | #define PCI_VENDOR_ID_LENOVO 0x17aa |
2179 | 2180 | ||
diff --git a/include/linux/phantom.h b/include/linux/phantom.h index 02268c54c250..94dd6645c60a 100644 --- a/include/linux/phantom.h +++ b/include/linux/phantom.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #ifndef __PHANTOM_H | 10 | #ifndef __PHANTOM_H |
11 | #define __PHANTOM_H | 11 | #define __PHANTOM_H |
12 | 12 | ||
13 | #include <asm/types.h> | 13 | #include <linux/types.h> |
14 | 14 | ||
15 | /* PHN_(G/S)ET_REG param */ | 15 | /* PHN_(G/S)ET_REG param */ |
16 | struct phm_reg { | 16 | struct phm_reg { |
diff --git a/include/linux/radeonfb.h b/include/linux/radeonfb.h index 5bd8975ed78e..8c4bbdecc44f 100644 --- a/include/linux/radeonfb.h +++ b/include/linux/radeonfb.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __LINUX_RADEONFB_H__ | 2 | #define __LINUX_RADEONFB_H__ |
3 | 3 | ||
4 | #include <asm/ioctl.h> | 4 | #include <asm/ioctl.h> |
5 | #include <asm/types.h> | 5 | #include <linux/types.h> |
6 | 6 | ||
7 | #define ATY_RADEON_LCD_ON 0x00000001 | 7 | #define ATY_RADEON_LCD_ON 0x00000001 |
8 | #define ATY_RADEON_CRT_ON 0x00000002 | 8 | #define ATY_RADEON_CRT_ON 0x00000002 |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index dede0a2cfc45..4c5bcf6ca7e8 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * | 9 | * |
10 | * Author: Pavel Emelianov <xemul@openvz.org> | 10 | * Author: Pavel Emelianov <xemul@openvz.org> |
11 | * | 11 | * |
12 | * See Documentation/controllers/resource_counter.txt for more | 12 | * See Documentation/cgroups/resource_counter.txt for more |
13 | * info about what this counter is. | 13 | * info about what this counter is. |
14 | */ | 14 | */ |
15 | 15 | ||
diff --git a/include/linux/smp.h b/include/linux/smp.h index b82466968101..715196b09d67 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -24,6 +24,9 @@ struct call_single_data { | |||
24 | /* total number of cpus in this system (may exceed NR_CPUS) */ | 24 | /* total number of cpus in this system (may exceed NR_CPUS) */ |
25 | extern unsigned int total_cpus; | 25 | extern unsigned int total_cpus; |
26 | 26 | ||
27 | int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, | ||
28 | int wait); | ||
29 | |||
27 | #ifdef CONFIG_SMP | 30 | #ifdef CONFIG_SMP |
28 | 31 | ||
29 | #include <linux/preempt.h> | 32 | #include <linux/preempt.h> |
@@ -79,8 +82,6 @@ smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, | |||
79 | return 0; | 82 | return 0; |
80 | } | 83 | } |
81 | 84 | ||
82 | int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, | ||
83 | int wait); | ||
84 | void __smp_call_function_single(int cpuid, struct call_single_data *data); | 85 | void __smp_call_function_single(int cpuid, struct call_single_data *data); |
85 | 86 | ||
86 | /* | 87 | /* |
@@ -140,14 +141,6 @@ static inline int up_smp_call_function(void (*func)(void *), void *info) | |||
140 | static inline void smp_send_reschedule(int cpu) { } | 141 | static inline void smp_send_reschedule(int cpu) { } |
141 | #define num_booting_cpus() 1 | 142 | #define num_booting_cpus() 1 |
142 | #define smp_prepare_boot_cpu() do {} while (0) | 143 | #define smp_prepare_boot_cpu() do {} while (0) |
143 | #define smp_call_function_single(cpuid, func, info, wait) \ | ||
144 | ({ \ | ||
145 | WARN_ON(cpuid != 0); \ | ||
146 | local_irq_disable(); \ | ||
147 | (func)(info); \ | ||
148 | local_irq_enable(); \ | ||
149 | 0; \ | ||
150 | }) | ||
151 | #define smp_call_function_mask(mask, func, info, wait) \ | 144 | #define smp_call_function_mask(mask, func, info, wait) \ |
152 | (up_smp_call_function(func, info)) | 145 | (up_smp_call_function(func, info)) |
153 | #define smp_call_function_many(mask, func, info, wait) \ | 146 | #define smp_call_function_many(mask, func, info, wait) \ |
diff --git a/include/linux/swab.h b/include/linux/swab.h index be5284d4a053..ea0c02fd5163 100644 --- a/include/linux/swab.h +++ b/include/linux/swab.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | #include <asm/byteorder.h> | 6 | #include <asm/swab.h> |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * casts are necessary for constants, because we never know how for sure | 9 | * casts are necessary for constants, because we never know how for sure |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 18d0a243a7b3..16875f89e6a7 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -54,6 +54,7 @@ struct compat_stat; | |||
54 | struct compat_timeval; | 54 | struct compat_timeval; |
55 | struct robust_list_head; | 55 | struct robust_list_head; |
56 | struct getcpu_cache; | 56 | struct getcpu_cache; |
57 | struct old_linux_dirent; | ||
57 | 58 | ||
58 | #include <linux/types.h> | 59 | #include <linux/types.h> |
59 | #include <linux/aio_abi.h> | 60 | #include <linux/aio_abi.h> |
@@ -65,6 +66,74 @@ struct getcpu_cache; | |||
65 | #include <linux/quota.h> | 66 | #include <linux/quota.h> |
66 | #include <linux/key.h> | 67 | #include <linux/key.h> |
67 | 68 | ||
69 | #define __SC_DECL1(t1, a1) t1 a1 | ||
70 | #define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) | ||
71 | #define __SC_DECL3(t3, a3, ...) t3 a3, __SC_DECL2(__VA_ARGS__) | ||
72 | #define __SC_DECL4(t4, a4, ...) t4 a4, __SC_DECL3(__VA_ARGS__) | ||
73 | #define __SC_DECL5(t5, a5, ...) t5 a5, __SC_DECL4(__VA_ARGS__) | ||
74 | #define __SC_DECL6(t6, a6, ...) t6 a6, __SC_DECL5(__VA_ARGS__) | ||
75 | |||
76 | #define __SC_LONG1(t1, a1) long a1 | ||
77 | #define __SC_LONG2(t2, a2, ...) long a2, __SC_LONG1(__VA_ARGS__) | ||
78 | #define __SC_LONG3(t3, a3, ...) long a3, __SC_LONG2(__VA_ARGS__) | ||
79 | #define __SC_LONG4(t4, a4, ...) long a4, __SC_LONG3(__VA_ARGS__) | ||
80 | #define __SC_LONG5(t5, a5, ...) long a5, __SC_LONG4(__VA_ARGS__) | ||
81 | #define __SC_LONG6(t6, a6, ...) long a6, __SC_LONG5(__VA_ARGS__) | ||
82 | |||
83 | #define __SC_CAST1(t1, a1) (t1) a1 | ||
84 | #define __SC_CAST2(t2, a2, ...) (t2) a2, __SC_CAST1(__VA_ARGS__) | ||
85 | #define __SC_CAST3(t3, a3, ...) (t3) a3, __SC_CAST2(__VA_ARGS__) | ||
86 | #define __SC_CAST4(t4, a4, ...) (t4) a4, __SC_CAST3(__VA_ARGS__) | ||
87 | #define __SC_CAST5(t5, a5, ...) (t5) a5, __SC_CAST4(__VA_ARGS__) | ||
88 | #define __SC_CAST6(t6, a6, ...) (t6) a6, __SC_CAST5(__VA_ARGS__) | ||
89 | |||
90 | #define __SC_TEST(type) BUILD_BUG_ON(sizeof(type) > sizeof(long)) | ||
91 | #define __SC_TEST1(t1, a1) __SC_TEST(t1) | ||
92 | #define __SC_TEST2(t2, a2, ...) __SC_TEST(t2); __SC_TEST1(__VA_ARGS__) | ||
93 | #define __SC_TEST3(t3, a3, ...) __SC_TEST(t3); __SC_TEST2(__VA_ARGS__) | ||
94 | #define __SC_TEST4(t4, a4, ...) __SC_TEST(t4); __SC_TEST3(__VA_ARGS__) | ||
95 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | ||
96 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | ||
97 | |||
98 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) | ||
99 | #define SYSCALL_DEFINE1(...) SYSCALL_DEFINEx(1, __VA_ARGS__) | ||
100 | #define SYSCALL_DEFINE2(...) SYSCALL_DEFINEx(2, __VA_ARGS__) | ||
101 | #define SYSCALL_DEFINE3(...) SYSCALL_DEFINEx(3, __VA_ARGS__) | ||
102 | #define SYSCALL_DEFINE4(...) SYSCALL_DEFINEx(4, __VA_ARGS__) | ||
103 | #define SYSCALL_DEFINE5(...) SYSCALL_DEFINEx(5, __VA_ARGS__) | ||
104 | #define SYSCALL_DEFINE6(...) SYSCALL_DEFINEx(6, __VA_ARGS__) | ||
105 | |||
106 | #ifdef CONFIG_PPC64 | ||
107 | #define SYSCALL_ALIAS(alias, name) \ | ||
108 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ | ||
109 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) | ||
110 | #else | ||
111 | #define SYSCALL_ALIAS(alias, name) \ | ||
112 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name) | ||
113 | #endif | ||
114 | |||
115 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
116 | |||
117 | #define SYSCALL_DEFINE(name) static inline long SYSC_##name | ||
118 | #define SYSCALL_DEFINEx(x, name, ...) \ | ||
119 | asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)); \ | ||
120 | static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)); \ | ||
121 | asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__)) \ | ||
122 | { \ | ||
123 | __SC_TEST##x(__VA_ARGS__); \ | ||
124 | return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__)); \ | ||
125 | } \ | ||
126 | SYSCALL_ALIAS(sys_##name, SyS_##name); \ | ||
127 | static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)) | ||
128 | |||
129 | #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | ||
130 | |||
131 | #define SYSCALL_DEFINE(name) asmlinkage long sys_##name | ||
132 | #define SYSCALL_DEFINEx(x, name, ...) \ | ||
133 | asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)) | ||
134 | |||
135 | #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | ||
136 | |||
68 | asmlinkage long sys_time(time_t __user *tloc); | 137 | asmlinkage long sys_time(time_t __user *tloc); |
69 | asmlinkage long sys_stime(time_t __user *tptr); | 138 | asmlinkage long sys_stime(time_t __user *tptr); |
70 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, | 139 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, |
@@ -77,7 +146,7 @@ asmlinkage long sys_times(struct tms __user *tbuf); | |||
77 | 146 | ||
78 | asmlinkage long sys_gettid(void); | 147 | asmlinkage long sys_gettid(void); |
79 | asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); | 148 | asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); |
80 | asmlinkage unsigned long sys_alarm(unsigned int seconds); | 149 | asmlinkage long sys_alarm(unsigned int seconds); |
81 | asmlinkage long sys_getpid(void); | 150 | asmlinkage long sys_getpid(void); |
82 | asmlinkage long sys_getppid(void); | 151 | asmlinkage long sys_getppid(void); |
83 | asmlinkage long sys_getuid(void); | 152 | asmlinkage long sys_getuid(void); |
@@ -166,7 +235,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, | |||
166 | unsigned long flags); | 235 | unsigned long flags); |
167 | 236 | ||
168 | asmlinkage long sys_exit(int error_code); | 237 | asmlinkage long sys_exit(int error_code); |
169 | asmlinkage void sys_exit_group(int error_code); | 238 | asmlinkage long sys_exit_group(int error_code); |
170 | asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, | 239 | asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, |
171 | int options, struct rusage __user *ru); | 240 | int options, struct rusage __user *ru); |
172 | asmlinkage long sys_waitid(int which, pid_t pid, | 241 | asmlinkage long sys_waitid(int which, pid_t pid, |
@@ -196,7 +265,7 @@ asmlinkage long sys_tkill(int pid, int sig); | |||
196 | asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo); | 265 | asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo); |
197 | asmlinkage long sys_sgetmask(void); | 266 | asmlinkage long sys_sgetmask(void); |
198 | asmlinkage long sys_ssetmask(int newmask); | 267 | asmlinkage long sys_ssetmask(int newmask); |
199 | asmlinkage unsigned long sys_signal(int sig, __sighandler_t handler); | 268 | asmlinkage long sys_signal(int sig, __sighandler_t handler); |
200 | asmlinkage long sys_pause(void); | 269 | asmlinkage long sys_pause(void); |
201 | 270 | ||
202 | asmlinkage long sys_sync(void); | 271 | asmlinkage long sys_sync(void); |
@@ -246,29 +315,29 @@ asmlinkage long sys_lsetxattr(const char __user *path, const char __user *name, | |||
246 | const void __user *value, size_t size, int flags); | 315 | const void __user *value, size_t size, int flags); |
247 | asmlinkage long sys_fsetxattr(int fd, const char __user *name, | 316 | asmlinkage long sys_fsetxattr(int fd, const char __user *name, |
248 | const void __user *value, size_t size, int flags); | 317 | const void __user *value, size_t size, int flags); |
249 | asmlinkage ssize_t sys_getxattr(const char __user *path, const char __user *name, | 318 | asmlinkage long sys_getxattr(const char __user *path, const char __user *name, |
250 | void __user *value, size_t size); | 319 | void __user *value, size_t size); |
251 | asmlinkage ssize_t sys_lgetxattr(const char __user *path, const char __user *name, | 320 | asmlinkage long sys_lgetxattr(const char __user *path, const char __user *name, |
252 | void __user *value, size_t size); | 321 | void __user *value, size_t size); |
253 | asmlinkage ssize_t sys_fgetxattr(int fd, const char __user *name, | 322 | asmlinkage long sys_fgetxattr(int fd, const char __user *name, |
254 | void __user *value, size_t size); | 323 | void __user *value, size_t size); |
255 | asmlinkage ssize_t sys_listxattr(const char __user *path, char __user *list, | 324 | asmlinkage long sys_listxattr(const char __user *path, char __user *list, |
256 | size_t size); | 325 | size_t size); |
257 | asmlinkage ssize_t sys_llistxattr(const char __user *path, char __user *list, | 326 | asmlinkage long sys_llistxattr(const char __user *path, char __user *list, |
258 | size_t size); | 327 | size_t size); |
259 | asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size); | 328 | asmlinkage long sys_flistxattr(int fd, char __user *list, size_t size); |
260 | asmlinkage long sys_removexattr(const char __user *path, | 329 | asmlinkage long sys_removexattr(const char __user *path, |
261 | const char __user *name); | 330 | const char __user *name); |
262 | asmlinkage long sys_lremovexattr(const char __user *path, | 331 | asmlinkage long sys_lremovexattr(const char __user *path, |
263 | const char __user *name); | 332 | const char __user *name); |
264 | asmlinkage long sys_fremovexattr(int fd, const char __user *name); | 333 | asmlinkage long sys_fremovexattr(int fd, const char __user *name); |
265 | 334 | ||
266 | asmlinkage unsigned long sys_brk(unsigned long brk); | 335 | asmlinkage long sys_brk(unsigned long brk); |
267 | asmlinkage long sys_mprotect(unsigned long start, size_t len, | 336 | asmlinkage long sys_mprotect(unsigned long start, size_t len, |
268 | unsigned long prot); | 337 | unsigned long prot); |
269 | asmlinkage unsigned long sys_mremap(unsigned long addr, | 338 | asmlinkage long sys_mremap(unsigned long addr, |
270 | unsigned long old_len, unsigned long new_len, | 339 | unsigned long old_len, unsigned long new_len, |
271 | unsigned long flags, unsigned long new_addr); | 340 | unsigned long flags, unsigned long new_addr); |
272 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, | 341 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, |
273 | unsigned long prot, unsigned long pgoff, | 342 | unsigned long prot, unsigned long pgoff, |
274 | unsigned long flags); | 343 | unsigned long flags); |
@@ -321,10 +390,10 @@ asmlinkage long sys_io_submit(aio_context_t, long, | |||
321 | struct iocb __user * __user *); | 390 | struct iocb __user * __user *); |
322 | asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | 391 | asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, |
323 | struct io_event __user *result); | 392 | struct io_event __user *result); |
324 | asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, | 393 | asmlinkage long sys_sendfile(int out_fd, int in_fd, |
325 | off_t __user *offset, size_t count); | 394 | off_t __user *offset, size_t count); |
326 | asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, | 395 | asmlinkage long sys_sendfile64(int out_fd, int in_fd, |
327 | loff_t __user *offset, size_t count); | 396 | loff_t __user *offset, size_t count); |
328 | asmlinkage long sys_readlink(const char __user *path, | 397 | asmlinkage long sys_readlink(const char __user *path, |
329 | char __user *buf, int bufsiz); | 398 | char __user *buf, int bufsiz); |
330 | asmlinkage long sys_creat(const char __user *pathname, int mode); | 399 | asmlinkage long sys_creat(const char __user *pathname, int mode); |
@@ -368,26 +437,25 @@ asmlinkage long sys_utime(char __user *filename, | |||
368 | struct utimbuf __user *times); | 437 | struct utimbuf __user *times); |
369 | asmlinkage long sys_utimes(char __user *filename, | 438 | asmlinkage long sys_utimes(char __user *filename, |
370 | struct timeval __user *utimes); | 439 | struct timeval __user *utimes); |
371 | asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, | 440 | asmlinkage long sys_lseek(unsigned int fd, off_t offset, |
372 | unsigned int origin); | 441 | unsigned int origin); |
373 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, | 442 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, |
374 | unsigned long offset_low, loff_t __user *result, | 443 | unsigned long offset_low, loff_t __user *result, |
375 | unsigned int origin); | 444 | unsigned int origin); |
376 | asmlinkage ssize_t sys_read(unsigned int fd, char __user *buf, | 445 | asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count); |
377 | size_t count); | 446 | asmlinkage long sys_readahead(int fd, loff_t offset, size_t count); |
378 | asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count); | 447 | asmlinkage long sys_readv(unsigned long fd, |
379 | asmlinkage ssize_t sys_readv(unsigned long fd, | 448 | const struct iovec __user *vec, |
380 | const struct iovec __user *vec, | 449 | unsigned long vlen); |
381 | unsigned long vlen); | 450 | asmlinkage long sys_write(unsigned int fd, const char __user *buf, |
382 | asmlinkage ssize_t sys_write(unsigned int fd, const char __user *buf, | 451 | size_t count); |
383 | size_t count); | 452 | asmlinkage long sys_writev(unsigned long fd, |
384 | asmlinkage ssize_t sys_writev(unsigned long fd, | 453 | const struct iovec __user *vec, |
385 | const struct iovec __user *vec, | 454 | unsigned long vlen); |
386 | unsigned long vlen); | 455 | asmlinkage long sys_pread64(unsigned int fd, char __user *buf, |
387 | asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | 456 | size_t count, loff_t pos); |
388 | size_t count, loff_t pos); | 457 | asmlinkage long sys_pwrite64(unsigned int fd, const char __user *buf, |
389 | asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | 458 | size_t count, loff_t pos); |
390 | size_t count, loff_t pos); | ||
391 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); | 459 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); |
392 | asmlinkage long sys_mkdir(const char __user *pathname, int mode); | 460 | asmlinkage long sys_mkdir(const char __user *pathname, int mode); |
393 | asmlinkage long sys_chdir(const char __user *filename); | 461 | asmlinkage long sys_chdir(const char __user *filename); |
@@ -476,7 +544,7 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); | |||
476 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); | 544 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); |
477 | asmlinkage long sys_mq_unlink(const char __user *name); | 545 | asmlinkage long sys_mq_unlink(const char __user *name); |
478 | asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); | 546 | asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); |
479 | asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); | 547 | asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); |
480 | asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); | 548 | asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); |
481 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); | 549 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); |
482 | 550 | ||
@@ -530,11 +598,6 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages, | |||
530 | const int __user *nodes, | 598 | const int __user *nodes, |
531 | int __user *status, | 599 | int __user *status, |
532 | int flags); | 600 | int flags); |
533 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | ||
534 | __u32 __user *pages, | ||
535 | const int __user *nodes, | ||
536 | int __user *status, | ||
537 | int flags); | ||
538 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, | 601 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, |
539 | unsigned long mode, | 602 | unsigned long mode, |
540 | unsigned long __user *nmask, | 603 | unsigned long __user *nmask, |
@@ -583,13 +646,6 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *bu | |||
583 | int bufsiz); | 646 | int bufsiz); |
584 | asmlinkage long sys_utimensat(int dfd, char __user *filename, | 647 | asmlinkage long sys_utimensat(int dfd, char __user *filename, |
585 | struct timespec __user *utimes, int flags); | 648 | struct timespec __user *utimes, int flags); |
586 | asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, | ||
587 | struct compat_timeval __user *t); | ||
588 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | ||
589 | struct compat_stat __user *statbuf, | ||
590 | int flag); | ||
591 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | ||
592 | int flags, int mode); | ||
593 | asmlinkage long sys_unshare(unsigned long unshare_flags); | 649 | asmlinkage long sys_unshare(unsigned long unshare_flags); |
594 | 650 | ||
595 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, | 651 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, |
@@ -621,6 +677,15 @@ asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); | |||
621 | asmlinkage long sys_eventfd(unsigned int count); | 677 | asmlinkage long sys_eventfd(unsigned int count); |
622 | asmlinkage long sys_eventfd2(unsigned int count, int flags); | 678 | asmlinkage long sys_eventfd2(unsigned int count, int flags); |
623 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); | 679 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); |
680 | asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int); | ||
681 | asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *, | ||
682 | fd_set __user *, struct timespec __user *, | ||
683 | void __user *); | ||
684 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, | ||
685 | struct timespec __user *, const sigset_t __user *, | ||
686 | size_t); | ||
687 | asmlinkage long sys_pipe2(int __user *, int); | ||
688 | asmlinkage long sys_pipe(int __user *); | ||
624 | 689 | ||
625 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 690 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
626 | 691 | ||
diff --git a/include/net/wimax.h b/include/net/wimax.h index 073809ce94f8..6b3824edb39e 100644 --- a/include/net/wimax.h +++ b/include/net/wimax.h | |||
@@ -323,8 +323,8 @@ struct input_dev; | |||
323 | * | 323 | * |
324 | * @rf_hw: [private] State of the hardware radio switch (OFF/ON) | 324 | * @rf_hw: [private] State of the hardware radio switch (OFF/ON) |
325 | * | 325 | * |
326 | * @debufs_dentry: [private] Used to hook up a debugfs entry. This | 326 | * @debugfs_dentry: [private] Used to hook up a debugfs entry. This |
327 | * shows up in the debugfs root as wimax:DEVICENAME. | 327 | * shows up in the debugfs root as wimax\:DEVICENAME. |
328 | * | 328 | * |
329 | * Description: | 329 | * Description: |
330 | * This structure defines a common interface to access all WiMAX | 330 | * This structure defines a common interface to access all WiMAX |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 4af1083e3287..93a4edb148b5 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -178,7 +178,7 @@ | |||
178 | .private_value = (unsigned long)&xenum } | 178 | .private_value = (unsigned long)&xenum } |
179 | #define SOC_DAPM_VALUE_ENUM(xname, xenum) \ | 179 | #define SOC_DAPM_VALUE_ENUM(xname, xenum) \ |
180 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 180 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
181 | .info = snd_soc_info_value_enum_double, \ | 181 | .info = snd_soc_info_enum_double, \ |
182 | .get = snd_soc_dapm_get_value_enum_double, \ | 182 | .get = snd_soc_dapm_get_value_enum_double, \ |
183 | .put = snd_soc_dapm_put_value_enum_double, \ | 183 | .put = snd_soc_dapm_put_value_enum_double, \ |
184 | .private_value = (unsigned long)&xenum } | 184 | .private_value = (unsigned long)&xenum } |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 9b930d342116..24593ac3ea19 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -106,7 +106,7 @@ | |||
106 | .private_value = (unsigned long)&xenum } | 106 | .private_value = (unsigned long)&xenum } |
107 | #define SOC_VALUE_ENUM(xname, xenum) \ | 107 | #define SOC_VALUE_ENUM(xname, xenum) \ |
108 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\ | 108 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\ |
109 | .info = snd_soc_info_value_enum_double, \ | 109 | .info = snd_soc_info_enum_double, \ |
110 | .get = snd_soc_get_value_enum_double, \ | 110 | .get = snd_soc_get_value_enum_double, \ |
111 | .put = snd_soc_put_value_enum_double, \ | 111 | .put = snd_soc_put_value_enum_double, \ |
112 | .private_value = (unsigned long)&xenum } | 112 | .private_value = (unsigned long)&xenum } |
@@ -211,8 +211,6 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol, | |||
211 | struct snd_ctl_elem_value *ucontrol); | 211 | struct snd_ctl_elem_value *ucontrol); |
212 | int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, | 212 | int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, |
213 | struct snd_ctl_elem_value *ucontrol); | 213 | struct snd_ctl_elem_value *ucontrol); |
214 | int snd_soc_info_value_enum_double(struct snd_kcontrol *kcontrol, | ||
215 | struct snd_ctl_elem_info *uinfo); | ||
216 | int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol, | 214 | int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol, |
217 | struct snd_ctl_elem_value *ucontrol); | 215 | struct snd_ctl_elem_value *ucontrol); |
218 | int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol, | 216 | int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol, |
@@ -419,17 +417,6 @@ struct soc_enum { | |||
419 | unsigned char shift_l; | 417 | unsigned char shift_l; |
420 | unsigned char shift_r; | 418 | unsigned char shift_r; |
421 | unsigned int max; | 419 | unsigned int max; |
422 | const char **texts; | ||
423 | void *dapm; | ||
424 | }; | ||
425 | |||
426 | /* semi enumerated kcontrol */ | ||
427 | struct soc_value_enum { | ||
428 | unsigned short reg; | ||
429 | unsigned short reg2; | ||
430 | unsigned char shift_l; | ||
431 | unsigned char shift_r; | ||
432 | unsigned int max; | ||
433 | unsigned int mask; | 420 | unsigned int mask; |
434 | const char **texts; | 421 | const char **texts; |
435 | const unsigned int *values; | 422 | const unsigned int *values; |
diff --git a/init/Kconfig b/init/Kconfig index a724a149bf3f..2af83825634e 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -323,26 +323,26 @@ config CGROUP_SCHED | |||
323 | This option allows you to create arbitrary task groups | 323 | This option allows you to create arbitrary task groups |
324 | using the "cgroup" pseudo filesystem and control | 324 | using the "cgroup" pseudo filesystem and control |
325 | the cpu bandwidth allocated to each such task group. | 325 | the cpu bandwidth allocated to each such task group. |
326 | Refer to Documentation/cgroups.txt for more information | 326 | Refer to Documentation/cgroups/cgroups.txt for more |
327 | on "cgroup" pseudo filesystem. | 327 | information on "cgroup" pseudo filesystem. |
328 | 328 | ||
329 | endchoice | 329 | endchoice |
330 | 330 | ||
331 | menu "Control Group support" | 331 | menuconfig CGROUPS |
332 | config CGROUPS | 332 | boolean "Control Group support" |
333 | bool "Control Group support" | ||
334 | help | 333 | help |
335 | This option add support for grouping sets of processes together, for | 334 | This option adds support for grouping sets of processes together, for |
336 | use with process control subsystems such as Cpusets, CFS, memory | 335 | use with process control subsystems such as Cpusets, CFS, memory |
337 | controls or device isolation. | 336 | controls or device isolation. |
338 | See | 337 | See |
339 | - Documentation/cpusets.txt (Cpusets) | ||
340 | - Documentation/scheduler/sched-design-CFS.txt (CFS) | 338 | - Documentation/scheduler/sched-design-CFS.txt (CFS) |
341 | - Documentation/cgroups/ (features for grouping, isolation) | 339 | - Documentation/cgroups/ (features for grouping, isolation |
342 | - Documentation/controllers/ (features for resource control) | 340 | and resource control) |
343 | 341 | ||
344 | Say N if unsure. | 342 | Say N if unsure. |
345 | 343 | ||
344 | if CGROUPS | ||
345 | |||
346 | config CGROUP_DEBUG | 346 | config CGROUP_DEBUG |
347 | bool "Example debug cgroup subsystem" | 347 | bool "Example debug cgroup subsystem" |
348 | depends on CGROUPS | 348 | depends on CGROUPS |
@@ -350,24 +350,24 @@ config CGROUP_DEBUG | |||
350 | help | 350 | help |
351 | This option enables a simple cgroup subsystem that | 351 | This option enables a simple cgroup subsystem that |
352 | exports useful debugging information about the cgroups | 352 | exports useful debugging information about the cgroups |
353 | framework | 353 | framework. |
354 | 354 | ||
355 | Say N if unsure | 355 | Say N if unsure. |
356 | 356 | ||
357 | config CGROUP_NS | 357 | config CGROUP_NS |
358 | bool "Namespace cgroup subsystem" | 358 | bool "Namespace cgroup subsystem" |
359 | depends on CGROUPS | 359 | depends on CGROUPS |
360 | help | 360 | help |
361 | Provides a simple namespace cgroup subsystem to | 361 | Provides a simple namespace cgroup subsystem to |
362 | provide hierarchical naming of sets of namespaces, | 362 | provide hierarchical naming of sets of namespaces, |
363 | for instance virtual servers and checkpoint/restart | 363 | for instance virtual servers and checkpoint/restart |
364 | jobs. | 364 | jobs. |
365 | 365 | ||
366 | config CGROUP_FREEZER | 366 | config CGROUP_FREEZER |
367 | bool "control group freezer subsystem" | 367 | bool "Freezer cgroup subsystem" |
368 | depends on CGROUPS | 368 | depends on CGROUPS |
369 | help | 369 | help |
370 | Provides a way to freeze and unfreeze all tasks in a | 370 | Provides a way to freeze and unfreeze all tasks in a |
371 | cgroup. | 371 | cgroup. |
372 | 372 | ||
373 | config CGROUP_DEVICE | 373 | config CGROUP_DEVICE |
@@ -388,18 +388,23 @@ config CPUSETS | |||
388 | 388 | ||
389 | Say N if unsure. | 389 | Say N if unsure. |
390 | 390 | ||
391 | config PROC_PID_CPUSET | ||
392 | bool "Include legacy /proc/<pid>/cpuset file" | ||
393 | depends on CPUSETS | ||
394 | default y | ||
395 | |||
391 | config CGROUP_CPUACCT | 396 | config CGROUP_CPUACCT |
392 | bool "Simple CPU accounting cgroup subsystem" | 397 | bool "Simple CPU accounting cgroup subsystem" |
393 | depends on CGROUPS | 398 | depends on CGROUPS |
394 | help | 399 | help |
395 | Provides a simple Resource Controller for monitoring the | 400 | Provides a simple Resource Controller for monitoring the |
396 | total CPU consumed by the tasks in a cgroup | 401 | total CPU consumed by the tasks in a cgroup. |
397 | 402 | ||
398 | config RESOURCE_COUNTERS | 403 | config RESOURCE_COUNTERS |
399 | bool "Resource counters" | 404 | bool "Resource counters" |
400 | help | 405 | help |
401 | This option enables controller independent resource accounting | 406 | This option enables controller independent resource accounting |
402 | infrastructure that works with cgroups | 407 | infrastructure that works with cgroups. |
403 | depends on CGROUPS | 408 | depends on CGROUPS |
404 | 409 | ||
405 | config CGROUP_MEM_RES_CTLR | 410 | config CGROUP_MEM_RES_CTLR |
@@ -425,9 +430,6 @@ config CGROUP_MEM_RES_CTLR | |||
425 | This config option also selects MM_OWNER config option, which | 430 | This config option also selects MM_OWNER config option, which |
426 | could in turn add some fork/exit overhead. | 431 | could in turn add some fork/exit overhead. |
427 | 432 | ||
428 | config MM_OWNER | ||
429 | bool | ||
430 | |||
431 | config CGROUP_MEM_RES_CTLR_SWAP | 433 | config CGROUP_MEM_RES_CTLR_SWAP |
432 | bool "Memory Resource Controller Swap Extension(EXPERIMENTAL)" | 434 | bool "Memory Resource Controller Swap Extension(EXPERIMENTAL)" |
433 | depends on CGROUP_MEM_RES_CTLR && SWAP && EXPERIMENTAL | 435 | depends on CGROUP_MEM_RES_CTLR && SWAP && EXPERIMENTAL |
@@ -444,8 +446,10 @@ config CGROUP_MEM_RES_CTLR_SWAP | |||
444 | there will be no overhead from this. Even when you set this config=y, | 446 | there will be no overhead from this. Even when you set this config=y, |
445 | if boot option "noswapaccount" is set, swap will not be accounted. | 447 | if boot option "noswapaccount" is set, swap will not be accounted. |
446 | 448 | ||
449 | endif # CGROUPS | ||
447 | 450 | ||
448 | endmenu | 451 | config MM_OWNER |
452 | bool | ||
449 | 453 | ||
450 | config SYSFS_DEPRECATED | 454 | config SYSFS_DEPRECATED |
451 | bool | 455 | bool |
@@ -483,11 +487,6 @@ config SYSFS_DEPRECATED_V2 | |||
483 | if the original kernel, that came with your distribution, has | 487 | if the original kernel, that came with your distribution, has |
484 | this option set to N. | 488 | this option set to N. |
485 | 489 | ||
486 | config PROC_PID_CPUSET | ||
487 | bool "Include legacy /proc/<pid>/cpuset file" | ||
488 | depends on CPUSETS | ||
489 | default y | ||
490 | |||
491 | config RELAY | 490 | config RELAY |
492 | bool "Kernel->user space relay support (formerly relayfs)" | 491 | bool "Kernel->user space relay support (formerly relayfs)" |
493 | help | 492 | help |
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 23fdb8492b8e..54b4077fed79 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -650,8 +650,8 @@ static struct file *do_open(struct dentry *dentry, int oflag) | |||
650 | return dentry_open(dentry, mqueue_mnt, oflag, cred); | 650 | return dentry_open(dentry, mqueue_mnt, oflag, cred); |
651 | } | 651 | } |
652 | 652 | ||
653 | asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode, | 653 | SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode, |
654 | struct mq_attr __user *u_attr) | 654 | struct mq_attr __user *, u_attr) |
655 | { | 655 | { |
656 | struct dentry *dentry; | 656 | struct dentry *dentry; |
657 | struct file *filp; | 657 | struct file *filp; |
@@ -721,7 +721,7 @@ out_putname: | |||
721 | return fd; | 721 | return fd; |
722 | } | 722 | } |
723 | 723 | ||
724 | asmlinkage long sys_mq_unlink(const char __user *u_name) | 724 | SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name) |
725 | { | 725 | { |
726 | int err; | 726 | int err; |
727 | char *name; | 727 | char *name; |
@@ -814,9 +814,9 @@ static inline void pipelined_receive(struct mqueue_inode_info *info) | |||
814 | sender->state = STATE_READY; | 814 | sender->state = STATE_READY; |
815 | } | 815 | } |
816 | 816 | ||
817 | asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, | 817 | SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, |
818 | size_t msg_len, unsigned int msg_prio, | 818 | size_t, msg_len, unsigned int, msg_prio, |
819 | const struct timespec __user *u_abs_timeout) | 819 | const struct timespec __user *, u_abs_timeout) |
820 | { | 820 | { |
821 | struct file *filp; | 821 | struct file *filp; |
822 | struct inode *inode; | 822 | struct inode *inode; |
@@ -907,9 +907,9 @@ out: | |||
907 | return ret; | 907 | return ret; |
908 | } | 908 | } |
909 | 909 | ||
910 | asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, | 910 | SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, |
911 | size_t msg_len, unsigned int __user *u_msg_prio, | 911 | size_t, msg_len, unsigned int __user *, u_msg_prio, |
912 | const struct timespec __user *u_abs_timeout) | 912 | const struct timespec __user *, u_abs_timeout) |
913 | { | 913 | { |
914 | long timeout; | 914 | long timeout; |
915 | ssize_t ret; | 915 | ssize_t ret; |
@@ -997,8 +997,8 @@ out: | |||
997 | * and he isn't currently owner of notification, will be silently discarded. | 997 | * and he isn't currently owner of notification, will be silently discarded. |
998 | * It isn't explicitly defined in the POSIX. | 998 | * It isn't explicitly defined in the POSIX. |
999 | */ | 999 | */ |
1000 | asmlinkage long sys_mq_notify(mqd_t mqdes, | 1000 | SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, |
1001 | const struct sigevent __user *u_notification) | 1001 | const struct sigevent __user *, u_notification) |
1002 | { | 1002 | { |
1003 | int ret; | 1003 | int ret; |
1004 | struct file *filp; | 1004 | struct file *filp; |
@@ -1123,9 +1123,9 @@ out: | |||
1123 | return ret; | 1123 | return ret; |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, | 1126 | SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, |
1127 | const struct mq_attr __user *u_mqstat, | 1127 | const struct mq_attr __user *, u_mqstat, |
1128 | struct mq_attr __user *u_omqstat) | 1128 | struct mq_attr __user *, u_omqstat) |
1129 | { | 1129 | { |
1130 | int ret; | 1130 | int ret; |
1131 | struct mq_attr mqstat, omqstat; | 1131 | struct mq_attr mqstat, omqstat; |
@@ -309,7 +309,7 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg) | |||
309 | return security_msg_queue_associate(msq, msgflg); | 309 | return security_msg_queue_associate(msq, msgflg); |
310 | } | 310 | } |
311 | 311 | ||
312 | asmlinkage long sys_msgget(key_t key, int msgflg) | 312 | SYSCALL_DEFINE2(msgget, key_t, key, int, msgflg) |
313 | { | 313 | { |
314 | struct ipc_namespace *ns; | 314 | struct ipc_namespace *ns; |
315 | struct ipc_ops msg_ops; | 315 | struct ipc_ops msg_ops; |
@@ -466,7 +466,7 @@ out_up: | |||
466 | return err; | 466 | return err; |
467 | } | 467 | } |
468 | 468 | ||
469 | asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf) | 469 | SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf) |
470 | { | 470 | { |
471 | struct msg_queue *msq; | 471 | struct msg_queue *msq; |
472 | int err, version; | 472 | int err, version; |
@@ -723,8 +723,8 @@ out_free: | |||
723 | return err; | 723 | return err; |
724 | } | 724 | } |
725 | 725 | ||
726 | asmlinkage long | 726 | SYSCALL_DEFINE4(msgsnd, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, |
727 | sys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg) | 727 | int, msgflg) |
728 | { | 728 | { |
729 | long mtype; | 729 | long mtype; |
730 | 730 | ||
@@ -904,8 +904,8 @@ out_unlock: | |||
904 | return msgsz; | 904 | return msgsz; |
905 | } | 905 | } |
906 | 906 | ||
907 | asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz, | 907 | SYSCALL_DEFINE5(msgrcv, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, |
908 | long msgtyp, int msgflg) | 908 | long, msgtyp, int, msgflg) |
909 | { | 909 | { |
910 | long err, mtype; | 910 | long err, mtype; |
911 | 911 | ||
@@ -308,7 +308,7 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp, | |||
308 | return 0; | 308 | return 0; |
309 | } | 309 | } |
310 | 310 | ||
311 | asmlinkage long sys_semget(key_t key, int nsems, int semflg) | 311 | SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg) |
312 | { | 312 | { |
313 | struct ipc_namespace *ns; | 313 | struct ipc_namespace *ns; |
314 | struct ipc_ops sem_ops; | 314 | struct ipc_ops sem_ops; |
@@ -887,7 +887,7 @@ out_up: | |||
887 | return err; | 887 | return err; |
888 | } | 888 | } |
889 | 889 | ||
890 | asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg) | 890 | SYSCALL_DEFINE(semctl)(int semid, int semnum, int cmd, union semun arg) |
891 | { | 891 | { |
892 | int err = -EINVAL; | 892 | int err = -EINVAL; |
893 | int version; | 893 | int version; |
@@ -923,6 +923,13 @@ asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg) | |||
923 | return -EINVAL; | 923 | return -EINVAL; |
924 | } | 924 | } |
925 | } | 925 | } |
926 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
927 | asmlinkage long SyS_semctl(int semid, int semnum, int cmd, union semun arg) | ||
928 | { | ||
929 | return SYSC_semctl((int) semid, (int) semnum, (int) cmd, arg); | ||
930 | } | ||
931 | SYSCALL_ALIAS(sys_semctl, SyS_semctl); | ||
932 | #endif | ||
926 | 933 | ||
927 | /* If the task doesn't already have a undo_list, then allocate one | 934 | /* If the task doesn't already have a undo_list, then allocate one |
928 | * here. We guarantee there is only one thread using this undo list, | 935 | * here. We guarantee there is only one thread using this undo list, |
@@ -1048,8 +1055,8 @@ out: | |||
1048 | return un; | 1055 | return un; |
1049 | } | 1056 | } |
1050 | 1057 | ||
1051 | asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops, | 1058 | SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, |
1052 | unsigned nsops, const struct timespec __user *timeout) | 1059 | unsigned, nsops, const struct timespec __user *, timeout) |
1053 | { | 1060 | { |
1054 | int error = -EINVAL; | 1061 | int error = -EINVAL; |
1055 | struct sem_array *sma; | 1062 | struct sem_array *sma; |
@@ -1225,7 +1232,8 @@ out_free: | |||
1225 | return error; | 1232 | return error; |
1226 | } | 1233 | } |
1227 | 1234 | ||
1228 | asmlinkage long sys_semop (int semid, struct sembuf __user *tsops, unsigned nsops) | 1235 | SYSCALL_DEFINE3(semop, int, semid, struct sembuf __user *, tsops, |
1236 | unsigned, nsops) | ||
1229 | { | 1237 | { |
1230 | return sys_semtimedop(semid, tsops, nsops, NULL); | 1238 | return sys_semtimedop(semid, tsops, nsops, NULL); |
1231 | } | 1239 | } |
@@ -440,7 +440,7 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp, | |||
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | 442 | ||
443 | asmlinkage long sys_shmget (key_t key, size_t size, int shmflg) | 443 | SYSCALL_DEFINE3(shmget, key_t, key, size_t, size, int, shmflg) |
444 | { | 444 | { |
445 | struct ipc_namespace *ns; | 445 | struct ipc_namespace *ns; |
446 | struct ipc_ops shm_ops; | 446 | struct ipc_ops shm_ops; |
@@ -621,7 +621,7 @@ out_up: | |||
621 | return err; | 621 | return err; |
622 | } | 622 | } |
623 | 623 | ||
624 | asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf) | 624 | SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) |
625 | { | 625 | { |
626 | struct shmid_kernel *shp; | 626 | struct shmid_kernel *shp; |
627 | int err, version; | 627 | int err, version; |
@@ -939,7 +939,7 @@ out_put_dentry: | |||
939 | goto out_nattch; | 939 | goto out_nattch; |
940 | } | 940 | } |
941 | 941 | ||
942 | asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg) | 942 | SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg) |
943 | { | 943 | { |
944 | unsigned long ret; | 944 | unsigned long ret; |
945 | long err; | 945 | long err; |
@@ -955,7 +955,7 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg) | |||
955 | * detach and kill segment if marked destroyed. | 955 | * detach and kill segment if marked destroyed. |
956 | * The work is done in shm_close. | 956 | * The work is done in shm_close. |
957 | */ | 957 | */ |
958 | asmlinkage long sys_shmdt(char __user *shmaddr) | 958 | SYSCALL_DEFINE1(shmdt, char __user *, shmaddr) |
959 | { | 959 | { |
960 | struct mm_struct *mm = current->mm; | 960 | struct mm_struct *mm = current->mm; |
961 | struct vm_area_struct *vma, *next; | 961 | struct vm_area_struct *vma, *next; |
diff --git a/kernel/Makefile b/kernel/Makefile index 2921d90ce32f..170a9213c1b6 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -41,6 +41,9 @@ obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o | |||
41 | obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o | 41 | obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o |
42 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o | 42 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o |
43 | obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o | 43 | obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o |
44 | ifneq ($(CONFIG_SMP),y) | ||
45 | obj-y += up.o | ||
46 | endif | ||
44 | obj-$(CONFIG_SMP) += spinlock.o | 47 | obj-$(CONFIG_SMP) += spinlock.o |
45 | obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o | 48 | obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o |
46 | obj-$(CONFIG_PROVE_LOCKING) += spinlock.o | 49 | obj-$(CONFIG_PROVE_LOCKING) += spinlock.o |
diff --git a/kernel/acct.c b/kernel/acct.c index d57b7cbb98b6..7afa31564162 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
@@ -277,7 +277,7 @@ static int acct_on(char *name) | |||
277 | * should be written. If the filename is NULL, accounting will be | 277 | * should be written. If the filename is NULL, accounting will be |
278 | * shutdown. | 278 | * shutdown. |
279 | */ | 279 | */ |
280 | asmlinkage long sys_acct(const char __user *name) | 280 | SYSCALL_DEFINE1(acct, const char __user *, name) |
281 | { | 281 | { |
282 | int error; | 282 | int error; |
283 | 283 | ||
diff --git a/kernel/async.c b/kernel/async.c index f286e9f2b736..608b32b42812 100644 --- a/kernel/async.c +++ b/kernel/async.c | |||
@@ -90,12 +90,12 @@ extern int initcall_debug; | |||
90 | static async_cookie_t __lowest_in_progress(struct list_head *running) | 90 | static async_cookie_t __lowest_in_progress(struct list_head *running) |
91 | { | 91 | { |
92 | struct async_entry *entry; | 92 | struct async_entry *entry; |
93 | if (!list_empty(&async_pending)) { | 93 | if (!list_empty(running)) { |
94 | entry = list_first_entry(&async_pending, | 94 | entry = list_first_entry(running, |
95 | struct async_entry, list); | 95 | struct async_entry, list); |
96 | return entry->cookie; | 96 | return entry->cookie; |
97 | } else if (!list_empty(running)) { | 97 | } else if (!list_empty(&async_pending)) { |
98 | entry = list_first_entry(running, | 98 | entry = list_first_entry(&async_pending, |
99 | struct async_entry, list); | 99 | struct async_entry, list); |
100 | return entry->cookie; | 100 | return entry->cookie; |
101 | } else { | 101 | } else { |
@@ -104,6 +104,17 @@ static async_cookie_t __lowest_in_progress(struct list_head *running) | |||
104 | } | 104 | } |
105 | 105 | ||
106 | } | 106 | } |
107 | |||
108 | static async_cookie_t lowest_in_progress(struct list_head *running) | ||
109 | { | ||
110 | unsigned long flags; | ||
111 | async_cookie_t ret; | ||
112 | |||
113 | spin_lock_irqsave(&async_lock, flags); | ||
114 | ret = __lowest_in_progress(running); | ||
115 | spin_unlock_irqrestore(&async_lock, flags); | ||
116 | return ret; | ||
117 | } | ||
107 | /* | 118 | /* |
108 | * pick the first pending entry and run it | 119 | * pick the first pending entry and run it |
109 | */ | 120 | */ |
@@ -229,7 +240,7 @@ void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *r | |||
229 | starttime = ktime_get(); | 240 | starttime = ktime_get(); |
230 | } | 241 | } |
231 | 242 | ||
232 | wait_event(async_done, __lowest_in_progress(running) >= cookie); | 243 | wait_event(async_done, lowest_in_progress(running) >= cookie); |
233 | 244 | ||
234 | if (initcall_debug && system_state == SYSTEM_BOOTING) { | 245 | if (initcall_debug && system_state == SYSTEM_BOOTING) { |
235 | endtime = ktime_get(); | 246 | endtime = ktime_get(); |
diff --git a/kernel/capability.c b/kernel/capability.c index 688926e496be..4e17041963f5 100644 --- a/kernel/capability.c +++ b/kernel/capability.c | |||
@@ -161,7 +161,7 @@ static inline int cap_get_target_pid(pid_t pid, kernel_cap_t *pEp, | |||
161 | * | 161 | * |
162 | * Returns 0 on success and < 0 on error. | 162 | * Returns 0 on success and < 0 on error. |
163 | */ | 163 | */ |
164 | asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) | 164 | SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr) |
165 | { | 165 | { |
166 | int ret = 0; | 166 | int ret = 0; |
167 | pid_t pid; | 167 | pid_t pid; |
@@ -235,7 +235,7 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) | |||
235 | * | 235 | * |
236 | * Returns 0 on success and < 0 on error. | 236 | * Returns 0 on success and < 0 on error. |
237 | */ | 237 | */ |
238 | asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data) | 238 | SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data) |
239 | { | 239 | { |
240 | struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S]; | 240 | struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S]; |
241 | unsigned i, tocopy; | 241 | unsigned i, tocopy; |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 647c77a88fcb..a85678865c5e 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -568,7 +568,7 @@ update_domain_attr_tree(struct sched_domain_attr *dattr, struct cpuset *c) | |||
568 | * load balancing domains (sched domains) as specified by that partial | 568 | * load balancing domains (sched domains) as specified by that partial |
569 | * partition. | 569 | * partition. |
570 | * | 570 | * |
571 | * See "What is sched_load_balance" in Documentation/cpusets.txt | 571 | * See "What is sched_load_balance" in Documentation/cgroups/cpusets.txt |
572 | * for a background explanation of this. | 572 | * for a background explanation of this. |
573 | * | 573 | * |
574 | * Does not return errors, on the theory that the callers of this | 574 | * Does not return errors, on the theory that the callers of this |
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index 0511716e9424..667c841c2952 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c | |||
@@ -209,8 +209,7 @@ static int __init proc_execdomains_init(void) | |||
209 | module_init(proc_execdomains_init); | 209 | module_init(proc_execdomains_init); |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | asmlinkage long | 212 | SYSCALL_DEFINE1(personality, u_long, personality) |
213 | sys_personality(u_long personality) | ||
214 | { | 213 | { |
215 | u_long old = current->personality; | 214 | u_long old = current->personality; |
216 | 215 | ||
diff --git a/kernel/exit.c b/kernel/exit.c index c7740fa3252c..f80dec3f1875 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1141,7 +1141,7 @@ NORET_TYPE void complete_and_exit(struct completion *comp, long code) | |||
1141 | 1141 | ||
1142 | EXPORT_SYMBOL(complete_and_exit); | 1142 | EXPORT_SYMBOL(complete_and_exit); |
1143 | 1143 | ||
1144 | asmlinkage long sys_exit(int error_code) | 1144 | SYSCALL_DEFINE1(exit, int, error_code) |
1145 | { | 1145 | { |
1146 | do_exit((error_code&0xff)<<8); | 1146 | do_exit((error_code&0xff)<<8); |
1147 | } | 1147 | } |
@@ -1182,9 +1182,11 @@ do_group_exit(int exit_code) | |||
1182 | * wait4()-ing process will get the correct exit code - even if this | 1182 | * wait4()-ing process will get the correct exit code - even if this |
1183 | * thread is not the thread group leader. | 1183 | * thread is not the thread group leader. |
1184 | */ | 1184 | */ |
1185 | asmlinkage void sys_exit_group(int error_code) | 1185 | SYSCALL_DEFINE1(exit_group, int, error_code) |
1186 | { | 1186 | { |
1187 | do_group_exit((error_code & 0xff) << 8); | 1187 | do_group_exit((error_code & 0xff) << 8); |
1188 | /* NOTREACHED */ | ||
1189 | return 0; | ||
1188 | } | 1190 | } |
1189 | 1191 | ||
1190 | static struct pid *task_pid_type(struct task_struct *task, enum pid_type type) | 1192 | static struct pid *task_pid_type(struct task_struct *task, enum pid_type type) |
@@ -1752,9 +1754,8 @@ end: | |||
1752 | return retval; | 1754 | return retval; |
1753 | } | 1755 | } |
1754 | 1756 | ||
1755 | asmlinkage long sys_waitid(int which, pid_t upid, | 1757 | SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, |
1756 | struct siginfo __user *infop, int options, | 1758 | infop, int, options, struct rusage __user *, ru) |
1757 | struct rusage __user *ru) | ||
1758 | { | 1759 | { |
1759 | struct pid *pid = NULL; | 1760 | struct pid *pid = NULL; |
1760 | enum pid_type type; | 1761 | enum pid_type type; |
@@ -1793,8 +1794,8 @@ asmlinkage long sys_waitid(int which, pid_t upid, | |||
1793 | return ret; | 1794 | return ret; |
1794 | } | 1795 | } |
1795 | 1796 | ||
1796 | asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr, | 1797 | SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, |
1797 | int options, struct rusage __user *ru) | 1798 | int, options, struct rusage __user *, ru) |
1798 | { | 1799 | { |
1799 | struct pid *pid = NULL; | 1800 | struct pid *pid = NULL; |
1800 | enum pid_type type; | 1801 | enum pid_type type; |
@@ -1831,7 +1832,7 @@ asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr, | |||
1831 | * sys_waitpid() remains for compatibility. waitpid() should be | 1832 | * sys_waitpid() remains for compatibility. waitpid() should be |
1832 | * implemented by calling sys_wait4() from libc.a. | 1833 | * implemented by calling sys_wait4() from libc.a. |
1833 | */ | 1834 | */ |
1834 | asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options) | 1835 | SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int, options) |
1835 | { | 1836 | { |
1836 | return sys_wait4(pid, stat_addr, options, NULL); | 1837 | return sys_wait4(pid, stat_addr, options, NULL); |
1837 | } | 1838 | } |
diff --git a/kernel/fork.c b/kernel/fork.c index 1d68f1255dd8..bf0cef8bbdf2 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -901,7 +901,7 @@ static void copy_flags(unsigned long clone_flags, struct task_struct *p) | |||
901 | clear_freeze_flag(p); | 901 | clear_freeze_flag(p); |
902 | } | 902 | } |
903 | 903 | ||
904 | asmlinkage long sys_set_tid_address(int __user *tidptr) | 904 | SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr) |
905 | { | 905 | { |
906 | current->clear_child_tid = tidptr; | 906 | current->clear_child_tid = tidptr; |
907 | 907 | ||
@@ -1603,7 +1603,7 @@ static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp | |||
1603 | * constructed. Here we are modifying the current, active, | 1603 | * constructed. Here we are modifying the current, active, |
1604 | * task_struct. | 1604 | * task_struct. |
1605 | */ | 1605 | */ |
1606 | asmlinkage long sys_unshare(unsigned long unshare_flags) | 1606 | SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) |
1607 | { | 1607 | { |
1608 | int err = 0; | 1608 | int err = 0; |
1609 | struct fs_struct *fs, *new_fs = NULL; | 1609 | struct fs_struct *fs, *new_fs = NULL; |
diff --git a/kernel/futex.c b/kernel/futex.c index 002aa189eb09..f89d373a9c6d 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -1733,9 +1733,8 @@ pi_faulted: | |||
1733 | * @head: pointer to the list-head | 1733 | * @head: pointer to the list-head |
1734 | * @len: length of the list-head, as userspace expects | 1734 | * @len: length of the list-head, as userspace expects |
1735 | */ | 1735 | */ |
1736 | asmlinkage long | 1736 | SYSCALL_DEFINE2(set_robust_list, struct robust_list_head __user *, head, |
1737 | sys_set_robust_list(struct robust_list_head __user *head, | 1737 | size_t, len) |
1738 | size_t len) | ||
1739 | { | 1738 | { |
1740 | if (!futex_cmpxchg_enabled) | 1739 | if (!futex_cmpxchg_enabled) |
1741 | return -ENOSYS; | 1740 | return -ENOSYS; |
@@ -1756,9 +1755,9 @@ sys_set_robust_list(struct robust_list_head __user *head, | |||
1756 | * @head_ptr: pointer to a list-head pointer, the kernel fills it in | 1755 | * @head_ptr: pointer to a list-head pointer, the kernel fills it in |
1757 | * @len_ptr: pointer to a length field, the kernel fills in the header size | 1756 | * @len_ptr: pointer to a length field, the kernel fills in the header size |
1758 | */ | 1757 | */ |
1759 | asmlinkage long | 1758 | SYSCALL_DEFINE3(get_robust_list, int, pid, |
1760 | sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr, | 1759 | struct robust_list_head __user * __user *, head_ptr, |
1761 | size_t __user *len_ptr) | 1760 | size_t __user *, len_ptr) |
1762 | { | 1761 | { |
1763 | struct robust_list_head __user *head; | 1762 | struct robust_list_head __user *head; |
1764 | unsigned long ret; | 1763 | unsigned long ret; |
@@ -1978,9 +1977,9 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, | |||
1978 | } | 1977 | } |
1979 | 1978 | ||
1980 | 1979 | ||
1981 | asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val, | 1980 | SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val, |
1982 | struct timespec __user *utime, u32 __user *uaddr2, | 1981 | struct timespec __user *, utime, u32 __user *, uaddr2, |
1983 | u32 val3) | 1982 | u32, val3) |
1984 | { | 1983 | { |
1985 | struct timespec ts; | 1984 | struct timespec ts; |
1986 | ktime_t t, *tp = NULL; | 1985 | ktime_t t, *tp = NULL; |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 1455b7651b6b..2dc30c59c5fd 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -1467,8 +1467,8 @@ out: | |||
1467 | return ret; | 1467 | return ret; |
1468 | } | 1468 | } |
1469 | 1469 | ||
1470 | asmlinkage long | 1470 | SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, |
1471 | sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp) | 1471 | struct timespec __user *, rmtp) |
1472 | { | 1472 | { |
1473 | struct timespec tu; | 1473 | struct timespec tu; |
1474 | 1474 | ||
diff --git a/kernel/itimer.c b/kernel/itimer.c index db7c358b9a02..6a5fe93dd8bd 100644 --- a/kernel/itimer.c +++ b/kernel/itimer.c | |||
@@ -100,7 +100,7 @@ int do_getitimer(int which, struct itimerval *value) | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | asmlinkage long sys_getitimer(int which, struct itimerval __user *value) | 103 | SYSCALL_DEFINE2(getitimer, int, which, struct itimerval __user *, value) |
104 | { | 104 | { |
105 | int error = -EFAULT; | 105 | int error = -EFAULT; |
106 | struct itimerval get_buffer; | 106 | struct itimerval get_buffer; |
@@ -260,9 +260,8 @@ unsigned int alarm_setitimer(unsigned int seconds) | |||
260 | return it_old.it_value.tv_sec; | 260 | return it_old.it_value.tv_sec; |
261 | } | 261 | } |
262 | 262 | ||
263 | asmlinkage long sys_setitimer(int which, | 263 | SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value, |
264 | struct itimerval __user *value, | 264 | struct itimerval __user *, ovalue) |
265 | struct itimerval __user *ovalue) | ||
266 | { | 265 | { |
267 | struct itimerval set_buffer, get_buffer; | 266 | struct itimerval set_buffer, get_buffer; |
268 | int error; | 267 | int error; |
diff --git a/kernel/kexec.c b/kernel/kexec.c index 3fb855ad6aa0..8a6d7b08864e 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -934,9 +934,8 @@ struct kimage *kexec_crash_image; | |||
934 | 934 | ||
935 | static DEFINE_MUTEX(kexec_mutex); | 935 | static DEFINE_MUTEX(kexec_mutex); |
936 | 936 | ||
937 | asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, | 937 | SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, |
938 | struct kexec_segment __user *segments, | 938 | struct kexec_segment __user *, segments, unsigned long, flags) |
939 | unsigned long flags) | ||
940 | { | 939 | { |
941 | struct kimage **dest_image, *image; | 940 | struct kimage **dest_image, *image; |
942 | int result; | 941 | int result; |
diff --git a/kernel/module.c b/kernel/module.c index c9332c90d5a0..e8b51d41dd72 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -743,8 +743,8 @@ static void wait_for_zero_refcount(struct module *mod) | |||
743 | mutex_lock(&module_mutex); | 743 | mutex_lock(&module_mutex); |
744 | } | 744 | } |
745 | 745 | ||
746 | asmlinkage long | 746 | SYSCALL_DEFINE2(delete_module, const char __user *, name_user, |
747 | sys_delete_module(const char __user *name_user, unsigned int flags) | 747 | unsigned int, flags) |
748 | { | 748 | { |
749 | struct module *mod; | 749 | struct module *mod; |
750 | char name[MODULE_NAME_LEN]; | 750 | char name[MODULE_NAME_LEN]; |
@@ -2296,10 +2296,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2296 | } | 2296 | } |
2297 | 2297 | ||
2298 | /* This is where the real work happens */ | 2298 | /* This is where the real work happens */ |
2299 | asmlinkage long | 2299 | SYSCALL_DEFINE3(init_module, void __user *, umod, |
2300 | sys_init_module(void __user *umod, | 2300 | unsigned long, len, const char __user *, uargs) |
2301 | unsigned long len, | ||
2302 | const char __user *uargs) | ||
2303 | { | 2301 | { |
2304 | struct module *mod; | 2302 | struct module *mod; |
2305 | int ret = 0; | 2303 | int ret = 0; |
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 887c63787de6..052ec4d195c7 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -477,10 +477,9 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set) | |||
477 | 477 | ||
478 | /* Create a POSIX.1b interval timer. */ | 478 | /* Create a POSIX.1b interval timer. */ |
479 | 479 | ||
480 | asmlinkage long | 480 | SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock, |
481 | sys_timer_create(const clockid_t which_clock, | 481 | struct sigevent __user *, timer_event_spec, |
482 | struct sigevent __user *timer_event_spec, | 482 | timer_t __user *, created_timer_id) |
483 | timer_t __user * created_timer_id) | ||
484 | { | 483 | { |
485 | struct k_itimer *new_timer; | 484 | struct k_itimer *new_timer; |
486 | int error, new_timer_id; | 485 | int error, new_timer_id; |
@@ -661,8 +660,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) | |||
661 | } | 660 | } |
662 | 661 | ||
663 | /* Get the time remaining on a POSIX.1b interval timer. */ | 662 | /* Get the time remaining on a POSIX.1b interval timer. */ |
664 | asmlinkage long | 663 | SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, |
665 | sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting) | 664 | struct itimerspec __user *, setting) |
666 | { | 665 | { |
667 | struct k_itimer *timr; | 666 | struct k_itimer *timr; |
668 | struct itimerspec cur_setting; | 667 | struct itimerspec cur_setting; |
@@ -691,8 +690,7 @@ sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting) | |||
691 | * the call back to do_schedule_next_timer(). So all we need to do is | 690 | * the call back to do_schedule_next_timer(). So all we need to do is |
692 | * to pick up the frozen overrun. | 691 | * to pick up the frozen overrun. |
693 | */ | 692 | */ |
694 | asmlinkage long | 693 | SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id) |
695 | sys_timer_getoverrun(timer_t timer_id) | ||
696 | { | 694 | { |
697 | struct k_itimer *timr; | 695 | struct k_itimer *timr; |
698 | int overrun; | 696 | int overrun; |
@@ -760,10 +758,9 @@ common_timer_set(struct k_itimer *timr, int flags, | |||
760 | } | 758 | } |
761 | 759 | ||
762 | /* Set a POSIX.1b interval timer */ | 760 | /* Set a POSIX.1b interval timer */ |
763 | asmlinkage long | 761 | SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, |
764 | sys_timer_settime(timer_t timer_id, int flags, | 762 | const struct itimerspec __user *, new_setting, |
765 | const struct itimerspec __user *new_setting, | 763 | struct itimerspec __user *, old_setting) |
766 | struct itimerspec __user *old_setting) | ||
767 | { | 764 | { |
768 | struct k_itimer *timr; | 765 | struct k_itimer *timr; |
769 | struct itimerspec new_spec, old_spec; | 766 | struct itimerspec new_spec, old_spec; |
@@ -816,8 +813,7 @@ static inline int timer_delete_hook(struct k_itimer *timer) | |||
816 | } | 813 | } |
817 | 814 | ||
818 | /* Delete a POSIX.1b interval timer. */ | 815 | /* Delete a POSIX.1b interval timer. */ |
819 | asmlinkage long | 816 | SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) |
820 | sys_timer_delete(timer_t timer_id) | ||
821 | { | 817 | { |
822 | struct k_itimer *timer; | 818 | struct k_itimer *timer; |
823 | unsigned long flags; | 819 | unsigned long flags; |
@@ -903,8 +899,8 @@ int do_posix_clock_nonanosleep(const clockid_t clock, int flags, | |||
903 | } | 899 | } |
904 | EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); | 900 | EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); |
905 | 901 | ||
906 | asmlinkage long sys_clock_settime(const clockid_t which_clock, | 902 | SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, |
907 | const struct timespec __user *tp) | 903 | const struct timespec __user *, tp) |
908 | { | 904 | { |
909 | struct timespec new_tp; | 905 | struct timespec new_tp; |
910 | 906 | ||
@@ -916,8 +912,8 @@ asmlinkage long sys_clock_settime(const clockid_t which_clock, | |||
916 | return CLOCK_DISPATCH(which_clock, clock_set, (which_clock, &new_tp)); | 912 | return CLOCK_DISPATCH(which_clock, clock_set, (which_clock, &new_tp)); |
917 | } | 913 | } |
918 | 914 | ||
919 | asmlinkage long | 915 | SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, |
920 | sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp) | 916 | struct timespec __user *,tp) |
921 | { | 917 | { |
922 | struct timespec kernel_tp; | 918 | struct timespec kernel_tp; |
923 | int error; | 919 | int error; |
@@ -933,8 +929,8 @@ sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp) | |||
933 | 929 | ||
934 | } | 930 | } |
935 | 931 | ||
936 | asmlinkage long | 932 | SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, |
937 | sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp) | 933 | struct timespec __user *, tp) |
938 | { | 934 | { |
939 | struct timespec rtn_tp; | 935 | struct timespec rtn_tp; |
940 | int error; | 936 | int error; |
@@ -963,10 +959,9 @@ static int common_nsleep(const clockid_t which_clock, int flags, | |||
963 | which_clock); | 959 | which_clock); |
964 | } | 960 | } |
965 | 961 | ||
966 | asmlinkage long | 962 | SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, |
967 | sys_clock_nanosleep(const clockid_t which_clock, int flags, | 963 | const struct timespec __user *, rqtp, |
968 | const struct timespec __user *rqtp, | 964 | struct timespec __user *, rmtp) |
969 | struct timespec __user *rmtp) | ||
970 | { | 965 | { |
971 | struct timespec t; | 966 | struct timespec t; |
972 | 967 | ||
diff --git a/kernel/printk.c b/kernel/printk.c index 7015733793e8..69188f226a93 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -382,7 +382,7 @@ out: | |||
382 | return error; | 382 | return error; |
383 | } | 383 | } |
384 | 384 | ||
385 | asmlinkage long sys_syslog(int type, char __user *buf, int len) | 385 | SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) |
386 | { | 386 | { |
387 | return do_syslog(type, buf, len); | 387 | return do_syslog(type, buf, len); |
388 | } | 388 | } |
@@ -742,11 +742,6 @@ EXPORT_SYMBOL(vprintk); | |||
742 | 742 | ||
743 | #else | 743 | #else |
744 | 744 | ||
745 | asmlinkage long sys_syslog(int type, char __user *buf, int len) | ||
746 | { | ||
747 | return -ENOSYS; | ||
748 | } | ||
749 | |||
750 | static void call_console_drivers(unsigned start, unsigned end) | 745 | static void call_console_drivers(unsigned start, unsigned end) |
751 | { | 746 | { |
752 | } | 747 | } |
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 29dc700e198c..c9cf48b21f05 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -574,7 +574,7 @@ struct task_struct *ptrace_get_task_struct(pid_t pid) | |||
574 | #define arch_ptrace_attach(child) do { } while (0) | 574 | #define arch_ptrace_attach(child) do { } while (0) |
575 | #endif | 575 | #endif |
576 | 576 | ||
577 | asmlinkage long sys_ptrace(long request, long pid, long addr, long data) | 577 | SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data) |
578 | { | 578 | { |
579 | struct task_struct *child; | 579 | struct task_struct *child; |
580 | long ret; | 580 | long ret; |
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index 1cff28db56b6..7c4142a79f0a 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c | |||
@@ -136,29 +136,47 @@ static int stutter_pause_test = 0; | |||
136 | #endif | 136 | #endif |
137 | int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT; | 137 | int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT; |
138 | 138 | ||
139 | #define FULLSTOP_SHUTDOWN 1 /* Bail due to system shutdown/panic. */ | 139 | /* Mediate rmmod and system shutdown. Concurrent rmmod & shutdown illegal! */ |
140 | #define FULLSTOP_CLEANUP 2 /* Orderly shutdown. */ | 140 | |
141 | static int fullstop; /* stop generating callbacks at test end. */ | 141 | #define FULLSTOP_DONTSTOP 0 /* Normal operation. */ |
142 | DEFINE_MUTEX(fullstop_mutex); /* protect fullstop transitions and */ | 142 | #define FULLSTOP_SHUTDOWN 1 /* System shutdown with rcutorture running. */ |
143 | /* spawning of kthreads. */ | 143 | #define FULLSTOP_RMMOD 2 /* Normal rmmod of rcutorture. */ |
144 | static int fullstop = FULLSTOP_RMMOD; | ||
145 | DEFINE_MUTEX(fullstop_mutex); /* Protect fullstop transitions and spawning */ | ||
146 | /* of kthreads. */ | ||
144 | 147 | ||
145 | /* | 148 | /* |
146 | * Detect and respond to a signal-based shutdown. | 149 | * Detect and respond to a system shutdown. |
147 | */ | 150 | */ |
148 | static int | 151 | static int |
149 | rcutorture_shutdown_notify(struct notifier_block *unused1, | 152 | rcutorture_shutdown_notify(struct notifier_block *unused1, |
150 | unsigned long unused2, void *unused3) | 153 | unsigned long unused2, void *unused3) |
151 | { | 154 | { |
152 | if (fullstop) | ||
153 | return NOTIFY_DONE; | ||
154 | mutex_lock(&fullstop_mutex); | 155 | mutex_lock(&fullstop_mutex); |
155 | if (!fullstop) | 156 | if (fullstop == FULLSTOP_DONTSTOP) |
156 | fullstop = FULLSTOP_SHUTDOWN; | 157 | fullstop = FULLSTOP_SHUTDOWN; |
158 | else | ||
159 | printk(KERN_WARNING /* but going down anyway, so... */ | ||
160 | "Concurrent 'rmmod rcutorture' and shutdown illegal!\n"); | ||
157 | mutex_unlock(&fullstop_mutex); | 161 | mutex_unlock(&fullstop_mutex); |
158 | return NOTIFY_DONE; | 162 | return NOTIFY_DONE; |
159 | } | 163 | } |
160 | 164 | ||
161 | /* | 165 | /* |
166 | * Absorb kthreads into a kernel function that won't return, so that | ||
167 | * they won't ever access module text or data again. | ||
168 | */ | ||
169 | static void rcutorture_shutdown_absorb(char *title) | ||
170 | { | ||
171 | if (ACCESS_ONCE(fullstop) == FULLSTOP_SHUTDOWN) { | ||
172 | printk(KERN_NOTICE | ||
173 | "rcutorture thread %s parking due to system shutdown\n", | ||
174 | title); | ||
175 | schedule_timeout_uninterruptible(MAX_SCHEDULE_TIMEOUT); | ||
176 | } | ||
177 | } | ||
178 | |||
179 | /* | ||
162 | * Allocate an element from the rcu_tortures pool. | 180 | * Allocate an element from the rcu_tortures pool. |
163 | */ | 181 | */ |
164 | static struct rcu_torture * | 182 | static struct rcu_torture * |
@@ -219,13 +237,14 @@ rcu_random(struct rcu_random_state *rrsp) | |||
219 | } | 237 | } |
220 | 238 | ||
221 | static void | 239 | static void |
222 | rcu_stutter_wait(void) | 240 | rcu_stutter_wait(char *title) |
223 | { | 241 | { |
224 | while ((stutter_pause_test || !rcutorture_runnable) && !fullstop) { | 242 | while (stutter_pause_test || !rcutorture_runnable) { |
225 | if (rcutorture_runnable) | 243 | if (rcutorture_runnable) |
226 | schedule_timeout_interruptible(1); | 244 | schedule_timeout_interruptible(1); |
227 | else | 245 | else |
228 | schedule_timeout_interruptible(round_jiffies_relative(HZ)); | 246 | schedule_timeout_interruptible(round_jiffies_relative(HZ)); |
247 | rcutorture_shutdown_absorb(title); | ||
229 | } | 248 | } |
230 | } | 249 | } |
231 | 250 | ||
@@ -287,7 +306,7 @@ rcu_torture_cb(struct rcu_head *p) | |||
287 | int i; | 306 | int i; |
288 | struct rcu_torture *rp = container_of(p, struct rcu_torture, rtort_rcu); | 307 | struct rcu_torture *rp = container_of(p, struct rcu_torture, rtort_rcu); |
289 | 308 | ||
290 | if (fullstop) { | 309 | if (fullstop != FULLSTOP_DONTSTOP) { |
291 | /* Test is ending, just drop callbacks on the floor. */ | 310 | /* Test is ending, just drop callbacks on the floor. */ |
292 | /* The next initialization will pick up the pieces. */ | 311 | /* The next initialization will pick up the pieces. */ |
293 | return; | 312 | return; |
@@ -619,10 +638,11 @@ rcu_torture_writer(void *arg) | |||
619 | } | 638 | } |
620 | rcu_torture_current_version++; | 639 | rcu_torture_current_version++; |
621 | oldbatch = cur_ops->completed(); | 640 | oldbatch = cur_ops->completed(); |
622 | rcu_stutter_wait(); | 641 | rcu_stutter_wait("rcu_torture_writer"); |
623 | } while (!kthread_should_stop() && !fullstop); | 642 | } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); |
624 | VERBOSE_PRINTK_STRING("rcu_torture_writer task stopping"); | 643 | VERBOSE_PRINTK_STRING("rcu_torture_writer task stopping"); |
625 | while (!kthread_should_stop() && fullstop != FULLSTOP_SHUTDOWN) | 644 | rcutorture_shutdown_absorb("rcu_torture_writer"); |
645 | while (!kthread_should_stop()) | ||
626 | schedule_timeout_uninterruptible(1); | 646 | schedule_timeout_uninterruptible(1); |
627 | return 0; | 647 | return 0; |
628 | } | 648 | } |
@@ -643,11 +663,12 @@ rcu_torture_fakewriter(void *arg) | |||
643 | schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10); | 663 | schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10); |
644 | udelay(rcu_random(&rand) & 0x3ff); | 664 | udelay(rcu_random(&rand) & 0x3ff); |
645 | cur_ops->sync(); | 665 | cur_ops->sync(); |
646 | rcu_stutter_wait(); | 666 | rcu_stutter_wait("rcu_torture_fakewriter"); |
647 | } while (!kthread_should_stop() && !fullstop); | 667 | } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); |
648 | 668 | ||
649 | VERBOSE_PRINTK_STRING("rcu_torture_fakewriter task stopping"); | 669 | VERBOSE_PRINTK_STRING("rcu_torture_fakewriter task stopping"); |
650 | while (!kthread_should_stop() && fullstop != FULLSTOP_SHUTDOWN) | 670 | rcutorture_shutdown_absorb("rcu_torture_fakewriter"); |
671 | while (!kthread_should_stop()) | ||
651 | schedule_timeout_uninterruptible(1); | 672 | schedule_timeout_uninterruptible(1); |
652 | return 0; | 673 | return 0; |
653 | } | 674 | } |
@@ -752,12 +773,13 @@ rcu_torture_reader(void *arg) | |||
752 | preempt_enable(); | 773 | preempt_enable(); |
753 | cur_ops->readunlock(idx); | 774 | cur_ops->readunlock(idx); |
754 | schedule(); | 775 | schedule(); |
755 | rcu_stutter_wait(); | 776 | rcu_stutter_wait("rcu_torture_reader"); |
756 | } while (!kthread_should_stop() && !fullstop); | 777 | } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); |
757 | VERBOSE_PRINTK_STRING("rcu_torture_reader task stopping"); | 778 | VERBOSE_PRINTK_STRING("rcu_torture_reader task stopping"); |
779 | rcutorture_shutdown_absorb("rcu_torture_reader"); | ||
758 | if (irqreader && cur_ops->irqcapable) | 780 | if (irqreader && cur_ops->irqcapable) |
759 | del_timer_sync(&t); | 781 | del_timer_sync(&t); |
760 | while (!kthread_should_stop() && fullstop != FULLSTOP_SHUTDOWN) | 782 | while (!kthread_should_stop()) |
761 | schedule_timeout_uninterruptible(1); | 783 | schedule_timeout_uninterruptible(1); |
762 | return 0; | 784 | return 0; |
763 | } | 785 | } |
@@ -854,7 +876,8 @@ rcu_torture_stats(void *arg) | |||
854 | do { | 876 | do { |
855 | schedule_timeout_interruptible(stat_interval * HZ); | 877 | schedule_timeout_interruptible(stat_interval * HZ); |
856 | rcu_torture_stats_print(); | 878 | rcu_torture_stats_print(); |
857 | } while (!kthread_should_stop() && !fullstop); | 879 | rcutorture_shutdown_absorb("rcu_torture_stats"); |
880 | } while (!kthread_should_stop()); | ||
858 | VERBOSE_PRINTK_STRING("rcu_torture_stats task stopping"); | 881 | VERBOSE_PRINTK_STRING("rcu_torture_stats task stopping"); |
859 | return 0; | 882 | return 0; |
860 | } | 883 | } |
@@ -866,52 +889,49 @@ static int rcu_idle_cpu; /* Force all torture tasks off this CPU */ | |||
866 | */ | 889 | */ |
867 | static void rcu_torture_shuffle_tasks(void) | 890 | static void rcu_torture_shuffle_tasks(void) |
868 | { | 891 | { |
869 | cpumask_var_t tmp_mask; | 892 | cpumask_t tmp_mask; |
870 | int i; | 893 | int i; |
871 | 894 | ||
872 | if (!alloc_cpumask_var(&tmp_mask, GFP_KERNEL)) | 895 | cpus_setall(tmp_mask); |
873 | BUG(); | ||
874 | |||
875 | cpumask_setall(tmp_mask); | ||
876 | get_online_cpus(); | 896 | get_online_cpus(); |
877 | 897 | ||
878 | /* No point in shuffling if there is only one online CPU (ex: UP) */ | 898 | /* No point in shuffling if there is only one online CPU (ex: UP) */ |
879 | if (num_online_cpus() == 1) | 899 | if (num_online_cpus() == 1) { |
880 | goto out; | 900 | put_online_cpus(); |
901 | return; | ||
902 | } | ||
881 | 903 | ||
882 | if (rcu_idle_cpu != -1) | 904 | if (rcu_idle_cpu != -1) |
883 | cpumask_clear_cpu(rcu_idle_cpu, tmp_mask); | 905 | cpu_clear(rcu_idle_cpu, tmp_mask); |
884 | 906 | ||
885 | set_cpus_allowed_ptr(current, tmp_mask); | 907 | set_cpus_allowed_ptr(current, &tmp_mask); |
886 | 908 | ||
887 | if (reader_tasks) { | 909 | if (reader_tasks) { |
888 | for (i = 0; i < nrealreaders; i++) | 910 | for (i = 0; i < nrealreaders; i++) |
889 | if (reader_tasks[i]) | 911 | if (reader_tasks[i]) |
890 | set_cpus_allowed_ptr(reader_tasks[i], | 912 | set_cpus_allowed_ptr(reader_tasks[i], |
891 | tmp_mask); | 913 | &tmp_mask); |
892 | } | 914 | } |
893 | 915 | ||
894 | if (fakewriter_tasks) { | 916 | if (fakewriter_tasks) { |
895 | for (i = 0; i < nfakewriters; i++) | 917 | for (i = 0; i < nfakewriters; i++) |
896 | if (fakewriter_tasks[i]) | 918 | if (fakewriter_tasks[i]) |
897 | set_cpus_allowed_ptr(fakewriter_tasks[i], | 919 | set_cpus_allowed_ptr(fakewriter_tasks[i], |
898 | tmp_mask); | 920 | &tmp_mask); |
899 | } | 921 | } |
900 | 922 | ||
901 | if (writer_task) | 923 | if (writer_task) |
902 | set_cpus_allowed_ptr(writer_task, tmp_mask); | 924 | set_cpus_allowed_ptr(writer_task, &tmp_mask); |
903 | 925 | ||
904 | if (stats_task) | 926 | if (stats_task) |
905 | set_cpus_allowed_ptr(stats_task, tmp_mask); | 927 | set_cpus_allowed_ptr(stats_task, &tmp_mask); |
906 | 928 | ||
907 | if (rcu_idle_cpu == -1) | 929 | if (rcu_idle_cpu == -1) |
908 | rcu_idle_cpu = num_online_cpus() - 1; | 930 | rcu_idle_cpu = num_online_cpus() - 1; |
909 | else | 931 | else |
910 | rcu_idle_cpu--; | 932 | rcu_idle_cpu--; |
911 | 933 | ||
912 | out: | ||
913 | put_online_cpus(); | 934 | put_online_cpus(); |
914 | free_cpumask_var(tmp_mask); | ||
915 | } | 935 | } |
916 | 936 | ||
917 | /* Shuffle tasks across CPUs, with the intent of allowing each CPU in the | 937 | /* Shuffle tasks across CPUs, with the intent of allowing each CPU in the |
@@ -925,7 +945,8 @@ rcu_torture_shuffle(void *arg) | |||
925 | do { | 945 | do { |
926 | schedule_timeout_interruptible(shuffle_interval * HZ); | 946 | schedule_timeout_interruptible(shuffle_interval * HZ); |
927 | rcu_torture_shuffle_tasks(); | 947 | rcu_torture_shuffle_tasks(); |
928 | } while (!kthread_should_stop() && !fullstop); | 948 | rcutorture_shutdown_absorb("rcu_torture_shuffle"); |
949 | } while (!kthread_should_stop()); | ||
929 | VERBOSE_PRINTK_STRING("rcu_torture_shuffle task stopping"); | 950 | VERBOSE_PRINTK_STRING("rcu_torture_shuffle task stopping"); |
930 | return 0; | 951 | return 0; |
931 | } | 952 | } |
@@ -940,10 +961,11 @@ rcu_torture_stutter(void *arg) | |||
940 | do { | 961 | do { |
941 | schedule_timeout_interruptible(stutter * HZ); | 962 | schedule_timeout_interruptible(stutter * HZ); |
942 | stutter_pause_test = 1; | 963 | stutter_pause_test = 1; |
943 | if (!kthread_should_stop() && !fullstop) | 964 | if (!kthread_should_stop()) |
944 | schedule_timeout_interruptible(stutter * HZ); | 965 | schedule_timeout_interruptible(stutter * HZ); |
945 | stutter_pause_test = 0; | 966 | stutter_pause_test = 0; |
946 | } while (!kthread_should_stop() && !fullstop); | 967 | rcutorture_shutdown_absorb("rcu_torture_stutter"); |
968 | } while (!kthread_should_stop()); | ||
947 | VERBOSE_PRINTK_STRING("rcu_torture_stutter task stopping"); | 969 | VERBOSE_PRINTK_STRING("rcu_torture_stutter task stopping"); |
948 | return 0; | 970 | return 0; |
949 | } | 971 | } |
@@ -970,15 +992,16 @@ rcu_torture_cleanup(void) | |||
970 | int i; | 992 | int i; |
971 | 993 | ||
972 | mutex_lock(&fullstop_mutex); | 994 | mutex_lock(&fullstop_mutex); |
973 | if (!fullstop) { | 995 | if (fullstop == FULLSTOP_SHUTDOWN) { |
974 | /* If being signaled, let it happen, then exit. */ | 996 | printk(KERN_WARNING /* but going down anyway, so... */ |
997 | "Concurrent 'rmmod rcutorture' and shutdown illegal!\n"); | ||
975 | mutex_unlock(&fullstop_mutex); | 998 | mutex_unlock(&fullstop_mutex); |
976 | schedule_timeout_interruptible(10 * HZ); | 999 | schedule_timeout_uninterruptible(10); |
977 | if (cur_ops->cb_barrier != NULL) | 1000 | if (cur_ops->cb_barrier != NULL) |
978 | cur_ops->cb_barrier(); | 1001 | cur_ops->cb_barrier(); |
979 | return; | 1002 | return; |
980 | } | 1003 | } |
981 | fullstop = FULLSTOP_CLEANUP; | 1004 | fullstop = FULLSTOP_RMMOD; |
982 | mutex_unlock(&fullstop_mutex); | 1005 | mutex_unlock(&fullstop_mutex); |
983 | unregister_reboot_notifier(&rcutorture_nb); | 1006 | unregister_reboot_notifier(&rcutorture_nb); |
984 | if (stutter_task) { | 1007 | if (stutter_task) { |
@@ -1078,7 +1101,7 @@ rcu_torture_init(void) | |||
1078 | else | 1101 | else |
1079 | nrealreaders = 2 * num_online_cpus(); | 1102 | nrealreaders = 2 * num_online_cpus(); |
1080 | rcu_torture_print_module_parms("Start of test"); | 1103 | rcu_torture_print_module_parms("Start of test"); |
1081 | fullstop = 0; | 1104 | fullstop = FULLSTOP_DONTSTOP; |
1082 | 1105 | ||
1083 | /* Set up the freelist. */ | 1106 | /* Set up the freelist. */ |
1084 | 1107 | ||
diff --git a/kernel/resource.c b/kernel/resource.c index ca6a1536b205..fd5d7d574bb9 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -620,6 +620,7 @@ resource_size_t resource_alignment(struct resource *res) | |||
620 | * @start: resource start address | 620 | * @start: resource start address |
621 | * @n: resource region size | 621 | * @n: resource region size |
622 | * @name: reserving caller's ID string | 622 | * @name: reserving caller's ID string |
623 | * @flags: IO resource flags | ||
623 | */ | 624 | */ |
624 | struct resource * __request_region(struct resource *parent, | 625 | struct resource * __request_region(struct resource *parent, |
625 | resource_size_t start, resource_size_t n, | 626 | resource_size_t start, resource_size_t n, |
diff --git a/kernel/sched.c b/kernel/sched.c index deb5ac8c12f3..52bbf1c842a8 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -125,6 +125,9 @@ DEFINE_TRACE(sched_switch); | |||
125 | DEFINE_TRACE(sched_migrate_task); | 125 | DEFINE_TRACE(sched_migrate_task); |
126 | 126 | ||
127 | #ifdef CONFIG_SMP | 127 | #ifdef CONFIG_SMP |
128 | |||
129 | static void double_rq_lock(struct rq *rq1, struct rq *rq2); | ||
130 | |||
128 | /* | 131 | /* |
129 | * Divide a load by a sched group cpu_power : (load / sg->__cpu_power) | 132 | * Divide a load by a sched group cpu_power : (load / sg->__cpu_power) |
130 | * Since cpu_power is a 'constant', we can use a reciprocal divide. | 133 | * Since cpu_power is a 'constant', we can use a reciprocal divide. |
@@ -1320,8 +1323,8 @@ static inline void update_load_sub(struct load_weight *lw, unsigned long dec) | |||
1320 | * slice expiry etc. | 1323 | * slice expiry etc. |
1321 | */ | 1324 | */ |
1322 | 1325 | ||
1323 | #define WEIGHT_IDLEPRIO 2 | 1326 | #define WEIGHT_IDLEPRIO 3 |
1324 | #define WMULT_IDLEPRIO (1 << 31) | 1327 | #define WMULT_IDLEPRIO 1431655765 |
1325 | 1328 | ||
1326 | /* | 1329 | /* |
1327 | * Nice levels are multiplicative, with a gentle 10% change for every | 1330 | * Nice levels are multiplicative, with a gentle 10% change for every |
@@ -4437,7 +4440,7 @@ void __kprobes sub_preempt_count(int val) | |||
4437 | /* | 4440 | /* |
4438 | * Underflow? | 4441 | * Underflow? |
4439 | */ | 4442 | */ |
4440 | if (DEBUG_LOCKS_WARN_ON(val > preempt_count() - (!!kernel_locked()))) | 4443 | if (DEBUG_LOCKS_WARN_ON(val > preempt_count())) |
4441 | return; | 4444 | return; |
4442 | /* | 4445 | /* |
4443 | * Is the spinlock portion underflowing? | 4446 | * Is the spinlock portion underflowing? |
@@ -5123,7 +5126,7 @@ int can_nice(const struct task_struct *p, const int nice) | |||
5123 | * sys_setpriority is a more generic, but much slower function that | 5126 | * sys_setpriority is a more generic, but much slower function that |
5124 | * does similar things. | 5127 | * does similar things. |
5125 | */ | 5128 | */ |
5126 | asmlinkage long sys_nice(int increment) | 5129 | SYSCALL_DEFINE1(nice, int, increment) |
5127 | { | 5130 | { |
5128 | long nice, retval; | 5131 | long nice, retval; |
5129 | 5132 | ||
@@ -5430,8 +5433,8 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) | |||
5430 | * @policy: new policy. | 5433 | * @policy: new policy. |
5431 | * @param: structure containing the new RT priority. | 5434 | * @param: structure containing the new RT priority. |
5432 | */ | 5435 | */ |
5433 | asmlinkage long | 5436 | SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy, |
5434 | sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) | 5437 | struct sched_param __user *, param) |
5435 | { | 5438 | { |
5436 | /* negative values for policy are not valid */ | 5439 | /* negative values for policy are not valid */ |
5437 | if (policy < 0) | 5440 | if (policy < 0) |
@@ -5445,7 +5448,7 @@ sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) | |||
5445 | * @pid: the pid in question. | 5448 | * @pid: the pid in question. |
5446 | * @param: structure containing the new RT priority. | 5449 | * @param: structure containing the new RT priority. |
5447 | */ | 5450 | */ |
5448 | asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param) | 5451 | SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param) |
5449 | { | 5452 | { |
5450 | return do_sched_setscheduler(pid, -1, param); | 5453 | return do_sched_setscheduler(pid, -1, param); |
5451 | } | 5454 | } |
@@ -5454,7 +5457,7 @@ asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param) | |||
5454 | * sys_sched_getscheduler - get the policy (scheduling class) of a thread | 5457 | * sys_sched_getscheduler - get the policy (scheduling class) of a thread |
5455 | * @pid: the pid in question. | 5458 | * @pid: the pid in question. |
5456 | */ | 5459 | */ |
5457 | asmlinkage long sys_sched_getscheduler(pid_t pid) | 5460 | SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) |
5458 | { | 5461 | { |
5459 | struct task_struct *p; | 5462 | struct task_struct *p; |
5460 | int retval; | 5463 | int retval; |
@@ -5479,7 +5482,7 @@ asmlinkage long sys_sched_getscheduler(pid_t pid) | |||
5479 | * @pid: the pid in question. | 5482 | * @pid: the pid in question. |
5480 | * @param: structure containing the RT priority. | 5483 | * @param: structure containing the RT priority. |
5481 | */ | 5484 | */ |
5482 | asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param __user *param) | 5485 | SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) |
5483 | { | 5486 | { |
5484 | struct sched_param lp; | 5487 | struct sched_param lp; |
5485 | struct task_struct *p; | 5488 | struct task_struct *p; |
@@ -5597,8 +5600,8 @@ static int get_user_cpu_mask(unsigned long __user *user_mask_ptr, unsigned len, | |||
5597 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr | 5600 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr |
5598 | * @user_mask_ptr: user-space pointer to the new cpu mask | 5601 | * @user_mask_ptr: user-space pointer to the new cpu mask |
5599 | */ | 5602 | */ |
5600 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, | 5603 | SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int, len, |
5601 | unsigned long __user *user_mask_ptr) | 5604 | unsigned long __user *, user_mask_ptr) |
5602 | { | 5605 | { |
5603 | cpumask_var_t new_mask; | 5606 | cpumask_var_t new_mask; |
5604 | int retval; | 5607 | int retval; |
@@ -5645,8 +5648,8 @@ out_unlock: | |||
5645 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr | 5648 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr |
5646 | * @user_mask_ptr: user-space pointer to hold the current cpu mask | 5649 | * @user_mask_ptr: user-space pointer to hold the current cpu mask |
5647 | */ | 5650 | */ |
5648 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, | 5651 | SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, |
5649 | unsigned long __user *user_mask_ptr) | 5652 | unsigned long __user *, user_mask_ptr) |
5650 | { | 5653 | { |
5651 | int ret; | 5654 | int ret; |
5652 | cpumask_var_t mask; | 5655 | cpumask_var_t mask; |
@@ -5675,7 +5678,7 @@ asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, | |||
5675 | * This function yields the current CPU to other tasks. If there are no | 5678 | * This function yields the current CPU to other tasks. If there are no |
5676 | * other threads running on this CPU then this function will return. | 5679 | * other threads running on this CPU then this function will return. |
5677 | */ | 5680 | */ |
5678 | asmlinkage long sys_sched_yield(void) | 5681 | SYSCALL_DEFINE0(sched_yield) |
5679 | { | 5682 | { |
5680 | struct rq *rq = this_rq_lock(); | 5683 | struct rq *rq = this_rq_lock(); |
5681 | 5684 | ||
@@ -5816,7 +5819,7 @@ long __sched io_schedule_timeout(long timeout) | |||
5816 | * this syscall returns the maximum rt_priority that can be used | 5819 | * this syscall returns the maximum rt_priority that can be used |
5817 | * by a given scheduling class. | 5820 | * by a given scheduling class. |
5818 | */ | 5821 | */ |
5819 | asmlinkage long sys_sched_get_priority_max(int policy) | 5822 | SYSCALL_DEFINE1(sched_get_priority_max, int, policy) |
5820 | { | 5823 | { |
5821 | int ret = -EINVAL; | 5824 | int ret = -EINVAL; |
5822 | 5825 | ||
@@ -5841,7 +5844,7 @@ asmlinkage long sys_sched_get_priority_max(int policy) | |||
5841 | * this syscall returns the minimum rt_priority that can be used | 5844 | * this syscall returns the minimum rt_priority that can be used |
5842 | * by a given scheduling class. | 5845 | * by a given scheduling class. |
5843 | */ | 5846 | */ |
5844 | asmlinkage long sys_sched_get_priority_min(int policy) | 5847 | SYSCALL_DEFINE1(sched_get_priority_min, int, policy) |
5845 | { | 5848 | { |
5846 | int ret = -EINVAL; | 5849 | int ret = -EINVAL; |
5847 | 5850 | ||
@@ -5866,8 +5869,8 @@ asmlinkage long sys_sched_get_priority_min(int policy) | |||
5866 | * this syscall writes the default timeslice value of a given process | 5869 | * this syscall writes the default timeslice value of a given process |
5867 | * into the user-space timespec buffer. A value of '0' means infinity. | 5870 | * into the user-space timespec buffer. A value of '0' means infinity. |
5868 | */ | 5871 | */ |
5869 | asmlinkage | 5872 | SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, |
5870 | long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval) | 5873 | struct timespec __user *, interval) |
5871 | { | 5874 | { |
5872 | struct task_struct *p; | 5875 | struct task_struct *p; |
5873 | unsigned int time_slice; | 5876 | unsigned int time_slice; |
@@ -7282,10 +7285,10 @@ cpu_to_phys_group(int cpu, const struct cpumask *cpu_map, | |||
7282 | * groups, so roll our own. Now each node has its own list of groups which | 7285 | * groups, so roll our own. Now each node has its own list of groups which |
7283 | * gets dynamically allocated. | 7286 | * gets dynamically allocated. |
7284 | */ | 7287 | */ |
7285 | static DEFINE_PER_CPU(struct sched_domain, node_domains); | 7288 | static DEFINE_PER_CPU(struct static_sched_domain, node_domains); |
7286 | static struct sched_group ***sched_group_nodes_bycpu; | 7289 | static struct sched_group ***sched_group_nodes_bycpu; |
7287 | 7290 | ||
7288 | static DEFINE_PER_CPU(struct sched_domain, allnodes_domains); | 7291 | static DEFINE_PER_CPU(struct static_sched_domain, allnodes_domains); |
7289 | static DEFINE_PER_CPU(struct static_sched_group, sched_group_allnodes); | 7292 | static DEFINE_PER_CPU(struct static_sched_group, sched_group_allnodes); |
7290 | 7293 | ||
7291 | static int cpu_to_allnodes_group(int cpu, const struct cpumask *cpu_map, | 7294 | static int cpu_to_allnodes_group(int cpu, const struct cpumask *cpu_map, |
@@ -7560,7 +7563,7 @@ static int __build_sched_domains(const struct cpumask *cpu_map, | |||
7560 | #ifdef CONFIG_NUMA | 7563 | #ifdef CONFIG_NUMA |
7561 | if (cpumask_weight(cpu_map) > | 7564 | if (cpumask_weight(cpu_map) > |
7562 | SD_NODES_PER_DOMAIN*cpumask_weight(nodemask)) { | 7565 | SD_NODES_PER_DOMAIN*cpumask_weight(nodemask)) { |
7563 | sd = &per_cpu(allnodes_domains, i); | 7566 | sd = &per_cpu(allnodes_domains, i).sd; |
7564 | SD_INIT(sd, ALLNODES); | 7567 | SD_INIT(sd, ALLNODES); |
7565 | set_domain_attribute(sd, attr); | 7568 | set_domain_attribute(sd, attr); |
7566 | cpumask_copy(sched_domain_span(sd), cpu_map); | 7569 | cpumask_copy(sched_domain_span(sd), cpu_map); |
@@ -7570,7 +7573,7 @@ static int __build_sched_domains(const struct cpumask *cpu_map, | |||
7570 | } else | 7573 | } else |
7571 | p = NULL; | 7574 | p = NULL; |
7572 | 7575 | ||
7573 | sd = &per_cpu(node_domains, i); | 7576 | sd = &per_cpu(node_domains, i).sd; |
7574 | SD_INIT(sd, NODE); | 7577 | SD_INIT(sd, NODE); |
7575 | set_domain_attribute(sd, attr); | 7578 | set_domain_attribute(sd, attr); |
7576 | sched_domain_node_span(cpu_to_node(i), sched_domain_span(sd)); | 7579 | sched_domain_node_span(cpu_to_node(i), sched_domain_span(sd)); |
@@ -7688,7 +7691,7 @@ static int __build_sched_domains(const struct cpumask *cpu_map, | |||
7688 | for_each_cpu(j, nodemask) { | 7691 | for_each_cpu(j, nodemask) { |
7689 | struct sched_domain *sd; | 7692 | struct sched_domain *sd; |
7690 | 7693 | ||
7691 | sd = &per_cpu(node_domains, j); | 7694 | sd = &per_cpu(node_domains, j).sd; |
7692 | sd->groups = sg; | 7695 | sd->groups = sg; |
7693 | } | 7696 | } |
7694 | sg->__cpu_power = 0; | 7697 | sg->__cpu_power = 0; |
@@ -9047,6 +9050,13 @@ static int tg_schedulable(struct task_group *tg, void *data) | |||
9047 | runtime = d->rt_runtime; | 9050 | runtime = d->rt_runtime; |
9048 | } | 9051 | } |
9049 | 9052 | ||
9053 | #ifdef CONFIG_USER_SCHED | ||
9054 | if (tg == &root_task_group) { | ||
9055 | period = global_rt_period(); | ||
9056 | runtime = global_rt_runtime(); | ||
9057 | } | ||
9058 | #endif | ||
9059 | |||
9050 | /* | 9060 | /* |
9051 | * Cannot have more runtime than the period. | 9061 | * Cannot have more runtime than the period. |
9052 | */ | 9062 | */ |
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index 4293cfa9681d..16eeba4e4169 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c | |||
@@ -145,6 +145,19 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu) | |||
145 | read_unlock_irqrestore(&tasklist_lock, flags); | 145 | read_unlock_irqrestore(&tasklist_lock, flags); |
146 | } | 146 | } |
147 | 147 | ||
148 | #if defined(CONFIG_CGROUP_SCHED) && \ | ||
149 | (defined(CONFIG_FAIR_GROUP_SCHED) || defined(CONFIG_RT_GROUP_SCHED)) | ||
150 | static void task_group_path(struct task_group *tg, char *buf, int buflen) | ||
151 | { | ||
152 | /* may be NULL if the underlying cgroup isn't fully-created yet */ | ||
153 | if (!tg->css.cgroup) { | ||
154 | buf[0] = '\0'; | ||
155 | return; | ||
156 | } | ||
157 | cgroup_path(tg->css.cgroup, buf, buflen); | ||
158 | } | ||
159 | #endif | ||
160 | |||
148 | void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | 161 | void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) |
149 | { | 162 | { |
150 | s64 MIN_vruntime = -1, min_vruntime, max_vruntime = -1, | 163 | s64 MIN_vruntime = -1, min_vruntime, max_vruntime = -1, |
@@ -154,10 +167,10 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
154 | unsigned long flags; | 167 | unsigned long flags; |
155 | 168 | ||
156 | #if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED) | 169 | #if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED) |
157 | char path[128] = ""; | 170 | char path[128]; |
158 | struct task_group *tg = cfs_rq->tg; | 171 | struct task_group *tg = cfs_rq->tg; |
159 | 172 | ||
160 | cgroup_path(tg->css.cgroup, path, sizeof(path)); | 173 | task_group_path(tg, path, sizeof(path)); |
161 | 174 | ||
162 | SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path); | 175 | SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path); |
163 | #elif defined(CONFIG_USER_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED) | 176 | #elif defined(CONFIG_USER_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED) |
@@ -208,10 +221,10 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
208 | void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq) | 221 | void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq) |
209 | { | 222 | { |
210 | #if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_RT_GROUP_SCHED) | 223 | #if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_RT_GROUP_SCHED) |
211 | char path[128] = ""; | 224 | char path[128]; |
212 | struct task_group *tg = rt_rq->tg; | 225 | struct task_group *tg = rt_rq->tg; |
213 | 226 | ||
214 | cgroup_path(tg->css.cgroup, path, sizeof(path)); | 227 | task_group_path(tg, path, sizeof(path)); |
215 | 228 | ||
216 | SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, path); | 229 | SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, path); |
217 | #else | 230 | #else |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 8e1352c75557..5cc1c162044f 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -283,7 +283,7 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq) | |||
283 | struct sched_entity, | 283 | struct sched_entity, |
284 | run_node); | 284 | run_node); |
285 | 285 | ||
286 | if (vruntime == cfs_rq->min_vruntime) | 286 | if (!cfs_rq->curr) |
287 | vruntime = se->vruntime; | 287 | vruntime = se->vruntime; |
288 | else | 288 | else |
289 | vruntime = min_vruntime(vruntime, se->vruntime); | 289 | vruntime = min_vruntime(vruntime, se->vruntime); |
@@ -429,7 +429,10 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
429 | u64 slice = __sched_period(cfs_rq->nr_running + !se->on_rq); | 429 | u64 slice = __sched_period(cfs_rq->nr_running + !se->on_rq); |
430 | 430 | ||
431 | for_each_sched_entity(se) { | 431 | for_each_sched_entity(se) { |
432 | struct load_weight *load = &cfs_rq->load; | 432 | struct load_weight *load; |
433 | |||
434 | cfs_rq = cfs_rq_of(se); | ||
435 | load = &cfs_rq->load; | ||
433 | 436 | ||
434 | if (unlikely(!se->on_rq)) { | 437 | if (unlikely(!se->on_rq)) { |
435 | struct load_weight lw = cfs_rq->load; | 438 | struct load_weight lw = cfs_rq->load; |
@@ -677,9 +680,13 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) | |||
677 | unsigned long thresh = sysctl_sched_latency; | 680 | unsigned long thresh = sysctl_sched_latency; |
678 | 681 | ||
679 | /* | 682 | /* |
680 | * convert the sleeper threshold into virtual time | 683 | * Convert the sleeper threshold into virtual time. |
684 | * SCHED_IDLE is a special sub-class. We care about | ||
685 | * fairness only relative to other SCHED_IDLE tasks, | ||
686 | * all of which have the same weight. | ||
681 | */ | 687 | */ |
682 | if (sched_feat(NORMALIZED_SLEEPER)) | 688 | if (sched_feat(NORMALIZED_SLEEPER) && |
689 | task_of(se)->policy != SCHED_IDLE) | ||
683 | thresh = calc_delta_fair(thresh, se); | 690 | thresh = calc_delta_fair(thresh, se); |
684 | 691 | ||
685 | vruntime -= thresh; | 692 | vruntime -= thresh; |
@@ -1340,14 +1347,18 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se) | |||
1340 | 1347 | ||
1341 | static void set_last_buddy(struct sched_entity *se) | 1348 | static void set_last_buddy(struct sched_entity *se) |
1342 | { | 1349 | { |
1343 | for_each_sched_entity(se) | 1350 | if (likely(task_of(se)->policy != SCHED_IDLE)) { |
1344 | cfs_rq_of(se)->last = se; | 1351 | for_each_sched_entity(se) |
1352 | cfs_rq_of(se)->last = se; | ||
1353 | } | ||
1345 | } | 1354 | } |
1346 | 1355 | ||
1347 | static void set_next_buddy(struct sched_entity *se) | 1356 | static void set_next_buddy(struct sched_entity *se) |
1348 | { | 1357 | { |
1349 | for_each_sched_entity(se) | 1358 | if (likely(task_of(se)->policy != SCHED_IDLE)) { |
1350 | cfs_rq_of(se)->next = se; | 1359 | for_each_sched_entity(se) |
1360 | cfs_rq_of(se)->next = se; | ||
1361 | } | ||
1351 | } | 1362 | } |
1352 | 1363 | ||
1353 | /* | 1364 | /* |
@@ -1393,12 +1404,18 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync) | |||
1393 | return; | 1404 | return; |
1394 | 1405 | ||
1395 | /* | 1406 | /* |
1396 | * Batch tasks do not preempt (their preemption is driven by | 1407 | * Batch and idle tasks do not preempt (their preemption is driven by |
1397 | * the tick): | 1408 | * the tick): |
1398 | */ | 1409 | */ |
1399 | if (unlikely(p->policy == SCHED_BATCH)) | 1410 | if (unlikely(p->policy != SCHED_NORMAL)) |
1400 | return; | 1411 | return; |
1401 | 1412 | ||
1413 | /* Idle tasks are by definition preempted by everybody. */ | ||
1414 | if (unlikely(curr->policy == SCHED_IDLE)) { | ||
1415 | resched_task(curr); | ||
1416 | return; | ||
1417 | } | ||
1418 | |||
1402 | if (!sched_feat(WAKEUP_PREEMPT)) | 1419 | if (!sched_feat(WAKEUP_PREEMPT)) |
1403 | return; | 1420 | return; |
1404 | 1421 | ||
diff --git a/kernel/signal.c b/kernel/signal.c index 3152ac3b62e2..e73759783dc8 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1961,7 +1961,7 @@ EXPORT_SYMBOL(unblock_all_signals); | |||
1961 | * System call entry points. | 1961 | * System call entry points. |
1962 | */ | 1962 | */ |
1963 | 1963 | ||
1964 | asmlinkage long sys_restart_syscall(void) | 1964 | SYSCALL_DEFINE0(restart_syscall) |
1965 | { | 1965 | { |
1966 | struct restart_block *restart = ¤t_thread_info()->restart_block; | 1966 | struct restart_block *restart = ¤t_thread_info()->restart_block; |
1967 | return restart->fn(restart); | 1967 | return restart->fn(restart); |
@@ -2014,8 +2014,8 @@ int sigprocmask(int how, sigset_t *set, sigset_t *oldset) | |||
2014 | return error; | 2014 | return error; |
2015 | } | 2015 | } |
2016 | 2016 | ||
2017 | asmlinkage long | 2017 | SYSCALL_DEFINE4(rt_sigprocmask, int, how, sigset_t __user *, set, |
2018 | sys_rt_sigprocmask(int how, sigset_t __user *set, sigset_t __user *oset, size_t sigsetsize) | 2018 | sigset_t __user *, oset, size_t, sigsetsize) |
2019 | { | 2019 | { |
2020 | int error = -EINVAL; | 2020 | int error = -EINVAL; |
2021 | sigset_t old_set, new_set; | 2021 | sigset_t old_set, new_set; |
@@ -2074,8 +2074,7 @@ out: | |||
2074 | return error; | 2074 | return error; |
2075 | } | 2075 | } |
2076 | 2076 | ||
2077 | asmlinkage long | 2077 | SYSCALL_DEFINE2(rt_sigpending, sigset_t __user *, set, size_t, sigsetsize) |
2078 | sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize) | ||
2079 | { | 2078 | { |
2080 | return do_sigpending(set, sigsetsize); | 2079 | return do_sigpending(set, sigsetsize); |
2081 | } | 2080 | } |
@@ -2146,11 +2145,9 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) | |||
2146 | 2145 | ||
2147 | #endif | 2146 | #endif |
2148 | 2147 | ||
2149 | asmlinkage long | 2148 | SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, |
2150 | sys_rt_sigtimedwait(const sigset_t __user *uthese, | 2149 | siginfo_t __user *, uinfo, const struct timespec __user *, uts, |
2151 | siginfo_t __user *uinfo, | 2150 | size_t, sigsetsize) |
2152 | const struct timespec __user *uts, | ||
2153 | size_t sigsetsize) | ||
2154 | { | 2151 | { |
2155 | int ret, sig; | 2152 | int ret, sig; |
2156 | sigset_t these; | 2153 | sigset_t these; |
@@ -2223,8 +2220,7 @@ sys_rt_sigtimedwait(const sigset_t __user *uthese, | |||
2223 | return ret; | 2220 | return ret; |
2224 | } | 2221 | } |
2225 | 2222 | ||
2226 | asmlinkage long | 2223 | SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
2227 | sys_kill(pid_t pid, int sig) | ||
2228 | { | 2224 | { |
2229 | struct siginfo info; | 2225 | struct siginfo info; |
2230 | 2226 | ||
@@ -2283,7 +2279,7 @@ static int do_tkill(pid_t tgid, pid_t pid, int sig) | |||
2283 | * exists but it's not belonging to the target process anymore. This | 2279 | * exists but it's not belonging to the target process anymore. This |
2284 | * method solves the problem of threads exiting and PIDs getting reused. | 2280 | * method solves the problem of threads exiting and PIDs getting reused. |
2285 | */ | 2281 | */ |
2286 | asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig) | 2282 | SYSCALL_DEFINE3(tgkill, pid_t, tgid, pid_t, pid, int, sig) |
2287 | { | 2283 | { |
2288 | /* This is only valid for single tasks */ | 2284 | /* This is only valid for single tasks */ |
2289 | if (pid <= 0 || tgid <= 0) | 2285 | if (pid <= 0 || tgid <= 0) |
@@ -2295,8 +2291,7 @@ asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig) | |||
2295 | /* | 2291 | /* |
2296 | * Send a signal to only one task, even if it's a CLONE_THREAD task. | 2292 | * Send a signal to only one task, even if it's a CLONE_THREAD task. |
2297 | */ | 2293 | */ |
2298 | asmlinkage long | 2294 | SYSCALL_DEFINE2(tkill, pid_t, pid, int, sig) |
2299 | sys_tkill(pid_t pid, int sig) | ||
2300 | { | 2295 | { |
2301 | /* This is only valid for single tasks */ | 2296 | /* This is only valid for single tasks */ |
2302 | if (pid <= 0) | 2297 | if (pid <= 0) |
@@ -2305,8 +2300,8 @@ sys_tkill(pid_t pid, int sig) | |||
2305 | return do_tkill(0, pid, sig); | 2300 | return do_tkill(0, pid, sig); |
2306 | } | 2301 | } |
2307 | 2302 | ||
2308 | asmlinkage long | 2303 | SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, pid, int, sig, |
2309 | sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo) | 2304 | siginfo_t __user *, uinfo) |
2310 | { | 2305 | { |
2311 | siginfo_t info; | 2306 | siginfo_t info; |
2312 | 2307 | ||
@@ -2434,8 +2429,7 @@ out: | |||
2434 | 2429 | ||
2435 | #ifdef __ARCH_WANT_SYS_SIGPENDING | 2430 | #ifdef __ARCH_WANT_SYS_SIGPENDING |
2436 | 2431 | ||
2437 | asmlinkage long | 2432 | SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set) |
2438 | sys_sigpending(old_sigset_t __user *set) | ||
2439 | { | 2433 | { |
2440 | return do_sigpending(set, sizeof(*set)); | 2434 | return do_sigpending(set, sizeof(*set)); |
2441 | } | 2435 | } |
@@ -2446,8 +2440,8 @@ sys_sigpending(old_sigset_t __user *set) | |||
2446 | /* Some platforms have their own version with special arguments others | 2440 | /* Some platforms have their own version with special arguments others |
2447 | support only sys_rt_sigprocmask. */ | 2441 | support only sys_rt_sigprocmask. */ |
2448 | 2442 | ||
2449 | asmlinkage long | 2443 | SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set, |
2450 | sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset) | 2444 | old_sigset_t __user *, oset) |
2451 | { | 2445 | { |
2452 | int error; | 2446 | int error; |
2453 | old_sigset_t old_set, new_set; | 2447 | old_sigset_t old_set, new_set; |
@@ -2497,11 +2491,10 @@ out: | |||
2497 | #endif /* __ARCH_WANT_SYS_SIGPROCMASK */ | 2491 | #endif /* __ARCH_WANT_SYS_SIGPROCMASK */ |
2498 | 2492 | ||
2499 | #ifdef __ARCH_WANT_SYS_RT_SIGACTION | 2493 | #ifdef __ARCH_WANT_SYS_RT_SIGACTION |
2500 | asmlinkage long | 2494 | SYSCALL_DEFINE4(rt_sigaction, int, sig, |
2501 | sys_rt_sigaction(int sig, | 2495 | const struct sigaction __user *, act, |
2502 | const struct sigaction __user *act, | 2496 | struct sigaction __user *, oact, |
2503 | struct sigaction __user *oact, | 2497 | size_t, sigsetsize) |
2504 | size_t sigsetsize) | ||
2505 | { | 2498 | { |
2506 | struct k_sigaction new_sa, old_sa; | 2499 | struct k_sigaction new_sa, old_sa; |
2507 | int ret = -EINVAL; | 2500 | int ret = -EINVAL; |
@@ -2531,15 +2524,13 @@ out: | |||
2531 | /* | 2524 | /* |
2532 | * For backwards compatibility. Functionality superseded by sigprocmask. | 2525 | * For backwards compatibility. Functionality superseded by sigprocmask. |
2533 | */ | 2526 | */ |
2534 | asmlinkage long | 2527 | SYSCALL_DEFINE0(sgetmask) |
2535 | sys_sgetmask(void) | ||
2536 | { | 2528 | { |
2537 | /* SMP safe */ | 2529 | /* SMP safe */ |
2538 | return current->blocked.sig[0]; | 2530 | return current->blocked.sig[0]; |
2539 | } | 2531 | } |
2540 | 2532 | ||
2541 | asmlinkage long | 2533 | SYSCALL_DEFINE1(ssetmask, int, newmask) |
2542 | sys_ssetmask(int newmask) | ||
2543 | { | 2534 | { |
2544 | int old; | 2535 | int old; |
2545 | 2536 | ||
@@ -2559,8 +2550,7 @@ sys_ssetmask(int newmask) | |||
2559 | /* | 2550 | /* |
2560 | * For backwards compatibility. Functionality superseded by sigaction. | 2551 | * For backwards compatibility. Functionality superseded by sigaction. |
2561 | */ | 2552 | */ |
2562 | asmlinkage unsigned long | 2553 | SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) |
2563 | sys_signal(int sig, __sighandler_t handler) | ||
2564 | { | 2554 | { |
2565 | struct k_sigaction new_sa, old_sa; | 2555 | struct k_sigaction new_sa, old_sa; |
2566 | int ret; | 2556 | int ret; |
@@ -2577,8 +2567,7 @@ sys_signal(int sig, __sighandler_t handler) | |||
2577 | 2567 | ||
2578 | #ifdef __ARCH_WANT_SYS_PAUSE | 2568 | #ifdef __ARCH_WANT_SYS_PAUSE |
2579 | 2569 | ||
2580 | asmlinkage long | 2570 | SYSCALL_DEFINE0(pause) |
2581 | sys_pause(void) | ||
2582 | { | 2571 | { |
2583 | current->state = TASK_INTERRUPTIBLE; | 2572 | current->state = TASK_INTERRUPTIBLE; |
2584 | schedule(); | 2573 | schedule(); |
@@ -2588,7 +2577,7 @@ sys_pause(void) | |||
2588 | #endif | 2577 | #endif |
2589 | 2578 | ||
2590 | #ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND | 2579 | #ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND |
2591 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) | 2580 | SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize) |
2592 | { | 2581 | { |
2593 | sigset_t newset; | 2582 | sigset_t newset; |
2594 | 2583 | ||
diff --git a/kernel/sys.c b/kernel/sys.c index 763c3c17ded3..e7dc0e10a485 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -143,7 +143,7 @@ out: | |||
143 | return error; | 143 | return error; |
144 | } | 144 | } |
145 | 145 | ||
146 | asmlinkage long sys_setpriority(int which, int who, int niceval) | 146 | SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval) |
147 | { | 147 | { |
148 | struct task_struct *g, *p; | 148 | struct task_struct *g, *p; |
149 | struct user_struct *user; | 149 | struct user_struct *user; |
@@ -208,7 +208,7 @@ out: | |||
208 | * has been offset by 20 (ie it returns 40..1 instead of -20..19) | 208 | * has been offset by 20 (ie it returns 40..1 instead of -20..19) |
209 | * to stay compatible. | 209 | * to stay compatible. |
210 | */ | 210 | */ |
211 | asmlinkage long sys_getpriority(int which, int who) | 211 | SYSCALL_DEFINE2(getpriority, int, which, int, who) |
212 | { | 212 | { |
213 | struct task_struct *g, *p; | 213 | struct task_struct *g, *p; |
214 | struct user_struct *user; | 214 | struct user_struct *user; |
@@ -355,7 +355,8 @@ EXPORT_SYMBOL_GPL(kernel_power_off); | |||
355 | * | 355 | * |
356 | * reboot doesn't sync: do that yourself before calling this. | 356 | * reboot doesn't sync: do that yourself before calling this. |
357 | */ | 357 | */ |
358 | asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user * arg) | 358 | SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, |
359 | void __user *, arg) | ||
359 | { | 360 | { |
360 | char buffer[256]; | 361 | char buffer[256]; |
361 | 362 | ||
@@ -478,7 +479,7 @@ void ctrl_alt_del(void) | |||
478 | * SMP: There are not races, the GIDs are checked only by filesystem | 479 | * SMP: There are not races, the GIDs are checked only by filesystem |
479 | * operations (as far as semantic preservation is concerned). | 480 | * operations (as far as semantic preservation is concerned). |
480 | */ | 481 | */ |
481 | asmlinkage long sys_setregid(gid_t rgid, gid_t egid) | 482 | SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid) |
482 | { | 483 | { |
483 | const struct cred *old; | 484 | const struct cred *old; |
484 | struct cred *new; | 485 | struct cred *new; |
@@ -529,7 +530,7 @@ error: | |||
529 | * | 530 | * |
530 | * SMP: Same implicit races as above. | 531 | * SMP: Same implicit races as above. |
531 | */ | 532 | */ |
532 | asmlinkage long sys_setgid(gid_t gid) | 533 | SYSCALL_DEFINE1(setgid, gid_t, gid) |
533 | { | 534 | { |
534 | const struct cred *old; | 535 | const struct cred *old; |
535 | struct cred *new; | 536 | struct cred *new; |
@@ -597,7 +598,7 @@ static int set_user(struct cred *new) | |||
597 | * 100% compatible with BSD. A program which uses just setuid() will be | 598 | * 100% compatible with BSD. A program which uses just setuid() will be |
598 | * 100% compatible with POSIX with saved IDs. | 599 | * 100% compatible with POSIX with saved IDs. |
599 | */ | 600 | */ |
600 | asmlinkage long sys_setreuid(uid_t ruid, uid_t euid) | 601 | SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid) |
601 | { | 602 | { |
602 | const struct cred *old; | 603 | const struct cred *old; |
603 | struct cred *new; | 604 | struct cred *new; |
@@ -661,7 +662,7 @@ error: | |||
661 | * will allow a root program to temporarily drop privileges and be able to | 662 | * will allow a root program to temporarily drop privileges and be able to |
662 | * regain them by swapping the real and effective uid. | 663 | * regain them by swapping the real and effective uid. |
663 | */ | 664 | */ |
664 | asmlinkage long sys_setuid(uid_t uid) | 665 | SYSCALL_DEFINE1(setuid, uid_t, uid) |
665 | { | 666 | { |
666 | const struct cred *old; | 667 | const struct cred *old; |
667 | struct cred *new; | 668 | struct cred *new; |
@@ -705,7 +706,7 @@ error: | |||
705 | * This function implements a generic ability to update ruid, euid, | 706 | * This function implements a generic ability to update ruid, euid, |
706 | * and suid. This allows you to implement the 4.4 compatible seteuid(). | 707 | * and suid. This allows you to implement the 4.4 compatible seteuid(). |
707 | */ | 708 | */ |
708 | asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) | 709 | SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) |
709 | { | 710 | { |
710 | const struct cred *old; | 711 | const struct cred *old; |
711 | struct cred *new; | 712 | struct cred *new; |
@@ -756,7 +757,7 @@ error: | |||
756 | return retval; | 757 | return retval; |
757 | } | 758 | } |
758 | 759 | ||
759 | asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid) | 760 | SYSCALL_DEFINE3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid) |
760 | { | 761 | { |
761 | const struct cred *cred = current_cred(); | 762 | const struct cred *cred = current_cred(); |
762 | int retval; | 763 | int retval; |
@@ -771,7 +772,7 @@ asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __us | |||
771 | /* | 772 | /* |
772 | * Same as above, but for rgid, egid, sgid. | 773 | * Same as above, but for rgid, egid, sgid. |
773 | */ | 774 | */ |
774 | asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) | 775 | SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) |
775 | { | 776 | { |
776 | const struct cred *old; | 777 | const struct cred *old; |
777 | struct cred *new; | 778 | struct cred *new; |
@@ -814,7 +815,7 @@ error: | |||
814 | return retval; | 815 | return retval; |
815 | } | 816 | } |
816 | 817 | ||
817 | asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid) | 818 | SYSCALL_DEFINE3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid) |
818 | { | 819 | { |
819 | const struct cred *cred = current_cred(); | 820 | const struct cred *cred = current_cred(); |
820 | int retval; | 821 | int retval; |
@@ -833,7 +834,7 @@ asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __us | |||
833 | * whatever uid it wants to). It normally shadows "euid", except when | 834 | * whatever uid it wants to). It normally shadows "euid", except when |
834 | * explicitly set by setfsuid() or for access.. | 835 | * explicitly set by setfsuid() or for access.. |
835 | */ | 836 | */ |
836 | asmlinkage long sys_setfsuid(uid_t uid) | 837 | SYSCALL_DEFINE1(setfsuid, uid_t, uid) |
837 | { | 838 | { |
838 | const struct cred *old; | 839 | const struct cred *old; |
839 | struct cred *new; | 840 | struct cred *new; |
@@ -870,7 +871,7 @@ change_okay: | |||
870 | /* | 871 | /* |
871 | * Samma på svenska.. | 872 | * Samma på svenska.. |
872 | */ | 873 | */ |
873 | asmlinkage long sys_setfsgid(gid_t gid) | 874 | SYSCALL_DEFINE1(setfsgid, gid_t, gid) |
874 | { | 875 | { |
875 | const struct cred *old; | 876 | const struct cred *old; |
876 | struct cred *new; | 877 | struct cred *new; |
@@ -919,7 +920,7 @@ void do_sys_times(struct tms *tms) | |||
919 | tms->tms_cstime = cputime_to_clock_t(cstime); | 920 | tms->tms_cstime = cputime_to_clock_t(cstime); |
920 | } | 921 | } |
921 | 922 | ||
922 | asmlinkage long sys_times(struct tms __user * tbuf) | 923 | SYSCALL_DEFINE1(times, struct tms __user *, tbuf) |
923 | { | 924 | { |
924 | if (tbuf) { | 925 | if (tbuf) { |
925 | struct tms tmp; | 926 | struct tms tmp; |
@@ -944,7 +945,7 @@ asmlinkage long sys_times(struct tms __user * tbuf) | |||
944 | * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. | 945 | * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. |
945 | * LBT 04.03.94 | 946 | * LBT 04.03.94 |
946 | */ | 947 | */ |
947 | asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) | 948 | SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid) |
948 | { | 949 | { |
949 | struct task_struct *p; | 950 | struct task_struct *p; |
950 | struct task_struct *group_leader = current->group_leader; | 951 | struct task_struct *group_leader = current->group_leader; |
@@ -1015,7 +1016,7 @@ out: | |||
1015 | return err; | 1016 | return err; |
1016 | } | 1017 | } |
1017 | 1018 | ||
1018 | asmlinkage long sys_getpgid(pid_t pid) | 1019 | SYSCALL_DEFINE1(getpgid, pid_t, pid) |
1019 | { | 1020 | { |
1020 | struct task_struct *p; | 1021 | struct task_struct *p; |
1021 | struct pid *grp; | 1022 | struct pid *grp; |
@@ -1045,14 +1046,14 @@ out: | |||
1045 | 1046 | ||
1046 | #ifdef __ARCH_WANT_SYS_GETPGRP | 1047 | #ifdef __ARCH_WANT_SYS_GETPGRP |
1047 | 1048 | ||
1048 | asmlinkage long sys_getpgrp(void) | 1049 | SYSCALL_DEFINE0(getpgrp) |
1049 | { | 1050 | { |
1050 | return sys_getpgid(0); | 1051 | return sys_getpgid(0); |
1051 | } | 1052 | } |
1052 | 1053 | ||
1053 | #endif | 1054 | #endif |
1054 | 1055 | ||
1055 | asmlinkage long sys_getsid(pid_t pid) | 1056 | SYSCALL_DEFINE1(getsid, pid_t, pid) |
1056 | { | 1057 | { |
1057 | struct task_struct *p; | 1058 | struct task_struct *p; |
1058 | struct pid *sid; | 1059 | struct pid *sid; |
@@ -1080,7 +1081,7 @@ out: | |||
1080 | return retval; | 1081 | return retval; |
1081 | } | 1082 | } |
1082 | 1083 | ||
1083 | asmlinkage long sys_setsid(void) | 1084 | SYSCALL_DEFINE0(setsid) |
1084 | { | 1085 | { |
1085 | struct task_struct *group_leader = current->group_leader; | 1086 | struct task_struct *group_leader = current->group_leader; |
1086 | struct pid *sid = task_pid(group_leader); | 1087 | struct pid *sid = task_pid(group_leader); |
@@ -1311,7 +1312,7 @@ int set_current_groups(struct group_info *group_info) | |||
1311 | 1312 | ||
1312 | EXPORT_SYMBOL(set_current_groups); | 1313 | EXPORT_SYMBOL(set_current_groups); |
1313 | 1314 | ||
1314 | asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist) | 1315 | SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist) |
1315 | { | 1316 | { |
1316 | const struct cred *cred = current_cred(); | 1317 | const struct cred *cred = current_cred(); |
1317 | int i; | 1318 | int i; |
@@ -1340,7 +1341,7 @@ out: | |||
1340 | * without another task interfering. | 1341 | * without another task interfering. |
1341 | */ | 1342 | */ |
1342 | 1343 | ||
1343 | asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist) | 1344 | SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist) |
1344 | { | 1345 | { |
1345 | struct group_info *group_info; | 1346 | struct group_info *group_info; |
1346 | int retval; | 1347 | int retval; |
@@ -1394,7 +1395,7 @@ EXPORT_SYMBOL(in_egroup_p); | |||
1394 | 1395 | ||
1395 | DECLARE_RWSEM(uts_sem); | 1396 | DECLARE_RWSEM(uts_sem); |
1396 | 1397 | ||
1397 | asmlinkage long sys_newuname(struct new_utsname __user * name) | 1398 | SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) |
1398 | { | 1399 | { |
1399 | int errno = 0; | 1400 | int errno = 0; |
1400 | 1401 | ||
@@ -1405,7 +1406,7 @@ asmlinkage long sys_newuname(struct new_utsname __user * name) | |||
1405 | return errno; | 1406 | return errno; |
1406 | } | 1407 | } |
1407 | 1408 | ||
1408 | asmlinkage long sys_sethostname(char __user *name, int len) | 1409 | SYSCALL_DEFINE2(sethostname, char __user *, name, int, len) |
1409 | { | 1410 | { |
1410 | int errno; | 1411 | int errno; |
1411 | char tmp[__NEW_UTS_LEN]; | 1412 | char tmp[__NEW_UTS_LEN]; |
@@ -1429,7 +1430,7 @@ asmlinkage long sys_sethostname(char __user *name, int len) | |||
1429 | 1430 | ||
1430 | #ifdef __ARCH_WANT_SYS_GETHOSTNAME | 1431 | #ifdef __ARCH_WANT_SYS_GETHOSTNAME |
1431 | 1432 | ||
1432 | asmlinkage long sys_gethostname(char __user *name, int len) | 1433 | SYSCALL_DEFINE2(gethostname, char __user *, name, int, len) |
1433 | { | 1434 | { |
1434 | int i, errno; | 1435 | int i, errno; |
1435 | struct new_utsname *u; | 1436 | struct new_utsname *u; |
@@ -1454,7 +1455,7 @@ asmlinkage long sys_gethostname(char __user *name, int len) | |||
1454 | * Only setdomainname; getdomainname can be implemented by calling | 1455 | * Only setdomainname; getdomainname can be implemented by calling |
1455 | * uname() | 1456 | * uname() |
1456 | */ | 1457 | */ |
1457 | asmlinkage long sys_setdomainname(char __user *name, int len) | 1458 | SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len) |
1458 | { | 1459 | { |
1459 | int errno; | 1460 | int errno; |
1460 | char tmp[__NEW_UTS_LEN]; | 1461 | char tmp[__NEW_UTS_LEN]; |
@@ -1477,7 +1478,7 @@ asmlinkage long sys_setdomainname(char __user *name, int len) | |||
1477 | return errno; | 1478 | return errno; |
1478 | } | 1479 | } |
1479 | 1480 | ||
1480 | asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim) | 1481 | SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim) |
1481 | { | 1482 | { |
1482 | if (resource >= RLIM_NLIMITS) | 1483 | if (resource >= RLIM_NLIMITS) |
1483 | return -EINVAL; | 1484 | return -EINVAL; |
@@ -1496,7 +1497,8 @@ asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim) | |||
1496 | * Back compatibility for getrlimit. Needed for some apps. | 1497 | * Back compatibility for getrlimit. Needed for some apps. |
1497 | */ | 1498 | */ |
1498 | 1499 | ||
1499 | asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim) | 1500 | SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource, |
1501 | struct rlimit __user *, rlim) | ||
1500 | { | 1502 | { |
1501 | struct rlimit x; | 1503 | struct rlimit x; |
1502 | if (resource >= RLIM_NLIMITS) | 1504 | if (resource >= RLIM_NLIMITS) |
@@ -1514,7 +1516,7 @@ asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *r | |||
1514 | 1516 | ||
1515 | #endif | 1517 | #endif |
1516 | 1518 | ||
1517 | asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim) | 1519 | SYSCALL_DEFINE2(setrlimit, unsigned int, resource, struct rlimit __user *, rlim) |
1518 | { | 1520 | { |
1519 | struct rlimit new_rlim, *old_rlim; | 1521 | struct rlimit new_rlim, *old_rlim; |
1520 | int retval; | 1522 | int retval; |
@@ -1687,7 +1689,7 @@ int getrusage(struct task_struct *p, int who, struct rusage __user *ru) | |||
1687 | return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; | 1689 | return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; |
1688 | } | 1690 | } |
1689 | 1691 | ||
1690 | asmlinkage long sys_getrusage(int who, struct rusage __user *ru) | 1692 | SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru) |
1691 | { | 1693 | { |
1692 | if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN && | 1694 | if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN && |
1693 | who != RUSAGE_THREAD) | 1695 | who != RUSAGE_THREAD) |
@@ -1695,14 +1697,14 @@ asmlinkage long sys_getrusage(int who, struct rusage __user *ru) | |||
1695 | return getrusage(current, who, ru); | 1697 | return getrusage(current, who, ru); |
1696 | } | 1698 | } |
1697 | 1699 | ||
1698 | asmlinkage long sys_umask(int mask) | 1700 | SYSCALL_DEFINE1(umask, int, mask) |
1699 | { | 1701 | { |
1700 | mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); | 1702 | mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); |
1701 | return mask; | 1703 | return mask; |
1702 | } | 1704 | } |
1703 | 1705 | ||
1704 | asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | 1706 | SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, |
1705 | unsigned long arg4, unsigned long arg5) | 1707 | unsigned long, arg4, unsigned long, arg5) |
1706 | { | 1708 | { |
1707 | struct task_struct *me = current; | 1709 | struct task_struct *me = current; |
1708 | unsigned char comm[sizeof(me->comm)]; | 1710 | unsigned char comm[sizeof(me->comm)]; |
@@ -1815,8 +1817,8 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
1815 | return error; | 1817 | return error; |
1816 | } | 1818 | } |
1817 | 1819 | ||
1818 | asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep, | 1820 | SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep, |
1819 | struct getcpu_cache __user *unused) | 1821 | struct getcpu_cache __user *, unused) |
1820 | { | 1822 | { |
1821 | int err = 0; | 1823 | int err = 0; |
1822 | int cpu = raw_smp_processor_id(); | 1824 | int cpu = raw_smp_processor_id(); |
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index e14a23281707..27dad2967387 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
@@ -131,6 +131,7 @@ cond_syscall(sys_io_destroy); | |||
131 | cond_syscall(sys_io_submit); | 131 | cond_syscall(sys_io_submit); |
132 | cond_syscall(sys_io_cancel); | 132 | cond_syscall(sys_io_cancel); |
133 | cond_syscall(sys_io_getevents); | 133 | cond_syscall(sys_io_getevents); |
134 | cond_syscall(sys_syslog); | ||
134 | 135 | ||
135 | /* arch-specific weak syscall entries */ | 136 | /* arch-specific weak syscall entries */ |
136 | cond_syscall(sys_pciconfig_read); | 137 | cond_syscall(sys_pciconfig_read); |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 89d74436318c..368d1638ee78 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -144,6 +144,7 @@ extern int acct_parm[]; | |||
144 | 144 | ||
145 | #ifdef CONFIG_IA64 | 145 | #ifdef CONFIG_IA64 |
146 | extern int no_unaligned_warning; | 146 | extern int no_unaligned_warning; |
147 | extern int unaligned_dump_stack; | ||
147 | #endif | 148 | #endif |
148 | 149 | ||
149 | #ifdef CONFIG_RT_MUTEXES | 150 | #ifdef CONFIG_RT_MUTEXES |
@@ -781,6 +782,14 @@ static struct ctl_table kern_table[] = { | |||
781 | .mode = 0644, | 782 | .mode = 0644, |
782 | .proc_handler = &proc_dointvec, | 783 | .proc_handler = &proc_dointvec, |
783 | }, | 784 | }, |
785 | { | ||
786 | .ctl_name = CTL_UNNUMBERED, | ||
787 | .procname = "unaligned-dump-stack", | ||
788 | .data = &unaligned_dump_stack, | ||
789 | .maxlen = sizeof (int), | ||
790 | .mode = 0644, | ||
791 | .proc_handler = &proc_dointvec, | ||
792 | }, | ||
784 | #endif | 793 | #endif |
785 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 794 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
786 | { | 795 | { |
@@ -1688,7 +1697,7 @@ int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *ol | |||
1688 | return error; | 1697 | return error; |
1689 | } | 1698 | } |
1690 | 1699 | ||
1691 | asmlinkage long sys_sysctl(struct __sysctl_args __user *args) | 1700 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) |
1692 | { | 1701 | { |
1693 | struct __sysctl_args tmp; | 1702 | struct __sysctl_args tmp; |
1694 | int error; | 1703 | int error; |
@@ -2989,7 +2998,7 @@ int sysctl_ms_jiffies(struct ctl_table *table, | |||
2989 | #else /* CONFIG_SYSCTL_SYSCALL */ | 2998 | #else /* CONFIG_SYSCTL_SYSCALL */ |
2990 | 2999 | ||
2991 | 3000 | ||
2992 | asmlinkage long sys_sysctl(struct __sysctl_args __user *args) | 3001 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) |
2993 | { | 3002 | { |
2994 | struct __sysctl_args tmp; | 3003 | struct __sysctl_args tmp; |
2995 | int error; | 3004 | int error; |
diff --git a/kernel/time.c b/kernel/time.c index 4886e3ce83a4..29511943871a 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
@@ -60,7 +60,7 @@ EXPORT_SYMBOL(sys_tz); | |||
60 | * why not move it into the appropriate arch directory (for those | 60 | * why not move it into the appropriate arch directory (for those |
61 | * architectures that need it). | 61 | * architectures that need it). |
62 | */ | 62 | */ |
63 | asmlinkage long sys_time(time_t __user * tloc) | 63 | SYSCALL_DEFINE1(time, time_t __user *, tloc) |
64 | { | 64 | { |
65 | time_t i = get_seconds(); | 65 | time_t i = get_seconds(); |
66 | 66 | ||
@@ -79,7 +79,7 @@ asmlinkage long sys_time(time_t __user * tloc) | |||
79 | * architectures that need it). | 79 | * architectures that need it). |
80 | */ | 80 | */ |
81 | 81 | ||
82 | asmlinkage long sys_stime(time_t __user *tptr) | 82 | SYSCALL_DEFINE1(stime, time_t __user *, tptr) |
83 | { | 83 | { |
84 | struct timespec tv; | 84 | struct timespec tv; |
85 | int err; | 85 | int err; |
@@ -99,8 +99,8 @@ asmlinkage long sys_stime(time_t __user *tptr) | |||
99 | 99 | ||
100 | #endif /* __ARCH_WANT_SYS_TIME */ | 100 | #endif /* __ARCH_WANT_SYS_TIME */ |
101 | 101 | ||
102 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, | 102 | SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv, |
103 | struct timezone __user *tz) | 103 | struct timezone __user *, tz) |
104 | { | 104 | { |
105 | if (likely(tv != NULL)) { | 105 | if (likely(tv != NULL)) { |
106 | struct timeval ktv; | 106 | struct timeval ktv; |
@@ -184,8 +184,8 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz) | |||
184 | return 0; | 184 | return 0; |
185 | } | 185 | } |
186 | 186 | ||
187 | asmlinkage long sys_settimeofday(struct timeval __user *tv, | 187 | SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv, |
188 | struct timezone __user *tz) | 188 | struct timezone __user *, tz) |
189 | { | 189 | { |
190 | struct timeval user_tv; | 190 | struct timeval user_tv; |
191 | struct timespec new_ts; | 191 | struct timespec new_ts; |
@@ -205,7 +205,7 @@ asmlinkage long sys_settimeofday(struct timeval __user *tv, | |||
205 | return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL); | 205 | return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL); |
206 | } | 206 | } |
207 | 207 | ||
208 | asmlinkage long sys_adjtimex(struct timex __user *txc_p) | 208 | SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) |
209 | { | 209 | { |
210 | struct timex txc; /* Local copy of parameter */ | 210 | struct timex txc; /* Local copy of parameter */ |
211 | int ret; | 211 | int ret; |
diff --git a/kernel/timer.c b/kernel/timer.c index dee3f641a7a7..13dd64fe143d 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1129,7 +1129,7 @@ void do_timer(unsigned long ticks) | |||
1129 | * For backwards compatibility? This can be done in libc so Alpha | 1129 | * For backwards compatibility? This can be done in libc so Alpha |
1130 | * and all newer ports shouldn't need it. | 1130 | * and all newer ports shouldn't need it. |
1131 | */ | 1131 | */ |
1132 | asmlinkage unsigned long sys_alarm(unsigned int seconds) | 1132 | SYSCALL_DEFINE1(alarm, unsigned int, seconds) |
1133 | { | 1133 | { |
1134 | return alarm_setitimer(seconds); | 1134 | return alarm_setitimer(seconds); |
1135 | } | 1135 | } |
@@ -1152,7 +1152,7 @@ asmlinkage unsigned long sys_alarm(unsigned int seconds) | |||
1152 | * | 1152 | * |
1153 | * This is SMP safe as current->tgid does not change. | 1153 | * This is SMP safe as current->tgid does not change. |
1154 | */ | 1154 | */ |
1155 | asmlinkage long sys_getpid(void) | 1155 | SYSCALL_DEFINE0(getpid) |
1156 | { | 1156 | { |
1157 | return task_tgid_vnr(current); | 1157 | return task_tgid_vnr(current); |
1158 | } | 1158 | } |
@@ -1163,7 +1163,7 @@ asmlinkage long sys_getpid(void) | |||
1163 | * value of ->real_parent under rcu_read_lock(), see | 1163 | * value of ->real_parent under rcu_read_lock(), see |
1164 | * release_task()->call_rcu(delayed_put_task_struct). | 1164 | * release_task()->call_rcu(delayed_put_task_struct). |
1165 | */ | 1165 | */ |
1166 | asmlinkage long sys_getppid(void) | 1166 | SYSCALL_DEFINE0(getppid) |
1167 | { | 1167 | { |
1168 | int pid; | 1168 | int pid; |
1169 | 1169 | ||
@@ -1174,25 +1174,25 @@ asmlinkage long sys_getppid(void) | |||
1174 | return pid; | 1174 | return pid; |
1175 | } | 1175 | } |
1176 | 1176 | ||
1177 | asmlinkage long sys_getuid(void) | 1177 | SYSCALL_DEFINE0(getuid) |
1178 | { | 1178 | { |
1179 | /* Only we change this so SMP safe */ | 1179 | /* Only we change this so SMP safe */ |
1180 | return current_uid(); | 1180 | return current_uid(); |
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | asmlinkage long sys_geteuid(void) | 1183 | SYSCALL_DEFINE0(geteuid) |
1184 | { | 1184 | { |
1185 | /* Only we change this so SMP safe */ | 1185 | /* Only we change this so SMP safe */ |
1186 | return current_euid(); | 1186 | return current_euid(); |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | asmlinkage long sys_getgid(void) | 1189 | SYSCALL_DEFINE0(getgid) |
1190 | { | 1190 | { |
1191 | /* Only we change this so SMP safe */ | 1191 | /* Only we change this so SMP safe */ |
1192 | return current_gid(); | 1192 | return current_gid(); |
1193 | } | 1193 | } |
1194 | 1194 | ||
1195 | asmlinkage long sys_getegid(void) | 1195 | SYSCALL_DEFINE0(getegid) |
1196 | { | 1196 | { |
1197 | /* Only we change this so SMP safe */ | 1197 | /* Only we change this so SMP safe */ |
1198 | return current_egid(); | 1198 | return current_egid(); |
@@ -1308,7 +1308,7 @@ signed long __sched schedule_timeout_uninterruptible(signed long timeout) | |||
1308 | EXPORT_SYMBOL(schedule_timeout_uninterruptible); | 1308 | EXPORT_SYMBOL(schedule_timeout_uninterruptible); |
1309 | 1309 | ||
1310 | /* Thread ID - the internal kernel "pid" */ | 1310 | /* Thread ID - the internal kernel "pid" */ |
1311 | asmlinkage long sys_gettid(void) | 1311 | SYSCALL_DEFINE0(gettid) |
1312 | { | 1312 | { |
1313 | return task_pid_vnr(current); | 1313 | return task_pid_vnr(current); |
1314 | } | 1314 | } |
@@ -1400,7 +1400,7 @@ out: | |||
1400 | return 0; | 1400 | return 0; |
1401 | } | 1401 | } |
1402 | 1402 | ||
1403 | asmlinkage long sys_sysinfo(struct sysinfo __user *info) | 1403 | SYSCALL_DEFINE1(sysinfo, struct sysinfo __user *, info) |
1404 | { | 1404 | { |
1405 | struct sysinfo val; | 1405 | struct sysinfo val; |
1406 | 1406 | ||
diff --git a/kernel/uid16.c b/kernel/uid16.c index 2460c3199b5a..0314501688b9 100644 --- a/kernel/uid16.c +++ b/kernel/uid16.c | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
19 | 19 | ||
20 | asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gid_t group) | 20 | SYSCALL_DEFINE3(chown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) |
21 | { | 21 | { |
22 | long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); | 22 | long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); |
23 | /* avoid REGPARM breakage on x86: */ | 23 | /* avoid REGPARM breakage on x86: */ |
@@ -25,7 +25,7 @@ asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gi | |||
25 | return ret; | 25 | return ret; |
26 | } | 26 | } |
27 | 27 | ||
28 | asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_gid_t group) | 28 | SYSCALL_DEFINE3(lchown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) |
29 | { | 29 | { |
30 | long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); | 30 | long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); |
31 | /* avoid REGPARM breakage on x86: */ | 31 | /* avoid REGPARM breakage on x86: */ |
@@ -33,7 +33,7 @@ asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_g | |||
33 | return ret; | 33 | return ret; |
34 | } | 34 | } |
35 | 35 | ||
36 | asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) | 36 | SYSCALL_DEFINE3(fchown16, unsigned int, fd, old_uid_t, user, old_gid_t, group) |
37 | { | 37 | { |
38 | long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); | 38 | long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); |
39 | /* avoid REGPARM breakage on x86: */ | 39 | /* avoid REGPARM breakage on x86: */ |
@@ -41,7 +41,7 @@ asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) | |||
41 | return ret; | 41 | return ret; |
42 | } | 42 | } |
43 | 43 | ||
44 | asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid) | 44 | SYSCALL_DEFINE2(setregid16, old_gid_t, rgid, old_gid_t, egid) |
45 | { | 45 | { |
46 | long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); | 46 | long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); |
47 | /* avoid REGPARM breakage on x86: */ | 47 | /* avoid REGPARM breakage on x86: */ |
@@ -49,7 +49,7 @@ asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid) | |||
49 | return ret; | 49 | return ret; |
50 | } | 50 | } |
51 | 51 | ||
52 | asmlinkage long sys_setgid16(old_gid_t gid) | 52 | SYSCALL_DEFINE1(setgid16, old_gid_t, gid) |
53 | { | 53 | { |
54 | long ret = sys_setgid(low2highgid(gid)); | 54 | long ret = sys_setgid(low2highgid(gid)); |
55 | /* avoid REGPARM breakage on x86: */ | 55 | /* avoid REGPARM breakage on x86: */ |
@@ -57,7 +57,7 @@ asmlinkage long sys_setgid16(old_gid_t gid) | |||
57 | return ret; | 57 | return ret; |
58 | } | 58 | } |
59 | 59 | ||
60 | asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid) | 60 | SYSCALL_DEFINE2(setreuid16, old_uid_t, ruid, old_uid_t, euid) |
61 | { | 61 | { |
62 | long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); | 62 | long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); |
63 | /* avoid REGPARM breakage on x86: */ | 63 | /* avoid REGPARM breakage on x86: */ |
@@ -65,7 +65,7 @@ asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid) | |||
65 | return ret; | 65 | return ret; |
66 | } | 66 | } |
67 | 67 | ||
68 | asmlinkage long sys_setuid16(old_uid_t uid) | 68 | SYSCALL_DEFINE1(setuid16, old_uid_t, uid) |
69 | { | 69 | { |
70 | long ret = sys_setuid(low2highuid(uid)); | 70 | long ret = sys_setuid(low2highuid(uid)); |
71 | /* avoid REGPARM breakage on x86: */ | 71 | /* avoid REGPARM breakage on x86: */ |
@@ -73,7 +73,7 @@ asmlinkage long sys_setuid16(old_uid_t uid) | |||
73 | return ret; | 73 | return ret; |
74 | } | 74 | } |
75 | 75 | ||
76 | asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) | 76 | SYSCALL_DEFINE3(setresuid16, old_uid_t, ruid, old_uid_t, euid, old_uid_t, suid) |
77 | { | 77 | { |
78 | long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), | 78 | long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), |
79 | low2highuid(suid)); | 79 | low2highuid(suid)); |
@@ -82,7 +82,7 @@ asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) | |||
82 | return ret; | 82 | return ret; |
83 | } | 83 | } |
84 | 84 | ||
85 | asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, old_uid_t __user *suid) | 85 | SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruid, old_uid_t __user *, euid, old_uid_t __user *, suid) |
86 | { | 86 | { |
87 | const struct cred *cred = current_cred(); | 87 | const struct cred *cred = current_cred(); |
88 | int retval; | 88 | int retval; |
@@ -94,7 +94,7 @@ asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, | |||
94 | return retval; | 94 | return retval; |
95 | } | 95 | } |
96 | 96 | ||
97 | asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) | 97 | SYSCALL_DEFINE3(setresgid16, old_gid_t, rgid, old_gid_t, egid, old_gid_t, sgid) |
98 | { | 98 | { |
99 | long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), | 99 | long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), |
100 | low2highgid(sgid)); | 100 | low2highgid(sgid)); |
@@ -103,7 +103,8 @@ asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) | |||
103 | return ret; | 103 | return ret; |
104 | } | 104 | } |
105 | 105 | ||
106 | asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid) | 106 | |
107 | SYSCALL_DEFINE3(getresgid16, old_gid_t __user *, rgid, old_gid_t __user *, egid, old_gid_t __user *, sgid) | ||
107 | { | 108 | { |
108 | const struct cred *cred = current_cred(); | 109 | const struct cred *cred = current_cred(); |
109 | int retval; | 110 | int retval; |
@@ -115,7 +116,7 @@ asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, | |||
115 | return retval; | 116 | return retval; |
116 | } | 117 | } |
117 | 118 | ||
118 | asmlinkage long sys_setfsuid16(old_uid_t uid) | 119 | SYSCALL_DEFINE1(setfsuid16, old_uid_t, uid) |
119 | { | 120 | { |
120 | long ret = sys_setfsuid(low2highuid(uid)); | 121 | long ret = sys_setfsuid(low2highuid(uid)); |
121 | /* avoid REGPARM breakage on x86: */ | 122 | /* avoid REGPARM breakage on x86: */ |
@@ -123,7 +124,7 @@ asmlinkage long sys_setfsuid16(old_uid_t uid) | |||
123 | return ret; | 124 | return ret; |
124 | } | 125 | } |
125 | 126 | ||
126 | asmlinkage long sys_setfsgid16(old_gid_t gid) | 127 | SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid) |
127 | { | 128 | { |
128 | long ret = sys_setfsgid(low2highgid(gid)); | 129 | long ret = sys_setfsgid(low2highgid(gid)); |
129 | /* avoid REGPARM breakage on x86: */ | 130 | /* avoid REGPARM breakage on x86: */ |
@@ -161,7 +162,7 @@ static int groups16_from_user(struct group_info *group_info, | |||
161 | return 0; | 162 | return 0; |
162 | } | 163 | } |
163 | 164 | ||
164 | asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist) | 165 | SYSCALL_DEFINE2(getgroups16, int, gidsetsize, old_gid_t __user *, grouplist) |
165 | { | 166 | { |
166 | const struct cred *cred = current_cred(); | 167 | const struct cred *cred = current_cred(); |
167 | int i; | 168 | int i; |
@@ -184,7 +185,7 @@ out: | |||
184 | return i; | 185 | return i; |
185 | } | 186 | } |
186 | 187 | ||
187 | asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist) | 188 | SYSCALL_DEFINE2(setgroups16, int, gidsetsize, old_gid_t __user *, grouplist) |
188 | { | 189 | { |
189 | struct group_info *group_info; | 190 | struct group_info *group_info; |
190 | int retval; | 191 | int retval; |
@@ -209,22 +210,22 @@ asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist) | |||
209 | return retval; | 210 | return retval; |
210 | } | 211 | } |
211 | 212 | ||
212 | asmlinkage long sys_getuid16(void) | 213 | SYSCALL_DEFINE0(getuid16) |
213 | { | 214 | { |
214 | return high2lowuid(current_uid()); | 215 | return high2lowuid(current_uid()); |
215 | } | 216 | } |
216 | 217 | ||
217 | asmlinkage long sys_geteuid16(void) | 218 | SYSCALL_DEFINE0(geteuid16) |
218 | { | 219 | { |
219 | return high2lowuid(current_euid()); | 220 | return high2lowuid(current_euid()); |
220 | } | 221 | } |
221 | 222 | ||
222 | asmlinkage long sys_getgid16(void) | 223 | SYSCALL_DEFINE0(getgid16) |
223 | { | 224 | { |
224 | return high2lowgid(current_gid()); | 225 | return high2lowgid(current_gid()); |
225 | } | 226 | } |
226 | 227 | ||
227 | asmlinkage long sys_getegid16(void) | 228 | SYSCALL_DEFINE0(getegid16) |
228 | { | 229 | { |
229 | return high2lowgid(current_egid()); | 230 | return high2lowgid(current_egid()); |
230 | } | 231 | } |
diff --git a/kernel/up.c b/kernel/up.c new file mode 100644 index 000000000000..1ff27a28bb7d --- /dev/null +++ b/kernel/up.c | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Uniprocessor-only support functions. The counterpart to kernel/smp.c | ||
3 | */ | ||
4 | |||
5 | #include <linux/interrupt.h> | ||
6 | #include <linux/kernel.h> | ||
7 | #include <linux/module.h> | ||
8 | #include <linux/smp.h> | ||
9 | |||
10 | int smp_call_function_single(int cpu, void (*func) (void *info), void *info, | ||
11 | int wait) | ||
12 | { | ||
13 | WARN_ON(cpu != 0); | ||
14 | |||
15 | local_irq_disable(); | ||
16 | (func)(info); | ||
17 | local_irq_enable(); | ||
18 | |||
19 | return 0; | ||
20 | } | ||
21 | EXPORT_SYMBOL(smp_call_function_single); | ||
@@ -121,7 +121,7 @@ int idr_pre_get(struct idr *idp, gfp_t gfp_mask) | |||
121 | { | 121 | { |
122 | while (idp->id_free_cnt < IDR_FREE_MAX) { | 122 | while (idp->id_free_cnt < IDR_FREE_MAX) { |
123 | struct idr_layer *new; | 123 | struct idr_layer *new; |
124 | new = kmem_cache_alloc(idr_layer_cache, gfp_mask); | 124 | new = kmem_cache_zalloc(idr_layer_cache, gfp_mask); |
125 | if (new == NULL) | 125 | if (new == NULL) |
126 | return (0); | 126 | return (0); |
127 | move_to_free_list(idp, new); | 127 | move_to_free_list(idp, new); |
@@ -292,7 +292,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id) | |||
292 | * and go back to the idr_pre_get() call. If the idr is full, it will | 292 | * and go back to the idr_pre_get() call. If the idr is full, it will |
293 | * return -ENOSPC. | 293 | * return -ENOSPC. |
294 | * | 294 | * |
295 | * @id returns a value in the range 0 ... 0x7fffffff | 295 | * @id returns a value in the range @starting_id ... 0x7fffffff |
296 | */ | 296 | */ |
297 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id) | 297 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id) |
298 | { | 298 | { |
@@ -623,16 +623,10 @@ void *idr_replace(struct idr *idp, void *ptr, int id) | |||
623 | } | 623 | } |
624 | EXPORT_SYMBOL(idr_replace); | 624 | EXPORT_SYMBOL(idr_replace); |
625 | 625 | ||
626 | static void idr_cache_ctor(void *idr_layer) | ||
627 | { | ||
628 | memset(idr_layer, 0, sizeof(struct idr_layer)); | ||
629 | } | ||
630 | |||
631 | void __init idr_init_cache(void) | 626 | void __init idr_init_cache(void) |
632 | { | 627 | { |
633 | idr_layer_cache = kmem_cache_create("idr_layer_cache", | 628 | idr_layer_cache = kmem_cache_create("idr_layer_cache", |
634 | sizeof(struct idr_layer), 0, SLAB_PANIC, | 629 | sizeof(struct idr_layer), 0, SLAB_PANIC, NULL); |
635 | idr_cache_ctor); | ||
636 | } | 630 | } |
637 | 631 | ||
638 | /** | 632 | /** |
@@ -723,7 +717,7 @@ EXPORT_SYMBOL(ida_pre_get); | |||
723 | * and go back to the ida_pre_get() call. If the ida is full, it will | 717 | * and go back to the ida_pre_get() call. If the ida is full, it will |
724 | * return -ENOSPC. | 718 | * return -ENOSPC. |
725 | * | 719 | * |
726 | * @p_id returns a value in the range 0 ... 0x7fffffff. | 720 | * @p_id returns a value in the range @starting_id ... 0x7fffffff. |
727 | */ | 721 | */ |
728 | int ida_get_new_above(struct ida *ida, int starting_id, int *p_id) | 722 | int ida_get_new_above(struct ida *ida, int starting_id, int *p_id) |
729 | { | 723 | { |
diff --git a/mm/fadvise.c b/mm/fadvise.c index a1da969bd980..54a0f8040afa 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c | |||
@@ -24,7 +24,7 @@ | |||
24 | * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could | 24 | * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could |
25 | * deactivate the pages and clear PG_Referenced. | 25 | * deactivate the pages and clear PG_Referenced. |
26 | */ | 26 | */ |
27 | asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice) | 27 | SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) |
28 | { | 28 | { |
29 | struct file *file = fget(fd); | 29 | struct file *file = fget(fd); |
30 | struct address_space *mapping; | 30 | struct address_space *mapping; |
@@ -126,12 +126,26 @@ out: | |||
126 | fput(file); | 126 | fput(file); |
127 | return ret; | 127 | return ret; |
128 | } | 128 | } |
129 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
130 | asmlinkage long SyS_fadvise64_64(long fd, loff_t offset, loff_t len, long advice) | ||
131 | { | ||
132 | return SYSC_fadvise64_64((int) fd, offset, len, (int) advice); | ||
133 | } | ||
134 | SYSCALL_ALIAS(sys_fadvise64_64, SyS_fadvise64_64); | ||
135 | #endif | ||
129 | 136 | ||
130 | #ifdef __ARCH_WANT_SYS_FADVISE64 | 137 | #ifdef __ARCH_WANT_SYS_FADVISE64 |
131 | 138 | ||
132 | asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice) | 139 | SYSCALL_DEFINE(fadvise64)(int fd, loff_t offset, size_t len, int advice) |
133 | { | 140 | { |
134 | return sys_fadvise64_64(fd, offset, len, advice); | 141 | return sys_fadvise64_64(fd, offset, len, advice); |
135 | } | 142 | } |
143 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
144 | asmlinkage long SyS_fadvise64(long fd, loff_t offset, long len, long advice) | ||
145 | { | ||
146 | return SYSC_fadvise64((int) fd, offset, (size_t)len, (int)advice); | ||
147 | } | ||
148 | SYSCALL_ALIAS(sys_fadvise64, SyS_fadvise64); | ||
149 | #endif | ||
136 | 150 | ||
137 | #endif | 151 | #endif |
diff --git a/mm/filemap.c b/mm/filemap.c index ceba0bd03662..23acefe51808 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -1374,7 +1374,7 @@ do_readahead(struct address_space *mapping, struct file *filp, | |||
1374 | return 0; | 1374 | return 0; |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count) | 1377 | SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count) |
1378 | { | 1378 | { |
1379 | ssize_t ret; | 1379 | ssize_t ret; |
1380 | struct file *file; | 1380 | struct file *file; |
@@ -1393,6 +1393,13 @@ asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count) | |||
1393 | } | 1393 | } |
1394 | return ret; | 1394 | return ret; |
1395 | } | 1395 | } |
1396 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
1397 | asmlinkage long SyS_readahead(long fd, loff_t offset, long count) | ||
1398 | { | ||
1399 | return SYSC_readahead((int) fd, offset, (size_t) count); | ||
1400 | } | ||
1401 | SYSCALL_ALIAS(sys_readahead, SyS_readahead); | ||
1402 | #endif | ||
1396 | 1403 | ||
1397 | #ifdef CONFIG_MMU | 1404 | #ifdef CONFIG_MMU |
1398 | /** | 1405 | /** |
diff --git a/mm/fremap.c b/mm/fremap.c index 62d5bbda921a..736ba7f3306a 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
@@ -120,8 +120,8 @@ static int populate_range(struct mm_struct *mm, struct vm_area_struct *vma, | |||
120 | * and the vma's default protection is used. Arbitrary protections | 120 | * and the vma's default protection is used. Arbitrary protections |
121 | * might be implemented in the future. | 121 | * might be implemented in the future. |
122 | */ | 122 | */ |
123 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, | 123 | SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, |
124 | unsigned long prot, unsigned long pgoff, unsigned long flags) | 124 | unsigned long, prot, unsigned long, pgoff, unsigned long, flags) |
125 | { | 125 | { |
126 | struct mm_struct *mm = current->mm; | 126 | struct mm_struct *mm = current->mm; |
127 | struct address_space *mapping; | 127 | struct address_space *mapping; |
diff --git a/mm/madvise.c b/mm/madvise.c index f9349c18a1b5..b9ce574827c8 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -281,7 +281,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev, | |||
281 | * -EBADF - map exists, but area maps something that isn't a file. | 281 | * -EBADF - map exists, but area maps something that isn't a file. |
282 | * -EAGAIN - a kernel resource was temporarily unavailable. | 282 | * -EAGAIN - a kernel resource was temporarily unavailable. |
283 | */ | 283 | */ |
284 | asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior) | 284 | SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) |
285 | { | 285 | { |
286 | unsigned long end, tmp; | 286 | unsigned long end, tmp; |
287 | struct vm_area_struct * vma, *prev; | 287 | struct vm_area_struct * vma, *prev; |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e2996b80601f..4d0ea3ceba6d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -358,6 +358,10 @@ void mem_cgroup_rotate_lru_list(struct page *page, enum lru_list lru) | |||
358 | return; | 358 | return; |
359 | 359 | ||
360 | pc = lookup_page_cgroup(page); | 360 | pc = lookup_page_cgroup(page); |
361 | /* | ||
362 | * Used bit is set without atomic ops but after smp_wmb(). | ||
363 | * For making pc->mem_cgroup visible, insert smp_rmb() here. | ||
364 | */ | ||
361 | smp_rmb(); | 365 | smp_rmb(); |
362 | /* unused page is not rotated. */ | 366 | /* unused page is not rotated. */ |
363 | if (!PageCgroupUsed(pc)) | 367 | if (!PageCgroupUsed(pc)) |
@@ -374,7 +378,10 @@ void mem_cgroup_add_lru_list(struct page *page, enum lru_list lru) | |||
374 | if (mem_cgroup_disabled()) | 378 | if (mem_cgroup_disabled()) |
375 | return; | 379 | return; |
376 | pc = lookup_page_cgroup(page); | 380 | pc = lookup_page_cgroup(page); |
377 | /* barrier to sync with "charge" */ | 381 | /* |
382 | * Used bit is set without atomic ops but after smp_wmb(). | ||
383 | * For making pc->mem_cgroup visible, insert smp_rmb() here. | ||
384 | */ | ||
378 | smp_rmb(); | 385 | smp_rmb(); |
379 | if (!PageCgroupUsed(pc)) | 386 | if (!PageCgroupUsed(pc)) |
380 | return; | 387 | return; |
@@ -559,6 +566,14 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page) | |||
559 | return NULL; | 566 | return NULL; |
560 | 567 | ||
561 | pc = lookup_page_cgroup(page); | 568 | pc = lookup_page_cgroup(page); |
569 | /* | ||
570 | * Used bit is set without atomic ops but after smp_wmb(). | ||
571 | * For making pc->mem_cgroup visible, insert smp_rmb() here. | ||
572 | */ | ||
573 | smp_rmb(); | ||
574 | if (!PageCgroupUsed(pc)) | ||
575 | return NULL; | ||
576 | |||
562 | mz = page_cgroup_zoneinfo(pc); | 577 | mz = page_cgroup_zoneinfo(pc); |
563 | if (!mz) | 578 | if (!mz) |
564 | return NULL; | 579 | return NULL; |
@@ -618,7 +633,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
618 | * called with hierarchy_mutex held | 633 | * called with hierarchy_mutex held |
619 | */ | 634 | */ |
620 | static struct mem_cgroup * | 635 | static struct mem_cgroup * |
621 | mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem) | 636 | __mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem) |
622 | { | 637 | { |
623 | struct cgroup *cgroup, *curr_cgroup, *root_cgroup; | 638 | struct cgroup *cgroup, *curr_cgroup, *root_cgroup; |
624 | 639 | ||
@@ -629,19 +644,16 @@ mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem) | |||
629 | /* | 644 | /* |
630 | * Walk down to children | 645 | * Walk down to children |
631 | */ | 646 | */ |
632 | mem_cgroup_put(curr); | ||
633 | cgroup = list_entry(curr_cgroup->children.next, | 647 | cgroup = list_entry(curr_cgroup->children.next, |
634 | struct cgroup, sibling); | 648 | struct cgroup, sibling); |
635 | curr = mem_cgroup_from_cont(cgroup); | 649 | curr = mem_cgroup_from_cont(cgroup); |
636 | mem_cgroup_get(curr); | ||
637 | goto done; | 650 | goto done; |
638 | } | 651 | } |
639 | 652 | ||
640 | visit_parent: | 653 | visit_parent: |
641 | if (curr_cgroup == root_cgroup) { | 654 | if (curr_cgroup == root_cgroup) { |
642 | mem_cgroup_put(curr); | 655 | /* caller handles NULL case */ |
643 | curr = root_mem; | 656 | curr = NULL; |
644 | mem_cgroup_get(curr); | ||
645 | goto done; | 657 | goto done; |
646 | } | 658 | } |
647 | 659 | ||
@@ -649,11 +661,9 @@ visit_parent: | |||
649 | * Goto next sibling | 661 | * Goto next sibling |
650 | */ | 662 | */ |
651 | if (curr_cgroup->sibling.next != &curr_cgroup->parent->children) { | 663 | if (curr_cgroup->sibling.next != &curr_cgroup->parent->children) { |
652 | mem_cgroup_put(curr); | ||
653 | cgroup = list_entry(curr_cgroup->sibling.next, struct cgroup, | 664 | cgroup = list_entry(curr_cgroup->sibling.next, struct cgroup, |
654 | sibling); | 665 | sibling); |
655 | curr = mem_cgroup_from_cont(cgroup); | 666 | curr = mem_cgroup_from_cont(cgroup); |
656 | mem_cgroup_get(curr); | ||
657 | goto done; | 667 | goto done; |
658 | } | 668 | } |
659 | 669 | ||
@@ -664,7 +674,6 @@ visit_parent: | |||
664 | goto visit_parent; | 674 | goto visit_parent; |
665 | 675 | ||
666 | done: | 676 | done: |
667 | root_mem->last_scanned_child = curr; | ||
668 | return curr; | 677 | return curr; |
669 | } | 678 | } |
670 | 679 | ||
@@ -674,40 +683,46 @@ done: | |||
674 | * that to reclaim free pages from. | 683 | * that to reclaim free pages from. |
675 | */ | 684 | */ |
676 | static struct mem_cgroup * | 685 | static struct mem_cgroup * |
677 | mem_cgroup_get_first_node(struct mem_cgroup *root_mem) | 686 | mem_cgroup_get_next_node(struct mem_cgroup *root_mem) |
678 | { | 687 | { |
679 | struct cgroup *cgroup; | 688 | struct cgroup *cgroup; |
680 | struct mem_cgroup *ret; | 689 | struct mem_cgroup *orig, *next; |
681 | bool obsolete; | 690 | bool obsolete; |
682 | 691 | ||
683 | obsolete = mem_cgroup_is_obsolete(root_mem->last_scanned_child); | ||
684 | |||
685 | /* | 692 | /* |
686 | * Scan all children under the mem_cgroup mem | 693 | * Scan all children under the mem_cgroup mem |
687 | */ | 694 | */ |
688 | mutex_lock(&mem_cgroup_subsys.hierarchy_mutex); | 695 | mutex_lock(&mem_cgroup_subsys.hierarchy_mutex); |
696 | |||
697 | orig = root_mem->last_scanned_child; | ||
698 | obsolete = mem_cgroup_is_obsolete(orig); | ||
699 | |||
689 | if (list_empty(&root_mem->css.cgroup->children)) { | 700 | if (list_empty(&root_mem->css.cgroup->children)) { |
690 | ret = root_mem; | 701 | /* |
702 | * root_mem might have children before and last_scanned_child | ||
703 | * may point to one of them. We put it later. | ||
704 | */ | ||
705 | if (orig) | ||
706 | VM_BUG_ON(!obsolete); | ||
707 | next = NULL; | ||
691 | goto done; | 708 | goto done; |
692 | } | 709 | } |
693 | 710 | ||
694 | if (!root_mem->last_scanned_child || obsolete) { | 711 | if (!orig || obsolete) { |
695 | |||
696 | if (obsolete && root_mem->last_scanned_child) | ||
697 | mem_cgroup_put(root_mem->last_scanned_child); | ||
698 | |||
699 | cgroup = list_first_entry(&root_mem->css.cgroup->children, | 712 | cgroup = list_first_entry(&root_mem->css.cgroup->children, |
700 | struct cgroup, sibling); | 713 | struct cgroup, sibling); |
701 | ret = mem_cgroup_from_cont(cgroup); | 714 | next = mem_cgroup_from_cont(cgroup); |
702 | mem_cgroup_get(ret); | ||
703 | } else | 715 | } else |
704 | ret = mem_cgroup_get_next_node(root_mem->last_scanned_child, | 716 | next = __mem_cgroup_get_next_node(orig, root_mem); |
705 | root_mem); | ||
706 | 717 | ||
707 | done: | 718 | done: |
708 | root_mem->last_scanned_child = ret; | 719 | if (next) |
720 | mem_cgroup_get(next); | ||
721 | root_mem->last_scanned_child = next; | ||
722 | if (orig) | ||
723 | mem_cgroup_put(orig); | ||
709 | mutex_unlock(&mem_cgroup_subsys.hierarchy_mutex); | 724 | mutex_unlock(&mem_cgroup_subsys.hierarchy_mutex); |
710 | return ret; | 725 | return (next) ? next : root_mem; |
711 | } | 726 | } |
712 | 727 | ||
713 | static bool mem_cgroup_check_under_limit(struct mem_cgroup *mem) | 728 | static bool mem_cgroup_check_under_limit(struct mem_cgroup *mem) |
@@ -758,28 +773,25 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem, | |||
758 | * but there might be left over accounting, even after children | 773 | * but there might be left over accounting, even after children |
759 | * have left. | 774 | * have left. |
760 | */ | 775 | */ |
761 | ret = try_to_free_mem_cgroup_pages(root_mem, gfp_mask, noswap, | 776 | ret += try_to_free_mem_cgroup_pages(root_mem, gfp_mask, noswap, |
762 | get_swappiness(root_mem)); | 777 | get_swappiness(root_mem)); |
763 | if (mem_cgroup_check_under_limit(root_mem)) | 778 | if (mem_cgroup_check_under_limit(root_mem)) |
764 | return 0; | 779 | return 1; /* indicate reclaim has succeeded */ |
765 | if (!root_mem->use_hierarchy) | 780 | if (!root_mem->use_hierarchy) |
766 | return ret; | 781 | return ret; |
767 | 782 | ||
768 | next_mem = mem_cgroup_get_first_node(root_mem); | 783 | next_mem = mem_cgroup_get_next_node(root_mem); |
769 | 784 | ||
770 | while (next_mem != root_mem) { | 785 | while (next_mem != root_mem) { |
771 | if (mem_cgroup_is_obsolete(next_mem)) { | 786 | if (mem_cgroup_is_obsolete(next_mem)) { |
772 | mem_cgroup_put(next_mem); | 787 | next_mem = mem_cgroup_get_next_node(root_mem); |
773 | next_mem = mem_cgroup_get_first_node(root_mem); | ||
774 | continue; | 788 | continue; |
775 | } | 789 | } |
776 | ret = try_to_free_mem_cgroup_pages(next_mem, gfp_mask, noswap, | 790 | ret += try_to_free_mem_cgroup_pages(next_mem, gfp_mask, noswap, |
777 | get_swappiness(next_mem)); | 791 | get_swappiness(next_mem)); |
778 | if (mem_cgroup_check_under_limit(root_mem)) | 792 | if (mem_cgroup_check_under_limit(root_mem)) |
779 | return 0; | 793 | return 1; /* indicate reclaim has succeeded */ |
780 | mutex_lock(&mem_cgroup_subsys.hierarchy_mutex); | 794 | next_mem = mem_cgroup_get_next_node(root_mem); |
781 | next_mem = mem_cgroup_get_next_node(next_mem, root_mem); | ||
782 | mutex_unlock(&mem_cgroup_subsys.hierarchy_mutex); | ||
783 | } | 795 | } |
784 | return ret; | 796 | return ret; |
785 | } | 797 | } |
@@ -863,6 +875,8 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm, | |||
863 | 875 | ||
864 | ret = mem_cgroup_hierarchical_reclaim(mem_over_limit, gfp_mask, | 876 | ret = mem_cgroup_hierarchical_reclaim(mem_over_limit, gfp_mask, |
865 | noswap); | 877 | noswap); |
878 | if (ret) | ||
879 | continue; | ||
866 | 880 | ||
867 | /* | 881 | /* |
868 | * try_to_free_mem_cgroup_pages() might not give us a full | 882 | * try_to_free_mem_cgroup_pages() might not give us a full |
@@ -979,14 +993,15 @@ static int mem_cgroup_move_account(struct page_cgroup *pc, | |||
979 | if (pc->mem_cgroup != from) | 993 | if (pc->mem_cgroup != from) |
980 | goto out; | 994 | goto out; |
981 | 995 | ||
982 | css_put(&from->css); | ||
983 | res_counter_uncharge(&from->res, PAGE_SIZE); | 996 | res_counter_uncharge(&from->res, PAGE_SIZE); |
984 | mem_cgroup_charge_statistics(from, pc, false); | 997 | mem_cgroup_charge_statistics(from, pc, false); |
985 | if (do_swap_account) | 998 | if (do_swap_account) |
986 | res_counter_uncharge(&from->memsw, PAGE_SIZE); | 999 | res_counter_uncharge(&from->memsw, PAGE_SIZE); |
1000 | css_put(&from->css); | ||
1001 | |||
1002 | css_get(&to->css); | ||
987 | pc->mem_cgroup = to; | 1003 | pc->mem_cgroup = to; |
988 | mem_cgroup_charge_statistics(to, pc, true); | 1004 | mem_cgroup_charge_statistics(to, pc, true); |
989 | css_get(&to->css); | ||
990 | ret = 0; | 1005 | ret = 0; |
991 | out: | 1006 | out: |
992 | unlock_page_cgroup(pc); | 1007 | unlock_page_cgroup(pc); |
@@ -1019,8 +1034,10 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc, | |||
1019 | if (ret || !parent) | 1034 | if (ret || !parent) |
1020 | return ret; | 1035 | return ret; |
1021 | 1036 | ||
1022 | if (!get_page_unless_zero(page)) | 1037 | if (!get_page_unless_zero(page)) { |
1023 | return -EBUSY; | 1038 | ret = -EBUSY; |
1039 | goto uncharge; | ||
1040 | } | ||
1024 | 1041 | ||
1025 | ret = isolate_lru_page(page); | 1042 | ret = isolate_lru_page(page); |
1026 | 1043 | ||
@@ -1029,19 +1046,23 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc, | |||
1029 | 1046 | ||
1030 | ret = mem_cgroup_move_account(pc, child, parent); | 1047 | ret = mem_cgroup_move_account(pc, child, parent); |
1031 | 1048 | ||
1032 | /* drop extra refcnt by try_charge() (move_account increment one) */ | ||
1033 | css_put(&parent->css); | ||
1034 | putback_lru_page(page); | 1049 | putback_lru_page(page); |
1035 | if (!ret) { | 1050 | if (!ret) { |
1036 | put_page(page); | 1051 | put_page(page); |
1052 | /* drop extra refcnt by try_charge() */ | ||
1053 | css_put(&parent->css); | ||
1037 | return 0; | 1054 | return 0; |
1038 | } | 1055 | } |
1039 | /* uncharge if move fails */ | 1056 | |
1040 | cancel: | 1057 | cancel: |
1058 | put_page(page); | ||
1059 | uncharge: | ||
1060 | /* drop extra refcnt by try_charge() */ | ||
1061 | css_put(&parent->css); | ||
1062 | /* uncharge if move fails */ | ||
1041 | res_counter_uncharge(&parent->res, PAGE_SIZE); | 1063 | res_counter_uncharge(&parent->res, PAGE_SIZE); |
1042 | if (do_swap_account) | 1064 | if (do_swap_account) |
1043 | res_counter_uncharge(&parent->memsw, PAGE_SIZE); | 1065 | res_counter_uncharge(&parent->memsw, PAGE_SIZE); |
1044 | put_page(page); | ||
1045 | return ret; | 1066 | return ret; |
1046 | } | 1067 | } |
1047 | 1068 | ||
@@ -1971,6 +1992,7 @@ static int mem_cgroup_swappiness_write(struct cgroup *cgrp, struct cftype *cft, | |||
1971 | { | 1992 | { |
1972 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp); | 1993 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp); |
1973 | struct mem_cgroup *parent; | 1994 | struct mem_cgroup *parent; |
1995 | |||
1974 | if (val > 100) | 1996 | if (val > 100) |
1975 | return -EINVAL; | 1997 | return -EINVAL; |
1976 | 1998 | ||
@@ -1978,15 +2000,22 @@ static int mem_cgroup_swappiness_write(struct cgroup *cgrp, struct cftype *cft, | |||
1978 | return -EINVAL; | 2000 | return -EINVAL; |
1979 | 2001 | ||
1980 | parent = mem_cgroup_from_cont(cgrp->parent); | 2002 | parent = mem_cgroup_from_cont(cgrp->parent); |
2003 | |||
2004 | cgroup_lock(); | ||
2005 | |||
1981 | /* If under hierarchy, only empty-root can set this value */ | 2006 | /* If under hierarchy, only empty-root can set this value */ |
1982 | if ((parent->use_hierarchy) || | 2007 | if ((parent->use_hierarchy) || |
1983 | (memcg->use_hierarchy && !list_empty(&cgrp->children))) | 2008 | (memcg->use_hierarchy && !list_empty(&cgrp->children))) { |
2009 | cgroup_unlock(); | ||
1984 | return -EINVAL; | 2010 | return -EINVAL; |
2011 | } | ||
1985 | 2012 | ||
1986 | spin_lock(&memcg->reclaim_param_lock); | 2013 | spin_lock(&memcg->reclaim_param_lock); |
1987 | memcg->swappiness = val; | 2014 | memcg->swappiness = val; |
1988 | spin_unlock(&memcg->reclaim_param_lock); | 2015 | spin_unlock(&memcg->reclaim_param_lock); |
1989 | 2016 | ||
2017 | cgroup_unlock(); | ||
2018 | |||
1990 | return 0; | 2019 | return 0; |
1991 | } | 2020 | } |
1992 | 2021 | ||
@@ -2181,7 +2210,7 @@ static void __init enable_swap_cgroup(void) | |||
2181 | } | 2210 | } |
2182 | #endif | 2211 | #endif |
2183 | 2212 | ||
2184 | static struct cgroup_subsys_state * | 2213 | static struct cgroup_subsys_state * __ref |
2185 | mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) | 2214 | mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) |
2186 | { | 2215 | { |
2187 | struct mem_cgroup *mem, *parent; | 2216 | struct mem_cgroup *mem, *parent; |
@@ -2232,7 +2261,14 @@ static void mem_cgroup_pre_destroy(struct cgroup_subsys *ss, | |||
2232 | static void mem_cgroup_destroy(struct cgroup_subsys *ss, | 2261 | static void mem_cgroup_destroy(struct cgroup_subsys *ss, |
2233 | struct cgroup *cont) | 2262 | struct cgroup *cont) |
2234 | { | 2263 | { |
2235 | mem_cgroup_put(mem_cgroup_from_cont(cont)); | 2264 | struct mem_cgroup *mem = mem_cgroup_from_cont(cont); |
2265 | struct mem_cgroup *last_scanned_child = mem->last_scanned_child; | ||
2266 | |||
2267 | if (last_scanned_child) { | ||
2268 | VM_BUG_ON(!mem_cgroup_is_obsolete(last_scanned_child)); | ||
2269 | mem_cgroup_put(last_scanned_child); | ||
2270 | } | ||
2271 | mem_cgroup_put(mem); | ||
2236 | } | 2272 | } |
2237 | 2273 | ||
2238 | static int mem_cgroup_populate(struct cgroup_subsys *ss, | 2274 | static int mem_cgroup_populate(struct cgroup_subsys *ss, |
diff --git a/mm/memory.c b/mm/memory.c index e009ce870859..22bfa7a47a0b 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1511,6 +1511,7 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, | |||
1511 | unsigned long pfn) | 1511 | unsigned long pfn) |
1512 | { | 1512 | { |
1513 | int ret; | 1513 | int ret; |
1514 | pgprot_t pgprot = vma->vm_page_prot; | ||
1514 | /* | 1515 | /* |
1515 | * Technically, architectures with pte_special can avoid all these | 1516 | * Technically, architectures with pte_special can avoid all these |
1516 | * restrictions (same for remap_pfn_range). However we would like | 1517 | * restrictions (same for remap_pfn_range). However we would like |
@@ -1525,10 +1526,10 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, | |||
1525 | 1526 | ||
1526 | if (addr < vma->vm_start || addr >= vma->vm_end) | 1527 | if (addr < vma->vm_start || addr >= vma->vm_end) |
1527 | return -EFAULT; | 1528 | return -EFAULT; |
1528 | if (track_pfn_vma_new(vma, vma->vm_page_prot, pfn, PAGE_SIZE)) | 1529 | if (track_pfn_vma_new(vma, &pgprot, pfn, PAGE_SIZE)) |
1529 | return -EINVAL; | 1530 | return -EINVAL; |
1530 | 1531 | ||
1531 | ret = insert_pfn(vma, addr, pfn, vma->vm_page_prot); | 1532 | ret = insert_pfn(vma, addr, pfn, pgprot); |
1532 | 1533 | ||
1533 | if (ret) | 1534 | if (ret) |
1534 | untrack_pfn_vma(vma, pfn, PAGE_SIZE); | 1535 | untrack_pfn_vma(vma, pfn, PAGE_SIZE); |
@@ -1671,9 +1672,15 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, | |||
1671 | 1672 | ||
1672 | vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; | 1673 | vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; |
1673 | 1674 | ||
1674 | err = track_pfn_vma_new(vma, prot, pfn, PAGE_ALIGN(size)); | 1675 | err = track_pfn_vma_new(vma, &prot, pfn, PAGE_ALIGN(size)); |
1675 | if (err) | 1676 | if (err) { |
1677 | /* | ||
1678 | * To indicate that track_pfn related cleanup is not | ||
1679 | * needed from higher level routine calling unmap_vmas | ||
1680 | */ | ||
1681 | vma->vm_flags &= ~(VM_IO | VM_RESERVED | VM_PFNMAP); | ||
1676 | return -EINVAL; | 1682 | return -EINVAL; |
1683 | } | ||
1677 | 1684 | ||
1678 | BUG_ON(addr >= end); | 1685 | BUG_ON(addr >= end); |
1679 | pfn -= addr >> PAGE_SHIFT; | 1686 | pfn -= addr >> PAGE_SHIFT; |
@@ -3165,6 +3172,15 @@ void print_vma_addr(char *prefix, unsigned long ip) | |||
3165 | #ifdef CONFIG_PROVE_LOCKING | 3172 | #ifdef CONFIG_PROVE_LOCKING |
3166 | void might_fault(void) | 3173 | void might_fault(void) |
3167 | { | 3174 | { |
3175 | /* | ||
3176 | * Some code (nfs/sunrpc) uses socket ops on kernel memory while | ||
3177 | * holding the mmap_sem, this is safe because kernel memory doesn't | ||
3178 | * get paged out, therefore we'll never actually fault, and the | ||
3179 | * below annotations will generate false positives. | ||
3180 | */ | ||
3181 | if (segment_eq(get_fs(), KERNEL_DS)) | ||
3182 | return; | ||
3183 | |||
3168 | might_sleep(); | 3184 | might_sleep(); |
3169 | /* | 3185 | /* |
3170 | * it would be nicer only to annotate paths which are not under | 3186 | * it would be nicer only to annotate paths which are not under |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index e412ffa8e52e..3eb4a6fdc043 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -1068,10 +1068,9 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode, | |||
1068 | return copy_to_user(mask, nodes_addr(*nodes), copy) ? -EFAULT : 0; | 1068 | return copy_to_user(mask, nodes_addr(*nodes), copy) ? -EFAULT : 0; |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, | 1071 | SYSCALL_DEFINE6(mbind, unsigned long, start, unsigned long, len, |
1072 | unsigned long mode, | 1072 | unsigned long, mode, unsigned long __user *, nmask, |
1073 | unsigned long __user *nmask, unsigned long maxnode, | 1073 | unsigned long, maxnode, unsigned, flags) |
1074 | unsigned flags) | ||
1075 | { | 1074 | { |
1076 | nodemask_t nodes; | 1075 | nodemask_t nodes; |
1077 | int err; | 1076 | int err; |
@@ -1091,8 +1090,8 @@ asmlinkage long sys_mbind(unsigned long start, unsigned long len, | |||
1091 | } | 1090 | } |
1092 | 1091 | ||
1093 | /* Set the process memory policy */ | 1092 | /* Set the process memory policy */ |
1094 | asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, | 1093 | SYSCALL_DEFINE3(set_mempolicy, int, mode, unsigned long __user *, nmask, |
1095 | unsigned long maxnode) | 1094 | unsigned long, maxnode) |
1096 | { | 1095 | { |
1097 | int err; | 1096 | int err; |
1098 | nodemask_t nodes; | 1097 | nodemask_t nodes; |
@@ -1110,9 +1109,9 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, | |||
1110 | return do_set_mempolicy(mode, flags, &nodes); | 1109 | return do_set_mempolicy(mode, flags, &nodes); |
1111 | } | 1110 | } |
1112 | 1111 | ||
1113 | asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, | 1112 | SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, |
1114 | const unsigned long __user *old_nodes, | 1113 | const unsigned long __user *, old_nodes, |
1115 | const unsigned long __user *new_nodes) | 1114 | const unsigned long __user *, new_nodes) |
1116 | { | 1115 | { |
1117 | const struct cred *cred = current_cred(), *tcred; | 1116 | const struct cred *cred = current_cred(), *tcred; |
1118 | struct mm_struct *mm; | 1117 | struct mm_struct *mm; |
@@ -1185,10 +1184,9 @@ out: | |||
1185 | 1184 | ||
1186 | 1185 | ||
1187 | /* Retrieve NUMA policy */ | 1186 | /* Retrieve NUMA policy */ |
1188 | asmlinkage long sys_get_mempolicy(int __user *policy, | 1187 | SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, |
1189 | unsigned long __user *nmask, | 1188 | unsigned long __user *, nmask, unsigned long, maxnode, |
1190 | unsigned long maxnode, | 1189 | unsigned long, addr, unsigned long, flags) |
1191 | unsigned long addr, unsigned long flags) | ||
1192 | { | 1190 | { |
1193 | int err; | 1191 | int err; |
1194 | int uninitialized_var(pval); | 1192 | int uninitialized_var(pval); |
diff --git a/mm/migrate.c b/mm/migrate.c index a30ea5fcf9f1..2bb4e1d63520 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -1055,10 +1055,10 @@ out: | |||
1055 | * Move a list of pages in the address space of the currently executing | 1055 | * Move a list of pages in the address space of the currently executing |
1056 | * process. | 1056 | * process. |
1057 | */ | 1057 | */ |
1058 | asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages, | 1058 | SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, |
1059 | const void __user * __user *pages, | 1059 | const void __user * __user *, pages, |
1060 | const int __user *nodes, | 1060 | const int __user *, nodes, |
1061 | int __user *status, int flags) | 1061 | int __user *, status, int, flags) |
1062 | { | 1062 | { |
1063 | const struct cred *cred = current_cred(), *tcred; | 1063 | const struct cred *cred = current_cred(), *tcred; |
1064 | struct task_struct *task; | 1064 | struct task_struct *task; |
diff --git a/mm/mincore.c b/mm/mincore.c index 5178800bc129..8cb508f84ea4 100644 --- a/mm/mincore.c +++ b/mm/mincore.c | |||
@@ -177,8 +177,8 @@ none_mapped: | |||
177 | * mapped | 177 | * mapped |
178 | * -EAGAIN - A kernel resource was temporarily unavailable. | 178 | * -EAGAIN - A kernel resource was temporarily unavailable. |
179 | */ | 179 | */ |
180 | asmlinkage long sys_mincore(unsigned long start, size_t len, | 180 | SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len, |
181 | unsigned char __user * vec) | 181 | unsigned char __user *, vec) |
182 | { | 182 | { |
183 | long retval; | 183 | long retval; |
184 | unsigned long pages; | 184 | unsigned long pages; |
diff --git a/mm/mlock.c b/mm/mlock.c index e125156c664e..2904a347e476 100644 --- a/mm/mlock.c +++ b/mm/mlock.c | |||
@@ -530,7 +530,7 @@ static int do_mlock(unsigned long start, size_t len, int on) | |||
530 | return error; | 530 | return error; |
531 | } | 531 | } |
532 | 532 | ||
533 | asmlinkage long sys_mlock(unsigned long start, size_t len) | 533 | SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len) |
534 | { | 534 | { |
535 | unsigned long locked; | 535 | unsigned long locked; |
536 | unsigned long lock_limit; | 536 | unsigned long lock_limit; |
@@ -558,7 +558,7 @@ asmlinkage long sys_mlock(unsigned long start, size_t len) | |||
558 | return error; | 558 | return error; |
559 | } | 559 | } |
560 | 560 | ||
561 | asmlinkage long sys_munlock(unsigned long start, size_t len) | 561 | SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) |
562 | { | 562 | { |
563 | int ret; | 563 | int ret; |
564 | 564 | ||
@@ -595,7 +595,7 @@ out: | |||
595 | return 0; | 595 | return 0; |
596 | } | 596 | } |
597 | 597 | ||
598 | asmlinkage long sys_mlockall(int flags) | 598 | SYSCALL_DEFINE1(mlockall, int, flags) |
599 | { | 599 | { |
600 | unsigned long lock_limit; | 600 | unsigned long lock_limit; |
601 | int ret = -EINVAL; | 601 | int ret = -EINVAL; |
@@ -623,7 +623,7 @@ out: | |||
623 | return ret; | 623 | return ret; |
624 | } | 624 | } |
625 | 625 | ||
626 | asmlinkage long sys_munlockall(void) | 626 | SYSCALL_DEFINE0(munlockall) |
627 | { | 627 | { |
628 | int ret; | 628 | int ret; |
629 | 629 | ||
@@ -245,7 +245,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) | |||
245 | return next; | 245 | return next; |
246 | } | 246 | } |
247 | 247 | ||
248 | asmlinkage unsigned long sys_brk(unsigned long brk) | 248 | SYSCALL_DEFINE1(brk, unsigned long, brk) |
249 | { | 249 | { |
250 | unsigned long rlim, retval; | 250 | unsigned long rlim, retval; |
251 | unsigned long newbrk, oldbrk; | 251 | unsigned long newbrk, oldbrk; |
@@ -1948,7 +1948,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) | |||
1948 | 1948 | ||
1949 | EXPORT_SYMBOL(do_munmap); | 1949 | EXPORT_SYMBOL(do_munmap); |
1950 | 1950 | ||
1951 | asmlinkage long sys_munmap(unsigned long addr, size_t len) | 1951 | SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) |
1952 | { | 1952 | { |
1953 | int ret; | 1953 | int ret; |
1954 | struct mm_struct *mm = current->mm; | 1954 | struct mm_struct *mm = current->mm; |
diff --git a/mm/mprotect.c b/mm/mprotect.c index d0f6e7ce09f1..abe2694e13f4 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
@@ -217,8 +217,8 @@ fail: | |||
217 | return error; | 217 | return error; |
218 | } | 218 | } |
219 | 219 | ||
220 | asmlinkage long | 220 | SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, |
221 | sys_mprotect(unsigned long start, size_t len, unsigned long prot) | 221 | unsigned long, prot) |
222 | { | 222 | { |
223 | unsigned long vm_flags, nstart, end, tmp, reqprot; | 223 | unsigned long vm_flags, nstart, end, tmp, reqprot; |
224 | struct vm_area_struct *vma, *prev; | 224 | struct vm_area_struct *vma, *prev; |
diff --git a/mm/mremap.c b/mm/mremap.c index 646de959aa58..a39b7b91be46 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -420,9 +420,9 @@ out_nc: | |||
420 | return ret; | 420 | return ret; |
421 | } | 421 | } |
422 | 422 | ||
423 | asmlinkage unsigned long sys_mremap(unsigned long addr, | 423 | SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, |
424 | unsigned long old_len, unsigned long new_len, | 424 | unsigned long, new_len, unsigned long, flags, |
425 | unsigned long flags, unsigned long new_addr) | 425 | unsigned long, new_addr) |
426 | { | 426 | { |
427 | unsigned long ret; | 427 | unsigned long ret; |
428 | 428 | ||
diff --git a/mm/msync.c b/mm/msync.c index 07dae08cf31c..4083209b7f02 100644 --- a/mm/msync.c +++ b/mm/msync.c | |||
@@ -28,7 +28,7 @@ | |||
28 | * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to | 28 | * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to |
29 | * applications. | 29 | * applications. |
30 | */ | 30 | */ |
31 | asmlinkage long sys_msync(unsigned long start, size_t len, int flags) | 31 | SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) |
32 | { | 32 | { |
33 | unsigned long end; | 33 | unsigned long end; |
34 | struct mm_struct *mm = current->mm; | 34 | struct mm_struct *mm = current->mm; |
diff --git a/mm/nommu.c b/mm/nommu.c index 60ed8375c986..8cee8c8ff0f2 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -416,7 +416,7 @@ EXPORT_SYMBOL(vm_insert_page); | |||
416 | * to a regular file. in this case, the unmapping will need | 416 | * to a regular file. in this case, the unmapping will need |
417 | * to invoke file system routines that need the global lock. | 417 | * to invoke file system routines that need the global lock. |
418 | */ | 418 | */ |
419 | asmlinkage unsigned long sys_brk(unsigned long brk) | 419 | SYSCALL_DEFINE1(brk, unsigned long, brk) |
420 | { | 420 | { |
421 | struct mm_struct *mm = current->mm; | 421 | struct mm_struct *mm = current->mm; |
422 | 422 | ||
@@ -1573,7 +1573,7 @@ erase_whole_vma: | |||
1573 | } | 1573 | } |
1574 | EXPORT_SYMBOL(do_munmap); | 1574 | EXPORT_SYMBOL(do_munmap); |
1575 | 1575 | ||
1576 | asmlinkage long sys_munmap(unsigned long addr, size_t len) | 1576 | SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) |
1577 | { | 1577 | { |
1578 | int ret; | 1578 | int ret; |
1579 | struct mm_struct *mm = current->mm; | 1579 | struct mm_struct *mm = current->mm; |
@@ -1657,10 +1657,9 @@ unsigned long do_mremap(unsigned long addr, | |||
1657 | } | 1657 | } |
1658 | EXPORT_SYMBOL(do_mremap); | 1658 | EXPORT_SYMBOL(do_mremap); |
1659 | 1659 | ||
1660 | asmlinkage | 1660 | SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, |
1661 | unsigned long sys_mremap(unsigned long addr, | 1661 | unsigned long, new_len, unsigned long, flags, |
1662 | unsigned long old_len, unsigned long new_len, | 1662 | unsigned long, new_addr) |
1663 | unsigned long flags, unsigned long new_addr) | ||
1664 | { | 1663 | { |
1665 | unsigned long ret; | 1664 | unsigned long ret; |
1666 | 1665 | ||
diff --git a/mm/swapfile.c b/mm/swapfile.c index da422c47e2ee..f48b831e5e5c 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -1377,7 +1377,7 @@ out: | |||
1377 | return ret; | 1377 | return ret; |
1378 | } | 1378 | } |
1379 | 1379 | ||
1380 | asmlinkage long sys_swapoff(const char __user * specialfile) | 1380 | SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) |
1381 | { | 1381 | { |
1382 | struct swap_info_struct * p = NULL; | 1382 | struct swap_info_struct * p = NULL; |
1383 | unsigned short *swap_map; | 1383 | unsigned short *swap_map; |
@@ -1633,7 +1633,7 @@ late_initcall(max_swapfiles_check); | |||
1633 | * | 1633 | * |
1634 | * The swapon system call | 1634 | * The swapon system call |
1635 | */ | 1635 | */ |
1636 | asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) | 1636 | SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) |
1637 | { | 1637 | { |
1638 | struct swap_info_struct * p; | 1638 | struct swap_info_struct * p; |
1639 | char *name = NULL; | 1639 | char *name = NULL; |
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index c5db9a7264d9..75f49d312e8c 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/highmem.h> | 14 | #include <linux/highmem.h> |
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/mutex.h> | ||
18 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
19 | #include <linux/proc_fs.h> | 18 | #include <linux/proc_fs.h> |
20 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
@@ -24,6 +23,7 @@ | |||
24 | #include <linux/rbtree.h> | 23 | #include <linux/rbtree.h> |
25 | #include <linux/radix-tree.h> | 24 | #include <linux/radix-tree.h> |
26 | #include <linux/rcupdate.h> | 25 | #include <linux/rcupdate.h> |
26 | #include <linux/bootmem.h> | ||
27 | 27 | ||
28 | #include <asm/atomic.h> | 28 | #include <asm/atomic.h> |
29 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
@@ -495,7 +495,7 @@ static atomic_t vmap_lazy_nr = ATOMIC_INIT(0); | |||
495 | static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end, | 495 | static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end, |
496 | int sync, int force_flush) | 496 | int sync, int force_flush) |
497 | { | 497 | { |
498 | static DEFINE_MUTEX(purge_lock); | 498 | static DEFINE_SPINLOCK(purge_lock); |
499 | LIST_HEAD(valist); | 499 | LIST_HEAD(valist); |
500 | struct vmap_area *va; | 500 | struct vmap_area *va; |
501 | int nr = 0; | 501 | int nr = 0; |
@@ -506,10 +506,10 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end, | |||
506 | * the case that isn't actually used at the moment anyway. | 506 | * the case that isn't actually used at the moment anyway. |
507 | */ | 507 | */ |
508 | if (!sync && !force_flush) { | 508 | if (!sync && !force_flush) { |
509 | if (!mutex_trylock(&purge_lock)) | 509 | if (!spin_trylock(&purge_lock)) |
510 | return; | 510 | return; |
511 | } else | 511 | } else |
512 | mutex_lock(&purge_lock); | 512 | spin_lock(&purge_lock); |
513 | 513 | ||
514 | rcu_read_lock(); | 514 | rcu_read_lock(); |
515 | list_for_each_entry_rcu(va, &vmap_area_list, list) { | 515 | list_for_each_entry_rcu(va, &vmap_area_list, list) { |
@@ -541,7 +541,7 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end, | |||
541 | __free_vmap_area(va); | 541 | __free_vmap_area(va); |
542 | spin_unlock(&vmap_area_lock); | 542 | spin_unlock(&vmap_area_lock); |
543 | } | 543 | } |
544 | mutex_unlock(&purge_lock); | 544 | spin_unlock(&purge_lock); |
545 | } | 545 | } |
546 | 546 | ||
547 | /* | 547 | /* |
@@ -984,6 +984,8 @@ EXPORT_SYMBOL(vm_map_ram); | |||
984 | 984 | ||
985 | void __init vmalloc_init(void) | 985 | void __init vmalloc_init(void) |
986 | { | 986 | { |
987 | struct vmap_area *va; | ||
988 | struct vm_struct *tmp; | ||
987 | int i; | 989 | int i; |
988 | 990 | ||
989 | for_each_possible_cpu(i) { | 991 | for_each_possible_cpu(i) { |
@@ -996,6 +998,14 @@ void __init vmalloc_init(void) | |||
996 | vbq->nr_dirty = 0; | 998 | vbq->nr_dirty = 0; |
997 | } | 999 | } |
998 | 1000 | ||
1001 | /* Import existing vmlist entries. */ | ||
1002 | for (tmp = vmlist; tmp; tmp = tmp->next) { | ||
1003 | va = alloc_bootmem(sizeof(struct vmap_area)); | ||
1004 | va->flags = tmp->flags | VM_VM_AREA; | ||
1005 | va->va_start = (unsigned long)tmp->addr; | ||
1006 | va->va_end = va->va_start + tmp->size; | ||
1007 | __insert_vmap_area(va); | ||
1008 | } | ||
999 | vmap_initialized = true; | 1009 | vmap_initialized = true; |
1000 | } | 1010 | } |
1001 | 1011 | ||
diff --git a/net/9p/Kconfig b/net/9p/Kconfig index 0663f99e977a..7ed75c7bd5d1 100644 --- a/net/9p/Kconfig +++ b/net/9p/Kconfig | |||
@@ -23,7 +23,7 @@ config NET_9P_VIRTIO | |||
23 | guest partitions and a host partition. | 23 | guest partitions and a host partition. |
24 | 24 | ||
25 | config NET_9P_RDMA | 25 | config NET_9P_RDMA |
26 | depends on INET && INFINIBAND && EXPERIMENTAL | 26 | depends on INET && INFINIBAND && INFINIBAND_ADDR_TRANS && EXPERIMENTAL |
27 | tristate "9P RDMA Transport (Experimental)" | 27 | tristate "9P RDMA Transport (Experimental)" |
28 | help | 28 | help |
29 | This builds support for an RDMA transport. | 29 | This builds support for an RDMA transport. |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index a65e43a17fbb..cf754ace0b75 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -58,11 +58,11 @@ static struct ctl_table_header *brnf_sysctl_header; | |||
58 | static int brnf_call_iptables __read_mostly = 1; | 58 | static int brnf_call_iptables __read_mostly = 1; |
59 | static int brnf_call_ip6tables __read_mostly = 1; | 59 | static int brnf_call_ip6tables __read_mostly = 1; |
60 | static int brnf_call_arptables __read_mostly = 1; | 60 | static int brnf_call_arptables __read_mostly = 1; |
61 | static int brnf_filter_vlan_tagged __read_mostly = 1; | 61 | static int brnf_filter_vlan_tagged __read_mostly = 0; |
62 | static int brnf_filter_pppoe_tagged __read_mostly = 1; | 62 | static int brnf_filter_pppoe_tagged __read_mostly = 0; |
63 | #else | 63 | #else |
64 | #define brnf_filter_vlan_tagged 1 | 64 | #define brnf_filter_vlan_tagged 0 |
65 | #define brnf_filter_pppoe_tagged 1 | 65 | #define brnf_filter_pppoe_tagged 0 |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | static inline __be16 vlan_proto(const struct sk_buff *skb) | 68 | static inline __be16 vlan_proto(const struct sk_buff *skb) |
@@ -686,8 +686,11 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb, | |||
686 | if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) || | 686 | if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) || |
687 | IS_PPPOE_IP(skb)) | 687 | IS_PPPOE_IP(skb)) |
688 | pf = PF_INET; | 688 | pf = PF_INET; |
689 | else | 689 | else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) || |
690 | IS_PPPOE_IPV6(skb)) | ||
690 | pf = PF_INET6; | 691 | pf = PF_INET6; |
692 | else | ||
693 | return NF_ACCEPT; | ||
691 | 694 | ||
692 | nf_bridge_pull_encap_header(skb); | 695 | nf_bridge_pull_encap_header(skb); |
693 | 696 | ||
@@ -828,8 +831,11 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb, | |||
828 | if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) || | 831 | if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) || |
829 | IS_PPPOE_IP(skb)) | 832 | IS_PPPOE_IP(skb)) |
830 | pf = PF_INET; | 833 | pf = PF_INET; |
831 | else | 834 | else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) || |
835 | IS_PPPOE_IPV6(skb)) | ||
832 | pf = PF_INET6; | 836 | pf = PF_INET6; |
837 | else | ||
838 | return NF_ACCEPT; | ||
833 | 839 | ||
834 | #ifdef CONFIG_NETFILTER_DEBUG | 840 | #ifdef CONFIG_NETFILTER_DEBUG |
835 | if (skb->dst == NULL) { | 841 | if (skb->dst == NULL) { |
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index fa108c46e851..820252aee81f 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
@@ -79,18 +79,19 @@ static inline int ebt_do_match (struct ebt_entry_match *m, | |||
79 | { | 79 | { |
80 | par->match = m->u.match; | 80 | par->match = m->u.match; |
81 | par->matchinfo = m->data; | 81 | par->matchinfo = m->data; |
82 | return m->u.match->match(skb, par); | 82 | return m->u.match->match(skb, par) ? EBT_MATCH : EBT_NOMATCH; |
83 | } | 83 | } |
84 | 84 | ||
85 | static inline int ebt_dev_check(char *entry, const struct net_device *device) | 85 | static inline int ebt_dev_check(char *entry, const struct net_device *device) |
86 | { | 86 | { |
87 | int i = 0; | 87 | int i = 0; |
88 | const char *devname = device->name; | 88 | const char *devname; |
89 | 89 | ||
90 | if (*entry == '\0') | 90 | if (*entry == '\0') |
91 | return 0; | 91 | return 0; |
92 | if (!device) | 92 | if (!device) |
93 | return 1; | 93 | return 1; |
94 | devname = device->name; | ||
94 | /* 1 is the wildcard token */ | 95 | /* 1 is the wildcard token */ |
95 | while (entry[i] != '\0' && entry[i] != 1 && entry[i] == devname[i]) | 96 | while (entry[i] != '\0' && entry[i] != 1 && entry[i] == devname[i]) |
96 | i++; | 97 | i++; |
diff --git a/net/can/bcm.c b/net/can/bcm.c index 1649c8ab2c2f..b7c7d4651136 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -347,51 +347,54 @@ static void bcm_tx_timeout_tsklet(unsigned long data) | |||
347 | struct bcm_op *op = (struct bcm_op *)data; | 347 | struct bcm_op *op = (struct bcm_op *)data; |
348 | struct bcm_msg_head msg_head; | 348 | struct bcm_msg_head msg_head; |
349 | 349 | ||
350 | /* create notification to user */ | ||
351 | msg_head.opcode = TX_EXPIRED; | ||
352 | msg_head.flags = op->flags; | ||
353 | msg_head.count = op->count; | ||
354 | msg_head.ival1 = op->ival1; | ||
355 | msg_head.ival2 = op->ival2; | ||
356 | msg_head.can_id = op->can_id; | ||
357 | msg_head.nframes = 0; | ||
358 | |||
359 | bcm_send_to_user(op, &msg_head, NULL, 0); | ||
360 | } | ||
361 | |||
362 | /* | ||
363 | * bcm_tx_timeout_handler - performes cyclic CAN frame transmissions | ||
364 | */ | ||
365 | static enum hrtimer_restart bcm_tx_timeout_handler(struct hrtimer *hrtimer) | ||
366 | { | ||
367 | struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); | ||
368 | enum hrtimer_restart ret = HRTIMER_NORESTART; | ||
369 | |||
370 | if (op->kt_ival1.tv64 && (op->count > 0)) { | 350 | if (op->kt_ival1.tv64 && (op->count > 0)) { |
371 | 351 | ||
372 | op->count--; | 352 | op->count--; |
373 | if (!op->count && (op->flags & TX_COUNTEVT)) | 353 | if (!op->count && (op->flags & TX_COUNTEVT)) { |
374 | tasklet_schedule(&op->tsklet); | 354 | |
355 | /* create notification to user */ | ||
356 | msg_head.opcode = TX_EXPIRED; | ||
357 | msg_head.flags = op->flags; | ||
358 | msg_head.count = op->count; | ||
359 | msg_head.ival1 = op->ival1; | ||
360 | msg_head.ival2 = op->ival2; | ||
361 | msg_head.can_id = op->can_id; | ||
362 | msg_head.nframes = 0; | ||
363 | |||
364 | bcm_send_to_user(op, &msg_head, NULL, 0); | ||
365 | } | ||
375 | } | 366 | } |
376 | 367 | ||
377 | if (op->kt_ival1.tv64 && (op->count > 0)) { | 368 | if (op->kt_ival1.tv64 && (op->count > 0)) { |
378 | 369 | ||
379 | /* send (next) frame */ | 370 | /* send (next) frame */ |
380 | bcm_can_tx(op); | 371 | bcm_can_tx(op); |
381 | hrtimer_forward(hrtimer, ktime_get(), op->kt_ival1); | 372 | hrtimer_start(&op->timer, |
382 | ret = HRTIMER_RESTART; | 373 | ktime_add(ktime_get(), op->kt_ival1), |
374 | HRTIMER_MODE_ABS); | ||
383 | 375 | ||
384 | } else { | 376 | } else { |
385 | if (op->kt_ival2.tv64) { | 377 | if (op->kt_ival2.tv64) { |
386 | 378 | ||
387 | /* send (next) frame */ | 379 | /* send (next) frame */ |
388 | bcm_can_tx(op); | 380 | bcm_can_tx(op); |
389 | hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2); | 381 | hrtimer_start(&op->timer, |
390 | ret = HRTIMER_RESTART; | 382 | ktime_add(ktime_get(), op->kt_ival2), |
383 | HRTIMER_MODE_ABS); | ||
391 | } | 384 | } |
392 | } | 385 | } |
386 | } | ||
393 | 387 | ||
394 | return ret; | 388 | /* |
389 | * bcm_tx_timeout_handler - performes cyclic CAN frame transmissions | ||
390 | */ | ||
391 | static enum hrtimer_restart bcm_tx_timeout_handler(struct hrtimer *hrtimer) | ||
392 | { | ||
393 | struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); | ||
394 | |||
395 | tasklet_schedule(&op->tsklet); | ||
396 | |||
397 | return HRTIMER_NORESTART; | ||
395 | } | 398 | } |
396 | 399 | ||
397 | /* | 400 | /* |
diff --git a/net/core/dev.c b/net/core/dev.c index 5f736f1ceeae..8d675975d85b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1088,6 +1088,11 @@ int dev_open(struct net_device *dev) | |||
1088 | dev->flags |= IFF_UP; | 1088 | dev->flags |= IFF_UP; |
1089 | 1089 | ||
1090 | /* | 1090 | /* |
1091 | * Enable NET_DMA | ||
1092 | */ | ||
1093 | dmaengine_get(); | ||
1094 | |||
1095 | /* | ||
1091 | * Initialize multicasting status | 1096 | * Initialize multicasting status |
1092 | */ | 1097 | */ |
1093 | dev_set_rx_mode(dev); | 1098 | dev_set_rx_mode(dev); |
@@ -1164,6 +1169,11 @@ int dev_close(struct net_device *dev) | |||
1164 | */ | 1169 | */ |
1165 | call_netdevice_notifiers(NETDEV_DOWN, dev); | 1170 | call_netdevice_notifiers(NETDEV_DOWN, dev); |
1166 | 1171 | ||
1172 | /* | ||
1173 | * Shutdown NET_DMA | ||
1174 | */ | ||
1175 | dmaengine_put(); | ||
1176 | |||
1167 | return 0; | 1177 | return 0; |
1168 | } | 1178 | } |
1169 | 1179 | ||
@@ -2382,6 +2392,9 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) | |||
2382 | if (!(skb->dev->features & NETIF_F_GRO)) | 2392 | if (!(skb->dev->features & NETIF_F_GRO)) |
2383 | goto normal; | 2393 | goto normal; |
2384 | 2394 | ||
2395 | if (skb_is_gso(skb) || skb_shinfo(skb)->frag_list) | ||
2396 | goto normal; | ||
2397 | |||
2385 | rcu_read_lock(); | 2398 | rcu_read_lock(); |
2386 | list_for_each_entry_rcu(ptype, head, list) { | 2399 | list_for_each_entry_rcu(ptype, head, list) { |
2387 | struct sk_buff *p; | 2400 | struct sk_buff *p; |
@@ -2478,12 +2491,6 @@ EXPORT_SYMBOL(napi_gro_receive); | |||
2478 | 2491 | ||
2479 | void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) | 2492 | void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) |
2480 | { | 2493 | { |
2481 | skb_shinfo(skb)->nr_frags = 0; | ||
2482 | |||
2483 | skb->len -= skb->data_len; | ||
2484 | skb->truesize -= skb->data_len; | ||
2485 | skb->data_len = 0; | ||
2486 | |||
2487 | __skb_pull(skb, skb_headlen(skb)); | 2494 | __skb_pull(skb, skb_headlen(skb)); |
2488 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); | 2495 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); |
2489 | 2496 | ||
@@ -4424,6 +4431,45 @@ err_uninit: | |||
4424 | } | 4431 | } |
4425 | 4432 | ||
4426 | /** | 4433 | /** |
4434 | * init_dummy_netdev - init a dummy network device for NAPI | ||
4435 | * @dev: device to init | ||
4436 | * | ||
4437 | * This takes a network device structure and initialize the minimum | ||
4438 | * amount of fields so it can be used to schedule NAPI polls without | ||
4439 | * registering a full blown interface. This is to be used by drivers | ||
4440 | * that need to tie several hardware interfaces to a single NAPI | ||
4441 | * poll scheduler due to HW limitations. | ||
4442 | */ | ||
4443 | int init_dummy_netdev(struct net_device *dev) | ||
4444 | { | ||
4445 | /* Clear everything. Note we don't initialize spinlocks | ||
4446 | * are they aren't supposed to be taken by any of the | ||
4447 | * NAPI code and this dummy netdev is supposed to be | ||
4448 | * only ever used for NAPI polls | ||
4449 | */ | ||
4450 | memset(dev, 0, sizeof(struct net_device)); | ||
4451 | |||
4452 | /* make sure we BUG if trying to hit standard | ||
4453 | * register/unregister code path | ||
4454 | */ | ||
4455 | dev->reg_state = NETREG_DUMMY; | ||
4456 | |||
4457 | /* initialize the ref count */ | ||
4458 | atomic_set(&dev->refcnt, 1); | ||
4459 | |||
4460 | /* NAPI wants this */ | ||
4461 | INIT_LIST_HEAD(&dev->napi_list); | ||
4462 | |||
4463 | /* a dummy interface is started by default */ | ||
4464 | set_bit(__LINK_STATE_PRESENT, &dev->state); | ||
4465 | set_bit(__LINK_STATE_START, &dev->state); | ||
4466 | |||
4467 | return 0; | ||
4468 | } | ||
4469 | EXPORT_SYMBOL_GPL(init_dummy_netdev); | ||
4470 | |||
4471 | |||
4472 | /** | ||
4427 | * register_netdev - register a network device | 4473 | * register_netdev - register a network device |
4428 | * @dev: device to register | 4474 | * @dev: device to register |
4429 | * | 4475 | * |
@@ -5151,9 +5197,6 @@ static int __init net_dev_init(void) | |||
5151 | hotcpu_notifier(dev_cpu_callback, 0); | 5197 | hotcpu_notifier(dev_cpu_callback, 0); |
5152 | dst_init(); | 5198 | dst_init(); |
5153 | dev_mcast_init(); | 5199 | dev_mcast_init(); |
5154 | #ifdef CONFIG_NET_DMA | ||
5155 | dmaengine_get(); | ||
5156 | #endif | ||
5157 | rc = 0; | 5200 | rc = 0; |
5158 | out: | 5201 | out: |
5159 | return rc; | 5202 | return rc; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 5110b359c758..65eac7739033 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2602,6 +2602,12 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2602 | skb_shinfo(skb)->nr_frags * sizeof(skb_frag_t)); | 2602 | skb_shinfo(skb)->nr_frags * sizeof(skb_frag_t)); |
2603 | 2603 | ||
2604 | skb_shinfo(p)->nr_frags += skb_shinfo(skb)->nr_frags; | 2604 | skb_shinfo(p)->nr_frags += skb_shinfo(skb)->nr_frags; |
2605 | skb_shinfo(skb)->nr_frags = 0; | ||
2606 | |||
2607 | skb->truesize -= skb->data_len; | ||
2608 | skb->len -= skb->data_len; | ||
2609 | skb->data_len = 0; | ||
2610 | |||
2605 | NAPI_GRO_CB(skb)->free = 1; | 2611 | NAPI_GRO_CB(skb)->free = 1; |
2606 | goto done; | 2612 | goto done; |
2607 | } | 2613 | } |
diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig index b28bf962edc3..4b5db44970aa 100644 --- a/net/dccp/ccids/Kconfig +++ b/net/dccp/ccids/Kconfig | |||
@@ -29,7 +29,7 @@ config IP_DCCP_CCID3 | |||
29 | http://www.ietf.org/rfc/rfc4342.txt | 29 | http://www.ietf.org/rfc/rfc4342.txt |
30 | 30 | ||
31 | The TFRC congestion control algorithms were initially described in | 31 | The TFRC congestion control algorithms were initially described in |
32 | RFC 5448. | 32 | RFC 5348. |
33 | 33 | ||
34 | This text was extracted from RFC 4340 (sec. 10.2), | 34 | This text was extracted from RFC 4340 (sec. 10.2), |
35 | http://www.ietf.org/rfc/rfc4340.txt | 35 | http://www.ietf.org/rfc/rfc4340.txt |
diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c index 60c412ccfeef..4902029854d8 100644 --- a/net/dccp/ccids/lib/tfrc.c +++ b/net/dccp/ccids/lib/tfrc.c | |||
@@ -36,7 +36,7 @@ out: | |||
36 | return rc; | 36 | return rc; |
37 | } | 37 | } |
38 | 38 | ||
39 | void __exit tfrc_lib_exit(void) | 39 | void tfrc_lib_exit(void) |
40 | { | 40 | { |
41 | tfrc_rx_packet_history_exit(); | 41 | tfrc_rx_packet_history_exit(); |
42 | tfrc_tx_packet_history_exit(); | 42 | tfrc_tx_packet_history_exit(); |
diff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c index c9224310ebae..52cb6939d093 100644 --- a/net/ipv4/netfilter/iptable_filter.c +++ b/net/ipv4/netfilter/iptable_filter.c | |||
@@ -93,13 +93,8 @@ ipt_local_out_hook(unsigned int hook, | |||
93 | { | 93 | { |
94 | /* root is playing with raw sockets. */ | 94 | /* root is playing with raw sockets. */ |
95 | if (skb->len < sizeof(struct iphdr) || | 95 | if (skb->len < sizeof(struct iphdr) || |
96 | ip_hdrlen(skb) < sizeof(struct iphdr)) { | 96 | ip_hdrlen(skb) < sizeof(struct iphdr)) |
97 | if (net_ratelimit()) | ||
98 | printk("iptable_filter: ignoring short SOCK_RAW " | ||
99 | "packet.\n"); | ||
100 | return NF_ACCEPT; | 97 | return NF_ACCEPT; |
101 | } | ||
102 | |||
103 | return ipt_do_table(skb, hook, in, out, | 98 | return ipt_do_table(skb, hook, in, out, |
104 | dev_net(out)->ipv4.iptable_filter); | 99 | dev_net(out)->ipv4.iptable_filter); |
105 | } | 100 | } |
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c index 69f2c4287146..3929d20b9e45 100644 --- a/net/ipv4/netfilter/iptable_mangle.c +++ b/net/ipv4/netfilter/iptable_mangle.c | |||
@@ -132,12 +132,8 @@ ipt_local_hook(unsigned int hook, | |||
132 | 132 | ||
133 | /* root is playing with raw sockets. */ | 133 | /* root is playing with raw sockets. */ |
134 | if (skb->len < sizeof(struct iphdr) | 134 | if (skb->len < sizeof(struct iphdr) |
135 | || ip_hdrlen(skb) < sizeof(struct iphdr)) { | 135 | || ip_hdrlen(skb) < sizeof(struct iphdr)) |
136 | if (net_ratelimit()) | ||
137 | printk("iptable_mangle: ignoring short SOCK_RAW " | ||
138 | "packet.\n"); | ||
139 | return NF_ACCEPT; | 136 | return NF_ACCEPT; |
140 | } | ||
141 | 137 | ||
142 | /* Save things which could affect route */ | 138 | /* Save things which could affect route */ |
143 | mark = skb->mark; | 139 | mark = skb->mark; |
diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c index 8faebfe638f1..7f65d18333e3 100644 --- a/net/ipv4/netfilter/iptable_raw.c +++ b/net/ipv4/netfilter/iptable_raw.c | |||
@@ -65,12 +65,8 @@ ipt_local_hook(unsigned int hook, | |||
65 | { | 65 | { |
66 | /* root is playing with raw sockets. */ | 66 | /* root is playing with raw sockets. */ |
67 | if (skb->len < sizeof(struct iphdr) || | 67 | if (skb->len < sizeof(struct iphdr) || |
68 | ip_hdrlen(skb) < sizeof(struct iphdr)) { | 68 | ip_hdrlen(skb) < sizeof(struct iphdr)) |
69 | if (net_ratelimit()) | ||
70 | printk("iptable_raw: ignoring short SOCK_RAW " | ||
71 | "packet.\n"); | ||
72 | return NF_ACCEPT; | 69 | return NF_ACCEPT; |
73 | } | ||
74 | return ipt_do_table(skb, hook, in, out, | 70 | return ipt_do_table(skb, hook, in, out, |
75 | dev_net(out)->ipv4.iptable_raw); | 71 | dev_net(out)->ipv4.iptable_raw); |
76 | } | 72 | } |
diff --git a/net/ipv4/netfilter/iptable_security.c b/net/ipv4/netfilter/iptable_security.c index 36f3be3cc428..a52a35f4a584 100644 --- a/net/ipv4/netfilter/iptable_security.c +++ b/net/ipv4/netfilter/iptable_security.c | |||
@@ -96,12 +96,8 @@ ipt_local_out_hook(unsigned int hook, | |||
96 | { | 96 | { |
97 | /* Somebody is playing with raw sockets. */ | 97 | /* Somebody is playing with raw sockets. */ |
98 | if (skb->len < sizeof(struct iphdr) | 98 | if (skb->len < sizeof(struct iphdr) |
99 | || ip_hdrlen(skb) < sizeof(struct iphdr)) { | 99 | || ip_hdrlen(skb) < sizeof(struct iphdr)) |
100 | if (net_ratelimit()) | ||
101 | printk(KERN_INFO "iptable_security: ignoring short " | ||
102 | "SOCK_RAW packet.\n"); | ||
103 | return NF_ACCEPT; | 100 | return NF_ACCEPT; |
104 | } | ||
105 | return ipt_do_table(skb, hook, in, out, | 101 | return ipt_do_table(skb, hook, in, out, |
106 | dev_net(out)->ipv4.iptable_security); | 102 | dev_net(out)->ipv4.iptable_security); |
107 | } | 103 | } |
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c index b2141e11575e..4beb04fac588 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | |||
@@ -145,11 +145,8 @@ static unsigned int ipv4_conntrack_local(unsigned int hooknum, | |||
145 | { | 145 | { |
146 | /* root is playing with raw sockets. */ | 146 | /* root is playing with raw sockets. */ |
147 | if (skb->len < sizeof(struct iphdr) || | 147 | if (skb->len < sizeof(struct iphdr) || |
148 | ip_hdrlen(skb) < sizeof(struct iphdr)) { | 148 | ip_hdrlen(skb) < sizeof(struct iphdr)) |
149 | if (net_ratelimit()) | ||
150 | printk("ipt_hook: happy cracking.\n"); | ||
151 | return NF_ACCEPT; | 149 | return NF_ACCEPT; |
152 | } | ||
153 | return nf_conntrack_in(dev_net(out), PF_INET, hooknum, skb); | 150 | return nf_conntrack_in(dev_net(out), PF_INET, hooknum, skb); |
154 | } | 151 | } |
155 | 152 | ||
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c index 1fd3ef7718b6..2a8bee26f43d 100644 --- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c +++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <net/netfilter/nf_conntrack_core.h> | 20 | #include <net/netfilter/nf_conntrack_core.h> |
21 | #include <net/netfilter/nf_log.h> | 21 | #include <net/netfilter/nf_log.h> |
22 | 22 | ||
23 | static unsigned long nf_ct_icmp_timeout __read_mostly = 30*HZ; | 23 | static unsigned int nf_ct_icmp_timeout __read_mostly = 30*HZ; |
24 | 24 | ||
25 | static bool icmp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, | 25 | static bool icmp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, |
26 | struct nf_conntrack_tuple *tuple) | 26 | struct nf_conntrack_tuple *tuple) |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index ce572f9dff02..0cd71b84e483 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -522,8 +522,12 @@ static int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, | |||
522 | unsigned int offset, size_t len) | 522 | unsigned int offset, size_t len) |
523 | { | 523 | { |
524 | struct tcp_splice_state *tss = rd_desc->arg.data; | 524 | struct tcp_splice_state *tss = rd_desc->arg.data; |
525 | int ret; | ||
525 | 526 | ||
526 | return skb_splice_bits(skb, offset, tss->pipe, tss->len, tss->flags); | 527 | ret = skb_splice_bits(skb, offset, tss->pipe, rd_desc->count, tss->flags); |
528 | if (ret > 0) | ||
529 | rd_desc->count -= ret; | ||
530 | return ret; | ||
527 | } | 531 | } |
528 | 532 | ||
529 | static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss) | 533 | static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss) |
@@ -531,6 +535,7 @@ static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss) | |||
531 | /* Store TCP splice context information in read_descriptor_t. */ | 535 | /* Store TCP splice context information in read_descriptor_t. */ |
532 | read_descriptor_t rd_desc = { | 536 | read_descriptor_t rd_desc = { |
533 | .arg.data = tss, | 537 | .arg.data = tss, |
538 | .count = tss->len, | ||
534 | }; | 539 | }; |
535 | 540 | ||
536 | return tcp_read_sock(sk, &rd_desc, tcp_splice_data_recv); | 541 | return tcp_read_sock(sk, &rd_desc, tcp_splice_data_recv); |
@@ -611,11 +616,13 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, | |||
611 | tss.len -= ret; | 616 | tss.len -= ret; |
612 | spliced += ret; | 617 | spliced += ret; |
613 | 618 | ||
619 | if (!timeo) | ||
620 | break; | ||
614 | release_sock(sk); | 621 | release_sock(sk); |
615 | lock_sock(sk); | 622 | lock_sock(sk); |
616 | 623 | ||
617 | if (sk->sk_err || sk->sk_state == TCP_CLOSE || | 624 | if (sk->sk_err || sk->sk_state == TCP_CLOSE || |
618 | (sk->sk_shutdown & RCV_SHUTDOWN) || !timeo || | 625 | (sk->sk_shutdown & RCV_SHUTDOWN) || |
619 | signal_pending(current)) | 626 | signal_pending(current)) |
620 | break; | 627 | break; |
621 | } | 628 | } |
@@ -2382,7 +2389,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2382 | unsigned int seq; | 2389 | unsigned int seq; |
2383 | __be32 delta; | 2390 | __be32 delta; |
2384 | unsigned int oldlen; | 2391 | unsigned int oldlen; |
2385 | unsigned int len; | 2392 | unsigned int mss; |
2386 | 2393 | ||
2387 | if (!pskb_may_pull(skb, sizeof(*th))) | 2394 | if (!pskb_may_pull(skb, sizeof(*th))) |
2388 | goto out; | 2395 | goto out; |
@@ -2398,10 +2405,13 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2398 | oldlen = (u16)~skb->len; | 2405 | oldlen = (u16)~skb->len; |
2399 | __skb_pull(skb, thlen); | 2406 | __skb_pull(skb, thlen); |
2400 | 2407 | ||
2408 | mss = skb_shinfo(skb)->gso_size; | ||
2409 | if (unlikely(skb->len <= mss)) | ||
2410 | goto out; | ||
2411 | |||
2401 | if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) { | 2412 | if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) { |
2402 | /* Packet is from an untrusted source, reset gso_segs. */ | 2413 | /* Packet is from an untrusted source, reset gso_segs. */ |
2403 | int type = skb_shinfo(skb)->gso_type; | 2414 | int type = skb_shinfo(skb)->gso_type; |
2404 | int mss; | ||
2405 | 2415 | ||
2406 | if (unlikely(type & | 2416 | if (unlikely(type & |
2407 | ~(SKB_GSO_TCPV4 | | 2417 | ~(SKB_GSO_TCPV4 | |
@@ -2412,7 +2422,6 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2412 | !(type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))) | 2422 | !(type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))) |
2413 | goto out; | 2423 | goto out; |
2414 | 2424 | ||
2415 | mss = skb_shinfo(skb)->gso_size; | ||
2416 | skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss); | 2425 | skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss); |
2417 | 2426 | ||
2418 | segs = NULL; | 2427 | segs = NULL; |
@@ -2423,8 +2432,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2423 | if (IS_ERR(segs)) | 2432 | if (IS_ERR(segs)) |
2424 | goto out; | 2433 | goto out; |
2425 | 2434 | ||
2426 | len = skb_shinfo(skb)->gso_size; | 2435 | delta = htonl(oldlen + (thlen + mss)); |
2427 | delta = htonl(oldlen + (thlen + len)); | ||
2428 | 2436 | ||
2429 | skb = segs; | 2437 | skb = segs; |
2430 | th = tcp_hdr(skb); | 2438 | th = tcp_hdr(skb); |
@@ -2440,7 +2448,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2440 | csum_fold(csum_partial(skb_transport_header(skb), | 2448 | csum_fold(csum_partial(skb_transport_header(skb), |
2441 | thlen, skb->csum)); | 2449 | thlen, skb->csum)); |
2442 | 2450 | ||
2443 | seq += len; | 2451 | seq += mss; |
2444 | skb = skb->next; | 2452 | skb = skb->next; |
2445 | th = tcp_hdr(skb); | 2453 | th = tcp_hdr(skb); |
2446 | 2454 | ||
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 29c7c99e69f7..52ee1dced2ff 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -298,6 +298,10 @@ static void fib6_dump_end(struct netlink_callback *cb) | |||
298 | struct fib6_walker_t *w = (void*)cb->args[2]; | 298 | struct fib6_walker_t *w = (void*)cb->args[2]; |
299 | 299 | ||
300 | if (w) { | 300 | if (w) { |
301 | if (cb->args[4]) { | ||
302 | cb->args[4] = 0; | ||
303 | fib6_walker_unlink(w); | ||
304 | } | ||
301 | cb->args[2] = 0; | 305 | cb->args[2] = 0; |
302 | kfree(w); | 306 | kfree(w); |
303 | } | 307 | } |
@@ -330,15 +334,12 @@ static int fib6_dump_table(struct fib6_table *table, struct sk_buff *skb, | |||
330 | read_lock_bh(&table->tb6_lock); | 334 | read_lock_bh(&table->tb6_lock); |
331 | res = fib6_walk_continue(w); | 335 | res = fib6_walk_continue(w); |
332 | read_unlock_bh(&table->tb6_lock); | 336 | read_unlock_bh(&table->tb6_lock); |
333 | if (res != 0) { | 337 | if (res <= 0) { |
334 | if (res < 0) | 338 | fib6_walker_unlink(w); |
335 | fib6_walker_unlink(w); | 339 | cb->args[4] = 0; |
336 | goto end; | ||
337 | } | 340 | } |
338 | fib6_walker_unlink(w); | ||
339 | cb->args[4] = 0; | ||
340 | } | 341 | } |
341 | end: | 342 | |
342 | return res; | 343 | return res; |
343 | } | 344 | } |
344 | 345 | ||
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c index bd52151d31e9..c455cf4ee756 100644 --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h> | 26 | #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h> |
27 | #include <net/netfilter/nf_log.h> | 27 | #include <net/netfilter/nf_log.h> |
28 | 28 | ||
29 | static unsigned long nf_ct_icmpv6_timeout __read_mostly = 30*HZ; | 29 | static unsigned int nf_ct_icmpv6_timeout __read_mostly = 30*HZ; |
30 | 30 | ||
31 | static bool icmpv6_pkt_to_tuple(const struct sk_buff *skb, | 31 | static bool icmpv6_pkt_to_tuple(const struct sk_buff *skb, |
32 | unsigned int dataoff, | 32 | unsigned int dataoff, |
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index 5f510a13b9f0..c5c0c5271096 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c | |||
@@ -469,7 +469,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
469 | struct ieee80211_sub_if_data *sdata; | 469 | struct ieee80211_sub_if_data *sdata; |
470 | u16 start_seq_num; | 470 | u16 start_seq_num; |
471 | u8 *state; | 471 | u8 *state; |
472 | int ret; | 472 | int ret = 0; |
473 | 473 | ||
474 | if ((tid >= STA_TID_NUM) || !(hw->flags & IEEE80211_HW_AMPDU_AGGREGATION)) | 474 | if ((tid >= STA_TID_NUM) || !(hw->flags & IEEE80211_HW_AMPDU_AGGREGATION)) |
475 | return -EINVAL; | 475 | return -EINVAL; |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 5abbc3f07dd6..b9074824862a 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -699,7 +699,8 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, | |||
699 | return 0; | 699 | return 0; |
700 | 700 | ||
701 | /* Setting ad-hoc mode on non-IBSS channel is not supported. */ | 701 | /* Setting ad-hoc mode on non-IBSS channel is not supported. */ |
702 | if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) | 702 | if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS && |
703 | type == NL80211_IFTYPE_ADHOC) | ||
703 | return -EOPNOTSUPP; | 704 | return -EOPNOTSUPP; |
704 | 705 | ||
705 | /* | 706 | /* |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 929ba542fd72..1159bdb4119c 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -107,6 +107,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata, | |||
107 | 107 | ||
108 | sta->flags = WLAN_STA_AUTHORIZED; | 108 | sta->flags = WLAN_STA_AUTHORIZED; |
109 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; | 109 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; |
110 | rate_control_rate_init(sta); | ||
110 | 111 | ||
111 | return sta; | 112 | return sta; |
112 | } | 113 | } |
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 2b3b490a6073..3824990d340b 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
@@ -395,13 +395,15 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
395 | { | 395 | { |
396 | struct minstrel_sta_info *mi = priv_sta; | 396 | struct minstrel_sta_info *mi = priv_sta; |
397 | struct minstrel_priv *mp = priv; | 397 | struct minstrel_priv *mp = priv; |
398 | struct minstrel_rate *mr_ctl; | 398 | struct ieee80211_local *local = hw_to_local(mp->hw); |
399 | struct ieee80211_rate *ctl_rate; | ||
399 | unsigned int i, n = 0; | 400 | unsigned int i, n = 0; |
400 | unsigned int t_slot = 9; /* FIXME: get real slot time */ | 401 | unsigned int t_slot = 9; /* FIXME: get real slot time */ |
401 | 402 | ||
402 | mi->lowest_rix = rate_lowest_index(sband, sta); | 403 | mi->lowest_rix = rate_lowest_index(sband, sta); |
403 | mr_ctl = &mi->r[rix_to_ndx(mi, mi->lowest_rix)]; | 404 | ctl_rate = &sband->bitrates[mi->lowest_rix]; |
404 | mi->sp_ack_dur = mr_ctl->ack_time; | 405 | mi->sp_ack_dur = ieee80211_frame_duration(local, 10, ctl_rate->bitrate, |
406 | !!(ctl_rate->flags & IEEE80211_RATE_ERP_G), 1); | ||
405 | 407 | ||
406 | for (i = 0; i < sband->n_bitrates; i++) { | 408 | for (i = 0; i < sband->n_bitrates; i++) { |
407 | struct minstrel_rate *mr = &mi->r[n]; | 409 | struct minstrel_rate *mr = &mi->r[n]; |
@@ -416,7 +418,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
416 | 418 | ||
417 | mr->rix = i; | 419 | mr->rix = i; |
418 | mr->bitrate = sband->bitrates[i].bitrate / 5; | 420 | mr->bitrate = sband->bitrates[i].bitrate / 5; |
419 | calc_rate_durations(mi, hw_to_local(mp->hw), mr, | 421 | calc_rate_durations(mi, local, mr, |
420 | &sband->bitrates[i]); | 422 | &sband->bitrates[i]); |
421 | 423 | ||
422 | /* calculate maximum number of retransmissions before | 424 | /* calculate maximum number of retransmissions before |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 7e83f74cd5de..90ce9ddb9451 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -469,7 +469,7 @@ struct nf_conn *nf_conntrack_alloc(struct net *net, | |||
469 | const struct nf_conntrack_tuple *repl, | 469 | const struct nf_conntrack_tuple *repl, |
470 | gfp_t gfp) | 470 | gfp_t gfp) |
471 | { | 471 | { |
472 | struct nf_conn *ct = NULL; | 472 | struct nf_conn *ct; |
473 | 473 | ||
474 | if (unlikely(!nf_conntrack_hash_rnd_initted)) { | 474 | if (unlikely(!nf_conntrack_hash_rnd_initted)) { |
475 | get_random_bytes(&nf_conntrack_hash_rnd, 4); | 475 | get_random_bytes(&nf_conntrack_hash_rnd, 4); |
@@ -551,7 +551,7 @@ init_conntrack(struct net *net, | |||
551 | } | 551 | } |
552 | 552 | ||
553 | ct = nf_conntrack_alloc(net, tuple, &repl_tuple, GFP_ATOMIC); | 553 | ct = nf_conntrack_alloc(net, tuple, &repl_tuple, GFP_ATOMIC); |
554 | if (ct == NULL || IS_ERR(ct)) { | 554 | if (IS_ERR(ct)) { |
555 | pr_debug("Can't allocate conntrack.\n"); | 555 | pr_debug("Can't allocate conntrack.\n"); |
556 | return (struct nf_conntrack_tuple_hash *)ct; | 556 | return (struct nf_conntrack_tuple_hash *)ct; |
557 | } | 557 | } |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 00e8c27130ff..3dddec6d2f7e 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1134,7 +1134,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1134 | struct nf_conntrack_helper *helper; | 1134 | struct nf_conntrack_helper *helper; |
1135 | 1135 | ||
1136 | ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_ATOMIC); | 1136 | ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_ATOMIC); |
1137 | if (ct == NULL || IS_ERR(ct)) | 1137 | if (IS_ERR(ct)) |
1138 | return -ENOMEM; | 1138 | return -ENOMEM; |
1139 | 1139 | ||
1140 | if (!cda[CTA_TIMEOUT]) | 1140 | if (!cda[CTA_TIMEOUT]) |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 89837a4eef76..bfbf521f6ea5 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -273,6 +273,10 @@ static int match_revfn(u8 af, const char *name, u8 revision, int *bestp) | |||
273 | have_rev = 1; | 273 | have_rev = 1; |
274 | } | 274 | } |
275 | } | 275 | } |
276 | |||
277 | if (af != NFPROTO_UNSPEC && !have_rev) | ||
278 | return match_revfn(NFPROTO_UNSPEC, name, revision, bestp); | ||
279 | |||
276 | return have_rev; | 280 | return have_rev; |
277 | } | 281 | } |
278 | 282 | ||
@@ -289,6 +293,10 @@ static int target_revfn(u8 af, const char *name, u8 revision, int *bestp) | |||
289 | have_rev = 1; | 293 | have_rev = 1; |
290 | } | 294 | } |
291 | } | 295 | } |
296 | |||
297 | if (af != NFPROTO_UNSPEC && !have_rev) | ||
298 | return target_revfn(NFPROTO_UNSPEC, name, revision, bestp); | ||
299 | |||
292 | return have_rev; | 300 | return have_rev; |
293 | } | 301 | } |
294 | 302 | ||
diff --git a/net/netfilter/xt_time.c b/net/netfilter/xt_time.c index 29375ba8db73..93acaa59d108 100644 --- a/net/netfilter/xt_time.c +++ b/net/netfilter/xt_time.c | |||
@@ -243,6 +243,17 @@ static struct xt_match xt_time_mt_reg __read_mostly = { | |||
243 | 243 | ||
244 | static int __init time_mt_init(void) | 244 | static int __init time_mt_init(void) |
245 | { | 245 | { |
246 | int minutes = sys_tz.tz_minuteswest; | ||
247 | |||
248 | if (minutes < 0) /* east of Greenwich */ | ||
249 | printk(KERN_INFO KBUILD_MODNAME | ||
250 | ": kernel timezone is +%02d%02d\n", | ||
251 | -minutes / 60, -minutes % 60); | ||
252 | else /* west of Greenwich */ | ||
253 | printk(KERN_INFO KBUILD_MODNAME | ||
254 | ": kernel timezone is -%02d%02d\n", | ||
255 | minutes / 60, minutes % 60); | ||
256 | |||
246 | return xt_register_match(&xt_time_mt_reg); | 257 | return xt_register_match(&xt_time_mt_reg); |
247 | } | 258 | } |
248 | 259 | ||
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 5070643ce534..2f0f0b04d3fb 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -661,12 +661,13 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl, | |||
661 | * next pending event (0 for no event in pq). | 661 | * next pending event (0 for no event in pq). |
662 | * Note: Applied are events whose have cl->pq_key <= q->now. | 662 | * Note: Applied are events whose have cl->pq_key <= q->now. |
663 | */ | 663 | */ |
664 | static psched_time_t htb_do_events(struct htb_sched *q, int level) | 664 | static psched_time_t htb_do_events(struct htb_sched *q, int level, |
665 | unsigned long start) | ||
665 | { | 666 | { |
666 | /* don't run for longer than 2 jiffies; 2 is used instead of | 667 | /* don't run for longer than 2 jiffies; 2 is used instead of |
667 | 1 to simplify things when jiffy is going to be incremented | 668 | 1 to simplify things when jiffy is going to be incremented |
668 | too soon */ | 669 | too soon */ |
669 | unsigned long stop_at = jiffies + 2; | 670 | unsigned long stop_at = start + 2; |
670 | while (time_before(jiffies, stop_at)) { | 671 | while (time_before(jiffies, stop_at)) { |
671 | struct htb_class *cl; | 672 | struct htb_class *cl; |
672 | long diff; | 673 | long diff; |
@@ -685,8 +686,8 @@ static psched_time_t htb_do_events(struct htb_sched *q, int level) | |||
685 | if (cl->cmode != HTB_CAN_SEND) | 686 | if (cl->cmode != HTB_CAN_SEND) |
686 | htb_add_to_wait_tree(q, cl, diff); | 687 | htb_add_to_wait_tree(q, cl, diff); |
687 | } | 688 | } |
688 | /* too much load - let's continue on next jiffie */ | 689 | /* too much load - let's continue on next jiffie (including above) */ |
689 | return q->now + PSCHED_TICKS_PER_SEC / HZ; | 690 | return q->now + 2 * PSCHED_TICKS_PER_SEC / HZ; |
690 | } | 691 | } |
691 | 692 | ||
692 | /* Returns class->node+prio from id-tree where classe's id is >= id. NULL | 693 | /* Returns class->node+prio from id-tree where classe's id is >= id. NULL |
@@ -845,6 +846,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
845 | struct htb_sched *q = qdisc_priv(sch); | 846 | struct htb_sched *q = qdisc_priv(sch); |
846 | int level; | 847 | int level; |
847 | psched_time_t next_event; | 848 | psched_time_t next_event; |
849 | unsigned long start_at; | ||
848 | 850 | ||
849 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ | 851 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ |
850 | skb = __skb_dequeue(&q->direct_queue); | 852 | skb = __skb_dequeue(&q->direct_queue); |
@@ -857,6 +859,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
857 | if (!sch->q.qlen) | 859 | if (!sch->q.qlen) |
858 | goto fin; | 860 | goto fin; |
859 | q->now = psched_get_time(); | 861 | q->now = psched_get_time(); |
862 | start_at = jiffies; | ||
860 | 863 | ||
861 | next_event = q->now + 5 * PSCHED_TICKS_PER_SEC; | 864 | next_event = q->now + 5 * PSCHED_TICKS_PER_SEC; |
862 | 865 | ||
@@ -866,14 +869,14 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
866 | psched_time_t event; | 869 | psched_time_t event; |
867 | 870 | ||
868 | if (q->now >= q->near_ev_cache[level]) { | 871 | if (q->now >= q->near_ev_cache[level]) { |
869 | event = htb_do_events(q, level); | 872 | event = htb_do_events(q, level, start_at); |
870 | if (!event) | 873 | if (!event) |
871 | event = q->now + PSCHED_TICKS_PER_SEC; | 874 | event = q->now + PSCHED_TICKS_PER_SEC; |
872 | q->near_ev_cache[level] = event; | 875 | q->near_ev_cache[level] = event; |
873 | } else | 876 | } else |
874 | event = q->near_ev_cache[level]; | 877 | event = q->near_ev_cache[level]; |
875 | 878 | ||
876 | if (event && next_event > event) | 879 | if (next_event > event) |
877 | next_event = event; | 880 | next_event = event; |
878 | 881 | ||
879 | m = ~q->row_mask[level]; | 882 | m = ~q->row_mask[level]; |
diff --git a/net/socket.c b/net/socket.c index 06603d73c411..35dd7371752a 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1214,7 +1214,7 @@ int sock_create_kern(int family, int type, int protocol, struct socket **res) | |||
1214 | return __sock_create(&init_net, family, type, protocol, res, 1); | 1214 | return __sock_create(&init_net, family, type, protocol, res, 1); |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | asmlinkage long sys_socket(int family, int type, int protocol) | 1217 | SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) |
1218 | { | 1218 | { |
1219 | int retval; | 1219 | int retval; |
1220 | struct socket *sock; | 1220 | struct socket *sock; |
@@ -1255,8 +1255,8 @@ out_release: | |||
1255 | * Create a pair of connected sockets. | 1255 | * Create a pair of connected sockets. |
1256 | */ | 1256 | */ |
1257 | 1257 | ||
1258 | asmlinkage long sys_socketpair(int family, int type, int protocol, | 1258 | SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol, |
1259 | int __user *usockvec) | 1259 | int __user *, usockvec) |
1260 | { | 1260 | { |
1261 | struct socket *sock1, *sock2; | 1261 | struct socket *sock1, *sock2; |
1262 | int fd1, fd2, err; | 1262 | int fd1, fd2, err; |
@@ -1356,7 +1356,7 @@ out_fd1: | |||
1356 | * the protocol layer (having also checked the address is ok). | 1356 | * the protocol layer (having also checked the address is ok). |
1357 | */ | 1357 | */ |
1358 | 1358 | ||
1359 | asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) | 1359 | SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) |
1360 | { | 1360 | { |
1361 | struct socket *sock; | 1361 | struct socket *sock; |
1362 | struct sockaddr_storage address; | 1362 | struct sockaddr_storage address; |
@@ -1385,7 +1385,7 @@ asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) | |||
1385 | * ready for listening. | 1385 | * ready for listening. |
1386 | */ | 1386 | */ |
1387 | 1387 | ||
1388 | asmlinkage long sys_listen(int fd, int backlog) | 1388 | SYSCALL_DEFINE2(listen, int, fd, int, backlog) |
1389 | { | 1389 | { |
1390 | struct socket *sock; | 1390 | struct socket *sock; |
1391 | int err, fput_needed; | 1391 | int err, fput_needed; |
@@ -1418,8 +1418,8 @@ asmlinkage long sys_listen(int fd, int backlog) | |||
1418 | * clean when we restucture accept also. | 1418 | * clean when we restucture accept also. |
1419 | */ | 1419 | */ |
1420 | 1420 | ||
1421 | asmlinkage long sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, | 1421 | SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, |
1422 | int __user *upeer_addrlen, int flags) | 1422 | int __user *, upeer_addrlen, int, flags) |
1423 | { | 1423 | { |
1424 | struct socket *sock, *newsock; | 1424 | struct socket *sock, *newsock; |
1425 | struct file *newfile; | 1425 | struct file *newfile; |
@@ -1502,8 +1502,8 @@ out_fd: | |||
1502 | goto out_put; | 1502 | goto out_put; |
1503 | } | 1503 | } |
1504 | 1504 | ||
1505 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1505 | SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr, |
1506 | int __user *upeer_addrlen) | 1506 | int __user *, upeer_addrlen) |
1507 | { | 1507 | { |
1508 | return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); | 1508 | return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); |
1509 | } | 1509 | } |
@@ -1520,8 +1520,8 @@ asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | |||
1520 | * include the -EINPROGRESS status for such sockets. | 1520 | * include the -EINPROGRESS status for such sockets. |
1521 | */ | 1521 | */ |
1522 | 1522 | ||
1523 | asmlinkage long sys_connect(int fd, struct sockaddr __user *uservaddr, | 1523 | SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, |
1524 | int addrlen) | 1524 | int, addrlen) |
1525 | { | 1525 | { |
1526 | struct socket *sock; | 1526 | struct socket *sock; |
1527 | struct sockaddr_storage address; | 1527 | struct sockaddr_storage address; |
@@ -1552,8 +1552,8 @@ out: | |||
1552 | * name to user space. | 1552 | * name to user space. |
1553 | */ | 1553 | */ |
1554 | 1554 | ||
1555 | asmlinkage long sys_getsockname(int fd, struct sockaddr __user *usockaddr, | 1555 | SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr, |
1556 | int __user *usockaddr_len) | 1556 | int __user *, usockaddr_len) |
1557 | { | 1557 | { |
1558 | struct socket *sock; | 1558 | struct socket *sock; |
1559 | struct sockaddr_storage address; | 1559 | struct sockaddr_storage address; |
@@ -1583,8 +1583,8 @@ out: | |||
1583 | * name to user space. | 1583 | * name to user space. |
1584 | */ | 1584 | */ |
1585 | 1585 | ||
1586 | asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr, | 1586 | SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr, |
1587 | int __user *usockaddr_len) | 1587 | int __user *, usockaddr_len) |
1588 | { | 1588 | { |
1589 | struct socket *sock; | 1589 | struct socket *sock; |
1590 | struct sockaddr_storage address; | 1590 | struct sockaddr_storage address; |
@@ -1615,9 +1615,9 @@ asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr, | |||
1615 | * the protocol. | 1615 | * the protocol. |
1616 | */ | 1616 | */ |
1617 | 1617 | ||
1618 | asmlinkage long sys_sendto(int fd, void __user *buff, size_t len, | 1618 | SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, |
1619 | unsigned flags, struct sockaddr __user *addr, | 1619 | unsigned, flags, struct sockaddr __user *, addr, |
1620 | int addr_len) | 1620 | int, addr_len) |
1621 | { | 1621 | { |
1622 | struct socket *sock; | 1622 | struct socket *sock; |
1623 | struct sockaddr_storage address; | 1623 | struct sockaddr_storage address; |
@@ -1660,7 +1660,8 @@ out: | |||
1660 | * Send a datagram down a socket. | 1660 | * Send a datagram down a socket. |
1661 | */ | 1661 | */ |
1662 | 1662 | ||
1663 | asmlinkage long sys_send(int fd, void __user *buff, size_t len, unsigned flags) | 1663 | SYSCALL_DEFINE4(send, int, fd, void __user *, buff, size_t, len, |
1664 | unsigned, flags) | ||
1664 | { | 1665 | { |
1665 | return sys_sendto(fd, buff, len, flags, NULL, 0); | 1666 | return sys_sendto(fd, buff, len, flags, NULL, 0); |
1666 | } | 1667 | } |
@@ -1671,9 +1672,9 @@ asmlinkage long sys_send(int fd, void __user *buff, size_t len, unsigned flags) | |||
1671 | * sender address from kernel to user space. | 1672 | * sender address from kernel to user space. |
1672 | */ | 1673 | */ |
1673 | 1674 | ||
1674 | asmlinkage long sys_recvfrom(int fd, void __user *ubuf, size_t size, | 1675 | SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, |
1675 | unsigned flags, struct sockaddr __user *addr, | 1676 | unsigned, flags, struct sockaddr __user *, addr, |
1676 | int __user *addr_len) | 1677 | int __user *, addr_len) |
1677 | { | 1678 | { |
1678 | struct socket *sock; | 1679 | struct socket *sock; |
1679 | struct iovec iov; | 1680 | struct iovec iov; |
@@ -1725,8 +1726,8 @@ asmlinkage long sys_recv(int fd, void __user *ubuf, size_t size, | |||
1725 | * to pass the user mode parameter for the protocols to sort out. | 1726 | * to pass the user mode parameter for the protocols to sort out. |
1726 | */ | 1727 | */ |
1727 | 1728 | ||
1728 | asmlinkage long sys_setsockopt(int fd, int level, int optname, | 1729 | SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname, |
1729 | char __user *optval, int optlen) | 1730 | char __user *, optval, int, optlen) |
1730 | { | 1731 | { |
1731 | int err, fput_needed; | 1732 | int err, fput_needed; |
1732 | struct socket *sock; | 1733 | struct socket *sock; |
@@ -1759,8 +1760,8 @@ out_put: | |||
1759 | * to pass a user mode parameter for the protocols to sort out. | 1760 | * to pass a user mode parameter for the protocols to sort out. |
1760 | */ | 1761 | */ |
1761 | 1762 | ||
1762 | asmlinkage long sys_getsockopt(int fd, int level, int optname, | 1763 | SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname, |
1763 | char __user *optval, int __user *optlen) | 1764 | char __user *, optval, int __user *, optlen) |
1764 | { | 1765 | { |
1765 | int err, fput_needed; | 1766 | int err, fput_needed; |
1766 | struct socket *sock; | 1767 | struct socket *sock; |
@@ -1789,7 +1790,7 @@ out_put: | |||
1789 | * Shutdown a socket. | 1790 | * Shutdown a socket. |
1790 | */ | 1791 | */ |
1791 | 1792 | ||
1792 | asmlinkage long sys_shutdown(int fd, int how) | 1793 | SYSCALL_DEFINE2(shutdown, int, fd, int, how) |
1793 | { | 1794 | { |
1794 | int err, fput_needed; | 1795 | int err, fput_needed; |
1795 | struct socket *sock; | 1796 | struct socket *sock; |
@@ -1815,7 +1816,7 @@ asmlinkage long sys_shutdown(int fd, int how) | |||
1815 | * BSD sendmsg interface | 1816 | * BSD sendmsg interface |
1816 | */ | 1817 | */ |
1817 | 1818 | ||
1818 | asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) | 1819 | SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags) |
1819 | { | 1820 | { |
1820 | struct compat_msghdr __user *msg_compat = | 1821 | struct compat_msghdr __user *msg_compat = |
1821 | (struct compat_msghdr __user *)msg; | 1822 | (struct compat_msghdr __user *)msg; |
@@ -1921,8 +1922,8 @@ out: | |||
1921 | * BSD recvmsg interface | 1922 | * BSD recvmsg interface |
1922 | */ | 1923 | */ |
1923 | 1924 | ||
1924 | asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, | 1925 | SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, |
1925 | unsigned int flags) | 1926 | unsigned int, flags) |
1926 | { | 1927 | { |
1927 | struct compat_msghdr __user *msg_compat = | 1928 | struct compat_msghdr __user *msg_compat = |
1928 | (struct compat_msghdr __user *)msg; | 1929 | (struct compat_msghdr __user *)msg; |
@@ -2045,7 +2046,7 @@ static const unsigned char nargs[19]={ | |||
2045 | * it is set by the callees. | 2046 | * it is set by the callees. |
2046 | */ | 2047 | */ |
2047 | 2048 | ||
2048 | asmlinkage long sys_socketcall(int call, unsigned long __user *args) | 2049 | SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args) |
2049 | { | 2050 | { |
2050 | unsigned long a[6]; | 2051 | unsigned long a[6]; |
2051 | unsigned long a0, a1; | 2052 | unsigned long a0, a1; |
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h index 5aa024b99c55..2f2d731bc1c2 100644 --- a/net/tipc/bcast.h +++ b/net/tipc/bcast.h | |||
@@ -124,7 +124,7 @@ static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_m | |||
124 | static inline void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b, | 124 | static inline void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b, |
125 | struct tipc_node_map *nm_diff) | 125 | struct tipc_node_map *nm_diff) |
126 | { | 126 | { |
127 | int stop = sizeof(nm_a->map) / sizeof(u32); | 127 | int stop = ARRAY_SIZE(nm_a->map); |
128 | int w; | 128 | int w; |
129 | int b; | 129 | int b; |
130 | u32 map; | 130 | u32 map; |
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index c609a4b98e15..42cd18391f46 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c | |||
@@ -63,7 +63,6 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb) | |||
63 | if (len > skb_tailroom(skb)) | 63 | if (len > skb_tailroom(skb)) |
64 | len = skb_tailroom(skb); | 64 | len = skb_tailroom(skb); |
65 | 65 | ||
66 | skb->truesize += len; | ||
67 | __skb_put(skb, len); | 66 | __skb_put(skb, len); |
68 | 67 | ||
69 | len += plen; | 68 | len += plen; |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index b95a2d64eb59..7877e7975dae 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1914,10 +1914,17 @@ static int xfrm_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type, | |||
1914 | } | 1914 | } |
1915 | #endif | 1915 | #endif |
1916 | 1916 | ||
1917 | /* For the xfrm_usersa_info cases we have to work around some 32-bit vs. | ||
1918 | * 64-bit compatability issues. On 32-bit the structure is 220 bytes, but | ||
1919 | * for 64-bit it gets padded out to 224 bytes. Those bytes are just | ||
1920 | * padding and don't have any content we care about. Therefore as long | ||
1921 | * as we have enough bytes for the content we can make both cases work. | ||
1922 | */ | ||
1923 | |||
1917 | #define XMSGSIZE(type) sizeof(struct type) | 1924 | #define XMSGSIZE(type) sizeof(struct type) |
1918 | 1925 | ||
1919 | static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = { | 1926 | static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = { |
1920 | [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info), | 1927 | [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = 220, /* see above */ |
1921 | [XFRM_MSG_DELSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), | 1928 | [XFRM_MSG_DELSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), |
1922 | [XFRM_MSG_GETSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), | 1929 | [XFRM_MSG_GETSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), |
1923 | [XFRM_MSG_NEWPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), | 1930 | [XFRM_MSG_NEWPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), |
@@ -1927,7 +1934,7 @@ static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = { | |||
1927 | [XFRM_MSG_ACQUIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_acquire), | 1934 | [XFRM_MSG_ACQUIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_acquire), |
1928 | [XFRM_MSG_EXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_expire), | 1935 | [XFRM_MSG_EXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_expire), |
1929 | [XFRM_MSG_UPDPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), | 1936 | [XFRM_MSG_UPDPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), |
1930 | [XFRM_MSG_UPDSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info), | 1937 | [XFRM_MSG_UPDSA - XFRM_MSG_BASE] = 220, /* see above */ |
1931 | [XFRM_MSG_POLEXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_polexpire), | 1938 | [XFRM_MSG_POLEXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_polexpire), |
1932 | [XFRM_MSG_FLUSHSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_flush), | 1939 | [XFRM_MSG_FLUSHSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_flush), |
1933 | [XFRM_MSG_FLUSHPOLICY - XFRM_MSG_BASE] = 0, | 1940 | [XFRM_MSG_FLUSHPOLICY - XFRM_MSG_BASE] = 0, |
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index 0a498e33b30b..b0246307aac4 100644 --- a/scripts/bootgraph.pl +++ b/scripts/bootgraph.pl | |||
@@ -41,11 +41,13 @@ use strict; | |||
41 | 41 | ||
42 | my %start; | 42 | my %start; |
43 | my %end; | 43 | my %end; |
44 | my %type; | ||
44 | my $done = 0; | 45 | my $done = 0; |
45 | my $maxtime = 0; | 46 | my $maxtime = 0; |
46 | my $firsttime = 100; | 47 | my $firsttime = 100; |
47 | my $count = 0; | 48 | my $count = 0; |
48 | my %pids; | 49 | my %pids; |
50 | my %pidctr; | ||
49 | 51 | ||
50 | while (<>) { | 52 | while (<>) { |
51 | my $line = $_; | 53 | my $line = $_; |
@@ -53,6 +55,7 @@ while (<>) { | |||
53 | my $func = $2; | 55 | my $func = $2; |
54 | if ($done == 0) { | 56 | if ($done == 0) { |
55 | $start{$func} = $1; | 57 | $start{$func} = $1; |
58 | $type{$func} = 0; | ||
56 | if ($1 < $firsttime) { | 59 | if ($1 < $firsttime) { |
57 | $firsttime = $1; | 60 | $firsttime = $1; |
58 | } | 61 | } |
@@ -63,12 +66,40 @@ while (<>) { | |||
63 | $count = $count + 1; | 66 | $count = $count + 1; |
64 | } | 67 | } |
65 | 68 | ||
69 | if ($line =~ /([0-9\.]+)\] async_waiting @ ([0-9]+)/) { | ||
70 | my $pid = $2; | ||
71 | my $func; | ||
72 | if (!defined($pidctr{$pid})) { | ||
73 | $func = "wait_" . $pid . "_1"; | ||
74 | $pidctr{$pid} = 1; | ||
75 | } else { | ||
76 | $pidctr{$pid} = $pidctr{$pid} + 1; | ||
77 | $func = "wait_" . $pid . "_" . $pidctr{$pid}; | ||
78 | } | ||
79 | if ($done == 0) { | ||
80 | $start{$func} = $1; | ||
81 | $type{$func} = 1; | ||
82 | if ($1 < $firsttime) { | ||
83 | $firsttime = $1; | ||
84 | } | ||
85 | } | ||
86 | $pids{$func} = $pid; | ||
87 | $count = $count + 1; | ||
88 | } | ||
89 | |||
66 | if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) { | 90 | if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) { |
67 | if ($done == 0) { | 91 | if ($done == 0) { |
68 | $end{$2} = $1; | 92 | $end{$2} = $1; |
69 | $maxtime = $1; | 93 | $maxtime = $1; |
70 | } | 94 | } |
71 | } | 95 | } |
96 | |||
97 | if ($line =~ /([0-9\.]+)\] async_continuing @ ([0-9]+)/) { | ||
98 | my $pid = $2; | ||
99 | my $func = "wait_" . $pid . "_" . $pidctr{$pid}; | ||
100 | $end{$func} = $1; | ||
101 | $maxtime = $1; | ||
102 | } | ||
72 | if ($line =~ /Write protecting the/) { | 103 | if ($line =~ /Write protecting the/) { |
73 | $done = 1; | 104 | $done = 1; |
74 | } | 105 | } |
@@ -105,6 +136,8 @@ $styles[9] = "fill:rgb(255,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0 | |||
105 | $styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; | 136 | $styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; |
106 | $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; | 137 | $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; |
107 | 138 | ||
139 | my $style_wait = "fill:rgb(128,128,128);fill-opacity:0.5;stroke-width:0;stroke:rgb(0,0,0)"; | ||
140 | |||
108 | my $mult = 1950.0 / ($maxtime - $firsttime); | 141 | my $mult = 1950.0 / ($maxtime - $firsttime); |
109 | my $threshold2 = ($maxtime - $firsttime) / 120.0; | 142 | my $threshold2 = ($maxtime - $firsttime) / 120.0; |
110 | my $threshold = $threshold2/10; | 143 | my $threshold = $threshold2/10; |
@@ -139,11 +172,16 @@ foreach my $key (@initcalls) { | |||
139 | $stylecounter = 0; | 172 | $stylecounter = 0; |
140 | }; | 173 | }; |
141 | 174 | ||
142 | print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"145\" style=\"$style\"/>\n"; | 175 | if ($type{$key} == 1) { |
143 | if ($duration >= $threshold2) { | 176 | $y = $y + 15; |
144 | print "<text transform=\"translate($s2,$y2) rotate(90)\">$key</text>\n"; | 177 | print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"115\" style=\"$style_wait\"/>\n"; |
145 | } else { | 178 | } else { |
146 | print "<text transform=\"translate($s3,$y2) rotate(90)\" font-size=\"3pt\">$key</text>\n"; | 179 | print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"145\" style=\"$style\"/>\n"; |
180 | if ($duration >= $threshold2) { | ||
181 | print "<text transform=\"translate($s2,$y2) rotate(90)\">$key</text>\n"; | ||
182 | } else { | ||
183 | print "<text transform=\"translate($s3,$y2) rotate(90)\" font-size=\"3pt\">$key</text>\n"; | ||
184 | } | ||
147 | } | 185 | } |
148 | } | 186 | } |
149 | } | 187 | } |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7bed4ed2c519..45eb0ae98eba 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -10,7 +10,7 @@ use strict; | |||
10 | my $P = $0; | 10 | my $P = $0; |
11 | $P =~ s@.*/@@g; | 11 | $P =~ s@.*/@@g; |
12 | 12 | ||
13 | my $V = '0.26'; | 13 | my $V = '0.27'; |
14 | 14 | ||
15 | use Getopt::Long qw(:config no_auto_abbrev); | 15 | use Getopt::Long qw(:config no_auto_abbrev); |
16 | 16 | ||
@@ -411,13 +411,15 @@ sub ctx_statement_block { | |||
411 | 411 | ||
412 | my $type = ''; | 412 | my $type = ''; |
413 | my $level = 0; | 413 | my $level = 0; |
414 | my @stack = ([$type, $level]); | 414 | my @stack = (); |
415 | my $p; | 415 | my $p; |
416 | my $c; | 416 | my $c; |
417 | my $len = 0; | 417 | my $len = 0; |
418 | 418 | ||
419 | my $remainder; | 419 | my $remainder; |
420 | while (1) { | 420 | while (1) { |
421 | @stack = (['', 0]) if ($#stack == -1); | ||
422 | |||
421 | #warn "CSB: blk<$blk> remain<$remain>\n"; | 423 | #warn "CSB: blk<$blk> remain<$remain>\n"; |
422 | # If we are about to drop off the end, pull in more | 424 | # If we are about to drop off the end, pull in more |
423 | # context. | 425 | # context. |
@@ -1663,7 +1665,7 @@ sub process { | |||
1663 | # Should not end with a space. | 1665 | # Should not end with a space. |
1664 | $to =~ s/\s+$//; | 1666 | $to =~ s/\s+$//; |
1665 | # '*'s should not have spaces between. | 1667 | # '*'s should not have spaces between. |
1666 | while ($to =~ s/(.)\s\*/$1\*/) { | 1668 | while ($to =~ s/\*\s+\*/\*\*/) { |
1667 | } | 1669 | } |
1668 | 1670 | ||
1669 | #print "from<$from> to<$to>\n"; | 1671 | #print "from<$from> to<$to>\n"; |
@@ -1678,7 +1680,7 @@ sub process { | |||
1678 | # Should not end with a space. | 1680 | # Should not end with a space. |
1679 | $to =~ s/\s+$//; | 1681 | $to =~ s/\s+$//; |
1680 | # '*'s should not have spaces between. | 1682 | # '*'s should not have spaces between. |
1681 | while ($to =~ s/(.)\s\*/$1\*/) { | 1683 | while ($to =~ s/\*\s+\*/\*\*/) { |
1682 | } | 1684 | } |
1683 | # Modifiers should have spaces. | 1685 | # Modifiers should have spaces. |
1684 | $to =~ s/(\b$Modifier$)/$1 /; | 1686 | $to =~ s/(\b$Modifier$)/$1 /; |
@@ -2014,7 +2016,11 @@ sub process { | |||
2014 | 2016 | ||
2015 | # Flatten any parentheses | 2017 | # Flatten any parentheses |
2016 | $value =~ s/\)\(/\) \(/g; | 2018 | $value =~ s/\)\(/\) \(/g; |
2017 | while ($value !~ /(?:$Ident|-?$Constant)\s*$Compare\s*(?:$Ident|-?$Constant)/ && $value =~ s/\([^\(\)]*\)/1/) { | 2019 | while ($value =~ s/\[[^\{\}]*\]/1/ || |
2020 | $value !~ /(?:$Ident|-?$Constant)\s* | ||
2021 | $Compare\s* | ||
2022 | (?:$Ident|-?$Constant)/x && | ||
2023 | $value =~ s/\([^\(\)]*\)/1/) { | ||
2018 | } | 2024 | } |
2019 | 2025 | ||
2020 | if ($value =~ /^(?:$Ident|-?$Constant)$/) { | 2026 | if ($value =~ /^(?:$Ident|-?$Constant)$/) { |
@@ -2102,6 +2108,11 @@ sub process { | |||
2102 | ERROR("trailing statements should be on next line\n" . $herecurr); | 2108 | ERROR("trailing statements should be on next line\n" . $herecurr); |
2103 | } | 2109 | } |
2104 | } | 2110 | } |
2111 | # if should not continue a brace | ||
2112 | if ($line =~ /}\s*if\b/) { | ||
2113 | ERROR("trailing statements should be on next line\n" . | ||
2114 | $herecurr); | ||
2115 | } | ||
2105 | # case and default should not have general statements after them | 2116 | # case and default should not have general statements after them |
2106 | if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g && | 2117 | if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g && |
2107 | $line !~ /\G(?: | 2118 | $line !~ /\G(?: |
@@ -2516,9 +2527,10 @@ sub process { | |||
2516 | WARN("please use device_initcall() instead of __initcall()\n" . $herecurr); | 2527 | WARN("please use device_initcall() instead of __initcall()\n" . $herecurr); |
2517 | } | 2528 | } |
2518 | # check for struct file_operations, ensure they are const. | 2529 | # check for struct file_operations, ensure they are const. |
2519 | if ($line =~ /\bstruct\s+file_operations\b/ && | 2530 | if ($line !~ /\bconst\b/ && |
2520 | $line !~ /\bconst\b/) { | 2531 | $line =~ /\bstruct\s+(file_operations|seq_operations)\b/) { |
2521 | WARN("struct file_operations should normally be const\n" . $herecurr); | 2532 | WARN("struct $1 should normally be const\n" . |
2533 | $herecurr); | ||
2522 | } | 2534 | } |
2523 | 2535 | ||
2524 | # use of NR_CPUS is usually wrong | 2536 | # use of NR_CPUS is usually wrong |
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl index 700a7a654a3f..d40449cafa84 100644 --- a/scripts/markup_oops.pl +++ b/scripts/markup_oops.pl | |||
@@ -1,5 +1,7 @@ | |||
1 | #!/usr/bin/perl -w | 1 | #!/usr/bin/perl -w |
2 | 2 | ||
3 | use File::Basename; | ||
4 | |||
3 | # Copyright 2008, Intel Corporation | 5 | # Copyright 2008, Intel Corporation |
4 | # | 6 | # |
5 | # This file is part of the Linux kernel | 7 | # This file is part of the Linux kernel |
@@ -13,23 +15,41 @@ | |||
13 | 15 | ||
14 | 16 | ||
15 | my $vmlinux_name = $ARGV[0]; | 17 | my $vmlinux_name = $ARGV[0]; |
16 | 18 | if (!defined($vmlinux_name)) { | |
19 | my $kerver = `uname -r`; | ||
20 | chomp($kerver); | ||
21 | $vmlinux_name = "/lib/modules/$kerver/build/vmlinux"; | ||
22 | print "No vmlinux specified, assuming $vmlinux_name\n"; | ||
23 | } | ||
24 | my $filename = $vmlinux_name; | ||
17 | # | 25 | # |
18 | # Step 1: Parse the oops to find the EIP value | 26 | # Step 1: Parse the oops to find the EIP value |
19 | # | 27 | # |
20 | 28 | ||
21 | my $target = "0"; | 29 | my $target = "0"; |
30 | my $function; | ||
31 | my $module = ""; | ||
32 | my $func_offset; | ||
33 | my $vmaoffset = 0; | ||
34 | |||
22 | while (<STDIN>) { | 35 | while (<STDIN>) { |
23 | if ($_ =~ /EIP: 0060:\[\<([a-z0-9]+)\>\]/) { | 36 | my $line = $_; |
37 | if ($line =~ /EIP: 0060:\[\<([a-z0-9]+)\>\]/) { | ||
24 | $target = $1; | 38 | $target = $1; |
25 | } | 39 | } |
26 | } | 40 | if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) { |
41 | $function = $1; | ||
42 | $func_offset = $2; | ||
43 | } | ||
27 | 44 | ||
28 | if ($target =~ /^f8/) { | 45 | # check if it's a module |
29 | print "This script does not work on modules ... \n"; | 46 | if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]+\W\[([a-zA-Z0-9\_\-]+)\]/) { |
30 | exit; | 47 | $module = $3; |
48 | } | ||
31 | } | 49 | } |
32 | 50 | ||
51 | my $decodestart = hex($target) - hex($func_offset); | ||
52 | my $decodestop = $decodestart + 8192; | ||
33 | if ($target eq "0") { | 53 | if ($target eq "0") { |
34 | print "No oops found!\n"; | 54 | print "No oops found!\n"; |
35 | print "Usage: \n"; | 55 | print "Usage: \n"; |
@@ -37,6 +57,29 @@ if ($target eq "0") { | |||
37 | exit; | 57 | exit; |
38 | } | 58 | } |
39 | 59 | ||
60 | # if it's a module, we need to find the .ko file and calculate a load offset | ||
61 | if ($module ne "") { | ||
62 | my $dir = dirname($filename); | ||
63 | $dir = $dir . "/"; | ||
64 | my $mod = $module . ".ko"; | ||
65 | my $modulefile = `find $dir -name $mod | head -1`; | ||
66 | chomp($modulefile); | ||
67 | $filename = $modulefile; | ||
68 | if ($filename eq "") { | ||
69 | print "Module .ko file for $module not found. Aborting\n"; | ||
70 | exit; | ||
71 | } | ||
72 | # ok so we found the module, now we need to calculate the vma offset | ||
73 | open(FILE, "objdump -dS $filename |") || die "Cannot start objdump"; | ||
74 | while (<FILE>) { | ||
75 | if ($_ =~ /^([0-9a-f]+) \<$function\>\:/) { | ||
76 | my $fu = $1; | ||
77 | $vmaoffset = hex($target) - hex($fu) - hex($func_offset); | ||
78 | } | ||
79 | } | ||
80 | close(FILE); | ||
81 | } | ||
82 | |||
40 | my $counter = 0; | 83 | my $counter = 0; |
41 | my $state = 0; | 84 | my $state = 0; |
42 | my $center = 0; | 85 | my $center = 0; |
@@ -59,9 +102,7 @@ sub InRange { | |||
59 | # first, parse the input into the lines array, but to keep size down, | 102 | # first, parse the input into the lines array, but to keep size down, |
60 | # we only do this for 4Kb around the sweet spot | 103 | # we only do this for 4Kb around the sweet spot |
61 | 104 | ||
62 | my $filename; | 105 | open(FILE, "objdump -dS --adjust-vma=$vmaoffset --start-address=$decodestart --stop-address=$decodestop $filename |") || die "Cannot start objdump"; |
63 | |||
64 | open(FILE, "objdump -dS $vmlinux_name |") || die "Cannot start objdump"; | ||
65 | 106 | ||
66 | while (<FILE>) { | 107 | while (<FILE>) { |
67 | my $line = $_; | 108 | my $line = $_; |
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index 09796797d122..e9335e1c6cf5 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c | |||
@@ -54,11 +54,11 @@ static int key_get_type_from_user(char *type, | |||
54 | * - returns the new key's serial number | 54 | * - returns the new key's serial number |
55 | * - implements add_key() | 55 | * - implements add_key() |
56 | */ | 56 | */ |
57 | asmlinkage long sys_add_key(const char __user *_type, | 57 | SYSCALL_DEFINE5(add_key, const char __user *, _type, |
58 | const char __user *_description, | 58 | const char __user *, _description, |
59 | const void __user *_payload, | 59 | const void __user *, _payload, |
60 | size_t plen, | 60 | size_t, plen, |
61 | key_serial_t ringid) | 61 | key_serial_t, ringid) |
62 | { | 62 | { |
63 | key_ref_t keyring_ref, key_ref; | 63 | key_ref_t keyring_ref, key_ref; |
64 | char type[32], *description; | 64 | char type[32], *description; |
@@ -146,10 +146,10 @@ asmlinkage long sys_add_key(const char __user *_type, | |||
146 | * - if the _callout_info string is empty, it will be rendered as "-" | 146 | * - if the _callout_info string is empty, it will be rendered as "-" |
147 | * - implements request_key() | 147 | * - implements request_key() |
148 | */ | 148 | */ |
149 | asmlinkage long sys_request_key(const char __user *_type, | 149 | SYSCALL_DEFINE4(request_key, const char __user *, _type, |
150 | const char __user *_description, | 150 | const char __user *, _description, |
151 | const char __user *_callout_info, | 151 | const char __user *, _callout_info, |
152 | key_serial_t destringid) | 152 | key_serial_t, destringid) |
153 | { | 153 | { |
154 | struct key_type *ktype; | 154 | struct key_type *ktype; |
155 | struct key *key; | 155 | struct key *key; |
@@ -1216,8 +1216,8 @@ long keyctl_get_security(key_serial_t keyid, | |||
1216 | /* | 1216 | /* |
1217 | * the key control system call | 1217 | * the key control system call |
1218 | */ | 1218 | */ |
1219 | asmlinkage long sys_keyctl(int option, unsigned long arg2, unsigned long arg3, | 1219 | SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3, |
1220 | unsigned long arg4, unsigned long arg5) | 1220 | unsigned long, arg4, unsigned long, arg5) |
1221 | { | 1221 | { |
1222 | switch (option) { | 1222 | switch (option) { |
1223 | case KEYCTL_GET_KEYRING_ID: | 1223 | case KEYCTL_GET_KEYRING_ID: |
diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c index 4d45bd63718b..57d9f154c88b 100644 --- a/sound/oss/dmasound/dmasound_atari.c +++ b/sound/oss/dmasound/dmasound_atari.c | |||
@@ -851,8 +851,9 @@ static int __init AtaIrqInit(void) | |||
851 | mfp.tim_dt_a = 1; /* Cause interrupt after first event. */ | 851 | mfp.tim_dt_a = 1; /* Cause interrupt after first event. */ |
852 | mfp.tim_ct_a = 8; /* Turn on event counting. */ | 852 | mfp.tim_ct_a = 8; /* Turn on event counting. */ |
853 | /* Register interrupt handler. */ | 853 | /* Register interrupt handler. */ |
854 | request_irq(IRQ_MFP_TIMA, AtaInterrupt, IRQ_TYPE_SLOW, "DMA sound", | 854 | if (request_irq(IRQ_MFP_TIMA, AtaInterrupt, IRQ_TYPE_SLOW, "DMA sound", |
855 | AtaInterrupt); | 855 | AtaInterrupt)) |
856 | return 0; | ||
856 | mfp.int_en_a |= 0x20; /* Turn interrupt on. */ | 857 | mfp.int_en_a |= 0x20; /* Turn interrupt on. */ |
857 | mfp.int_mk_a |= 0x20; | 858 | mfp.int_mk_a |= 0x20; |
858 | return 1; | 859 | return 1; |
diff --git a/sound/oss/dmasound/dmasound_q40.c b/sound/oss/dmasound/dmasound_q40.c index 1855b14d90c3..99bcb21c2281 100644 --- a/sound/oss/dmasound/dmasound_q40.c +++ b/sound/oss/dmasound/dmasound_q40.c | |||
@@ -371,8 +371,9 @@ static void Q40Free(void *ptr, unsigned int size) | |||
371 | static int __init Q40IrqInit(void) | 371 | static int __init Q40IrqInit(void) |
372 | { | 372 | { |
373 | /* Register interrupt handler. */ | 373 | /* Register interrupt handler. */ |
374 | request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0, | 374 | if (request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0, |
375 | "DMA sound", Q40Interrupt); | 375 | "DMA sound", Q40Interrupt)) |
376 | return 0; | ||
376 | 377 | ||
377 | return(1); | 378 | return(1); |
378 | } | 379 | } |
@@ -401,6 +402,7 @@ static void Q40PlayNextFrame(int index) | |||
401 | u_char *start; | 402 | u_char *start; |
402 | u_long size; | 403 | u_long size; |
403 | u_char speed; | 404 | u_char speed; |
405 | int error; | ||
404 | 406 | ||
405 | /* used by Q40Play() if all doubts whether there really is something | 407 | /* used by Q40Play() if all doubts whether there really is something |
406 | * to be played are already wiped out. | 408 | * to be played are already wiped out. |
@@ -419,11 +421,13 @@ static void Q40PlayNextFrame(int index) | |||
419 | master_outb( 0,SAMPLE_ENABLE_REG); | 421 | master_outb( 0,SAMPLE_ENABLE_REG); |
420 | free_irq(Q40_IRQ_SAMPLE, Q40Interrupt); | 422 | free_irq(Q40_IRQ_SAMPLE, Q40Interrupt); |
421 | if (dmasound.soft.stereo) | 423 | if (dmasound.soft.stereo) |
422 | request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0, | 424 | error = request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0, |
423 | "Q40 sound", Q40Interrupt); | 425 | "Q40 sound", Q40Interrupt); |
424 | else | 426 | else |
425 | request_irq(Q40_IRQ_SAMPLE, Q40MonoInterrupt, 0, | 427 | error = request_irq(Q40_IRQ_SAMPLE, Q40MonoInterrupt, 0, |
426 | "Q40 sound", Q40Interrupt); | 428 | "Q40 sound", Q40Interrupt); |
429 | if (error && printk_ratelimit()) | ||
430 | pr_err("Couldn't register sound interrupt\n"); | ||
427 | 431 | ||
428 | master_outb( speed, SAMPLE_RATE_REG); | 432 | master_outb( speed, SAMPLE_RATE_REG); |
429 | master_outb( 1,SAMPLE_CLEAR_REG); | 433 | master_outb( 1,SAMPLE_CLEAR_REG); |
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index e00421c0d8ba..960fd7970384 100644 --- a/sound/pci/hda/hda_beep.c +++ b/sound/pci/hda/hda_beep.c | |||
@@ -135,7 +135,6 @@ void snd_hda_detach_beep_device(struct hda_codec *codec) | |||
135 | struct hda_beep *beep = codec->beep; | 135 | struct hda_beep *beep = codec->beep; |
136 | if (beep) { | 136 | if (beep) { |
137 | cancel_work_sync(&beep->beep_work); | 137 | cancel_work_sync(&beep->beep_work); |
138 | flush_scheduled_work(); | ||
139 | 138 | ||
140 | input_unregister_device(beep->dev); | 139 | input_unregister_device(beep->dev); |
141 | kfree(beep); | 140 | kfree(beep); |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e16cf63821ae..b7bba7dc7cf1 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -373,7 +373,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex) | |||
373 | unsol->queue[wp] = res; | 373 | unsol->queue[wp] = res; |
374 | unsol->queue[wp + 1] = res_ex; | 374 | unsol->queue[wp + 1] = res_ex; |
375 | 375 | ||
376 | schedule_work(&unsol->work); | 376 | queue_work(bus->workq, &unsol->work); |
377 | 377 | ||
378 | return 0; | 378 | return 0; |
379 | } | 379 | } |
@@ -437,15 +437,17 @@ static int snd_hda_bus_free(struct hda_bus *bus) | |||
437 | 437 | ||
438 | if (!bus) | 438 | if (!bus) |
439 | return 0; | 439 | return 0; |
440 | if (bus->unsol) { | 440 | if (bus->workq) |
441 | flush_scheduled_work(); | 441 | flush_workqueue(bus->workq); |
442 | if (bus->unsol) | ||
442 | kfree(bus->unsol); | 443 | kfree(bus->unsol); |
443 | } | ||
444 | list_for_each_entry_safe(codec, n, &bus->codec_list, list) { | 444 | list_for_each_entry_safe(codec, n, &bus->codec_list, list) { |
445 | snd_hda_codec_free(codec); | 445 | snd_hda_codec_free(codec); |
446 | } | 446 | } |
447 | if (bus->ops.private_free) | 447 | if (bus->ops.private_free) |
448 | bus->ops.private_free(bus); | 448 | bus->ops.private_free(bus); |
449 | if (bus->workq) | ||
450 | destroy_workqueue(bus->workq); | ||
449 | kfree(bus); | 451 | kfree(bus); |
450 | return 0; | 452 | return 0; |
451 | } | 453 | } |
@@ -485,6 +487,7 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card, | |||
485 | { | 487 | { |
486 | struct hda_bus *bus; | 488 | struct hda_bus *bus; |
487 | int err; | 489 | int err; |
490 | char qname[8]; | ||
488 | static struct snd_device_ops dev_ops = { | 491 | static struct snd_device_ops dev_ops = { |
489 | .dev_register = snd_hda_bus_dev_register, | 492 | .dev_register = snd_hda_bus_dev_register, |
490 | .dev_free = snd_hda_bus_dev_free, | 493 | .dev_free = snd_hda_bus_dev_free, |
@@ -514,6 +517,14 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card, | |||
514 | mutex_init(&bus->cmd_mutex); | 517 | mutex_init(&bus->cmd_mutex); |
515 | INIT_LIST_HEAD(&bus->codec_list); | 518 | INIT_LIST_HEAD(&bus->codec_list); |
516 | 519 | ||
520 | snprintf(qname, sizeof(qname), "hda%d", card->number); | ||
521 | bus->workq = create_workqueue(qname); | ||
522 | if (!bus->workq) { | ||
523 | snd_printk(KERN_ERR "cannot create workqueue %s\n", qname); | ||
524 | kfree(bus); | ||
525 | return -ENOMEM; | ||
526 | } | ||
527 | |||
517 | err = snd_device_new(card, SNDRV_DEV_BUS, bus, &dev_ops); | 528 | err = snd_device_new(card, SNDRV_DEV_BUS, bus, &dev_ops); |
518 | if (err < 0) { | 529 | if (err < 0) { |
519 | snd_hda_bus_free(bus); | 530 | snd_hda_bus_free(bus); |
@@ -684,7 +695,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) | |||
684 | return; | 695 | return; |
685 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 696 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
686 | cancel_delayed_work(&codec->power_work); | 697 | cancel_delayed_work(&codec->power_work); |
687 | flush_scheduled_work(); | 698 | flush_workqueue(codec->bus->workq); |
688 | #endif | 699 | #endif |
689 | list_del(&codec->list); | 700 | list_del(&codec->list); |
690 | snd_array_free(&codec->mixers); | 701 | snd_array_free(&codec->mixers); |
@@ -735,6 +746,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr | |||
735 | codec->bus = bus; | 746 | codec->bus = bus; |
736 | codec->addr = codec_addr; | 747 | codec->addr = codec_addr; |
737 | mutex_init(&codec->spdif_mutex); | 748 | mutex_init(&codec->spdif_mutex); |
749 | mutex_init(&codec->control_mutex); | ||
738 | init_hda_cache(&codec->amp_cache, sizeof(struct hda_amp_info)); | 750 | init_hda_cache(&codec->amp_cache, sizeof(struct hda_amp_info)); |
739 | init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head)); | 751 | init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head)); |
740 | snd_array_init(&codec->mixers, sizeof(struct snd_kcontrol *), 32); | 752 | snd_array_init(&codec->mixers, sizeof(struct snd_kcontrol *), 32); |
@@ -1272,7 +1284,7 @@ void snd_hda_codec_reset(struct hda_codec *codec) | |||
1272 | 1284 | ||
1273 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1285 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
1274 | cancel_delayed_work(&codec->power_work); | 1286 | cancel_delayed_work(&codec->power_work); |
1275 | flush_scheduled_work(); | 1287 | flush_workqueue(codec->bus->workq); |
1276 | #endif | 1288 | #endif |
1277 | snd_hda_ctls_clear(codec); | 1289 | snd_hda_ctls_clear(codec); |
1278 | /* relase PCMs */ | 1290 | /* relase PCMs */ |
@@ -1418,12 +1430,12 @@ int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, | |||
1418 | unsigned long pval; | 1430 | unsigned long pval; |
1419 | int err; | 1431 | int err; |
1420 | 1432 | ||
1421 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1433 | mutex_lock(&codec->control_mutex); |
1422 | pval = kcontrol->private_value; | 1434 | pval = kcontrol->private_value; |
1423 | kcontrol->private_value = pval & ~AMP_VAL_IDX_MASK; /* index 0 */ | 1435 | kcontrol->private_value = pval & ~AMP_VAL_IDX_MASK; /* index 0 */ |
1424 | err = snd_hda_mixer_amp_switch_get(kcontrol, ucontrol); | 1436 | err = snd_hda_mixer_amp_switch_get(kcontrol, ucontrol); |
1425 | kcontrol->private_value = pval; | 1437 | kcontrol->private_value = pval; |
1426 | mutex_unlock(&codec->spdif_mutex); | 1438 | mutex_unlock(&codec->control_mutex); |
1427 | return err; | 1439 | return err; |
1428 | } | 1440 | } |
1429 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_get); | 1441 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_get); |
@@ -1435,7 +1447,7 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, | |||
1435 | unsigned long pval; | 1447 | unsigned long pval; |
1436 | int i, indices, err = 0, change = 0; | 1448 | int i, indices, err = 0, change = 0; |
1437 | 1449 | ||
1438 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1450 | mutex_lock(&codec->control_mutex); |
1439 | pval = kcontrol->private_value; | 1451 | pval = kcontrol->private_value; |
1440 | indices = (pval & AMP_VAL_IDX_MASK) >> AMP_VAL_IDX_SHIFT; | 1452 | indices = (pval & AMP_VAL_IDX_MASK) >> AMP_VAL_IDX_SHIFT; |
1441 | for (i = 0; i < indices; i++) { | 1453 | for (i = 0; i < indices; i++) { |
@@ -1447,7 +1459,7 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, | |||
1447 | change |= err; | 1459 | change |= err; |
1448 | } | 1460 | } |
1449 | kcontrol->private_value = pval; | 1461 | kcontrol->private_value = pval; |
1450 | mutex_unlock(&codec->spdif_mutex); | 1462 | mutex_unlock(&codec->control_mutex); |
1451 | return err < 0 ? err : change; | 1463 | return err < 0 ? err : change; |
1452 | } | 1464 | } |
1453 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_put); | 1465 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_put); |
@@ -1462,12 +1474,12 @@ int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, | |||
1462 | struct hda_bind_ctls *c; | 1474 | struct hda_bind_ctls *c; |
1463 | int err; | 1475 | int err; |
1464 | 1476 | ||
1465 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1477 | mutex_lock(&codec->control_mutex); |
1466 | c = (struct hda_bind_ctls *)kcontrol->private_value; | 1478 | c = (struct hda_bind_ctls *)kcontrol->private_value; |
1467 | kcontrol->private_value = *c->values; | 1479 | kcontrol->private_value = *c->values; |
1468 | err = c->ops->info(kcontrol, uinfo); | 1480 | err = c->ops->info(kcontrol, uinfo); |
1469 | kcontrol->private_value = (long)c; | 1481 | kcontrol->private_value = (long)c; |
1470 | mutex_unlock(&codec->spdif_mutex); | 1482 | mutex_unlock(&codec->control_mutex); |
1471 | return err; | 1483 | return err; |
1472 | } | 1484 | } |
1473 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_info); | 1485 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_info); |
@@ -1479,12 +1491,12 @@ int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, | |||
1479 | struct hda_bind_ctls *c; | 1491 | struct hda_bind_ctls *c; |
1480 | int err; | 1492 | int err; |
1481 | 1493 | ||
1482 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1494 | mutex_lock(&codec->control_mutex); |
1483 | c = (struct hda_bind_ctls *)kcontrol->private_value; | 1495 | c = (struct hda_bind_ctls *)kcontrol->private_value; |
1484 | kcontrol->private_value = *c->values; | 1496 | kcontrol->private_value = *c->values; |
1485 | err = c->ops->get(kcontrol, ucontrol); | 1497 | err = c->ops->get(kcontrol, ucontrol); |
1486 | kcontrol->private_value = (long)c; | 1498 | kcontrol->private_value = (long)c; |
1487 | mutex_unlock(&codec->spdif_mutex); | 1499 | mutex_unlock(&codec->control_mutex); |
1488 | return err; | 1500 | return err; |
1489 | } | 1501 | } |
1490 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_get); | 1502 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_get); |
@@ -1497,7 +1509,7 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, | |||
1497 | unsigned long *vals; | 1509 | unsigned long *vals; |
1498 | int err = 0, change = 0; | 1510 | int err = 0, change = 0; |
1499 | 1511 | ||
1500 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1512 | mutex_lock(&codec->control_mutex); |
1501 | c = (struct hda_bind_ctls *)kcontrol->private_value; | 1513 | c = (struct hda_bind_ctls *)kcontrol->private_value; |
1502 | for (vals = c->values; *vals; vals++) { | 1514 | for (vals = c->values; *vals; vals++) { |
1503 | kcontrol->private_value = *vals; | 1515 | kcontrol->private_value = *vals; |
@@ -1507,7 +1519,7 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, | |||
1507 | change |= err; | 1519 | change |= err; |
1508 | } | 1520 | } |
1509 | kcontrol->private_value = (long)c; | 1521 | kcontrol->private_value = (long)c; |
1510 | mutex_unlock(&codec->spdif_mutex); | 1522 | mutex_unlock(&codec->control_mutex); |
1511 | return err < 0 ? err : change; | 1523 | return err < 0 ? err : change; |
1512 | } | 1524 | } |
1513 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_put); | 1525 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_put); |
@@ -1519,12 +1531,12 @@ int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
1519 | struct hda_bind_ctls *c; | 1531 | struct hda_bind_ctls *c; |
1520 | int err; | 1532 | int err; |
1521 | 1533 | ||
1522 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1534 | mutex_lock(&codec->control_mutex); |
1523 | c = (struct hda_bind_ctls *)kcontrol->private_value; | 1535 | c = (struct hda_bind_ctls *)kcontrol->private_value; |
1524 | kcontrol->private_value = *c->values; | 1536 | kcontrol->private_value = *c->values; |
1525 | err = c->ops->tlv(kcontrol, op_flag, size, tlv); | 1537 | err = c->ops->tlv(kcontrol, op_flag, size, tlv); |
1526 | kcontrol->private_value = (long)c; | 1538 | kcontrol->private_value = (long)c; |
1527 | mutex_unlock(&codec->spdif_mutex); | 1539 | mutex_unlock(&codec->control_mutex); |
1528 | return err; | 1540 | return err; |
1529 | } | 1541 | } |
1530 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_tlv); | 1542 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_tlv); |
@@ -2712,6 +2724,67 @@ int snd_hda_check_board_config(struct hda_codec *codec, | |||
2712 | EXPORT_SYMBOL_HDA(snd_hda_check_board_config); | 2724 | EXPORT_SYMBOL_HDA(snd_hda_check_board_config); |
2713 | 2725 | ||
2714 | /** | 2726 | /** |
2727 | * snd_hda_check_board_codec_sid_config - compare the current codec | ||
2728 | subsystem ID with the | ||
2729 | config table | ||
2730 | |||
2731 | This is important for Gateway notebooks with SB450 HDA Audio | ||
2732 | where the vendor ID of the PCI device is: | ||
2733 | ATI Technologies Inc SB450 HDA Audio [1002:437b] | ||
2734 | and the vendor/subvendor are found only at the codec. | ||
2735 | |||
2736 | * @codec: the HDA codec | ||
2737 | * @num_configs: number of config enums | ||
2738 | * @models: array of model name strings | ||
2739 | * @tbl: configuration table, terminated by null entries | ||
2740 | * | ||
2741 | * Compares the modelname or PCI subsystem id of the current codec with the | ||
2742 | * given configuration table. If a matching entry is found, returns its | ||
2743 | * config value (supposed to be 0 or positive). | ||
2744 | * | ||
2745 | * If no entries are matching, the function returns a negative value. | ||
2746 | */ | ||
2747 | int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, | ||
2748 | int num_configs, const char **models, | ||
2749 | const struct snd_pci_quirk *tbl) | ||
2750 | { | ||
2751 | const struct snd_pci_quirk *q; | ||
2752 | |||
2753 | /* Search for codec ID */ | ||
2754 | for (q = tbl; q->subvendor; q++) { | ||
2755 | unsigned long vendorid = (q->subdevice) | (q->subvendor << 16); | ||
2756 | |||
2757 | if (vendorid == codec->subsystem_id) | ||
2758 | break; | ||
2759 | } | ||
2760 | |||
2761 | if (!q->subvendor) | ||
2762 | return -1; | ||
2763 | |||
2764 | tbl = q; | ||
2765 | |||
2766 | if (tbl->value >= 0 && tbl->value < num_configs) { | ||
2767 | #ifdef CONFIG_SND_DEBUG_DETECT | ||
2768 | char tmp[10]; | ||
2769 | const char *model = NULL; | ||
2770 | if (models) | ||
2771 | model = models[tbl->value]; | ||
2772 | if (!model) { | ||
2773 | sprintf(tmp, "#%d", tbl->value); | ||
2774 | model = tmp; | ||
2775 | } | ||
2776 | snd_printdd(KERN_INFO "hda_codec: model '%s' is selected " | ||
2777 | "for config %x:%x (%s)\n", | ||
2778 | model, tbl->subvendor, tbl->subdevice, | ||
2779 | (tbl->name ? tbl->name : "Unknown device")); | ||
2780 | #endif | ||
2781 | return tbl->value; | ||
2782 | } | ||
2783 | return -1; | ||
2784 | } | ||
2785 | EXPORT_SYMBOL_HDA(snd_hda_check_board_codec_sid_config); | ||
2786 | |||
2787 | /** | ||
2715 | * snd_hda_add_new_ctls - create controls from the array | 2788 | * snd_hda_add_new_ctls - create controls from the array |
2716 | * @codec: the HDA codec | 2789 | * @codec: the HDA codec |
2717 | * @knew: the array of struct snd_kcontrol_new | 2790 | * @knew: the array of struct snd_kcontrol_new |
@@ -2803,7 +2876,7 @@ void snd_hda_power_down(struct hda_codec *codec) | |||
2803 | return; | 2876 | return; |
2804 | if (power_save(codec)) { | 2877 | if (power_save(codec)) { |
2805 | codec->power_transition = 1; /* avoid reentrance */ | 2878 | codec->power_transition = 1; /* avoid reentrance */ |
2806 | schedule_delayed_work(&codec->power_work, | 2879 | queue_delayed_work(codec->bus->workq, &codec->power_work, |
2807 | msecs_to_jiffies(power_save(codec) * 1000)); | 2880 | msecs_to_jiffies(power_save(codec) * 1000)); |
2808 | } | 2881 | } |
2809 | } | 2882 | } |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 729fc7642d7f..5810ef588402 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -614,6 +614,7 @@ struct hda_bus { | |||
614 | 614 | ||
615 | /* unsolicited event queue */ | 615 | /* unsolicited event queue */ |
616 | struct hda_bus_unsolicited *unsol; | 616 | struct hda_bus_unsolicited *unsol; |
617 | struct workqueue_struct *workq; /* common workqueue for codecs */ | ||
617 | 618 | ||
618 | /* assigned PCMs */ | 619 | /* assigned PCMs */ |
619 | DECLARE_BITMAP(pcm_dev_bits, SNDRV_PCM_DEVICES); | 620 | DECLARE_BITMAP(pcm_dev_bits, SNDRV_PCM_DEVICES); |
@@ -771,6 +772,7 @@ struct hda_codec { | |||
771 | struct hda_cache_rec cmd_cache; /* cache for other commands */ | 772 | struct hda_cache_rec cmd_cache; /* cache for other commands */ |
772 | 773 | ||
773 | struct mutex spdif_mutex; | 774 | struct mutex spdif_mutex; |
775 | struct mutex control_mutex; | ||
774 | unsigned int spdif_status; /* IEC958 status bits */ | 776 | unsigned int spdif_status; /* IEC958 status bits */ |
775 | unsigned short spdif_ctls; /* SPDIF control bits */ | 777 | unsigned short spdif_ctls; /* SPDIF control bits */ |
776 | unsigned int spdif_in_enable; /* SPDIF input enable? */ | 778 | unsigned int spdif_in_enable; /* SPDIF input enable? */ |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index f04de115ee11..11e791b965f6 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -996,10 +996,11 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id) | |||
996 | spin_unlock(&chip->reg_lock); | 996 | spin_unlock(&chip->reg_lock); |
997 | snd_pcm_period_elapsed(azx_dev->substream); | 997 | snd_pcm_period_elapsed(azx_dev->substream); |
998 | spin_lock(&chip->reg_lock); | 998 | spin_lock(&chip->reg_lock); |
999 | } else { | 999 | } else if (chip->bus && chip->bus->workq) { |
1000 | /* bogus IRQ, process it later */ | 1000 | /* bogus IRQ, process it later */ |
1001 | azx_dev->irq_pending = 1; | 1001 | azx_dev->irq_pending = 1; |
1002 | schedule_work(&chip->irq_pending_work); | 1002 | queue_work(chip->bus->workq, |
1003 | &chip->irq_pending_work); | ||
1003 | } | 1004 | } |
1004 | } | 1005 | } |
1005 | } | 1006 | } |
@@ -1741,7 +1742,6 @@ static void azx_clear_irq_pending(struct azx *chip) | |||
1741 | for (i = 0; i < chip->num_streams; i++) | 1742 | for (i = 0; i < chip->num_streams; i++) |
1742 | chip->azx_dev[i].irq_pending = 0; | 1743 | chip->azx_dev[i].irq_pending = 0; |
1743 | spin_unlock_irq(&chip->reg_lock); | 1744 | spin_unlock_irq(&chip->reg_lock); |
1744 | flush_scheduled_work(); | ||
1745 | } | 1745 | } |
1746 | 1746 | ||
1747 | static struct snd_pcm_ops azx_pcm_ops = { | 1747 | static struct snd_pcm_ops azx_pcm_ops = { |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 6f2fe0f9fdd8..1dd8716c387f 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -296,6 +296,9 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen); | |||
296 | int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, | 296 | int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, |
297 | const char **modelnames, | 297 | const char **modelnames, |
298 | const struct snd_pci_quirk *pci_list); | 298 | const struct snd_pci_quirk *pci_list); |
299 | int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, | ||
300 | int num_configs, const char **models, | ||
301 | const struct snd_pci_quirk *tbl); | ||
299 | int snd_hda_add_new_ctls(struct hda_codec *codec, | 302 | int snd_hda_add_new_ctls(struct hda_codec *codec, |
300 | struct snd_kcontrol_new *knew); | 303 | struct snd_kcontrol_new *knew); |
301 | 304 | ||
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 26247cfe749d..2e7371ec2e23 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -3900,6 +3900,7 @@ static const char *ad1884a_models[AD1884A_MODELS] = { | |||
3900 | 3900 | ||
3901 | static struct snd_pci_quirk ad1884a_cfg_tbl[] = { | 3901 | static struct snd_pci_quirk ad1884a_cfg_tbl[] = { |
3902 | SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), | 3902 | SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), |
3903 | SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP), | ||
3903 | SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE), | 3904 | SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE), |
3904 | SND_PCI_QUIRK(0x103c, 0x30e6, "HP 6730b", AD1884A_LAPTOP), | 3905 | SND_PCI_QUIRK(0x103c, 0x30e6, "HP 6730b", AD1884A_LAPTOP), |
3905 | SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP), | 3906 | SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP), |
@@ -4262,13 +4263,13 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4262 | spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids); | 4263 | spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids); |
4263 | spec->adc_nids = ad1882_adc_nids; | 4264 | spec->adc_nids = ad1882_adc_nids; |
4264 | spec->capsrc_nids = ad1882_capsrc_nids; | 4265 | spec->capsrc_nids = ad1882_capsrc_nids; |
4265 | if (codec->vendor_id == 0x11d1882) | 4266 | if (codec->vendor_id == 0x11d41882) |
4266 | spec->input_mux = &ad1882_capture_source; | 4267 | spec->input_mux = &ad1882_capture_source; |
4267 | else | 4268 | else |
4268 | spec->input_mux = &ad1882a_capture_source; | 4269 | spec->input_mux = &ad1882a_capture_source; |
4269 | spec->num_mixers = 2; | 4270 | spec->num_mixers = 2; |
4270 | spec->mixers[0] = ad1882_base_mixers; | 4271 | spec->mixers[0] = ad1882_base_mixers; |
4271 | if (codec->vendor_id == 0x11d1882) | 4272 | if (codec->vendor_id == 0x11d41882) |
4272 | spec->mixers[1] = ad1882_loopback_mixers; | 4273 | spec->mixers[1] = ad1882_loopback_mixers; |
4273 | else | 4274 | else |
4274 | spec->mixers[1] = ad1882a_loopback_mixers; | 4275 | spec->mixers[1] = ad1882a_loopback_mixers; |
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 0270fda0bda5..d57d8132a06e 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
@@ -160,14 +160,18 @@ static int patch_nvhdmi(struct hda_codec *codec) | |||
160 | */ | 160 | */ |
161 | static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { | 161 | static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { |
162 | { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi }, | 162 | { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi }, |
163 | { .id = 0x10de0006, .name = "MCP78 HDMI", .patch = patch_nvhdmi }, | ||
163 | { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi }, | 164 | { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi }, |
164 | { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi }, | 165 | { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi }, |
166 | { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi }, | ||
165 | {} /* terminator */ | 167 | {} /* terminator */ |
166 | }; | 168 | }; |
167 | 169 | ||
168 | MODULE_ALIAS("snd-hda-codec-id:10de0002"); | 170 | MODULE_ALIAS("snd-hda-codec-id:10de0002"); |
171 | MODULE_ALIAS("snd-hda-codec-id:10de0006"); | ||
169 | MODULE_ALIAS("snd-hda-codec-id:10de0007"); | 172 | MODULE_ALIAS("snd-hda-codec-id:10de0007"); |
170 | MODULE_ALIAS("snd-hda-codec-id:10de0067"); | 173 | MODULE_ALIAS("snd-hda-codec-id:10de0067"); |
174 | MODULE_ALIAS("snd-hda-codec-id:10de8001"); | ||
171 | 175 | ||
172 | MODULE_LICENSE("GPL"); | 176 | MODULE_LICENSE("GPL"); |
173 | MODULE_DESCRIPTION("Nvidia HDMI HD-audio codec"); | 177 | MODULE_DESCRIPTION("Nvidia HDMI HD-audio codec"); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 9065ebf9c065..82dd08431970 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1502,11 +1502,11 @@ static int alc_cap_vol_info(struct snd_kcontrol *kcontrol, | |||
1502 | struct alc_spec *spec = codec->spec; | 1502 | struct alc_spec *spec = codec->spec; |
1503 | int err; | 1503 | int err; |
1504 | 1504 | ||
1505 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1505 | mutex_lock(&codec->control_mutex); |
1506 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, | 1506 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, |
1507 | HDA_INPUT); | 1507 | HDA_INPUT); |
1508 | err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo); | 1508 | err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo); |
1509 | mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1509 | mutex_unlock(&codec->control_mutex); |
1510 | return err; | 1510 | return err; |
1511 | } | 1511 | } |
1512 | 1512 | ||
@@ -1517,11 +1517,11 @@ static int alc_cap_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
1517 | struct alc_spec *spec = codec->spec; | 1517 | struct alc_spec *spec = codec->spec; |
1518 | int err; | 1518 | int err; |
1519 | 1519 | ||
1520 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1520 | mutex_lock(&codec->control_mutex); |
1521 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, | 1521 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, |
1522 | HDA_INPUT); | 1522 | HDA_INPUT); |
1523 | err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv); | 1523 | err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv); |
1524 | mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1524 | mutex_unlock(&codec->control_mutex); |
1525 | return err; | 1525 | return err; |
1526 | } | 1526 | } |
1527 | 1527 | ||
@@ -1537,11 +1537,11 @@ static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol, | |||
1537 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 1537 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
1538 | int err; | 1538 | int err; |
1539 | 1539 | ||
1540 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1540 | mutex_lock(&codec->control_mutex); |
1541 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], | 1541 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], |
1542 | 3, 0, HDA_INPUT); | 1542 | 3, 0, HDA_INPUT); |
1543 | err = func(kcontrol, ucontrol); | 1543 | err = func(kcontrol, ucontrol); |
1544 | mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1544 | mutex_unlock(&codec->control_mutex); |
1545 | return err; | 1545 | return err; |
1546 | } | 1546 | } |
1547 | 1547 | ||
@@ -8461,6 +8461,10 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
8461 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), | 8461 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), |
8462 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", | 8462 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
8463 | ALC888_ACER_ASPIRE_4930G), | 8463 | ALC888_ACER_ASPIRE_4930G), |
8464 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", | ||
8465 | ALC888_ACER_ASPIRE_4930G), | ||
8466 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", | ||
8467 | ALC888_ACER_ASPIRE_4930G), | ||
8464 | SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ | 8468 | SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ |
8465 | SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), | 8469 | SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), |
8466 | SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), | 8470 | SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), |
@@ -8522,6 +8526,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
8522 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), | 8526 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), |
8523 | SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), | 8527 | SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), |
8524 | SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL), | 8528 | SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL), |
8529 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC883_3ST_6ch_INTEL), | ||
8525 | SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), | 8530 | SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), |
8526 | {} | 8531 | {} |
8527 | }; | 8532 | }; |
@@ -10568,6 +10573,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { | |||
10568 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU), | 10573 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU), |
10569 | SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), | 10574 | SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), |
10570 | SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA), | 10575 | SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA), |
10576 | SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO), | ||
10571 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000), | 10577 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000), |
10572 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), | 10578 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), |
10573 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31), | 10579 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31), |
@@ -11689,6 +11695,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = { | |||
11689 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", | 11695 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", |
11690 | ALC268_ACER_ASPIRE_ONE), | 11696 | ALC268_ACER_ASPIRE_ONE), |
11691 | SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), | 11697 | SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), |
11698 | SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL), | ||
11692 | SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), | 11699 | SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), |
11693 | SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), | 11700 | SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), |
11694 | SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), | 11701 | SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 35b83dc6e19e..c39deebb588f 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -55,7 +55,8 @@ enum { | |||
55 | STAC_9200_DELL_M25, | 55 | STAC_9200_DELL_M25, |
56 | STAC_9200_DELL_M26, | 56 | STAC_9200_DELL_M26, |
57 | STAC_9200_DELL_M27, | 57 | STAC_9200_DELL_M27, |
58 | STAC_9200_GATEWAY, | 58 | STAC_9200_M4, |
59 | STAC_9200_M4_2, | ||
59 | STAC_9200_PANASONIC, | 60 | STAC_9200_PANASONIC, |
60 | STAC_9200_MODELS | 61 | STAC_9200_MODELS |
61 | }; | 62 | }; |
@@ -89,14 +90,19 @@ enum { | |||
89 | STAC_DELL_M4_2, | 90 | STAC_DELL_M4_2, |
90 | STAC_DELL_M4_3, | 91 | STAC_DELL_M4_3, |
91 | STAC_HP_M4, | 92 | STAC_HP_M4, |
93 | STAC_HP_DV5, | ||
92 | STAC_92HD71BXX_MODELS | 94 | STAC_92HD71BXX_MODELS |
93 | }; | 95 | }; |
94 | 96 | ||
95 | enum { | 97 | enum { |
96 | STAC_925x_REF, | 98 | STAC_925x_REF, |
99 | STAC_M1, | ||
100 | STAC_M1_2, | ||
101 | STAC_M2, | ||
97 | STAC_M2_2, | 102 | STAC_M2_2, |
98 | STAC_MA6, | 103 | STAC_M3, |
99 | STAC_PA6, | 104 | STAC_M5, |
105 | STAC_M6, | ||
100 | STAC_925x_MODELS | 106 | STAC_925x_MODELS |
101 | }; | 107 | }; |
102 | 108 | ||
@@ -331,6 +337,10 @@ static unsigned int stac92hd83xxx_pwr_mapping[4] = { | |||
331 | 0x03, 0x0c, 0x10, 0x40, | 337 | 0x03, 0x0c, 0x10, 0x40, |
332 | }; | 338 | }; |
333 | 339 | ||
340 | static hda_nid_t stac92hd83xxx_amp_nids[1] = { | ||
341 | 0xc, | ||
342 | }; | ||
343 | |||
334 | static hda_nid_t stac92hd71bxx_pwr_nids[3] = { | 344 | static hda_nid_t stac92hd71bxx_pwr_nids[3] = { |
335 | 0x0a, 0x0d, 0x0f | 345 | 0x0a, 0x0d, 0x0f |
336 | }; | 346 | }; |
@@ -875,6 +885,8 @@ static struct hda_verb stac92hd71bxx_analog_core_init[] = { | |||
875 | static struct hda_verb stac925x_core_init[] = { | 885 | static struct hda_verb stac925x_core_init[] = { |
876 | /* set dac0mux for dac converter */ | 886 | /* set dac0mux for dac converter */ |
877 | { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, | 887 | { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, |
888 | /* unmute and set max the selector */ | ||
889 | { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb01f }, | ||
878 | {} | 890 | {} |
879 | }; | 891 | }; |
880 | 892 | ||
@@ -1334,7 +1346,16 @@ static unsigned int ref9200_pin_configs[8] = { | |||
1334 | 0x02a19020, 0x01a19021, 0x90100140, 0x01813122, | 1346 | 0x02a19020, 0x01a19021, 0x90100140, 0x01813122, |
1335 | }; | 1347 | }; |
1336 | 1348 | ||
1337 | /* | 1349 | static unsigned int gateway9200_m4_pin_configs[8] = { |
1350 | 0x400000fe, 0x404500f4, 0x400100f0, 0x90110010, | ||
1351 | 0x400100f1, 0x02a1902e, 0x500000f2, 0x500000f3, | ||
1352 | }; | ||
1353 | static unsigned int gateway9200_m4_2_pin_configs[8] = { | ||
1354 | 0x400000fe, 0x404500f4, 0x400100f0, 0x90110010, | ||
1355 | 0x400100f1, 0x02a1902e, 0x500000f2, 0x500000f3, | ||
1356 | }; | ||
1357 | |||
1358 | /* | ||
1338 | STAC 9200 pin configs for | 1359 | STAC 9200 pin configs for |
1339 | 102801A8 | 1360 | 102801A8 |
1340 | 102801DE | 1361 | 102801DE |
@@ -1464,6 +1485,8 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = { | |||
1464 | [STAC_9200_DELL_M25] = dell9200_m25_pin_configs, | 1485 | [STAC_9200_DELL_M25] = dell9200_m25_pin_configs, |
1465 | [STAC_9200_DELL_M26] = dell9200_m26_pin_configs, | 1486 | [STAC_9200_DELL_M26] = dell9200_m26_pin_configs, |
1466 | [STAC_9200_DELL_M27] = dell9200_m27_pin_configs, | 1487 | [STAC_9200_DELL_M27] = dell9200_m27_pin_configs, |
1488 | [STAC_9200_M4] = gateway9200_m4_pin_configs, | ||
1489 | [STAC_9200_M4_2] = gateway9200_m4_2_pin_configs, | ||
1467 | [STAC_9200_PANASONIC] = ref9200_pin_configs, | 1490 | [STAC_9200_PANASONIC] = ref9200_pin_configs, |
1468 | }; | 1491 | }; |
1469 | 1492 | ||
@@ -1480,7 +1503,8 @@ static const char *stac9200_models[STAC_9200_MODELS] = { | |||
1480 | [STAC_9200_DELL_M25] = "dell-m25", | 1503 | [STAC_9200_DELL_M25] = "dell-m25", |
1481 | [STAC_9200_DELL_M26] = "dell-m26", | 1504 | [STAC_9200_DELL_M26] = "dell-m26", |
1482 | [STAC_9200_DELL_M27] = "dell-m27", | 1505 | [STAC_9200_DELL_M27] = "dell-m27", |
1483 | [STAC_9200_GATEWAY] = "gateway", | 1506 | [STAC_9200_M4] = "gateway-m4", |
1507 | [STAC_9200_M4_2] = "gateway-m4-2", | ||
1484 | [STAC_9200_PANASONIC] = "panasonic", | 1508 | [STAC_9200_PANASONIC] = "panasonic", |
1485 | }; | 1509 | }; |
1486 | 1510 | ||
@@ -1550,11 +1574,9 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = { | |||
1550 | /* Panasonic */ | 1574 | /* Panasonic */ |
1551 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC), | 1575 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC), |
1552 | /* Gateway machines needs EAPD to be set on resume */ | 1576 | /* Gateway machines needs EAPD to be set on resume */ |
1553 | SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_GATEWAY), | 1577 | SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4), |
1554 | SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", | 1578 | SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", STAC_9200_M4_2), |
1555 | STAC_9200_GATEWAY), | 1579 | SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707", STAC_9200_M4_2), |
1556 | SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707", | ||
1557 | STAC_9200_GATEWAY), | ||
1558 | /* OQO Mobile */ | 1580 | /* OQO Mobile */ |
1559 | SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO), | 1581 | SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO), |
1560 | {} /* terminator */ | 1582 | {} /* terminator */ |
@@ -1565,44 +1587,85 @@ static unsigned int ref925x_pin_configs[8] = { | |||
1565 | 0x90a70320, 0x02214210, 0x01019020, 0x9033032e, | 1587 | 0x90a70320, 0x02214210, 0x01019020, 0x9033032e, |
1566 | }; | 1588 | }; |
1567 | 1589 | ||
1568 | static unsigned int stac925x_MA6_pin_configs[8] = { | 1590 | static unsigned int stac925xM1_pin_configs[8] = { |
1569 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, | 1591 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, |
1570 | 0x90a70320, 0x90100211, 0x400003f1, 0x9033032e, | 1592 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, |
1571 | }; | 1593 | }; |
1572 | 1594 | ||
1573 | static unsigned int stac925x_PA6_pin_configs[8] = { | 1595 | static unsigned int stac925xM1_2_pin_configs[8] = { |
1574 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, | 1596 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, |
1575 | 0x50a103f0, 0x90100211, 0x400003f1, 0x9033032e, | 1597 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, |
1598 | }; | ||
1599 | |||
1600 | static unsigned int stac925xM2_pin_configs[8] = { | ||
1601 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1602 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | ||
1576 | }; | 1603 | }; |
1577 | 1604 | ||
1578 | static unsigned int stac925xM2_2_pin_configs[8] = { | 1605 | static unsigned int stac925xM2_2_pin_configs[8] = { |
1579 | 0x40c003f3, 0x424503f2, 0x04180011, 0x02a19020, | 1606 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, |
1580 | 0x50a103f0, 0x90100212, 0x400003f1, 0x9033032e, | 1607 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, |
1608 | }; | ||
1609 | |||
1610 | static unsigned int stac925xM3_pin_configs[8] = { | ||
1611 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1612 | 0x40a000f0, 0x90100210, 0x400003f1, 0x503303f3, | ||
1613 | }; | ||
1614 | |||
1615 | static unsigned int stac925xM5_pin_configs[8] = { | ||
1616 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1617 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | ||
1618 | }; | ||
1619 | |||
1620 | static unsigned int stac925xM6_pin_configs[8] = { | ||
1621 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1622 | 0x40a000f0, 0x90100210, 0x400003f1, 0x90330320, | ||
1581 | }; | 1623 | }; |
1582 | 1624 | ||
1583 | static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { | 1625 | static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { |
1584 | [STAC_REF] = ref925x_pin_configs, | 1626 | [STAC_REF] = ref925x_pin_configs, |
1627 | [STAC_M1] = stac925xM1_pin_configs, | ||
1628 | [STAC_M1_2] = stac925xM1_2_pin_configs, | ||
1629 | [STAC_M2] = stac925xM2_pin_configs, | ||
1585 | [STAC_M2_2] = stac925xM2_2_pin_configs, | 1630 | [STAC_M2_2] = stac925xM2_2_pin_configs, |
1586 | [STAC_MA6] = stac925x_MA6_pin_configs, | 1631 | [STAC_M3] = stac925xM3_pin_configs, |
1587 | [STAC_PA6] = stac925x_PA6_pin_configs, | 1632 | [STAC_M5] = stac925xM5_pin_configs, |
1633 | [STAC_M6] = stac925xM6_pin_configs, | ||
1588 | }; | 1634 | }; |
1589 | 1635 | ||
1590 | static const char *stac925x_models[STAC_925x_MODELS] = { | 1636 | static const char *stac925x_models[STAC_925x_MODELS] = { |
1591 | [STAC_REF] = "ref", | 1637 | [STAC_REF] = "ref", |
1638 | [STAC_M1] = "m1", | ||
1639 | [STAC_M1_2] = "m1-2", | ||
1640 | [STAC_M2] = "m2", | ||
1592 | [STAC_M2_2] = "m2-2", | 1641 | [STAC_M2_2] = "m2-2", |
1593 | [STAC_MA6] = "m6", | 1642 | [STAC_M3] = "m3", |
1594 | [STAC_PA6] = "pa6", | 1643 | [STAC_M5] = "m5", |
1644 | [STAC_M6] = "m6", | ||
1645 | }; | ||
1646 | |||
1647 | static struct snd_pci_quirk stac925x_codec_id_cfg_tbl[] = { | ||
1648 | SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2), | ||
1649 | SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5), | ||
1650 | SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1), | ||
1651 | SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_M2), | ||
1652 | SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2), | ||
1653 | /* Not sure about the brand name for those */ | ||
1654 | SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1), | ||
1655 | SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3), | ||
1656 | SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6), | ||
1657 | SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2), | ||
1658 | {} /* terminator */ | ||
1595 | }; | 1659 | }; |
1596 | 1660 | ||
1597 | static struct snd_pci_quirk stac925x_cfg_tbl[] = { | 1661 | static struct snd_pci_quirk stac925x_cfg_tbl[] = { |
1598 | /* SigmaTel reference board */ | 1662 | /* SigmaTel reference board */ |
1599 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), | 1663 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), |
1600 | SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), | 1664 | SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), |
1601 | SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF), | 1665 | |
1602 | SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF), | 1666 | /* Default table for unknown ID */ |
1603 | SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6), | 1667 | SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2), |
1604 | SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_PA6), | 1668 | |
1605 | SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2), | ||
1606 | {} /* terminator */ | 1669 | {} /* terminator */ |
1607 | }; | 1670 | }; |
1608 | 1671 | ||
@@ -1682,7 +1745,7 @@ static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = { | |||
1682 | static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { | 1745 | static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { |
1683 | /* SigmaTel reference board */ | 1746 | /* SigmaTel reference board */ |
1684 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, | 1747 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
1685 | "DFI LanParty", STAC_92HD71BXX_REF), | 1748 | "DFI LanParty", STAC_92HD83XXX_REF), |
1686 | {} /* terminator */ | 1749 | {} /* terminator */ |
1687 | }; | 1750 | }; |
1688 | 1751 | ||
@@ -1716,6 +1779,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { | |||
1716 | [STAC_DELL_M4_2] = dell_m4_2_pin_configs, | 1779 | [STAC_DELL_M4_2] = dell_m4_2_pin_configs, |
1717 | [STAC_DELL_M4_3] = dell_m4_3_pin_configs, | 1780 | [STAC_DELL_M4_3] = dell_m4_3_pin_configs, |
1718 | [STAC_HP_M4] = NULL, | 1781 | [STAC_HP_M4] = NULL, |
1782 | [STAC_HP_DV5] = NULL, | ||
1719 | }; | 1783 | }; |
1720 | 1784 | ||
1721 | static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { | 1785 | static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { |
@@ -1724,6 +1788,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { | |||
1724 | [STAC_DELL_M4_2] = "dell-m4-2", | 1788 | [STAC_DELL_M4_2] = "dell-m4-2", |
1725 | [STAC_DELL_M4_3] = "dell-m4-3", | 1789 | [STAC_DELL_M4_3] = "dell-m4-3", |
1726 | [STAC_HP_M4] = "hp-m4", | 1790 | [STAC_HP_M4] = "hp-m4", |
1791 | [STAC_HP_DV5] = "hp-dv5", | ||
1727 | }; | 1792 | }; |
1728 | 1793 | ||
1729 | static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { | 1794 | static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { |
@@ -1736,6 +1801,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { | |||
1736 | "HP dv7", STAC_HP_M4), | 1801 | "HP dv7", STAC_HP_M4), |
1737 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc, | 1802 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc, |
1738 | "HP dv7", STAC_HP_M4), | 1803 | "HP dv7", STAC_HP_M4), |
1804 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603, | ||
1805 | "HP dv5", STAC_HP_DV5), | ||
1739 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, | 1806 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, |
1740 | "unknown HP", STAC_HP_M4), | 1807 | "unknown HP", STAC_HP_M4), |
1741 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, | 1808 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, |
@@ -4163,8 +4230,19 @@ static void stac92xx_hp_detect(struct hda_codec *codec) | |||
4163 | continue; | 4230 | continue; |
4164 | if (presence) | 4231 | if (presence) |
4165 | stac92xx_set_pinctl(codec, cfg->hp_pins[i], val); | 4232 | stac92xx_set_pinctl(codec, cfg->hp_pins[i], val); |
4233 | #if 0 /* FIXME */ | ||
4234 | /* Resetting the pinctl like below may lead to (a sort of) regressions | ||
4235 | * on some devices since they use the HP pin actually for line/speaker | ||
4236 | * outs although the default pin config shows a different pin (that is | ||
4237 | * wrong and useless). | ||
4238 | * | ||
4239 | * So, it's basically a problem of default pin configs, likely a BIOS issue. | ||
4240 | * But, disabling the code below just works around it, and I'm too tired of | ||
4241 | * bug reports with such devices... | ||
4242 | */ | ||
4166 | else | 4243 | else |
4167 | stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val); | 4244 | stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val); |
4245 | #endif /* FIXME */ | ||
4168 | } | 4246 | } |
4169 | } | 4247 | } |
4170 | 4248 | ||
@@ -4390,7 +4468,8 @@ static int patch_stac9200(struct hda_codec *codec) | |||
4390 | spec->num_adcs = 1; | 4468 | spec->num_adcs = 1; |
4391 | spec->num_pwrs = 0; | 4469 | spec->num_pwrs = 0; |
4392 | 4470 | ||
4393 | if (spec->board_config == STAC_9200_GATEWAY || | 4471 | if (spec->board_config == STAC_9200_M4 || |
4472 | spec->board_config == STAC_9200_M4_2 || | ||
4394 | spec->board_config == STAC_9200_OQO) | 4473 | spec->board_config == STAC_9200_OQO) |
4395 | spec->init = stac9200_eapd_init; | 4474 | spec->init = stac9200_eapd_init; |
4396 | else | 4475 | else |
@@ -4408,6 +4487,12 @@ static int patch_stac9200(struct hda_codec *codec) | |||
4408 | return err; | 4487 | return err; |
4409 | } | 4488 | } |
4410 | 4489 | ||
4490 | /* CF-74 has no headphone detection, and the driver should *NOT* | ||
4491 | * do detection and HP/speaker toggle because the hardware does it. | ||
4492 | */ | ||
4493 | if (spec->board_config == STAC_9200_PANASONIC) | ||
4494 | spec->hp_detect = 0; | ||
4495 | |||
4411 | codec->patch_ops = stac92xx_patch_ops; | 4496 | codec->patch_ops = stac92xx_patch_ops; |
4412 | 4497 | ||
4413 | return 0; | 4498 | return 0; |
@@ -4425,12 +4510,22 @@ static int patch_stac925x(struct hda_codec *codec) | |||
4425 | codec->spec = spec; | 4510 | codec->spec = spec; |
4426 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); | 4511 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); |
4427 | spec->pin_nids = stac925x_pin_nids; | 4512 | spec->pin_nids = stac925x_pin_nids; |
4428 | spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, | 4513 | |
4514 | /* Check first for codec ID */ | ||
4515 | spec->board_config = snd_hda_check_board_codec_sid_config(codec, | ||
4516 | STAC_925x_MODELS, | ||
4517 | stac925x_models, | ||
4518 | stac925x_codec_id_cfg_tbl); | ||
4519 | |||
4520 | /* Now checks for PCI ID, if codec ID is not found */ | ||
4521 | if (spec->board_config < 0) | ||
4522 | spec->board_config = snd_hda_check_board_config(codec, | ||
4523 | STAC_925x_MODELS, | ||
4429 | stac925x_models, | 4524 | stac925x_models, |
4430 | stac925x_cfg_tbl); | 4525 | stac925x_cfg_tbl); |
4431 | again: | 4526 | again: |
4432 | if (spec->board_config < 0) { | 4527 | if (spec->board_config < 0) { |
4433 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x," | 4528 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x," |
4434 | "using BIOS defaults\n"); | 4529 | "using BIOS defaults\n"); |
4435 | err = stac92xx_save_bios_config_regs(codec); | 4530 | err = stac92xx_save_bios_config_regs(codec); |
4436 | } else | 4531 | } else |
@@ -4672,6 +4767,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
4672 | spec->dmux_nids = stac92hd83xxx_dmux_nids; | 4767 | spec->dmux_nids = stac92hd83xxx_dmux_nids; |
4673 | spec->adc_nids = stac92hd83xxx_adc_nids; | 4768 | spec->adc_nids = stac92hd83xxx_adc_nids; |
4674 | spec->pwr_nids = stac92hd83xxx_pwr_nids; | 4769 | spec->pwr_nids = stac92hd83xxx_pwr_nids; |
4770 | spec->amp_nids = stac92hd83xxx_amp_nids; | ||
4675 | spec->pwr_mapping = stac92hd83xxx_pwr_mapping; | 4771 | spec->pwr_mapping = stac92hd83xxx_pwr_mapping; |
4676 | spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); | 4772 | spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); |
4677 | spec->multiout.dac_nids = spec->dac_nids; | 4773 | spec->multiout.dac_nids = spec->dac_nids; |
@@ -4689,6 +4785,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
4689 | spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); | 4785 | spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); |
4690 | spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids); | 4786 | spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids); |
4691 | spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids); | 4787 | spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids); |
4788 | spec->num_amps = ARRAY_SIZE(stac92hd83xxx_amp_nids); | ||
4692 | spec->num_dmics = STAC92HD83XXX_NUM_DMICS; | 4789 | spec->num_dmics = STAC92HD83XXX_NUM_DMICS; |
4693 | spec->dinput_mux = &stac92hd83xxx_dmux; | 4790 | spec->dinput_mux = &stac92hd83xxx_dmux; |
4694 | spec->pin_nids = stac92hd83xxx_pin_nids; | 4791 | spec->pin_nids = stac92hd83xxx_pin_nids; |
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c index 98c6a8c65d81..e9e829e83d7a 100644 --- a/sound/pci/oxygen/virtuoso.c +++ b/sound/pci/oxygen/virtuoso.c | |||
@@ -26,7 +26,7 @@ | |||
26 | * SPI 0 -> 1st PCM1796 (front) | 26 | * SPI 0 -> 1st PCM1796 (front) |
27 | * SPI 1 -> 2nd PCM1796 (surround) | 27 | * SPI 1 -> 2nd PCM1796 (surround) |
28 | * SPI 2 -> 3rd PCM1796 (center/LFE) | 28 | * SPI 2 -> 3rd PCM1796 (center/LFE) |
29 | * SPI 4 -> 4th PCM1796 (back) | 29 | * SPI 4 -> 4th PCM1796 (back) and EEPROM self-destruct (do not use!) |
30 | * | 30 | * |
31 | * GPIO 2 -> M0 of CS5381 | 31 | * GPIO 2 -> M0 of CS5381 |
32 | * GPIO 3 -> M1 of CS5381 | 32 | * GPIO 3 -> M1 of CS5381 |
@@ -207,6 +207,12 @@ static void xonar_gpio_changed(struct oxygen *chip); | |||
207 | static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec, | 207 | static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec, |
208 | u8 reg, u8 value) | 208 | u8 reg, u8 value) |
209 | { | 209 | { |
210 | /* | ||
211 | * We don't want to do writes on SPI 4 because the EEPROM, which shares | ||
212 | * the same pin, might get confused and broken. We'd better take care | ||
213 | * that the driver works with the default register values ... | ||
214 | */ | ||
215 | #if 0 | ||
210 | /* maps ALSA channel pair number to SPI output */ | 216 | /* maps ALSA channel pair number to SPI output */ |
211 | static const u8 codec_map[4] = { | 217 | static const u8 codec_map[4] = { |
212 | 0, 1, 2, 4 | 218 | 0, 1, 2, 4 |
@@ -217,6 +223,7 @@ static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec, | |||
217 | (codec_map[codec] << OXYGEN_SPI_CODEC_SHIFT) | | 223 | (codec_map[codec] << OXYGEN_SPI_CODEC_SHIFT) | |
218 | OXYGEN_SPI_CEN_LATCH_CLOCK_HI, | 224 | OXYGEN_SPI_CEN_LATCH_CLOCK_HI, |
219 | (reg << 8) | value); | 225 | (reg << 8) | value); |
226 | #endif | ||
220 | } | 227 | } |
221 | 228 | ||
222 | static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec, | 229 | static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec, |
@@ -750,6 +757,9 @@ static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -12700, 100, 0); | |||
750 | 757 | ||
751 | static int xonar_d2_control_filter(struct snd_kcontrol_new *template) | 758 | static int xonar_d2_control_filter(struct snd_kcontrol_new *template) |
752 | { | 759 | { |
760 | if (!strncmp(template->name, "Master Playback ", 16)) | ||
761 | /* disable volume/mute because they would require SPI writes */ | ||
762 | return 1; | ||
753 | if (!strncmp(template->name, "CD Capture ", 11)) | 763 | if (!strncmp(template->name, "CD Capture ", 11)) |
754 | /* CD in is actually connected to the video in pin */ | 764 | /* CD in is actually connected to the video in pin */ |
755 | template->private_value ^= AC97_CD ^ AC97_VIDEO; | 765 | template->private_value ^= AC97_CD ^ AC97_VIDEO; |
@@ -840,9 +850,8 @@ static const struct oxygen_model model_xonar_d2 = { | |||
840 | .dac_volume_min = 0x0f, | 850 | .dac_volume_min = 0x0f, |
841 | .dac_volume_max = 0xff, | 851 | .dac_volume_max = 0xff, |
842 | .misc_flags = OXYGEN_MISC_MIDI, | 852 | .misc_flags = OXYGEN_MISC_MIDI, |
843 | .function_flags = OXYGEN_FUNCTION_SPI | | 853 | .function_flags = OXYGEN_FUNCTION_SPI, |
844 | OXYGEN_FUNCTION_ENABLE_SPI_4_5, | 854 | .dac_i2s_format = OXYGEN_I2S_FORMAT_I2S, |
845 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | ||
846 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 855 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
847 | }; | 856 | }; |
848 | 857 | ||
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index fd0f338374a7..ea370a4f86d5 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -197,7 +197,7 @@ static const char *twl4030_earpiece_texts[] = | |||
197 | static const unsigned int twl4030_earpiece_values[] = | 197 | static const unsigned int twl4030_earpiece_values[] = |
198 | {0x0, 0x1, 0x2, 0x4}; | 198 | {0x0, 0x1, 0x2, 0x4}; |
199 | 199 | ||
200 | static const struct soc_value_enum twl4030_earpiece_enum = | 200 | static const struct soc_enum twl4030_earpiece_enum = |
201 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_EAR_CTL, 1, 0x7, | 201 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_EAR_CTL, 1, 0x7, |
202 | ARRAY_SIZE(twl4030_earpiece_texts), | 202 | ARRAY_SIZE(twl4030_earpiece_texts), |
203 | twl4030_earpiece_texts, | 203 | twl4030_earpiece_texts, |
@@ -213,7 +213,7 @@ static const char *twl4030_predrivel_texts[] = | |||
213 | static const unsigned int twl4030_predrivel_values[] = | 213 | static const unsigned int twl4030_predrivel_values[] = |
214 | {0x0, 0x1, 0x2, 0x4}; | 214 | {0x0, 0x1, 0x2, 0x4}; |
215 | 215 | ||
216 | static const struct soc_value_enum twl4030_predrivel_enum = | 216 | static const struct soc_enum twl4030_predrivel_enum = |
217 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_PREDL_CTL, 1, 0x7, | 217 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_PREDL_CTL, 1, 0x7, |
218 | ARRAY_SIZE(twl4030_predrivel_texts), | 218 | ARRAY_SIZE(twl4030_predrivel_texts), |
219 | twl4030_predrivel_texts, | 219 | twl4030_predrivel_texts, |
@@ -229,7 +229,7 @@ static const char *twl4030_predriver_texts[] = | |||
229 | static const unsigned int twl4030_predriver_values[] = | 229 | static const unsigned int twl4030_predriver_values[] = |
230 | {0x0, 0x1, 0x2, 0x4}; | 230 | {0x0, 0x1, 0x2, 0x4}; |
231 | 231 | ||
232 | static const struct soc_value_enum twl4030_predriver_enum = | 232 | static const struct soc_enum twl4030_predriver_enum = |
233 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_PREDR_CTL, 1, 0x7, | 233 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_PREDR_CTL, 1, 0x7, |
234 | ARRAY_SIZE(twl4030_predriver_texts), | 234 | ARRAY_SIZE(twl4030_predriver_texts), |
235 | twl4030_predriver_texts, | 235 | twl4030_predriver_texts, |
@@ -317,7 +317,7 @@ static const char *twl4030_analoglmic_texts[] = | |||
317 | static const unsigned int twl4030_analoglmic_values[] = | 317 | static const unsigned int twl4030_analoglmic_values[] = |
318 | {0x0, 0x1, 0x2, 0x4, 0x8}; | 318 | {0x0, 0x1, 0x2, 0x4, 0x8}; |
319 | 319 | ||
320 | static const struct soc_value_enum twl4030_analoglmic_enum = | 320 | static const struct soc_enum twl4030_analoglmic_enum = |
321 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICL, 0, 0xf, | 321 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICL, 0, 0xf, |
322 | ARRAY_SIZE(twl4030_analoglmic_texts), | 322 | ARRAY_SIZE(twl4030_analoglmic_texts), |
323 | twl4030_analoglmic_texts, | 323 | twl4030_analoglmic_texts, |
@@ -333,7 +333,7 @@ static const char *twl4030_analogrmic_texts[] = | |||
333 | static const unsigned int twl4030_analogrmic_values[] = | 333 | static const unsigned int twl4030_analogrmic_values[] = |
334 | {0x0, 0x1, 0x4}; | 334 | {0x0, 0x1, 0x4}; |
335 | 335 | ||
336 | static const struct soc_value_enum twl4030_analogrmic_enum = | 336 | static const struct soc_enum twl4030_analogrmic_enum = |
337 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICR, 0, 0x5, | 337 | SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICR, 0, 0x5, |
338 | ARRAY_SIZE(twl4030_analogrmic_texts), | 338 | ARRAY_SIZE(twl4030_analogrmic_texts), |
339 | twl4030_analogrmic_texts, | 339 | twl4030_analogrmic_texts, |
@@ -1280,6 +1280,8 @@ static int twl4030_remove(struct platform_device *pdev) | |||
1280 | struct snd_soc_codec *codec = socdev->codec; | 1280 | struct snd_soc_codec *codec = socdev->codec; |
1281 | 1281 | ||
1282 | printk(KERN_INFO "TWL4030 Audio Codec remove\n"); | 1282 | printk(KERN_INFO "TWL4030 Audio Codec remove\n"); |
1283 | snd_soc_free_pcms(socdev); | ||
1284 | snd_soc_dapm_free(socdev); | ||
1283 | kfree(codec); | 1285 | kfree(codec); |
1284 | 1286 | ||
1285 | return 0; | 1287 | return 0; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6cbe7e82f238..55fdb4abb179 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1585,37 +1585,6 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, | |||
1585 | EXPORT_SYMBOL_GPL(snd_soc_put_enum_double); | 1585 | EXPORT_SYMBOL_GPL(snd_soc_put_enum_double); |
1586 | 1586 | ||
1587 | /** | 1587 | /** |
1588 | * snd_soc_info_value_enum_double - semi enumerated double mixer info callback | ||
1589 | * @kcontrol: mixer control | ||
1590 | * @uinfo: control element information | ||
1591 | * | ||
1592 | * Callback to provide information about a double semi enumerated | ||
1593 | * mixer control. | ||
1594 | * | ||
1595 | * Semi enumerated mixer: the enumerated items are referred as values. Can be | ||
1596 | * used for handling bitfield coded enumeration for example. | ||
1597 | * | ||
1598 | * Returns 0 for success. | ||
1599 | */ | ||
1600 | int snd_soc_info_value_enum_double(struct snd_kcontrol *kcontrol, | ||
1601 | struct snd_ctl_elem_info *uinfo) | ||
1602 | { | ||
1603 | struct soc_value_enum *e = (struct soc_value_enum *) | ||
1604 | kcontrol->private_value; | ||
1605 | |||
1606 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | ||
1607 | uinfo->count = e->shift_l == e->shift_r ? 1 : 2; | ||
1608 | uinfo->value.enumerated.items = e->max; | ||
1609 | |||
1610 | if (uinfo->value.enumerated.item > e->max - 1) | ||
1611 | uinfo->value.enumerated.item = e->max - 1; | ||
1612 | strcpy(uinfo->value.enumerated.name, | ||
1613 | e->texts[uinfo->value.enumerated.item]); | ||
1614 | return 0; | ||
1615 | } | ||
1616 | EXPORT_SYMBOL_GPL(snd_soc_info_value_enum_double); | ||
1617 | |||
1618 | /** | ||
1619 | * snd_soc_get_value_enum_double - semi enumerated double mixer get callback | 1588 | * snd_soc_get_value_enum_double - semi enumerated double mixer get callback |
1620 | * @kcontrol: mixer control | 1589 | * @kcontrol: mixer control |
1621 | * @ucontrol: control element information | 1590 | * @ucontrol: control element information |
@@ -1631,8 +1600,7 @@ int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1631 | struct snd_ctl_elem_value *ucontrol) | 1600 | struct snd_ctl_elem_value *ucontrol) |
1632 | { | 1601 | { |
1633 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1602 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
1634 | struct soc_value_enum *e = (struct soc_value_enum *) | 1603 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
1635 | kcontrol->private_value; | ||
1636 | unsigned short reg_val, val, mux; | 1604 | unsigned short reg_val, val, mux; |
1637 | 1605 | ||
1638 | reg_val = snd_soc_read(codec, e->reg); | 1606 | reg_val = snd_soc_read(codec, e->reg); |
@@ -1671,8 +1639,7 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1671 | struct snd_ctl_elem_value *ucontrol) | 1639 | struct snd_ctl_elem_value *ucontrol) |
1672 | { | 1640 | { |
1673 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1641 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
1674 | struct soc_value_enum *e = (struct soc_value_enum *) | 1642 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
1675 | kcontrol->private_value; | ||
1676 | unsigned short val; | 1643 | unsigned short val; |
1677 | unsigned short mask; | 1644 | unsigned short mask; |
1678 | 1645 | ||
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ad0d801677c1..a2f1da8b4646 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -137,7 +137,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
137 | } | 137 | } |
138 | break; | 138 | break; |
139 | case snd_soc_dapm_value_mux: { | 139 | case snd_soc_dapm_value_mux: { |
140 | struct soc_value_enum *e = (struct soc_value_enum *) | 140 | struct soc_enum *e = (struct soc_enum *) |
141 | w->kcontrols[i].private_value; | 141 | w->kcontrols[i].private_value; |
142 | int val, item; | 142 | int val, item; |
143 | 143 | ||
@@ -200,30 +200,6 @@ static int dapm_connect_mux(struct snd_soc_codec *codec, | |||
200 | return -ENODEV; | 200 | return -ENODEV; |
201 | } | 201 | } |
202 | 202 | ||
203 | /* connect value_mux widget to it's interconnecting audio paths */ | ||
204 | static int dapm_connect_value_mux(struct snd_soc_codec *codec, | ||
205 | struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest, | ||
206 | struct snd_soc_dapm_path *path, const char *control_name, | ||
207 | const struct snd_kcontrol_new *kcontrol) | ||
208 | { | ||
209 | struct soc_value_enum *e = (struct soc_value_enum *) | ||
210 | kcontrol->private_value; | ||
211 | int i; | ||
212 | |||
213 | for (i = 0; i < e->max; i++) { | ||
214 | if (!(strcmp(control_name, e->texts[i]))) { | ||
215 | list_add(&path->list, &codec->dapm_paths); | ||
216 | list_add(&path->list_sink, &dest->sources); | ||
217 | list_add(&path->list_source, &src->sinks); | ||
218 | path->name = (char *)e->texts[i]; | ||
219 | dapm_set_path_status(dest, path, 0); | ||
220 | return 0; | ||
221 | } | ||
222 | } | ||
223 | |||
224 | return -ENODEV; | ||
225 | } | ||
226 | |||
227 | /* connect mixer widget to it's interconnecting audio paths */ | 203 | /* connect mixer widget to it's interconnecting audio paths */ |
228 | static int dapm_connect_mixer(struct snd_soc_codec *codec, | 204 | static int dapm_connect_mixer(struct snd_soc_codec *codec, |
229 | struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest, | 205 | struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest, |
@@ -744,7 +720,8 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | |||
744 | struct snd_soc_dapm_path *path; | 720 | struct snd_soc_dapm_path *path; |
745 | int found = 0; | 721 | int found = 0; |
746 | 722 | ||
747 | if (widget->id != snd_soc_dapm_mux) | 723 | if (widget->id != snd_soc_dapm_mux && |
724 | widget->id != snd_soc_dapm_value_mux) | ||
748 | return -ENODEV; | 725 | return -ENODEV; |
749 | 726 | ||
750 | if (!snd_soc_test_bits(widget->codec, e->reg, mask, val)) | 727 | if (!snd_soc_test_bits(widget->codec, e->reg, mask, val)) |
@@ -774,45 +751,6 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | |||
774 | return 0; | 751 | return 0; |
775 | } | 752 | } |
776 | 753 | ||
777 | /* test and update the power status of a value_mux widget */ | ||
778 | static int dapm_value_mux_update_power(struct snd_soc_dapm_widget *widget, | ||
779 | struct snd_kcontrol *kcontrol, int mask, | ||
780 | int mux, int val, struct soc_value_enum *e) | ||
781 | { | ||
782 | struct snd_soc_dapm_path *path; | ||
783 | int found = 0; | ||
784 | |||
785 | if (widget->id != snd_soc_dapm_value_mux) | ||
786 | return -ENODEV; | ||
787 | |||
788 | if (!snd_soc_test_bits(widget->codec, e->reg, mask, val)) | ||
789 | return 0; | ||
790 | |||
791 | /* find dapm widget path assoc with kcontrol */ | ||
792 | list_for_each_entry(path, &widget->codec->dapm_paths, list) { | ||
793 | if (path->kcontrol != kcontrol) | ||
794 | continue; | ||
795 | |||
796 | if (!path->name || !e->texts[mux]) | ||
797 | continue; | ||
798 | |||
799 | found = 1; | ||
800 | /* we now need to match the string in the enum to the path */ | ||
801 | if (!(strcmp(path->name, e->texts[mux]))) | ||
802 | path->connect = 1; /* new connection */ | ||
803 | else | ||
804 | path->connect = 0; /* old connection must be | ||
805 | powered down */ | ||
806 | } | ||
807 | |||
808 | if (found) { | ||
809 | dapm_power_widgets(widget->codec, SND_SOC_DAPM_STREAM_NOP); | ||
810 | dump_dapm(widget->codec, "mux power update"); | ||
811 | } | ||
812 | |||
813 | return 0; | ||
814 | } | ||
815 | |||
816 | /* test and update the power status of a mixer or switch widget */ | 754 | /* test and update the power status of a mixer or switch widget */ |
817 | static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | 755 | static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, |
818 | struct snd_kcontrol *kcontrol, int reg, | 756 | struct snd_kcontrol *kcontrol, int reg, |
@@ -1045,17 +983,12 @@ static int snd_soc_dapm_add_route(struct snd_soc_codec *codec, | |||
1045 | path->connect = 1; | 983 | path->connect = 1; |
1046 | return 0; | 984 | return 0; |
1047 | case snd_soc_dapm_mux: | 985 | case snd_soc_dapm_mux: |
986 | case snd_soc_dapm_value_mux: | ||
1048 | ret = dapm_connect_mux(codec, wsource, wsink, path, control, | 987 | ret = dapm_connect_mux(codec, wsource, wsink, path, control, |
1049 | &wsink->kcontrols[0]); | 988 | &wsink->kcontrols[0]); |
1050 | if (ret != 0) | 989 | if (ret != 0) |
1051 | goto err; | 990 | goto err; |
1052 | break; | 991 | break; |
1053 | case snd_soc_dapm_value_mux: | ||
1054 | ret = dapm_connect_value_mux(codec, wsource, wsink, path, | ||
1055 | control, &wsink->kcontrols[0]); | ||
1056 | if (ret != 0) | ||
1057 | goto err; | ||
1058 | break; | ||
1059 | case snd_soc_dapm_switch: | 992 | case snd_soc_dapm_switch: |
1060 | case snd_soc_dapm_mixer: | 993 | case snd_soc_dapm_mixer: |
1061 | ret = dapm_connect_mixer(codec, wsource, wsink, path, control); | 994 | ret = dapm_connect_mixer(codec, wsource, wsink, path, control); |
@@ -1382,8 +1315,7 @@ int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1382 | struct snd_ctl_elem_value *ucontrol) | 1315 | struct snd_ctl_elem_value *ucontrol) |
1383 | { | 1316 | { |
1384 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); | 1317 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); |
1385 | struct soc_value_enum *e = (struct soc_value_enum *) | 1318 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
1386 | kcontrol->private_value; | ||
1387 | unsigned short reg_val, val, mux; | 1319 | unsigned short reg_val, val, mux; |
1388 | 1320 | ||
1389 | reg_val = snd_soc_read(widget->codec, e->reg); | 1321 | reg_val = snd_soc_read(widget->codec, e->reg); |
@@ -1423,8 +1355,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1423 | struct snd_ctl_elem_value *ucontrol) | 1355 | struct snd_ctl_elem_value *ucontrol) |
1424 | { | 1356 | { |
1425 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); | 1357 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); |
1426 | struct soc_value_enum *e = (struct soc_value_enum *) | 1358 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
1427 | kcontrol->private_value; | ||
1428 | unsigned short val, mux; | 1359 | unsigned short val, mux; |
1429 | unsigned short mask; | 1360 | unsigned short mask; |
1430 | int ret = 0; | 1361 | int ret = 0; |
@@ -1443,7 +1374,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1443 | 1374 | ||
1444 | mutex_lock(&widget->codec->mutex); | 1375 | mutex_lock(&widget->codec->mutex); |
1445 | widget->value = val; | 1376 | widget->value = val; |
1446 | dapm_value_mux_update_power(widget, kcontrol, mask, mux, val, e); | 1377 | dapm_mux_update_power(widget, kcontrol, mask, mux, val, e); |
1447 | if (widget->event) { | 1378 | if (widget->event) { |
1448 | if (widget->event_flags & SND_SOC_DAPM_PRE_REG) { | 1379 | if (widget->event_flags & SND_SOC_DAPM_PRE_REG) { |
1449 | ret = widget->event(widget, | 1380 | ret = widget->event(widget, |
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c index a62500e387a6..41c36b055f6b 100644 --- a/sound/usb/caiaq/caiaq-device.c +++ b/sound/usb/caiaq/caiaq-device.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); | 44 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); |
45 | MODULE_DESCRIPTION("caiaq USB audio, version 1.3.9"); | 45 | MODULE_DESCRIPTION("caiaq USB audio, version 1.3.10"); |
46 | MODULE_LICENSE("GPL"); | 46 | MODULE_LICENSE("GPL"); |
47 | MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," | 47 | MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," |
48 | "{Native Instruments, RigKontrol3}," | 48 | "{Native Instruments, RigKontrol3}," |
diff --git a/sound/usb/caiaq/caiaq-device.h b/sound/usb/caiaq/caiaq-device.h index f9fbdbae269d..ab56e738c5fc 100644 --- a/sound/usb/caiaq/caiaq-device.h +++ b/sound/usb/caiaq/caiaq-device.h | |||
@@ -75,6 +75,7 @@ struct snd_usb_caiaqdev { | |||
75 | wait_queue_head_t ep1_wait_queue; | 75 | wait_queue_head_t ep1_wait_queue; |
76 | wait_queue_head_t prepare_wait_queue; | 76 | wait_queue_head_t prepare_wait_queue; |
77 | int spec_received, audio_parm_answer; | 77 | int spec_received, audio_parm_answer; |
78 | int midi_out_active; | ||
78 | 79 | ||
79 | char vendor_name[CAIAQ_USB_STR_LEN]; | 80 | char vendor_name[CAIAQ_USB_STR_LEN]; |
80 | char product_name[CAIAQ_USB_STR_LEN]; | 81 | char product_name[CAIAQ_USB_STR_LEN]; |
diff --git a/sound/usb/caiaq/caiaq-midi.c b/sound/usb/caiaq/caiaq-midi.c index 30b57f97c6e4..f19fd360c936 100644 --- a/sound/usb/caiaq/caiaq-midi.c +++ b/sound/usb/caiaq/caiaq-midi.c | |||
@@ -59,6 +59,11 @@ static int snd_usb_caiaq_midi_output_open(struct snd_rawmidi_substream *substrea | |||
59 | 59 | ||
60 | static int snd_usb_caiaq_midi_output_close(struct snd_rawmidi_substream *substream) | 60 | static int snd_usb_caiaq_midi_output_close(struct snd_rawmidi_substream *substream) |
61 | { | 61 | { |
62 | struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; | ||
63 | if (dev->midi_out_active) { | ||
64 | usb_kill_urb(&dev->midi_out_urb); | ||
65 | dev->midi_out_active = 0; | ||
66 | } | ||
62 | return 0; | 67 | return 0; |
63 | } | 68 | } |
64 | 69 | ||
@@ -69,7 +74,8 @@ static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *dev, | |||
69 | 74 | ||
70 | dev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; | 75 | dev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; |
71 | dev->midi_out_buf[1] = 0; /* port */ | 76 | dev->midi_out_buf[1] = 0; /* port */ |
72 | len = snd_rawmidi_transmit_peek(substream, dev->midi_out_buf+3, EP1_BUFSIZE-3); | 77 | len = snd_rawmidi_transmit(substream, dev->midi_out_buf + 3, |
78 | EP1_BUFSIZE - 3); | ||
73 | 79 | ||
74 | if (len <= 0) | 80 | if (len <= 0) |
75 | return; | 81 | return; |
@@ -79,24 +85,24 @@ static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *dev, | |||
79 | 85 | ||
80 | ret = usb_submit_urb(&dev->midi_out_urb, GFP_ATOMIC); | 86 | ret = usb_submit_urb(&dev->midi_out_urb, GFP_ATOMIC); |
81 | if (ret < 0) | 87 | if (ret < 0) |
82 | log("snd_usb_caiaq_midi_send(%p): usb_submit_urb() failed, %d\n", | 88 | log("snd_usb_caiaq_midi_send(%p): usb_submit_urb() failed," |
83 | substream, ret); | 89 | "ret=%d, len=%d\n", |
90 | substream, ret, len); | ||
91 | else | ||
92 | dev->midi_out_active = 1; | ||
84 | } | 93 | } |
85 | 94 | ||
86 | static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) | 95 | static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) |
87 | { | 96 | { |
88 | struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; | 97 | struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; |
89 | 98 | ||
90 | if (dev->midi_out_substream != NULL) | 99 | if (up) { |
91 | return; | 100 | dev->midi_out_substream = substream; |
92 | 101 | if (!dev->midi_out_active) | |
93 | if (!up) { | 102 | snd_usb_caiaq_midi_send(dev, substream); |
103 | } else { | ||
94 | dev->midi_out_substream = NULL; | 104 | dev->midi_out_substream = NULL; |
95 | return; | ||
96 | } | 105 | } |
97 | |||
98 | dev->midi_out_substream = substream; | ||
99 | snd_usb_caiaq_midi_send(dev, substream); | ||
100 | } | 106 | } |
101 | 107 | ||
102 | 108 | ||
@@ -161,16 +167,14 @@ int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device) | |||
161 | void snd_usb_caiaq_midi_output_done(struct urb* urb) | 167 | void snd_usb_caiaq_midi_output_done(struct urb* urb) |
162 | { | 168 | { |
163 | struct snd_usb_caiaqdev *dev = urb->context; | 169 | struct snd_usb_caiaqdev *dev = urb->context; |
164 | char *buf = urb->transfer_buffer; | ||
165 | 170 | ||
171 | dev->midi_out_active = 0; | ||
166 | if (urb->status != 0) | 172 | if (urb->status != 0) |
167 | return; | 173 | return; |
168 | 174 | ||
169 | if (!dev->midi_out_substream) | 175 | if (!dev->midi_out_substream) |
170 | return; | 176 | return; |
171 | 177 | ||
172 | snd_rawmidi_transmit_ack(dev->midi_out_substream, buf[2]); | ||
173 | dev->midi_out_substream = NULL; | ||
174 | snd_usb_caiaq_midi_send(dev, dev->midi_out_substream); | 178 | snd_usb_caiaq_midi_send(dev, dev->midi_out_substream); |
175 | } | 179 | } |
176 | 180 | ||
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index 92115755d98e..5d8ef09b9dcc 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h | |||
@@ -128,6 +128,14 @@ | |||
128 | .bInterfaceClass = USB_CLASS_AUDIO, | 128 | .bInterfaceClass = USB_CLASS_AUDIO, |
129 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL | 129 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL |
130 | }, | 130 | }, |
131 | { | ||
132 | USB_DEVICE(0x046d, 0x0990), | ||
133 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { | ||
134 | .vendor_name = "Logitech, Inc.", | ||
135 | .product_name = "QuickCam Pro 9000", | ||
136 | .ifnum = QUIRK_NO_INTERFACE | ||
137 | } | ||
138 | }, | ||
131 | 139 | ||
132 | /* | 140 | /* |
133 | * Yamaha devices | 141 | * Yamaha devices |