forked from Minki/linux
Merge 3.16-rc5 into tty-next.
We want those fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
commit
ca17749259
@ -280,12 +280,9 @@ that is possible.
|
||||
mcelog
|
||||
------
|
||||
|
||||
In Linux 2.6.31+ the i386 kernel needs to run the mcelog utility
|
||||
as a regular cronjob similar to the x86-64 kernel to process and log
|
||||
machine check events when CONFIG_X86_NEW_MCE is enabled. Machine check
|
||||
events are errors reported by the CPU. Processing them is strongly encouraged.
|
||||
All x86-64 kernels since 2.6.4 require the mcelog utility to
|
||||
process machine checks.
|
||||
On x86 kernels the mcelog utility is needed to process and log machine check
|
||||
events when CONFIG_X86_MCE is enabled. Machine check events are errors reported
|
||||
by the CPU. Processing them is strongly encouraged.
|
||||
|
||||
Getting updated software
|
||||
========================
|
||||
|
@ -708,7 +708,7 @@ hardware level details could be very different.
|
||||
|
||||
<para>Systems need specialized hardware support to implement OTG,
|
||||
notably including a special <emphasis>Mini-AB</emphasis> jack
|
||||
and associated transciever to support <emphasis>Dual-Role</emphasis>
|
||||
and associated transceiver to support <emphasis>Dual-Role</emphasis>
|
||||
operation:
|
||||
they can act either as a host, using the standard
|
||||
Linux-USB host side driver stack,
|
||||
|
@ -182,7 +182,7 @@
|
||||
<para>
|
||||
Each interrupt is described by an interrupt descriptor structure
|
||||
irq_desc. The interrupt is referenced by an 'unsigned int' numeric
|
||||
value which selects the corresponding interrupt decription structure
|
||||
value which selects the corresponding interrupt description structure
|
||||
in the descriptor structures array.
|
||||
The descriptor structure contains status information and pointers
|
||||
to the interrupt flow method and the interrupt chip structure
|
||||
@ -470,7 +470,7 @@ if (desc->irq_data.chip->irq_eoi)
|
||||
<para>
|
||||
To avoid copies of identical implementations of IRQ chips the
|
||||
core provides a configurable generic interrupt chip
|
||||
implementation. Developers should check carefuly whether the
|
||||
implementation. Developers should check carefully whether the
|
||||
generic chip fits their needs before implementing the same
|
||||
functionality slightly differently themselves.
|
||||
</para>
|
||||
|
@ -1760,7 +1760,7 @@ as it would be on UP.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There is a furthur optimization possible here: remember our original
|
||||
There is a further optimization possible here: remember our original
|
||||
cache code, where there were no reference counts and the caller simply
|
||||
held the lock whenever using the object? This is still possible: if
|
||||
you hold the lock, no one can delete the object, so you don't need to
|
||||
|
@ -677,7 +677,7 @@ and other resources, etc.
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
ATA_QCFLAG_ACTIVE is clared from qc->flags.
|
||||
ATA_QCFLAG_ACTIVE is cleared from qc->flags.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
@ -708,7 +708,7 @@ and other resources, etc.
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
qc->waiting is claread & completed (in that order).
|
||||
qc->waiting is cleared & completed (in that order).
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
@ -1163,7 +1163,7 @@ and other resources, etc.
|
||||
|
||||
<para>
|
||||
Once sense data is acquired, this type of errors can be
|
||||
handled similary to other SCSI errors. Note that sense data
|
||||
handled similarly to other SCSI errors. Note that sense data
|
||||
may indicate ATA bus error (e.g. Sense Key 04h HARDWARE ERROR
|
||||
&& ASC/ASCQ 47h/00h SCSI PARITY ERROR). In such
|
||||
cases, the error should be considered as an ATA bus error and
|
||||
|
@ -68,7 +68,7 @@
|
||||
several digital tv standards. While it is called as DVB API,
|
||||
in fact it covers several different video standards including
|
||||
DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated
|
||||
to documment support also for DVB-S2, ISDB-T and ISDB-S.</para>
|
||||
to document support also for DVB-S2, ISDB-T and ISDB-S.</para>
|
||||
<para>The third part covers the Remote Controller API.</para>
|
||||
<para>The fourth part covers the Media Controller API.</para>
|
||||
<para>For additional information and for the latest development code,
|
||||
|
@ -91,7 +91,7 @@
|
||||
<listitem><para>
|
||||
[MTD Interface]</para><para>
|
||||
These functions provide the interface to the MTD kernel API.
|
||||
They are not replacable and provide functionality
|
||||
They are not replaceable and provide functionality
|
||||
which is complete hardware independent.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
@ -100,14 +100,14 @@
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
[GENERIC]</para><para>
|
||||
Generic functions are not replacable and provide functionality
|
||||
Generic functions are not replaceable and provide functionality
|
||||
which is complete hardware independent.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
[DEFAULT]</para><para>
|
||||
Default functions provide hardware related functionality which is suitable
|
||||
for most of the implementations. These functions can be replaced by the
|
||||
board driver if neccecary. Those functions are called via pointers in the
|
||||
board driver if necessary. Those functions are called via pointers in the
|
||||
NAND chip description structure. The board driver can set the functions which
|
||||
should be replaced by board dependent functions before calling nand_scan().
|
||||
If the function pointer is NULL on entry to nand_scan() then the pointer
|
||||
@ -264,7 +264,7 @@ static void board_hwcontrol(struct mtd_info *mtd, int cmd)
|
||||
is set up nand_scan() is called. This function tries to
|
||||
detect and identify then chip. If a chip is found all the
|
||||
internal data fields are initialized accordingly.
|
||||
The structure(s) have to be zeroed out first and then filled with the neccecary
|
||||
The structure(s) have to be zeroed out first and then filled with the necessary
|
||||
information about the device.
|
||||
</para>
|
||||
<programlisting>
|
||||
@ -327,7 +327,7 @@ module_init(board_init);
|
||||
<sect1 id="Exit_function">
|
||||
<title>Exit function</title>
|
||||
<para>
|
||||
The exit function is only neccecary if the driver is
|
||||
The exit function is only necessary if the driver is
|
||||
compiled as a module. It releases all resources which
|
||||
are held by the chip driver and unregisters the partitions
|
||||
in the MTD layer.
|
||||
@ -494,7 +494,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
|
||||
in this case. See rts_from4.c and diskonchip.c for
|
||||
implementation reference. In those cases we must also
|
||||
use bad block tables on FLASH, because the ECC layout is
|
||||
interferring with the bad block marker positions.
|
||||
interfering with the bad block marker positions.
|
||||
See bad block table support for details.
|
||||
</para>
|
||||
</sect2>
|
||||
@ -542,7 +542,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
|
||||
<para>
|
||||
nand_scan() calls the function nand_default_bbt().
|
||||
nand_default_bbt() selects appropriate default
|
||||
bad block table desriptors depending on the chip information
|
||||
bad block table descriptors depending on the chip information
|
||||
which was retrieved by nand_scan().
|
||||
</para>
|
||||
<para>
|
||||
@ -554,7 +554,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
|
||||
<sect2 id="Flash_based_tables">
|
||||
<title>Flash based tables</title>
|
||||
<para>
|
||||
It may be desired or neccecary to keep a bad block table in FLASH.
|
||||
It may be desired or necessary to keep a bad block table in FLASH.
|
||||
For AG-AND chips this is mandatory, as they have no factory marked
|
||||
bad blocks. They have factory marked good blocks. The marker pattern
|
||||
is erased when the block is erased to be reused. So in case of
|
||||
@ -565,10 +565,10 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
|
||||
of the blocks.
|
||||
</para>
|
||||
<para>
|
||||
The blocks in which the tables are stored are procteted against
|
||||
The blocks in which the tables are stored are protected against
|
||||
accidental access by marking them bad in the memory bad block
|
||||
table. The bad block table management functions are allowed
|
||||
to circumvernt this protection.
|
||||
to circumvent this protection.
|
||||
</para>
|
||||
<para>
|
||||
The simplest way to activate the FLASH based bad block table support
|
||||
@ -592,7 +592,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
|
||||
User defined tables are created by filling out a
|
||||
nand_bbt_descr structure and storing the pointer in the
|
||||
nand_chip structure member bbt_td before calling nand_scan().
|
||||
If a mirror table is neccecary a second structure must be
|
||||
If a mirror table is necessary a second structure must be
|
||||
created and a pointer to this structure must be stored
|
||||
in bbt_md inside the nand_chip structure. If the bbt_md
|
||||
member is set to NULL then only the main table is used
|
||||
@ -666,7 +666,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
|
||||
<para>
|
||||
For automatic placement some blocks must be reserved for
|
||||
bad block table storage. The number of reserved blocks is defined
|
||||
in the maxblocks member of the babd block table description structure.
|
||||
in the maxblocks member of the bad block table description structure.
|
||||
Reserving 4 blocks for mirrored tables should be a reasonable number.
|
||||
This also limits the number of blocks which are scanned for the bad
|
||||
block table ident pattern.
|
||||
@ -1068,11 +1068,11 @@ in this page</entry>
|
||||
<chapter id="filesystems">
|
||||
<title>Filesystem support</title>
|
||||
<para>
|
||||
The NAND driver provides all neccecary functions for a
|
||||
The NAND driver provides all necessary functions for a
|
||||
filesystem via the MTD interface.
|
||||
</para>
|
||||
<para>
|
||||
Filesystems must be aware of the NAND pecularities and
|
||||
Filesystems must be aware of the NAND peculiarities and
|
||||
restrictions. One major restrictions of NAND Flash is, that you cannot
|
||||
write as often as you want to a page. The consecutive writes to a page,
|
||||
before erasing it again, are restricted to 1-3 writes, depending on the
|
||||
@ -1222,7 +1222,7 @@ in this page</entry>
|
||||
#define NAND_BBT_VERSION 0x00000100
|
||||
/* Create a bbt if none axists */
|
||||
#define NAND_BBT_CREATE 0x00000200
|
||||
/* Write bbt if neccecary */
|
||||
/* Write bbt if necessary */
|
||||
#define NAND_BBT_WRITE 0x00001000
|
||||
/* Read and write back block contents when writing bbt */
|
||||
#define NAND_BBT_SAVECONTENT 0x00002000
|
||||
|
@ -155,7 +155,7 @@
|
||||
release regulators. Functions are
|
||||
provided to <link linkend='API-regulator-enable'>enable</link>
|
||||
and <link linkend='API-regulator-disable'>disable</link> the
|
||||
reguator and to get and set the runtime parameters of the
|
||||
regulator and to get and set the runtime parameters of the
|
||||
regulator.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -766,10 +766,10 @@ framework to set up sysfs files for this region. Simply leave it alone.
|
||||
<para>
|
||||
The dynamic memory regions will be allocated when the UIO device file,
|
||||
<varname>/dev/uioX</varname> is opened.
|
||||
Simiar to static memory resources, the memory region information for
|
||||
Similar to static memory resources, the memory region information for
|
||||
dynamic regions is then visible via sysfs at
|
||||
<varname>/sys/class/uio/uioX/maps/mapY/*</varname>.
|
||||
The dynmaic memory regions will be freed when the UIO device file is
|
||||
The dynamic memory regions will be freed when the UIO device file is
|
||||
closed. When no processes are holding the device file open, the address
|
||||
returned to userspace is ~0.
|
||||
</para>
|
||||
|
@ -153,7 +153,7 @@
|
||||
|
||||
<listitem><para>The Linux USB API supports synchronous calls for
|
||||
control and bulk messages.
|
||||
It also supports asynchnous calls for all kinds of data transfer,
|
||||
It also supports asynchronous calls for all kinds of data transfer,
|
||||
using request structures called "URBs" (USB Request Blocks).
|
||||
</para></listitem>
|
||||
|
||||
|
@ -5696,7 +5696,7 @@ struct _snd_pcm_runtime {
|
||||
suspending the PCM operations via
|
||||
<function>snd_pcm_suspend_all()</function> or
|
||||
<function>snd_pcm_suspend()</function>. It means that the PCM
|
||||
streams are already stoppped when the register snapshot is
|
||||
streams are already stopped when the register snapshot is
|
||||
taken. But, remember that you don't have to restart the PCM
|
||||
stream in the resume callback. It'll be restarted via
|
||||
trigger call with <constant>SNDRV_PCM_TRIGGER_RESUME</constant>
|
||||
|
@ -15,10 +15,13 @@ New sysfs files for controlling P state selection have been added to
|
||||
/sys/devices/system/cpu/intel_pstate/
|
||||
|
||||
max_perf_pct: limits the maximum P state that will be requested by
|
||||
the driver stated as a percentage of the available performance.
|
||||
the driver stated as a percentage of the available performance. The
|
||||
available (P states) performance may be reduced by the no_turbo
|
||||
setting described below.
|
||||
|
||||
min_perf_pct: limits the minimum P state that will be requested by
|
||||
the driver stated as a percentage of the available performance.
|
||||
the driver stated as a percentage of the max (non-turbo)
|
||||
performance level.
|
||||
|
||||
no_turbo: limits the driver to selecting P states below the turbo
|
||||
frequency range.
|
||||
|
@ -9,6 +9,18 @@ Required Properties:
|
||||
- reg: physical base address of the controller and length of memory mapped
|
||||
region.
|
||||
|
||||
Optional Properties:
|
||||
- clocks: List of clock handles. The parent clocks of the input clocks to the
|
||||
devices in this power domain are set to oscclk before power gating
|
||||
and restored back after powering on a domain. This is required for
|
||||
all domains which are powered on and off and not required for unused
|
||||
domains.
|
||||
- clock-names: The following clocks can be specified:
|
||||
- oscclk: Oscillator clock.
|
||||
- pclkN, clkN: Pairs of parent of input clock and input clock to the
|
||||
devices in this power domain. Maximum of 4 pairs (N = 0 to 3)
|
||||
are supported currently.
|
||||
|
||||
Node of a device using power domains must have a samsung,power-domain property
|
||||
defined with a phandle to respective power domain.
|
||||
|
||||
@ -19,6 +31,14 @@ Example:
|
||||
reg = <0x10023C00 0x10>;
|
||||
};
|
||||
|
||||
mfc_pd: power-domain@10044060 {
|
||||
compatible = "samsung,exynos4210-pd";
|
||||
reg = <0x10044060 0x20>;
|
||||
clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK333>,
|
||||
<&clock CLK_MOUT_USER_ACLK333>;
|
||||
clock-names = "oscclk", "pclk0", "clk0";
|
||||
};
|
||||
|
||||
Example of the node using power domain:
|
||||
|
||||
node {
|
||||
|
@ -4,6 +4,13 @@ Required properties:
|
||||
|
||||
- compatible: Must contain one of the following:
|
||||
|
||||
- "renesas,scifa-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFA compatible UART.
|
||||
- "renesas,scifb-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFB compatible UART.
|
||||
- "renesas,scifa-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFA compatible UART.
|
||||
- "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB compatible UART.
|
||||
- "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1) SCIFA compatible UART.
|
||||
- "renesas,scifb-r8a7740" for R8A7740 (R-Mobile A1) SCIFB compatible UART.
|
||||
- "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.
|
||||
- "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART.
|
||||
- "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
|
||||
- "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible UART.
|
||||
|
@ -8,8 +8,8 @@ disk-shock-protection.txt
|
||||
- information on hard disk shock protection.
|
||||
dslm.c
|
||||
- Simple Disk Sleep Monitor program
|
||||
hpfall.c
|
||||
- (HP) laptop accelerometer program for disk protection.
|
||||
freefall.c
|
||||
- (HP/DELL) laptop accelerometer program for disk protection.
|
||||
laptop-mode.txt
|
||||
- how to conserve battery power using laptop-mode.
|
||||
sony-laptop.txt
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* Disk protection for HP machines.
|
||||
/* Disk protection for HP/DELL machines.
|
||||
*
|
||||
* Copyright 2008 Eric Piel
|
||||
* Copyright 2009 Pavel Machek <pavel@ucw.cz>
|
||||
* Copyright 2012 Sonal Santan
|
||||
* Copyright 2014 Pali Rohár <pali.rohar@gmail.com>
|
||||
*
|
||||
* GPLv2.
|
||||
*/
|
||||
@ -18,24 +20,31 @@
|
||||
#include <signal.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sched.h>
|
||||
#include <syslog.h>
|
||||
|
||||
char unload_heads_path[64];
|
||||
static int noled;
|
||||
static char unload_heads_path[64];
|
||||
static char device_path[32];
|
||||
static const char app_name[] = "FREE FALL";
|
||||
|
||||
int set_unload_heads_path(char *device)
|
||||
static int set_unload_heads_path(char *device)
|
||||
{
|
||||
char devname[64];
|
||||
|
||||
if (strlen(device) <= 5 || strncmp(device, "/dev/", 5) != 0)
|
||||
return -EINVAL;
|
||||
strncpy(devname, device + 5, sizeof(devname));
|
||||
strncpy(devname, device + 5, sizeof(devname) - 1);
|
||||
strncpy(device_path, device, sizeof(device_path) - 1);
|
||||
|
||||
snprintf(unload_heads_path, sizeof(unload_heads_path) - 1,
|
||||
"/sys/block/%s/device/unload_heads", devname);
|
||||
return 0;
|
||||
}
|
||||
int valid_disk(void)
|
||||
|
||||
static int valid_disk(void)
|
||||
{
|
||||
int fd = open(unload_heads_path, O_RDONLY);
|
||||
|
||||
if (fd < 0) {
|
||||
perror(unload_heads_path);
|
||||
return 0;
|
||||
@ -45,43 +54,54 @@ int valid_disk(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void write_int(char *path, int i)
|
||||
static void write_int(char *path, int i)
|
||||
{
|
||||
char buf[1024];
|
||||
int fd = open(path, O_RDWR);
|
||||
|
||||
if (fd < 0) {
|
||||
perror("open");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sprintf(buf, "%d", i);
|
||||
|
||||
if (write(fd, buf, strlen(buf)) != strlen(buf)) {
|
||||
perror("write");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
void set_led(int on)
|
||||
static void set_led(int on)
|
||||
{
|
||||
if (noled)
|
||||
return;
|
||||
write_int("/sys/class/leds/hp::hddprotect/brightness", on);
|
||||
}
|
||||
|
||||
void protect(int seconds)
|
||||
static void protect(int seconds)
|
||||
{
|
||||
const char *str = (seconds == 0) ? "Unparked" : "Parked";
|
||||
|
||||
write_int(unload_heads_path, seconds*1000);
|
||||
syslog(LOG_INFO, "%s %s disk head\n", str, device_path);
|
||||
}
|
||||
|
||||
int on_ac(void)
|
||||
static int on_ac(void)
|
||||
{
|
||||
// /sys/class/power_supply/AC0/online
|
||||
/* /sys/class/power_supply/AC0/online */
|
||||
return 1;
|
||||
}
|
||||
|
||||
int lid_open(void)
|
||||
static int lid_open(void)
|
||||
{
|
||||
// /proc/acpi/button/lid/LID/state
|
||||
/* /proc/acpi/button/lid/LID/state */
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ignore_me(void)
|
||||
static void ignore_me(int signum)
|
||||
{
|
||||
protect(0);
|
||||
set_led(0);
|
||||
@ -90,6 +110,7 @@ void ignore_me(void)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int fd, ret;
|
||||
struct stat st;
|
||||
struct sched_param param;
|
||||
|
||||
if (argc == 1)
|
||||
@ -111,7 +132,16 @@ int main(int argc, char **argv)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
daemon(0, 0);
|
||||
if (stat("/sys/class/leds/hp::hddprotect/brightness", &st))
|
||||
noled = 1;
|
||||
|
||||
if (daemon(0, 0) != 0) {
|
||||
perror("daemon");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
openlog(app_name, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
|
||||
|
||||
param.sched_priority = sched_get_priority_max(SCHED_FIFO);
|
||||
sched_setscheduler(0, SCHED_FIFO, ¶m);
|
||||
mlockall(MCL_CURRENT|MCL_FUTURE);
|
||||
@ -141,6 +171,7 @@ int main(int argc, char **argv)
|
||||
alarm(20);
|
||||
}
|
||||
|
||||
closelog();
|
||||
close(fd);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
20
MAINTAINERS
20
MAINTAINERS
@ -1314,6 +1314,20 @@ W: http://oss.renesas.com
|
||||
Q: http://patchwork.kernel.org/project/linux-sh/list/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next
|
||||
S: Supported
|
||||
F: arch/arm/boot/dts/emev2*
|
||||
F: arch/arm/boot/dts/r7s*
|
||||
F: arch/arm/boot/dts/r8a*
|
||||
F: arch/arm/boot/dts/sh*
|
||||
F: arch/arm/configs/ape6evm_defconfig
|
||||
F: arch/arm/configs/armadillo800eva_defconfig
|
||||
F: arch/arm/configs/bockw_defconfig
|
||||
F: arch/arm/configs/genmai_defconfig
|
||||
F: arch/arm/configs/koelsch_defconfig
|
||||
F: arch/arm/configs/kzm9g_defconfig
|
||||
F: arch/arm/configs/lager_defconfig
|
||||
F: arch/arm/configs/mackerel_defconfig
|
||||
F: arch/arm/configs/marzen_defconfig
|
||||
F: arch/arm/configs/shmobile_defconfig
|
||||
F: arch/arm/mach-shmobile/
|
||||
F: drivers/sh/
|
||||
|
||||
@ -6787,7 +6801,7 @@ F: arch/x86/kernel/quirks.c
|
||||
|
||||
PCI DRIVER FOR IMX6
|
||||
M: Richard Zhu <r65037@freescale.com>
|
||||
M: Shawn Guo <shawn.guo@linaro.org>
|
||||
M: Shawn Guo <shawn.guo@freescale.com>
|
||||
L: linux-pci@vger.kernel.org
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
@ -8984,7 +8998,7 @@ F: drivers/media/radio/radio-raremono.c
|
||||
|
||||
THERMAL
|
||||
M: Zhang Rui <rui.zhang@intel.com>
|
||||
M: Eduardo Valentin <eduardo.valentin@ti.com>
|
||||
M: Eduardo Valentin <edubezval@gmail.com>
|
||||
L: linux-pm@vger.kernel.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git
|
||||
@ -9011,7 +9025,7 @@ S: Maintained
|
||||
F: drivers/platform/x86/thinkpad_acpi.c
|
||||
|
||||
TI BANDGAP AND THERMAL DRIVER
|
||||
M: Eduardo Valentin <eduardo.valentin@ti.com>
|
||||
M: Eduardo Valentin <edubezval@gmail.com>
|
||||
L: linux-pm@vger.kernel.org
|
||||
S: Supported
|
||||
F: drivers/thermal/ti-soc-thermal/
|
||||
|
101
Makefile
101
Makefile
@ -1,7 +1,7 @@
|
||||
VERSION = 3
|
||||
PATCHLEVEL = 16
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc4
|
||||
EXTRAVERSION = -rc5
|
||||
NAME = Shuffling Zombie Juror
|
||||
|
||||
# *DOCUMENTATION*
|
||||
@ -41,6 +41,29 @@ unexport GREP_OPTIONS
|
||||
# descending is started. They are now explicitly listed as the
|
||||
# prepare rule.
|
||||
|
||||
# Beautify output
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# Normally, we echo the whole command before executing it. By making
|
||||
# that echo $($(quiet)$(cmd)), we now have the possibility to set
|
||||
# $(quiet) to choose other forms of output instead, e.g.
|
||||
#
|
||||
# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
|
||||
# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
|
||||
#
|
||||
# If $(quiet) is empty, the whole command will be printed.
|
||||
# If it is set to "quiet_", only the short version will be printed.
|
||||
# If it is set to "silent_", nothing will be printed at all, since
|
||||
# the variable $(silent_cmd_cc_o_c) doesn't exist.
|
||||
#
|
||||
# A simple variant is to prefix commands with $(Q) - that's useful
|
||||
# for commands that shall be hidden in non-verbose mode.
|
||||
#
|
||||
# $(Q)ln $@ :<
|
||||
#
|
||||
# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
|
||||
# If KBUILD_VERBOSE equals 1 then the above command is displayed.
|
||||
#
|
||||
# To put more focus on warnings, be less verbose as default
|
||||
# Use 'make V=1' to see the full commands
|
||||
|
||||
@ -51,6 +74,29 @@ ifndef KBUILD_VERBOSE
|
||||
KBUILD_VERBOSE = 0
|
||||
endif
|
||||
|
||||
ifeq ($(KBUILD_VERBOSE),1)
|
||||
quiet =
|
||||
Q =
|
||||
else
|
||||
quiet=quiet_
|
||||
Q = @
|
||||
endif
|
||||
|
||||
# If the user is running make -s (silent mode), suppress echoing of
|
||||
# commands
|
||||
|
||||
ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
|
||||
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
|
||||
quiet=silent_
|
||||
endif
|
||||
else # make-3.8x
|
||||
ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
|
||||
quiet=silent_
|
||||
endif
|
||||
endif
|
||||
|
||||
export quiet Q KBUILD_VERBOSE
|
||||
|
||||
# Call a source code checker (by default, "sparse") as part of the
|
||||
# C compilation.
|
||||
#
|
||||
@ -128,8 +174,11 @@ $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
|
||||
|
||||
# Fake the "Entering directory" message once, so that IDEs/editors are
|
||||
# able to understand relative filenames.
|
||||
echodir := @echo
|
||||
quiet_echodir := @echo
|
||||
silent_echodir := @:
|
||||
sub-make: FORCE
|
||||
@echo "make[1]: Entering directory \`$(KBUILD_OUTPUT)'"
|
||||
$($(quiet)echodir) "make[1]: Entering directory \`$(KBUILD_OUTPUT)'"
|
||||
$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
|
||||
KBUILD_SRC=$(CURDIR) \
|
||||
KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \
|
||||
@ -292,52 +341,6 @@ endif
|
||||
export KBUILD_MODULES KBUILD_BUILTIN
|
||||
export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
|
||||
|
||||
# Beautify output
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# Normally, we echo the whole command before executing it. By making
|
||||
# that echo $($(quiet)$(cmd)), we now have the possibility to set
|
||||
# $(quiet) to choose other forms of output instead, e.g.
|
||||
#
|
||||
# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
|
||||
# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
|
||||
#
|
||||
# If $(quiet) is empty, the whole command will be printed.
|
||||
# If it is set to "quiet_", only the short version will be printed.
|
||||
# If it is set to "silent_", nothing will be printed at all, since
|
||||
# the variable $(silent_cmd_cc_o_c) doesn't exist.
|
||||
#
|
||||
# A simple variant is to prefix commands with $(Q) - that's useful
|
||||
# for commands that shall be hidden in non-verbose mode.
|
||||
#
|
||||
# $(Q)ln $@ :<
|
||||
#
|
||||
# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
|
||||
# If KBUILD_VERBOSE equals 1 then the above command is displayed.
|
||||
|
||||
ifeq ($(KBUILD_VERBOSE),1)
|
||||
quiet =
|
||||
Q =
|
||||
else
|
||||
quiet=quiet_
|
||||
Q = @
|
||||
endif
|
||||
|
||||
# If the user is running make -s (silent mode), suppress echoing of
|
||||
# commands
|
||||
|
||||
ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
|
||||
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
|
||||
quiet=silent_
|
||||
endif
|
||||
else # make-3.8x
|
||||
ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
|
||||
quiet=silent_
|
||||
endif
|
||||
endif
|
||||
|
||||
export quiet Q KBUILD_VERBOSE
|
||||
|
||||
ifneq ($(CC),)
|
||||
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
|
||||
COMPILER := clang
|
||||
@ -1173,7 +1176,7 @@ distclean: mrproper
|
||||
# Packaging of the kernel to various formats
|
||||
# ---------------------------------------------------------------------------
|
||||
# rpm target kept for backward compatibility
|
||||
package-dir := $(srctree)/scripts/package
|
||||
package-dir := scripts/package
|
||||
|
||||
%src-pkg: FORCE
|
||||
$(Q)$(MAKE) $(build)=$(package-dir) $@
|
||||
|
@ -529,8 +529,8 @@
|
||||
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
|
||||
0 0 1 2
|
||||
>;
|
||||
tx-num-evt = <1>;
|
||||
rx-num-evt = <1>;
|
||||
tx-num-evt = <32>;
|
||||
rx-num-evt = <32>;
|
||||
};
|
||||
|
||||
&tps {
|
||||
|
@ -560,8 +560,8 @@
|
||||
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
|
||||
0 0 1 2
|
||||
>;
|
||||
tx-num-evt = <1>;
|
||||
rx-num-evt = <1>;
|
||||
tx-num-evt = <32>;
|
||||
rx-num-evt = <32>;
|
||||
};
|
||||
|
||||
&tscadc {
|
||||
|
@ -105,10 +105,16 @@
|
||||
|
||||
&cpsw_emac0 {
|
||||
phy_id = <&davinci_mdio>, <0>;
|
||||
phy-mode = "rmii";
|
||||
};
|
||||
|
||||
&cpsw_emac1 {
|
||||
phy_id = <&davinci_mdio>, <1>;
|
||||
phy-mode = "rmii";
|
||||
};
|
||||
|
||||
&phy_sel {
|
||||
rmii-clock-ext;
|
||||
};
|
||||
|
||||
&elm {
|
||||
|
@ -1045,6 +1045,8 @@
|
||||
reg = <0x00500000 0x80000
|
||||
0xf803c000 0x400>;
|
||||
interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
clocks = <&usb>, <&udphs_clk>;
|
||||
clock-names = "hclk", "pclk";
|
||||
status = "disabled";
|
||||
|
||||
ep0 {
|
||||
|
@ -240,6 +240,7 @@
|
||||
regulator-name = "ldo3";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
|
@ -673,10 +673,12 @@
|
||||
|
||||
l3_iclk_div: l3_iclk_div {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-factor-clock";
|
||||
compatible = "ti,divider-clock";
|
||||
ti,max-div = <2>;
|
||||
ti,bit-shift = <4>;
|
||||
reg = <0x0100>;
|
||||
clocks = <&dpll_core_h12x2_ck>;
|
||||
clock-mult = <1>;
|
||||
clock-div = <1>;
|
||||
ti,index-power-of-two;
|
||||
};
|
||||
|
||||
l4_root_clk_div: l4_root_clk_div {
|
||||
@ -684,7 +686,7 @@
|
||||
compatible = "fixed-factor-clock";
|
||||
clocks = <&l3_iclk_div>;
|
||||
clock-mult = <1>;
|
||||
clock-div = <1>;
|
||||
clock-div = <2>;
|
||||
};
|
||||
|
||||
video1_clk2_div: video1_clk2_div {
|
||||
|
@ -558,7 +558,7 @@
|
||||
interrupts = <0 37 0>, <0 38 0>, <0 39 0>, <0 40 0>, <0 41 0>;
|
||||
clocks = <&clock CLK_PWM>;
|
||||
clock-names = "timers";
|
||||
#pwm-cells = <2>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
@ -167,7 +167,7 @@
|
||||
compatible = "samsung,exynos5420-audss-clock";
|
||||
reg = <0x03810000 0x0C>;
|
||||
#clock-cells = <1>;
|
||||
clocks = <&clock CLK_FIN_PLL>, <&clock CLK_FOUT_EPLL>,
|
||||
clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MAU_EPLL>,
|
||||
<&clock CLK_SCLK_MAUDIO0>, <&clock CLK_SCLK_MAUPCM0>;
|
||||
clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
|
||||
};
|
||||
@ -260,6 +260,9 @@
|
||||
mfc_pd: power-domain@10044060 {
|
||||
compatible = "samsung,exynos4210-pd";
|
||||
reg = <0x10044060 0x20>;
|
||||
clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK333>,
|
||||
<&clock CLK_MOUT_USER_ACLK333>;
|
||||
clock-names = "oscclk", "pclk0", "clk0";
|
||||
};
|
||||
|
||||
disp_pd: power-domain@100440C0 {
|
||||
|
@ -74,8 +74,6 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_RRR( op "lt" s " r11, r",11,VAL1,", r",14,N(val),", asr r",7, 6,"")\
|
||||
TEST_RR( op "gt" s " r12, r13" ", r",14,val, ", ror r",14,7,"")\
|
||||
TEST_RR( op "le" s " r14, r",0, val, ", r13" ", lsl r",14,8,"")\
|
||||
TEST_RR( op s " r12, pc" ", r",14,val, ", ror r",14,7,"")\
|
||||
TEST_RR( op s " r14, r",0, val, ", pc" ", lsl r",14,8,"")\
|
||||
TEST_R( op "eq" s " r0, r",11,VAL1,", #0xf5") \
|
||||
TEST_R( op "ne" s " r11, r",0, VAL1,", #0xf5000000") \
|
||||
TEST_R( op s " r7, r",8, VAL2,", #0x000af000") \
|
||||
@ -103,8 +101,6 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_RRR( op "ge r",11,VAL1,", r",14,N(val),", asr r",7, 6,"") \
|
||||
TEST_RR( op "le r13" ", r",14,val, ", ror r",14,7,"") \
|
||||
TEST_RR( op "gt r",0, val, ", r13" ", lsl r",14,8,"") \
|
||||
TEST_RR( op " pc" ", r",14,val, ", ror r",14,7,"") \
|
||||
TEST_RR( op " r",0, val, ", pc" ", lsl r",14,8,"") \
|
||||
TEST_R( op "eq r",11,VAL1,", #0xf5") \
|
||||
TEST_R( op "ne r",0, VAL1,", #0xf5000000") \
|
||||
TEST_R( op " r",8, VAL2,", #0x000af000")
|
||||
@ -125,7 +121,6 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_RR( op "ge" s " r11, r",11,N(val),", asr r",7, 6,"") \
|
||||
TEST_RR( op "lt" s " r12, r",11,val, ", ror r",14,7,"") \
|
||||
TEST_R( op "gt" s " r14, r13" ", lsl r",14,8,"") \
|
||||
TEST_R( op "le" s " r14, pc" ", lsl r",14,8,"") \
|
||||
TEST( op "eq" s " r0, #0xf5") \
|
||||
TEST( op "ne" s " r11, #0xf5000000") \
|
||||
TEST( op s " r7, #0x000af000") \
|
||||
@ -159,12 +154,19 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_SUPPORTED("cmp pc, #0x1000");
|
||||
TEST_SUPPORTED("cmp sp, #0x1000");
|
||||
|
||||
/* Data-processing with PC as shift*/
|
||||
/* Data-processing with PC and a shift count in a register */
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe15c0f1e) " @ cmp r12, r14, asl pc")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe1a0cf1e) " @ mov r12, r14, asl pc")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe08caf1e) " @ add r10, r12, r14, asl pc")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe151021f) " @ cmp r1, pc, lsl r2")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe17f0211) " @ cmn pc, r1, lsl r2")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe1a0121f) " @ mov r1, pc, lsl r2")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe1a0f211) " @ mov pc, r1, lsl r2")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe042131f) " @ sub r1, r2, pc, lsl r3")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe1cf1312) " @ bic r1, pc, r2, lsl r3")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe081f312) " @ add pc, r1, r2, lsl r3")
|
||||
|
||||
/* Data-processing with PC as shift*/
|
||||
/* Data-processing with PC as a target and status registers updated */
|
||||
TEST_UNSUPPORTED("movs pc, r1")
|
||||
TEST_UNSUPPORTED("movs pc, r1, lsl r2")
|
||||
TEST_UNSUPPORTED("movs pc, #0x10000")
|
||||
@ -187,14 +189,14 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_BF_R ("add pc, pc, r",14,2f-1f-8,"")
|
||||
TEST_BF_R ("add pc, r",14,2f-1f-8,", pc")
|
||||
TEST_BF_R ("mov pc, r",0,2f,"")
|
||||
TEST_BF_RR("mov pc, r",0,2f,", asl r",1,0,"")
|
||||
TEST_BF_R ("add pc, pc, r",14,(2f-1f-8)*2,", asr #1")
|
||||
TEST_BB( "sub pc, pc, #1b-2b+8")
|
||||
#if __LINUX_ARM_ARCH__ == 6 && !defined(CONFIG_CPU_V7)
|
||||
TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before and after ARMv6 */
|
||||
#endif
|
||||
TEST_BB_R( "sub pc, pc, r",14, 1f-2f+8,"")
|
||||
TEST_BB_R( "rsb pc, r",14,1f-2f+8,", pc")
|
||||
TEST_RR( "add pc, pc, r",10,-2,", asl r",11,1,"")
|
||||
TEST_R( "add pc, pc, r",10,-2,", asl #1")
|
||||
#ifdef CONFIG_THUMB2_KERNEL
|
||||
TEST_ARM_TO_THUMB_INTERWORK_R("add pc, pc, r",0,3f-1f-8+1,"")
|
||||
TEST_ARM_TO_THUMB_INTERWORK_R("sub pc, r",0,3f+8+1,", #8")
|
||||
@ -216,6 +218,7 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_BB_R("bx r",7,2f,"")
|
||||
TEST_BF_R("bxeq r",14,2f,"")
|
||||
|
||||
#if __LINUX_ARM_ARCH__ >= 5
|
||||
TEST_R("clz r0, r",0, 0x0,"")
|
||||
TEST_R("clzeq r7, r",14,0x1,"")
|
||||
TEST_R("clz lr, r",7, 0xffffffff,"")
|
||||
@ -337,6 +340,7 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe16f02e1) " @ smultt pc, r1, r2")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe16002ef) " @ smultt r0, pc, r2")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe1600fe1) " @ smultt r0, r1, pc")
|
||||
#endif
|
||||
|
||||
TEST_GROUP("Multiply and multiply-accumulate")
|
||||
|
||||
@ -559,6 +563,7 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_UNSUPPORTED("ldrsht r1, [r2], #48")
|
||||
#endif
|
||||
|
||||
#if __LINUX_ARM_ARCH__ >= 5
|
||||
TEST_RPR( "strd r",0, VAL1,", [r",1, 48,", -r",2,24,"]")
|
||||
TEST_RPR( "strccd r",8, VAL2,", [r",13,0, ", r",12,48,"]")
|
||||
TEST_RPR( "strd r",4, VAL1,", [r",2, 24,", r",3, 48,"]!")
|
||||
@ -595,6 +600,7 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe1efc3d0) " @ ldrd r12, [pc, #48]!")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe0c9f3d0) " @ ldrd pc, [r9], #48")
|
||||
TEST_UNSUPPORTED(__inst_arm(0xe0c9e3d0) " @ ldrd lr, [r9], #48")
|
||||
#endif
|
||||
|
||||
TEST_GROUP("Miscellaneous")
|
||||
|
||||
@ -1227,7 +1233,9 @@ void kprobe_arm_test_cases(void)
|
||||
TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0")
|
||||
|
||||
COPROCESSOR_INSTRUCTIONS_ST_LD("",e)
|
||||
#if __LINUX_ARM_ARCH__ >= 5
|
||||
COPROCESSOR_INSTRUCTIONS_MC_MR("",e)
|
||||
#endif
|
||||
TEST_UNSUPPORTED("svc 0")
|
||||
TEST_UNSUPPORTED("svc 0xffffff")
|
||||
|
||||
@ -1287,7 +1295,9 @@ void kprobe_arm_test_cases(void)
|
||||
TEST( "blx __dummy_thumb_subroutine_odd")
|
||||
#endif /* __LINUX_ARM_ARCH__ >= 6 */
|
||||
|
||||
#if __LINUX_ARM_ARCH__ >= 5
|
||||
COPROCESSOR_INSTRUCTIONS_ST_LD("2",f)
|
||||
#endif
|
||||
#if __LINUX_ARM_ARCH__ >= 6
|
||||
COPROCESSOR_INSTRUCTIONS_MC_MR("2",f)
|
||||
#endif
|
||||
|
@ -225,6 +225,7 @@ static int pre_handler_called;
|
||||
static int post_handler_called;
|
||||
static int jprobe_func_called;
|
||||
static int kretprobe_handler_called;
|
||||
static int tests_failed;
|
||||
|
||||
#define FUNC_ARG1 0x12345678
|
||||
#define FUNC_ARG2 0xabcdef
|
||||
@ -461,6 +462,13 @@ static int run_api_tests(long (*func)(long, long))
|
||||
|
||||
pr_info(" jprobe\n");
|
||||
ret = test_jprobe(func);
|
||||
#if defined(CONFIG_THUMB2_KERNEL) && !defined(MODULE)
|
||||
if (ret == -EINVAL) {
|
||||
pr_err("FAIL: Known longtime bug with jprobe on Thumb kernels\n");
|
||||
tests_failed = ret;
|
||||
ret = 0;
|
||||
}
|
||||
#endif
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -1671,6 +1679,8 @@ static int __init run_all_tests(void)
|
||||
#endif
|
||||
|
||||
out:
|
||||
if (ret == 0)
|
||||
ret = tests_failed;
|
||||
if (ret == 0)
|
||||
pr_info("Finished kprobe tests OK\n");
|
||||
else
|
||||
|
@ -341,12 +341,12 @@ static const union decode_item arm_cccc_000x_table[] = {
|
||||
/* CMP (reg-shift reg) cccc 0001 0101 xxxx xxxx xxxx 0xx1 xxxx */
|
||||
/* CMN (reg-shift reg) cccc 0001 0111 xxxx xxxx xxxx 0xx1 xxxx */
|
||||
DECODE_EMULATEX (0x0f900090, 0x01100010, PROBES_DATA_PROCESSING_REG,
|
||||
REGS(ANY, 0, NOPC, 0, ANY)),
|
||||
REGS(NOPC, 0, NOPC, 0, NOPC)),
|
||||
|
||||
/* MOV (reg-shift reg) cccc 0001 101x xxxx xxxx xxxx 0xx1 xxxx */
|
||||
/* MVN (reg-shift reg) cccc 0001 111x xxxx xxxx xxxx 0xx1 xxxx */
|
||||
DECODE_EMULATEX (0x0fa00090, 0x01a00010, PROBES_DATA_PROCESSING_REG,
|
||||
REGS(0, ANY, NOPC, 0, ANY)),
|
||||
REGS(0, NOPC, NOPC, 0, NOPC)),
|
||||
|
||||
/* AND (reg-shift reg) cccc 0000 000x xxxx xxxx xxxx 0xx1 xxxx */
|
||||
/* EOR (reg-shift reg) cccc 0000 001x xxxx xxxx xxxx 0xx1 xxxx */
|
||||
@ -359,7 +359,7 @@ static const union decode_item arm_cccc_000x_table[] = {
|
||||
/* ORR (reg-shift reg) cccc 0001 100x xxxx xxxx xxxx 0xx1 xxxx */
|
||||
/* BIC (reg-shift reg) cccc 0001 110x xxxx xxxx xxxx 0xx1 xxxx */
|
||||
DECODE_EMULATEX (0x0e000090, 0x00000010, PROBES_DATA_PROCESSING_REG,
|
||||
REGS(ANY, ANY, NOPC, 0, ANY)),
|
||||
REGS(NOPC, NOPC, NOPC, 0, NOPC)),
|
||||
|
||||
DECODE_END
|
||||
};
|
||||
|
@ -173,10 +173,8 @@ static struct platform_device exynos_cpuidle = {
|
||||
|
||||
void __init exynos_cpuidle_init(void)
|
||||
{
|
||||
if (soc_is_exynos5440())
|
||||
return;
|
||||
|
||||
platform_device_register(&exynos_cpuidle);
|
||||
if (soc_is_exynos4210() || soc_is_exynos5250())
|
||||
platform_device_register(&exynos_cpuidle);
|
||||
}
|
||||
|
||||
void __init exynos_cpufreq_init(void)
|
||||
@ -297,7 +295,7 @@ static void __init exynos_dt_machine_init(void)
|
||||
* This is called from smp_prepare_cpus if we've built for SMP, but
|
||||
* we still need to set it up for PM and firmware ops if not.
|
||||
*/
|
||||
if (!IS_ENABLED(SMP))
|
||||
if (!IS_ENABLED(CONFIG_SMP))
|
||||
exynos_sysram_init();
|
||||
|
||||
exynos_cpuidle_init();
|
||||
|
@ -57,8 +57,13 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
|
||||
|
||||
boot_reg = sysram_ns_base_addr + 0x1c;
|
||||
|
||||
if (!soc_is_exynos4212() && !soc_is_exynos3250())
|
||||
boot_reg += 4*cpu;
|
||||
/*
|
||||
* Almost all Exynos-series of SoCs that run in secure mode don't need
|
||||
* additional offset for every CPU, with Exynos4412 being the only
|
||||
* exception.
|
||||
*/
|
||||
if (soc_is_exynos4412())
|
||||
boot_reg += 4 * cpu;
|
||||
|
||||
__raw_writel(boot_addr, boot_reg);
|
||||
return 0;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/pm_domain.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_platform.h>
|
||||
@ -24,6 +25,8 @@
|
||||
|
||||
#include "regs-pmu.h"
|
||||
|
||||
#define MAX_CLK_PER_DOMAIN 4
|
||||
|
||||
/*
|
||||
* Exynos specific wrapper around the generic power domain
|
||||
*/
|
||||
@ -32,6 +35,9 @@ struct exynos_pm_domain {
|
||||
char const *name;
|
||||
bool is_off;
|
||||
struct generic_pm_domain pd;
|
||||
struct clk *oscclk;
|
||||
struct clk *clk[MAX_CLK_PER_DOMAIN];
|
||||
struct clk *pclk[MAX_CLK_PER_DOMAIN];
|
||||
};
|
||||
|
||||
static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
|
||||
@ -44,6 +50,19 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
|
||||
pd = container_of(domain, struct exynos_pm_domain, pd);
|
||||
base = pd->base;
|
||||
|
||||
/* Set oscclk before powering off a domain*/
|
||||
if (!power_on) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
|
||||
if (IS_ERR(pd->clk[i]))
|
||||
break;
|
||||
if (clk_set_parent(pd->clk[i], pd->oscclk))
|
||||
pr_err("%s: error setting oscclk as parent to clock %d\n",
|
||||
pd->name, i);
|
||||
}
|
||||
}
|
||||
|
||||
pwr = power_on ? S5P_INT_LOCAL_PWR_EN : 0;
|
||||
__raw_writel(pwr, base);
|
||||
|
||||
@ -60,6 +79,20 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
|
||||
cpu_relax();
|
||||
usleep_range(80, 100);
|
||||
}
|
||||
|
||||
/* Restore clocks after powering on a domain*/
|
||||
if (power_on) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
|
||||
if (IS_ERR(pd->clk[i]))
|
||||
break;
|
||||
if (clk_set_parent(pd->clk[i], pd->pclk[i]))
|
||||
pr_err("%s: error setting parent to clock%d\n",
|
||||
pd->name, i);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -152,9 +185,11 @@ static __init int exynos4_pm_init_power_domain(void)
|
||||
|
||||
for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
|
||||
struct exynos_pm_domain *pd;
|
||||
int on;
|
||||
int on, i;
|
||||
struct device *dev;
|
||||
|
||||
pdev = of_find_device_by_node(np);
|
||||
dev = &pdev->dev;
|
||||
|
||||
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
|
||||
if (!pd) {
|
||||
@ -170,6 +205,30 @@ static __init int exynos4_pm_init_power_domain(void)
|
||||
pd->pd.power_on = exynos_pd_power_on;
|
||||
pd->pd.of_node = np;
|
||||
|
||||
pd->oscclk = clk_get(dev, "oscclk");
|
||||
if (IS_ERR(pd->oscclk))
|
||||
goto no_clk;
|
||||
|
||||
for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
|
||||
char clk_name[8];
|
||||
|
||||
snprintf(clk_name, sizeof(clk_name), "clk%d", i);
|
||||
pd->clk[i] = clk_get(dev, clk_name);
|
||||
if (IS_ERR(pd->clk[i]))
|
||||
break;
|
||||
snprintf(clk_name, sizeof(clk_name), "pclk%d", i);
|
||||
pd->pclk[i] = clk_get(dev, clk_name);
|
||||
if (IS_ERR(pd->pclk[i])) {
|
||||
clk_put(pd->clk[i]);
|
||||
pd->clk[i] = ERR_PTR(-EINVAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ERR(pd->clk[0]))
|
||||
clk_put(pd->oscclk);
|
||||
|
||||
no_clk:
|
||||
platform_set_drvdata(pdev, pd);
|
||||
|
||||
on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
|
||||
|
@ -67,8 +67,12 @@ static void clk_gate2_disable(struct clk_hw *hw)
|
||||
|
||||
spin_lock_irqsave(gate->lock, flags);
|
||||
|
||||
if (gate->share_count && --(*gate->share_count) > 0)
|
||||
goto out;
|
||||
if (gate->share_count) {
|
||||
if (WARN_ON(*gate->share_count == 0))
|
||||
goto out;
|
||||
else if (--(*gate->share_count) > 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
reg = readl(gate->reg);
|
||||
reg &= ~(3 << gate->bit_idx);
|
||||
@ -78,19 +82,26 @@ out:
|
||||
spin_unlock_irqrestore(gate->lock, flags);
|
||||
}
|
||||
|
||||
static int clk_gate2_is_enabled(struct clk_hw *hw)
|
||||
static int clk_gate2_reg_is_enabled(void __iomem *reg, u8 bit_idx)
|
||||
{
|
||||
u32 reg;
|
||||
struct clk_gate2 *gate = to_clk_gate2(hw);
|
||||
u32 val = readl(reg);
|
||||
|
||||
reg = readl(gate->reg);
|
||||
|
||||
if (((reg >> gate->bit_idx) & 1) == 1)
|
||||
if (((val >> bit_idx) & 1) == 1)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int clk_gate2_is_enabled(struct clk_hw *hw)
|
||||
{
|
||||
struct clk_gate2 *gate = to_clk_gate2(hw);
|
||||
|
||||
if (gate->share_count)
|
||||
return !!(*gate->share_count);
|
||||
else
|
||||
return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx);
|
||||
}
|
||||
|
||||
static struct clk_ops clk_gate2_ops = {
|
||||
.enable = clk_gate2_enable,
|
||||
.disable = clk_gate2_disable,
|
||||
@ -116,6 +127,10 @@ struct clk *clk_register_gate2(struct device *dev, const char *name,
|
||||
gate->bit_idx = bit_idx;
|
||||
gate->flags = clk_gate2_flags;
|
||||
gate->lock = lock;
|
||||
|
||||
/* Initialize share_count per hardware state */
|
||||
if (share_count)
|
||||
*share_count = clk_gate2_reg_is_enabled(reg, bit_idx) ? 1 : 0;
|
||||
gate->share_count = share_count;
|
||||
|
||||
init.name = name;
|
||||
|
@ -76,7 +76,7 @@
|
||||
* (assuming that it is counting N upwards), or -2 if the enclosing loop
|
||||
* should skip to the next iteration (again assuming N is increasing).
|
||||
*/
|
||||
static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n)
|
||||
static int _dpll_test_fint(struct clk_hw_omap *clk, unsigned int n)
|
||||
{
|
||||
struct dpll_data *dd;
|
||||
long fint, fint_min, fint_max;
|
||||
|
@ -26,11 +26,14 @@
|
||||
#define OMAP3430_EN_WDT3_SHIFT 12
|
||||
#define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK (1 << 0)
|
||||
#define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT 0
|
||||
#define OMAP3430_IVA2_DPLL_FREQSEL_SHIFT 4
|
||||
#define OMAP3430_IVA2_DPLL_FREQSEL_MASK (0xf << 4)
|
||||
#define OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT 3
|
||||
#define OMAP3430_EN_IVA2_DPLL_SHIFT 0
|
||||
#define OMAP3430_EN_IVA2_DPLL_MASK (0x7 << 0)
|
||||
#define OMAP3430_ST_IVA2_SHIFT 0
|
||||
#define OMAP3430_ST_IVA2_CLK_MASK (1 << 0)
|
||||
#define OMAP3430_AUTO_IVA2_DPLL_SHIFT 0
|
||||
#define OMAP3430_AUTO_IVA2_DPLL_MASK (0x7 << 0)
|
||||
#define OMAP3430_IVA2_CLK_SRC_SHIFT 19
|
||||
#define OMAP3430_IVA2_CLK_SRC_WIDTH 3
|
||||
|
@ -162,7 +162,8 @@ static inline void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
|
||||
#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
|
||||
defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
|
||||
void omap44xx_restart(enum reboot_mode mode, const char *cmd);
|
||||
#else
|
||||
static inline void omap44xx_restart(enum reboot_mode mode, const char *cmd)
|
||||
|
@ -297,33 +297,6 @@ static void omap_init_audio(void)
|
||||
static inline void omap_init_audio(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
|
||||
defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
|
||||
|
||||
static struct platform_device omap_hdmi_audio = {
|
||||
.name = "omap-hdmi-audio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
static void __init omap_init_hdmi_audio(void)
|
||||
{
|
||||
struct omap_hwmod *oh;
|
||||
struct platform_device *pdev;
|
||||
|
||||
oh = omap_hwmod_lookup("dss_hdmi");
|
||||
if (!oh)
|
||||
return;
|
||||
|
||||
pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0);
|
||||
WARN(IS_ERR(pdev),
|
||||
"Can't build omap_device for omap-hdmi-audio-dai.\n");
|
||||
|
||||
platform_device_register(&omap_hdmi_audio);
|
||||
}
|
||||
#else
|
||||
static inline void omap_init_hdmi_audio(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
|
||||
|
||||
#include <linux/platform_data/spi-omap2-mcspi.h>
|
||||
@ -459,7 +432,6 @@ static int __init omap2_init_devices(void)
|
||||
*/
|
||||
omap_init_audio();
|
||||
omap_init_camera();
|
||||
omap_init_hdmi_audio();
|
||||
omap_init_mbox();
|
||||
/* If dtb is there, the devices will be created dynamically */
|
||||
if (!of_have_populated_dt()) {
|
||||
|
@ -29,6 +29,7 @@
|
||||
#ifdef CONFIG_TIDSPBRIDGE_DVFS
|
||||
#include "omap-pm.h"
|
||||
#endif
|
||||
#include "soc.h"
|
||||
|
||||
#include <linux/platform_data/dsp-omap.h>
|
||||
|
||||
@ -59,6 +60,9 @@ void __init omap_dsp_reserve_sdram_memblock(void)
|
||||
phys_addr_t size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
|
||||
phys_addr_t paddr;
|
||||
|
||||
if (!cpu_is_omap34xx())
|
||||
return;
|
||||
|
||||
if (!size)
|
||||
return;
|
||||
|
||||
@ -83,6 +87,9 @@ static int __init omap_dsp_init(void)
|
||||
int err = -ENOMEM;
|
||||
struct omap_dsp_platform_data *pdata = &omap_dsp_pdata;
|
||||
|
||||
if (!cpu_is_omap34xx())
|
||||
return 0;
|
||||
|
||||
pdata->phys_mempool_base = omap_dsp_get_mempool_base();
|
||||
|
||||
if (pdata->phys_mempool_base) {
|
||||
@ -115,6 +122,9 @@ module_init(omap_dsp_init);
|
||||
|
||||
static void __exit omap_dsp_exit(void)
|
||||
{
|
||||
if (!cpu_is_omap34xx())
|
||||
return;
|
||||
|
||||
platform_device_unregister(omap_dsp_pdev);
|
||||
}
|
||||
module_exit(omap_dsp_exit);
|
||||
|
@ -1615,7 +1615,7 @@ static int gpmc_probe_dt(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
for_each_child_of_node(pdev->dev.of_node, child) {
|
||||
for_each_available_child_of_node(pdev->dev.of_node, child) {
|
||||
|
||||
if (!child->name)
|
||||
continue;
|
||||
|
@ -1268,9 +1268,6 @@ static struct omap_hwmod_class dra7xx_sata_hwmod_class = {
|
||||
};
|
||||
|
||||
/* sata */
|
||||
static struct omap_hwmod_opt_clk sata_opt_clks[] = {
|
||||
{ .role = "ref_clk", .clk = "sata_ref_clk" },
|
||||
};
|
||||
|
||||
static struct omap_hwmod dra7xx_sata_hwmod = {
|
||||
.name = "sata",
|
||||
@ -1278,6 +1275,7 @@ static struct omap_hwmod dra7xx_sata_hwmod = {
|
||||
.clkdm_name = "l3init_clkdm",
|
||||
.flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
|
||||
.main_clk = "func_48m_fclk",
|
||||
.mpu_rt_idx = 1,
|
||||
.prcm = {
|
||||
.omap4 = {
|
||||
.clkctrl_offs = DRA7XX_CM_L3INIT_SATA_CLKCTRL_OFFSET,
|
||||
@ -1285,8 +1283,6 @@ static struct omap_hwmod dra7xx_sata_hwmod = {
|
||||
.modulemode = MODULEMODE_SWCTRL,
|
||||
},
|
||||
},
|
||||
.opt_clks = sata_opt_clks,
|
||||
.opt_clks_cnt = ARRAY_SIZE(sata_opt_clks),
|
||||
};
|
||||
|
||||
/*
|
||||
@ -1731,8 +1727,20 @@ static struct omap_hwmod dra7xx_uart6_hwmod = {
|
||||
*
|
||||
*/
|
||||
|
||||
static struct omap_hwmod_class_sysconfig dra7xx_usb_otg_ss_sysc = {
|
||||
.rev_offs = 0x0000,
|
||||
.sysc_offs = 0x0010,
|
||||
.sysc_flags = (SYSC_HAS_DMADISABLE | SYSC_HAS_MIDLEMODE |
|
||||
SYSC_HAS_SIDLEMODE),
|
||||
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
|
||||
SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
|
||||
MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
|
||||
.sysc_fields = &omap_hwmod_sysc_type2,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_class dra7xx_usb_otg_ss_hwmod_class = {
|
||||
.name = "usb_otg_ss",
|
||||
.sysc = &dra7xx_usb_otg_ss_sysc,
|
||||
};
|
||||
|
||||
/* usb_otg_ss1 */
|
||||
|
@ -35,6 +35,8 @@
|
||||
#define OMAP3430_LOGICSTATEST_MASK (1 << 2)
|
||||
#define OMAP3430_LASTLOGICSTATEENTERED_MASK (1 << 2)
|
||||
#define OMAP3430_LASTPOWERSTATEENTERED_MASK (0x3 << 0)
|
||||
#define OMAP3430_GRPSEL_MCBSP5_MASK (1 << 10)
|
||||
#define OMAP3430_GRPSEL_MCBSP1_MASK (1 << 9)
|
||||
#define OMAP3630_GRPSEL_UART4_MASK (1 << 18)
|
||||
#define OMAP3430_GRPSEL_GPIO6_MASK (1 << 17)
|
||||
#define OMAP3430_GRPSEL_GPIO5_MASK (1 << 16)
|
||||
@ -42,6 +44,10 @@
|
||||
#define OMAP3430_GRPSEL_GPIO3_MASK (1 << 14)
|
||||
#define OMAP3430_GRPSEL_GPIO2_MASK (1 << 13)
|
||||
#define OMAP3430_GRPSEL_UART3_MASK (1 << 11)
|
||||
#define OMAP3430_GRPSEL_GPT8_MASK (1 << 9)
|
||||
#define OMAP3430_GRPSEL_GPT7_MASK (1 << 8)
|
||||
#define OMAP3430_GRPSEL_GPT6_MASK (1 << 7)
|
||||
#define OMAP3430_GRPSEL_GPT5_MASK (1 << 6)
|
||||
#define OMAP3430_GRPSEL_MCBSP4_MASK (1 << 2)
|
||||
#define OMAP3430_GRPSEL_MCBSP3_MASK (1 << 1)
|
||||
#define OMAP3430_GRPSEL_MCBSP2_MASK (1 << 0)
|
||||
|
@ -664,7 +664,7 @@ static int l2c310_cpu_enable_flz(struct notifier_block *nb, unsigned long act, v
|
||||
|
||||
static void __init l2c310_enable(void __iomem *base, u32 aux, unsigned num_lock)
|
||||
{
|
||||
unsigned rev = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_PART_MASK;
|
||||
unsigned rev = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_RTL_MASK;
|
||||
bool cortex_a9 = read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9;
|
||||
|
||||
if (rev >= L310_CACHE_ID_RTL_R2P0) {
|
||||
|
@ -56,6 +56,8 @@
|
||||
#define TASK_SIZE_32 UL(0x100000000)
|
||||
#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \
|
||||
TASK_SIZE_32 : TASK_SIZE_64)
|
||||
#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \
|
||||
TASK_SIZE_32 : TASK_SIZE_64)
|
||||
#else
|
||||
#define TASK_SIZE TASK_SIZE_64
|
||||
#endif /* CONFIG_COMPAT */
|
||||
|
@ -27,8 +27,10 @@ void __cpu_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
|
||||
copy_page(kto, kfrom);
|
||||
__flush_dcache_area(kto, PAGE_SIZE);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__cpu_copy_user_page);
|
||||
|
||||
void __cpu_clear_user_page(void *kaddr, unsigned long vaddr)
|
||||
{
|
||||
clear_page(kaddr);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__cpu_clear_user_page);
|
||||
|
@ -921,7 +921,8 @@ L(nocon):
|
||||
jls 1f
|
||||
lsrl #1,%d1
|
||||
1:
|
||||
movel %d1,m68k_init_mapped_size
|
||||
lea %pc@(m68k_init_mapped_size),%a0
|
||||
movel %d1,%a0@
|
||||
mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\
|
||||
%pc@(m68k_supervisor_cachemode)
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/kernel.h>
|
||||
@ -30,6 +31,7 @@
|
||||
|
||||
|
||||
unsigned long (*mach_random_get_entropy)(void);
|
||||
EXPORT_SYMBOL_GPL(mach_random_get_entropy);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1210,7 +1210,8 @@ static struct hp_hardware hp_hardware_list[] = {
|
||||
{HPHW_FIO, 0x004, 0x00320, 0x0, "Metheus Frame Buffer"},
|
||||
{HPHW_FIO, 0x004, 0x00340, 0x0, "BARCO CX4500 VME Grphx Cnsl"},
|
||||
{HPHW_FIO, 0x004, 0x00360, 0x0, "Hughes TOG VME FDDI"},
|
||||
{HPHW_FIO, 0x076, 0x000AD, 0x00, "Crestone Peak RS-232"},
|
||||
{HPHW_FIO, 0x076, 0x000AD, 0x0, "Crestone Peak Core RS-232"},
|
||||
{HPHW_FIO, 0x077, 0x000AD, 0x0, "Crestone Peak Fast? Core RS-232"},
|
||||
{HPHW_IOA, 0x185, 0x0000B, 0x00, "Java BC Summit Port"},
|
||||
{HPHW_IOA, 0x1FF, 0x0000B, 0x00, "Hitachi Ghostview Summit Port"},
|
||||
{HPHW_IOA, 0x580, 0x0000B, 0x10, "U2-IOA BC Runway Port"},
|
||||
|
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2000-2001 Hewlett Packard Company
|
||||
* Copyright (C) 2000 John Marvin
|
||||
* Copyright (C) 2001 Matthew Wilcox
|
||||
* Copyright (C) 2014 Helge Deller <deller@gmx.de>
|
||||
*
|
||||
* These routines maintain argument size conversion between 32bit and 64bit
|
||||
* environment. Based heavily on sys_ia32.c and sys_sparc32.c.
|
||||
@ -11,44 +12,8 @@
|
||||
|
||||
#include <linux/compat.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/resource.h>
|
||||
#include <linux/times.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/sem.h>
|
||||
#include <linux/shm.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/uio.h>
|
||||
#include <linux/ncp_fs.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/personality.h>
|
||||
#include <linux/stat.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/highuid.h>
|
||||
#include <linux/mman.h>
|
||||
#include <linux/binfmts.h>
|
||||
#include <linux/namei.h>
|
||||
#include <linux/vfs.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/swap.h>
|
||||
#include <linux/syscalls.h>
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/mmu_context.h>
|
||||
|
||||
#undef DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DBG(x) printk x
|
||||
#else
|
||||
#define DBG(x)
|
||||
#endif
|
||||
|
||||
asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
|
||||
int r22, int r21, int r20)
|
||||
@ -57,3 +22,12 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
|
||||
current->comm, current->pid, r20);
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
asmlinkage long sys32_fanotify_mark(compat_int_t fanotify_fd, compat_uint_t flags,
|
||||
compat_uint_t mask0, compat_uint_t mask1, compat_int_t dfd,
|
||||
const char __user * pathname)
|
||||
{
|
||||
return sys_fanotify_mark(fanotify_fd, flags,
|
||||
((__u64)mask1 << 32) | mask0,
|
||||
dfd, pathname);
|
||||
}
|
||||
|
@ -418,7 +418,7 @@
|
||||
ENTRY_SAME(accept4) /* 320 */
|
||||
ENTRY_SAME(prlimit64)
|
||||
ENTRY_SAME(fanotify_init)
|
||||
ENTRY_COMP(fanotify_mark)
|
||||
ENTRY_DIFF(fanotify_mark)
|
||||
ENTRY_COMP(clock_adjtime)
|
||||
ENTRY_SAME(name_to_handle_at) /* 325 */
|
||||
ENTRY_COMP(open_by_handle_at)
|
||||
|
@ -414,7 +414,7 @@ config KEXEC
|
||||
config CRASH_DUMP
|
||||
bool "Build a kdump crash kernel"
|
||||
depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP)
|
||||
select RELOCATABLE if PPC64 || 44x || FSL_BOOKE
|
||||
select RELOCATABLE if (PPC64 && !COMPILE_TEST) || 44x || FSL_BOOKE
|
||||
help
|
||||
Build a kernel suitable for use as a kdump capture kernel.
|
||||
The same kernel binary can be used as production kernel and dump
|
||||
@ -1017,6 +1017,7 @@ endmenu
|
||||
if PPC64
|
||||
config RELOCATABLE
|
||||
bool "Build a relocatable kernel"
|
||||
depends on !COMPILE_TEST
|
||||
select NONSTATIC_KERNEL
|
||||
help
|
||||
This builds a kernel image that is capable of running anywhere
|
||||
|
@ -19,8 +19,7 @@
|
||||
#define MMU_FTR_TYPE_40x ASM_CONST(0x00000004)
|
||||
#define MMU_FTR_TYPE_44x ASM_CONST(0x00000008)
|
||||
#define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010)
|
||||
#define MMU_FTR_TYPE_3E ASM_CONST(0x00000020)
|
||||
#define MMU_FTR_TYPE_47x ASM_CONST(0x00000040)
|
||||
#define MMU_FTR_TYPE_47x ASM_CONST(0x00000020)
|
||||
|
||||
/*
|
||||
* This is individual features
|
||||
@ -106,13 +105,6 @@
|
||||
MMU_FTR_CI_LARGE_PAGE
|
||||
#define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
|
||||
MMU_FTR_CI_LARGE_PAGE | MMU_FTR_NO_SLBIE_B
|
||||
#define MMU_FTRS_A2 MMU_FTR_TYPE_3E | MMU_FTR_USE_TLBILX | \
|
||||
MMU_FTR_USE_TLBIVAX_BCAST | \
|
||||
MMU_FTR_LOCK_BCAST_INVAL | \
|
||||
MMU_FTR_USE_TLBRSRV | \
|
||||
MMU_FTR_USE_PAIRED_MAS | \
|
||||
MMU_FTR_TLBIEL | \
|
||||
MMU_FTR_16M_PAGE
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <asm/cputable.h>
|
||||
|
||||
|
@ -61,8 +61,7 @@ struct power_pmu {
|
||||
#define PPMU_SIAR_VALID 0x00000010 /* Processor has SIAR Valid bit */
|
||||
#define PPMU_HAS_SSLOT 0x00000020 /* Has sampled slot in MMCRA */
|
||||
#define PPMU_HAS_SIER 0x00000040 /* Has SIER */
|
||||
#define PPMU_BHRB 0x00000080 /* has BHRB feature enabled */
|
||||
#define PPMU_EBB 0x00000100 /* supports event based branch */
|
||||
#define PPMU_ARCH_207S 0x00000080 /* PMC is architecture v2.07S */
|
||||
|
||||
/*
|
||||
* Values for flags to get_alternatives()
|
||||
|
@ -131,7 +131,7 @@ _GLOBAL(power7_nap)
|
||||
|
||||
_GLOBAL(power7_sleep)
|
||||
li r3,1
|
||||
li r4,0
|
||||
li r4,1
|
||||
b power7_powersave_common
|
||||
/* No return */
|
||||
|
||||
|
@ -127,11 +127,6 @@ BEGIN_FTR_SECTION
|
||||
stw r10, HSTATE_PMC + 24(r13)
|
||||
stw r11, HSTATE_PMC + 28(r13)
|
||||
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201)
|
||||
BEGIN_FTR_SECTION
|
||||
mfspr r9, SPRN_SIER
|
||||
std r8, HSTATE_MMCR + 40(r13)
|
||||
std r9, HSTATE_MMCR + 48(r13)
|
||||
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
|
||||
31:
|
||||
|
||||
/*
|
||||
|
@ -410,17 +410,7 @@ void __init mmu_context_init(void)
|
||||
} else if (mmu_has_feature(MMU_FTR_TYPE_47x)) {
|
||||
first_context = 1;
|
||||
last_context = 65535;
|
||||
} else
|
||||
#ifdef CONFIG_PPC_BOOK3E_MMU
|
||||
if (mmu_has_feature(MMU_FTR_TYPE_3E)) {
|
||||
u32 mmucfg = mfspr(SPRN_MMUCFG);
|
||||
u32 pid_bits = (mmucfg & MMUCFG_PIDSIZE_MASK)
|
||||
>> MMUCFG_PIDSIZE_SHIFT;
|
||||
first_context = 1;
|
||||
last_context = (1UL << (pid_bits + 1)) - 1;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
first_context = 1;
|
||||
last_context = 255;
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ static bool is_ebb_event(struct perf_event *event)
|
||||
* check that the PMU supports EBB, meaning those that don't can still
|
||||
* use bit 63 of the event code for something else if they wish.
|
||||
*/
|
||||
return (ppmu->flags & PPMU_EBB) &&
|
||||
return (ppmu->flags & PPMU_ARCH_207S) &&
|
||||
((event->attr.config >> PERF_EVENT_CONFIG_EBB_SHIFT) & 1);
|
||||
}
|
||||
|
||||
@ -777,7 +777,7 @@ void perf_event_print_debug(void)
|
||||
if (ppmu->flags & PPMU_HAS_SIER)
|
||||
sier = mfspr(SPRN_SIER);
|
||||
|
||||
if (ppmu->flags & PPMU_EBB) {
|
||||
if (ppmu->flags & PPMU_ARCH_207S) {
|
||||
pr_info("MMCR2: %016lx EBBHR: %016lx\n",
|
||||
mfspr(SPRN_MMCR2), mfspr(SPRN_EBBHR));
|
||||
pr_info("EBBRR: %016lx BESCR: %016lx\n",
|
||||
@ -996,7 +996,22 @@ static void power_pmu_read(struct perf_event *event)
|
||||
} while (local64_cmpxchg(&event->hw.prev_count, prev, val) != prev);
|
||||
|
||||
local64_add(delta, &event->count);
|
||||
local64_sub(delta, &event->hw.period_left);
|
||||
|
||||
/*
|
||||
* A number of places program the PMC with (0x80000000 - period_left).
|
||||
* We never want period_left to be less than 1 because we will program
|
||||
* the PMC with a value >= 0x800000000 and an edge detected PMC will
|
||||
* roll around to 0 before taking an exception. We have seen this
|
||||
* on POWER8.
|
||||
*
|
||||
* To fix this, clamp the minimum value of period_left to 1.
|
||||
*/
|
||||
do {
|
||||
prev = local64_read(&event->hw.period_left);
|
||||
val = prev - delta;
|
||||
if (val < 1)
|
||||
val = 1;
|
||||
} while (local64_cmpxchg(&event->hw.period_left, prev, val) != prev);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1300,6 +1315,9 @@ static void power_pmu_enable(struct pmu *pmu)
|
||||
|
||||
write_mmcr0(cpuhw, mmcr0);
|
||||
|
||||
if (ppmu->flags & PPMU_ARCH_207S)
|
||||
mtspr(SPRN_MMCR2, 0);
|
||||
|
||||
/*
|
||||
* Enable instruction sampling if necessary
|
||||
*/
|
||||
@ -1696,7 +1714,7 @@ static int power_pmu_event_init(struct perf_event *event)
|
||||
|
||||
if (has_branch_stack(event)) {
|
||||
/* PMU has BHRB enabled */
|
||||
if (!(ppmu->flags & PPMU_BHRB))
|
||||
if (!(ppmu->flags & PPMU_ARCH_207S))
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
|
@ -792,7 +792,7 @@ static struct power_pmu power8_pmu = {
|
||||
.get_constraint = power8_get_constraint,
|
||||
.get_alternatives = power8_get_alternatives,
|
||||
.disable_pmc = power8_disable_pmc,
|
||||
.flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_BHRB | PPMU_EBB,
|
||||
.flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_ARCH_207S,
|
||||
.n_generic = ARRAY_SIZE(power8_generic_events),
|
||||
.generic_events = power8_generic_events,
|
||||
.cache_events = &power8_cache_events,
|
||||
|
@ -111,6 +111,7 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COREDUMP
|
||||
int elf_coredump_extra_notes_size(void)
|
||||
{
|
||||
struct spufs_calls *calls;
|
||||
@ -142,6 +143,7 @@ int elf_coredump_extra_notes_write(struct coredump_params *cprm)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
void notify_spus_active(void)
|
||||
{
|
||||
|
@ -1,8 +1,9 @@
|
||||
|
||||
obj-$(CONFIG_SPU_FS) += spufs.o
|
||||
spufs-y += inode.o file.o context.o syscalls.o coredump.o
|
||||
spufs-y += inode.o file.o context.o syscalls.o
|
||||
spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o
|
||||
spufs-y += switch.o fault.o lscsa_alloc.o
|
||||
spufs-$(CONFIG_COREDUMP) += coredump.o
|
||||
|
||||
# magic for the trace events
|
||||
CFLAGS_sched.o := -I$(src)
|
||||
|
@ -79,8 +79,10 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,
|
||||
struct spufs_calls spufs_calls = {
|
||||
.create_thread = do_spu_create,
|
||||
.spu_run = do_spu_run,
|
||||
.coredump_extra_notes_size = spufs_coredump_extra_notes_size,
|
||||
.coredump_extra_notes_write = spufs_coredump_extra_notes_write,
|
||||
.notify_spus_active = do_notify_spus_active,
|
||||
.owner = THIS_MODULE,
|
||||
#ifdef CONFIG_COREDUMP
|
||||
.coredump_extra_notes_size = spufs_coredump_extra_notes_size,
|
||||
.coredump_extra_notes_write = spufs_coredump_extra_notes_write,
|
||||
#endif
|
||||
};
|
||||
|
@ -141,7 +141,7 @@ static int sha512_ssse3_final(struct shash_desc *desc, u8 *out)
|
||||
|
||||
/* save number of bits */
|
||||
bits[1] = cpu_to_be64(sctx->count[0] << 3);
|
||||
bits[0] = cpu_to_be64(sctx->count[1] << 3) | sctx->count[0] >> 61;
|
||||
bits[0] = cpu_to_be64(sctx->count[1] << 3 | sctx->count[0] >> 61);
|
||||
|
||||
/* Pad out to 112 mod 128 and append length */
|
||||
index = sctx->count[0] & 0x7f;
|
||||
|
@ -93,6 +93,9 @@ static void BITSFUNC(copy_section)(struct BITSFUNC(fake_sections) *out,
|
||||
uint64_t flags = GET_LE(&in->sh_flags);
|
||||
|
||||
bool copy = flags & SHF_ALLOC &&
|
||||
(GET_LE(&in->sh_size) ||
|
||||
(GET_LE(&in->sh_type) != SHT_RELA &&
|
||||
GET_LE(&in->sh_type) != SHT_REL)) &&
|
||||
strcmp(name, ".altinstructions") &&
|
||||
strcmp(name, ".altinstr_replacement");
|
||||
|
||||
|
@ -62,6 +62,9 @@ struct linux_binprm;
|
||||
Only used for the 64-bit and x32 vdsos. */
|
||||
static unsigned long vdso_addr(unsigned long start, unsigned len)
|
||||
{
|
||||
#ifdef CONFIG_X86_32
|
||||
return 0;
|
||||
#else
|
||||
unsigned long addr, end;
|
||||
unsigned offset;
|
||||
end = (start + PMD_SIZE - 1) & PMD_MASK;
|
||||
@ -83,6 +86,7 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
|
||||
addr = align_vdso_addr(addr);
|
||||
|
||||
return addr;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int map_vdso(const struct vdso_image *image, bool calculate_addr)
|
||||
|
@ -30,6 +30,10 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/delay.h>
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
#endif
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/power_supply.h>
|
||||
#include <linux/acpi.h>
|
||||
@ -52,6 +56,7 @@ MODULE_AUTHOR("Paul Diefenbaugh");
|
||||
MODULE_DESCRIPTION("ACPI AC Adapter Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
|
||||
static int acpi_ac_add(struct acpi_device *device);
|
||||
static int acpi_ac_remove(struct acpi_device *device);
|
||||
static void acpi_ac_notify(struct acpi_device *device, u32 event);
|
||||
@ -67,6 +72,13 @@ static int acpi_ac_resume(struct device *dev);
|
||||
#endif
|
||||
static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
|
||||
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
extern struct proc_dir_entry *acpi_lock_ac_dir(void);
|
||||
extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
|
||||
static int acpi_ac_open_fs(struct inode *inode, struct file *file);
|
||||
#endif
|
||||
|
||||
|
||||
static int ac_sleep_before_get_state_ms;
|
||||
|
||||
static struct acpi_driver acpi_ac_driver = {
|
||||
@ -91,6 +103,16 @@ struct acpi_ac {
|
||||
|
||||
#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger)
|
||||
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
static const struct file_operations acpi_ac_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = acpi_ac_open_fs,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
AC Adapter Management
|
||||
-------------------------------------------------------------------------- */
|
||||
@ -143,6 +165,83 @@ static enum power_supply_property ac_props[] = {
|
||||
POWER_SUPPLY_PROP_ONLINE,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
/* --------------------------------------------------------------------------
|
||||
FS Interface (/proc)
|
||||
-------------------------------------------------------------------------- */
|
||||
|
||||
static struct proc_dir_entry *acpi_ac_dir;
|
||||
|
||||
static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
|
||||
{
|
||||
struct acpi_ac *ac = seq->private;
|
||||
|
||||
|
||||
if (!ac)
|
||||
return 0;
|
||||
|
||||
if (acpi_ac_get_state(ac)) {
|
||||
seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
seq_puts(seq, "state: ");
|
||||
switch (ac->state) {
|
||||
case ACPI_AC_STATUS_OFFLINE:
|
||||
seq_puts(seq, "off-line\n");
|
||||
break;
|
||||
case ACPI_AC_STATUS_ONLINE:
|
||||
seq_puts(seq, "on-line\n");
|
||||
break;
|
||||
default:
|
||||
seq_puts(seq, "unknown\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_ac_open_fs(struct inode *inode, struct file *file)
|
||||
{
|
||||
return single_open(file, acpi_ac_seq_show, PDE_DATA(inode));
|
||||
}
|
||||
|
||||
static int acpi_ac_add_fs(struct acpi_ac *ac)
|
||||
{
|
||||
struct proc_dir_entry *entry = NULL;
|
||||
|
||||
printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded,"
|
||||
" please retry with CONFIG_ACPI_PROCFS_POWER cleared\n");
|
||||
if (!acpi_device_dir(ac->device)) {
|
||||
acpi_device_dir(ac->device) =
|
||||
proc_mkdir(acpi_device_bid(ac->device), acpi_ac_dir);
|
||||
if (!acpi_device_dir(ac->device))
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* 'state' [R] */
|
||||
entry = proc_create_data(ACPI_AC_FILE_STATE,
|
||||
S_IRUGO, acpi_device_dir(ac->device),
|
||||
&acpi_ac_fops, ac);
|
||||
if (!entry)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_ac_remove_fs(struct acpi_ac *ac)
|
||||
{
|
||||
|
||||
if (acpi_device_dir(ac->device)) {
|
||||
remove_proc_entry(ACPI_AC_FILE_STATE,
|
||||
acpi_device_dir(ac->device));
|
||||
remove_proc_entry(acpi_device_bid(ac->device), acpi_ac_dir);
|
||||
acpi_device_dir(ac->device) = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
Driver Model
|
||||
-------------------------------------------------------------------------- */
|
||||
@ -243,6 +342,11 @@ static int acpi_ac_add(struct acpi_device *device)
|
||||
goto end;
|
||||
|
||||
ac->charger.name = acpi_device_bid(device);
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
result = acpi_ac_add_fs(ac);
|
||||
if (result)
|
||||
goto end;
|
||||
#endif
|
||||
ac->charger.type = POWER_SUPPLY_TYPE_MAINS;
|
||||
ac->charger.properties = ac_props;
|
||||
ac->charger.num_properties = ARRAY_SIZE(ac_props);
|
||||
@ -258,8 +362,12 @@ static int acpi_ac_add(struct acpi_device *device)
|
||||
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
|
||||
register_acpi_notifier(&ac->battery_nb);
|
||||
end:
|
||||
if (result)
|
||||
if (result) {
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
acpi_ac_remove_fs(ac);
|
||||
#endif
|
||||
kfree(ac);
|
||||
}
|
||||
|
||||
dmi_check_system(ac_dmi_table);
|
||||
return result;
|
||||
@ -303,6 +411,10 @@ static int acpi_ac_remove(struct acpi_device *device)
|
||||
power_supply_unregister(&ac->charger);
|
||||
unregister_acpi_notifier(&ac->battery_nb);
|
||||
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
acpi_ac_remove_fs(ac);
|
||||
#endif
|
||||
|
||||
kfree(ac);
|
||||
|
||||
return 0;
|
||||
@ -315,9 +427,20 @@ static int __init acpi_ac_init(void)
|
||||
if (acpi_disabled)
|
||||
return -ENODEV;
|
||||
|
||||
result = acpi_bus_register_driver(&acpi_ac_driver);
|
||||
if (result < 0)
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
acpi_ac_dir = acpi_lock_ac_dir();
|
||||
if (!acpi_ac_dir)
|
||||
return -ENODEV;
|
||||
#endif
|
||||
|
||||
|
||||
result = acpi_bus_register_driver(&acpi_ac_driver);
|
||||
if (result < 0) {
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
acpi_unlock_ac_dir(acpi_ac_dir);
|
||||
#endif
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -325,6 +448,9 @@ static int __init acpi_ac_init(void)
|
||||
static void __exit acpi_ac_exit(void)
|
||||
{
|
||||
acpi_bus_unregister_driver(&acpi_ac_driver);
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
acpi_unlock_ac_dir(acpi_ac_dir);
|
||||
#endif
|
||||
}
|
||||
module_init(acpi_ac_init);
|
||||
module_exit(acpi_ac_exit);
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include <linux/module.h>
|
||||
|
||||
static const struct acpi_device_id acpi_pnp_device_ids[] = {
|
||||
/* soc_button_array */
|
||||
{"PNP0C40"},
|
||||
/* pata_isapnp */
|
||||
{"PNP0600"}, /* Generic ESDI/IDE/ATA compatible hard disk controller */
|
||||
/* floppy */
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/delay.h>
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
@ -534,6 +535,20 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
|
||||
" invalid.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* When fully charged, some batteries wrongly report
|
||||
* capacity_now = design_capacity instead of = full_charge_capacity
|
||||
*/
|
||||
if (battery->capacity_now > battery->full_charge_capacity
|
||||
&& battery->full_charge_capacity != ACPI_BATTERY_VALUE_UNKNOWN) {
|
||||
battery->capacity_now = battery->full_charge_capacity;
|
||||
if (battery->capacity_now != battery->design_capacity)
|
||||
printk_once(KERN_WARNING FW_BUG
|
||||
"battery: reported current charge level (%d) "
|
||||
"is higher than reported maximum charge level (%d).\n",
|
||||
battery->capacity_now, battery->full_charge_capacity);
|
||||
}
|
||||
|
||||
if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)
|
||||
&& battery->capacity_now >= 0 && battery->capacity_now <= 100)
|
||||
battery->capacity_now = (battery->capacity_now *
|
||||
@ -1151,6 +1166,28 @@ static struct dmi_system_id bat_dmi_table[] = {
|
||||
{},
|
||||
};
|
||||
|
||||
/*
|
||||
* Some machines'(E,G Lenovo Z480) ECs are not stable
|
||||
* during boot up and this causes battery driver fails to be
|
||||
* probed due to failure of getting battery information
|
||||
* from EC sometimes. After several retries, the operation
|
||||
* may work. So add retry code here and 20ms sleep between
|
||||
* every retries.
|
||||
*/
|
||||
static int acpi_battery_update_retry(struct acpi_battery *battery)
|
||||
{
|
||||
int retry, ret;
|
||||
|
||||
for (retry = 5; retry; retry--) {
|
||||
ret = acpi_battery_update(battery, false);
|
||||
if (!ret)
|
||||
break;
|
||||
|
||||
msleep(20);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int acpi_battery_add(struct acpi_device *device)
|
||||
{
|
||||
int result = 0;
|
||||
@ -1169,9 +1206,11 @@ static int acpi_battery_add(struct acpi_device *device)
|
||||
mutex_init(&battery->sysfs_lock);
|
||||
if (acpi_has_method(battery->device->handle, "_BIX"))
|
||||
set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags);
|
||||
result = acpi_battery_update(battery, false);
|
||||
|
||||
result = acpi_battery_update_retry(battery);
|
||||
if (result)
|
||||
goto fail;
|
||||
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
result = acpi_battery_add_fs(device);
|
||||
#endif
|
||||
|
@ -1,11 +1,14 @@
|
||||
/*
|
||||
* ec.c - ACPI Embedded Controller Driver (v2.1)
|
||||
* ec.c - ACPI Embedded Controller Driver (v2.2)
|
||||
*
|
||||
* Copyright (C) 2006-2008 Alexey Starikovskiy <astarikovskiy@suse.de>
|
||||
* Copyright (C) 2006 Denis Sadykov <denis.m.sadykov@intel.com>
|
||||
* Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
|
||||
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
|
||||
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
|
||||
* Copyright (C) 2001-2014 Intel Corporation
|
||||
* Author: 2014 Lv Zheng <lv.zheng@intel.com>
|
||||
* 2006, 2007 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
|
||||
* 2006 Denis Sadykov <denis.m.sadykov@intel.com>
|
||||
* 2004 Luming Yu <luming.yu@intel.com>
|
||||
* 2001, 2002 Andy Grover <andrew.grover@intel.com>
|
||||
* 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
|
||||
* Copyright (C) 2008 Alexey Starikovskiy <astarikovskiy@suse.de>
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
@ -52,6 +55,7 @@
|
||||
/* EC status register */
|
||||
#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */
|
||||
#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */
|
||||
#define ACPI_EC_FLAG_CMD 0x08 /* Input buffer contains a command */
|
||||
#define ACPI_EC_FLAG_BURST 0x10 /* burst mode */
|
||||
#define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */
|
||||
|
||||
@ -78,6 +82,9 @@ enum {
|
||||
EC_FLAGS_BLOCKED, /* Transactions are blocked */
|
||||
};
|
||||
|
||||
#define ACPI_EC_COMMAND_POLL 0x01 /* Available for command byte */
|
||||
#define ACPI_EC_COMMAND_COMPLETE 0x02 /* Completed last byte */
|
||||
|
||||
/* ec.c is compiled in acpi namespace so this shows up as acpi.ec_delay param */
|
||||
static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY;
|
||||
module_param(ec_delay, uint, 0644);
|
||||
@ -109,7 +116,7 @@ struct transaction {
|
||||
u8 ri;
|
||||
u8 wlen;
|
||||
u8 rlen;
|
||||
bool done;
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
struct acpi_ec *boot_ec, *first_ec;
|
||||
@ -127,83 +134,104 @@ static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
|
||||
static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
|
||||
{
|
||||
u8 x = inb(ec->command_addr);
|
||||
pr_debug("---> status = 0x%2.2x\n", x);
|
||||
pr_debug("EC_SC(R) = 0x%2.2x "
|
||||
"SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d\n",
|
||||
x,
|
||||
!!(x & ACPI_EC_FLAG_SCI),
|
||||
!!(x & ACPI_EC_FLAG_BURST),
|
||||
!!(x & ACPI_EC_FLAG_CMD),
|
||||
!!(x & ACPI_EC_FLAG_IBF),
|
||||
!!(x & ACPI_EC_FLAG_OBF));
|
||||
return x;
|
||||
}
|
||||
|
||||
static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
|
||||
{
|
||||
u8 x = inb(ec->data_addr);
|
||||
pr_debug("---> data = 0x%2.2x\n", x);
|
||||
pr_debug("EC_DATA(R) = 0x%2.2x\n", x);
|
||||
return x;
|
||||
}
|
||||
|
||||
static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
|
||||
{
|
||||
pr_debug("<--- command = 0x%2.2x\n", command);
|
||||
pr_debug("EC_SC(W) = 0x%2.2x\n", command);
|
||||
outb(command, ec->command_addr);
|
||||
}
|
||||
|
||||
static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
|
||||
{
|
||||
pr_debug("<--- data = 0x%2.2x\n", data);
|
||||
pr_debug("EC_DATA(W) = 0x%2.2x\n", data);
|
||||
outb(data, ec->data_addr);
|
||||
}
|
||||
|
||||
static int ec_transaction_done(struct acpi_ec *ec)
|
||||
static int ec_transaction_completed(struct acpi_ec *ec)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret = 0;
|
||||
spin_lock_irqsave(&ec->lock, flags);
|
||||
if (!ec->curr || ec->curr->done)
|
||||
if (ec->curr && (ec->curr->flags & ACPI_EC_COMMAND_COMPLETE))
|
||||
ret = 1;
|
||||
spin_unlock_irqrestore(&ec->lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void start_transaction(struct acpi_ec *ec)
|
||||
static bool advance_transaction(struct acpi_ec *ec)
|
||||
{
|
||||
ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0;
|
||||
ec->curr->done = false;
|
||||
acpi_ec_write_cmd(ec, ec->curr->command);
|
||||
}
|
||||
|
||||
static void advance_transaction(struct acpi_ec *ec, u8 status)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct transaction *t;
|
||||
u8 status;
|
||||
bool wakeup = false;
|
||||
|
||||
spin_lock_irqsave(&ec->lock, flags);
|
||||
pr_debug("===== %s =====\n", in_interrupt() ? "IRQ" : "TASK");
|
||||
status = acpi_ec_read_status(ec);
|
||||
t = ec->curr;
|
||||
if (!t)
|
||||
goto unlock;
|
||||
if (t->wlen > t->wi) {
|
||||
if ((status & ACPI_EC_FLAG_IBF) == 0)
|
||||
acpi_ec_write_data(ec,
|
||||
t->wdata[t->wi++]);
|
||||
else
|
||||
goto err;
|
||||
} else if (t->rlen > t->ri) {
|
||||
if ((status & ACPI_EC_FLAG_OBF) == 1) {
|
||||
t->rdata[t->ri++] = acpi_ec_read_data(ec);
|
||||
if (t->rlen == t->ri)
|
||||
t->done = true;
|
||||
goto err;
|
||||
if (t->flags & ACPI_EC_COMMAND_POLL) {
|
||||
if (t->wlen > t->wi) {
|
||||
if ((status & ACPI_EC_FLAG_IBF) == 0)
|
||||
acpi_ec_write_data(ec, t->wdata[t->wi++]);
|
||||
else
|
||||
goto err;
|
||||
} else if (t->rlen > t->ri) {
|
||||
if ((status & ACPI_EC_FLAG_OBF) == 1) {
|
||||
t->rdata[t->ri++] = acpi_ec_read_data(ec);
|
||||
if (t->rlen == t->ri) {
|
||||
t->flags |= ACPI_EC_COMMAND_COMPLETE;
|
||||
wakeup = true;
|
||||
}
|
||||
} else
|
||||
goto err;
|
||||
} else if (t->wlen == t->wi &&
|
||||
(status & ACPI_EC_FLAG_IBF) == 0) {
|
||||
t->flags |= ACPI_EC_COMMAND_COMPLETE;
|
||||
wakeup = true;
|
||||
}
|
||||
return wakeup;
|
||||
} else {
|
||||
if ((status & ACPI_EC_FLAG_IBF) == 0) {
|
||||
acpi_ec_write_cmd(ec, t->command);
|
||||
t->flags |= ACPI_EC_COMMAND_POLL;
|
||||
} else
|
||||
goto err;
|
||||
} else if (t->wlen == t->wi &&
|
||||
(status & ACPI_EC_FLAG_IBF) == 0)
|
||||
t->done = true;
|
||||
goto unlock;
|
||||
return wakeup;
|
||||
}
|
||||
err:
|
||||
/*
|
||||
* If SCI bit is set, then don't think it's a false IRQ
|
||||
* otherwise will take a not handled IRQ as a false one.
|
||||
*/
|
||||
if (in_interrupt() && !(status & ACPI_EC_FLAG_SCI))
|
||||
++t->irq_count;
|
||||
if (!(status & ACPI_EC_FLAG_SCI)) {
|
||||
if (in_interrupt() && t)
|
||||
++t->irq_count;
|
||||
}
|
||||
return wakeup;
|
||||
}
|
||||
|
||||
unlock:
|
||||
spin_unlock_irqrestore(&ec->lock, flags);
|
||||
static void start_transaction(struct acpi_ec *ec)
|
||||
{
|
||||
ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0;
|
||||
ec->curr->flags = 0;
|
||||
(void)advance_transaction(ec);
|
||||
}
|
||||
|
||||
static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data);
|
||||
@ -228,15 +256,17 @@ static int ec_poll(struct acpi_ec *ec)
|
||||
/* don't sleep with disabled interrupts */
|
||||
if (EC_FLAGS_MSI || irqs_disabled()) {
|
||||
udelay(ACPI_EC_MSI_UDELAY);
|
||||
if (ec_transaction_done(ec))
|
||||
if (ec_transaction_completed(ec))
|
||||
return 0;
|
||||
} else {
|
||||
if (wait_event_timeout(ec->wait,
|
||||
ec_transaction_done(ec),
|
||||
ec_transaction_completed(ec),
|
||||
msecs_to_jiffies(1)))
|
||||
return 0;
|
||||
}
|
||||
advance_transaction(ec, acpi_ec_read_status(ec));
|
||||
spin_lock_irqsave(&ec->lock, flags);
|
||||
(void)advance_transaction(ec);
|
||||
spin_unlock_irqrestore(&ec->lock, flags);
|
||||
} while (time_before(jiffies, delay));
|
||||
pr_debug("controller reset, restart transaction\n");
|
||||
spin_lock_irqsave(&ec->lock, flags);
|
||||
@ -268,23 +298,6 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ec_check_ibf0(struct acpi_ec *ec)
|
||||
{
|
||||
u8 status = acpi_ec_read_status(ec);
|
||||
return (status & ACPI_EC_FLAG_IBF) == 0;
|
||||
}
|
||||
|
||||
static int ec_wait_ibf0(struct acpi_ec *ec)
|
||||
{
|
||||
unsigned long delay = jiffies + msecs_to_jiffies(ec_delay);
|
||||
/* interrupt wait manually if GPE mode is not active */
|
||||
while (time_before(jiffies, delay))
|
||||
if (wait_event_timeout(ec->wait, ec_check_ibf0(ec),
|
||||
msecs_to_jiffies(1)))
|
||||
return 0;
|
||||
return -ETIME;
|
||||
}
|
||||
|
||||
static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
|
||||
{
|
||||
int status;
|
||||
@ -305,12 +318,6 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
if (ec_wait_ibf0(ec)) {
|
||||
pr_err("input buffer is not empty, "
|
||||
"aborting transaction\n");
|
||||
status = -ETIME;
|
||||
goto end;
|
||||
}
|
||||
pr_debug("transaction start (cmd=0x%02x, addr=0x%02x)\n",
|
||||
t->command, t->wdata ? t->wdata[0] : 0);
|
||||
/* disable GPE during transaction if storm is detected */
|
||||
@ -334,7 +341,6 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
|
||||
set_bit(EC_FLAGS_GPE_STORM, &ec->flags);
|
||||
}
|
||||
pr_debug("transaction end\n");
|
||||
end:
|
||||
if (ec->global_lock)
|
||||
acpi_release_global_lock(glk);
|
||||
unlock:
|
||||
@ -634,17 +640,14 @@ static int ec_check_sci(struct acpi_ec *ec, u8 state)
|
||||
static u32 acpi_ec_gpe_handler(acpi_handle gpe_device,
|
||||
u32 gpe_number, void *data)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct acpi_ec *ec = data;
|
||||
u8 status = acpi_ec_read_status(ec);
|
||||
|
||||
pr_debug("~~~> interrupt, status:0x%02x\n", status);
|
||||
|
||||
advance_transaction(ec, status);
|
||||
if (ec_transaction_done(ec) &&
|
||||
(acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) == 0) {
|
||||
spin_lock_irqsave(&ec->lock, flags);
|
||||
if (advance_transaction(ec))
|
||||
wake_up(&ec->wait);
|
||||
ec_check_sci(ec, acpi_ec_read_status(ec));
|
||||
}
|
||||
spin_unlock_irqrestore(&ec->lock, flags);
|
||||
ec_check_sci(ec, acpi_ec_read_status(ec));
|
||||
return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
|
||||
}
|
||||
|
||||
@ -1066,8 +1069,10 @@ int __init acpi_ec_ecdt_probe(void)
|
||||
/* fall through */
|
||||
}
|
||||
|
||||
if (EC_FLAGS_SKIP_DSDT_SCAN)
|
||||
if (EC_FLAGS_SKIP_DSDT_SCAN) {
|
||||
kfree(saved_ec);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* This workaround is needed only on some broken machines,
|
||||
* which require early EC, but fail to provide ECDT */
|
||||
@ -1105,6 +1110,7 @@ install:
|
||||
}
|
||||
error:
|
||||
kfree(boot_ec);
|
||||
kfree(saved_ec);
|
||||
boot_ec = NULL;
|
||||
return -ENODEV;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res)
|
||||
switch (ares->type) {
|
||||
case ACPI_RESOURCE_TYPE_MEMORY24:
|
||||
memory24 = &ares->data.memory24;
|
||||
if (!memory24->address_length)
|
||||
if (!memory24->minimum && !memory24->address_length)
|
||||
return false;
|
||||
acpi_dev_get_memresource(res, memory24->minimum,
|
||||
memory24->address_length,
|
||||
@ -85,7 +85,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res)
|
||||
break;
|
||||
case ACPI_RESOURCE_TYPE_MEMORY32:
|
||||
memory32 = &ares->data.memory32;
|
||||
if (!memory32->address_length)
|
||||
if (!memory32->minimum && !memory32->address_length)
|
||||
return false;
|
||||
acpi_dev_get_memresource(res, memory32->minimum,
|
||||
memory32->address_length,
|
||||
@ -93,7 +93,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res)
|
||||
break;
|
||||
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
|
||||
fixed_memory32 = &ares->data.fixed_memory32;
|
||||
if (!fixed_memory32->address_length)
|
||||
if (!fixed_memory32->address && !fixed_memory32->address_length)
|
||||
return false;
|
||||
acpi_dev_get_memresource(res, fixed_memory32->address,
|
||||
fixed_memory32->address_length,
|
||||
@ -150,7 +150,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res)
|
||||
switch (ares->type) {
|
||||
case ACPI_RESOURCE_TYPE_IO:
|
||||
io = &ares->data.io;
|
||||
if (!io->address_length)
|
||||
if (!io->minimum && !io->address_length)
|
||||
return false;
|
||||
acpi_dev_get_ioresource(res, io->minimum,
|
||||
io->address_length,
|
||||
@ -158,7 +158,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res)
|
||||
break;
|
||||
case ACPI_RESOURCE_TYPE_FIXED_IO:
|
||||
fixed_io = &ares->data.fixed_io;
|
||||
if (!fixed_io->address_length)
|
||||
if (!fixed_io->address && !fixed_io->address_length)
|
||||
return false;
|
||||
acpi_dev_get_ioresource(res, fixed_io->address,
|
||||
fixed_io->address_length,
|
||||
|
@ -241,13 +241,14 @@ static bool acpi_video_use_native_backlight(void)
|
||||
return use_native_backlight_dmi;
|
||||
}
|
||||
|
||||
static bool acpi_video_verify_backlight_support(void)
|
||||
bool acpi_video_verify_backlight_support(void)
|
||||
{
|
||||
if (acpi_osi_is_win8() && acpi_video_use_native_backlight() &&
|
||||
backlight_device_registered(BACKLIGHT_RAW))
|
||||
return false;
|
||||
return acpi_video_backlight_support();
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_video_verify_backlight_support);
|
||||
|
||||
/* backlight device sysfs support */
|
||||
static int acpi_video_get_brightness(struct backlight_device *bd)
|
||||
@ -562,6 +563,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-471G"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = video_set_use_native_backlight,
|
||||
.ident = "Acer TravelMate B113",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate B113"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = video_set_use_native_backlight,
|
||||
.ident = "HP ProBook 4340s",
|
||||
|
@ -166,6 +166,14 @@ static struct dmi_system_id video_detect_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = video_detect_force_vendor,
|
||||
.ident = "Dell Inspiron 5737",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5737"),
|
||||
},
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
|
@ -371,7 +371,9 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
|
||||
int pmp, unsigned long deadline,
|
||||
int (*check_ready)(struct ata_link *link));
|
||||
|
||||
unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);
|
||||
int ahci_stop_engine(struct ata_port *ap);
|
||||
void ahci_start_fis_rx(struct ata_port *ap);
|
||||
void ahci_start_engine(struct ata_port *ap);
|
||||
int ahci_check_ready(struct ata_link *link);
|
||||
int ahci_kick_engine(struct ata_port *ap);
|
||||
|
@ -58,6 +58,8 @@ enum ahci_imx_type {
|
||||
struct imx_ahci_priv {
|
||||
struct platform_device *ahci_pdev;
|
||||
enum ahci_imx_type type;
|
||||
struct clk *sata_clk;
|
||||
struct clk *sata_ref_clk;
|
||||
struct clk *ahb_clk;
|
||||
struct regmap *gpr;
|
||||
bool no_device;
|
||||
@ -224,7 +226,7 @@ static int imx_sata_enable(struct ahci_host_priv *hpriv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = ahci_platform_enable_clks(hpriv);
|
||||
ret = clk_prepare_enable(imxpriv->sata_ref_clk);
|
||||
if (ret < 0)
|
||||
goto disable_regulator;
|
||||
|
||||
@ -291,7 +293,7 @@ static void imx_sata_disable(struct ahci_host_priv *hpriv)
|
||||
!IMX6Q_GPR13_SATA_MPLL_CLK_EN);
|
||||
}
|
||||
|
||||
ahci_platform_disable_clks(hpriv);
|
||||
clk_disable_unprepare(imxpriv->sata_ref_clk);
|
||||
|
||||
if (hpriv->target_pwr)
|
||||
regulator_disable(hpriv->target_pwr);
|
||||
@ -324,6 +326,9 @@ static void ahci_imx_error_handler(struct ata_port *ap)
|
||||
writel(reg_val | IMX_P0PHYCR_TEST_PDDQ, mmio + IMX_P0PHYCR);
|
||||
imx_sata_disable(hpriv);
|
||||
imxpriv->no_device = true;
|
||||
|
||||
dev_info(ap->dev, "no device found, disabling link.\n");
|
||||
dev_info(ap->dev, "pass " MODULE_PARAM_PREFIX ".hotplug=1 to enable hotplug\n");
|
||||
}
|
||||
|
||||
static int ahci_imx_softreset(struct ata_link *link, unsigned int *class,
|
||||
@ -385,6 +390,19 @@ static int imx_ahci_probe(struct platform_device *pdev)
|
||||
imxpriv->no_device = false;
|
||||
imxpriv->first_time = true;
|
||||
imxpriv->type = (enum ahci_imx_type)of_id->data;
|
||||
|
||||
imxpriv->sata_clk = devm_clk_get(dev, "sata");
|
||||
if (IS_ERR(imxpriv->sata_clk)) {
|
||||
dev_err(dev, "can't get sata clock.\n");
|
||||
return PTR_ERR(imxpriv->sata_clk);
|
||||
}
|
||||
|
||||
imxpriv->sata_ref_clk = devm_clk_get(dev, "sata_ref");
|
||||
if (IS_ERR(imxpriv->sata_ref_clk)) {
|
||||
dev_err(dev, "can't get sata_ref clock.\n");
|
||||
return PTR_ERR(imxpriv->sata_ref_clk);
|
||||
}
|
||||
|
||||
imxpriv->ahb_clk = devm_clk_get(dev, "ahb");
|
||||
if (IS_ERR(imxpriv->ahb_clk)) {
|
||||
dev_err(dev, "can't get ahb clock.\n");
|
||||
@ -407,10 +425,14 @@ static int imx_ahci_probe(struct platform_device *pdev)
|
||||
|
||||
hpriv->plat_data = imxpriv;
|
||||
|
||||
ret = imx_sata_enable(hpriv);
|
||||
ret = clk_prepare_enable(imxpriv->sata_clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = imx_sata_enable(hpriv);
|
||||
if (ret)
|
||||
goto disable_clk;
|
||||
|
||||
/*
|
||||
* Configure the HWINIT bits of the HOST_CAP and HOST_PORTS_IMPL,
|
||||
* and IP vendor specific register IMX_TIMER1MS.
|
||||
@ -435,16 +457,24 @@ static int imx_ahci_probe(struct platform_device *pdev)
|
||||
ret = ahci_platform_init_host(pdev, hpriv, &ahci_imx_port_info,
|
||||
0, 0, 0);
|
||||
if (ret)
|
||||
imx_sata_disable(hpriv);
|
||||
goto disable_sata;
|
||||
|
||||
return 0;
|
||||
|
||||
disable_sata:
|
||||
imx_sata_disable(hpriv);
|
||||
disable_clk:
|
||||
clk_disable_unprepare(imxpriv->sata_clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ahci_imx_host_stop(struct ata_host *host)
|
||||
{
|
||||
struct ahci_host_priv *hpriv = host->private_data;
|
||||
struct imx_ahci_priv *imxpriv = hpriv->plat_data;
|
||||
|
||||
imx_sata_disable(hpriv);
|
||||
clk_disable_unprepare(imxpriv->sata_clk);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -58,7 +58,7 @@ static int ahci_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
|
||||
hflags |= AHCI_HFLAG_NO_FBS;
|
||||
hflags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
|
||||
|
||||
rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info,
|
||||
hflags, 0, 0);
|
||||
|
@ -78,6 +78,7 @@
|
||||
struct xgene_ahci_context {
|
||||
struct ahci_host_priv *hpriv;
|
||||
struct device *dev;
|
||||
u8 last_cmd[MAX_AHCI_CHN_PERCTR]; /* tracking the last command issued*/
|
||||
void __iomem *csr_core; /* Core CSR address of IP */
|
||||
void __iomem *csr_diag; /* Diag CSR address of IP */
|
||||
void __iomem *csr_axi; /* AXI CSR address of IP */
|
||||
@ -97,6 +98,50 @@ static int xgene_ahci_init_memram(struct xgene_ahci_context *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xgene_ahci_restart_engine - Restart the dma engine.
|
||||
* @ap : ATA port of interest
|
||||
*
|
||||
* Restarts the dma engine inside the controller.
|
||||
*/
|
||||
static int xgene_ahci_restart_engine(struct ata_port *ap)
|
||||
{
|
||||
struct ahci_host_priv *hpriv = ap->host->private_data;
|
||||
|
||||
ahci_stop_engine(ap);
|
||||
ahci_start_fis_rx(ap);
|
||||
hpriv->start_engine(ap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xgene_ahci_qc_issue - Issue commands to the device
|
||||
* @qc: Command to issue
|
||||
*
|
||||
* Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot
|
||||
* clear the BSY bit after receiving the PIO setup FIS. This results in the dma
|
||||
* state machine goes into the CMFatalErrorUpdate state and locks up. By
|
||||
* restarting the dma engine, it removes the controller out of lock up state.
|
||||
*/
|
||||
static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)
|
||||
{
|
||||
struct ata_port *ap = qc->ap;
|
||||
struct ahci_host_priv *hpriv = ap->host->private_data;
|
||||
struct xgene_ahci_context *ctx = hpriv->plat_data;
|
||||
int rc = 0;
|
||||
|
||||
if (unlikely(ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA))
|
||||
xgene_ahci_restart_engine(ap);
|
||||
|
||||
rc = ahci_qc_issue(qc);
|
||||
|
||||
/* Save the last command issued */
|
||||
ctx->last_cmd[ap->port_no] = qc->tf.command;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* xgene_ahci_read_id - Read ID data from the specified device
|
||||
* @dev: device
|
||||
@ -104,14 +149,12 @@ static int xgene_ahci_init_memram(struct xgene_ahci_context *ctx)
|
||||
* @id: data buffer
|
||||
*
|
||||
* This custom read ID function is required due to the fact that the HW
|
||||
* does not support DEVSLP and the controller state machine may get stuck
|
||||
* after processing the ID query command.
|
||||
* does not support DEVSLP.
|
||||
*/
|
||||
static unsigned int xgene_ahci_read_id(struct ata_device *dev,
|
||||
struct ata_taskfile *tf, u16 *id)
|
||||
{
|
||||
u32 err_mask;
|
||||
void __iomem *port_mmio = ahci_port_base(dev->link->ap);
|
||||
|
||||
err_mask = ata_do_dev_read_id(dev, tf, id);
|
||||
if (err_mask)
|
||||
@ -133,16 +176,6 @@ static unsigned int xgene_ahci_read_id(struct ata_device *dev,
|
||||
*/
|
||||
id[ATA_ID_FEATURE_SUPP] &= ~(1 << 8);
|
||||
|
||||
/*
|
||||
* Due to HW errata, restart the port if no other command active.
|
||||
* Otherwise the controller may get stuck.
|
||||
*/
|
||||
if (!readl(port_mmio + PORT_CMD_ISSUE)) {
|
||||
writel(PORT_CMD_FIS_RX, port_mmio + PORT_CMD);
|
||||
readl(port_mmio + PORT_CMD); /* Force a barrier */
|
||||
writel(PORT_CMD_FIS_RX | PORT_CMD_START, port_mmio + PORT_CMD);
|
||||
readl(port_mmio + PORT_CMD); /* Force a barrier */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -300,6 +333,7 @@ static struct ata_port_operations xgene_ahci_ops = {
|
||||
.host_stop = xgene_ahci_host_stop,
|
||||
.hardreset = xgene_ahci_hardreset,
|
||||
.read_id = xgene_ahci_read_id,
|
||||
.qc_issue = xgene_ahci_qc_issue,
|
||||
};
|
||||
|
||||
static const struct ata_port_info xgene_ahci_port_info = {
|
||||
|
@ -68,7 +68,6 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
|
||||
|
||||
static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
|
||||
static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
|
||||
static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);
|
||||
static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc);
|
||||
static int ahci_port_start(struct ata_port *ap);
|
||||
static void ahci_port_stop(struct ata_port *ap);
|
||||
@ -620,7 +619,7 @@ int ahci_stop_engine(struct ata_port *ap)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ahci_stop_engine);
|
||||
|
||||
static void ahci_start_fis_rx(struct ata_port *ap)
|
||||
void ahci_start_fis_rx(struct ata_port *ap)
|
||||
{
|
||||
void __iomem *port_mmio = ahci_port_base(ap);
|
||||
struct ahci_host_priv *hpriv = ap->host->private_data;
|
||||
@ -646,6 +645,7 @@ static void ahci_start_fis_rx(struct ata_port *ap)
|
||||
/* flush */
|
||||
readl(port_mmio + PORT_CMD);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ahci_start_fis_rx);
|
||||
|
||||
static int ahci_stop_fis_rx(struct ata_port *ap)
|
||||
{
|
||||
@ -1945,7 +1945,7 @@ irqreturn_t ahci_interrupt(int irq, void *dev_instance)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ahci_interrupt);
|
||||
|
||||
static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
|
||||
unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
|
||||
{
|
||||
struct ata_port *ap = qc->ap;
|
||||
void __iomem *port_mmio = ahci_port_base(ap);
|
||||
@ -1974,6 +1974,7 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ahci_qc_issue);
|
||||
|
||||
static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
|
||||
{
|
||||
|
@ -250,8 +250,13 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
|
||||
if (IS_ERR(hpriv->phy)) {
|
||||
rc = PTR_ERR(hpriv->phy);
|
||||
switch (rc) {
|
||||
case -ENODEV:
|
||||
case -ENOSYS:
|
||||
/* No PHY support. Check if PHY is required. */
|
||||
if (of_find_property(dev->of_node, "phys", NULL)) {
|
||||
dev_err(dev, "couldn't get sata-phy: ENOSYS\n");
|
||||
goto err_out;
|
||||
}
|
||||
case -ENODEV:
|
||||
/* continue normally */
|
||||
hpriv->phy = NULL;
|
||||
break;
|
||||
|
@ -138,7 +138,9 @@ static int i8k_smm(struct smm_regs *regs)
|
||||
if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))
|
||||
return -ENOMEM;
|
||||
cpumask_copy(old_mask, ¤t->cpus_allowed);
|
||||
set_cpus_allowed_ptr(current, cpumask_of(0));
|
||||
rc = set_cpus_allowed_ptr(current, cpumask_of(0));
|
||||
if (rc)
|
||||
goto out;
|
||||
if (smp_processor_id() != 0) {
|
||||
rc = -EBUSY;
|
||||
goto out;
|
||||
|
@ -230,16 +230,13 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
|
||||
goto err_reg;
|
||||
}
|
||||
|
||||
s2mps11_clk->lookup = devm_kzalloc(&pdev->dev,
|
||||
sizeof(struct clk_lookup), GFP_KERNEL);
|
||||
s2mps11_clk->lookup = clkdev_alloc(s2mps11_clk->clk,
|
||||
s2mps11_name(s2mps11_clk), NULL);
|
||||
if (!s2mps11_clk->lookup) {
|
||||
ret = -ENOMEM;
|
||||
goto err_lup;
|
||||
}
|
||||
|
||||
s2mps11_clk->lookup->con_id = s2mps11_name(s2mps11_clk);
|
||||
s2mps11_clk->lookup->clk = s2mps11_clk->clk;
|
||||
|
||||
clkdev_add(s2mps11_clk->lookup);
|
||||
}
|
||||
|
||||
|
@ -1209,7 +1209,7 @@ static struct clk_branch rot_clk = {
|
||||
|
||||
static u8 mmcc_pxo_hdmi_map[] = {
|
||||
[P_PXO] = 0,
|
||||
[P_HDMI_PLL] = 2,
|
||||
[P_HDMI_PLL] = 3,
|
||||
};
|
||||
|
||||
static const char *mmcc_pxo_hdmi[] = {
|
||||
|
@ -925,21 +925,13 @@ static struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = {
|
||||
GATE(CLK_RTC, "rtc", "aclk100", E4X12_GATE_IP_PERIR, 15,
|
||||
0, 0),
|
||||
GATE(CLK_KEYIF, "keyif", "aclk100", E4X12_GATE_IP_PERIR, 16, 0, 0),
|
||||
GATE(CLK_SCLK_PWM_ISP, "sclk_pwm_isp", "div_pwm_isp",
|
||||
E4X12_SRC_MASK_ISP, 0, CLK_SET_RATE_PARENT, 0),
|
||||
GATE(CLK_SCLK_SPI0_ISP, "sclk_spi0_isp", "div_spi0_isp_pre",
|
||||
E4X12_SRC_MASK_ISP, 4, CLK_SET_RATE_PARENT, 0),
|
||||
GATE(CLK_SCLK_SPI1_ISP, "sclk_spi1_isp", "div_spi1_isp_pre",
|
||||
E4X12_SRC_MASK_ISP, 8, CLK_SET_RATE_PARENT, 0),
|
||||
GATE(CLK_SCLK_UART_ISP, "sclk_uart_isp", "div_uart_isp",
|
||||
E4X12_SRC_MASK_ISP, 12, CLK_SET_RATE_PARENT, 0),
|
||||
GATE(CLK_PWM_ISP_SCLK, "pwm_isp_sclk", "sclk_pwm_isp",
|
||||
GATE(CLK_PWM_ISP_SCLK, "pwm_isp_sclk", "div_pwm_isp",
|
||||
E4X12_GATE_IP_ISP, 0, 0, 0),
|
||||
GATE(CLK_SPI0_ISP_SCLK, "spi0_isp_sclk", "sclk_spi0_isp",
|
||||
GATE(CLK_SPI0_ISP_SCLK, "spi0_isp_sclk", "div_spi0_isp_pre",
|
||||
E4X12_GATE_IP_ISP, 1, 0, 0),
|
||||
GATE(CLK_SPI1_ISP_SCLK, "spi1_isp_sclk", "sclk_spi1_isp",
|
||||
GATE(CLK_SPI1_ISP_SCLK, "spi1_isp_sclk", "div_spi1_isp_pre",
|
||||
E4X12_GATE_IP_ISP, 2, 0, 0),
|
||||
GATE(CLK_UART_ISP_SCLK, "uart_isp_sclk", "sclk_uart_isp",
|
||||
GATE(CLK_UART_ISP_SCLK, "uart_isp_sclk", "div_uart_isp",
|
||||
E4X12_GATE_IP_ISP, 3, 0, 0),
|
||||
GATE(CLK_WDT, "watchdog", "aclk100", E4X12_GATE_IP_PERIR, 14, 0, 0),
|
||||
GATE(CLK_PCM0, "pcm0", "aclk100", E4X12_GATE_IP_MAUDIO, 2,
|
||||
|
@ -661,7 +661,7 @@ static struct samsung_gate_clock exynos5250_gate_clks[] __initdata = {
|
||||
GATE(CLK_RTC, "rtc", "div_aclk66", GATE_IP_PERIS, 20, 0, 0),
|
||||
GATE(CLK_TMU, "tmu", "div_aclk66", GATE_IP_PERIS, 21, 0, 0),
|
||||
GATE(CLK_SMMU_TV, "smmu_tv", "mout_aclk200_disp1_sub",
|
||||
GATE_IP_DISP1, 2, 0, 0),
|
||||
GATE_IP_DISP1, 9, 0, 0),
|
||||
GATE(CLK_SMMU_FIMD1, "smmu_fimd1", "mout_aclk200_disp1_sub",
|
||||
GATE_IP_DISP1, 8, 0, 0),
|
||||
GATE(CLK_SMMU_2D, "smmu_2d", "div_aclk200", GATE_IP_ACP, 7, 0, 0),
|
||||
|
@ -631,7 +631,8 @@ static struct samsung_mux_clock exynos5x_mux_clks[] __initdata = {
|
||||
SRC_TOP4, 16, 1),
|
||||
MUX(0, "mout_user_aclk266", mout_user_aclk266_p, SRC_TOP4, 20, 1),
|
||||
MUX(0, "mout_user_aclk166", mout_user_aclk166_p, SRC_TOP4, 24, 1),
|
||||
MUX(0, "mout_user_aclk333", mout_user_aclk333_p, SRC_TOP4, 28, 1),
|
||||
MUX(CLK_MOUT_USER_ACLK333, "mout_user_aclk333", mout_user_aclk333_p,
|
||||
SRC_TOP4, 28, 1),
|
||||
|
||||
MUX(0, "mout_user_aclk400_disp1", mout_user_aclk400_disp1_p,
|
||||
SRC_TOP5, 0, 1),
|
||||
@ -684,7 +685,8 @@ static struct samsung_mux_clock exynos5x_mux_clks[] __initdata = {
|
||||
SRC_TOP11, 12, 1),
|
||||
MUX(0, "mout_sw_aclk266", mout_sw_aclk266_p, SRC_TOP11, 20, 1),
|
||||
MUX(0, "mout_sw_aclk166", mout_sw_aclk166_p, SRC_TOP11, 24, 1),
|
||||
MUX(0, "mout_sw_aclk333", mout_sw_aclk333_p, SRC_TOP11, 28, 1),
|
||||
MUX(CLK_MOUT_SW_ACLK333, "mout_sw_aclk333", mout_sw_aclk333_p,
|
||||
SRC_TOP11, 28, 1),
|
||||
|
||||
MUX(0, "mout_sw_aclk400_disp1", mout_sw_aclk400_disp1_p,
|
||||
SRC_TOP12, 4, 1),
|
||||
@ -890,8 +892,6 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = {
|
||||
GATE_BUS_TOP, 9, CLK_IGNORE_UNUSED, 0),
|
||||
GATE(0, "aclk66_psgen", "mout_user_aclk66_psgen",
|
||||
GATE_BUS_TOP, 10, CLK_IGNORE_UNUSED, 0),
|
||||
GATE(CLK_ACLK66_PERIC, "aclk66_peric", "mout_user_aclk66_peric",
|
||||
GATE_BUS_TOP, 11, CLK_IGNORE_UNUSED, 0),
|
||||
GATE(0, "aclk266_isp", "mout_user_aclk266_isp",
|
||||
GATE_BUS_TOP, 13, 0, 0),
|
||||
GATE(0, "aclk166", "mout_user_aclk166",
|
||||
@ -994,34 +994,61 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = {
|
||||
SRC_MASK_FSYS, 24, CLK_SET_RATE_PARENT, 0),
|
||||
|
||||
/* PERIC Block */
|
||||
GATE(CLK_UART0, "uart0", "aclk66_peric", GATE_IP_PERIC, 0, 0, 0),
|
||||
GATE(CLK_UART1, "uart1", "aclk66_peric", GATE_IP_PERIC, 1, 0, 0),
|
||||
GATE(CLK_UART2, "uart2", "aclk66_peric", GATE_IP_PERIC, 2, 0, 0),
|
||||
GATE(CLK_UART3, "uart3", "aclk66_peric", GATE_IP_PERIC, 3, 0, 0),
|
||||
GATE(CLK_I2C0, "i2c0", "aclk66_peric", GATE_IP_PERIC, 6, 0, 0),
|
||||
GATE(CLK_I2C1, "i2c1", "aclk66_peric", GATE_IP_PERIC, 7, 0, 0),
|
||||
GATE(CLK_I2C2, "i2c2", "aclk66_peric", GATE_IP_PERIC, 8, 0, 0),
|
||||
GATE(CLK_I2C3, "i2c3", "aclk66_peric", GATE_IP_PERIC, 9, 0, 0),
|
||||
GATE(CLK_USI0, "usi0", "aclk66_peric", GATE_IP_PERIC, 10, 0, 0),
|
||||
GATE(CLK_USI1, "usi1", "aclk66_peric", GATE_IP_PERIC, 11, 0, 0),
|
||||
GATE(CLK_USI2, "usi2", "aclk66_peric", GATE_IP_PERIC, 12, 0, 0),
|
||||
GATE(CLK_USI3, "usi3", "aclk66_peric", GATE_IP_PERIC, 13, 0, 0),
|
||||
GATE(CLK_I2C_HDMI, "i2c_hdmi", "aclk66_peric", GATE_IP_PERIC, 14, 0, 0),
|
||||
GATE(CLK_TSADC, "tsadc", "aclk66_peric", GATE_IP_PERIC, 15, 0, 0),
|
||||
GATE(CLK_SPI0, "spi0", "aclk66_peric", GATE_IP_PERIC, 16, 0, 0),
|
||||
GATE(CLK_SPI1, "spi1", "aclk66_peric", GATE_IP_PERIC, 17, 0, 0),
|
||||
GATE(CLK_SPI2, "spi2", "aclk66_peric", GATE_IP_PERIC, 18, 0, 0),
|
||||
GATE(CLK_I2S1, "i2s1", "aclk66_peric", GATE_IP_PERIC, 20, 0, 0),
|
||||
GATE(CLK_I2S2, "i2s2", "aclk66_peric", GATE_IP_PERIC, 21, 0, 0),
|
||||
GATE(CLK_PCM1, "pcm1", "aclk66_peric", GATE_IP_PERIC, 22, 0, 0),
|
||||
GATE(CLK_PCM2, "pcm2", "aclk66_peric", GATE_IP_PERIC, 23, 0, 0),
|
||||
GATE(CLK_PWM, "pwm", "aclk66_peric", GATE_IP_PERIC, 24, 0, 0),
|
||||
GATE(CLK_SPDIF, "spdif", "aclk66_peric", GATE_IP_PERIC, 26, 0, 0),
|
||||
GATE(CLK_USI4, "usi4", "aclk66_peric", GATE_IP_PERIC, 28, 0, 0),
|
||||
GATE(CLK_USI5, "usi5", "aclk66_peric", GATE_IP_PERIC, 30, 0, 0),
|
||||
GATE(CLK_USI6, "usi6", "aclk66_peric", GATE_IP_PERIC, 31, 0, 0),
|
||||
GATE(CLK_UART0, "uart0", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 0, 0, 0),
|
||||
GATE(CLK_UART1, "uart1", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 1, 0, 0),
|
||||
GATE(CLK_UART2, "uart2", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 2, 0, 0),
|
||||
GATE(CLK_UART3, "uart3", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 3, 0, 0),
|
||||
GATE(CLK_I2C0, "i2c0", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 6, 0, 0),
|
||||
GATE(CLK_I2C1, "i2c1", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 7, 0, 0),
|
||||
GATE(CLK_I2C2, "i2c2", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 8, 0, 0),
|
||||
GATE(CLK_I2C3, "i2c3", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 9, 0, 0),
|
||||
GATE(CLK_USI0, "usi0", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 10, 0, 0),
|
||||
GATE(CLK_USI1, "usi1", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 11, 0, 0),
|
||||
GATE(CLK_USI2, "usi2", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 12, 0, 0),
|
||||
GATE(CLK_USI3, "usi3", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 13, 0, 0),
|
||||
GATE(CLK_I2C_HDMI, "i2c_hdmi", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 14, 0, 0),
|
||||
GATE(CLK_TSADC, "tsadc", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 15, 0, 0),
|
||||
GATE(CLK_SPI0, "spi0", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 16, 0, 0),
|
||||
GATE(CLK_SPI1, "spi1", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 17, 0, 0),
|
||||
GATE(CLK_SPI2, "spi2", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 18, 0, 0),
|
||||
GATE(CLK_I2S1, "i2s1", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 20, 0, 0),
|
||||
GATE(CLK_I2S2, "i2s2", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 21, 0, 0),
|
||||
GATE(CLK_PCM1, "pcm1", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 22, 0, 0),
|
||||
GATE(CLK_PCM2, "pcm2", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 23, 0, 0),
|
||||
GATE(CLK_PWM, "pwm", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 24, 0, 0),
|
||||
GATE(CLK_SPDIF, "spdif", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 26, 0, 0),
|
||||
GATE(CLK_USI4, "usi4", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 28, 0, 0),
|
||||
GATE(CLK_USI5, "usi5", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 30, 0, 0),
|
||||
GATE(CLK_USI6, "usi6", "mout_user_aclk66_peric",
|
||||
GATE_IP_PERIC, 31, 0, 0),
|
||||
|
||||
GATE(CLK_KEYIF, "keyif", "aclk66_peric", GATE_BUS_PERIC, 22, 0, 0),
|
||||
GATE(CLK_KEYIF, "keyif", "mout_user_aclk66_peric",
|
||||
GATE_BUS_PERIC, 22, 0, 0),
|
||||
|
||||
/* PERIS Block */
|
||||
GATE(CLK_CHIPID, "chipid", "aclk66_psgen",
|
||||
|
@ -152,6 +152,11 @@ struct samsung_clock_alias s3c2410_common_aliases[] __initdata = {
|
||||
ALIAS(HCLK, NULL, "hclk"),
|
||||
ALIAS(MPLL, NULL, "mpll"),
|
||||
ALIAS(FCLK, NULL, "fclk"),
|
||||
ALIAS(PCLK, NULL, "watchdog"),
|
||||
ALIAS(PCLK_SDI, NULL, "sdi"),
|
||||
ALIAS(HCLK_NAND, NULL, "nand"),
|
||||
ALIAS(PCLK_I2S, NULL, "iis"),
|
||||
ALIAS(PCLK_I2C, NULL, "i2c"),
|
||||
};
|
||||
|
||||
/* S3C2410 specific clocks */
|
||||
@ -378,7 +383,7 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f,
|
||||
if (!np)
|
||||
s3c2410_common_clk_register_fixed_ext(ctx, xti_f);
|
||||
|
||||
if (current_soc == 2410) {
|
||||
if (current_soc == S3C2410) {
|
||||
if (_get_rate("xti") == 12 * MHZ) {
|
||||
s3c2410_plls[mpll].rate_table = pll_s3c2410_12mhz_tbl;
|
||||
s3c2410_plls[upll].rate_table = pll_s3c2410_12mhz_tbl;
|
||||
@ -432,7 +437,7 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f,
|
||||
samsung_clk_register_fixed_factor(ctx, s3c2410_ffactor,
|
||||
ARRAY_SIZE(s3c2410_ffactor));
|
||||
samsung_clk_register_alias(ctx, s3c2410_aliases,
|
||||
ARRAY_SIZE(s3c2410_common_aliases));
|
||||
ARRAY_SIZE(s3c2410_aliases));
|
||||
break;
|
||||
case S3C2440:
|
||||
samsung_clk_register_mux(ctx, s3c2440_muxes,
|
||||
|
@ -418,8 +418,10 @@ static struct samsung_clock_alias s3c64xx_clock_aliases[] = {
|
||||
ALIAS(SCLK_MMC2, "s3c-sdhci.2", "mmc_busclk.2"),
|
||||
ALIAS(SCLK_MMC1, "s3c-sdhci.1", "mmc_busclk.2"),
|
||||
ALIAS(SCLK_MMC0, "s3c-sdhci.0", "mmc_busclk.2"),
|
||||
ALIAS(SCLK_SPI1, "s3c6410-spi.1", "spi-bus"),
|
||||
ALIAS(SCLK_SPI0, "s3c6410-spi.0", "spi-bus"),
|
||||
ALIAS(PCLK_SPI1, "s3c6410-spi.1", "spi_busclk0"),
|
||||
ALIAS(SCLK_SPI1, "s3c6410-spi.1", "spi_busclk2"),
|
||||
ALIAS(PCLK_SPI0, "s3c6410-spi.0", "spi_busclk0"),
|
||||
ALIAS(SCLK_SPI0, "s3c6410-spi.0", "spi_busclk2"),
|
||||
ALIAS(SCLK_AUDIO1, "samsung-pcm.1", "audio-bus"),
|
||||
ALIAS(SCLK_AUDIO1, "samsung-i2s.1", "audio-bus"),
|
||||
ALIAS(SCLK_AUDIO0, "samsung-pcm.0", "audio-bus"),
|
||||
|
@ -211,7 +211,7 @@ static inline void spear310_clk_init(void) { }
|
||||
/* array of all spear 320 clock lookups */
|
||||
#ifdef CONFIG_MACH_SPEAR320
|
||||
|
||||
#define SPEAR320_CONTROL_REG (soc_config_base + 0x0000)
|
||||
#define SPEAR320_CONTROL_REG (soc_config_base + 0x0010)
|
||||
#define SPEAR320_EXT_CTRL_REG (soc_config_base + 0x0018)
|
||||
|
||||
#define SPEAR320_UARTX_PCLK_MASK 0x1
|
||||
@ -245,7 +245,8 @@ static const char *smii0_parents[] = { "smii_125m_pad", "ras_pll2_clk",
|
||||
"ras_syn0_gclk", };
|
||||
static const char *uartx_parents[] = { "ras_syn1_gclk", "ras_apb_clk", };
|
||||
|
||||
static void __init spear320_clk_init(void __iomem *soc_config_base)
|
||||
static void __init spear320_clk_init(void __iomem *soc_config_base,
|
||||
struct clk *ras_apb_clk)
|
||||
{
|
||||
struct clk *clk;
|
||||
|
||||
@ -342,6 +343,8 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
|
||||
SPEAR320_CONTROL_REG, UART1_PCLK_SHIFT, UART1_PCLK_MASK,
|
||||
0, &_lock);
|
||||
clk_register_clkdev(clk, NULL, "a3000000.serial");
|
||||
/* Enforce ras_apb_clk */
|
||||
clk_set_parent(clk, ras_apb_clk);
|
||||
|
||||
clk = clk_register_mux(NULL, "uart2_clk", uartx_parents,
|
||||
ARRAY_SIZE(uartx_parents),
|
||||
@ -349,6 +352,8 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
|
||||
SPEAR320_EXT_CTRL_REG, SPEAR320_UART2_PCLK_SHIFT,
|
||||
SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
|
||||
clk_register_clkdev(clk, NULL, "a4000000.serial");
|
||||
/* Enforce ras_apb_clk */
|
||||
clk_set_parent(clk, ras_apb_clk);
|
||||
|
||||
clk = clk_register_mux(NULL, "uart3_clk", uartx_parents,
|
||||
ARRAY_SIZE(uartx_parents),
|
||||
@ -379,12 +384,12 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
|
||||
clk_register_clkdev(clk, NULL, "60100000.serial");
|
||||
}
|
||||
#else
|
||||
static inline void spear320_clk_init(void __iomem *soc_config_base) { }
|
||||
static inline void spear320_clk_init(void __iomem *sb, struct clk *rc) { }
|
||||
#endif
|
||||
|
||||
void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_base)
|
||||
{
|
||||
struct clk *clk, *clk1;
|
||||
struct clk *clk, *clk1, *ras_apb_clk;
|
||||
|
||||
clk = clk_register_fixed_rate(NULL, "osc_32k_clk", NULL, CLK_IS_ROOT,
|
||||
32000);
|
||||
@ -613,6 +618,7 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
|
||||
clk = clk_register_gate(NULL, "ras_apb_clk", "apb_clk", 0, RAS_CLK_ENB,
|
||||
RAS_APB_CLK_ENB, 0, &_lock);
|
||||
clk_register_clkdev(clk, "ras_apb_clk", NULL);
|
||||
ras_apb_clk = clk;
|
||||
|
||||
clk = clk_register_gate(NULL, "ras_32k_clk", "osc_32k_clk", 0,
|
||||
RAS_CLK_ENB, RAS_32K_CLK_ENB, 0, &_lock);
|
||||
@ -659,5 +665,5 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
|
||||
else if (of_machine_is_compatible("st,spear310"))
|
||||
spear310_clk_init();
|
||||
else if (of_machine_is_compatible("st,spear320"))
|
||||
spear320_clk_init(soc_config_base);
|
||||
spear320_clk_init(soc_config_base, ras_apb_clk);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
|
||||
|
||||
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
reg = devm_ioremap_resource(&pdev->dev, r);
|
||||
if (!reg)
|
||||
if (IS_ERR(reg))
|
||||
return PTR_ERR(reg);
|
||||
|
||||
clk_parent = of_clk_get_parent_name(np, 0);
|
||||
|
@ -77,13 +77,11 @@ static int dra7_apll_enable(struct clk_hw *hw)
|
||||
if (i == MAX_APLL_WAIT_TRIES) {
|
||||
pr_warn("clock: %s failed transition to '%s'\n",
|
||||
clk_name, (state) ? "locked" : "bypassed");
|
||||
} else {
|
||||
r = -EBUSY;
|
||||
} else
|
||||
pr_debug("clock: %s transition to '%s' in %d loops\n",
|
||||
clk_name, (state) ? "locked" : "bypassed", i);
|
||||
|
||||
r = 0;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -338,7 +336,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
|
||||
const char *parent_name;
|
||||
u32 val;
|
||||
|
||||
ad = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
|
||||
ad = kzalloc(sizeof(*ad), GFP_KERNEL);
|
||||
clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
|
||||
init = kzalloc(sizeof(*init), GFP_KERNEL);
|
||||
|
||||
|
@ -161,7 +161,8 @@ cleanup:
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
|
||||
defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX)
|
||||
defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) || \
|
||||
defined(CONFIG_SOC_AM43XX)
|
||||
/**
|
||||
* ti_clk_register_dpll_x2 - Registers a DPLLx2 clock
|
||||
* @node: device node for this clock
|
||||
@ -322,7 +323,7 @@ CLK_OF_DECLARE(ti_omap4_dpll_x2_clock, "ti,omap4-dpll-x2-clock",
|
||||
of_ti_omap4_dpll_x2_setup);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SOC_AM33XX
|
||||
#if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX)
|
||||
static void __init of_ti_am3_dpll_x2_setup(struct device_node *node)
|
||||
{
|
||||
ti_clk_register_dpll_x2(node, &dpll_x2_ck_ops, NULL);
|
||||
|
@ -160,7 +160,7 @@ static void of_mux_clk_setup(struct device_node *node)
|
||||
u8 clk_mux_flags = 0;
|
||||
u32 mask = 0;
|
||||
u32 shift = 0;
|
||||
u32 flags = 0;
|
||||
u32 flags = CLK_SET_RATE_NO_REPARENT;
|
||||
|
||||
num_parents = of_clk_get_parent_count(node);
|
||||
if (num_parents < 2) {
|
||||
|
@ -162,7 +162,7 @@ static void exynos4_mct_frc_start(void)
|
||||
exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON);
|
||||
}
|
||||
|
||||
static cycle_t exynos4_frc_read(struct clocksource *cs)
|
||||
static cycle_t notrace _exynos4_frc_read(void)
|
||||
{
|
||||
unsigned int lo, hi;
|
||||
u32 hi2 = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_U);
|
||||
@ -176,6 +176,11 @@ static cycle_t exynos4_frc_read(struct clocksource *cs)
|
||||
return ((cycle_t)hi << 32) | lo;
|
||||
}
|
||||
|
||||
static cycle_t exynos4_frc_read(struct clocksource *cs)
|
||||
{
|
||||
return _exynos4_frc_read();
|
||||
}
|
||||
|
||||
static void exynos4_frc_resume(struct clocksource *cs)
|
||||
{
|
||||
exynos4_mct_frc_start();
|
||||
@ -192,13 +197,24 @@ struct clocksource mct_frc = {
|
||||
|
||||
static u64 notrace exynos4_read_sched_clock(void)
|
||||
{
|
||||
return exynos4_frc_read(&mct_frc);
|
||||
return _exynos4_frc_read();
|
||||
}
|
||||
|
||||
static struct delay_timer exynos4_delay_timer;
|
||||
|
||||
static cycles_t exynos4_read_current_timer(void)
|
||||
{
|
||||
return _exynos4_frc_read();
|
||||
}
|
||||
|
||||
static void __init exynos4_clocksource_init(void)
|
||||
{
|
||||
exynos4_mct_frc_start();
|
||||
|
||||
exynos4_delay_timer.read_current_timer = &exynos4_read_current_timer;
|
||||
exynos4_delay_timer.freq = clk_rate;
|
||||
register_current_timer_delay(&exynos4_delay_timer);
|
||||
|
||||
if (clocksource_register_hz(&mct_frc, clk_rate))
|
||||
panic("%s: can't register clocksource\n", mct_frc.name);
|
||||
|
||||
|
@ -49,7 +49,7 @@ obj-$(CONFIG_ARM_BIG_LITTLE_CPUFREQ) += arm_big_little.o
|
||||
# LITTLE drivers, so that it is probed last.
|
||||
obj-$(CONFIG_ARM_DT_BL_CPUFREQ) += arm_big_little_dt.o
|
||||
|
||||
obj-$(CONFIG_ARCH_DAVINCI_DA850) += davinci-cpufreq.o
|
||||
obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o
|
||||
obj-$(CONFIG_UX500_SOC_DB8500) += dbx500-cpufreq.o
|
||||
obj-$(CONFIG_ARM_EXYNOS_CPUFREQ) += exynos-cpufreq.o
|
||||
obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ) += exynos4210-cpufreq.o
|
||||
|
@ -128,6 +128,7 @@ static struct pstate_funcs pstate_funcs;
|
||||
|
||||
struct perf_limits {
|
||||
int no_turbo;
|
||||
int turbo_disabled;
|
||||
int max_perf_pct;
|
||||
int min_perf_pct;
|
||||
int32_t max_perf;
|
||||
@ -287,7 +288,10 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b,
|
||||
if (ret != 1)
|
||||
return -EINVAL;
|
||||
limits.no_turbo = clamp_t(int, input, 0 , 1);
|
||||
|
||||
if (limits.turbo_disabled) {
|
||||
pr_warn("Turbo disabled by BIOS or unavailable on processor\n");
|
||||
limits.no_turbo = limits.turbo_disabled;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -357,21 +361,21 @@ static int byt_get_min_pstate(void)
|
||||
{
|
||||
u64 value;
|
||||
rdmsrl(BYT_RATIOS, value);
|
||||
return (value >> 8) & 0x3F;
|
||||
return (value >> 8) & 0x7F;
|
||||
}
|
||||
|
||||
static int byt_get_max_pstate(void)
|
||||
{
|
||||
u64 value;
|
||||
rdmsrl(BYT_RATIOS, value);
|
||||
return (value >> 16) & 0x3F;
|
||||
return (value >> 16) & 0x7F;
|
||||
}
|
||||
|
||||
static int byt_get_turbo_pstate(void)
|
||||
{
|
||||
u64 value;
|
||||
rdmsrl(BYT_TURBO_RATIOS, value);
|
||||
return value & 0x3F;
|
||||
return value & 0x7F;
|
||||
}
|
||||
|
||||
static void byt_set_pstate(struct cpudata *cpudata, int pstate)
|
||||
@ -381,7 +385,7 @@ static void byt_set_pstate(struct cpudata *cpudata, int pstate)
|
||||
u32 vid;
|
||||
|
||||
val = pstate << 8;
|
||||
if (limits.no_turbo)
|
||||
if (limits.no_turbo && !limits.turbo_disabled)
|
||||
val |= (u64)1 << 32;
|
||||
|
||||
vid_fp = cpudata->vid.min + mul_fp(
|
||||
@ -405,8 +409,8 @@ static void byt_get_vid(struct cpudata *cpudata)
|
||||
|
||||
|
||||
rdmsrl(BYT_VIDS, value);
|
||||
cpudata->vid.min = int_tofp((value >> 8) & 0x3f);
|
||||
cpudata->vid.max = int_tofp((value >> 16) & 0x3f);
|
||||
cpudata->vid.min = int_tofp((value >> 8) & 0x7f);
|
||||
cpudata->vid.max = int_tofp((value >> 16) & 0x7f);
|
||||
cpudata->vid.ratio = div_fp(
|
||||
cpudata->vid.max - cpudata->vid.min,
|
||||
int_tofp(cpudata->pstate.max_pstate -
|
||||
@ -448,7 +452,7 @@ static void core_set_pstate(struct cpudata *cpudata, int pstate)
|
||||
u64 val;
|
||||
|
||||
val = pstate << 8;
|
||||
if (limits.no_turbo)
|
||||
if (limits.no_turbo && !limits.turbo_disabled)
|
||||
val |= (u64)1 << 32;
|
||||
|
||||
wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val);
|
||||
@ -696,9 +700,8 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
|
||||
|
||||
cpu = all_cpu_data[cpunum];
|
||||
|
||||
intel_pstate_get_cpu_pstates(cpu);
|
||||
|
||||
cpu->cpu = cpunum;
|
||||
intel_pstate_get_cpu_pstates(cpu);
|
||||
|
||||
init_timer_deferrable(&cpu->timer);
|
||||
cpu->timer.function = intel_pstate_timer_func;
|
||||
@ -741,7 +744,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
|
||||
limits.min_perf = int_tofp(1);
|
||||
limits.max_perf_pct = 100;
|
||||
limits.max_perf = int_tofp(1);
|
||||
limits.no_turbo = 0;
|
||||
limits.no_turbo = limits.turbo_disabled;
|
||||
return 0;
|
||||
}
|
||||
limits.min_perf_pct = (policy->min * 100) / policy->cpuinfo.max_freq;
|
||||
@ -784,6 +787,7 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
struct cpudata *cpu;
|
||||
int rc;
|
||||
u64 misc_en;
|
||||
|
||||
rc = intel_pstate_init_cpu(policy->cpu);
|
||||
if (rc)
|
||||
@ -791,8 +795,13 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
|
||||
|
||||
cpu = all_cpu_data[policy->cpu];
|
||||
|
||||
if (!limits.no_turbo &&
|
||||
limits.min_perf_pct == 100 && limits.max_perf_pct == 100)
|
||||
rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);
|
||||
if (misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE ||
|
||||
cpu->pstate.max_pstate == cpu->pstate.turbo_pstate) {
|
||||
limits.turbo_disabled = 1;
|
||||
limits.no_turbo = 1;
|
||||
}
|
||||
if (limits.min_perf_pct == 100 && limits.max_perf_pct == 100)
|
||||
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
|
||||
else
|
||||
policy->policy = CPUFREQ_POLICY_POWERSAVE;
|
||||
|
@ -453,8 +453,8 @@ static int caam_jr_probe(struct platform_device *pdev)
|
||||
int error;
|
||||
|
||||
jrdev = &pdev->dev;
|
||||
jrpriv = kmalloc(sizeof(struct caam_drv_private_jr),
|
||||
GFP_KERNEL);
|
||||
jrpriv = devm_kmalloc(jrdev, sizeof(struct caam_drv_private_jr),
|
||||
GFP_KERNEL);
|
||||
if (!jrpriv)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -487,10 +487,8 @@ static int caam_jr_probe(struct platform_device *pdev)
|
||||
|
||||
/* Now do the platform independent part */
|
||||
error = caam_jr_init(jrdev); /* now turn on hardware */
|
||||
if (error) {
|
||||
kfree(jrpriv);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
||||
jrpriv->dev = jrdev;
|
||||
spin_lock(&driver_data.jr_alloc_lock);
|
||||
|
@ -86,6 +86,9 @@
|
||||
|
||||
#define USBSS_IRQ_PD_COMP (1 << 2)
|
||||
|
||||
/* Packet Descriptor */
|
||||
#define PD2_ZERO_LENGTH (1 << 19)
|
||||
|
||||
struct cppi41_channel {
|
||||
struct dma_chan chan;
|
||||
struct dma_async_tx_descriptor txd;
|
||||
@ -307,7 +310,7 @@ static irqreturn_t cppi41_irq(int irq, void *data)
|
||||
__iormb();
|
||||
|
||||
while (val) {
|
||||
u32 desc;
|
||||
u32 desc, len;
|
||||
|
||||
q_num = __fls(val);
|
||||
val &= ~(1 << q_num);
|
||||
@ -319,9 +322,13 @@ static irqreturn_t cppi41_irq(int irq, void *data)
|
||||
q_num, desc);
|
||||
continue;
|
||||
}
|
||||
c->residue = pd_trans_len(c->desc->pd6) -
|
||||
pd_trans_len(c->desc->pd0);
|
||||
|
||||
if (c->desc->pd2 & PD2_ZERO_LENGTH)
|
||||
len = 0;
|
||||
else
|
||||
len = pd_trans_len(c->desc->pd0);
|
||||
|
||||
c->residue = pd_trans_len(c->desc->pd6) - len;
|
||||
dma_cookie_complete(&c->txd);
|
||||
c->txd.callback(c->txd.callback_param);
|
||||
}
|
||||
|
@ -255,6 +255,7 @@ struct sdma_channel {
|
||||
enum dma_slave_buswidth word_size;
|
||||
unsigned int buf_tail;
|
||||
unsigned int num_bd;
|
||||
unsigned int period_len;
|
||||
struct sdma_buffer_descriptor *bd;
|
||||
dma_addr_t bd_phys;
|
||||
unsigned int pc_from_device, pc_to_device;
|
||||
@ -592,6 +593,12 @@ static void sdma_event_disable(struct sdma_channel *sdmac, unsigned int event)
|
||||
}
|
||||
|
||||
static void sdma_handle_channel_loop(struct sdma_channel *sdmac)
|
||||
{
|
||||
if (sdmac->desc.callback)
|
||||
sdmac->desc.callback(sdmac->desc.callback_param);
|
||||
}
|
||||
|
||||
static void sdma_update_channel_loop(struct sdma_channel *sdmac)
|
||||
{
|
||||
struct sdma_buffer_descriptor *bd;
|
||||
|
||||
@ -611,9 +618,6 @@ static void sdma_handle_channel_loop(struct sdma_channel *sdmac)
|
||||
bd->mode.status |= BD_DONE;
|
||||
sdmac->buf_tail++;
|
||||
sdmac->buf_tail %= sdmac->num_bd;
|
||||
|
||||
if (sdmac->desc.callback)
|
||||
sdmac->desc.callback(sdmac->desc.callback_param);
|
||||
}
|
||||
}
|
||||
|
||||
@ -669,6 +673,9 @@ static irqreturn_t sdma_int_handler(int irq, void *dev_id)
|
||||
int channel = fls(stat) - 1;
|
||||
struct sdma_channel *sdmac = &sdma->channel[channel];
|
||||
|
||||
if (sdmac->flags & IMX_DMA_SG_LOOP)
|
||||
sdma_update_channel_loop(sdmac);
|
||||
|
||||
tasklet_schedule(&sdmac->tasklet);
|
||||
|
||||
__clear_bit(channel, &stat);
|
||||
@ -1129,6 +1136,7 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic(
|
||||
sdmac->status = DMA_IN_PROGRESS;
|
||||
|
||||
sdmac->buf_tail = 0;
|
||||
sdmac->period_len = period_len;
|
||||
|
||||
sdmac->flags |= IMX_DMA_SG_LOOP;
|
||||
sdmac->direction = direction;
|
||||
@ -1225,9 +1233,15 @@ static enum dma_status sdma_tx_status(struct dma_chan *chan,
|
||||
struct dma_tx_state *txstate)
|
||||
{
|
||||
struct sdma_channel *sdmac = to_sdma_chan(chan);
|
||||
u32 residue;
|
||||
|
||||
if (sdmac->flags & IMX_DMA_SG_LOOP)
|
||||
residue = (sdmac->num_bd - sdmac->buf_tail) * sdmac->period_len;
|
||||
else
|
||||
residue = sdmac->chn_count - sdmac->chn_real_count;
|
||||
|
||||
dma_set_tx_state(txstate, chan->completed_cookie, chan->cookie,
|
||||
sdmac->chn_count - sdmac->chn_real_count);
|
||||
residue);
|
||||
|
||||
return sdmac->status;
|
||||
}
|
||||
|
@ -1464,12 +1464,13 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
|
||||
#else
|
||||
static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
DRM_INFO("Replacing VGA console driver\n");
|
||||
|
||||
console_lock();
|
||||
ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
|
||||
if (con_is_bound(&vga_con))
|
||||
ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
|
||||
if (ret == 0) {
|
||||
ret = do_unregister_con_driver(&vga_con);
|
||||
|
||||
|
@ -656,6 +656,7 @@ enum intel_sbi_destination {
|
||||
#define QUIRK_PIPEA_FORCE (1<<0)
|
||||
#define QUIRK_LVDS_SSC_DISABLE (1<<1)
|
||||
#define QUIRK_INVERT_BRIGHTNESS (1<<2)
|
||||
#define QUIRK_BACKLIGHT_PRESENT (1<<3)
|
||||
|
||||
struct intel_fbdev;
|
||||
struct intel_fbc_work;
|
||||
|
@ -74,6 +74,50 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev)
|
||||
if (base == 0)
|
||||
return 0;
|
||||
|
||||
/* make sure we don't clobber the GTT if it's within stolen memory */
|
||||
if (INTEL_INFO(dev)->gen <= 4 && !IS_G33(dev) && !IS_G4X(dev)) {
|
||||
struct {
|
||||
u32 start, end;
|
||||
} stolen[2] = {
|
||||
{ .start = base, .end = base + dev_priv->gtt.stolen_size, },
|
||||
{ .start = base, .end = base + dev_priv->gtt.stolen_size, },
|
||||
};
|
||||
u64 gtt_start, gtt_end;
|
||||
|
||||
gtt_start = I915_READ(PGTBL_CTL);
|
||||
if (IS_GEN4(dev))
|
||||
gtt_start = (gtt_start & PGTBL_ADDRESS_LO_MASK) |
|
||||
(gtt_start & PGTBL_ADDRESS_HI_MASK) << 28;
|
||||
else
|
||||
gtt_start &= PGTBL_ADDRESS_LO_MASK;
|
||||
gtt_end = gtt_start + gtt_total_entries(dev_priv->gtt) * 4;
|
||||
|
||||
if (gtt_start >= stolen[0].start && gtt_start < stolen[0].end)
|
||||
stolen[0].end = gtt_start;
|
||||
if (gtt_end > stolen[1].start && gtt_end <= stolen[1].end)
|
||||
stolen[1].start = gtt_end;
|
||||
|
||||
/* pick the larger of the two chunks */
|
||||
if (stolen[0].end - stolen[0].start >
|
||||
stolen[1].end - stolen[1].start) {
|
||||
base = stolen[0].start;
|
||||
dev_priv->gtt.stolen_size = stolen[0].end - stolen[0].start;
|
||||
} else {
|
||||
base = stolen[1].start;
|
||||
dev_priv->gtt.stolen_size = stolen[1].end - stolen[1].start;
|
||||
}
|
||||
|
||||
if (stolen[0].start != stolen[1].start ||
|
||||
stolen[0].end != stolen[1].end) {
|
||||
DRM_DEBUG_KMS("GTT within stolen memory at 0x%llx-0x%llx\n",
|
||||
(unsigned long long) gtt_start,
|
||||
(unsigned long long) gtt_end - 1);
|
||||
DRM_DEBUG_KMS("Stolen memory adjusted to 0x%x-0x%x\n",
|
||||
base, base + (u32) dev_priv->gtt.stolen_size - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Verify that nothing else uses this physical address. Stolen
|
||||
* memory should be reserved by the BIOS and hidden from the
|
||||
* kernel. So if the region is already marked as busy, something
|
||||
|
@ -942,6 +942,9 @@ enum punit_power_well {
|
||||
/*
|
||||
* Instruction and interrupt control regs
|
||||
*/
|
||||
#define PGTBL_CTL 0x02020
|
||||
#define PGTBL_ADDRESS_LO_MASK 0xfffff000 /* bits [31:12] */
|
||||
#define PGTBL_ADDRESS_HI_MASK 0x000000f0 /* bits [35:32] (gen4) */
|
||||
#define PGTBL_ER 0x02024
|
||||
#define RENDER_RING_BASE 0x02000
|
||||
#define BSD_RING_BASE 0x04000
|
||||
|
@ -11591,6 +11591,14 @@ static void quirk_invert_brightness(struct drm_device *dev)
|
||||
DRM_INFO("applying inverted panel brightness quirk\n");
|
||||
}
|
||||
|
||||
/* Some VBT's incorrectly indicate no backlight is present */
|
||||
static void quirk_backlight_present(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
dev_priv->quirks |= QUIRK_BACKLIGHT_PRESENT;
|
||||
DRM_INFO("applying backlight present quirk\n");
|
||||
}
|
||||
|
||||
struct intel_quirk {
|
||||
int device;
|
||||
int subsystem_vendor;
|
||||
@ -11659,6 +11667,12 @@ static struct intel_quirk intel_quirks[] = {
|
||||
|
||||
/* Acer Aspire 5336 */
|
||||
{ 0x2a42, 0x1025, 0x048a, quirk_invert_brightness },
|
||||
|
||||
/* Acer C720 and C720P Chromebooks (Celeron 2955U) have backlights */
|
||||
{ 0x0a06, 0x1025, 0x0a11, quirk_backlight_present },
|
||||
|
||||
/* Toshiba CB35 Chromebook (Celeron 2955U) */
|
||||
{ 0x0a06, 0x1179, 0x0a88, quirk_backlight_present },
|
||||
};
|
||||
|
||||
static void intel_init_quirks(struct drm_device *dev)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user