diff options
Diffstat (limited to 'arch')
124 files changed, 865 insertions, 515 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e084b7e981e8..b259c7c644e3 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -220,8 +220,9 @@ config NEED_MACH_MEMORY_H | |||
220 | be avoided when possible. | 220 | be avoided when possible. |
221 | 221 | ||
222 | config PHYS_OFFSET | 222 | config PHYS_OFFSET |
223 | hex "Physical address of main memory" | 223 | hex "Physical address of main memory" if MMU |
224 | depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H | 224 | depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H |
225 | default DRAM_BASE if !MMU | ||
225 | help | 226 | help |
226 | Please provide the physical address corresponding to the | 227 | Please provide the physical address corresponding to the |
227 | location of main memory in your system. | 228 | location of main memory in your system. |
@@ -1245,7 +1246,7 @@ config PL310_ERRATA_588369 | |||
1245 | 1246 | ||
1246 | config ARM_ERRATA_720789 | 1247 | config ARM_ERRATA_720789 |
1247 | bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID" | 1248 | bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID" |
1248 | depends on CPU_V7 && SMP | 1249 | depends on CPU_V7 |
1249 | help | 1250 | help |
1250 | This option enables the workaround for the 720789 Cortex-A9 (prior to | 1251 | This option enables the workaround for the 720789 Cortex-A9 (prior to |
1251 | r2p0) erratum. A faulty ASID can be sent to the other CPUs for the | 1252 | r2p0) erratum. A faulty ASID can be sent to the other CPUs for the |
@@ -1281,7 +1282,7 @@ config ARM_ERRATA_743622 | |||
1281 | 1282 | ||
1282 | config ARM_ERRATA_751472 | 1283 | config ARM_ERRATA_751472 |
1283 | bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation" | 1284 | bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation" |
1284 | depends on CPU_V7 && SMP | 1285 | depends on CPU_V7 |
1285 | help | 1286 | help |
1286 | This option enables the workaround for the 751472 Cortex-A9 (prior | 1287 | This option enables the workaround for the 751472 Cortex-A9 (prior |
1287 | to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the | 1288 | to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the |
diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c index f407a6b35d3d..8d8df744f7a5 100644 --- a/arch/arm/common/pl330.c +++ b/arch/arm/common/pl330.c | |||
@@ -221,17 +221,6 @@ | |||
221 | */ | 221 | */ |
222 | #define MCODE_BUFF_PER_REQ 256 | 222 | #define MCODE_BUFF_PER_REQ 256 |
223 | 223 | ||
224 | /* | ||
225 | * Mark a _pl330_req as free. | ||
226 | * We do it by writing DMAEND as the first instruction | ||
227 | * because no valid request is going to have DMAEND as | ||
228 | * its first instruction to execute. | ||
229 | */ | ||
230 | #define MARK_FREE(req) do { \ | ||
231 | _emit_END(0, (req)->mc_cpu); \ | ||
232 | (req)->mc_len = 0; \ | ||
233 | } while (0) | ||
234 | |||
235 | /* If the _pl330_req is available to the client */ | 224 | /* If the _pl330_req is available to the client */ |
236 | #define IS_FREE(req) (*((u8 *)((req)->mc_cpu)) == CMD_DMAEND) | 225 | #define IS_FREE(req) (*((u8 *)((req)->mc_cpu)) == CMD_DMAEND) |
237 | 226 | ||
@@ -301,8 +290,10 @@ struct pl330_thread { | |||
301 | struct pl330_dmac *dmac; | 290 | struct pl330_dmac *dmac; |
302 | /* Only two at a time */ | 291 | /* Only two at a time */ |
303 | struct _pl330_req req[2]; | 292 | struct _pl330_req req[2]; |
304 | /* Index of the last submitted request */ | 293 | /* Index of the last enqueued request */ |
305 | unsigned lstenq; | 294 | unsigned lstenq; |
295 | /* Index of the last submitted request or -1 if the DMA is stopped */ | ||
296 | int req_running; | ||
306 | }; | 297 | }; |
307 | 298 | ||
308 | enum pl330_dmac_state { | 299 | enum pl330_dmac_state { |
@@ -778,6 +769,22 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd, | |||
778 | writel(0, regs + DBGCMD); | 769 | writel(0, regs + DBGCMD); |
779 | } | 770 | } |
780 | 771 | ||
772 | /* | ||
773 | * Mark a _pl330_req as free. | ||
774 | * We do it by writing DMAEND as the first instruction | ||
775 | * because no valid request is going to have DMAEND as | ||
776 | * its first instruction to execute. | ||
777 | */ | ||
778 | static void mark_free(struct pl330_thread *thrd, int idx) | ||
779 | { | ||
780 | struct _pl330_req *req = &thrd->req[idx]; | ||
781 | |||
782 | _emit_END(0, req->mc_cpu); | ||
783 | req->mc_len = 0; | ||
784 | |||
785 | thrd->req_running = -1; | ||
786 | } | ||
787 | |||
781 | static inline u32 _state(struct pl330_thread *thrd) | 788 | static inline u32 _state(struct pl330_thread *thrd) |
782 | { | 789 | { |
783 | void __iomem *regs = thrd->dmac->pinfo->base; | 790 | void __iomem *regs = thrd->dmac->pinfo->base; |
@@ -836,31 +843,6 @@ static inline u32 _state(struct pl330_thread *thrd) | |||
836 | } | 843 | } |
837 | } | 844 | } |
838 | 845 | ||
839 | /* If the request 'req' of thread 'thrd' is currently active */ | ||
840 | static inline bool _req_active(struct pl330_thread *thrd, | ||
841 | struct _pl330_req *req) | ||
842 | { | ||
843 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
844 | u32 buf = req->mc_bus, pc = readl(regs + CPC(thrd->id)); | ||
845 | |||
846 | if (IS_FREE(req)) | ||
847 | return false; | ||
848 | |||
849 | return (pc >= buf && pc <= buf + req->mc_len) ? true : false; | ||
850 | } | ||
851 | |||
852 | /* Returns 0 if the thread is inactive, ID of active req + 1 otherwise */ | ||
853 | static inline unsigned _thrd_active(struct pl330_thread *thrd) | ||
854 | { | ||
855 | if (_req_active(thrd, &thrd->req[0])) | ||
856 | return 1; /* First req active */ | ||
857 | |||
858 | if (_req_active(thrd, &thrd->req[1])) | ||
859 | return 2; /* Second req active */ | ||
860 | |||
861 | return 0; | ||
862 | } | ||
863 | |||
864 | static void _stop(struct pl330_thread *thrd) | 846 | static void _stop(struct pl330_thread *thrd) |
865 | { | 847 | { |
866 | void __iomem *regs = thrd->dmac->pinfo->base; | 848 | void __iomem *regs = thrd->dmac->pinfo->base; |
@@ -892,17 +874,22 @@ static bool _trigger(struct pl330_thread *thrd) | |||
892 | struct _arg_GO go; | 874 | struct _arg_GO go; |
893 | unsigned ns; | 875 | unsigned ns; |
894 | u8 insn[6] = {0, 0, 0, 0, 0, 0}; | 876 | u8 insn[6] = {0, 0, 0, 0, 0, 0}; |
877 | int idx; | ||
895 | 878 | ||
896 | /* Return if already ACTIVE */ | 879 | /* Return if already ACTIVE */ |
897 | if (_state(thrd) != PL330_STATE_STOPPED) | 880 | if (_state(thrd) != PL330_STATE_STOPPED) |
898 | return true; | 881 | return true; |
899 | 882 | ||
900 | if (!IS_FREE(&thrd->req[1 - thrd->lstenq])) | 883 | idx = 1 - thrd->lstenq; |
901 | req = &thrd->req[1 - thrd->lstenq]; | 884 | if (!IS_FREE(&thrd->req[idx])) |
902 | else if (!IS_FREE(&thrd->req[thrd->lstenq])) | 885 | req = &thrd->req[idx]; |
903 | req = &thrd->req[thrd->lstenq]; | 886 | else { |
904 | else | 887 | idx = thrd->lstenq; |
905 | req = NULL; | 888 | if (!IS_FREE(&thrd->req[idx])) |
889 | req = &thrd->req[idx]; | ||
890 | else | ||
891 | req = NULL; | ||
892 | } | ||
906 | 893 | ||
907 | /* Return if no request */ | 894 | /* Return if no request */ |
908 | if (!req || !req->r) | 895 | if (!req || !req->r) |
@@ -933,6 +920,8 @@ static bool _trigger(struct pl330_thread *thrd) | |||
933 | /* Only manager can execute GO */ | 920 | /* Only manager can execute GO */ |
934 | _execute_DBGINSN(thrd, insn, true); | 921 | _execute_DBGINSN(thrd, insn, true); |
935 | 922 | ||
923 | thrd->req_running = idx; | ||
924 | |||
936 | return true; | 925 | return true; |
937 | } | 926 | } |
938 | 927 | ||
@@ -1382,8 +1371,8 @@ static void pl330_dotask(unsigned long data) | |||
1382 | 1371 | ||
1383 | thrd->req[0].r = NULL; | 1372 | thrd->req[0].r = NULL; |
1384 | thrd->req[1].r = NULL; | 1373 | thrd->req[1].r = NULL; |
1385 | MARK_FREE(&thrd->req[0]); | 1374 | mark_free(thrd, 0); |
1386 | MARK_FREE(&thrd->req[1]); | 1375 | mark_free(thrd, 1); |
1387 | 1376 | ||
1388 | /* Clear the reset flag */ | 1377 | /* Clear the reset flag */ |
1389 | pl330->dmac_tbd.reset_chan &= ~(1 << i); | 1378 | pl330->dmac_tbd.reset_chan &= ~(1 << i); |
@@ -1461,14 +1450,12 @@ int pl330_update(const struct pl330_info *pi) | |||
1461 | 1450 | ||
1462 | thrd = &pl330->channels[id]; | 1451 | thrd = &pl330->channels[id]; |
1463 | 1452 | ||
1464 | active = _thrd_active(thrd); | 1453 | active = thrd->req_running; |
1465 | if (!active) /* Aborted */ | 1454 | if (active == -1) /* Aborted */ |
1466 | continue; | 1455 | continue; |
1467 | 1456 | ||
1468 | active -= 1; | ||
1469 | |||
1470 | rqdone = &thrd->req[active]; | 1457 | rqdone = &thrd->req[active]; |
1471 | MARK_FREE(rqdone); | 1458 | mark_free(thrd, active); |
1472 | 1459 | ||
1473 | /* Get going again ASAP */ | 1460 | /* Get going again ASAP */ |
1474 | _start(thrd); | 1461 | _start(thrd); |
@@ -1509,7 +1496,7 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op) | |||
1509 | struct pl330_thread *thrd = ch_id; | 1496 | struct pl330_thread *thrd = ch_id; |
1510 | struct pl330_dmac *pl330; | 1497 | struct pl330_dmac *pl330; |
1511 | unsigned long flags; | 1498 | unsigned long flags; |
1512 | int ret = 0, active; | 1499 | int ret = 0, active = thrd->req_running; |
1513 | 1500 | ||
1514 | if (!thrd || thrd->free || thrd->dmac->state == DYING) | 1501 | if (!thrd || thrd->free || thrd->dmac->state == DYING) |
1515 | return -EINVAL; | 1502 | return -EINVAL; |
@@ -1525,28 +1512,24 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op) | |||
1525 | 1512 | ||
1526 | thrd->req[0].r = NULL; | 1513 | thrd->req[0].r = NULL; |
1527 | thrd->req[1].r = NULL; | 1514 | thrd->req[1].r = NULL; |
1528 | MARK_FREE(&thrd->req[0]); | 1515 | mark_free(thrd, 0); |
1529 | MARK_FREE(&thrd->req[1]); | 1516 | mark_free(thrd, 1); |
1530 | break; | 1517 | break; |
1531 | 1518 | ||
1532 | case PL330_OP_ABORT: | 1519 | case PL330_OP_ABORT: |
1533 | active = _thrd_active(thrd); | ||
1534 | |||
1535 | /* Make sure the channel is stopped */ | 1520 | /* Make sure the channel is stopped */ |
1536 | _stop(thrd); | 1521 | _stop(thrd); |
1537 | 1522 | ||
1538 | /* ABORT is only for the active req */ | 1523 | /* ABORT is only for the active req */ |
1539 | if (!active) | 1524 | if (active == -1) |
1540 | break; | 1525 | break; |
1541 | 1526 | ||
1542 | active--; | ||
1543 | |||
1544 | thrd->req[active].r = NULL; | 1527 | thrd->req[active].r = NULL; |
1545 | MARK_FREE(&thrd->req[active]); | 1528 | mark_free(thrd, active); |
1546 | 1529 | ||
1547 | /* Start the next */ | 1530 | /* Start the next */ |
1548 | case PL330_OP_START: | 1531 | case PL330_OP_START: |
1549 | if (!_thrd_active(thrd) && !_start(thrd)) | 1532 | if ((active == -1) && !_start(thrd)) |
1550 | ret = -EIO; | 1533 | ret = -EIO; |
1551 | break; | 1534 | break; |
1552 | 1535 | ||
@@ -1587,14 +1570,13 @@ int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus) | |||
1587 | else | 1570 | else |
1588 | pstatus->faulting = false; | 1571 | pstatus->faulting = false; |
1589 | 1572 | ||
1590 | active = _thrd_active(thrd); | 1573 | active = thrd->req_running; |
1591 | 1574 | ||
1592 | if (!active) { | 1575 | if (active == -1) { |
1593 | /* Indicate that the thread is not running */ | 1576 | /* Indicate that the thread is not running */ |
1594 | pstatus->top_req = NULL; | 1577 | pstatus->top_req = NULL; |
1595 | pstatus->wait_req = NULL; | 1578 | pstatus->wait_req = NULL; |
1596 | } else { | 1579 | } else { |
1597 | active--; | ||
1598 | pstatus->top_req = thrd->req[active].r; | 1580 | pstatus->top_req = thrd->req[active].r; |
1599 | pstatus->wait_req = !IS_FREE(&thrd->req[1 - active]) | 1581 | pstatus->wait_req = !IS_FREE(&thrd->req[1 - active]) |
1600 | ? thrd->req[1 - active].r : NULL; | 1582 | ? thrd->req[1 - active].r : NULL; |
@@ -1659,9 +1641,9 @@ void *pl330_request_channel(const struct pl330_info *pi) | |||
1659 | thrd->free = false; | 1641 | thrd->free = false; |
1660 | thrd->lstenq = 1; | 1642 | thrd->lstenq = 1; |
1661 | thrd->req[0].r = NULL; | 1643 | thrd->req[0].r = NULL; |
1662 | MARK_FREE(&thrd->req[0]); | 1644 | mark_free(thrd, 0); |
1663 | thrd->req[1].r = NULL; | 1645 | thrd->req[1].r = NULL; |
1664 | MARK_FREE(&thrd->req[1]); | 1646 | mark_free(thrd, 1); |
1665 | break; | 1647 | break; |
1666 | } | 1648 | } |
1667 | } | 1649 | } |
@@ -1767,14 +1749,14 @@ static inline void _reset_thread(struct pl330_thread *thrd) | |||
1767 | thrd->req[0].mc_bus = pl330->mcode_bus | 1749 | thrd->req[0].mc_bus = pl330->mcode_bus |
1768 | + (thrd->id * pi->mcbufsz); | 1750 | + (thrd->id * pi->mcbufsz); |
1769 | thrd->req[0].r = NULL; | 1751 | thrd->req[0].r = NULL; |
1770 | MARK_FREE(&thrd->req[0]); | 1752 | mark_free(thrd, 0); |
1771 | 1753 | ||
1772 | thrd->req[1].mc_cpu = thrd->req[0].mc_cpu | 1754 | thrd->req[1].mc_cpu = thrd->req[0].mc_cpu |
1773 | + pi->mcbufsz / 2; | 1755 | + pi->mcbufsz / 2; |
1774 | thrd->req[1].mc_bus = thrd->req[0].mc_bus | 1756 | thrd->req[1].mc_bus = thrd->req[0].mc_bus |
1775 | + pi->mcbufsz / 2; | 1757 | + pi->mcbufsz / 2; |
1776 | thrd->req[1].r = NULL; | 1758 | thrd->req[1].r = NULL; |
1777 | MARK_FREE(&thrd->req[1]); | 1759 | mark_free(thrd, 1); |
1778 | } | 1760 | } |
1779 | 1761 | ||
1780 | static int dmac_alloc_threads(struct pl330_dmac *pl330) | 1762 | static int dmac_alloc_threads(struct pl330_dmac *pl330) |
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig index 11a4192197c8..cf497ce41dfe 100644 --- a/arch/arm/configs/imx_v4_v5_defconfig +++ b/arch/arm/configs/imx_v4_v5_defconfig | |||
@@ -18,9 +18,10 @@ CONFIG_ARCH_MXC=y | |||
18 | CONFIG_ARCH_IMX_V4_V5=y | 18 | CONFIG_ARCH_IMX_V4_V5=y |
19 | CONFIG_ARCH_MX1ADS=y | 19 | CONFIG_ARCH_MX1ADS=y |
20 | CONFIG_MACH_SCB9328=y | 20 | CONFIG_MACH_SCB9328=y |
21 | CONFIG_MACH_APF9328=y | ||
21 | CONFIG_MACH_MX21ADS=y | 22 | CONFIG_MACH_MX21ADS=y |
22 | CONFIG_MACH_MX25_3DS=y | 23 | CONFIG_MACH_MX25_3DS=y |
23 | CONFIG_MACH_EUKREA_CPUIMX25=y | 24 | CONFIG_MACH_EUKREA_CPUIMX25SD=y |
24 | CONFIG_MACH_MX27ADS=y | 25 | CONFIG_MACH_MX27ADS=y |
25 | CONFIG_MACH_PCM038=y | 26 | CONFIG_MACH_PCM038=y |
26 | CONFIG_MACH_CPUIMX27=y | 27 | CONFIG_MACH_CPUIMX27=y |
@@ -72,17 +73,16 @@ CONFIG_MTD_CFI_GEOMETRY=y | |||
72 | CONFIG_MTD_CFI_INTELEXT=y | 73 | CONFIG_MTD_CFI_INTELEXT=y |
73 | CONFIG_MTD_PHYSMAP=y | 74 | CONFIG_MTD_PHYSMAP=y |
74 | CONFIG_MTD_NAND=y | 75 | CONFIG_MTD_NAND=y |
76 | CONFIG_MTD_NAND_MXC=y | ||
75 | CONFIG_MTD_UBI=y | 77 | CONFIG_MTD_UBI=y |
76 | CONFIG_MISC_DEVICES=y | 78 | CONFIG_MISC_DEVICES=y |
77 | CONFIG_EEPROM_AT24=y | 79 | CONFIG_EEPROM_AT24=y |
78 | CONFIG_EEPROM_AT25=y | 80 | CONFIG_EEPROM_AT25=y |
79 | CONFIG_NETDEVICES=y | 81 | CONFIG_NETDEVICES=y |
80 | CONFIG_NET_ETHERNET=y | ||
81 | CONFIG_SMC91X=y | ||
82 | CONFIG_DM9000=y | 82 | CONFIG_DM9000=y |
83 | CONFIG_SMC91X=y | ||
83 | CONFIG_SMC911X=y | 84 | CONFIG_SMC911X=y |
84 | # CONFIG_NETDEV_1000 is not set | 85 | CONFIG_SMSC_PHY=y |
85 | # CONFIG_NETDEV_10000 is not set | ||
86 | # CONFIG_INPUT_MOUSEDEV is not set | 86 | # CONFIG_INPUT_MOUSEDEV is not set |
87 | CONFIG_INPUT_EVDEV=y | 87 | CONFIG_INPUT_EVDEV=y |
88 | # CONFIG_INPUT_KEYBOARD is not set | 88 | # CONFIG_INPUT_KEYBOARD is not set |
@@ -100,6 +100,7 @@ CONFIG_I2C_CHARDEV=y | |||
100 | CONFIG_I2C_IMX=y | 100 | CONFIG_I2C_IMX=y |
101 | CONFIG_SPI=y | 101 | CONFIG_SPI=y |
102 | CONFIG_SPI_IMX=y | 102 | CONFIG_SPI_IMX=y |
103 | CONFIG_SPI_SPIDEV=y | ||
103 | CONFIG_W1=y | 104 | CONFIG_W1=y |
104 | CONFIG_W1_MASTER_MXC=y | 105 | CONFIG_W1_MASTER_MXC=y |
105 | CONFIG_W1_SLAVE_THERM=y | 106 | CONFIG_W1_SLAVE_THERM=y |
@@ -139,6 +140,7 @@ CONFIG_MMC=y | |||
139 | CONFIG_MMC_MXC=y | 140 | CONFIG_MMC_MXC=y |
140 | CONFIG_NEW_LEDS=y | 141 | CONFIG_NEW_LEDS=y |
141 | CONFIG_LEDS_CLASS=y | 142 | CONFIG_LEDS_CLASS=y |
143 | CONFIG_LEDS_GPIO=y | ||
142 | CONFIG_LEDS_MC13783=y | 144 | CONFIG_LEDS_MC13783=y |
143 | CONFIG_LEDS_TRIGGERS=y | 145 | CONFIG_LEDS_TRIGGERS=y |
144 | CONFIG_LEDS_TRIGGER_TIMER=y | 146 | CONFIG_LEDS_TRIGGER_TIMER=y |
diff --git a/arch/arm/configs/omap1_defconfig b/arch/arm/configs/omap1_defconfig index a7e777581378..945a34f2a34d 100644 --- a/arch/arm/configs/omap1_defconfig +++ b/arch/arm/configs/omap1_defconfig | |||
@@ -48,12 +48,7 @@ CONFIG_MACH_SX1=y | |||
48 | CONFIG_MACH_NOKIA770=y | 48 | CONFIG_MACH_NOKIA770=y |
49 | CONFIG_MACH_AMS_DELTA=y | 49 | CONFIG_MACH_AMS_DELTA=y |
50 | CONFIG_MACH_OMAP_GENERIC=y | 50 | CONFIG_MACH_OMAP_GENERIC=y |
51 | CONFIG_OMAP_ARM_216MHZ=y | ||
52 | CONFIG_OMAP_ARM_195MHZ=y | ||
53 | CONFIG_OMAP_ARM_192MHZ=y | ||
54 | CONFIG_OMAP_ARM_182MHZ=y | 51 | CONFIG_OMAP_ARM_182MHZ=y |
55 | CONFIG_OMAP_ARM_168MHZ=y | ||
56 | # CONFIG_OMAP_ARM_60MHZ is not set | ||
57 | # CONFIG_ARM_THUMB is not set | 52 | # CONFIG_ARM_THUMB is not set |
58 | CONFIG_PCCARD=y | 53 | CONFIG_PCCARD=y |
59 | CONFIG_OMAP_CF=y | 54 | CONFIG_OMAP_CF=y |
diff --git a/arch/arm/include/asm/unwind.h b/arch/arm/include/asm/unwind.h index a5edf421005c..d1c3f3a71c94 100644 --- a/arch/arm/include/asm/unwind.h +++ b/arch/arm/include/asm/unwind.h | |||
@@ -30,14 +30,15 @@ enum unwind_reason_code { | |||
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct unwind_idx { | 32 | struct unwind_idx { |
33 | unsigned long addr; | 33 | unsigned long addr_offset; |
34 | unsigned long insn; | 34 | unsigned long insn; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | struct unwind_table { | 37 | struct unwind_table { |
38 | struct list_head list; | 38 | struct list_head list; |
39 | struct unwind_idx *start; | 39 | const struct unwind_idx *start; |
40 | struct unwind_idx *stop; | 40 | const struct unwind_idx *origin; |
41 | const struct unwind_idx *stop; | ||
41 | unsigned long begin_addr; | 42 | unsigned long begin_addr; |
42 | unsigned long end_addr; | 43 | unsigned long end_addr; |
43 | }; | 44 | }; |
@@ -49,15 +50,6 @@ extern struct unwind_table *unwind_table_add(unsigned long start, | |||
49 | extern void unwind_table_del(struct unwind_table *tab); | 50 | extern void unwind_table_del(struct unwind_table *tab); |
50 | extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk); | 51 | extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk); |
51 | 52 | ||
52 | #ifdef CONFIG_ARM_UNWIND | ||
53 | extern int __init unwind_init(void); | ||
54 | #else | ||
55 | static inline int __init unwind_init(void) | ||
56 | { | ||
57 | return 0; | ||
58 | } | ||
59 | #endif | ||
60 | |||
61 | #endif /* !__ASSEMBLY__ */ | 53 | #endif /* !__ASSEMBLY__ */ |
62 | 54 | ||
63 | #ifdef CONFIG_ARM_UNWIND | 55 | #ifdef CONFIG_ARM_UNWIND |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index c475379199b1..88b0941ce51e 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -353,15 +353,15 @@ validate_group(struct perf_event *event) | |||
353 | fake_pmu.used_mask = fake_used_mask; | 353 | fake_pmu.used_mask = fake_used_mask; |
354 | 354 | ||
355 | if (!validate_event(&fake_pmu, leader)) | 355 | if (!validate_event(&fake_pmu, leader)) |
356 | return -ENOSPC; | 356 | return -EINVAL; |
357 | 357 | ||
358 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { | 358 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { |
359 | if (!validate_event(&fake_pmu, sibling)) | 359 | if (!validate_event(&fake_pmu, sibling)) |
360 | return -ENOSPC; | 360 | return -EINVAL; |
361 | } | 361 | } |
362 | 362 | ||
363 | if (!validate_event(&fake_pmu, event)) | 363 | if (!validate_event(&fake_pmu, event)) |
364 | return -ENOSPC; | 364 | return -EINVAL; |
365 | 365 | ||
366 | return 0; | 366 | return 0; |
367 | } | 367 | } |
@@ -640,6 +640,9 @@ static struct platform_device_id armpmu_plat_device_ids[] = { | |||
640 | 640 | ||
641 | static int __devinit armpmu_device_probe(struct platform_device *pdev) | 641 | static int __devinit armpmu_device_probe(struct platform_device *pdev) |
642 | { | 642 | { |
643 | if (!cpu_pmu) | ||
644 | return -ENODEV; | ||
645 | |||
643 | cpu_pmu->plat_device = pdev; | 646 | cpu_pmu->plat_device = pdev; |
644 | return 0; | 647 | return 0; |
645 | } | 648 | } |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 3448a3f9cc8c..8fc2c8fcbdc6 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -895,8 +895,6 @@ void __init setup_arch(char **cmdline_p) | |||
895 | { | 895 | { |
896 | struct machine_desc *mdesc; | 896 | struct machine_desc *mdesc; |
897 | 897 | ||
898 | unwind_init(); | ||
899 | |||
900 | setup_processor(); | 898 | setup_processor(); |
901 | mdesc = setup_machine_fdt(__atags_pointer); | 899 | mdesc = setup_machine_fdt(__atags_pointer); |
902 | if (!mdesc) | 900 | if (!mdesc) |
@@ -904,6 +902,12 @@ void __init setup_arch(char **cmdline_p) | |||
904 | machine_desc = mdesc; | 902 | machine_desc = mdesc; |
905 | machine_name = mdesc->name; | 903 | machine_name = mdesc->name; |
906 | 904 | ||
905 | #ifdef CONFIG_ZONE_DMA | ||
906 | if (mdesc->dma_zone_size) { | ||
907 | extern unsigned long arm_dma_zone_size; | ||
908 | arm_dma_zone_size = mdesc->dma_zone_size; | ||
909 | } | ||
910 | #endif | ||
907 | if (mdesc->soft_reboot) | 911 | if (mdesc->soft_reboot) |
908 | reboot_setup("s"); | 912 | reboot_setup("s"); |
909 | 913 | ||
@@ -934,12 +938,6 @@ void __init setup_arch(char **cmdline_p) | |||
934 | 938 | ||
935 | tcm_init(); | 939 | tcm_init(); |
936 | 940 | ||
937 | #ifdef CONFIG_ZONE_DMA | ||
938 | if (mdesc->dma_zone_size) { | ||
939 | extern unsigned long arm_dma_zone_size; | ||
940 | arm_dma_zone_size = mdesc->dma_zone_size; | ||
941 | } | ||
942 | #endif | ||
943 | #ifdef CONFIG_MULTI_IRQ_HANDLER | 941 | #ifdef CONFIG_MULTI_IRQ_HANDLER |
944 | handle_arch_irq = mdesc->handle_irq; | 942 | handle_arch_irq = mdesc->handle_irq; |
945 | #endif | 943 | #endif |
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index e7e8365795c3..00df012c4678 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c | |||
@@ -67,7 +67,7 @@ EXPORT_SYMBOL(__aeabi_unwind_cpp_pr2); | |||
67 | 67 | ||
68 | struct unwind_ctrl_block { | 68 | struct unwind_ctrl_block { |
69 | unsigned long vrs[16]; /* virtual register set */ | 69 | unsigned long vrs[16]; /* virtual register set */ |
70 | unsigned long *insn; /* pointer to the current instructions word */ | 70 | const unsigned long *insn; /* pointer to the current instructions word */ |
71 | int entries; /* number of entries left to interpret */ | 71 | int entries; /* number of entries left to interpret */ |
72 | int byte; /* current byte number in the instructions word */ | 72 | int byte; /* current byte number in the instructions word */ |
73 | }; | 73 | }; |
@@ -83,8 +83,9 @@ enum regs { | |||
83 | PC = 15 | 83 | PC = 15 |
84 | }; | 84 | }; |
85 | 85 | ||
86 | extern struct unwind_idx __start_unwind_idx[]; | 86 | extern const struct unwind_idx __start_unwind_idx[]; |
87 | extern struct unwind_idx __stop_unwind_idx[]; | 87 | static const struct unwind_idx *__origin_unwind_idx; |
88 | extern const struct unwind_idx __stop_unwind_idx[]; | ||
88 | 89 | ||
89 | static DEFINE_SPINLOCK(unwind_lock); | 90 | static DEFINE_SPINLOCK(unwind_lock); |
90 | static LIST_HEAD(unwind_tables); | 91 | static LIST_HEAD(unwind_tables); |
@@ -98,45 +99,99 @@ static LIST_HEAD(unwind_tables); | |||
98 | }) | 99 | }) |
99 | 100 | ||
100 | /* | 101 | /* |
101 | * Binary search in the unwind index. The entries entries are | 102 | * Binary search in the unwind index. The entries are |
102 | * guaranteed to be sorted in ascending order by the linker. | 103 | * guaranteed to be sorted in ascending order by the linker. |
104 | * | ||
105 | * start = first entry | ||
106 | * origin = first entry with positive offset (or stop if there is no such entry) | ||
107 | * stop - 1 = last entry | ||
103 | */ | 108 | */ |
104 | static struct unwind_idx *search_index(unsigned long addr, | 109 | static const struct unwind_idx *search_index(unsigned long addr, |
105 | struct unwind_idx *first, | 110 | const struct unwind_idx *start, |
106 | struct unwind_idx *last) | 111 | const struct unwind_idx *origin, |
112 | const struct unwind_idx *stop) | ||
107 | { | 113 | { |
108 | pr_debug("%s(%08lx, %p, %p)\n", __func__, addr, first, last); | 114 | unsigned long addr_prel31; |
115 | |||
116 | pr_debug("%s(%08lx, %p, %p, %p)\n", | ||
117 | __func__, addr, start, origin, stop); | ||
118 | |||
119 | /* | ||
120 | * only search in the section with the matching sign. This way the | ||
121 | * prel31 numbers can be compared as unsigned longs. | ||
122 | */ | ||
123 | if (addr < (unsigned long)start) | ||
124 | /* negative offsets: [start; origin) */ | ||
125 | stop = origin; | ||
126 | else | ||
127 | /* positive offsets: [origin; stop) */ | ||
128 | start = origin; | ||
129 | |||
130 | /* prel31 for address relavive to start */ | ||
131 | addr_prel31 = (addr - (unsigned long)start) & 0x7fffffff; | ||
109 | 132 | ||
110 | if (addr < first->addr) { | 133 | while (start < stop - 1) { |
134 | const struct unwind_idx *mid = start + ((stop - start) >> 1); | ||
135 | |||
136 | /* | ||
137 | * As addr_prel31 is relative to start an offset is needed to | ||
138 | * make it relative to mid. | ||
139 | */ | ||
140 | if (addr_prel31 - ((unsigned long)mid - (unsigned long)start) < | ||
141 | mid->addr_offset) | ||
142 | stop = mid; | ||
143 | else { | ||
144 | /* keep addr_prel31 relative to start */ | ||
145 | addr_prel31 -= ((unsigned long)mid - | ||
146 | (unsigned long)start); | ||
147 | start = mid; | ||
148 | } | ||
149 | } | ||
150 | |||
151 | if (likely(start->addr_offset <= addr_prel31)) | ||
152 | return start; | ||
153 | else { | ||
111 | pr_warning("unwind: Unknown symbol address %08lx\n", addr); | 154 | pr_warning("unwind: Unknown symbol address %08lx\n", addr); |
112 | return NULL; | 155 | return NULL; |
113 | } else if (addr >= last->addr) | 156 | } |
114 | return last; | 157 | } |
115 | 158 | ||
116 | while (first < last - 1) { | 159 | static const struct unwind_idx *unwind_find_origin( |
117 | struct unwind_idx *mid = first + ((last - first + 1) >> 1); | 160 | const struct unwind_idx *start, const struct unwind_idx *stop) |
161 | { | ||
162 | pr_debug("%s(%p, %p)\n", __func__, start, stop); | ||
163 | while (start < stop) { | ||
164 | const struct unwind_idx *mid = start + ((stop - start) >> 1); | ||
118 | 165 | ||
119 | if (addr < mid->addr) | 166 | if (mid->addr_offset >= 0x40000000) |
120 | last = mid; | 167 | /* negative offset */ |
168 | start = mid + 1; | ||
121 | else | 169 | else |
122 | first = mid; | 170 | /* positive offset */ |
171 | stop = mid; | ||
123 | } | 172 | } |
124 | 173 | pr_debug("%s -> %p\n", __func__, stop); | |
125 | return first; | 174 | return stop; |
126 | } | 175 | } |
127 | 176 | ||
128 | static struct unwind_idx *unwind_find_idx(unsigned long addr) | 177 | static const struct unwind_idx *unwind_find_idx(unsigned long addr) |
129 | { | 178 | { |
130 | struct unwind_idx *idx = NULL; | 179 | const struct unwind_idx *idx = NULL; |
131 | unsigned long flags; | 180 | unsigned long flags; |
132 | 181 | ||
133 | pr_debug("%s(%08lx)\n", __func__, addr); | 182 | pr_debug("%s(%08lx)\n", __func__, addr); |
134 | 183 | ||
135 | if (core_kernel_text(addr)) | 184 | if (core_kernel_text(addr)) { |
185 | if (unlikely(!__origin_unwind_idx)) | ||
186 | __origin_unwind_idx = | ||
187 | unwind_find_origin(__start_unwind_idx, | ||
188 | __stop_unwind_idx); | ||
189 | |||
136 | /* main unwind table */ | 190 | /* main unwind table */ |
137 | idx = search_index(addr, __start_unwind_idx, | 191 | idx = search_index(addr, __start_unwind_idx, |
138 | __stop_unwind_idx - 1); | 192 | __origin_unwind_idx, |
139 | else { | 193 | __stop_unwind_idx); |
194 | } else { | ||
140 | /* module unwind tables */ | 195 | /* module unwind tables */ |
141 | struct unwind_table *table; | 196 | struct unwind_table *table; |
142 | 197 | ||
@@ -145,7 +200,8 @@ static struct unwind_idx *unwind_find_idx(unsigned long addr) | |||
145 | if (addr >= table->begin_addr && | 200 | if (addr >= table->begin_addr && |
146 | addr < table->end_addr) { | 201 | addr < table->end_addr) { |
147 | idx = search_index(addr, table->start, | 202 | idx = search_index(addr, table->start, |
148 | table->stop - 1); | 203 | table->origin, |
204 | table->stop); | ||
149 | /* Move-to-front to exploit common traces */ | 205 | /* Move-to-front to exploit common traces */ |
150 | list_move(&table->list, &unwind_tables); | 206 | list_move(&table->list, &unwind_tables); |
151 | break; | 207 | break; |
@@ -274,7 +330,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl) | |||
274 | int unwind_frame(struct stackframe *frame) | 330 | int unwind_frame(struct stackframe *frame) |
275 | { | 331 | { |
276 | unsigned long high, low; | 332 | unsigned long high, low; |
277 | struct unwind_idx *idx; | 333 | const struct unwind_idx *idx; |
278 | struct unwind_ctrl_block ctrl; | 334 | struct unwind_ctrl_block ctrl; |
279 | 335 | ||
280 | /* only go to a higher address on the stack */ | 336 | /* only go to a higher address on the stack */ |
@@ -399,7 +455,6 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size, | |||
399 | unsigned long text_size) | 455 | unsigned long text_size) |
400 | { | 456 | { |
401 | unsigned long flags; | 457 | unsigned long flags; |
402 | struct unwind_idx *idx; | ||
403 | struct unwind_table *tab = kmalloc(sizeof(*tab), GFP_KERNEL); | 458 | struct unwind_table *tab = kmalloc(sizeof(*tab), GFP_KERNEL); |
404 | 459 | ||
405 | pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size, | 460 | pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size, |
@@ -408,15 +463,12 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size, | |||
408 | if (!tab) | 463 | if (!tab) |
409 | return tab; | 464 | return tab; |
410 | 465 | ||
411 | tab->start = (struct unwind_idx *)start; | 466 | tab->start = (const struct unwind_idx *)start; |
412 | tab->stop = (struct unwind_idx *)(start + size); | 467 | tab->stop = (const struct unwind_idx *)(start + size); |
468 | tab->origin = unwind_find_origin(tab->start, tab->stop); | ||
413 | tab->begin_addr = text_addr; | 469 | tab->begin_addr = text_addr; |
414 | tab->end_addr = text_addr + text_size; | 470 | tab->end_addr = text_addr + text_size; |
415 | 471 | ||
416 | /* Convert the symbol addresses to absolute values */ | ||
417 | for (idx = tab->start; idx < tab->stop; idx++) | ||
418 | idx->addr = prel31_to_addr(&idx->addr); | ||
419 | |||
420 | spin_lock_irqsave(&unwind_lock, flags); | 472 | spin_lock_irqsave(&unwind_lock, flags); |
421 | list_add_tail(&tab->list, &unwind_tables); | 473 | list_add_tail(&tab->list, &unwind_tables); |
422 | spin_unlock_irqrestore(&unwind_lock, flags); | 474 | spin_unlock_irqrestore(&unwind_lock, flags); |
@@ -437,16 +489,3 @@ void unwind_table_del(struct unwind_table *tab) | |||
437 | 489 | ||
438 | kfree(tab); | 490 | kfree(tab); |
439 | } | 491 | } |
440 | |||
441 | int __init unwind_init(void) | ||
442 | { | ||
443 | struct unwind_idx *idx; | ||
444 | |||
445 | /* Convert the symbol addresses to absolute values */ | ||
446 | for (idx = __start_unwind_idx; idx < __stop_unwind_idx; idx++) | ||
447 | idx->addr = prel31_to_addr(&idx->addr); | ||
448 | |||
449 | pr_debug("unwind: ARM stack unwinding initialised\n"); | ||
450 | |||
451 | return 0; | ||
452 | } | ||
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 66591fa53e05..ad930688358c 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -83,7 +83,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | |||
83 | * USB Device (Gadget) | 83 | * USB Device (Gadget) |
84 | * -------------------------------------------------------------------- */ | 84 | * -------------------------------------------------------------------- */ |
85 | 85 | ||
86 | #ifdef CONFIG_USB_GADGET_AT91 | 86 | #ifdef CONFIG_USB_AT91 |
87 | static struct at91_udc_data udc_data; | 87 | static struct at91_udc_data udc_data; |
88 | 88 | ||
89 | static struct resource udc_resources[] = { | 89 | static struct resource udc_resources[] = { |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index b84a9f642f59..0d20677fbef0 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -195,9 +195,9 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), | 195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), |
196 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), | 196 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), |
197 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), | 197 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), |
198 | CLKDEV_CON_DEV_ID("t3_clk", "atmel_tcb.1", &tc3_clk), | 198 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk), |
199 | CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk), | 199 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), |
200 | CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk), | 200 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), |
201 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), | 201 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), |
202 | /* more usart lookup table for DT entries */ | 202 | /* more usart lookup table for DT entries */ |
203 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), | 203 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 25e3464fb07f..629fa9774972 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -84,7 +84,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | |||
84 | * USB Device (Gadget) | 84 | * USB Device (Gadget) |
85 | * -------------------------------------------------------------------- */ | 85 | * -------------------------------------------------------------------- */ |
86 | 86 | ||
87 | #ifdef CONFIG_USB_GADGET_AT91 | 87 | #ifdef CONFIG_USB_AT91 |
88 | static struct at91_udc_data udc_data; | 88 | static struct at91_udc_data udc_data; |
89 | 89 | ||
90 | static struct resource udc_resources[] = { | 90 | static struct resource udc_resources[] = { |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index ae78f4d03b73..a178b58b0b9c 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -87,7 +87,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | |||
87 | * USB Device (Gadget) | 87 | * USB Device (Gadget) |
88 | * -------------------------------------------------------------------- */ | 88 | * -------------------------------------------------------------------- */ |
89 | 89 | ||
90 | #ifdef CONFIG_USB_GADGET_AT91 | 90 | #ifdef CONFIG_USB_AT91 |
91 | static struct at91_udc_data udc_data; | 91 | static struct at91_udc_data udc_data; |
92 | 92 | ||
93 | static struct resource udc_resources[] = { | 93 | static struct resource udc_resources[] = { |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index ad017eb1f8df..d5fbac9ff4fa 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -92,7 +92,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | |||
92 | * USB Device (Gadget) | 92 | * USB Device (Gadget) |
93 | * -------------------------------------------------------------------- */ | 93 | * -------------------------------------------------------------------- */ |
94 | 94 | ||
95 | #ifdef CONFIG_USB_GADGET_AT91 | 95 | #ifdef CONFIG_USB_AT91 |
96 | static struct at91_udc_data udc_data; | 96 | static struct at91_udc_data udc_data; |
97 | 97 | ||
98 | static struct resource udc_resources[] = { | 98 | static struct resource udc_resources[] = { |
diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h index 8f4866045b41..ec164a4124c9 100644 --- a/arch/arm/mach-at91/include/mach/system_rev.h +++ b/arch/arm/mach-at91/include/mach/system_rev.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #define BOARD_HAVE_NAND_16BIT (1 << 31) | 19 | #define BOARD_HAVE_NAND_16BIT (1 << 31) |
20 | static inline int board_have_nand_16bit(void) | 20 | static inline int board_have_nand_16bit(void) |
21 | { | 21 | { |
22 | return system_rev & BOARD_HAVE_NAND_16BIT; | 22 | return (system_rev & BOARD_HAVE_NAND_16BIT) ? 1 : 0; |
23 | } | 23 | } |
24 | 24 | ||
25 | #endif /* __ARCH_SYSTEM_REV_H__ */ | 25 | #endif /* __ARCH_SYSTEM_REV_H__ */ |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 1d7d24995226..6659a90dbcad 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -753,7 +753,7 @@ static struct snd_platform_data da850_evm_snd_data = { | |||
753 | .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), | 753 | .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), |
754 | .tdm_slots = 2, | 754 | .tdm_slots = 2, |
755 | .serial_dir = da850_iis_serializer_direction, | 755 | .serial_dir = da850_iis_serializer_direction, |
756 | .asp_chan_q = EVENTQ_1, | 756 | .asp_chan_q = EVENTQ_0, |
757 | .version = MCASP_VERSION_2, | 757 | .version = MCASP_VERSION_2, |
758 | .txnumevt = 1, | 758 | .txnumevt = 1, |
759 | .rxnumevt = 1, | 759 | .rxnumevt = 1, |
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 1918ae711428..46e1f4173b97 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -107,7 +107,7 @@ static struct mtd_partition davinci_nand_partitions[] = { | |||
107 | /* UBL (a few copies) plus U-Boot */ | 107 | /* UBL (a few copies) plus U-Boot */ |
108 | .name = "bootloader", | 108 | .name = "bootloader", |
109 | .offset = 0, | 109 | .offset = 0, |
110 | .size = 28 * NAND_BLOCK_SIZE, | 110 | .size = 30 * NAND_BLOCK_SIZE, |
111 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | 111 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
112 | }, { | 112 | }, { |
113 | /* U-Boot environment */ | 113 | /* U-Boot environment */ |
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index e574d7f837a8..635bf7740157 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
@@ -564,7 +564,7 @@ static int setup_vpif_input_channel_mode(int mux_mode) | |||
564 | int val; | 564 | int val; |
565 | u32 value; | 565 | u32 value; |
566 | 566 | ||
567 | if (!vpif_vsclkdis_reg || !cpld_client) | 567 | if (!vpif_vidclkctl_reg || !cpld_client) |
568 | return -ENXIO; | 568 | return -ENXIO; |
569 | 569 | ||
570 | val = i2c_smbus_read_byte(cpld_client); | 570 | val = i2c_smbus_read_byte(cpld_client); |
@@ -572,7 +572,7 @@ static int setup_vpif_input_channel_mode(int mux_mode) | |||
572 | return val; | 572 | return val; |
573 | 573 | ||
574 | spin_lock_irqsave(&vpif_reg_lock, flags); | 574 | spin_lock_irqsave(&vpif_reg_lock, flags); |
575 | value = __raw_readl(vpif_vsclkdis_reg); | 575 | value = __raw_readl(vpif_vidclkctl_reg); |
576 | if (mux_mode) { | 576 | if (mux_mode) { |
577 | val &= VPIF_INPUT_TWO_CHANNEL; | 577 | val &= VPIF_INPUT_TWO_CHANNEL; |
578 | value |= VIDCH1CLK; | 578 | value |= VIDCH1CLK; |
@@ -580,7 +580,7 @@ static int setup_vpif_input_channel_mode(int mux_mode) | |||
580 | val |= VPIF_INPUT_ONE_CHANNEL; | 580 | val |= VPIF_INPUT_ONE_CHANNEL; |
581 | value &= ~VIDCH1CLK; | 581 | value &= ~VIDCH1CLK; |
582 | } | 582 | } |
583 | __raw_writel(value, vpif_vsclkdis_reg); | 583 | __raw_writel(value, vpif_vidclkctl_reg); |
584 | spin_unlock_irqrestore(&vpif_reg_lock, flags); | 584 | spin_unlock_irqrestore(&vpif_reg_lock, flags); |
585 | 585 | ||
586 | err = i2c_smbus_write_byte(cpld_client, val); | 586 | err = i2c_smbus_write_byte(cpld_client, val); |
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 0b68ed534f8e..af27c130595f 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c | |||
@@ -161,7 +161,6 @@ static struct clk dsp_clk = { | |||
161 | .name = "dsp", | 161 | .name = "dsp", |
162 | .parent = &pll1_sysclk1, | 162 | .parent = &pll1_sysclk1, |
163 | .lpsc = DM646X_LPSC_C64X_CPU, | 163 | .lpsc = DM646X_LPSC_C64X_CPU, |
164 | .flags = PSC_DSP, | ||
165 | .usecount = 1, /* REVISIT how to disable? */ | 164 | .usecount = 1, /* REVISIT how to disable? */ |
166 | }; | 165 | }; |
167 | 166 | ||
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h index fa59c097223d..8bc3fc256171 100644 --- a/arch/arm/mach-davinci/include/mach/psc.h +++ b/arch/arm/mach-davinci/include/mach/psc.h | |||
@@ -233,7 +233,7 @@ | |||
233 | #define PTCMD 0x120 | 233 | #define PTCMD 0x120 |
234 | #define PTSTAT 0x128 | 234 | #define PTSTAT 0x128 |
235 | #define PDSTAT 0x200 | 235 | #define PDSTAT 0x200 |
236 | #define PDCTL1 0x304 | 236 | #define PDCTL 0x300 |
237 | #define MDSTAT 0x800 | 237 | #define MDSTAT 0x800 |
238 | #define MDCTL 0xA00 | 238 | #define MDCTL 0xA00 |
239 | 239 | ||
@@ -244,7 +244,10 @@ | |||
244 | #define PSC_STATE_ENABLE 3 | 244 | #define PSC_STATE_ENABLE 3 |
245 | 245 | ||
246 | #define MDSTAT_STATE_MASK 0x3f | 246 | #define MDSTAT_STATE_MASK 0x3f |
247 | #define PDSTAT_STATE_MASK 0x1f | ||
247 | #define MDCTL_FORCE BIT(31) | 248 | #define MDCTL_FORCE BIT(31) |
249 | #define PDCTL_NEXT BIT(1) | ||
250 | #define PDCTL_EPCGOOD BIT(8) | ||
248 | 251 | ||
249 | #ifndef __ASSEMBLER__ | 252 | #ifndef __ASSEMBLER__ |
250 | 253 | ||
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index 1fb6bdff38c1..d7e210f4b55c 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c | |||
@@ -52,7 +52,7 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id) | |||
52 | void davinci_psc_config(unsigned int domain, unsigned int ctlr, | 52 | void davinci_psc_config(unsigned int domain, unsigned int ctlr, |
53 | unsigned int id, bool enable, u32 flags) | 53 | unsigned int id, bool enable, u32 flags) |
54 | { | 54 | { |
55 | u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl; | 55 | u32 epcpr, ptcmd, ptstat, pdstat, pdctl, mdstat, mdctl; |
56 | void __iomem *psc_base; | 56 | void __iomem *psc_base; |
57 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 57 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
58 | u32 next_state = PSC_STATE_ENABLE; | 58 | u32 next_state = PSC_STATE_ENABLE; |
@@ -79,11 +79,11 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, | |||
79 | mdctl |= MDCTL_FORCE; | 79 | mdctl |= MDCTL_FORCE; |
80 | __raw_writel(mdctl, psc_base + MDCTL + 4 * id); | 80 | __raw_writel(mdctl, psc_base + MDCTL + 4 * id); |
81 | 81 | ||
82 | pdstat = __raw_readl(psc_base + PDSTAT); | 82 | pdstat = __raw_readl(psc_base + PDSTAT + 4 * domain); |
83 | if ((pdstat & 0x00000001) == 0) { | 83 | if ((pdstat & PDSTAT_STATE_MASK) == 0) { |
84 | pdctl1 = __raw_readl(psc_base + PDCTL1); | 84 | pdctl = __raw_readl(psc_base + PDCTL + 4 * domain); |
85 | pdctl1 |= 0x1; | 85 | pdctl |= PDCTL_NEXT; |
86 | __raw_writel(pdctl1, psc_base + PDCTL1); | 86 | __raw_writel(pdctl, psc_base + PDCTL + 4 * domain); |
87 | 87 | ||
88 | ptcmd = 1 << domain; | 88 | ptcmd = 1 << domain; |
89 | __raw_writel(ptcmd, psc_base + PTCMD); | 89 | __raw_writel(ptcmd, psc_base + PTCMD); |
@@ -92,9 +92,9 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, | |||
92 | epcpr = __raw_readl(psc_base + EPCPR); | 92 | epcpr = __raw_readl(psc_base + EPCPR); |
93 | } while ((((epcpr >> domain) & 1) == 0)); | 93 | } while ((((epcpr >> domain) & 1) == 0)); |
94 | 94 | ||
95 | pdctl1 = __raw_readl(psc_base + PDCTL1); | 95 | pdctl = __raw_readl(psc_base + PDCTL + 4 * domain); |
96 | pdctl1 |= 0x100; | 96 | pdctl |= PDCTL_EPCGOOD; |
97 | __raw_writel(pdctl1, psc_base + PDCTL1); | 97 | __raw_writel(pdctl, psc_base + PDCTL + 4 * domain); |
98 | } else { | 98 | } else { |
99 | ptcmd = 1 << domain; | 99 | ptcmd = 1 << domain; |
100 | __raw_writel(ptcmd, psc_base + PTCMD); | 100 | __raw_writel(ptcmd, psc_base + PTCMD); |
diff --git a/arch/arm/mach-exynos/cpu.c b/arch/arm/mach-exynos/cpu.c index 90ec247f3b37..cc8d4bd6d0f7 100644 --- a/arch/arm/mach-exynos/cpu.c +++ b/arch/arm/mach-exynos/cpu.c | |||
@@ -111,11 +111,6 @@ static struct map_desc exynos4_iodesc[] __initdata = { | |||
111 | .length = SZ_4K, | 111 | .length = SZ_4K, |
112 | .type = MT_DEVICE, | 112 | .type = MT_DEVICE, |
113 | }, { | 113 | }, { |
114 | .virtual = (unsigned long)S5P_VA_SROMC, | ||
115 | .pfn = __phys_to_pfn(EXYNOS4_PA_SROMC), | ||
116 | .length = SZ_4K, | ||
117 | .type = MT_DEVICE, | ||
118 | }, { | ||
119 | .virtual = (unsigned long)S3C_VA_USB_HSPHY, | 114 | .virtual = (unsigned long)S3C_VA_USB_HSPHY, |
120 | .pfn = __phys_to_pfn(EXYNOS4_PA_HSPHY), | 115 | .pfn = __phys_to_pfn(EXYNOS4_PA_HSPHY), |
121 | .length = SZ_4K, | 116 | .length = SZ_4K, |
diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c index 97343df8f132..85b5527d0918 100644 --- a/arch/arm/mach-exynos/mct.c +++ b/arch/arm/mach-exynos/mct.c | |||
@@ -44,8 +44,6 @@ struct mct_clock_event_device { | |||
44 | char name[10]; | 44 | char name[10]; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick); | ||
48 | |||
49 | static void exynos4_mct_write(unsigned int value, void *addr) | 47 | static void exynos4_mct_write(unsigned int value, void *addr) |
50 | { | 48 | { |
51 | void __iomem *stat_addr; | 49 | void __iomem *stat_addr; |
@@ -264,6 +262,9 @@ static void exynos4_clockevent_init(void) | |||
264 | } | 262 | } |
265 | 263 | ||
266 | #ifdef CONFIG_LOCAL_TIMERS | 264 | #ifdef CONFIG_LOCAL_TIMERS |
265 | |||
266 | static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick); | ||
267 | |||
267 | /* Clock event handling */ | 268 | /* Clock event handling */ |
268 | static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt) | 269 | static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt) |
269 | { | 270 | { |
@@ -428,9 +429,13 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt) | |||
428 | 429 | ||
429 | void local_timer_stop(struct clock_event_device *evt) | 430 | void local_timer_stop(struct clock_event_device *evt) |
430 | { | 431 | { |
432 | unsigned int cpu = smp_processor_id(); | ||
431 | evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); | 433 | evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); |
432 | if (mct_int_type == MCT_INT_SPI) | 434 | if (mct_int_type == MCT_INT_SPI) |
433 | disable_irq(evt->irq); | 435 | if (cpu == 0) |
436 | remove_irq(evt->irq, &mct_tick0_event_irq); | ||
437 | else | ||
438 | remove_irq(evt->irq, &mct_tick1_event_irq); | ||
434 | else | 439 | else |
435 | disable_percpu_irq(IRQ_MCT_LOCALTIMER); | 440 | disable_percpu_irq(IRQ_MCT_LOCALTIMER); |
436 | } | 441 | } |
@@ -443,6 +448,7 @@ static void __init exynos4_timer_resources(void) | |||
443 | 448 | ||
444 | clk_rate = clk_get_rate(mct_clk); | 449 | clk_rate = clk_get_rate(mct_clk); |
445 | 450 | ||
451 | #ifdef CONFIG_LOCAL_TIMERS | ||
446 | if (mct_int_type == MCT_INT_PPI) { | 452 | if (mct_int_type == MCT_INT_PPI) { |
447 | int err; | 453 | int err; |
448 | 454 | ||
@@ -452,6 +458,7 @@ static void __init exynos4_timer_resources(void) | |||
452 | WARN(err, "MCT: can't request IRQ %d (%d)\n", | 458 | WARN(err, "MCT: can't request IRQ %d (%d)\n", |
453 | IRQ_MCT_LOCALTIMER, err); | 459 | IRQ_MCT_LOCALTIMER, err); |
454 | } | 460 | } |
461 | #endif /* CONFIG_LOCAL_TIMERS */ | ||
455 | } | 462 | } |
456 | 463 | ||
457 | static void __init exynos4_timer_init(void) | 464 | static void __init exynos4_timer_init(void) |
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index c44aa974e79c..0e6f1af260b6 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -132,7 +132,7 @@ config MACH_MX25_3DS | |||
132 | select IMX_HAVE_PLATFORM_MXC_NAND | 132 | select IMX_HAVE_PLATFORM_MXC_NAND |
133 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX | 133 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX |
134 | 134 | ||
135 | config MACH_EUKREA_CPUIMX25 | 135 | config MACH_EUKREA_CPUIMX25SD |
136 | bool "Support Eukrea CPUIMX25 Platform" | 136 | bool "Support Eukrea CPUIMX25 Platform" |
137 | select SOC_IMX25 | 137 | select SOC_IMX25 |
138 | select IMX_HAVE_PLATFORM_FLEXCAN | 138 | select IMX_HAVE_PLATFORM_FLEXCAN |
@@ -148,7 +148,7 @@ config MACH_EUKREA_CPUIMX25 | |||
148 | 148 | ||
149 | choice | 149 | choice |
150 | prompt "Baseboard" | 150 | prompt "Baseboard" |
151 | depends on MACH_EUKREA_CPUIMX25 | 151 | depends on MACH_EUKREA_CPUIMX25SD |
152 | default MACH_EUKREA_MBIMXSD25_BASEBOARD | 152 | default MACH_EUKREA_MBIMXSD25_BASEBOARD |
153 | 153 | ||
154 | config MACH_EUKREA_MBIMXSD25_BASEBOARD | 154 | config MACH_EUKREA_MBIMXSD25_BASEBOARD |
@@ -542,7 +542,7 @@ config MACH_MX35_3DS | |||
542 | Include support for MX35PDK platform. This includes specific | 542 | Include support for MX35PDK platform. This includes specific |
543 | configurations for the board and its peripherals. | 543 | configurations for the board and its peripherals. |
544 | 544 | ||
545 | config MACH_EUKREA_CPUIMX35 | 545 | config MACH_EUKREA_CPUIMX35SD |
546 | bool "Support Eukrea CPUIMX35 Platform" | 546 | bool "Support Eukrea CPUIMX35 Platform" |
547 | select SOC_IMX35 | 547 | select SOC_IMX35 |
548 | select IMX_HAVE_PLATFORM_FLEXCAN | 548 | select IMX_HAVE_PLATFORM_FLEXCAN |
@@ -560,7 +560,7 @@ config MACH_EUKREA_CPUIMX35 | |||
560 | 560 | ||
561 | choice | 561 | choice |
562 | prompt "Baseboard" | 562 | prompt "Baseboard" |
563 | depends on MACH_EUKREA_CPUIMX35 | 563 | depends on MACH_EUKREA_CPUIMX35SD |
564 | default MACH_EUKREA_MBIMXSD35_BASEBOARD | 564 | default MACH_EUKREA_MBIMXSD35_BASEBOARD |
565 | 565 | ||
566 | config MACH_EUKREA_MBIMXSD35_BASEBOARD | 566 | config MACH_EUKREA_MBIMXSD35_BASEBOARD |
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index aba73214c2a8..d97f409ce98b 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -24,7 +24,7 @@ obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o | |||
24 | 24 | ||
25 | # i.MX25 based machines | 25 | # i.MX25 based machines |
26 | obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o | 26 | obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o |
27 | obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += mach-eukrea_cpuimx25.o | 27 | obj-$(CONFIG_MACH_EUKREA_CPUIMX25SD) += mach-eukrea_cpuimx25.o |
28 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o | 28 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o |
29 | 29 | ||
30 | # i.MX27 based machines | 30 | # i.MX27 based machines |
@@ -57,7 +57,7 @@ obj-$(CONFIG_MACH_BUG) += mach-bug.o | |||
57 | # i.MX35 based machines | 57 | # i.MX35 based machines |
58 | obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o | 58 | obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o |
59 | obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o | 59 | obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o |
60 | obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o | 60 | obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o |
61 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o | 61 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o |
62 | obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o | 62 | obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o |
63 | 63 | ||
diff --git a/arch/arm/mach-imx/clock-imx35.c b/arch/arm/mach-imx/clock-imx35.c index 8116f119517d..ac8238caecb9 100644 --- a/arch/arm/mach-imx/clock-imx35.c +++ b/arch/arm/mach-imx/clock-imx35.c | |||
@@ -507,7 +507,7 @@ static struct clk_lookup lookups[] = { | |||
507 | 507 | ||
508 | int __init mx35_clocks_init() | 508 | int __init mx35_clocks_init() |
509 | { | 509 | { |
510 | unsigned int cgr2 = 3 << 26, cgr3 = 0; | 510 | unsigned int cgr2 = 3 << 26; |
511 | 511 | ||
512 | #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) | 512 | #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) |
513 | cgr2 |= 3 << 16; | 513 | cgr2 |= 3 << 16; |
@@ -521,6 +521,12 @@ int __init mx35_clocks_init() | |||
521 | __raw_writel((3 << 18), CCM_BASE + CCM_CGR0); | 521 | __raw_writel((3 << 18), CCM_BASE + CCM_CGR0); |
522 | __raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16), | 522 | __raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16), |
523 | CCM_BASE + CCM_CGR1); | 523 | CCM_BASE + CCM_CGR1); |
524 | __raw_writel(cgr2, CCM_BASE + CCM_CGR2); | ||
525 | __raw_writel(0, CCM_BASE + CCM_CGR3); | ||
526 | |||
527 | clk_enable(&iim_clk); | ||
528 | imx_print_silicon_rev("i.MX35", mx35_revision()); | ||
529 | clk_disable(&iim_clk); | ||
524 | 530 | ||
525 | /* | 531 | /* |
526 | * Check if we came up in internal boot mode. If yes, we need some | 532 | * Check if we came up in internal boot mode. If yes, we need some |
@@ -529,17 +535,11 @@ int __init mx35_clocks_init() | |||
529 | */ | 535 | */ |
530 | if (!(__raw_readl(CCM_BASE + CCM_RCSR) & (3 << 10))) { | 536 | if (!(__raw_readl(CCM_BASE + CCM_RCSR) & (3 << 10))) { |
531 | /* Additionally turn on UART1, SCC, and IIM clocks */ | 537 | /* Additionally turn on UART1, SCC, and IIM clocks */ |
532 | cgr2 |= 3 << 16 | 3 << 4; | 538 | clk_enable(&iim_clk); |
533 | cgr3 |= 3 << 2; | 539 | clk_enable(&uart1_clk); |
540 | clk_enable(&scc_clk); | ||
534 | } | 541 | } |
535 | 542 | ||
536 | __raw_writel(cgr2, CCM_BASE + CCM_CGR2); | ||
537 | __raw_writel(cgr3, CCM_BASE + CCM_CGR3); | ||
538 | |||
539 | clk_enable(&iim_clk); | ||
540 | imx_print_silicon_rev("i.MX35", mx35_revision()); | ||
541 | clk_disable(&iim_clk); | ||
542 | |||
543 | #ifdef CONFIG_MXC_USE_EPIT | 543 | #ifdef CONFIG_MXC_USE_EPIT |
544 | epit_timer_init(&epit1_clk, | 544 | epit_timer_init(&epit1_clk, |
545 | MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1); | 545 | MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1); |
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c index 66af2e8f7e57..362aae780601 100644 --- a/arch/arm/mach-imx/mach-cpuimx35.c +++ b/arch/arm/mach-imx/mach-cpuimx35.c | |||
@@ -53,12 +53,18 @@ static const struct imxi2c_platform_data | |||
53 | .bitrate = 100000, | 53 | .bitrate = 100000, |
54 | }; | 54 | }; |
55 | 55 | ||
56 | #define TSC2007_IRQGPIO IMX_GPIO_NR(3, 2) | ||
57 | static int tsc2007_get_pendown_state(void) | ||
58 | { | ||
59 | return !gpio_get_value(TSC2007_IRQGPIO); | ||
60 | } | ||
61 | |||
56 | static struct tsc2007_platform_data tsc2007_info = { | 62 | static struct tsc2007_platform_data tsc2007_info = { |
57 | .model = 2007, | 63 | .model = 2007, |
58 | .x_plate_ohms = 180, | 64 | .x_plate_ohms = 180, |
65 | .get_pendown_state = tsc2007_get_pendown_state, | ||
59 | }; | 66 | }; |
60 | 67 | ||
61 | #define TSC2007_IRQGPIO IMX_GPIO_NR(3, 2) | ||
62 | static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { | 68 | static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { |
63 | { | 69 | { |
64 | I2C_BOARD_INFO("pcf8563", 0x51), | 70 | I2C_BOARD_INFO("pcf8563", 0x51), |
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 9cd860a27af5..8deb012189b5 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -37,14 +37,15 @@ static void __init imx6q_map_io(void) | |||
37 | imx6q_clock_map_io(); | 37 | imx6q_clock_map_io(); |
38 | } | 38 | } |
39 | 39 | ||
40 | static void __init imx6q_gpio_add_irq_domain(struct device_node *np, | 40 | static int __init imx6q_gpio_add_irq_domain(struct device_node *np, |
41 | struct device_node *interrupt_parent) | 41 | struct device_node *interrupt_parent) |
42 | { | 42 | { |
43 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - | 43 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; |
44 | 32 * 7; /* imx6q gets 7 gpio ports */ | ||
45 | 44 | ||
45 | gpio_irq_base -= 32; | ||
46 | irq_domain_add_simple(np, gpio_irq_base); | 46 | irq_domain_add_simple(np, gpio_irq_base); |
47 | gpio_irq_base += 32; | 47 | |
48 | return 0; | ||
48 | } | 49 | } |
49 | 50 | ||
50 | static const struct of_device_id imx6q_irq_match[] __initconst = { | 51 | static const struct of_device_id imx6q_irq_match[] __initconst = { |
diff --git a/arch/arm/mach-msm/devices-iommu.c b/arch/arm/mach-msm/devices-iommu.c index 24030d0da6e3..0fb7a17df398 100644 --- a/arch/arm/mach-msm/devices-iommu.c +++ b/arch/arm/mach-msm/devices-iommu.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/bootmem.h> | 20 | #include <linux/bootmem.h> |
21 | #include <linux/module.h> | ||
21 | #include <mach/irqs.h> | 22 | #include <mach/irqs.h> |
22 | #include <mach/iommu.h> | 23 | #include <mach/iommu.h> |
23 | 24 | ||
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 5c837603ff0f..24994bb52147 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -362,7 +362,7 @@ static void __init mx51_babbage_init(void) | |||
362 | { | 362 | { |
363 | iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; | 363 | iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; |
364 | iomux_v3_cfg_t power_key = NEW_PAD_CTRL(MX51_PAD_EIM_A27__GPIO2_21, | 364 | iomux_v3_cfg_t power_key = NEW_PAD_CTRL(MX51_PAD_EIM_A27__GPIO2_21, |
365 | PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP); | 365 | PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH); |
366 | 366 | ||
367 | imx51_soc_init(); | 367 | imx51_soc_init(); |
368 | 368 | ||
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c index 6bea31ab8f85..64bbfcea6f35 100644 --- a/arch/arm/mach-mx5/board-mx53_evk.c +++ b/arch/arm/mach-mx5/board-mx53_evk.c | |||
@@ -106,7 +106,7 @@ static inline void mx53_evk_fec_reset(void) | |||
106 | gpio_set_value(MX53_EVK_FEC_PHY_RST, 1); | 106 | gpio_set_value(MX53_EVK_FEC_PHY_RST, 1); |
107 | } | 107 | } |
108 | 108 | ||
109 | static struct fec_platform_data mx53_evk_fec_pdata = { | 109 | static const struct fec_platform_data mx53_evk_fec_pdata __initconst = { |
110 | .phy = PHY_INTERFACE_MODE_RMII, | 110 | .phy = PHY_INTERFACE_MODE_RMII, |
111 | }; | 111 | }; |
112 | 112 | ||
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c index 7678f7734db6..237bdecd9331 100644 --- a/arch/arm/mach-mx5/board-mx53_loco.c +++ b/arch/arm/mach-mx5/board-mx53_loco.c | |||
@@ -242,7 +242,7 @@ static inline void mx53_loco_fec_reset(void) | |||
242 | gpio_set_value(LOCO_FEC_PHY_RST, 1); | 242 | gpio_set_value(LOCO_FEC_PHY_RST, 1); |
243 | } | 243 | } |
244 | 244 | ||
245 | static struct fec_platform_data mx53_loco_fec_data = { | 245 | static const struct fec_platform_data mx53_loco_fec_data __initconst = { |
246 | .phy = PHY_INTERFACE_MODE_RMII, | 246 | .phy = PHY_INTERFACE_MODE_RMII, |
247 | }; | 247 | }; |
248 | 248 | ||
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c index 59c0845eb4a6..d42132a80e8f 100644 --- a/arch/arm/mach-mx5/board-mx53_smd.c +++ b/arch/arm/mach-mx5/board-mx53_smd.c | |||
@@ -104,7 +104,7 @@ static inline void mx53_smd_fec_reset(void) | |||
104 | gpio_set_value(SMD_FEC_PHY_RST, 1); | 104 | gpio_set_value(SMD_FEC_PHY_RST, 1); |
105 | } | 105 | } |
106 | 106 | ||
107 | static struct fec_platform_data mx53_smd_fec_data = { | 107 | static const struct fec_platform_data mx53_smd_fec_data __initconst = { |
108 | .phy = PHY_INTERFACE_MODE_RMII, | 108 | .phy = PHY_INTERFACE_MODE_RMII, |
109 | }; | 109 | }; |
110 | 110 | ||
diff --git a/arch/arm/mach-mx5/imx51-dt.c b/arch/arm/mach-mx5/imx51-dt.c index ccc61585659b..596edd967dbf 100644 --- a/arch/arm/mach-mx5/imx51-dt.c +++ b/arch/arm/mach-mx5/imx51-dt.c | |||
@@ -44,20 +44,22 @@ static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = { | |||
44 | { /* sentinel */ } | 44 | { /* sentinel */ } |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static void __init imx51_tzic_add_irq_domain(struct device_node *np, | 47 | static int __init imx51_tzic_add_irq_domain(struct device_node *np, |
48 | struct device_node *interrupt_parent) | 48 | struct device_node *interrupt_parent) |
49 | { | 49 | { |
50 | irq_domain_add_simple(np, 0); | 50 | irq_domain_add_simple(np, 0); |
51 | return 0; | ||
51 | } | 52 | } |
52 | 53 | ||
53 | static void __init imx51_gpio_add_irq_domain(struct device_node *np, | 54 | static int __init imx51_gpio_add_irq_domain(struct device_node *np, |
54 | struct device_node *interrupt_parent) | 55 | struct device_node *interrupt_parent) |
55 | { | 56 | { |
56 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - | 57 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; |
57 | 32 * 4; /* imx51 gets 4 gpio ports */ | ||
58 | 58 | ||
59 | gpio_irq_base -= 32; | ||
59 | irq_domain_add_simple(np, gpio_irq_base); | 60 | irq_domain_add_simple(np, gpio_irq_base); |
60 | gpio_irq_base += 32; | 61 | |
62 | return 0; | ||
61 | } | 63 | } |
62 | 64 | ||
63 | static const struct of_device_id imx51_irq_match[] __initconst = { | 65 | static const struct of_device_id imx51_irq_match[] __initconst = { |
diff --git a/arch/arm/mach-mx5/imx53-dt.c b/arch/arm/mach-mx5/imx53-dt.c index ccaa0b81b768..85bfd5ff21b0 100644 --- a/arch/arm/mach-mx5/imx53-dt.c +++ b/arch/arm/mach-mx5/imx53-dt.c | |||
@@ -48,20 +48,22 @@ static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = { | |||
48 | { /* sentinel */ } | 48 | { /* sentinel */ } |
49 | }; | 49 | }; |
50 | 50 | ||
51 | static void __init imx53_tzic_add_irq_domain(struct device_node *np, | 51 | static int __init imx53_tzic_add_irq_domain(struct device_node *np, |
52 | struct device_node *interrupt_parent) | 52 | struct device_node *interrupt_parent) |
53 | { | 53 | { |
54 | irq_domain_add_simple(np, 0); | 54 | irq_domain_add_simple(np, 0); |
55 | return 0; | ||
55 | } | 56 | } |
56 | 57 | ||
57 | static void __init imx53_gpio_add_irq_domain(struct device_node *np, | 58 | static int __init imx53_gpio_add_irq_domain(struct device_node *np, |
58 | struct device_node *interrupt_parent) | 59 | struct device_node *interrupt_parent) |
59 | { | 60 | { |
60 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - | 61 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; |
61 | 32 * 7; /* imx53 gets 7 gpio ports */ | ||
62 | 62 | ||
63 | gpio_irq_base -= 32; | ||
63 | irq_domain_add_simple(np, gpio_irq_base); | 64 | irq_domain_add_simple(np, gpio_irq_base); |
64 | gpio_irq_base += 32; | 65 | |
66 | return 0; | ||
65 | } | 67 | } |
66 | 68 | ||
67 | static const struct of_device_id imx53_irq_match[] __initconst = { | 69 | static const struct of_device_id imx53_irq_match[] __initconst = { |
diff --git a/arch/arm/mach-mxs/include/mach/mx28.h b/arch/arm/mach-mxs/include/mach/mx28.h index 75d86118b76a..30c7990f3c01 100644 --- a/arch/arm/mach-mxs/include/mach/mx28.h +++ b/arch/arm/mach-mxs/include/mach/mx28.h | |||
@@ -104,8 +104,8 @@ | |||
104 | #define MX28_INT_CAN1 9 | 104 | #define MX28_INT_CAN1 9 |
105 | #define MX28_INT_LRADC_TOUCH 10 | 105 | #define MX28_INT_LRADC_TOUCH 10 |
106 | #define MX28_INT_HSADC 13 | 106 | #define MX28_INT_HSADC 13 |
107 | #define MX28_INT_IRADC_THRESH0 14 | 107 | #define MX28_INT_LRADC_THRESH0 14 |
108 | #define MX28_INT_IRADC_THRESH1 15 | 108 | #define MX28_INT_LRADC_THRESH1 15 |
109 | #define MX28_INT_LRADC_CH0 16 | 109 | #define MX28_INT_LRADC_CH0 16 |
110 | #define MX28_INT_LRADC_CH1 17 | 110 | #define MX28_INT_LRADC_CH1 17 |
111 | #define MX28_INT_LRADC_CH2 18 | 111 | #define MX28_INT_LRADC_CH2 18 |
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h index 0d2d2b470998..bde5f6634747 100644 --- a/arch/arm/mach-mxs/include/mach/mxs.h +++ b/arch/arm/mach-mxs/include/mach/mxs.h | |||
@@ -30,6 +30,7 @@ | |||
30 | */ | 30 | */ |
31 | #define cpu_is_mx23() ( \ | 31 | #define cpu_is_mx23() ( \ |
32 | machine_is_mx23evk() || \ | 32 | machine_is_mx23evk() || \ |
33 | machine_is_stmp378x() || \ | ||
33 | 0) | 34 | 0) |
34 | #define cpu_is_mx28() ( \ | 35 | #define cpu_is_mx28() ( \ |
35 | machine_is_mx28evk() || \ | 36 | machine_is_mx28evk() || \ |
diff --git a/arch/arm/mach-mxs/mach-m28evk.c b/arch/arm/mach-mxs/mach-m28evk.c index 3b1681e4f49a..6b00577b7025 100644 --- a/arch/arm/mach-mxs/mach-m28evk.c +++ b/arch/arm/mach-mxs/mach-m28evk.c | |||
@@ -361,6 +361,6 @@ static struct sys_timer m28evk_timer = { | |||
361 | MACHINE_START(M28EVK, "DENX M28 EVK") | 361 | MACHINE_START(M28EVK, "DENX M28 EVK") |
362 | .map_io = mx28_map_io, | 362 | .map_io = mx28_map_io, |
363 | .init_irq = mx28_init_irq, | 363 | .init_irq = mx28_init_irq, |
364 | .init_machine = m28evk_init, | ||
365 | .timer = &m28evk_timer, | 364 | .timer = &m28evk_timer, |
365 | .init_machine = m28evk_init, | ||
366 | MACHINE_END | 366 | MACHINE_END |
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c index 177e53123a02..6834dea38c04 100644 --- a/arch/arm/mach-mxs/mach-stmp378x_devb.c +++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c | |||
@@ -115,6 +115,6 @@ static struct sys_timer stmp378x_dvb_timer = { | |||
115 | MACHINE_START(STMP378X, "STMP378X") | 115 | MACHINE_START(STMP378X, "STMP378X") |
116 | .map_io = mx23_map_io, | 116 | .map_io = mx23_map_io, |
117 | .init_irq = mx23_init_irq, | 117 | .init_irq = mx23_init_irq, |
118 | .init_machine = stmp378x_dvb_init, | ||
119 | .timer = &stmp378x_dvb_timer, | 118 | .timer = &stmp378x_dvb_timer, |
119 | .init_machine = stmp378x_dvb_init, | ||
120 | MACHINE_END | 120 | MACHINE_END |
diff --git a/arch/arm/mach-mxs/module-tx28.c b/arch/arm/mach-mxs/module-tx28.c index 0fcff47009cf..9a7b08b2a925 100644 --- a/arch/arm/mach-mxs/module-tx28.c +++ b/arch/arm/mach-mxs/module-tx28.c | |||
@@ -66,11 +66,11 @@ static const iomux_cfg_t tx28_fec1_pads[] __initconst = { | |||
66 | MX28_PAD_ENET0_CRS__ENET1_RX_EN, | 66 | MX28_PAD_ENET0_CRS__ENET1_RX_EN, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | static struct fec_platform_data tx28_fec0_data = { | 69 | static const struct fec_platform_data tx28_fec0_data __initconst = { |
70 | .phy = PHY_INTERFACE_MODE_RMII, | 70 | .phy = PHY_INTERFACE_MODE_RMII, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static struct fec_platform_data tx28_fec1_data = { | 73 | static const struct fec_platform_data tx28_fec1_data __initconst = { |
74 | .phy = PHY_INTERFACE_MODE_RMII, | 74 | .phy = PHY_INTERFACE_MODE_RMII, |
75 | }; | 75 | }; |
76 | 76 | ||
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index 1297bb58869c..9ff90a744a21 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c | |||
@@ -16,6 +16,8 @@ | |||
16 | 16 | ||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/cpufreq.h> | ||
20 | #include <linux/delay.h> | ||
19 | #include <linux/io.h> | 21 | #include <linux/io.h> |
20 | 22 | ||
21 | #include <asm/mach-types.h> /* for machine_is_* */ | 23 | #include <asm/mach-types.h> /* for machine_is_* */ |
@@ -927,16 +929,22 @@ int __init omap1_clk_init(void) | |||
927 | 929 | ||
928 | void __init omap1_clk_late_init(void) | 930 | void __init omap1_clk_late_init(void) |
929 | { | 931 | { |
930 | if (ck_dpll1.rate >= OMAP1_DPLL1_SANE_VALUE) | 932 | unsigned long rate = ck_dpll1.rate; |
933 | |||
934 | if (rate >= OMAP1_DPLL1_SANE_VALUE) | ||
931 | return; | 935 | return; |
932 | 936 | ||
937 | /* System booting at unusable rate, force reprogramming of DPLL1 */ | ||
938 | ck_dpll1_p->rate = 0; | ||
939 | |||
933 | /* Find the highest supported frequency and enable it */ | 940 | /* Find the highest supported frequency and enable it */ |
934 | if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { | 941 | if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { |
935 | pr_err("System frequencies not set, using default. Check your config.\n"); | 942 | pr_err("System frequencies not set, using default. Check your config.\n"); |
936 | omap_writew(0x2290, DPLL_CTL); | 943 | omap_writew(0x2290, DPLL_CTL); |
937 | omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL); | 944 | omap_writew(cpu_is_omap7xx() ? 0x2005 : 0x0005, ARM_CKCTL); |
938 | ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE; | 945 | ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE; |
939 | } | 946 | } |
940 | propagate_rate(&ck_dpll1); | 947 | propagate_rate(&ck_dpll1); |
941 | omap1_show_rates(); | 948 | omap1_show_rates(); |
949 | loops_per_jiffy = cpufreq_scale(loops_per_jiffy, rate, ck_dpll1.rate); | ||
942 | } | 950 | } |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index ba1aa07bdb29..c15c5c9c9085 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -193,7 +193,7 @@ static struct platform_device rx51_charger_device = { | |||
193 | static void __init rx51_charger_init(void) | 193 | static void __init rx51_charger_init(void) |
194 | { | 194 | { |
195 | WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO, | 195 | WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO, |
196 | GPIOF_OUT_INIT_LOW, "isp1704_reset")); | 196 | GPIOF_OUT_INIT_HIGH, "isp1704_reset")); |
197 | 197 | ||
198 | platform_device_register(&rx51_charger_device); | 198 | platform_device_register(&rx51_charger_device); |
199 | } | 199 | } |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 292eee3be15f..28fcb27005d2 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -145,6 +145,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) | |||
145 | pdata->reg_size = 4; | 145 | pdata->reg_size = 4; |
146 | pdata->has_ccr = true; | 146 | pdata->has_ccr = true; |
147 | } | 147 | } |
148 | pdata->set_clk_src = omap2_mcbsp_set_clk_src; | ||
149 | if (id == 1) | ||
150 | pdata->mux_signal = omap2_mcbsp1_mux_rx_clk; | ||
148 | 151 | ||
149 | if (oh->class->rev == MCBSP_CONFIG_TYPE3) { | 152 | if (oh->class->rev == MCBSP_CONFIG_TYPE3) { |
150 | if (id == 2) | 153 | if (id == 2) |
@@ -174,9 +177,6 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) | |||
174 | name, oh->name); | 177 | name, oh->name); |
175 | return PTR_ERR(pdev); | 178 | return PTR_ERR(pdev); |
176 | } | 179 | } |
177 | pdata->set_clk_src = omap2_mcbsp_set_clk_src; | ||
178 | if (id == 1) | ||
179 | pdata->mux_signal = omap2_mcbsp1_mux_rx_clk; | ||
180 | omap_mcbsp_count++; | 180 | omap_mcbsp_count++; |
181 | return 0; | 181 | return 0; |
182 | } | 182 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 7f8915ad5099..eef43e2e163e 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -3247,18 +3247,14 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
3247 | 3247 | ||
3248 | /* 3430ES1-only hwmods */ | 3248 | /* 3430ES1-only hwmods */ |
3249 | static __initdata struct omap_hwmod *omap3430es1_hwmods[] = { | 3249 | static __initdata struct omap_hwmod *omap3430es1_hwmods[] = { |
3250 | &omap3xxx_iva_hwmod, | ||
3251 | &omap3430es1_dss_core_hwmod, | 3250 | &omap3430es1_dss_core_hwmod, |
3252 | &omap3xxx_mailbox_hwmod, | ||
3253 | NULL | 3251 | NULL |
3254 | }; | 3252 | }; |
3255 | 3253 | ||
3256 | /* 3430ES2+-only hwmods */ | 3254 | /* 3430ES2+-only hwmods */ |
3257 | static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = { | 3255 | static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = { |
3258 | &omap3xxx_iva_hwmod, | ||
3259 | &omap3xxx_dss_core_hwmod, | 3256 | &omap3xxx_dss_core_hwmod, |
3260 | &omap3xxx_usbhsotg_hwmod, | 3257 | &omap3xxx_usbhsotg_hwmod, |
3261 | &omap3xxx_mailbox_hwmod, | ||
3262 | NULL | 3258 | NULL |
3263 | }; | 3259 | }; |
3264 | 3260 | ||
diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c index cb53160f6c5d..26ebb57719df 100644 --- a/arch/arm/mach-prima2/pm.c +++ b/arch/arm/mach-prima2/pm.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/suspend.h> | 10 | #include <linux/suspend.h> |
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/module.h> | ||
12 | #include <linux/of.h> | 13 | #include <linux/of.h> |
13 | #include <linux/of_address.h> | 14 | #include <linux/of_address.h> |
14 | #include <linux/of_device.h> | 15 | #include <linux/of_device.h> |
diff --git a/arch/arm/mach-prima2/prima2.c b/arch/arm/mach-prima2/prima2.c index ef555c041962..a12b689a8702 100644 --- a/arch/arm/mach-prima2/prima2.c +++ b/arch/arm/mach-prima2/prima2.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <asm/sizes.h> | ||
11 | #include <asm/mach-types.h> | 12 | #include <asm/mach-types.h> |
12 | #include <asm/mach/arch.h> | 13 | #include <asm/mach/arch.h> |
13 | #include <linux/of.h> | 14 | #include <linux/of.h> |
diff --git a/arch/arm/mach-s3c64xx/dev-spi.c b/arch/arm/mach-s3c64xx/dev-spi.c index 5e6b42089eb4..3341fd118723 100644 --- a/arch/arm/mach-s3c64xx/dev-spi.c +++ b/arch/arm/mach-s3c64xx/dev-spi.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
13 | #include <linux/export.h> | ||
13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
14 | #include <linux/dma-mapping.h> | 15 | #include <linux/dma-mapping.h> |
15 | #include <linux/gpio.h> | 16 | #include <linux/gpio.h> |
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c index 7a3bc32df425..51c00f2453c6 100644 --- a/arch/arm/mach-s3c64xx/s3c6400.c +++ b/arch/arm/mach-s3c64xx/s3c6400.c | |||
@@ -70,7 +70,7 @@ void __init s3c6400_init_irq(void) | |||
70 | s3c64xx_init_irq(~0 & ~(0xf << 5), ~0); | 70 | s3c64xx_init_irq(~0 & ~(0xf << 5), ~0); |
71 | } | 71 | } |
72 | 72 | ||
73 | struct sysdev_class s3c6400_sysclass = { | 73 | static struct sysdev_class s3c6400_sysclass = { |
74 | .name = "s3c6400-core", | 74 | .name = "s3c6400-core", |
75 | }; | 75 | }; |
76 | 76 | ||
diff --git a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c index 83d2afb79e9f..2cf80026c58d 100644 --- a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c +++ b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <plat/fb.h> | 20 | #include <plat/fb.h> |
21 | #include <plat/gpio-cfg.h> | 21 | #include <plat/gpio-cfg.h> |
22 | 22 | ||
23 | extern void s3c64xx_fb_gpio_setup_24bpp(void) | 23 | void s3c64xx_fb_gpio_setup_24bpp(void) |
24 | { | 24 | { |
25 | s3c_gpio_cfgrange_nopull(S3C64XX_GPI(0), 16, S3C_GPIO_SFN(2)); | 25 | s3c_gpio_cfgrange_nopull(S3C64XX_GPI(0), 16, S3C_GPIO_SFN(2)); |
26 | s3c_gpio_cfgrange_nopull(S3C64XX_GPJ(0), 12, S3C_GPIO_SFN(2)); | 26 | s3c_gpio_cfgrange_nopull(S3C64XX_GPJ(0), 12, S3C_GPIO_SFN(2)); |
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c index a9106c392398..8662ef6e5681 100644 --- a/arch/arm/mach-s5pv210/mach-smdkv210.c +++ b/arch/arm/mach-s5pv210/mach-smdkv210.c | |||
@@ -273,6 +273,7 @@ static struct samsung_bl_gpio_info smdkv210_bl_gpio_info = { | |||
273 | 273 | ||
274 | static struct platform_pwm_backlight_data smdkv210_bl_data = { | 274 | static struct platform_pwm_backlight_data smdkv210_bl_data = { |
275 | .pwm_id = 3, | 275 | .pwm_id = 3, |
276 | .pwm_period_ns = 1000, | ||
276 | }; | 277 | }; |
277 | 278 | ||
278 | static void __init smdkv210_map_io(void) | 279 | static void __init smdkv210_map_io(void) |
diff --git a/arch/arm/mach-sa1100/Makefile.boot b/arch/arm/mach-sa1100/Makefile.boot index 5a616f6e5612..f7951aa04562 100644 --- a/arch/arm/mach-sa1100/Makefile.boot +++ b/arch/arm/mach-sa1100/Makefile.boot | |||
@@ -1,5 +1,5 @@ | |||
1 | ifeq ($(CONFIG_ARCH_SA1100),y) | 1 | ifeq ($(CONFIG_SA1111),y) |
2 | zreladdr-$(CONFIG_SA1111) += 0xc0208000 | 2 | zreladdr-y += 0xc0208000 |
3 | else | 3 | else |
4 | zreladdr-y += 0xc0008000 | 4 | zreladdr-y += 0xc0008000 |
5 | endif | 5 | endif |
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c index b862e9f81e3e..7119b87cbfa0 100644 --- a/arch/arm/mach-shmobile/board-ag5evm.c +++ b/arch/arm/mach-shmobile/board-ag5evm.c | |||
@@ -607,6 +607,7 @@ struct sys_timer ag5evm_timer = { | |||
607 | 607 | ||
608 | MACHINE_START(AG5EVM, "ag5evm") | 608 | MACHINE_START(AG5EVM, "ag5evm") |
609 | .map_io = ag5evm_map_io, | 609 | .map_io = ag5evm_map_io, |
610 | .nr_irqs = NR_IRQS_LEGACY, | ||
610 | .init_irq = sh73a0_init_irq, | 611 | .init_irq = sh73a0_init_irq, |
611 | .handle_irq = shmobile_handle_irq_gic, | 612 | .handle_irq = shmobile_handle_irq_gic, |
612 | .init_machine = ag5evm_init, | 613 | .init_machine = ag5evm_init, |
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c index bd9a78424d6b..f44150b5ae46 100644 --- a/arch/arm/mach-shmobile/board-kota2.c +++ b/arch/arm/mach-shmobile/board-kota2.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/input/sh_keysc.h> | 33 | #include <linux/input/sh_keysc.h> |
34 | #include <linux/gpio_keys.h> | 34 | #include <linux/gpio_keys.h> |
35 | #include <linux/leds.h> | 35 | #include <linux/leds.h> |
36 | #include <linux/platform_data/leds-renesas-tpu.h> | ||
36 | #include <linux/mmc/host.h> | 37 | #include <linux/mmc/host.h> |
37 | #include <linux/mmc/sh_mmcif.h> | 38 | #include <linux/mmc/sh_mmcif.h> |
38 | #include <linux/mfd/tmio.h> | 39 | #include <linux/mfd/tmio.h> |
@@ -56,7 +57,7 @@ static struct resource smsc9220_resources[] = { | |||
56 | .flags = IORESOURCE_MEM, | 57 | .flags = IORESOURCE_MEM, |
57 | }, | 58 | }, |
58 | [1] = { | 59 | [1] = { |
59 | .start = gic_spi(33), /* PINTA2 @ PORT144 */ | 60 | .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */ |
60 | .flags = IORESOURCE_IRQ, | 61 | .flags = IORESOURCE_IRQ, |
61 | }, | 62 | }, |
62 | }; | 63 | }; |
@@ -157,10 +158,6 @@ static struct platform_device gpio_keys_device = { | |||
157 | #define GPIO_LED(n, g) { .name = n, .gpio = g } | 158 | #define GPIO_LED(n, g) { .name = n, .gpio = g } |
158 | 159 | ||
159 | static struct gpio_led gpio_leds[] = { | 160 | static struct gpio_led gpio_leds[] = { |
160 | GPIO_LED("V2513", GPIO_PORT153), /* PORT153 [TPU1T02] -> V2513 */ | ||
161 | GPIO_LED("V2514", GPIO_PORT199), /* PORT199 [TPU4TO1] -> V2514 */ | ||
162 | GPIO_LED("V2515", GPIO_PORT197), /* PORT197 [TPU2TO1] -> V2515 */ | ||
163 | GPIO_LED("KEYLED", GPIO_PORT163), /* PORT163 [TPU3TO0] -> KEYLED */ | ||
164 | GPIO_LED("G", GPIO_PORT20), /* PORT20 [GPO0] -> LED7 -> "G" */ | 161 | GPIO_LED("G", GPIO_PORT20), /* PORT20 [GPO0] -> LED7 -> "G" */ |
165 | GPIO_LED("H", GPIO_PORT21), /* PORT21 [GPO1] -> LED8 -> "H" */ | 162 | GPIO_LED("H", GPIO_PORT21), /* PORT21 [GPO1] -> LED8 -> "H" */ |
166 | GPIO_LED("J", GPIO_PORT22), /* PORT22 [GPO2] -> LED9 -> "J" */ | 163 | GPIO_LED("J", GPIO_PORT22), /* PORT22 [GPO2] -> LED9 -> "J" */ |
@@ -179,6 +176,119 @@ static struct platform_device gpio_leds_device = { | |||
179 | }, | 176 | }, |
180 | }; | 177 | }; |
181 | 178 | ||
179 | /* TPU LED */ | ||
180 | static struct led_renesas_tpu_config led_renesas_tpu12_pdata = { | ||
181 | .name = "V2513", | ||
182 | .pin_gpio_fn = GPIO_FN_TPU1TO2, | ||
183 | .pin_gpio = GPIO_PORT153, | ||
184 | .channel_offset = 0x90, | ||
185 | .timer_bit = 2, | ||
186 | .max_brightness = 1000, | ||
187 | }; | ||
188 | |||
189 | static struct resource tpu12_resources[] = { | ||
190 | [0] = { | ||
191 | .name = "TPU12", | ||
192 | .start = 0xe6610090, | ||
193 | .end = 0xe66100b5, | ||
194 | .flags = IORESOURCE_MEM, | ||
195 | }, | ||
196 | }; | ||
197 | |||
198 | static struct platform_device leds_tpu12_device = { | ||
199 | .name = "leds-renesas-tpu", | ||
200 | .id = 12, | ||
201 | .dev = { | ||
202 | .platform_data = &led_renesas_tpu12_pdata, | ||
203 | }, | ||
204 | .num_resources = ARRAY_SIZE(tpu12_resources), | ||
205 | .resource = tpu12_resources, | ||
206 | }; | ||
207 | |||
208 | static struct led_renesas_tpu_config led_renesas_tpu41_pdata = { | ||
209 | .name = "V2514", | ||
210 | .pin_gpio_fn = GPIO_FN_TPU4TO1, | ||
211 | .pin_gpio = GPIO_PORT199, | ||
212 | .channel_offset = 0x50, | ||
213 | .timer_bit = 1, | ||
214 | .max_brightness = 1000, | ||
215 | }; | ||
216 | |||
217 | static struct resource tpu41_resources[] = { | ||
218 | [0] = { | ||
219 | .name = "TPU41", | ||
220 | .start = 0xe6640050, | ||
221 | .end = 0xe6640075, | ||
222 | .flags = IORESOURCE_MEM, | ||
223 | }, | ||
224 | }; | ||
225 | |||
226 | static struct platform_device leds_tpu41_device = { | ||
227 | .name = "leds-renesas-tpu", | ||
228 | .id = 41, | ||
229 | .dev = { | ||
230 | .platform_data = &led_renesas_tpu41_pdata, | ||
231 | }, | ||
232 | .num_resources = ARRAY_SIZE(tpu41_resources), | ||
233 | .resource = tpu41_resources, | ||
234 | }; | ||
235 | |||
236 | static struct led_renesas_tpu_config led_renesas_tpu21_pdata = { | ||
237 | .name = "V2515", | ||
238 | .pin_gpio_fn = GPIO_FN_TPU2TO1, | ||
239 | .pin_gpio = GPIO_PORT197, | ||
240 | .channel_offset = 0x50, | ||
241 | .timer_bit = 1, | ||
242 | .max_brightness = 1000, | ||
243 | }; | ||
244 | |||
245 | static struct resource tpu21_resources[] = { | ||
246 | [0] = { | ||
247 | .name = "TPU21", | ||
248 | .start = 0xe6620050, | ||
249 | .end = 0xe6620075, | ||
250 | .flags = IORESOURCE_MEM, | ||
251 | }, | ||
252 | }; | ||
253 | |||
254 | static struct platform_device leds_tpu21_device = { | ||
255 | .name = "leds-renesas-tpu", | ||
256 | .id = 21, | ||
257 | .dev = { | ||
258 | .platform_data = &led_renesas_tpu21_pdata, | ||
259 | }, | ||
260 | .num_resources = ARRAY_SIZE(tpu21_resources), | ||
261 | .resource = tpu21_resources, | ||
262 | }; | ||
263 | |||
264 | static struct led_renesas_tpu_config led_renesas_tpu30_pdata = { | ||
265 | .name = "KEYLED", | ||
266 | .pin_gpio_fn = GPIO_FN_TPU3TO0, | ||
267 | .pin_gpio = GPIO_PORT163, | ||
268 | .channel_offset = 0x10, | ||
269 | .timer_bit = 0, | ||
270 | .max_brightness = 1000, | ||
271 | }; | ||
272 | |||
273 | static struct resource tpu30_resources[] = { | ||
274 | [0] = { | ||
275 | .name = "TPU30", | ||
276 | .start = 0xe6630010, | ||
277 | .end = 0xe6630035, | ||
278 | .flags = IORESOURCE_MEM, | ||
279 | }, | ||
280 | }; | ||
281 | |||
282 | static struct platform_device leds_tpu30_device = { | ||
283 | .name = "leds-renesas-tpu", | ||
284 | .id = 30, | ||
285 | .dev = { | ||
286 | .platform_data = &led_renesas_tpu30_pdata, | ||
287 | }, | ||
288 | .num_resources = ARRAY_SIZE(tpu30_resources), | ||
289 | .resource = tpu30_resources, | ||
290 | }; | ||
291 | |||
182 | /* MMCIF */ | 292 | /* MMCIF */ |
183 | static struct resource mmcif_resources[] = { | 293 | static struct resource mmcif_resources[] = { |
184 | [0] = { | 294 | [0] = { |
@@ -291,6 +401,10 @@ static struct platform_device *kota2_devices[] __initdata = { | |||
291 | &keysc_device, | 401 | &keysc_device, |
292 | &gpio_keys_device, | 402 | &gpio_keys_device, |
293 | &gpio_leds_device, | 403 | &gpio_leds_device, |
404 | &leds_tpu12_device, | ||
405 | &leds_tpu41_device, | ||
406 | &leds_tpu21_device, | ||
407 | &leds_tpu30_device, | ||
294 | &mmcif_device, | 408 | &mmcif_device, |
295 | &sdhi0_device, | 409 | &sdhi0_device, |
296 | &sdhi1_device, | 410 | &sdhi1_device, |
@@ -317,18 +431,6 @@ static void __init kota2_map_io(void) | |||
317 | shmobile_setup_console(); | 431 | shmobile_setup_console(); |
318 | } | 432 | } |
319 | 433 | ||
320 | #define PINTER0A 0xe69000a0 | ||
321 | #define PINTCR0A 0xe69000b0 | ||
322 | |||
323 | void __init kota2_init_irq(void) | ||
324 | { | ||
325 | sh73a0_init_irq(); | ||
326 | |||
327 | /* setup PINT: enable PINTA2 as active low */ | ||
328 | __raw_writel(1 << 29, PINTER0A); | ||
329 | __raw_writew(2 << 10, PINTCR0A); | ||
330 | } | ||
331 | |||
332 | static void __init kota2_init(void) | 434 | static void __init kota2_init(void) |
333 | { | 435 | { |
334 | sh73a0_pinmux_init(); | 436 | sh73a0_pinmux_init(); |
@@ -447,7 +549,8 @@ struct sys_timer kota2_timer = { | |||
447 | 549 | ||
448 | MACHINE_START(KOTA2, "kota2") | 550 | MACHINE_START(KOTA2, "kota2") |
449 | .map_io = kota2_map_io, | 551 | .map_io = kota2_map_io, |
450 | .init_irq = kota2_init_irq, | 552 | .nr_irqs = NR_IRQS_LEGACY, |
553 | .init_irq = sh73a0_init_irq, | ||
451 | .handle_irq = shmobile_handle_irq_gic, | 554 | .handle_irq = shmobile_handle_irq_gic, |
452 | .init_machine = kota2_init, | 555 | .init_machine = kota2_init, |
453 | .timer = &kota2_timer, | 556 | .timer = &kota2_timer, |
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 61a846bb30f2..1370a89ca358 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -113,6 +113,12 @@ static struct clk main_clk = { | |||
113 | .ops = &main_clk_ops, | 113 | .ops = &main_clk_ops, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | /* Divide Main clock by two */ | ||
117 | static struct clk main_div2_clk = { | ||
118 | .ops = &div2_clk_ops, | ||
119 | .parent = &main_clk, | ||
120 | }; | ||
121 | |||
116 | /* PLL0, PLL1, PLL2, PLL3 */ | 122 | /* PLL0, PLL1, PLL2, PLL3 */ |
117 | static unsigned long pll_recalc(struct clk *clk) | 123 | static unsigned long pll_recalc(struct clk *clk) |
118 | { | 124 | { |
@@ -181,6 +187,7 @@ static struct clk *main_clks[] = { | |||
181 | &extal1_div2_clk, | 187 | &extal1_div2_clk, |
182 | &extal2_div2_clk, | 188 | &extal2_div2_clk, |
183 | &main_clk, | 189 | &main_clk, |
190 | &main_div2_clk, | ||
184 | &pll0_clk, | 191 | &pll0_clk, |
185 | &pll1_clk, | 192 | &pll1_clk, |
186 | &pll2_clk, | 193 | &pll2_clk, |
@@ -243,7 +250,7 @@ static struct clk div6_clks[DIV6_NR] = { | |||
243 | [DIV6_VCK1] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR1, 0), | 250 | [DIV6_VCK1] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR1, 0), |
244 | [DIV6_VCK2] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR2, 0), | 251 | [DIV6_VCK2] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR2, 0), |
245 | [DIV6_VCK3] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR3, 0), | 252 | [DIV6_VCK3] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR3, 0), |
246 | [DIV6_ZB1] = SH_CLK_DIV6(&pll1_div2_clk, ZBCKCR, 0), | 253 | [DIV6_ZB1] = SH_CLK_DIV6(&pll1_div2_clk, ZBCKCR, CLK_ENABLE_ON_INIT), |
247 | [DIV6_FLCTL] = SH_CLK_DIV6(&pll1_div2_clk, FLCKCR, 0), | 254 | [DIV6_FLCTL] = SH_CLK_DIV6(&pll1_div2_clk, FLCKCR, 0), |
248 | [DIV6_SDHI0] = SH_CLK_DIV6(&pll1_div2_clk, SD0CKCR, 0), | 255 | [DIV6_SDHI0] = SH_CLK_DIV6(&pll1_div2_clk, SD0CKCR, 0), |
249 | [DIV6_SDHI1] = SH_CLK_DIV6(&pll1_div2_clk, SD1CKCR, 0), | 256 | [DIV6_SDHI1] = SH_CLK_DIV6(&pll1_div2_clk, SD1CKCR, 0), |
@@ -268,6 +275,7 @@ enum { MSTP001, | |||
268 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, | 275 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, |
269 | MSTP331, MSTP329, MSTP325, MSTP323, MSTP318, | 276 | MSTP331, MSTP329, MSTP325, MSTP323, MSTP318, |
270 | MSTP314, MSTP313, MSTP312, MSTP311, | 277 | MSTP314, MSTP313, MSTP312, MSTP311, |
278 | MSTP303, MSTP302, MSTP301, MSTP300, | ||
271 | MSTP411, MSTP410, MSTP403, | 279 | MSTP411, MSTP410, MSTP403, |
272 | MSTP_NR }; | 280 | MSTP_NR }; |
273 | 281 | ||
@@ -301,6 +309,10 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
301 | [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */ | 309 | [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */ |
302 | [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ | 310 | [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ |
303 | [MSTP311] = MSTP(&div6_clks[DIV6_SDHI2], SMSTPCR3, 11, 0), /* SDHI2 */ | 311 | [MSTP311] = MSTP(&div6_clks[DIV6_SDHI2], SMSTPCR3, 11, 0), /* SDHI2 */ |
312 | [MSTP303] = MSTP(&main_div2_clk, SMSTPCR3, 3, 0), /* TPU1 */ | ||
313 | [MSTP302] = MSTP(&main_div2_clk, SMSTPCR3, 2, 0), /* TPU2 */ | ||
314 | [MSTP301] = MSTP(&main_div2_clk, SMSTPCR3, 1, 0), /* TPU3 */ | ||
315 | [MSTP300] = MSTP(&main_div2_clk, SMSTPCR3, 0, 0), /* TPU4 */ | ||
304 | [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ | 316 | [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ |
305 | [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */ | 317 | [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */ |
306 | [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ | 318 | [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ |
@@ -350,6 +362,10 @@ static struct clk_lookup lookups[] = { | |||
350 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ | 362 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ |
351 | CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ | 363 | CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ |
352 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */ | 364 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */ |
365 | CLKDEV_DEV_ID("leds-renesas-tpu.12", &mstp_clks[MSTP303]), /* TPU1 */ | ||
366 | CLKDEV_DEV_ID("leds-renesas-tpu.21", &mstp_clks[MSTP302]), /* TPU2 */ | ||
367 | CLKDEV_DEV_ID("leds-renesas-tpu.30", &mstp_clks[MSTP301]), /* TPU3 */ | ||
368 | CLKDEV_DEV_ID("leds-renesas-tpu.41", &mstp_clks[MSTP300]), /* TPU4 */ | ||
353 | CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ | 369 | CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ |
354 | CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */ | 370 | CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */ |
355 | CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ | 371 | CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 2c559ac38142..e70a73731eaa 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -363,11 +363,13 @@ __v7_setup: | |||
363 | orreq r10, r10, #1 << 6 @ set bit #6 | 363 | orreq r10, r10, #1 << 6 @ set bit #6 |
364 | mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register | 364 | mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register |
365 | #endif | 365 | #endif |
366 | #ifdef CONFIG_ARM_ERRATA_751472 | 366 | #if defined(CONFIG_ARM_ERRATA_751472) && defined(CONFIG_SMP) |
367 | cmp r6, #0x30 @ present prior to r3p0 | 367 | ALT_SMP(cmp r6, #0x30) @ present prior to r3p0 |
368 | ALT_UP_B(1f) | ||
368 | mrclt p15, 0, r10, c15, c0, 1 @ read diagnostic register | 369 | mrclt p15, 0, r10, c15, c0, 1 @ read diagnostic register |
369 | orrlt r10, r10, #1 << 11 @ set bit #11 | 370 | orrlt r10, r10, #1 << 11 @ set bit #11 |
370 | mcrlt p15, 0, r10, c15, c0, 1 @ write diagnostic register | 371 | mcrlt p15, 0, r10, c15, c0, 1 @ write diagnostic register |
372 | 1: | ||
371 | #endif | 373 | #endif |
372 | 374 | ||
373 | 3: mov r10, #0 | 375 | 3: mov r10, #0 |
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c index c074e66ad224..4e0a371630b3 100644 --- a/arch/arm/oprofile/common.c +++ b/arch/arm/oprofile/common.c | |||
@@ -116,7 +116,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
116 | return oprofile_perf_init(ops); | 116 | return oprofile_perf_init(ops); |
117 | } | 117 | } |
118 | 118 | ||
119 | void __exit oprofile_arch_exit(void) | 119 | void oprofile_arch_exit(void) |
120 | { | 120 | { |
121 | oprofile_perf_exit(); | 121 | oprofile_perf_exit(); |
122 | } | 122 | } |
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c index 74aac96cda20..73db34bf588a 100644 --- a/arch/arm/plat-mxc/cpufreq.c +++ b/arch/arm/plat-mxc/cpufreq.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * the CPU clock speed on the fly. | 17 | * the CPU clock speed on the fly. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/module.h> | ||
20 | #include <linux/cpufreq.h> | 21 | #include <linux/cpufreq.h> |
21 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
22 | #include <linux/err.h> | 23 | #include <linux/err.h> |
@@ -97,7 +98,7 @@ static int mxc_set_target(struct cpufreq_policy *policy, | |||
97 | return ret; | 98 | return ret; |
98 | } | 99 | } |
99 | 100 | ||
100 | static int __init mxc_cpufreq_init(struct cpufreq_policy *policy) | 101 | static int mxc_cpufreq_init(struct cpufreq_policy *policy) |
101 | { | 102 | { |
102 | int ret; | 103 | int ret; |
103 | int i; | 104 | int i; |
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h index 88fd40452567..477971b00930 100644 --- a/arch/arm/plat-mxc/include/mach/uncompress.h +++ b/arch/arm/plat-mxc/include/mach/uncompress.h | |||
@@ -98,6 +98,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id) | |||
98 | case MACH_TYPE_PCM043: | 98 | case MACH_TYPE_PCM043: |
99 | case MACH_TYPE_LILLY1131: | 99 | case MACH_TYPE_LILLY1131: |
100 | case MACH_TYPE_VPR200: | 100 | case MACH_TYPE_VPR200: |
101 | case MACH_TYPE_EUKREA_CPUIMX35SD: | ||
101 | uart_base = MX3X_UART1_BASE_ADDR; | 102 | uart_base = MX3X_UART1_BASE_ADDR; |
102 | break; | 103 | break; |
103 | case MACH_TYPE_MAGX_ZN5: | 104 | case MACH_TYPE_MAGX_ZN5: |
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c index 42d74ea59084..e032717f7d02 100644 --- a/arch/arm/plat-mxc/pwm.c +++ b/arch/arm/plat-mxc/pwm.c | |||
@@ -32,6 +32,9 @@ | |||
32 | #define MX3_PWMSAR 0x0C /* PWM Sample Register */ | 32 | #define MX3_PWMSAR 0x0C /* PWM Sample Register */ |
33 | #define MX3_PWMPR 0x10 /* PWM Period Register */ | 33 | #define MX3_PWMPR 0x10 /* PWM Period Register */ |
34 | #define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4) | 34 | #define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4) |
35 | #define MX3_PWMCR_DOZEEN (1 << 24) | ||
36 | #define MX3_PWMCR_WAITEN (1 << 23) | ||
37 | #define MX3_PWMCR_DBGEN (1 << 22) | ||
35 | #define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16) | 38 | #define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16) |
36 | #define MX3_PWMCR_CLKSRC_IPG (1 << 16) | 39 | #define MX3_PWMCR_CLKSRC_IPG (1 << 16) |
37 | #define MX3_PWMCR_EN (1 << 0) | 40 | #define MX3_PWMCR_EN (1 << 0) |
@@ -74,10 +77,21 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) | |||
74 | do_div(c, period_ns); | 77 | do_div(c, period_ns); |
75 | duty_cycles = c; | 78 | duty_cycles = c; |
76 | 79 | ||
80 | /* | ||
81 | * according to imx pwm RM, the real period value should be | ||
82 | * PERIOD value in PWMPR plus 2. | ||
83 | */ | ||
84 | if (period_cycles > 2) | ||
85 | period_cycles -= 2; | ||
86 | else | ||
87 | period_cycles = 0; | ||
88 | |||
77 | writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR); | 89 | writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR); |
78 | writel(period_cycles, pwm->mmio_base + MX3_PWMPR); | 90 | writel(period_cycles, pwm->mmio_base + MX3_PWMPR); |
79 | 91 | ||
80 | cr = MX3_PWMCR_PRESCALER(prescale) | MX3_PWMCR_EN; | 92 | cr = MX3_PWMCR_PRESCALER(prescale) | |
93 | MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN | | ||
94 | MX3_PWMCR_DBGEN | MX3_PWMCR_EN; | ||
81 | 95 | ||
82 | if (cpu_is_mx25()) | 96 | if (cpu_is_mx25()) |
83 | cr |= MX3_PWMCR_CLKSRC_IPG; | 97 | cr |= MX3_PWMCR_CLKSRC_IPG; |
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c index 41ab97ebe4cf..10d160888133 100644 --- a/arch/arm/plat-orion/gpio.c +++ b/arch/arm/plat-orion/gpio.c | |||
@@ -384,12 +384,16 @@ void __init orion_gpio_init(int gpio_base, int ngpio, | |||
384 | struct orion_gpio_chip *ochip; | 384 | struct orion_gpio_chip *ochip; |
385 | struct irq_chip_generic *gc; | 385 | struct irq_chip_generic *gc; |
386 | struct irq_chip_type *ct; | 386 | struct irq_chip_type *ct; |
387 | char gc_label[16]; | ||
387 | 388 | ||
388 | if (orion_gpio_chip_count == ARRAY_SIZE(orion_gpio_chips)) | 389 | if (orion_gpio_chip_count == ARRAY_SIZE(orion_gpio_chips)) |
389 | return; | 390 | return; |
390 | 391 | ||
392 | snprintf(gc_label, sizeof(gc_label), "orion_gpio%d", | ||
393 | orion_gpio_chip_count); | ||
394 | |||
391 | ochip = orion_gpio_chips + orion_gpio_chip_count; | 395 | ochip = orion_gpio_chips + orion_gpio_chip_count; |
392 | ochip->chip.label = "orion_gpio"; | 396 | ochip->chip.label = kstrdup(gc_label, GFP_KERNEL); |
393 | ochip->chip.request = orion_gpio_request; | 397 | ochip->chip.request = orion_gpio_request; |
394 | ochip->chip.direction_input = orion_gpio_direction_input; | 398 | ochip->chip.direction_input = orion_gpio_direction_input; |
395 | ochip->chip.get = orion_gpio_get; | 399 | ochip->chip.get = orion_gpio_get; |
diff --git a/arch/arm/plat-samsung/dev-backlight.c b/arch/arm/plat-samsung/dev-backlight.c index e657305644cc..a976c023b286 100644 --- a/arch/arm/plat-samsung/dev-backlight.c +++ b/arch/arm/plat-samsung/dev-backlight.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/pwm_backlight.h> | 17 | #include <linux/pwm_backlight.h> |
18 | #include <linux/slab.h> | ||
19 | 18 | ||
20 | #include <plat/devs.h> | 19 | #include <plat/devs.h> |
21 | #include <plat/gpio-cfg.h> | 20 | #include <plat/gpio-cfg.h> |
diff --git a/arch/arm/plat-samsung/include/plat/cpu-freq-core.h b/arch/arm/plat-samsung/include/plat/cpu-freq-core.h index dac4760c0f0a..95509d8eb140 100644 --- a/arch/arm/plat-samsung/include/plat/cpu-freq-core.h +++ b/arch/arm/plat-samsung/include/plat/cpu-freq-core.h | |||
@@ -202,14 +202,6 @@ extern int s3c_plltab_register(struct cpufreq_frequency_table *plls, | |||
202 | extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void); | 202 | extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void); |
203 | extern struct s3c_iotimings *s3c_cpufreq_getiotimings(void); | 203 | extern struct s3c_iotimings *s3c_cpufreq_getiotimings(void); |
204 | 204 | ||
205 | extern void s3c2410_iotiming_debugfs(struct seq_file *seq, | ||
206 | struct s3c_cpufreq_config *cfg, | ||
207 | union s3c_iobank *iob); | ||
208 | |||
209 | extern void s3c2412_iotiming_debugfs(struct seq_file *seq, | ||
210 | struct s3c_cpufreq_config *cfg, | ||
211 | union s3c_iobank *iob); | ||
212 | |||
213 | #ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS | 205 | #ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS |
214 | #define s3c_cpufreq_debugfs_call(x) x | 206 | #define s3c_cpufreq_debugfs_call(x) x |
215 | #else | 207 | #else |
@@ -226,6 +218,10 @@ extern void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg); | |||
226 | extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg); | 218 | extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg); |
227 | 219 | ||
228 | #ifdef CONFIG_S3C2410_IOTIMING | 220 | #ifdef CONFIG_S3C2410_IOTIMING |
221 | extern void s3c2410_iotiming_debugfs(struct seq_file *seq, | ||
222 | struct s3c_cpufreq_config *cfg, | ||
223 | union s3c_iobank *iob); | ||
224 | |||
229 | extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg, | 225 | extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg, |
230 | struct s3c_iotimings *iot); | 226 | struct s3c_iotimings *iot); |
231 | 227 | ||
@@ -235,6 +231,7 @@ extern int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg, | |||
235 | extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg, | 231 | extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg, |
236 | struct s3c_iotimings *iot); | 232 | struct s3c_iotimings *iot); |
237 | #else | 233 | #else |
234 | #define s3c2410_iotiming_debugfs NULL | ||
238 | #define s3c2410_iotiming_calc NULL | 235 | #define s3c2410_iotiming_calc NULL |
239 | #define s3c2410_iotiming_get NULL | 236 | #define s3c2410_iotiming_get NULL |
240 | #define s3c2410_iotiming_set NULL | 237 | #define s3c2410_iotiming_set NULL |
@@ -242,8 +239,10 @@ extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg, | |||
242 | 239 | ||
243 | /* S3C2412 compatible routines */ | 240 | /* S3C2412 compatible routines */ |
244 | 241 | ||
245 | extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, | 242 | #ifdef CONFIG_S3C2412_IOTIMING |
246 | struct s3c_iotimings *timings); | 243 | extern void s3c2412_iotiming_debugfs(struct seq_file *seq, |
244 | struct s3c_cpufreq_config *cfg, | ||
245 | union s3c_iobank *iob); | ||
247 | 246 | ||
248 | extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, | 247 | extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, |
249 | struct s3c_iotimings *timings); | 248 | struct s3c_iotimings *timings); |
@@ -253,6 +252,12 @@ extern int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg, | |||
253 | 252 | ||
254 | extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg, | 253 | extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg, |
255 | struct s3c_iotimings *iot); | 254 | struct s3c_iotimings *iot); |
255 | #else | ||
256 | #define s3c2412_iotiming_debugfs NULL | ||
257 | #define s3c2412_iotiming_calc NULL | ||
258 | #define s3c2412_iotiming_get NULL | ||
259 | #define s3c2412_iotiming_set NULL | ||
260 | #endif /* CONFIG_S3C2412_IOTIMING */ | ||
256 | 261 | ||
257 | #ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUG | 262 | #ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUG |
258 | #define s3c_freq_dbg(x...) printk(KERN_INFO x) | 263 | #define s3c_freq_dbg(x...) printk(KERN_INFO x) |
diff --git a/arch/ia64/include/asm/cputime.h b/arch/ia64/include/asm/cputime.h index 6073b187528a..5a274af31b2b 100644 --- a/arch/ia64/include/asm/cputime.h +++ b/arch/ia64/include/asm/cputime.h | |||
@@ -60,6 +60,7 @@ typedef u64 cputime64_t; | |||
60 | */ | 60 | */ |
61 | #define cputime_to_usecs(__ct) ((__ct) / NSEC_PER_USEC) | 61 | #define cputime_to_usecs(__ct) ((__ct) / NSEC_PER_USEC) |
62 | #define usecs_to_cputime(__usecs) ((__usecs) * NSEC_PER_USEC) | 62 | #define usecs_to_cputime(__usecs) ((__usecs) * NSEC_PER_USEC) |
63 | #define usecs_to_cputime64(__usecs) usecs_to_cputime(__usecs) | ||
63 | 64 | ||
64 | /* | 65 | /* |
65 | * Convert cputime <-> seconds | 66 | * Convert cputime <-> seconds |
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 43f984e93970..303192fc9260 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
@@ -350,10 +350,12 @@ | |||
350 | #define __NR_clock_adjtime 342 | 350 | #define __NR_clock_adjtime 342 |
351 | #define __NR_syncfs 343 | 351 | #define __NR_syncfs 343 |
352 | #define __NR_setns 344 | 352 | #define __NR_setns 344 |
353 | #define __NR_process_vm_readv 345 | ||
354 | #define __NR_process_vm_writev 346 | ||
353 | 355 | ||
354 | #ifdef __KERNEL__ | 356 | #ifdef __KERNEL__ |
355 | 357 | ||
356 | #define NR_syscalls 345 | 358 | #define NR_syscalls 347 |
357 | 359 | ||
358 | #define __ARCH_WANT_IPC_PARSE_VERSION | 360 | #define __ARCH_WANT_IPC_PARSE_VERSION |
359 | #define __ARCH_WANT_OLD_READDIR | 361 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S index c468f2edaa85..ce827b376110 100644 --- a/arch/m68k/kernel/syscalltable.S +++ b/arch/m68k/kernel/syscalltable.S | |||
@@ -365,4 +365,6 @@ ENTRY(sys_call_table) | |||
365 | .long sys_clock_adjtime | 365 | .long sys_clock_adjtime |
366 | .long sys_syncfs | 366 | .long sys_syncfs |
367 | .long sys_setns | 367 | .long sys_setns |
368 | .long sys_process_vm_readv /* 345 */ | ||
369 | .long sys_process_vm_writev | ||
368 | 370 | ||
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index 4f2971bcf8e5..315fc0b250f8 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c | |||
@@ -623,7 +623,7 @@ static int mipspmu_event_init(struct perf_event *event) | |||
623 | if (!atomic_inc_not_zero(&active_events)) { | 623 | if (!atomic_inc_not_zero(&active_events)) { |
624 | if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) { | 624 | if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) { |
625 | atomic_dec(&active_events); | 625 | atomic_dec(&active_events); |
626 | return -ENOSPC; | 626 | return -EINVAL; |
627 | } | 627 | } |
628 | 628 | ||
629 | mutex_lock(&pmu_reserve_mutex); | 629 | mutex_lock(&pmu_reserve_mutex); |
@@ -732,15 +732,15 @@ static int validate_group(struct perf_event *event) | |||
732 | memset(&fake_cpuc, 0, sizeof(fake_cpuc)); | 732 | memset(&fake_cpuc, 0, sizeof(fake_cpuc)); |
733 | 733 | ||
734 | if (!validate_event(&fake_cpuc, leader)) | 734 | if (!validate_event(&fake_cpuc, leader)) |
735 | return -ENOSPC; | 735 | return -EINVAL; |
736 | 736 | ||
737 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { | 737 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { |
738 | if (!validate_event(&fake_cpuc, sibling)) | 738 | if (!validate_event(&fake_cpuc, sibling)) |
739 | return -ENOSPC; | 739 | return -EINVAL; |
740 | } | 740 | } |
741 | 741 | ||
742 | if (!validate_event(&fake_cpuc, event)) | 742 | if (!validate_event(&fake_cpuc, event)) |
743 | return -ENOSPC; | 743 | return -EINVAL; |
744 | 744 | ||
745 | return 0; | 745 | return 0; |
746 | } | 746 | } |
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index 1cf20bdfbeca..98b7c4b49c9d 100644 --- a/arch/powerpc/include/asm/cputime.h +++ b/arch/powerpc/include/asm/cputime.h | |||
@@ -150,6 +150,8 @@ static inline cputime_t usecs_to_cputime(const unsigned long us) | |||
150 | return ct; | 150 | return ct; |
151 | } | 151 | } |
152 | 152 | ||
153 | #define usecs_to_cputime64(us) usecs_to_cputime(us) | ||
154 | |||
153 | /* | 155 | /* |
154 | * Convert cputime <-> seconds | 156 | * Convert cputime <-> seconds |
155 | */ | 157 | */ |
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index d4df013ad779..69c7377d2071 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
@@ -381,39 +381,6 @@ static inline bool kvmppc_critical_section(struct kvm_vcpu *vcpu) | |||
381 | } | 381 | } |
382 | #endif | 382 | #endif |
383 | 383 | ||
384 | static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r, | ||
385 | unsigned long pte_index) | ||
386 | { | ||
387 | unsigned long rb, va_low; | ||
388 | |||
389 | rb = (v & ~0x7fUL) << 16; /* AVA field */ | ||
390 | va_low = pte_index >> 3; | ||
391 | if (v & HPTE_V_SECONDARY) | ||
392 | va_low = ~va_low; | ||
393 | /* xor vsid from AVA */ | ||
394 | if (!(v & HPTE_V_1TB_SEG)) | ||
395 | va_low ^= v >> 12; | ||
396 | else | ||
397 | va_low ^= v >> 24; | ||
398 | va_low &= 0x7ff; | ||
399 | if (v & HPTE_V_LARGE) { | ||
400 | rb |= 1; /* L field */ | ||
401 | if (cpu_has_feature(CPU_FTR_ARCH_206) && | ||
402 | (r & 0xff000)) { | ||
403 | /* non-16MB large page, must be 64k */ | ||
404 | /* (masks depend on page size) */ | ||
405 | rb |= 0x1000; /* page encoding in LP field */ | ||
406 | rb |= (va_low & 0x7f) << 16; /* 7b of VA in AVA/LP field */ | ||
407 | rb |= (va_low & 0xfe); /* AVAL field (P7 doesn't seem to care) */ | ||
408 | } | ||
409 | } else { | ||
410 | /* 4kB page */ | ||
411 | rb |= (va_low & 0x7ff) << 12; /* remaining 11b of VA */ | ||
412 | } | ||
413 | rb |= (v >> 54) & 0x300; /* B field */ | ||
414 | return rb; | ||
415 | } | ||
416 | |||
417 | /* Magic register values loaded into r3 and r4 before the 'sc' assembly | 384 | /* Magic register values loaded into r3 and r4 before the 'sc' assembly |
418 | * instruction for the OSI hypercalls */ | 385 | * instruction for the OSI hypercalls */ |
419 | #define OSI_SC_MAGIC_R3 0x113724FA | 386 | #define OSI_SC_MAGIC_R3 0x113724FA |
diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h index e43fe42b9875..d0ac94f98f9e 100644 --- a/arch/powerpc/include/asm/kvm_book3s_64.h +++ b/arch/powerpc/include/asm/kvm_book3s_64.h | |||
@@ -29,4 +29,37 @@ static inline struct kvmppc_book3s_shadow_vcpu *to_svcpu(struct kvm_vcpu *vcpu) | |||
29 | 29 | ||
30 | #define SPAPR_TCE_SHIFT 12 | 30 | #define SPAPR_TCE_SHIFT 12 |
31 | 31 | ||
32 | static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r, | ||
33 | unsigned long pte_index) | ||
34 | { | ||
35 | unsigned long rb, va_low; | ||
36 | |||
37 | rb = (v & ~0x7fUL) << 16; /* AVA field */ | ||
38 | va_low = pte_index >> 3; | ||
39 | if (v & HPTE_V_SECONDARY) | ||
40 | va_low = ~va_low; | ||
41 | /* xor vsid from AVA */ | ||
42 | if (!(v & HPTE_V_1TB_SEG)) | ||
43 | va_low ^= v >> 12; | ||
44 | else | ||
45 | va_low ^= v >> 24; | ||
46 | va_low &= 0x7ff; | ||
47 | if (v & HPTE_V_LARGE) { | ||
48 | rb |= 1; /* L field */ | ||
49 | if (cpu_has_feature(CPU_FTR_ARCH_206) && | ||
50 | (r & 0xff000)) { | ||
51 | /* non-16MB large page, must be 64k */ | ||
52 | /* (masks depend on page size) */ | ||
53 | rb |= 0x1000; /* page encoding in LP field */ | ||
54 | rb |= (va_low & 0x7f) << 16; /* 7b of VA in AVA/LP field */ | ||
55 | rb |= (va_low & 0xfe); /* AVAL field (P7 doesn't seem to care) */ | ||
56 | } | ||
57 | } else { | ||
58 | /* 4kB page */ | ||
59 | rb |= (va_low & 0x7ff) << 12; /* remaining 11b of VA */ | ||
60 | } | ||
61 | rb |= (v >> 54) & 0x300; /* B field */ | ||
62 | return rb; | ||
63 | } | ||
64 | |||
32 | #endif /* __ASM_KVM_BOOK3S_64_H__ */ | 65 | #endif /* __ASM_KVM_BOOK3S_64_H__ */ |
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 0cb137a9b038..336983da9e72 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
@@ -538,7 +538,7 @@ static void kvmppc_start_thread(struct kvm_vcpu *vcpu) | |||
538 | tpaca->kvm_hstate.napping = 0; | 538 | tpaca->kvm_hstate.napping = 0; |
539 | vcpu->cpu = vc->pcpu; | 539 | vcpu->cpu = vc->pcpu; |
540 | smp_wmb(); | 540 | smp_wmb(); |
541 | #ifdef CONFIG_PPC_ICP_NATIVE | 541 | #if defined(CONFIG_PPC_ICP_NATIVE) && defined(CONFIG_SMP) |
542 | if (vcpu->arch.ptid) { | 542 | if (vcpu->arch.ptid) { |
543 | tpaca->cpu_start = 0x80; | 543 | tpaca->cpu_start = 0x80; |
544 | wmb(); | 544 | wmb(); |
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 3c791e1eb675..e2cfb9e1e20e 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c | |||
@@ -658,10 +658,12 @@ program_interrupt: | |||
658 | ulong cmd = kvmppc_get_gpr(vcpu, 3); | 658 | ulong cmd = kvmppc_get_gpr(vcpu, 3); |
659 | int i; | 659 | int i; |
660 | 660 | ||
661 | #ifdef CONFIG_KVM_BOOK3S_64_PR | ||
661 | if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) { | 662 | if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) { |
662 | r = RESUME_GUEST; | 663 | r = RESUME_GUEST; |
663 | break; | 664 | break; |
664 | } | 665 | } |
666 | #endif | ||
665 | 667 | ||
666 | run->papr_hcall.nr = cmd; | 668 | run->papr_hcall.nr = cmd; |
667 | for (i = 0; i < 9; ++i) { | 669 | for (i = 0; i < 9; ++i) { |
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c index 26d20903f2bc..8c0d45a6faf7 100644 --- a/arch/powerpc/kvm/e500.c +++ b/arch/powerpc/kvm/e500.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kvm_host.h> | 15 | #include <linux/kvm_host.h> |
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | #include <linux/export.h> | ||
18 | 19 | ||
19 | #include <asm/reg.h> | 20 | #include <asm/reg.h> |
20 | #include <asm/cputable.h> | 21 | #include <asm/cputable.h> |
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 081434878296..b9acaaa175d8 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
@@ -87,6 +87,8 @@ usecs_to_cputime(const unsigned int m) | |||
87 | return (cputime_t) m * 4096; | 87 | return (cputime_t) m * 4096; |
88 | } | 88 | } |
89 | 89 | ||
90 | #define usecs_to_cputime64(m) usecs_to_cputime(m) | ||
91 | |||
90 | /* | 92 | /* |
91 | * Convert cputime to milliseconds and back. | 93 | * Convert cputime to milliseconds and back. |
92 | */ | 94 | */ |
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 524d23b8610c..4f289ff0b7fe 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -599,10 +599,10 @@ static inline pgste_t pgste_update_all(pte_t *ptep, pgste_t pgste) | |||
599 | skey = page_get_storage_key(address); | 599 | skey = page_get_storage_key(address); |
600 | bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED); | 600 | bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED); |
601 | /* Clear page changed & referenced bit in the storage key */ | 601 | /* Clear page changed & referenced bit in the storage key */ |
602 | if (bits) { | 602 | if (bits & _PAGE_CHANGED) |
603 | skey ^= bits; | 603 | page_set_storage_key(address, skey ^ bits, 1); |
604 | page_set_storage_key(address, skey, 1); | 604 | else if (bits) |
605 | } | 605 | page_reset_referenced(address); |
606 | /* Transfer page changed & referenced bit to guest bits in pgste */ | 606 | /* Transfer page changed & referenced bit to guest bits in pgste */ |
607 | pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */ | 607 | pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */ |
608 | /* Get host changed & referenced bits from pgste */ | 608 | /* Get host changed & referenced bits from pgste */ |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 450931a45b68..573bc29551ef 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -296,13 +296,6 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) | |||
296 | ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA)))) | 296 | ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA)))) |
297 | /* Invalid psw mask. */ | 297 | /* Invalid psw mask. */ |
298 | return -EINVAL; | 298 | return -EINVAL; |
299 | if (addr == (addr_t) &dummy->regs.psw.addr) | ||
300 | /* | ||
301 | * The debugger changed the instruction address, | ||
302 | * reset system call restart, see signal.c:do_signal | ||
303 | */ | ||
304 | task_thread_info(child)->system_call = 0; | ||
305 | |||
306 | *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data; | 299 | *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data; |
307 | 300 | ||
308 | } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { | 301 | } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { |
@@ -614,11 +607,6 @@ static int __poke_user_compat(struct task_struct *child, | |||
614 | /* Transfer 31 bit amode bit to psw mask. */ | 607 | /* Transfer 31 bit amode bit to psw mask. */ |
615 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) | | 608 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) | |
616 | (__u64)(tmp & PSW32_ADDR_AMODE); | 609 | (__u64)(tmp & PSW32_ADDR_AMODE); |
617 | /* | ||
618 | * The debugger changed the instruction address, | ||
619 | * reset system call restart, see signal.c:do_signal | ||
620 | */ | ||
621 | task_thread_info(child)->system_call = 0; | ||
622 | } else { | 610 | } else { |
623 | /* gpr 0-15 */ | 611 | /* gpr 0-15 */ |
624 | *(__u32*)((addr_t) ®s->psw + addr*2 + 4) = tmp; | 612 | *(__u32*)((addr_t) ®s->psw + addr*2 + 4) = tmp; |
@@ -905,6 +893,14 @@ static int s390_last_break_get(struct task_struct *target, | |||
905 | return 0; | 893 | return 0; |
906 | } | 894 | } |
907 | 895 | ||
896 | static int s390_last_break_set(struct task_struct *target, | ||
897 | const struct user_regset *regset, | ||
898 | unsigned int pos, unsigned int count, | ||
899 | const void *kbuf, const void __user *ubuf) | ||
900 | { | ||
901 | return 0; | ||
902 | } | ||
903 | |||
908 | #endif | 904 | #endif |
909 | 905 | ||
910 | static int s390_system_call_get(struct task_struct *target, | 906 | static int s390_system_call_get(struct task_struct *target, |
@@ -951,6 +947,7 @@ static const struct user_regset s390_regsets[] = { | |||
951 | .size = sizeof(long), | 947 | .size = sizeof(long), |
952 | .align = sizeof(long), | 948 | .align = sizeof(long), |
953 | .get = s390_last_break_get, | 949 | .get = s390_last_break_get, |
950 | .set = s390_last_break_set, | ||
954 | }, | 951 | }, |
955 | #endif | 952 | #endif |
956 | [REGSET_SYSTEM_CALL] = { | 953 | [REGSET_SYSTEM_CALL] = { |
@@ -1116,6 +1113,14 @@ static int s390_compat_last_break_get(struct task_struct *target, | |||
1116 | return 0; | 1113 | return 0; |
1117 | } | 1114 | } |
1118 | 1115 | ||
1116 | static int s390_compat_last_break_set(struct task_struct *target, | ||
1117 | const struct user_regset *regset, | ||
1118 | unsigned int pos, unsigned int count, | ||
1119 | const void *kbuf, const void __user *ubuf) | ||
1120 | { | ||
1121 | return 0; | ||
1122 | } | ||
1123 | |||
1119 | static const struct user_regset s390_compat_regsets[] = { | 1124 | static const struct user_regset s390_compat_regsets[] = { |
1120 | [REGSET_GENERAL] = { | 1125 | [REGSET_GENERAL] = { |
1121 | .core_note_type = NT_PRSTATUS, | 1126 | .core_note_type = NT_PRSTATUS, |
@@ -1139,6 +1144,7 @@ static const struct user_regset s390_compat_regsets[] = { | |||
1139 | .size = sizeof(long), | 1144 | .size = sizeof(long), |
1140 | .align = sizeof(long), | 1145 | .align = sizeof(long), |
1141 | .get = s390_compat_last_break_get, | 1146 | .get = s390_compat_last_break_get, |
1147 | .set = s390_compat_last_break_set, | ||
1142 | }, | 1148 | }, |
1143 | [REGSET_SYSTEM_CALL] = { | 1149 | [REGSET_SYSTEM_CALL] = { |
1144 | .core_note_type = NT_S390_SYSTEM_CALL, | 1150 | .core_note_type = NT_S390_SYSTEM_CALL, |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index e58a462949b1..e54c4ff8abaa 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -579,7 +579,7 @@ static unsigned long __init find_crash_base(unsigned long crash_size, | |||
579 | *msg = "first memory chunk must be at least crashkernel size"; | 579 | *msg = "first memory chunk must be at least crashkernel size"; |
580 | return 0; | 580 | return 0; |
581 | } | 581 | } |
582 | if (is_kdump_kernel() && (crash_size == OLDMEM_SIZE)) | 582 | if (OLDMEM_BASE && crash_size == OLDMEM_SIZE) |
583 | return OLDMEM_BASE; | 583 | return OLDMEM_BASE; |
584 | 584 | ||
585 | for (i = MEMORY_CHUNKS - 1; i >= 0; i--) { | 585 | for (i = MEMORY_CHUNKS - 1; i >= 0; i--) { |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 05a85bc14c98..7f6f9f354545 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -460,9 +460,9 @@ void do_signal(struct pt_regs *regs) | |||
460 | regs->svc_code >> 16); | 460 | regs->svc_code >> 16); |
461 | break; | 461 | break; |
462 | } | 462 | } |
463 | /* No longer in a system call */ | ||
464 | clear_thread_flag(TIF_SYSCALL); | ||
465 | } | 463 | } |
464 | /* No longer in a system call */ | ||
465 | clear_thread_flag(TIF_SYSCALL); | ||
466 | 466 | ||
467 | if ((is_compat_task() ? | 467 | if ((is_compat_task() ? |
468 | handle_signal32(signr, &ka, &info, oldset, regs) : | 468 | handle_signal32(signr, &ka, &info, oldset, regs) : |
@@ -486,6 +486,7 @@ void do_signal(struct pt_regs *regs) | |||
486 | } | 486 | } |
487 | 487 | ||
488 | /* No handlers present - check for system call restart */ | 488 | /* No handlers present - check for system call restart */ |
489 | clear_thread_flag(TIF_SYSCALL); | ||
489 | if (current_thread_info()->system_call) { | 490 | if (current_thread_info()->system_call) { |
490 | regs->svc_code = current_thread_info()->system_call; | 491 | regs->svc_code = current_thread_info()->system_call; |
491 | switch (regs->gprs[2]) { | 492 | switch (regs->gprs[2]) { |
@@ -500,9 +501,6 @@ void do_signal(struct pt_regs *regs) | |||
500 | regs->gprs[2] = regs->orig_gpr2; | 501 | regs->gprs[2] = regs->orig_gpr2; |
501 | set_thread_flag(TIF_SYSCALL); | 502 | set_thread_flag(TIF_SYSCALL); |
502 | break; | 503 | break; |
503 | default: | ||
504 | clear_thread_flag(TIF_SYSCALL); | ||
505 | break; | ||
506 | } | 504 | } |
507 | } | 505 | } |
508 | 506 | ||
diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index 6efc18b5e60a..bd58b72454cf 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c | |||
@@ -88,7 +88,7 @@ static ssize_t hwsampler_write(struct file *file, char const __user *buf, | |||
88 | return -EINVAL; | 88 | return -EINVAL; |
89 | 89 | ||
90 | retval = oprofilefs_ulong_from_user(&val, buf, count); | 90 | retval = oprofilefs_ulong_from_user(&val, buf, count); |
91 | if (retval) | 91 | if (retval <= 0) |
92 | return retval; | 92 | return retval; |
93 | 93 | ||
94 | if (oprofile_started) | 94 | if (oprofile_started) |
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c index ec8c84c14b17..895e337c79b6 100644 --- a/arch/sh/boards/board-sh7757lcr.c +++ b/arch/sh/boards/board-sh7757lcr.c | |||
@@ -50,9 +50,9 @@ static struct platform_device heartbeat_device = { | |||
50 | #define GBECONT 0xffc10100 | 50 | #define GBECONT 0xffc10100 |
51 | #define GBECONT_RMII1 BIT(17) | 51 | #define GBECONT_RMII1 BIT(17) |
52 | #define GBECONT_RMII0 BIT(16) | 52 | #define GBECONT_RMII0 BIT(16) |
53 | static void sh7757_eth_set_mdio_gate(unsigned long addr) | 53 | static void sh7757_eth_set_mdio_gate(void *addr) |
54 | { | 54 | { |
55 | if ((addr & 0x00000fff) < 0x0800) | 55 | if (((unsigned long)addr & 0x00000fff) < 0x0800) |
56 | writel(readl(GBECONT) | GBECONT_RMII0, GBECONT); | 56 | writel(readl(GBECONT) | GBECONT_RMII0, GBECONT); |
57 | else | 57 | else |
58 | writel(readl(GBECONT) | GBECONT_RMII1, GBECONT); | 58 | writel(readl(GBECONT) | GBECONT_RMII1, GBECONT); |
@@ -116,9 +116,9 @@ static struct platform_device sh7757_eth1_device = { | |||
116 | }, | 116 | }, |
117 | }; | 117 | }; |
118 | 118 | ||
119 | static void sh7757_eth_giga_set_mdio_gate(unsigned long addr) | 119 | static void sh7757_eth_giga_set_mdio_gate(void *addr) |
120 | { | 120 | { |
121 | if ((addr & 0x00000fff) < 0x0800) { | 121 | if (((unsigned long)addr & 0x00000fff) < 0x0800) { |
122 | gpio_set_value(GPIO_PTT4, 1); | 122 | gpio_set_value(GPIO_PTT4, 1); |
123 | writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT); | 123 | writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT); |
124 | } else { | 124 | } else { |
@@ -210,8 +210,12 @@ static struct resource sh_mmcif_resources[] = { | |||
210 | }; | 210 | }; |
211 | 211 | ||
212 | static struct sh_mmcif_dma sh7757lcr_mmcif_dma = { | 212 | static struct sh_mmcif_dma sh7757lcr_mmcif_dma = { |
213 | .chan_priv_tx = SHDMA_SLAVE_MMCIF_TX, | 213 | .chan_priv_tx = { |
214 | .chan_priv_rx = SHDMA_SLAVE_MMCIF_RX, | 214 | .slave_id = SHDMA_SLAVE_MMCIF_TX, |
215 | }, | ||
216 | .chan_priv_rx = { | ||
217 | .slave_id = SHDMA_SLAVE_MMCIF_RX, | ||
218 | } | ||
215 | }; | 219 | }; |
216 | 220 | ||
217 | static struct sh_mmcif_plat_data sh_mmcif_plat = { | 221 | static struct sh_mmcif_plat_data sh_mmcif_plat = { |
diff --git a/arch/sh/oprofile/common.c b/arch/sh/oprofile/common.c index b4c2d2b946dd..e4dd5d5a1115 100644 --- a/arch/sh/oprofile/common.c +++ b/arch/sh/oprofile/common.c | |||
@@ -49,7 +49,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
49 | return oprofile_perf_init(ops); | 49 | return oprofile_perf_init(ops); |
50 | } | 50 | } |
51 | 51 | ||
52 | void __exit oprofile_arch_exit(void) | 52 | void oprofile_arch_exit(void) |
53 | { | 53 | { |
54 | oprofile_perf_exit(); | 54 | oprofile_perf_exit(); |
55 | kfree(sh_pmu_op_name); | 55 | kfree(sh_pmu_op_name); |
@@ -60,5 +60,5 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
60 | ops->backtrace = sh_backtrace; | 60 | ops->backtrace = sh_backtrace; |
61 | return -ENODEV; | 61 | return -ENODEV; |
62 | } | 62 | } |
63 | void __exit oprofile_arch_exit(void) {} | 63 | void oprofile_arch_exit(void) {} |
64 | #endif /* CONFIG_HW_PERF_EVENTS */ | 64 | #endif /* CONFIG_HW_PERF_EVENTS */ |
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 7429b47c3aca..381edcd5bc29 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c | |||
@@ -1181,13 +1181,11 @@ static int __devinit ds_probe(struct vio_dev *vdev, | |||
1181 | 1181 | ||
1182 | dp->rcv_buf_len = 4096; | 1182 | dp->rcv_buf_len = 4096; |
1183 | 1183 | ||
1184 | dp->ds_states = kzalloc(sizeof(ds_states_template), | 1184 | dp->ds_states = kmemdup(ds_states_template, |
1185 | GFP_KERNEL); | 1185 | sizeof(ds_states_template), GFP_KERNEL); |
1186 | if (!dp->ds_states) | 1186 | if (!dp->ds_states) |
1187 | goto out_free_rcv_buf; | 1187 | goto out_free_rcv_buf; |
1188 | 1188 | ||
1189 | memcpy(dp->ds_states, ds_states_template, | ||
1190 | sizeof(ds_states_template)); | ||
1191 | dp->num_ds_states = ARRAY_SIZE(ds_states_template); | 1189 | dp->num_ds_states = ARRAY_SIZE(ds_states_template); |
1192 | 1190 | ||
1193 | for (i = 0; i < dp->num_ds_states; i++) | 1191 | for (i = 0; i < dp->num_ds_states; i++) |
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index b272cda35a01..af5755d20fbe 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c | |||
@@ -849,10 +849,10 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm, | |||
849 | if (!irq) | 849 | if (!irq) |
850 | return -ENOMEM; | 850 | return -ENOMEM; |
851 | 851 | ||
852 | if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE)) | ||
853 | return -EINVAL; | ||
854 | if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID)) | 852 | if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID)) |
855 | return -EINVAL; | 853 | return -EINVAL; |
854 | if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE)) | ||
855 | return -EINVAL; | ||
856 | 856 | ||
857 | return irq; | 857 | return irq; |
858 | } | 858 | } |
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c index 46614807a57f..741df916c124 100644 --- a/arch/sparc/kernel/prom_common.c +++ b/arch/sparc/kernel/prom_common.c | |||
@@ -58,12 +58,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len | |||
58 | void *new_val; | 58 | void *new_val; |
59 | int err; | 59 | int err; |
60 | 60 | ||
61 | new_val = kmalloc(len, GFP_KERNEL); | 61 | new_val = kmemdup(val, len, GFP_KERNEL); |
62 | if (!new_val) | 62 | if (!new_val) |
63 | return -ENOMEM; | 63 | return -ENOMEM; |
64 | 64 | ||
65 | memcpy(new_val, val, len); | ||
66 | |||
67 | err = -ENODEV; | 65 | err = -ENODEV; |
68 | 66 | ||
69 | mutex_lock(&of_set_property_mutex); | 67 | mutex_lock(&of_set_property_mutex); |
diff --git a/arch/sparc/mm/btfixup.c b/arch/sparc/mm/btfixup.c index 5175ac2f4820..8a7f81743c12 100644 --- a/arch/sparc/mm/btfixup.c +++ b/arch/sparc/mm/btfixup.c | |||
@@ -302,8 +302,7 @@ void __init btfixup(void) | |||
302 | case 'i': /* INT */ | 302 | case 'i': /* INT */ |
303 | if ((insn & 0xc1c00000) == 0x01000000) /* %HI */ | 303 | if ((insn & 0xc1c00000) == 0x01000000) /* %HI */ |
304 | set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10)); | 304 | set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10)); |
305 | else if ((insn & 0x80002000) == 0x80002000 && | 305 | else if ((insn & 0x80002000) == 0x80002000) /* %LO */ |
306 | (insn & 0x01800000) != 0x01800000) /* %LO */ | ||
307 | set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff)); | 306 | set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff)); |
308 | else { | 307 | else { |
309 | prom_printf(insn_i, p, addr, insn); | 308 | prom_printf(insn_i, p, addr, insn); |
diff --git a/arch/tile/include/asm/irq.h b/arch/tile/include/asm/irq.h index 94e9a511de84..f80f8ceabc67 100644 --- a/arch/tile/include/asm/irq.h +++ b/arch/tile/include/asm/irq.h | |||
@@ -74,16 +74,6 @@ enum { | |||
74 | */ | 74 | */ |
75 | void tile_irq_activate(unsigned int irq, int tile_irq_type); | 75 | void tile_irq_activate(unsigned int irq, int tile_irq_type); |
76 | 76 | ||
77 | /* | ||
78 | * For onboard, non-PCI (e.g. TILE_IRQ_PERCPU) devices, drivers know | ||
79 | * how to use enable/disable_percpu_irq() to manage interrupts on each | ||
80 | * core. We can't use the generic enable/disable_irq() because they | ||
81 | * use a single reference count per irq, rather than per cpu per irq. | ||
82 | */ | ||
83 | void enable_percpu_irq(unsigned int irq); | ||
84 | void disable_percpu_irq(unsigned int irq); | ||
85 | |||
86 | |||
87 | void setup_irq_regs(void); | 77 | void setup_irq_regs(void); |
88 | 78 | ||
89 | #endif /* _ASM_TILE_IRQ_H */ | 79 | #endif /* _ASM_TILE_IRQ_H */ |
diff --git a/arch/tile/kernel/irq.c b/arch/tile/kernel/irq.c index aa0134db2dd6..02e628065012 100644 --- a/arch/tile/kernel/irq.c +++ b/arch/tile/kernel/irq.c | |||
@@ -152,14 +152,13 @@ void tile_dev_intr(struct pt_regs *regs, int intnum) | |||
152 | * Remove an irq from the disabled mask. If we're in an interrupt | 152 | * Remove an irq from the disabled mask. If we're in an interrupt |
153 | * context, defer enabling the HW interrupt until we leave. | 153 | * context, defer enabling the HW interrupt until we leave. |
154 | */ | 154 | */ |
155 | void enable_percpu_irq(unsigned int irq) | 155 | static void tile_irq_chip_enable(struct irq_data *d) |
156 | { | 156 | { |
157 | get_cpu_var(irq_disable_mask) &= ~(1UL << irq); | 157 | get_cpu_var(irq_disable_mask) &= ~(1UL << d->irq); |
158 | if (__get_cpu_var(irq_depth) == 0) | 158 | if (__get_cpu_var(irq_depth) == 0) |
159 | unmask_irqs(1UL << irq); | 159 | unmask_irqs(1UL << d->irq); |
160 | put_cpu_var(irq_disable_mask); | 160 | put_cpu_var(irq_disable_mask); |
161 | } | 161 | } |
162 | EXPORT_SYMBOL(enable_percpu_irq); | ||
163 | 162 | ||
164 | /* | 163 | /* |
165 | * Add an irq to the disabled mask. We disable the HW interrupt | 164 | * Add an irq to the disabled mask. We disable the HW interrupt |
@@ -167,13 +166,12 @@ EXPORT_SYMBOL(enable_percpu_irq); | |||
167 | * in an interrupt context, the return path is careful to avoid | 166 | * in an interrupt context, the return path is careful to avoid |
168 | * unmasking a newly disabled interrupt. | 167 | * unmasking a newly disabled interrupt. |
169 | */ | 168 | */ |
170 | void disable_percpu_irq(unsigned int irq) | 169 | static void tile_irq_chip_disable(struct irq_data *d) |
171 | { | 170 | { |
172 | get_cpu_var(irq_disable_mask) |= (1UL << irq); | 171 | get_cpu_var(irq_disable_mask) |= (1UL << d->irq); |
173 | mask_irqs(1UL << irq); | 172 | mask_irqs(1UL << d->irq); |
174 | put_cpu_var(irq_disable_mask); | 173 | put_cpu_var(irq_disable_mask); |
175 | } | 174 | } |
176 | EXPORT_SYMBOL(disable_percpu_irq); | ||
177 | 175 | ||
178 | /* Mask an interrupt. */ | 176 | /* Mask an interrupt. */ |
179 | static void tile_irq_chip_mask(struct irq_data *d) | 177 | static void tile_irq_chip_mask(struct irq_data *d) |
@@ -209,6 +207,8 @@ static void tile_irq_chip_eoi(struct irq_data *d) | |||
209 | 207 | ||
210 | static struct irq_chip tile_irq_chip = { | 208 | static struct irq_chip tile_irq_chip = { |
211 | .name = "tile_irq_chip", | 209 | .name = "tile_irq_chip", |
210 | .irq_enable = tile_irq_chip_enable, | ||
211 | .irq_disable = tile_irq_chip_disable, | ||
212 | .irq_ack = tile_irq_chip_ack, | 212 | .irq_ack = tile_irq_chip_ack, |
213 | .irq_eoi = tile_irq_chip_eoi, | 213 | .irq_eoi = tile_irq_chip_eoi, |
214 | .irq_mask = tile_irq_chip_mask, | 214 | .irq_mask = tile_irq_chip_mask, |
diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c index 658f2ce426a4..b3ed19f8779c 100644 --- a/arch/tile/kernel/pci-dma.c +++ b/arch/tile/kernel/pci-dma.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/dma-mapping.h> | 16 | #include <linux/dma-mapping.h> |
17 | #include <linux/vmalloc.h> | 17 | #include <linux/vmalloc.h> |
18 | #include <linux/export.h> | ||
18 | #include <asm/tlbflush.h> | 19 | #include <asm/tlbflush.h> |
19 | #include <asm/homecache.h> | 20 | #include <asm/homecache.h> |
20 | 21 | ||
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c index 2a8014cb1ff5..9d610d3fb11e 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/uaccess.h> | 26 | #include <linux/uaccess.h> |
27 | #include <linux/export.h> | ||
27 | 28 | ||
28 | #include <asm/processor.h> | 29 | #include <asm/processor.h> |
29 | #include <asm/sections.h> | 30 | #include <asm/sections.h> |
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c index b671a86f4515..602908268093 100644 --- a/arch/tile/kernel/sysfs.c +++ b/arch/tile/kernel/sysfs.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/cpu.h> | 18 | #include <linux/cpu.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/smp.h> | 20 | #include <linux/smp.h> |
21 | #include <linux/stat.h> | ||
21 | #include <hv/hypervisor.h> | 22 | #include <hv/hypervisor.h> |
22 | 23 | ||
23 | /* Return a string queried from the hypervisor, truncated to page size. */ | 24 | /* Return a string queried from the hypervisor, truncated to page size. */ |
diff --git a/arch/tile/lib/exports.c b/arch/tile/lib/exports.c index a87d2a859ba9..2a81d32de0da 100644 --- a/arch/tile/lib/exports.c +++ b/arch/tile/lib/exports.c | |||
@@ -39,6 +39,9 @@ EXPORT_SYMBOL(finv_user_asm); | |||
39 | EXPORT_SYMBOL(current_text_addr); | 39 | EXPORT_SYMBOL(current_text_addr); |
40 | EXPORT_SYMBOL(dump_stack); | 40 | EXPORT_SYMBOL(dump_stack); |
41 | 41 | ||
42 | /* arch/tile/kernel/head.S */ | ||
43 | EXPORT_SYMBOL(empty_zero_page); | ||
44 | |||
42 | /* arch/tile/lib/, various memcpy files */ | 45 | /* arch/tile/lib/, various memcpy files */ |
43 | EXPORT_SYMBOL(memcpy); | 46 | EXPORT_SYMBOL(memcpy); |
44 | EXPORT_SYMBOL(__copy_to_user_inatomic); | 47 | EXPORT_SYMBOL(__copy_to_user_inatomic); |
diff --git a/arch/tile/mm/homecache.c b/arch/tile/mm/homecache.c index cbe6f4f9eca3..1cc6ae477c98 100644 --- a/arch/tile/mm/homecache.c +++ b/arch/tile/mm/homecache.c | |||
@@ -449,9 +449,12 @@ void homecache_free_pages(unsigned long addr, unsigned int order) | |||
449 | VM_BUG_ON(!virt_addr_valid((void *)addr)); | 449 | VM_BUG_ON(!virt_addr_valid((void *)addr)); |
450 | page = virt_to_page((void *)addr); | 450 | page = virt_to_page((void *)addr); |
451 | if (put_page_testzero(page)) { | 451 | if (put_page_testzero(page)) { |
452 | int pages = (1 << order); | ||
453 | homecache_change_page_home(page, order, initial_page_home()); | 452 | homecache_change_page_home(page, order, initial_page_home()); |
454 | while (pages--) | 453 | if (order == 0) { |
455 | __free_page(page++); | 454 | free_hot_cold_page(page, 0); |
455 | } else { | ||
456 | init_page_count(page); | ||
457 | __free_pages(page, order); | ||
458 | } | ||
456 | } | 459 | } |
457 | } | 460 | } |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cb9a1044a771..efb42949cc09 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -390,7 +390,7 @@ config X86_INTEL_CE | |||
390 | This option compiles in support for the CE4100 SOC for settop | 390 | This option compiles in support for the CE4100 SOC for settop |
391 | boxes and media devices. | 391 | boxes and media devices. |
392 | 392 | ||
393 | config X86_INTEL_MID | 393 | config X86_WANT_INTEL_MID |
394 | bool "Intel MID platform support" | 394 | bool "Intel MID platform support" |
395 | depends on X86_32 | 395 | depends on X86_32 |
396 | depends on X86_EXTENDED_PLATFORM | 396 | depends on X86_EXTENDED_PLATFORM |
@@ -399,7 +399,10 @@ config X86_INTEL_MID | |||
399 | systems which do not have the PCI legacy interfaces (Moorestown, | 399 | systems which do not have the PCI legacy interfaces (Moorestown, |
400 | Medfield). If you are building for a PC class system say N here. | 400 | Medfield). If you are building for a PC class system say N here. |
401 | 401 | ||
402 | if X86_INTEL_MID | 402 | if X86_WANT_INTEL_MID |
403 | |||
404 | config X86_INTEL_MID | ||
405 | bool | ||
403 | 406 | ||
404 | config X86_MRST | 407 | config X86_MRST |
405 | bool "Moorestown MID platform" | 408 | bool "Moorestown MID platform" |
@@ -411,6 +414,7 @@ config X86_MRST | |||
411 | select SPI | 414 | select SPI |
412 | select INTEL_SCU_IPC | 415 | select INTEL_SCU_IPC |
413 | select X86_PLATFORM_DEVICES | 416 | select X86_PLATFORM_DEVICES |
417 | select X86_INTEL_MID | ||
414 | ---help--- | 418 | ---help--- |
415 | Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin | 419 | Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin |
416 | Internet Device(MID) platform. Moorestown consists of two chips: | 420 | Internet Device(MID) platform. Moorestown consists of two chips: |
diff --git a/arch/x86/include/asm/intel_scu_ipc.h b/arch/x86/include/asm/intel_scu_ipc.h index 4420993acc47..925b605eb5c6 100644 --- a/arch/x86/include/asm/intel_scu_ipc.h +++ b/arch/x86/include/asm/intel_scu_ipc.h | |||
@@ -3,11 +3,15 @@ | |||
3 | 3 | ||
4 | #include <linux/notifier.h> | 4 | #include <linux/notifier.h> |
5 | 5 | ||
6 | #define IPCMSG_VRTC 0xFA /* Set vRTC device */ | 6 | #define IPCMSG_WARM_RESET 0xF0 |
7 | 7 | #define IPCMSG_COLD_RESET 0xF1 | |
8 | /* Command id associated with message IPCMSG_VRTC */ | 8 | #define IPCMSG_SOFT_RESET 0xF2 |
9 | #define IPC_CMD_VRTC_SETTIME 1 /* Set time */ | 9 | #define IPCMSG_COLD_BOOT 0xF3 |
10 | #define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */ | 10 | |
11 | #define IPCMSG_VRTC 0xFA /* Set vRTC device */ | ||
12 | /* Command id associated with message IPCMSG_VRTC */ | ||
13 | #define IPC_CMD_VRTC_SETTIME 1 /* Set time */ | ||
14 | #define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */ | ||
11 | 15 | ||
12 | /* Read single register */ | 16 | /* Read single register */ |
13 | int intel_scu_ipc_ioread8(u16 addr, u8 *data); | 17 | int intel_scu_ipc_ioread8(u16 addr, u8 *data); |
diff --git a/arch/x86/include/asm/mrst.h b/arch/x86/include/asm/mrst.h index e6283129c821..93f79094c224 100644 --- a/arch/x86/include/asm/mrst.h +++ b/arch/x86/include/asm/mrst.h | |||
@@ -31,11 +31,20 @@ enum mrst_cpu_type { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | extern enum mrst_cpu_type __mrst_cpu_chip; | 33 | extern enum mrst_cpu_type __mrst_cpu_chip; |
34 | |||
35 | #ifdef CONFIG_X86_INTEL_MID | ||
36 | |||
34 | static inline enum mrst_cpu_type mrst_identify_cpu(void) | 37 | static inline enum mrst_cpu_type mrst_identify_cpu(void) |
35 | { | 38 | { |
36 | return __mrst_cpu_chip; | 39 | return __mrst_cpu_chip; |
37 | } | 40 | } |
38 | 41 | ||
42 | #else /* !CONFIG_X86_INTEL_MID */ | ||
43 | |||
44 | #define mrst_identify_cpu() (0) | ||
45 | |||
46 | #endif /* !CONFIG_X86_INTEL_MID */ | ||
47 | |||
39 | enum mrst_timer_options { | 48 | enum mrst_timer_options { |
40 | MRST_TIMER_DEFAULT, | 49 | MRST_TIMER_DEFAULT, |
41 | MRST_TIMER_APBT_ONLY, | 50 | MRST_TIMER_APBT_ONLY, |
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 084ef95274cd..95203d40ffdd 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h | |||
@@ -169,7 +169,14 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high) | |||
169 | return native_write_msr_safe(msr, low, high); | 169 | return native_write_msr_safe(msr, low, high); |
170 | } | 170 | } |
171 | 171 | ||
172 | /* rdmsr with exception handling */ | 172 | /* |
173 | * rdmsr with exception handling. | ||
174 | * | ||
175 | * Please note that the exception handling works only after we've | ||
176 | * switched to the "smart" #GP handler in trap_init() which knows about | ||
177 | * exception tables - using this macro earlier than that causes machine | ||
178 | * hangs on boxes which do not implement the @msr in the first argument. | ||
179 | */ | ||
173 | #define rdmsr_safe(msr, p1, p2) \ | 180 | #define rdmsr_safe(msr, p1, p2) \ |
174 | ({ \ | 181 | ({ \ |
175 | int __err; \ | 182 | int __err; \ |
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h index c2ff2a1d845e..2d2f01ce6dcb 100644 --- a/arch/x86/include/asm/system.h +++ b/arch/x86/include/asm/system.h | |||
@@ -401,6 +401,7 @@ extern unsigned long arch_align_stack(unsigned long sp); | |||
401 | extern void free_init_pages(char *what, unsigned long begin, unsigned long end); | 401 | extern void free_init_pages(char *what, unsigned long begin, unsigned long end); |
402 | 402 | ||
403 | void default_idle(void); | 403 | void default_idle(void); |
404 | bool set_pm_idle_to_default(void); | ||
404 | 405 | ||
405 | void stop_this_cpu(void *dummy); | 406 | void stop_this_cpu(void *dummy); |
406 | 407 | ||
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h index fa7b9176b76c..431793e5d484 100644 --- a/arch/x86/include/asm/timer.h +++ b/arch/x86/include/asm/timer.h | |||
@@ -32,6 +32,22 @@ extern int no_timer_check; | |||
32 | * (mathieu.desnoyers@polymtl.ca) | 32 | * (mathieu.desnoyers@polymtl.ca) |
33 | * | 33 | * |
34 | * -johnstul@us.ibm.com "math is hard, lets go shopping!" | 34 | * -johnstul@us.ibm.com "math is hard, lets go shopping!" |
35 | * | ||
36 | * In: | ||
37 | * | ||
38 | * ns = cycles * cyc2ns_scale / SC | ||
39 | * | ||
40 | * Although we may still have enough bits to store the value of ns, | ||
41 | * in some cases, we may not have enough bits to store cycles * cyc2ns_scale, | ||
42 | * leading to an incorrect result. | ||
43 | * | ||
44 | * To avoid this, we can decompose 'cycles' into quotient and remainder | ||
45 | * of division by SC. Then, | ||
46 | * | ||
47 | * ns = (quot * SC + rem) * cyc2ns_scale / SC | ||
48 | * = quot * cyc2ns_scale + (rem * cyc2ns_scale) / SC | ||
49 | * | ||
50 | * - sqazi@google.com | ||
35 | */ | 51 | */ |
36 | 52 | ||
37 | DECLARE_PER_CPU(unsigned long, cyc2ns); | 53 | DECLARE_PER_CPU(unsigned long, cyc2ns); |
@@ -41,9 +57,14 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset); | |||
41 | 57 | ||
42 | static inline unsigned long long __cycles_2_ns(unsigned long long cyc) | 58 | static inline unsigned long long __cycles_2_ns(unsigned long long cyc) |
43 | { | 59 | { |
60 | unsigned long long quot; | ||
61 | unsigned long long rem; | ||
44 | int cpu = smp_processor_id(); | 62 | int cpu = smp_processor_id(); |
45 | unsigned long long ns = per_cpu(cyc2ns_offset, cpu); | 63 | unsigned long long ns = per_cpu(cyc2ns_offset, cpu); |
46 | ns += cyc * per_cpu(cyc2ns, cpu) >> CYC2NS_SCALE_FACTOR; | 64 | quot = (cyc >> CYC2NS_SCALE_FACTOR); |
65 | rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1); | ||
66 | ns += quot * per_cpu(cyc2ns, cpu) + | ||
67 | ((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR); | ||
47 | return ns; | 68 | return ns; |
48 | } | 69 | } |
49 | 70 | ||
diff --git a/arch/x86/include/asm/uv/uv_mmrs.h b/arch/x86/include/asm/uv/uv_mmrs.h index 10474fb1185d..cf1d73643f60 100644 --- a/arch/x86/include/asm/uv/uv_mmrs.h +++ b/arch/x86/include/asm/uv/uv_mmrs.h | |||
@@ -57,6 +57,7 @@ | |||
57 | 57 | ||
58 | #define UV1_HUB_PART_NUMBER 0x88a5 | 58 | #define UV1_HUB_PART_NUMBER 0x88a5 |
59 | #define UV2_HUB_PART_NUMBER 0x8eb8 | 59 | #define UV2_HUB_PART_NUMBER 0x8eb8 |
60 | #define UV2_HUB_PART_NUMBER_X 0x1111 | ||
60 | 61 | ||
61 | /* Compat: if this #define is present, UV headers support UV2 */ | 62 | /* Compat: if this #define is present, UV headers support UV2 */ |
62 | #define UV2_HUB_IS_SUPPORTED 1 | 63 | #define UV2_HUB_IS_SUPPORTED 1 |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 62ae3001ae02..9d59bbacd4e3 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -93,6 +93,8 @@ static int __init early_get_pnodeid(void) | |||
93 | 93 | ||
94 | if (node_id.s.part_number == UV2_HUB_PART_NUMBER) | 94 | if (node_id.s.part_number == UV2_HUB_PART_NUMBER) |
95 | uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1; | 95 | uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1; |
96 | if (node_id.s.part_number == UV2_HUB_PART_NUMBER_X) | ||
97 | uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1; | ||
96 | 98 | ||
97 | uv_hub_info->hub_revision = uv_min_hub_revision_id; | 99 | uv_hub_info->hub_revision = uv_min_hub_revision_id; |
98 | pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1); | 100 | pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1); |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index c7e46cb35327..0bab2b18bb20 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -442,8 +442,6 @@ static void __cpuinit bsp_init_amd(struct cpuinfo_x86 *c) | |||
442 | 442 | ||
443 | static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | 443 | static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) |
444 | { | 444 | { |
445 | u32 dummy; | ||
446 | |||
447 | early_init_amd_mc(c); | 445 | early_init_amd_mc(c); |
448 | 446 | ||
449 | /* | 447 | /* |
@@ -473,12 +471,12 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | |||
473 | set_cpu_cap(c, X86_FEATURE_EXTD_APICID); | 471 | set_cpu_cap(c, X86_FEATURE_EXTD_APICID); |
474 | } | 472 | } |
475 | #endif | 473 | #endif |
476 | |||
477 | rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy); | ||
478 | } | 474 | } |
479 | 475 | ||
480 | static void __cpuinit init_amd(struct cpuinfo_x86 *c) | 476 | static void __cpuinit init_amd(struct cpuinfo_x86 *c) |
481 | { | 477 | { |
478 | u32 dummy; | ||
479 | |||
482 | #ifdef CONFIG_SMP | 480 | #ifdef CONFIG_SMP |
483 | unsigned long long value; | 481 | unsigned long long value; |
484 | 482 | ||
@@ -657,6 +655,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
657 | checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask); | 655 | checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask); |
658 | } | 656 | } |
659 | } | 657 | } |
658 | |||
659 | rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy); | ||
660 | } | 660 | } |
661 | 661 | ||
662 | #ifdef CONFIG_X86_32 | 662 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index a71efcdbb092..97b26356e9ee 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c | |||
@@ -547,6 +547,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base, | |||
547 | 547 | ||
548 | if (tmp != mask_lo) { | 548 | if (tmp != mask_lo) { |
549 | printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n"); | 549 | printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n"); |
550 | add_taint(TAINT_FIRMWARE_WORKAROUND); | ||
550 | mask_lo = tmp; | 551 | mask_lo = tmp; |
551 | } | 552 | } |
552 | } | 553 | } |
@@ -693,6 +694,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock) | |||
693 | 694 | ||
694 | /* Disable MTRRs, and set the default type to uncached */ | 695 | /* Disable MTRRs, and set the default type to uncached */ |
695 | mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi); | 696 | mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi); |
697 | wbinvd(); | ||
696 | } | 698 | } |
697 | 699 | ||
698 | static void post_set(void) __releases(set_atomicity_lock) | 700 | static void post_set(void) __releases(set_atomicity_lock) |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 640891014b2a..2bda212a0010 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -312,12 +312,8 @@ int x86_setup_perfctr(struct perf_event *event) | |||
312 | return -EOPNOTSUPP; | 312 | return -EOPNOTSUPP; |
313 | } | 313 | } |
314 | 314 | ||
315 | /* | ||
316 | * Do not allow config1 (extended registers) to propagate, | ||
317 | * there's no sane user-space generalization yet: | ||
318 | */ | ||
319 | if (attr->type == PERF_TYPE_RAW) | 315 | if (attr->type == PERF_TYPE_RAW) |
320 | return 0; | 316 | return x86_pmu_extra_regs(event->attr.config, event); |
321 | 317 | ||
322 | if (attr->type == PERF_TYPE_HW_CACHE) | 318 | if (attr->type == PERF_TYPE_HW_CACHE) |
323 | return set_ext_hw_attr(hwc, event); | 319 | return set_ext_hw_attr(hwc, event); |
@@ -588,7 +584,7 @@ done: | |||
588 | x86_pmu.put_event_constraints(cpuc, cpuc->event_list[i]); | 584 | x86_pmu.put_event_constraints(cpuc, cpuc->event_list[i]); |
589 | } | 585 | } |
590 | } | 586 | } |
591 | return num ? -ENOSPC : 0; | 587 | return num ? -EINVAL : 0; |
592 | } | 588 | } |
593 | 589 | ||
594 | /* | 590 | /* |
@@ -607,7 +603,7 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader, | |||
607 | 603 | ||
608 | if (is_x86_event(leader)) { | 604 | if (is_x86_event(leader)) { |
609 | if (n >= max_count) | 605 | if (n >= max_count) |
610 | return -ENOSPC; | 606 | return -EINVAL; |
611 | cpuc->event_list[n] = leader; | 607 | cpuc->event_list[n] = leader; |
612 | n++; | 608 | n++; |
613 | } | 609 | } |
@@ -620,7 +616,7 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader, | |||
620 | continue; | 616 | continue; |
621 | 617 | ||
622 | if (n >= max_count) | 618 | if (n >= max_count) |
623 | return -ENOSPC; | 619 | return -EINVAL; |
624 | 620 | ||
625 | cpuc->event_list[n] = event; | 621 | cpuc->event_list[n] = event; |
626 | n++; | 622 | n++; |
@@ -1316,7 +1312,7 @@ static int validate_event(struct perf_event *event) | |||
1316 | c = x86_pmu.get_event_constraints(fake_cpuc, event); | 1312 | c = x86_pmu.get_event_constraints(fake_cpuc, event); |
1317 | 1313 | ||
1318 | if (!c || !c->weight) | 1314 | if (!c || !c->weight) |
1319 | ret = -ENOSPC; | 1315 | ret = -EINVAL; |
1320 | 1316 | ||
1321 | if (x86_pmu.put_event_constraints) | 1317 | if (x86_pmu.put_event_constraints) |
1322 | x86_pmu.put_event_constraints(fake_cpuc, event); | 1318 | x86_pmu.put_event_constraints(fake_cpuc, event); |
@@ -1341,7 +1337,7 @@ static int validate_group(struct perf_event *event) | |||
1341 | { | 1337 | { |
1342 | struct perf_event *leader = event->group_leader; | 1338 | struct perf_event *leader = event->group_leader; |
1343 | struct cpu_hw_events *fake_cpuc; | 1339 | struct cpu_hw_events *fake_cpuc; |
1344 | int ret = -ENOSPC, n; | 1340 | int ret = -EINVAL, n; |
1345 | 1341 | ||
1346 | fake_cpuc = allocate_fake_cpuc(); | 1342 | fake_cpuc = allocate_fake_cpuc(); |
1347 | if (IS_ERR(fake_cpuc)) | 1343 | if (IS_ERR(fake_cpuc)) |
diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c index ab6343d21825..3b8a2d30d14e 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c +++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c | |||
@@ -199,8 +199,7 @@ static int force_ibs_eilvt_setup(void) | |||
199 | goto out; | 199 | goto out; |
200 | } | 200 | } |
201 | 201 | ||
202 | pr_err(FW_BUG "using offset %d for IBS interrupts\n", offset); | 202 | pr_info("IBS: LVT offset %d assigned\n", offset); |
203 | pr_err(FW_BUG "workaround enabled for IBS LVT offset\n"); | ||
204 | 203 | ||
205 | return 0; | 204 | return 0; |
206 | out: | 205 | out: |
@@ -265,19 +264,23 @@ perf_ibs_cpu_notifier(struct notifier_block *self, unsigned long action, void *h | |||
265 | static __init int amd_ibs_init(void) | 264 | static __init int amd_ibs_init(void) |
266 | { | 265 | { |
267 | u32 caps; | 266 | u32 caps; |
268 | int ret; | 267 | int ret = -EINVAL; |
269 | 268 | ||
270 | caps = __get_ibs_caps(); | 269 | caps = __get_ibs_caps(); |
271 | if (!caps) | 270 | if (!caps) |
272 | return -ENODEV; /* ibs not supported by the cpu */ | 271 | return -ENODEV; /* ibs not supported by the cpu */ |
273 | 272 | ||
274 | if (!ibs_eilvt_valid()) { | 273 | /* |
275 | ret = force_ibs_eilvt_setup(); | 274 | * Force LVT offset assignment for family 10h: The offsets are |
276 | if (ret) { | 275 | * not assigned by the BIOS for this family, so the OS is |
277 | pr_err("Failed to setup IBS, %d\n", ret); | 276 | * responsible for doing it. If the OS assignment fails, fall |
278 | return ret; | 277 | * back to BIOS settings and try to setup this. |
279 | } | 278 | */ |
280 | } | 279 | if (boot_cpu_data.x86 == 0x10) |
280 | force_ibs_eilvt_setup(); | ||
281 | |||
282 | if (!ibs_eilvt_valid()) | ||
283 | goto out; | ||
281 | 284 | ||
282 | get_online_cpus(); | 285 | get_online_cpus(); |
283 | ibs_caps = caps; | 286 | ibs_caps = caps; |
@@ -287,7 +290,11 @@ static __init int amd_ibs_init(void) | |||
287 | smp_call_function(setup_APIC_ibs, NULL, 1); | 290 | smp_call_function(setup_APIC_ibs, NULL, 1); |
288 | put_online_cpus(); | 291 | put_online_cpus(); |
289 | 292 | ||
290 | return perf_event_ibs_init(); | 293 | ret = perf_event_ibs_init(); |
294 | out: | ||
295 | if (ret) | ||
296 | pr_err("Failed to setup IBS, %d\n", ret); | ||
297 | return ret; | ||
291 | } | 298 | } |
292 | 299 | ||
293 | /* Since we need the pci subsystem to init ibs we can't do this earlier: */ | 300 | /* Since we need the pci subsystem to init ibs we can't do this earlier: */ |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 2be5ebe99872..121f1be4da19 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -1169,7 +1169,7 @@ again: | |||
1169 | */ | 1169 | */ |
1170 | c = &unconstrained; | 1170 | c = &unconstrained; |
1171 | } else if (intel_try_alt_er(event, orig_idx)) { | 1171 | } else if (intel_try_alt_er(event, orig_idx)) { |
1172 | raw_spin_unlock(&era->lock); | 1172 | raw_spin_unlock_irqrestore(&era->lock, flags); |
1173 | goto again; | 1173 | goto again; |
1174 | } | 1174 | } |
1175 | raw_spin_unlock_irqrestore(&era->lock, flags); | 1175 | raw_spin_unlock_irqrestore(&era->lock, flags); |
@@ -1545,6 +1545,13 @@ static void intel_clovertown_quirks(void) | |||
1545 | x86_pmu.pebs_constraints = NULL; | 1545 | x86_pmu.pebs_constraints = NULL; |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | static void intel_sandybridge_quirks(void) | ||
1549 | { | ||
1550 | printk(KERN_WARNING "PEBS disabled due to CPU errata.\n"); | ||
1551 | x86_pmu.pebs = 0; | ||
1552 | x86_pmu.pebs_constraints = NULL; | ||
1553 | } | ||
1554 | |||
1548 | __init int intel_pmu_init(void) | 1555 | __init int intel_pmu_init(void) |
1549 | { | 1556 | { |
1550 | union cpuid10_edx edx; | 1557 | union cpuid10_edx edx; |
@@ -1694,6 +1701,7 @@ __init int intel_pmu_init(void) | |||
1694 | break; | 1701 | break; |
1695 | 1702 | ||
1696 | case 42: /* SandyBridge */ | 1703 | case 42: /* SandyBridge */ |
1704 | x86_pmu.quirks = intel_sandybridge_quirks; | ||
1697 | case 45: /* SandyBridge, "Romely-EP" */ | 1705 | case 45: /* SandyBridge, "Romely-EP" */ |
1698 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, | 1706 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, |
1699 | sizeof(hw_cache_event_ids)); | 1707 | sizeof(hw_cache_event_ids)); |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c index c0d238f49db8..73da6b64f5b7 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c | |||
@@ -493,6 +493,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs) | |||
493 | unsigned long from = cpuc->lbr_entries[0].from; | 493 | unsigned long from = cpuc->lbr_entries[0].from; |
494 | unsigned long old_to, to = cpuc->lbr_entries[0].to; | 494 | unsigned long old_to, to = cpuc->lbr_entries[0].to; |
495 | unsigned long ip = regs->ip; | 495 | unsigned long ip = regs->ip; |
496 | int is_64bit = 0; | ||
496 | 497 | ||
497 | /* | 498 | /* |
498 | * We don't need to fixup if the PEBS assist is fault like | 499 | * We don't need to fixup if the PEBS assist is fault like |
@@ -544,7 +545,10 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs) | |||
544 | } else | 545 | } else |
545 | kaddr = (void *)to; | 546 | kaddr = (void *)to; |
546 | 547 | ||
547 | kernel_insn_init(&insn, kaddr); | 548 | #ifdef CONFIG_X86_64 |
549 | is_64bit = kernel_ip(to) || !test_thread_flag(TIF_IA32); | ||
550 | #endif | ||
551 | insn_init(&insn, kaddr, is_64bit); | ||
548 | insn_get_length(&insn); | 552 | insn_get_length(&insn); |
549 | to += insn.length; | 553 | to += insn.length; |
550 | } while (to < ip); | 554 | } while (to < ip); |
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index 492bf1358a7c..ef484d9d0a25 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -1268,7 +1268,7 @@ reserve: | |||
1268 | } | 1268 | } |
1269 | 1269 | ||
1270 | done: | 1270 | done: |
1271 | return num ? -ENOSPC : 0; | 1271 | return num ? -EINVAL : 0; |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | static __initconst const struct x86_pmu p4_pmu = { | 1274 | static __initconst const struct x86_pmu p4_pmu = { |
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 3b97a80ce329..c99f9ed013d5 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
@@ -116,16 +116,16 @@ void show_registers(struct pt_regs *regs) | |||
116 | for (i = 0; i < code_len; i++, ip++) { | 116 | for (i = 0; i < code_len; i++, ip++) { |
117 | if (ip < (u8 *)PAGE_OFFSET || | 117 | if (ip < (u8 *)PAGE_OFFSET || |
118 | probe_kernel_address(ip, c)) { | 118 | probe_kernel_address(ip, c)) { |
119 | printk(" Bad EIP value."); | 119 | printk(KERN_CONT " Bad EIP value."); |
120 | break; | 120 | break; |
121 | } | 121 | } |
122 | if (ip == (u8 *)regs->ip) | 122 | if (ip == (u8 *)regs->ip) |
123 | printk("<%02x> ", c); | 123 | printk(KERN_CONT "<%02x> ", c); |
124 | else | 124 | else |
125 | printk("%02x ", c); | 125 | printk(KERN_CONT "%02x ", c); |
126 | } | 126 | } |
127 | } | 127 | } |
128 | printk("\n"); | 128 | printk(KERN_CONT "\n"); |
129 | } | 129 | } |
130 | 130 | ||
131 | int is_valid_bugaddr(unsigned long ip) | 131 | int is_valid_bugaddr(unsigned long ip) |
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 19853ad8afc5..6d728d9284bd 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
@@ -284,16 +284,16 @@ void show_registers(struct pt_regs *regs) | |||
284 | for (i = 0; i < code_len; i++, ip++) { | 284 | for (i = 0; i < code_len; i++, ip++) { |
285 | if (ip < (u8 *)PAGE_OFFSET || | 285 | if (ip < (u8 *)PAGE_OFFSET || |
286 | probe_kernel_address(ip, c)) { | 286 | probe_kernel_address(ip, c)) { |
287 | printk(" Bad RIP value."); | 287 | printk(KERN_CONT " Bad RIP value."); |
288 | break; | 288 | break; |
289 | } | 289 | } |
290 | if (ip == (u8 *)regs->ip) | 290 | if (ip == (u8 *)regs->ip) |
291 | printk("<%02x> ", c); | 291 | printk(KERN_CONT "<%02x> ", c); |
292 | else | 292 | else |
293 | printk("%02x ", c); | 293 | printk(KERN_CONT "%02x ", c); |
294 | } | 294 | } |
295 | } | 295 | } |
296 | printk("\n"); | 296 | printk(KERN_CONT "\n"); |
297 | } | 297 | } |
298 | 298 | ||
299 | int is_valid_bugaddr(unsigned long ip) | 299 | int is_valid_bugaddr(unsigned long ip) |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index b946a9eac7d9..1bb0bf4d92cd 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -1049,6 +1049,14 @@ int hpet_rtc_timer_init(void) | |||
1049 | } | 1049 | } |
1050 | EXPORT_SYMBOL_GPL(hpet_rtc_timer_init); | 1050 | EXPORT_SYMBOL_GPL(hpet_rtc_timer_init); |
1051 | 1051 | ||
1052 | static void hpet_disable_rtc_channel(void) | ||
1053 | { | ||
1054 | unsigned long cfg; | ||
1055 | cfg = hpet_readl(HPET_T1_CFG); | ||
1056 | cfg &= ~HPET_TN_ENABLE; | ||
1057 | hpet_writel(cfg, HPET_T1_CFG); | ||
1058 | } | ||
1059 | |||
1052 | /* | 1060 | /* |
1053 | * The functions below are called from rtc driver. | 1061 | * The functions below are called from rtc driver. |
1054 | * Return 0 if HPET is not being used. | 1062 | * Return 0 if HPET is not being used. |
@@ -1060,6 +1068,9 @@ int hpet_mask_rtc_irq_bit(unsigned long bit_mask) | |||
1060 | return 0; | 1068 | return 0; |
1061 | 1069 | ||
1062 | hpet_rtc_flags &= ~bit_mask; | 1070 | hpet_rtc_flags &= ~bit_mask; |
1071 | if (unlikely(!hpet_rtc_flags)) | ||
1072 | hpet_disable_rtc_channel(); | ||
1073 | |||
1063 | return 1; | 1074 | return 1; |
1064 | } | 1075 | } |
1065 | EXPORT_SYMBOL_GPL(hpet_mask_rtc_irq_bit); | 1076 | EXPORT_SYMBOL_GPL(hpet_mask_rtc_irq_bit); |
@@ -1125,15 +1136,11 @@ EXPORT_SYMBOL_GPL(hpet_rtc_dropped_irq); | |||
1125 | 1136 | ||
1126 | static void hpet_rtc_timer_reinit(void) | 1137 | static void hpet_rtc_timer_reinit(void) |
1127 | { | 1138 | { |
1128 | unsigned int cfg, delta; | 1139 | unsigned int delta; |
1129 | int lost_ints = -1; | 1140 | int lost_ints = -1; |
1130 | 1141 | ||
1131 | if (unlikely(!hpet_rtc_flags)) { | 1142 | if (unlikely(!hpet_rtc_flags)) |
1132 | cfg = hpet_readl(HPET_T1_CFG); | 1143 | hpet_disable_rtc_channel(); |
1133 | cfg &= ~HPET_TN_ENABLE; | ||
1134 | hpet_writel(cfg, HPET_T1_CFG); | ||
1135 | return; | ||
1136 | } | ||
1137 | 1144 | ||
1138 | if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit) | 1145 | if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit) |
1139 | delta = hpet_default_delta; | 1146 | delta = hpet_default_delta; |
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index acf8fbf8fbda..69bca468c47a 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c | |||
@@ -38,6 +38,9 @@ static inline void stack_overflow_check(struct pt_regs *regs) | |||
38 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 38 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
39 | u64 curbase = (u64)task_stack_page(current); | 39 | u64 curbase = (u64)task_stack_page(current); |
40 | 40 | ||
41 | if (user_mode_vm(regs)) | ||
42 | return; | ||
43 | |||
41 | WARN_ONCE(regs->sp >= curbase && | 44 | WARN_ONCE(regs->sp >= curbase && |
42 | regs->sp <= curbase + THREAD_SIZE && | 45 | regs->sp <= curbase + THREAD_SIZE && |
43 | regs->sp < curbase + sizeof(struct thread_info) + | 46 | regs->sp < curbase + sizeof(struct thread_info) + |
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index f2d2a664e797..9d46f5e43b51 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
@@ -256,7 +256,7 @@ static int __init microcode_dev_init(void) | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | 258 | ||
259 | static void microcode_dev_exit(void) | 259 | static void __exit microcode_dev_exit(void) |
260 | { | 260 | { |
261 | misc_deregister(µcode_dev); | 261 | misc_deregister(µcode_dev); |
262 | } | 262 | } |
@@ -519,10 +519,8 @@ static int __init microcode_init(void) | |||
519 | 519 | ||
520 | microcode_pdev = platform_device_register_simple("microcode", -1, | 520 | microcode_pdev = platform_device_register_simple("microcode", -1, |
521 | NULL, 0); | 521 | NULL, 0); |
522 | if (IS_ERR(microcode_pdev)) { | 522 | if (IS_ERR(microcode_pdev)) |
523 | microcode_dev_exit(); | ||
524 | return PTR_ERR(microcode_pdev); | 523 | return PTR_ERR(microcode_pdev); |
525 | } | ||
526 | 524 | ||
527 | get_online_cpus(); | 525 | get_online_cpus(); |
528 | mutex_lock(µcode_mutex); | 526 | mutex_lock(µcode_mutex); |
@@ -532,14 +530,12 @@ static int __init microcode_init(void) | |||
532 | mutex_unlock(µcode_mutex); | 530 | mutex_unlock(µcode_mutex); |
533 | put_online_cpus(); | 531 | put_online_cpus(); |
534 | 532 | ||
535 | if (error) { | 533 | if (error) |
536 | platform_device_unregister(microcode_pdev); | 534 | goto out_pdev; |
537 | return error; | ||
538 | } | ||
539 | 535 | ||
540 | error = microcode_dev_init(); | 536 | error = microcode_dev_init(); |
541 | if (error) | 537 | if (error) |
542 | return error; | 538 | goto out_sysdev_driver; |
543 | 539 | ||
544 | register_syscore_ops(&mc_syscore_ops); | 540 | register_syscore_ops(&mc_syscore_ops); |
545 | register_hotcpu_notifier(&mc_cpu_notifier); | 541 | register_hotcpu_notifier(&mc_cpu_notifier); |
@@ -548,6 +544,20 @@ static int __init microcode_init(void) | |||
548 | " <tigran@aivazian.fsnet.co.uk>, Peter Oruba\n"); | 544 | " <tigran@aivazian.fsnet.co.uk>, Peter Oruba\n"); |
549 | 545 | ||
550 | return 0; | 546 | return 0; |
547 | |||
548 | out_sysdev_driver: | ||
549 | get_online_cpus(); | ||
550 | mutex_lock(µcode_mutex); | ||
551 | |||
552 | sysdev_driver_unregister(&cpu_sysdev_class, &mc_sysdev_driver); | ||
553 | |||
554 | mutex_unlock(µcode_mutex); | ||
555 | put_online_cpus(); | ||
556 | |||
557 | out_pdev: | ||
558 | platform_device_unregister(microcode_pdev); | ||
559 | return error; | ||
560 | |||
551 | } | 561 | } |
552 | module_init(microcode_init); | 562 | module_init(microcode_init); |
553 | 563 | ||
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 9103b89c145a..0741b062a304 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -95,8 +95,8 @@ static void __init MP_bus_info(struct mpc_bus *m) | |||
95 | } | 95 | } |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | set_bit(m->busid, mp_bus_not_pci); | ||
98 | if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { | 99 | if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { |
99 | set_bit(m->busid, mp_bus_not_pci); | ||
100 | #if defined(CONFIG_EISA) || defined(CONFIG_MCA) | 100 | #if defined(CONFIG_EISA) || defined(CONFIG_MCA) |
101 | mp_bus_id_to_type[m->busid] = MP_BUS_ISA; | 101 | mp_bus_id_to_type[m->busid] = MP_BUS_ISA; |
102 | #endif | 102 | #endif |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index b9b3b1a51643..ee5d4fbd53b4 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -403,6 +403,14 @@ void default_idle(void) | |||
403 | EXPORT_SYMBOL(default_idle); | 403 | EXPORT_SYMBOL(default_idle); |
404 | #endif | 404 | #endif |
405 | 405 | ||
406 | bool set_pm_idle_to_default(void) | ||
407 | { | ||
408 | bool ret = !!pm_idle; | ||
409 | |||
410 | pm_idle = default_idle; | ||
411 | |||
412 | return ret; | ||
413 | } | ||
406 | void stop_this_cpu(void *dummy) | 414 | void stop_this_cpu(void *dummy) |
407 | { | 415 | { |
408 | local_irq_disable(); | 416 | local_irq_disable(); |
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index b78643d0f9a5..03920a15a632 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c | |||
@@ -553,4 +553,17 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC, | |||
553 | quirk_amd_nb_node); | 553 | quirk_amd_nb_node); |
554 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_LINK, | 554 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_LINK, |
555 | quirk_amd_nb_node); | 555 | quirk_amd_nb_node); |
556 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F0, | ||
557 | quirk_amd_nb_node); | ||
558 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F1, | ||
559 | quirk_amd_nb_node); | ||
560 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F2, | ||
561 | quirk_amd_nb_node); | ||
562 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F3, | ||
563 | quirk_amd_nb_node); | ||
564 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F4, | ||
565 | quirk_amd_nb_node); | ||
566 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F5, | ||
567 | quirk_amd_nb_node); | ||
568 | |||
556 | #endif | 569 | #endif |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index e334be1182b9..37a458b521a6 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -124,7 +124,7 @@ __setup("reboot=", reboot_setup); | |||
124 | */ | 124 | */ |
125 | 125 | ||
126 | /* | 126 | /* |
127 | * Some machines require the "reboot=b" commandline option, | 127 | * Some machines require the "reboot=b" or "reboot=k" commandline options, |
128 | * this quirk makes that automatic. | 128 | * this quirk makes that automatic. |
129 | */ | 129 | */ |
130 | static int __init set_bios_reboot(const struct dmi_system_id *d) | 130 | static int __init set_bios_reboot(const struct dmi_system_id *d) |
@@ -136,6 +136,15 @@ static int __init set_bios_reboot(const struct dmi_system_id *d) | |||
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | 138 | ||
139 | static int __init set_kbd_reboot(const struct dmi_system_id *d) | ||
140 | { | ||
141 | if (reboot_type != BOOT_KBD) { | ||
142 | reboot_type = BOOT_KBD; | ||
143 | printk(KERN_INFO "%s series board detected. Selecting KBD-method for reboot.\n", d->ident); | ||
144 | } | ||
145 | return 0; | ||
146 | } | ||
147 | |||
139 | static struct dmi_system_id __initdata reboot_dmi_table[] = { | 148 | static struct dmi_system_id __initdata reboot_dmi_table[] = { |
140 | { /* Handle problems with rebooting on Dell E520's */ | 149 | { /* Handle problems with rebooting on Dell E520's */ |
141 | .callback = set_bios_reboot, | 150 | .callback = set_bios_reboot, |
@@ -295,7 +304,7 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
295 | }, | 304 | }, |
296 | }, | 305 | }, |
297 | { /* Handle reboot issue on Acer Aspire one */ | 306 | { /* Handle reboot issue on Acer Aspire one */ |
298 | .callback = set_bios_reboot, | 307 | .callback = set_kbd_reboot, |
299 | .ident = "Acer Aspire One A110", | 308 | .ident = "Acer Aspire One A110", |
300 | .matches = { | 309 | .matches = { |
301 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 310 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
@@ -443,6 +452,14 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = { | |||
443 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"), | 452 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"), |
444 | }, | 453 | }, |
445 | }, | 454 | }, |
455 | { /* Handle problems with rebooting on the OptiPlex 990. */ | ||
456 | .callback = set_pci_reboot, | ||
457 | .ident = "Dell OptiPlex 990", | ||
458 | .matches = { | ||
459 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
460 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"), | ||
461 | }, | ||
462 | }, | ||
446 | { } | 463 | { } |
447 | }; | 464 | }; |
448 | 465 | ||
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index 348ce016a835..af6db6ec5b2a 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/vsyscall.h> | 12 | #include <asm/vsyscall.h> |
13 | #include <asm/x86_init.h> | 13 | #include <asm/x86_init.h> |
14 | #include <asm/time.h> | 14 | #include <asm/time.h> |
15 | #include <asm/mrst.h> | ||
15 | 16 | ||
16 | #ifdef CONFIG_X86_32 | 17 | #ifdef CONFIG_X86_32 |
17 | /* | 18 | /* |
@@ -242,6 +243,10 @@ static __init int add_rtc_cmos(void) | |||
242 | if (of_have_populated_dt()) | 243 | if (of_have_populated_dt()) |
243 | return 0; | 244 | return 0; |
244 | 245 | ||
246 | /* Intel MID platforms don't have ioport rtc */ | ||
247 | if (mrst_identify_cpu()) | ||
248 | return -ENODEV; | ||
249 | |||
245 | platform_device_register(&rtc_device); | 250 | platform_device_register(&rtc_device); |
246 | dev_info(&rtc_device.dev, | 251 | dev_info(&rtc_device.dev, |
247 | "registered platform RTC device (no PNP device found)\n"); | 252 | "registered platform RTC device (no PNP device found)\n"); |
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 76e3f1cd0369..405f2620392f 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
@@ -338,11 +338,15 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data) | |||
338 | return HRTIMER_NORESTART; | 338 | return HRTIMER_NORESTART; |
339 | } | 339 | } |
340 | 340 | ||
341 | static void create_pit_timer(struct kvm_kpit_state *ps, u32 val, int is_period) | 341 | static void create_pit_timer(struct kvm *kvm, u32 val, int is_period) |
342 | { | 342 | { |
343 | struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state; | ||
343 | struct kvm_timer *pt = &ps->pit_timer; | 344 | struct kvm_timer *pt = &ps->pit_timer; |
344 | s64 interval; | 345 | s64 interval; |
345 | 346 | ||
347 | if (!irqchip_in_kernel(kvm)) | ||
348 | return; | ||
349 | |||
346 | interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ); | 350 | interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ); |
347 | 351 | ||
348 | pr_debug("create pit timer, interval is %llu nsec\n", interval); | 352 | pr_debug("create pit timer, interval is %llu nsec\n", interval); |
@@ -394,13 +398,13 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val) | |||
394 | /* FIXME: enhance mode 4 precision */ | 398 | /* FIXME: enhance mode 4 precision */ |
395 | case 4: | 399 | case 4: |
396 | if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)) { | 400 | if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)) { |
397 | create_pit_timer(ps, val, 0); | 401 | create_pit_timer(kvm, val, 0); |
398 | } | 402 | } |
399 | break; | 403 | break; |
400 | case 2: | 404 | case 2: |
401 | case 3: | 405 | case 3: |
402 | if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)){ | 406 | if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)){ |
403 | create_pit_timer(ps, val, 1); | 407 | create_pit_timer(kvm, val, 1); |
404 | } | 408 | } |
405 | break; | 409 | break; |
406 | default: | 410 | default: |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c38efd7b792e..4c938da2ba00 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -602,7 +602,6 @@ static void update_cpuid(struct kvm_vcpu *vcpu) | |||
602 | { | 602 | { |
603 | struct kvm_cpuid_entry2 *best; | 603 | struct kvm_cpuid_entry2 *best; |
604 | struct kvm_lapic *apic = vcpu->arch.apic; | 604 | struct kvm_lapic *apic = vcpu->arch.apic; |
605 | u32 timer_mode_mask; | ||
606 | 605 | ||
607 | best = kvm_find_cpuid_entry(vcpu, 1, 0); | 606 | best = kvm_find_cpuid_entry(vcpu, 1, 0); |
608 | if (!best) | 607 | if (!best) |
@@ -615,15 +614,12 @@ static void update_cpuid(struct kvm_vcpu *vcpu) | |||
615 | best->ecx |= bit(X86_FEATURE_OSXSAVE); | 614 | best->ecx |= bit(X86_FEATURE_OSXSAVE); |
616 | } | 615 | } |
617 | 616 | ||
618 | if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && | 617 | if (apic) { |
619 | best->function == 0x1) { | 618 | if (best->ecx & bit(X86_FEATURE_TSC_DEADLINE_TIMER)) |
620 | best->ecx |= bit(X86_FEATURE_TSC_DEADLINE_TIMER); | 619 | apic->lapic_timer.timer_mode_mask = 3 << 17; |
621 | timer_mode_mask = 3 << 17; | 620 | else |
622 | } else | 621 | apic->lapic_timer.timer_mode_mask = 1 << 17; |
623 | timer_mode_mask = 1 << 17; | 622 | } |
624 | |||
625 | if (apic) | ||
626 | apic->lapic_timer.timer_mode_mask = timer_mode_mask; | ||
627 | } | 623 | } |
628 | 624 | ||
629 | int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) | 625 | int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) |
@@ -2135,6 +2131,9 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
2135 | case KVM_CAP_TSC_CONTROL: | 2131 | case KVM_CAP_TSC_CONTROL: |
2136 | r = kvm_has_tsc_control; | 2132 | r = kvm_has_tsc_control; |
2137 | break; | 2133 | break; |
2134 | case KVM_CAP_TSC_DEADLINE_TIMER: | ||
2135 | r = boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER); | ||
2136 | break; | ||
2138 | default: | 2137 | default: |
2139 | r = 0; | 2138 | r = 0; |
2140 | break; | 2139 | break; |
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index ea305856151c..dd74e46828c0 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c | |||
@@ -201,6 +201,8 @@ static noinline int gup_huge_pud(pud_t pud, unsigned long addr, | |||
201 | do { | 201 | do { |
202 | VM_BUG_ON(compound_head(page) != head); | 202 | VM_BUG_ON(compound_head(page) != head); |
203 | pages[*nr] = page; | 203 | pages[*nr] = page; |
204 | if (PageTail(page)) | ||
205 | get_huge_page_tail(page); | ||
204 | (*nr)++; | 206 | (*nr)++; |
205 | page++; | 207 | page++; |
206 | refs++; | 208 | refs++; |
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index b49962662101..f4f29b19fac5 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c | |||
@@ -45,6 +45,7 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot) | |||
45 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 45 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
46 | BUG_ON(!pte_none(*(kmap_pte-idx))); | 46 | BUG_ON(!pte_none(*(kmap_pte-idx))); |
47 | set_pte(kmap_pte-idx, mk_pte(page, prot)); | 47 | set_pte(kmap_pte-idx, mk_pte(page, prot)); |
48 | arch_flush_lazy_mmu_mode(); | ||
48 | 49 | ||
49 | return (void *)vaddr; | 50 | return (void *)vaddr; |
50 | } | 51 | } |
@@ -88,6 +89,7 @@ void __kunmap_atomic(void *kvaddr) | |||
88 | */ | 89 | */ |
89 | kpte_clear_flush(kmap_pte-idx, vaddr); | 90 | kpte_clear_flush(kmap_pte-idx, vaddr); |
90 | kmap_atomic_idx_pop(); | 91 | kmap_atomic_idx_pop(); |
92 | arch_flush_lazy_mmu_mode(); | ||
91 | } | 93 | } |
92 | #ifdef CONFIG_DEBUG_HIGHMEM | 94 | #ifdef CONFIG_DEBUG_HIGHMEM |
93 | else { | 95 | else { |
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index bfab3fa10edc..7b65f752c5f8 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -568,8 +568,8 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; | |||
568 | break; | 568 | break; |
569 | } | 569 | } |
570 | if (filter[i].jt != 0) { | 570 | if (filter[i].jt != 0) { |
571 | if (filter[i].jf) | 571 | if (filter[i].jf && f_offset) |
572 | t_offset += is_near(f_offset) ? 2 : 6; | 572 | t_offset += is_near(f_offset) ? 2 : 5; |
573 | EMIT_COND_JMP(t_op, t_offset); | 573 | EMIT_COND_JMP(t_op, t_offset); |
574 | if (filter[i].jf) | 574 | if (filter[i].jf) |
575 | EMIT_JMP(f_offset); | 575 | EMIT_JMP(f_offset); |
diff --git a/arch/x86/oprofile/init.c b/arch/x86/oprofile/init.c index cdfe4c54deca..f148cf652678 100644 --- a/arch/x86/oprofile/init.c +++ b/arch/x86/oprofile/init.c | |||
@@ -21,6 +21,7 @@ extern int op_nmi_timer_init(struct oprofile_operations *ops); | |||
21 | extern void op_nmi_exit(void); | 21 | extern void op_nmi_exit(void); |
22 | extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); | 22 | extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); |
23 | 23 | ||
24 | static int nmi_timer; | ||
24 | 25 | ||
25 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 26 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
26 | { | 27 | { |
@@ -31,8 +32,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
31 | #ifdef CONFIG_X86_LOCAL_APIC | 32 | #ifdef CONFIG_X86_LOCAL_APIC |
32 | ret = op_nmi_init(ops); | 33 | ret = op_nmi_init(ops); |
33 | #endif | 34 | #endif |
35 | nmi_timer = (ret != 0); | ||
34 | #ifdef CONFIG_X86_IO_APIC | 36 | #ifdef CONFIG_X86_IO_APIC |
35 | if (ret < 0) | 37 | if (nmi_timer) |
36 | ret = op_nmi_timer_init(ops); | 38 | ret = op_nmi_timer_init(ops); |
37 | #endif | 39 | #endif |
38 | ops->backtrace = x86_backtrace; | 40 | ops->backtrace = x86_backtrace; |
@@ -44,6 +46,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
44 | void oprofile_arch_exit(void) | 46 | void oprofile_arch_exit(void) |
45 | { | 47 | { |
46 | #ifdef CONFIG_X86_LOCAL_APIC | 48 | #ifdef CONFIG_X86_LOCAL_APIC |
47 | op_nmi_exit(); | 49 | if (!nmi_timer) |
50 | op_nmi_exit(); | ||
48 | #endif | 51 | #endif |
49 | } | 52 | } |
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c index e36bf714cb77..40e446941dd7 100644 --- a/arch/x86/platform/efi/efi_32.c +++ b/arch/x86/platform/efi/efi_32.c | |||
@@ -39,43 +39,14 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | static unsigned long efi_rt_eflags; | 41 | static unsigned long efi_rt_eflags; |
42 | static pgd_t efi_bak_pg_dir_pointer[2]; | ||
43 | 42 | ||
44 | void efi_call_phys_prelog(void) | 43 | void efi_call_phys_prelog(void) |
45 | { | 44 | { |
46 | unsigned long cr4; | ||
47 | unsigned long temp; | ||
48 | struct desc_ptr gdt_descr; | 45 | struct desc_ptr gdt_descr; |
49 | 46 | ||
50 | local_irq_save(efi_rt_eflags); | 47 | local_irq_save(efi_rt_eflags); |
51 | 48 | ||
52 | /* | 49 | load_cr3(initial_page_table); |
53 | * If I don't have PAE, I should just duplicate two entries in page | ||
54 | * directory. If I have PAE, I just need to duplicate one entry in | ||
55 | * page directory. | ||
56 | */ | ||
57 | cr4 = read_cr4_safe(); | ||
58 | |||
59 | if (cr4 & X86_CR4_PAE) { | ||
60 | efi_bak_pg_dir_pointer[0].pgd = | ||
61 | swapper_pg_dir[pgd_index(0)].pgd; | ||
62 | swapper_pg_dir[0].pgd = | ||
63 | swapper_pg_dir[pgd_index(PAGE_OFFSET)].pgd; | ||
64 | } else { | ||
65 | efi_bak_pg_dir_pointer[0].pgd = | ||
66 | swapper_pg_dir[pgd_index(0)].pgd; | ||
67 | efi_bak_pg_dir_pointer[1].pgd = | ||
68 | swapper_pg_dir[pgd_index(0x400000)].pgd; | ||
69 | swapper_pg_dir[pgd_index(0)].pgd = | ||
70 | swapper_pg_dir[pgd_index(PAGE_OFFSET)].pgd; | ||
71 | temp = PAGE_OFFSET + 0x400000; | ||
72 | swapper_pg_dir[pgd_index(0x400000)].pgd = | ||
73 | swapper_pg_dir[pgd_index(temp)].pgd; | ||
74 | } | ||
75 | |||
76 | /* | ||
77 | * After the lock is released, the original page table is restored. | ||
78 | */ | ||
79 | __flush_tlb_all(); | 50 | __flush_tlb_all(); |
80 | 51 | ||
81 | gdt_descr.address = __pa(get_cpu_gdt_table(0)); | 52 | gdt_descr.address = __pa(get_cpu_gdt_table(0)); |
@@ -85,28 +56,13 @@ void efi_call_phys_prelog(void) | |||
85 | 56 | ||
86 | void efi_call_phys_epilog(void) | 57 | void efi_call_phys_epilog(void) |
87 | { | 58 | { |
88 | unsigned long cr4; | ||
89 | struct desc_ptr gdt_descr; | 59 | struct desc_ptr gdt_descr; |
90 | 60 | ||
91 | gdt_descr.address = (unsigned long)get_cpu_gdt_table(0); | 61 | gdt_descr.address = (unsigned long)get_cpu_gdt_table(0); |
92 | gdt_descr.size = GDT_SIZE - 1; | 62 | gdt_descr.size = GDT_SIZE - 1; |
93 | load_gdt(&gdt_descr); | 63 | load_gdt(&gdt_descr); |
94 | 64 | ||
95 | cr4 = read_cr4_safe(); | 65 | load_cr3(swapper_pg_dir); |
96 | |||
97 | if (cr4 & X86_CR4_PAE) { | ||
98 | swapper_pg_dir[pgd_index(0)].pgd = | ||
99 | efi_bak_pg_dir_pointer[0].pgd; | ||
100 | } else { | ||
101 | swapper_pg_dir[pgd_index(0)].pgd = | ||
102 | efi_bak_pg_dir_pointer[0].pgd; | ||
103 | swapper_pg_dir[pgd_index(0x400000)].pgd = | ||
104 | efi_bak_pg_dir_pointer[1].pgd; | ||
105 | } | ||
106 | |||
107 | /* | ||
108 | * After the lock is released, the original page table is restored. | ||
109 | */ | ||
110 | __flush_tlb_all(); | 66 | __flush_tlb_all(); |
111 | 67 | ||
112 | local_irq_restore(efi_rt_eflags); | 68 | local_irq_restore(efi_rt_eflags); |
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index b1489a06a49d..ad4ec1cb097e 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c | |||
@@ -76,6 +76,20 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX]; | |||
76 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); | 76 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); |
77 | int sfi_mrtc_num; | 77 | int sfi_mrtc_num; |
78 | 78 | ||
79 | static void mrst_power_off(void) | ||
80 | { | ||
81 | if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) | ||
82 | intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1); | ||
83 | } | ||
84 | |||
85 | static void mrst_reboot(void) | ||
86 | { | ||
87 | if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) | ||
88 | intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0); | ||
89 | else | ||
90 | intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); | ||
91 | } | ||
92 | |||
79 | /* parse all the mtimer info to a static mtimer array */ | 93 | /* parse all the mtimer info to a static mtimer array */ |
80 | static int __init sfi_parse_mtmr(struct sfi_table_header *table) | 94 | static int __init sfi_parse_mtmr(struct sfi_table_header *table) |
81 | { | 95 | { |
@@ -265,17 +279,6 @@ static int mrst_i8042_detect(void) | |||
265 | return 0; | 279 | return 0; |
266 | } | 280 | } |
267 | 281 | ||
268 | /* Reboot and power off are handled by the SCU on a MID device */ | ||
269 | static void mrst_power_off(void) | ||
270 | { | ||
271 | intel_scu_ipc_simple_command(0xf1, 1); | ||
272 | } | ||
273 | |||
274 | static void mrst_reboot(void) | ||
275 | { | ||
276 | intel_scu_ipc_simple_command(0xf1, 0); | ||
277 | } | ||
278 | |||
279 | /* | 282 | /* |
280 | * Moorestown does not have external NMI source nor port 0x61 to report | 283 | * Moorestown does not have external NMI source nor port 0x61 to report |
281 | * NMI status. The possible NMI sources are from pmu as a result of NMI | 284 | * NMI status. The possible NMI sources are from pmu as a result of NMI |
@@ -484,6 +487,46 @@ static void __init *max7315_platform_data(void *info) | |||
484 | return max7315; | 487 | return max7315; |
485 | } | 488 | } |
486 | 489 | ||
490 | static void *tca6416_platform_data(void *info) | ||
491 | { | ||
492 | static struct pca953x_platform_data tca6416; | ||
493 | struct i2c_board_info *i2c_info = info; | ||
494 | int gpio_base, intr; | ||
495 | char base_pin_name[SFI_NAME_LEN + 1]; | ||
496 | char intr_pin_name[SFI_NAME_LEN + 1]; | ||
497 | |||
498 | strcpy(i2c_info->type, "tca6416"); | ||
499 | strcpy(base_pin_name, "tca6416_base"); | ||
500 | strcpy(intr_pin_name, "tca6416_int"); | ||
501 | |||
502 | gpio_base = get_gpio_by_name(base_pin_name); | ||
503 | intr = get_gpio_by_name(intr_pin_name); | ||
504 | |||
505 | if (gpio_base == -1) | ||
506 | return NULL; | ||
507 | tca6416.gpio_base = gpio_base; | ||
508 | if (intr != -1) { | ||
509 | i2c_info->irq = intr + MRST_IRQ_OFFSET; | ||
510 | tca6416.irq_base = gpio_base + MRST_IRQ_OFFSET; | ||
511 | } else { | ||
512 | i2c_info->irq = -1; | ||
513 | tca6416.irq_base = -1; | ||
514 | } | ||
515 | return &tca6416; | ||
516 | } | ||
517 | |||
518 | static void *mpu3050_platform_data(void *info) | ||
519 | { | ||
520 | struct i2c_board_info *i2c_info = info; | ||
521 | int intr = get_gpio_by_name("mpu3050_int"); | ||
522 | |||
523 | if (intr == -1) | ||
524 | return NULL; | ||
525 | |||
526 | i2c_info->irq = intr + MRST_IRQ_OFFSET; | ||
527 | return NULL; | ||
528 | } | ||
529 | |||
487 | static void __init *emc1403_platform_data(void *info) | 530 | static void __init *emc1403_platform_data(void *info) |
488 | { | 531 | { |
489 | static short intr2nd_pdata; | 532 | static short intr2nd_pdata; |
@@ -646,12 +689,15 @@ static void *msic_ocd_platform_data(void *info) | |||
646 | static const struct devs_id __initconst device_ids[] = { | 689 | static const struct devs_id __initconst device_ids[] = { |
647 | {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data}, | 690 | {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data}, |
648 | {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, | 691 | {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, |
692 | {"pmic_gpio", SFI_DEV_TYPE_IPC, 1, &pmic_gpio_platform_data}, | ||
649 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, | 693 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, |
650 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 694 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
651 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 695 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
696 | {"tca6416", SFI_DEV_TYPE_I2C, 1, &tca6416_platform_data}, | ||
652 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, | 697 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, |
653 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, | 698 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, |
654 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, | 699 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, |
700 | {"mpu3050", SFI_DEV_TYPE_I2C, 1, &mpu3050_platform_data}, | ||
655 | 701 | ||
656 | /* MSIC subdevices */ | 702 | /* MSIC subdevices */ |
657 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, | 703 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 38d0af4fefec..b2c7179fa263 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -173,9 +173,21 @@ static unsigned long __init xen_get_max_pages(void) | |||
173 | domid_t domid = DOMID_SELF; | 173 | domid_t domid = DOMID_SELF; |
174 | int ret; | 174 | int ret; |
175 | 175 | ||
176 | ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid); | 176 | /* |
177 | if (ret > 0) | 177 | * For the initial domain we use the maximum reservation as |
178 | max_pages = ret; | 178 | * the maximum page. |
179 | * | ||
180 | * For guest domains the current maximum reservation reflects | ||
181 | * the current maximum rather than the static maximum. In this | ||
182 | * case the e820 map provided to us will cover the static | ||
183 | * maximum region. | ||
184 | */ | ||
185 | if (xen_initial_domain()) { | ||
186 | ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid); | ||
187 | if (ret > 0) | ||
188 | max_pages = ret; | ||
189 | } | ||
190 | |||
179 | return min(max_pages, MAX_DOMAIN_PAGES); | 191 | return min(max_pages, MAX_DOMAIN_PAGES); |
180 | } | 192 | } |
181 | 193 | ||
@@ -410,6 +422,6 @@ void __init xen_arch_setup(void) | |||
410 | #endif | 422 | #endif |
411 | disable_cpuidle(); | 423 | disable_cpuidle(); |
412 | boot_option_idle_override = IDLE_HALT; | 424 | boot_option_idle_override = IDLE_HALT; |
413 | 425 | WARN_ON(set_pm_idle_to_default()); | |
414 | fiddle_vdso(); | 426 | fiddle_vdso(); |
415 | } | 427 | } |