Merge branches 'rmobile/ag5' and 'rmobile/fsi-despair' into rmobile-latest
This commit is contained in:
commit
c4d73e7d75
1
.mailmap
1
.mailmap
|
@ -105,3 +105,4 @@ Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
|
|||
Uwe Kleine-König <ukl@pengutronix.de>
|
||||
Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
|
||||
Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
|
||||
Takashi YOSHII <takashi.yoshii.zj@renesas.com>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</orgname>
|
||||
|
||||
<address>
|
||||
<email>hjk@linutronix.de</email>
|
||||
<email>hjk@hansjkoch.de</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
|
@ -114,7 +114,7 @@ GPL version 2.
|
|||
|
||||
<para>If you know of any translations for this document, or you are
|
||||
interested in translating it, please email me
|
||||
<email>hjk@linutronix.de</email>.
|
||||
<email>hjk@hansjkoch.de</email>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@ -171,7 +171,7 @@ interested in translating it, please email me
|
|||
<title>Feedback</title>
|
||||
<para>Find something wrong with this document? (Or perhaps something
|
||||
right?) I would love to hear from you. Please email me at
|
||||
<email>hjk@linutronix.de</email>.</para>
|
||||
<email>hjk@hansjkoch.de</email>.</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ The stages that a patch goes through are, generally:
|
|||
inclusion, it should be accepted by a relevant subsystem maintainer -
|
||||
though this acceptance is not a guarantee that the patch will make it
|
||||
all the way to the mainline. The patch will show up in the maintainer's
|
||||
subsystem tree and into the staging trees (described below). When the
|
||||
subsystem tree and into the -next trees (described below). When the
|
||||
process works, this step leads to more extensive review of the patch and
|
||||
the discovery of any problems resulting from the integration of this
|
||||
patch with work being done by others.
|
||||
|
@ -236,7 +236,7 @@ finding the right maintainer. Sending patches directly to Linus is not
|
|||
normally the right way to go.
|
||||
|
||||
|
||||
2.4: STAGING TREES
|
||||
2.4: NEXT TREES
|
||||
|
||||
The chain of subsystem trees guides the flow of patches into the kernel,
|
||||
but it also raises an interesting question: what if somebody wants to look
|
||||
|
@ -250,7 +250,7 @@ changes land in the mainline kernel. One could pull changes from all of
|
|||
the interesting subsystem trees, but that would be a big and error-prone
|
||||
job.
|
||||
|
||||
The answer comes in the form of staging trees, where subsystem trees are
|
||||
The answer comes in the form of -next trees, where subsystem trees are
|
||||
collected for testing and review. The older of these trees, maintained by
|
||||
Andrew Morton, is called "-mm" (for memory management, which is how it got
|
||||
started). The -mm tree integrates patches from a long list of subsystem
|
||||
|
@ -275,7 +275,7 @@ directory at:
|
|||
Use of the MMOTM tree is likely to be a frustrating experience, though;
|
||||
there is a definite chance that it will not even compile.
|
||||
|
||||
The other staging tree, started more recently, is linux-next, maintained by
|
||||
The other -next tree, started more recently, is linux-next, maintained by
|
||||
Stephen Rothwell. The linux-next tree is, by design, a snapshot of what
|
||||
the mainline is expected to look like after the next merge window closes.
|
||||
Linux-next trees are announced on the linux-kernel and linux-next mailing
|
||||
|
@ -303,12 +303,25 @@ volatility of linux-next tends to make it a difficult development target.
|
|||
See http://lwn.net/Articles/289013/ for more information on this topic, and
|
||||
stay tuned; much is still in flux where linux-next is involved.
|
||||
|
||||
Besides the mmotm and linux-next trees, the kernel source tree now contains
|
||||
the drivers/staging/ directory and many sub-directories for drivers or
|
||||
filesystems that are on their way to being added to the kernel tree
|
||||
proper, but they remain in drivers/staging/ while they still need more
|
||||
work.
|
||||
2.4.1: STAGING TREES
|
||||
|
||||
The kernel source tree now contains the drivers/staging/ directory, where
|
||||
many sub-directories for drivers or filesystems that are on their way to
|
||||
being added to the kernel tree live. They remain in drivers/staging while
|
||||
they still need more work; once complete, they can be moved into the
|
||||
kernel proper. This is a way to keep track of drivers that aren't
|
||||
up to Linux kernel coding or quality standards, but people may want to use
|
||||
them and track development.
|
||||
|
||||
Greg Kroah-Hartman currently (as of 2.6.36) maintains the staging tree.
|
||||
Drivers that still need work are sent to him, with each driver having
|
||||
its own subdirectory in drivers/staging/. Along with the driver source
|
||||
files, a TODO file should be present in the directory as well. The TODO
|
||||
file lists the pending work that the driver needs for acceptance into
|
||||
the kernel proper, as well as a list of people that should be Cc'd for any
|
||||
patches to the driver. Staging drivers that don't currently build should
|
||||
have their config entries depend upon CONFIG_BROKEN. Once they can
|
||||
be successfully built without outside patches, CONFIG_BROKEN can be removed.
|
||||
|
||||
2.5: TOOLS
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ static ssize_t childless_storeme_write(struct childless *childless,
|
|||
char *p = (char *) page;
|
||||
|
||||
tmp = simple_strtoul(p, &p, 10);
|
||||
if (!p || (*p && (*p != '\n')))
|
||||
if ((*p != '\0') && (*p != '\n'))
|
||||
return -EINVAL;
|
||||
|
||||
if (tmp > INT_MAX)
|
||||
|
|
|
@ -617,6 +617,16 @@ and have the following read/write attributes:
|
|||
is configured as an output, this value may be written;
|
||||
any nonzero value is treated as high.
|
||||
|
||||
If the pin can be configured as interrupt-generating interrupt
|
||||
and if it has been configured to generate interrupts (see the
|
||||
description of "edge"), you can poll(2) on that file and
|
||||
poll(2) will return whenever the interrupt was triggered. If
|
||||
you use poll(2), set the events POLLPRI and POLLERR. If you
|
||||
use select(2), set the file descriptor in exceptfds. After
|
||||
poll(2) returns, either lseek(2) to the beginning of the sysfs
|
||||
file and read the new value or close the file and re-open it
|
||||
to read the value.
|
||||
|
||||
"edge" ... reads as either "none", "rising", "falling", or
|
||||
"both". Write these strings to select the signal edge(s)
|
||||
that will make poll(2) on the "value" file return.
|
||||
|
|
|
@ -11,7 +11,7 @@ Authors:
|
|||
Mark M. Hoffman <mhoffman@lightlink.com>
|
||||
Ported to 2.6 by Eric J. Bowersox <ericb@aspsys.com>
|
||||
Adapted to 2.6.20 by Carsten Emde <ce@osadl.org>
|
||||
Modified for mainline integration by Hans J. Koch <hjk@linutronix.de>
|
||||
Modified for mainline integration by Hans J. Koch <hjk@hansjkoch.de>
|
||||
|
||||
Module Parameters
|
||||
-----------------
|
||||
|
|
|
@ -8,7 +8,7 @@ Supported chips:
|
|||
Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf
|
||||
|
||||
Authors:
|
||||
Hans J. Koch <hjk@linutronix.de>
|
||||
Hans J. Koch <hjk@hansjkoch.de>
|
||||
John Morris <john.morris@spirentcom.com>
|
||||
Claus Gindhart <claus.gindhart@kontron.com>
|
||||
|
||||
|
|
|
@ -37,6 +37,9 @@ Typical usage of the OPP library is as follows:
|
|||
SoC framework -> modifies on required cases certain OPPs -> OPP layer
|
||||
-> queries to search/retrieve information ->
|
||||
|
||||
Architectures that provide a SoC framework for OPP should select ARCH_HAS_OPP
|
||||
to make the OPP layer available.
|
||||
|
||||
OPP layer expects each domain to be represented by a unique device pointer. SoC
|
||||
framework registers a set of initial OPPs per device with the OPP layer. This
|
||||
list is expected to be an optimally small number typically around 5 per device.
|
||||
|
|
11
MAINTAINERS
11
MAINTAINERS
|
@ -1359,7 +1359,7 @@ F: include/net/bluetooth/
|
|||
|
||||
BONDING DRIVER
|
||||
M: Jay Vosburgh <fubar@us.ibm.com>
|
||||
L: bonding-devel@lists.sourceforge.net
|
||||
L: netdev@vger.kernel.org
|
||||
W: http://sourceforge.net/projects/bonding/
|
||||
S: Supported
|
||||
F: drivers/net/bonding/
|
||||
|
@ -1829,6 +1829,13 @@ W: http://www.chelsio.com
|
|||
S: Supported
|
||||
F: drivers/net/cxgb4vf/
|
||||
|
||||
STMMAC ETHERNET DRIVER
|
||||
M: Giuseppe Cavallaro <peppe.cavallaro@st.com>
|
||||
L: netdev@vger.kernel.org
|
||||
W: http://www.stlinux.com
|
||||
S: Supported
|
||||
F: drivers/net/stmmac/
|
||||
|
||||
CYBERPRO FB DRIVER
|
||||
M: Russell King <linux@arm.linux.org.uk>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
|
@ -2008,6 +2015,7 @@ F: drivers/hwmon/dme1737.c
|
|||
DOCBOOK FOR DOCUMENTATION
|
||||
M: Randy Dunlap <rdunlap@xenotime.net>
|
||||
S: Maintained
|
||||
F: scripts/kernel-doc
|
||||
|
||||
DOCKING STATION DRIVER
|
||||
M: Shaohua Li <shaohua.li@intel.com>
|
||||
|
@ -2018,6 +2026,7 @@ F: drivers/acpi/dock.c
|
|||
DOCUMENTATION
|
||||
M: Randy Dunlap <rdunlap@xenotime.net>
|
||||
L: linux-doc@vger.kernel.org
|
||||
T: quilt oss.oracle.com/~rdunlap/kernel-doc-patches/current/
|
||||
S: Maintained
|
||||
F: Documentation/
|
||||
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,7 +1,7 @@
|
|||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 37
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION = -rc3
|
||||
NAME = Flesh-Eating Bats with Fangs
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
@ -359,8 +359,8 @@ static struct clk_lookup dm355_clks[] = {
|
|||
CLK(NULL, "uart1", &uart1_clk),
|
||||
CLK(NULL, "uart2", &uart2_clk),
|
||||
CLK("i2c_davinci.1", NULL, &i2c_clk),
|
||||
CLK("davinci-asp.0", NULL, &asp0_clk),
|
||||
CLK("davinci-asp.1", NULL, &asp1_clk),
|
||||
CLK("davinci-mcbsp.0", NULL, &asp0_clk),
|
||||
CLK("davinci-mcbsp.1", NULL, &asp1_clk),
|
||||
CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
|
||||
CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
|
||||
CLK("spi_davinci.0", NULL, &spi0_clk),
|
||||
|
@ -664,7 +664,7 @@ static struct resource dm355_asp1_resources[] = {
|
|||
};
|
||||
|
||||
static struct platform_device dm355_asp1_device = {
|
||||
.name = "davinci-asp",
|
||||
.name = "davinci-mcbsp",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(dm355_asp1_resources),
|
||||
.resource = dm355_asp1_resources,
|
||||
|
|
|
@ -459,7 +459,7 @@ static struct clk_lookup dm365_clks[] = {
|
|||
CLK(NULL, "usb", &usb_clk),
|
||||
CLK("davinci_emac.1", NULL, &emac_clk),
|
||||
CLK("davinci_voicecodec", NULL, &voicecodec_clk),
|
||||
CLK("davinci-asp.0", NULL, &asp0_clk),
|
||||
CLK("davinci-mcbsp", NULL, &asp0_clk),
|
||||
CLK(NULL, "rto", &rto_clk),
|
||||
CLK(NULL, "mjcp", &mjcp_clk),
|
||||
CLK(NULL, NULL, NULL),
|
||||
|
@ -922,8 +922,8 @@ static struct resource dm365_asp_resources[] = {
|
|||
};
|
||||
|
||||
static struct platform_device dm365_asp_device = {
|
||||
.name = "davinci-asp",
|
||||
.id = 0,
|
||||
.name = "davinci-mcbsp",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(dm365_asp_resources),
|
||||
.resource = dm365_asp_resources,
|
||||
};
|
||||
|
|
|
@ -302,7 +302,7 @@ static struct clk_lookup dm644x_clks[] = {
|
|||
CLK("davinci_emac.1", NULL, &emac_clk),
|
||||
CLK("i2c_davinci.1", NULL, &i2c_clk),
|
||||
CLK("palm_bk3710", NULL, &ide_clk),
|
||||
CLK("davinci-asp", NULL, &asp_clk),
|
||||
CLK("davinci-mcbsp", NULL, &asp_clk),
|
||||
CLK("davinci_mmc.0", NULL, &mmcsd_clk),
|
||||
CLK(NULL, "spi", &spi_clk),
|
||||
CLK(NULL, "gpio", &gpio_clk),
|
||||
|
@ -580,7 +580,7 @@ static struct resource dm644x_asp_resources[] = {
|
|||
};
|
||||
|
||||
static struct platform_device dm644x_asp_device = {
|
||||
.name = "davinci-asp",
|
||||
.name = "davinci-mcbsp",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(dm644x_asp_resources),
|
||||
.resource = dm644x_asp_resources,
|
||||
|
|
|
@ -24,6 +24,7 @@ config ARCH_SH73A0
|
|||
bool "SH-Mobile AG5 (R8A73A00)"
|
||||
select CPU_V7
|
||||
select SH_CLK_CPG
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select ARM_GIC
|
||||
|
||||
comment "SH-Mobile Board Type"
|
||||
|
@ -60,6 +61,7 @@ endchoice
|
|||
config MACH_AG5EVM
|
||||
bool "AG5EVM board"
|
||||
depends on ARCH_SH73A0
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
|
||||
comment "SH-Mobile System Configuration"
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o
|
|||
pfc-$(CONFIG_ARCH_SH7367) := pfc-sh7367.o
|
||||
pfc-$(CONFIG_ARCH_SH7377) := pfc-sh7377.o
|
||||
pfc-$(CONFIG_ARCH_SH7372) := pfc-sh7372.o
|
||||
pfc-$(CONFIG_ARCH_SH73A0) := pfc-sh73a0.o
|
||||
obj-$(CONFIG_GENERIC_GPIO) += $(pfc-y)
|
||||
|
||||
# Board objects
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#include <linux/serial_sci.h>
|
||||
#include <linux/smsc911x.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/input/sh_keysc.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/sh73a0.h>
|
||||
#include <mach/common.h>
|
||||
|
@ -70,8 +73,49 @@ static struct platform_device eth_device = {
|
|||
.num_resources = ARRAY_SIZE(smsc9220_resources),
|
||||
};
|
||||
|
||||
static struct sh_keysc_info keysc_platdata = {
|
||||
.mode = SH_KEYSC_MODE_6,
|
||||
.scan_timing = 3,
|
||||
.delay = 100,
|
||||
.keycodes = {
|
||||
KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
|
||||
KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
|
||||
KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
|
||||
KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
|
||||
KEY_SPACE, KEY_9, KEY_6, KEY_3, KEY_WAKEUP, KEY_RIGHT, \
|
||||
KEY_COFFEE,
|
||||
KEY_0, KEY_8, KEY_5, KEY_2, KEY_DOWN, KEY_ENTER, KEY_UP,
|
||||
KEY_KPASTERISK, KEY_7, KEY_4, KEY_1, KEY_STOP, KEY_LEFT, \
|
||||
KEY_COMPUTER,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource keysc_resources[] = {
|
||||
[0] = {
|
||||
.name = "KEYSC",
|
||||
.start = 0xe61b0000,
|
||||
.end = 0xe61b0098 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(71),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device keysc_device = {
|
||||
.name = "sh_keysc",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(keysc_resources),
|
||||
.resource = keysc_resources,
|
||||
.dev = {
|
||||
.platform_data = &keysc_platdata,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *ag5evm_devices[] __initdata = {
|
||||
ð_device,
|
||||
&keysc_device,
|
||||
};
|
||||
|
||||
static struct map_desc ag5evm_io_desc[] __initdata = {
|
||||
|
@ -109,28 +153,47 @@ void __init ag5evm_init_irq(void)
|
|||
gic_cpu_init(0, __io(0xf0000100));
|
||||
}
|
||||
|
||||
#define PORT144CR 0xe6052090
|
||||
#define PORT145CR 0xe6052091
|
||||
|
||||
#define PORT154CR 0xe605209a
|
||||
#define PORT155CR 0xe605209b
|
||||
#define PORT156CR 0xe605209c
|
||||
#define PORT157CR 0xe605209d
|
||||
|
||||
#define PORTR159_128DR 0xe6056004
|
||||
|
||||
static void __init ag5evm_init(void)
|
||||
{
|
||||
sh73a0_pinmux_init();
|
||||
|
||||
/* enable SCIFA2 */
|
||||
__raw_writeb(0x12, PORT154CR); /* TXD */
|
||||
__raw_writeb(0x22, PORT155CR); /* RXD */
|
||||
__raw_writeb(0x12, PORT156CR); /* RTS */
|
||||
__raw_writeb(0x22, PORT157CR); /* CTS */
|
||||
gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
|
||||
gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
|
||||
gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
|
||||
gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
|
||||
|
||||
/* enable KEYSC */
|
||||
gpio_request(GPIO_FN_KEYIN0, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN1, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN2, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN3, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN4, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN5, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN6, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN7, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT0, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT1, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT2, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT3, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT4, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT5, NULL);
|
||||
gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL);
|
||||
gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT8, NULL);
|
||||
gpio_request(GPIO_FN_PORT149_KEYOUT9, NULL);
|
||||
|
||||
/* enable IC2 2 and 3 */
|
||||
gpio_request(GPIO_FN_PORT236_I2C_SDA2, NULL);
|
||||
gpio_request(GPIO_FN_PORT237_I2C_SCL2, NULL);
|
||||
gpio_request(GPIO_FN_PORT248_I2C_SCL3, NULL);
|
||||
gpio_request(GPIO_FN_PORT249_I2C_SDA3, NULL);
|
||||
|
||||
/* enable SMSC911X */
|
||||
__raw_writeb(0x20, PORT144CR); /* PINTA2 */
|
||||
__raw_writeb(0x10, PORT145CR); /* RESET */
|
||||
__raw_writel(__raw_readl(PORTR159_128DR) & ~(1 << 17), PORTR159_128DR);
|
||||
gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
|
||||
gpio_direction_input(GPIO_PORT144);
|
||||
gpio_request(GPIO_PORT145, NULL); /* RESET */
|
||||
gpio_direction_output(GPIO_PORT145, 1);
|
||||
|
||||
#ifdef CONFIG_CACHE_L2X0
|
||||
/* Shared attribute override enable, 64K*8way */
|
||||
|
|
|
@ -567,38 +567,127 @@ static struct platform_device *qhd_devices[] __initdata = {
|
|||
|
||||
/* FSI */
|
||||
#define IRQ_FSI evt2irq(0x1840)
|
||||
static int __fsi_set_rate(struct clk *clk, long rate, int enable)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
static int fsi_set_rate(int is_porta, int rate)
|
||||
if (rate <= 0)
|
||||
return ret;
|
||||
|
||||
if (enable) {
|
||||
ret = clk_set_rate(clk, rate);
|
||||
if (0 == ret)
|
||||
ret = clk_enable(clk);
|
||||
} else {
|
||||
clk_disable(clk);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
|
||||
{
|
||||
return __fsi_set_rate(clk, clk_round_rate(clk, rate), enable);
|
||||
}
|
||||
|
||||
static int fsi_ak4642_set_rate(struct device *dev, int rate, int enable)
|
||||
{
|
||||
struct clk *fsia_ick;
|
||||
struct clk *fsiack;
|
||||
int ret = -EIO;
|
||||
|
||||
fsia_ick = clk_get(dev, "icka");
|
||||
if (IS_ERR(fsia_ick))
|
||||
return PTR_ERR(fsia_ick);
|
||||
|
||||
/*
|
||||
* FSIACK is connected to AK4642,
|
||||
* and use external clock pin from it.
|
||||
* it is parent of fsia_ick now.
|
||||
*/
|
||||
fsiack = clk_get_parent(fsia_ick);
|
||||
if (!fsiack)
|
||||
goto fsia_ick_out;
|
||||
|
||||
/*
|
||||
* we get 1/1 divided clock by setting same rate to fsiack and fsia_ick
|
||||
*
|
||||
** FIXME **
|
||||
* Because the freq_table of external clk (fsiack) are all 0,
|
||||
* the return value of clk_round_rate became 0.
|
||||
* So, it use __fsi_set_rate here.
|
||||
*/
|
||||
ret = __fsi_set_rate(fsiack, rate, enable);
|
||||
if (ret < 0)
|
||||
goto fsiack_out;
|
||||
|
||||
ret = __fsi_set_round_rate(fsia_ick, rate, enable);
|
||||
if ((ret < 0) && enable)
|
||||
__fsi_set_round_rate(fsiack, rate, 0); /* disable FSI ACK */
|
||||
|
||||
fsiack_out:
|
||||
clk_put(fsiack);
|
||||
|
||||
fsia_ick_out:
|
||||
clk_put(fsia_ick);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable)
|
||||
{
|
||||
struct clk *fsib_clk;
|
||||
struct clk *fdiv_clk = &sh7372_fsidivb_clk;
|
||||
long fsib_rate = 0;
|
||||
long fdiv_rate = 0;
|
||||
int ackmd_bpfmd;
|
||||
int ret;
|
||||
|
||||
/* set_rate is not needed if port A */
|
||||
if (is_porta)
|
||||
return 0;
|
||||
|
||||
fsib_clk = clk_get(NULL, "fsib_clk");
|
||||
if (IS_ERR(fsib_clk))
|
||||
return -EINVAL;
|
||||
|
||||
switch (rate) {
|
||||
case 44100:
|
||||
clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 11283000));
|
||||
ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
fsib_rate = rate * 256;
|
||||
ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
break;
|
||||
case 48000:
|
||||
clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 85428000));
|
||||
clk_set_rate(fdiv_clk, clk_round_rate(fdiv_clk, 12204000));
|
||||
ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
fsib_rate = 85428000; /* around 48kHz x 256 x 7 */
|
||||
fdiv_rate = rate * 256;
|
||||
ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
break;
|
||||
default:
|
||||
pr_err("unsupported rate in FSI2 port B\n");
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* FSI B setting */
|
||||
fsib_clk = clk_get(dev, "ickb");
|
||||
if (IS_ERR(fsib_clk))
|
||||
return -EIO;
|
||||
|
||||
ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable);
|
||||
clk_put(fsib_clk);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* FSI DIV setting */
|
||||
ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable);
|
||||
if (ret < 0) {
|
||||
/* disable FSI B */
|
||||
if (enable)
|
||||
__fsi_set_round_rate(fsib_clk, fsib_rate, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ackmd_bpfmd;
|
||||
}
|
||||
|
||||
static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (is_porta)
|
||||
ret = fsi_ak4642_set_rate(dev, rate, enable);
|
||||
else
|
||||
ret = fsi_hdmi_set_rate(dev, rate, enable);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -880,6 +969,11 @@ static int __init hdmi_init_pm_clock(void)
|
|||
goto out;
|
||||
}
|
||||
|
||||
ret = clk_enable(&sh7372_pllc2_clk);
|
||||
if (ret < 0) {
|
||||
pr_err("Cannot enable pllc2 clock\n");
|
||||
goto out;
|
||||
}
|
||||
pr_debug("PLLC2 set frequency %lu\n", rate);
|
||||
|
||||
ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
|
||||
|
@ -896,23 +990,11 @@ out:
|
|||
|
||||
device_initcall(hdmi_init_pm_clock);
|
||||
|
||||
#define FSIACK_DUMMY_RATE 48000
|
||||
static int __init fsi_init_pm_clock(void)
|
||||
{
|
||||
struct clk *fsia_ick;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* FSIACK is connected to AK4642,
|
||||
* and the rate is depend on playing sound rate.
|
||||
* So, set dummy rate (= 48k) here
|
||||
*/
|
||||
ret = clk_set_rate(&sh7372_fsiack_clk, FSIACK_DUMMY_RATE);
|
||||
if (ret < 0) {
|
||||
pr_err("Cannot set FSIACK dummy rate: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
fsia_ick = clk_get(&fsi_device.dev, "icka");
|
||||
if (IS_ERR(fsia_ick)) {
|
||||
ret = PTR_ERR(fsia_ick);
|
||||
|
@ -921,16 +1003,9 @@ static int __init fsi_init_pm_clock(void)
|
|||
}
|
||||
|
||||
ret = clk_set_parent(fsia_ick, &sh7372_fsiack_clk);
|
||||
if (ret < 0) {
|
||||
pr_err("Cannot set FSI-A parent: %d\n", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = clk_set_rate(fsia_ick, FSIACK_DUMMY_RATE);
|
||||
if (ret < 0)
|
||||
pr_err("Cannot set FSI-A rate: %d\n", ret);
|
||||
pr_err("Cannot set FSI-A parent: %d\n", ret);
|
||||
|
||||
out:
|
||||
clk_put(fsia_ick);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -230,21 +230,13 @@ static int pllc2_set_rate(struct clk *clk,
|
|||
if (idx < 0)
|
||||
return idx;
|
||||
|
||||
if (rate == clk->parent->rate) {
|
||||
pllc2_disable(clk);
|
||||
return 0;
|
||||
}
|
||||
if (rate == clk->parent->rate)
|
||||
return -EINVAL;
|
||||
|
||||
value = __raw_readl(PLLC2CR) & ~(0x3f << 24);
|
||||
|
||||
if (value & 0x80000000)
|
||||
pllc2_disable(clk);
|
||||
|
||||
__raw_writel((value & ~0x80000000) | ((idx + 19) << 24), PLLC2CR);
|
||||
|
||||
if (value & 0x80000000)
|
||||
return pllc2_enable(clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -453,10 +445,8 @@ static int fsidiv_enable(struct clk *clk)
|
|||
unsigned long value;
|
||||
|
||||
value = __raw_readl(clk->mapping->base) >> 16;
|
||||
if (value < 2) {
|
||||
fsidiv_disable(clk);
|
||||
return -ENOENT;
|
||||
}
|
||||
if (value < 2)
|
||||
return -EIO;
|
||||
|
||||
__raw_writel((value << 16) | 0x3, clk->mapping->base);
|
||||
|
||||
|
@ -468,17 +458,12 @@ static int fsidiv_set_rate(struct clk *clk,
|
|||
{
|
||||
int idx;
|
||||
|
||||
if (clk->parent->rate == rate) {
|
||||
fsidiv_disable(clk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
idx = (clk->parent->rate / rate) & 0xffff;
|
||||
if (idx < 2)
|
||||
return -ENOENT;
|
||||
return -EINVAL;
|
||||
|
||||
__raw_writel(idx << 16, clk->mapping->base);
|
||||
return fsidiv_enable(clk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct clk_ops fsidiv_clk_ops = {
|
||||
|
@ -609,8 +594,6 @@ static struct clk_lookup lookups[] = {
|
|||
CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]),
|
||||
CLKDEV_CON_ID("fmsi_clk", &div6_clks[DIV6_FMSI]),
|
||||
CLKDEV_CON_ID("fmso_clk", &div6_clks[DIV6_FMSO]),
|
||||
CLKDEV_CON_ID("fsia_clk", &div6_reparent_clks[DIV6_FSIA]),
|
||||
CLKDEV_CON_ID("fsib_clk", &div6_reparent_clks[DIV6_FSIB]),
|
||||
CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]),
|
||||
CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]),
|
||||
CLKDEV_CON_ID("vou_clk", &div6_clks[DIV6_VOU]),
|
||||
|
|
|
@ -40,21 +40,30 @@ static struct clk sub_clk = {
|
|||
.rate = 48000000,
|
||||
};
|
||||
|
||||
/* Temporarily fixed 104 MHz HP clock */
|
||||
static struct clk hp_clk = {
|
||||
.rate = 104000000,
|
||||
};
|
||||
|
||||
static struct clk *main_clks[] = {
|
||||
&r_clk,
|
||||
&sub_clk,
|
||||
&hp_clk,
|
||||
};
|
||||
|
||||
enum { MSTP219,
|
||||
MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
|
||||
MSTP331, MSTP329,
|
||||
MSTP001, MSTP116, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
|
||||
MSTP201, MSTP200, MSTP323, MSTP331, MSTP329, MSTP312, MSTP411,
|
||||
MSTP410, MSTP403,
|
||||
MSTP_NR };
|
||||
|
||||
#define MSTP(_parent, _reg, _bit, _flags) \
|
||||
SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
|
||||
|
||||
static struct clk mstp_clks[MSTP_NR] = {
|
||||
[MSTP001] = MSTP(&hp_clk, SMSTPCR0, 1, 0), /* I2C2 */
|
||||
[MSTP219] = MSTP(&sub_clk, SMSTPCR2, 19, 0), /* SCIFA7 */
|
||||
[MSTP116] = MSTP(&hp_clk, SMSTPCR1, 16, 0), /* I2C0 */
|
||||
[MSTP207] = MSTP(&sub_clk, SMSTPCR2, 7, 0), /* SCIFA5 */
|
||||
[MSTP206] = MSTP(&sub_clk, SMSTPCR2, 6, 0), /* SCIFB */
|
||||
[MSTP204] = MSTP(&sub_clk, SMSTPCR2, 4, 0), /* SCIFA0 */
|
||||
|
@ -64,6 +73,10 @@ static struct clk mstp_clks[MSTP_NR] = {
|
|||
[MSTP200] = MSTP(&sub_clk, SMSTPCR2, 0, 0), /* SCIFA4 */
|
||||
[MSTP331] = MSTP(&sub_clk, SMSTPCR3, 31, 0), /* SCIFA6 */
|
||||
[MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
|
||||
[MSTP323] = MSTP(&hp_clk, SMSTPCR3, 23, 0), /* I2C1 */
|
||||
[MSTP403] = MSTP(&r_clk, SMSTPCR4, 0, 0), /* KEYSC0 */
|
||||
[MSTP411] = MSTP(&hp_clk, SMSTPCR4, 11, 0), /* I2C3 */
|
||||
[MSTP410] = MSTP(&hp_clk, SMSTPCR4, 10, 0), /* I2C4 */
|
||||
};
|
||||
|
||||
#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
|
||||
|
@ -80,6 +93,12 @@ static struct clk_lookup lookups[] = {
|
|||
CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
|
||||
CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
|
||||
CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
|
||||
CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC0 */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
|
||||
};
|
||||
|
||||
void __init sh73a0_clock_init(void)
|
||||
|
|
|
@ -33,5 +33,6 @@ extern struct clk sh7372_extal2_clk;
|
|||
extern void sh73a0_add_early_devices(void);
|
||||
extern void sh73a0_add_standard_devices(void);
|
||||
extern void sh73a0_clock_init(void);
|
||||
extern void sh73a0_pinmux_init(void);
|
||||
|
||||
#endif /* __ARCH_MACH_COMMON_H */
|
||||
|
|
|
@ -1,6 +1,446 @@
|
|||
#ifndef __ASM_SH73A0_H__
|
||||
#define __ASM_SH73A0_H__
|
||||
|
||||
/* This will soon be replaced by pinmux enums */
|
||||
/* Pin Function Controller:
|
||||
* GPIO_FN_xx - GPIO used to select pin function and MSEL switch
|
||||
* GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
|
||||
*/
|
||||
enum {
|
||||
/* Hardware manual Table 25-1 (GPIO) */
|
||||
GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
|
||||
GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
|
||||
|
||||
GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
|
||||
GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
|
||||
|
||||
GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
|
||||
GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
|
||||
|
||||
GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
|
||||
GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
|
||||
|
||||
GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
|
||||
GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
|
||||
|
||||
GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
|
||||
GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
|
||||
|
||||
GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
|
||||
GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
|
||||
|
||||
GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
|
||||
GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
|
||||
|
||||
GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
|
||||
GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
|
||||
|
||||
GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
|
||||
GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
|
||||
|
||||
GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
|
||||
GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
|
||||
|
||||
GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
|
||||
GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118,
|
||||
|
||||
GPIO_PORT128, GPIO_PORT129,
|
||||
|
||||
GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
|
||||
GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
|
||||
|
||||
GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
|
||||
GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
|
||||
|
||||
GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
|
||||
GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
|
||||
|
||||
GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
|
||||
|
||||
GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
|
||||
GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
|
||||
|
||||
GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
|
||||
GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
|
||||
|
||||
GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
|
||||
GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
|
||||
|
||||
GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
|
||||
GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
|
||||
|
||||
GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
|
||||
GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
|
||||
|
||||
GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
|
||||
GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
|
||||
|
||||
GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
|
||||
GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
|
||||
|
||||
GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
|
||||
GPIO_PORT265, GPIO_PORT266, GPIO_PORT267, GPIO_PORT268, GPIO_PORT269,
|
||||
|
||||
GPIO_PORT270, GPIO_PORT271, GPIO_PORT272, GPIO_PORT273, GPIO_PORT274,
|
||||
GPIO_PORT275, GPIO_PORT276, GPIO_PORT277, GPIO_PORT278, GPIO_PORT279,
|
||||
|
||||
GPIO_PORT280, GPIO_PORT281, GPIO_PORT282,
|
||||
|
||||
GPIO_PORT288, GPIO_PORT289,
|
||||
|
||||
GPIO_PORT290, GPIO_PORT291, GPIO_PORT292, GPIO_PORT293, GPIO_PORT294,
|
||||
GPIO_PORT295, GPIO_PORT296, GPIO_PORT297, GPIO_PORT298, GPIO_PORT299,
|
||||
|
||||
GPIO_PORT300, GPIO_PORT301, GPIO_PORT302, GPIO_PORT303, GPIO_PORT304,
|
||||
GPIO_PORT305, GPIO_PORT306, GPIO_PORT307, GPIO_PORT308, GPIO_PORT309,
|
||||
|
||||
/* Table 25-1 (Function 0-7) */
|
||||
GPIO_FN_VBUS_0,
|
||||
GPIO_FN_GPI0,
|
||||
GPIO_FN_GPI1,
|
||||
GPIO_FN_GPI2,
|
||||
GPIO_FN_GPI3,
|
||||
GPIO_FN_GPI4,
|
||||
GPIO_FN_GPI5,
|
||||
GPIO_FN_GPI6,
|
||||
GPIO_FN_GPI7,
|
||||
GPIO_FN_SCIFA7_RXD,
|
||||
GPIO_FN_SCIFA7_CTS_,
|
||||
GPIO_FN_GPO7, GPIO_FN_MFG0_OUT2,
|
||||
GPIO_FN_GPO6, GPIO_FN_MFG1_OUT2,
|
||||
GPIO_FN_GPO5, GPIO_FN_SCIFA0_SCK, GPIO_FN_FSICOSLDT3, \
|
||||
GPIO_FN_PORT16_VIO_CKOR,
|
||||
GPIO_FN_SCIFA0_TXD,
|
||||
GPIO_FN_SCIFA7_TXD,
|
||||
GPIO_FN_SCIFA7_RTS_, GPIO_FN_PORT19_VIO_CKO2,
|
||||
GPIO_FN_GPO0,
|
||||
GPIO_FN_GPO1,
|
||||
GPIO_FN_GPO2, GPIO_FN_STATUS0,
|
||||
GPIO_FN_GPO3, GPIO_FN_STATUS1,
|
||||
GPIO_FN_GPO4, GPIO_FN_STATUS2,
|
||||
GPIO_FN_VINT,
|
||||
GPIO_FN_TCKON,
|
||||
GPIO_FN_XDVFS1, GPIO_FN_PORT27_I2C_SCL2, GPIO_FN_PORT27_I2C_SCL3, \
|
||||
GPIO_FN_MFG0_OUT1, GPIO_FN_PORT27_IROUT,
|
||||
GPIO_FN_XDVFS2, GPIO_FN_PORT28_I2C_SDA2, GPIO_FN_PORT28_I2C_SDA3, \
|
||||
GPIO_FN_PORT28_TPU1TO1,
|
||||
GPIO_FN_SIM_RST, GPIO_FN_PORT29_TPU1TO1,
|
||||
GPIO_FN_SIM_CLK, GPIO_FN_PORT30_VIO_CKOR,
|
||||
GPIO_FN_SIM_D, GPIO_FN_PORT31_IROUT,
|
||||
GPIO_FN_SCIFA4_TXD,
|
||||
GPIO_FN_SCIFA4_RXD, GPIO_FN_XWUP,
|
||||
GPIO_FN_SCIFA4_RTS_,
|
||||
GPIO_FN_SCIFA4_CTS_,
|
||||
GPIO_FN_FSIBOBT, GPIO_FN_FSIBIBT,
|
||||
GPIO_FN_FSIBOLR, GPIO_FN_FSIBILR,
|
||||
GPIO_FN_FSIBOSLD,
|
||||
GPIO_FN_FSIBISLD,
|
||||
GPIO_FN_VACK,
|
||||
GPIO_FN_XTAL1L,
|
||||
GPIO_FN_SCIFA0_RTS_, GPIO_FN_FSICOSLDT2,
|
||||
GPIO_FN_SCIFA0_RXD,
|
||||
GPIO_FN_SCIFA0_CTS_, GPIO_FN_FSICOSLDT1,
|
||||
GPIO_FN_FSICOBT, GPIO_FN_FSICIBT, GPIO_FN_FSIDOBT, GPIO_FN_FSIDIBT,
|
||||
GPIO_FN_FSICOLR, GPIO_FN_FSICILR, GPIO_FN_FSIDOLR, GPIO_FN_FSIDILR,
|
||||
GPIO_FN_FSICOSLD, GPIO_FN_PORT47_FSICSPDIF,
|
||||
GPIO_FN_FSICISLD, GPIO_FN_FSIDISLD,
|
||||
GPIO_FN_FSIACK, GPIO_FN_PORT49_IRDA_OUT, GPIO_FN_PORT49_IROUT, \
|
||||
GPIO_FN_FSIAOMC,
|
||||
GPIO_FN_FSIAOLR, GPIO_FN_BBIF2_TSYNC2, GPIO_FN_TPU2TO2, GPIO_FN_FSIAILR,
|
||||
|
||||
GPIO_FN_FSIAOBT, GPIO_FN_BBIF2_TSCK2, GPIO_FN_TPU2TO3, GPIO_FN_FSIAIBT,
|
||||
GPIO_FN_FSIAOSLD, GPIO_FN_BBIF2_TXD2,
|
||||
GPIO_FN_FSIASPDIF, GPIO_FN_PORT53_IRDA_IN, GPIO_FN_TPU3TO3, \
|
||||
GPIO_FN_FSIBSPDIF, GPIO_FN_PORT53_FSICSPDIF,
|
||||
GPIO_FN_FSIBCK, GPIO_FN_PORT54_IRDA_FIRSEL, GPIO_FN_TPU3TO2, \
|
||||
GPIO_FN_FSIBOMC, GPIO_FN_FSICCK, GPIO_FN_FSICOMC,
|
||||
GPIO_FN_FSIAISLD, GPIO_FN_TPU0TO0,
|
||||
GPIO_FN_A0, GPIO_FN_BS_,
|
||||
GPIO_FN_A12, GPIO_FN_PORT58_KEYOUT7, GPIO_FN_TPU4TO2,
|
||||
GPIO_FN_A13, GPIO_FN_PORT59_KEYOUT6, GPIO_FN_TPU0TO1,
|
||||
GPIO_FN_A14, GPIO_FN_KEYOUT5,
|
||||
GPIO_FN_A15, GPIO_FN_KEYOUT4,
|
||||
GPIO_FN_A16, GPIO_FN_KEYOUT3, GPIO_FN_MSIOF0_SS1,
|
||||
GPIO_FN_A17, GPIO_FN_KEYOUT2, GPIO_FN_MSIOF0_TSYNC,
|
||||
GPIO_FN_A18, GPIO_FN_KEYOUT1, GPIO_FN_MSIOF0_TSCK,
|
||||
GPIO_FN_A19, GPIO_FN_KEYOUT0, GPIO_FN_MSIOF0_TXD,
|
||||
GPIO_FN_A20, GPIO_FN_KEYIN0, GPIO_FN_MSIOF0_RSCK,
|
||||
GPIO_FN_A21, GPIO_FN_KEYIN1, GPIO_FN_MSIOF0_RSYNC,
|
||||
GPIO_FN_A22, GPIO_FN_KEYIN2, GPIO_FN_MSIOF0_MCK0,
|
||||
GPIO_FN_A23, GPIO_FN_KEYIN3, GPIO_FN_MSIOF0_MCK1,
|
||||
GPIO_FN_A24, GPIO_FN_KEYIN4, GPIO_FN_MSIOF0_RXD,
|
||||
GPIO_FN_A25, GPIO_FN_KEYIN5, GPIO_FN_MSIOF0_SS2,
|
||||
GPIO_FN_A26, GPIO_FN_KEYIN6,
|
||||
GPIO_FN_KEYIN7,
|
||||
GPIO_FN_D0_NAF0,
|
||||
GPIO_FN_D1_NAF1,
|
||||
GPIO_FN_D2_NAF2,
|
||||
GPIO_FN_D3_NAF3,
|
||||
GPIO_FN_D4_NAF4,
|
||||
GPIO_FN_D5_NAF5,
|
||||
GPIO_FN_D6_NAF6,
|
||||
GPIO_FN_D7_NAF7,
|
||||
GPIO_FN_D8_NAF8,
|
||||
GPIO_FN_D9_NAF9,
|
||||
GPIO_FN_D10_NAF10,
|
||||
GPIO_FN_D11_NAF11,
|
||||
GPIO_FN_D12_NAF12,
|
||||
GPIO_FN_D13_NAF13,
|
||||
GPIO_FN_D14_NAF14,
|
||||
GPIO_FN_D15_NAF15,
|
||||
GPIO_FN_CS4_,
|
||||
GPIO_FN_CS5A_, GPIO_FN_PORT91_RDWR,
|
||||
GPIO_FN_CS5B_, GPIO_FN_FCE1_,
|
||||
GPIO_FN_CS6B_, GPIO_FN_DACK0,
|
||||
GPIO_FN_FCE0_, GPIO_FN_CS6A_,
|
||||
GPIO_FN_WAIT_, GPIO_FN_DREQ0,
|
||||
GPIO_FN_RD__FSC,
|
||||
GPIO_FN_WE0__FWE, GPIO_FN_RDWR_FWE,
|
||||
GPIO_FN_WE1_,
|
||||
GPIO_FN_FRB,
|
||||
GPIO_FN_CKO,
|
||||
GPIO_FN_NBRSTOUT_,
|
||||
GPIO_FN_NBRST_,
|
||||
GPIO_FN_BBIF2_TXD,
|
||||
GPIO_FN_BBIF2_RXD,
|
||||
GPIO_FN_BBIF2_SYNC,
|
||||
GPIO_FN_BBIF2_SCK,
|
||||
GPIO_FN_SCIFA3_CTS_, GPIO_FN_MFG3_IN2,
|
||||
GPIO_FN_SCIFA3_RXD, GPIO_FN_MFG3_IN1,
|
||||
GPIO_FN_BBIF1_SS2, GPIO_FN_SCIFA3_RTS_, GPIO_FN_MFG3_OUT1,
|
||||
GPIO_FN_SCIFA3_TXD,
|
||||
GPIO_FN_HSI_RX_DATA, GPIO_FN_BBIF1_RXD,
|
||||
GPIO_FN_HSI_TX_WAKE, GPIO_FN_BBIF1_TSCK,
|
||||
GPIO_FN_HSI_TX_DATA, GPIO_FN_BBIF1_TSYNC,
|
||||
GPIO_FN_HSI_TX_READY, GPIO_FN_BBIF1_TXD,
|
||||
GPIO_FN_HSI_RX_READY, GPIO_FN_BBIF1_RSCK, GPIO_FN_PORT115_I2C_SCL2, \
|
||||
GPIO_FN_PORT115_I2C_SCL3,
|
||||
GPIO_FN_HSI_RX_WAKE, GPIO_FN_BBIF1_RSYNC, GPIO_FN_PORT116_I2C_SDA2, \
|
||||
GPIO_FN_PORT116_I2C_SDA3,
|
||||
GPIO_FN_HSI_RX_FLAG, GPIO_FN_BBIF1_SS1, GPIO_FN_BBIF1_FLOW,
|
||||
GPIO_FN_HSI_TX_FLAG,
|
||||
GPIO_FN_VIO_VD, GPIO_FN_PORT128_LCD2VSYN, GPIO_FN_VIO2_VD, \
|
||||
GPIO_FN_LCD2D0,
|
||||
|
||||
GPIO_FN_VIO_HD, GPIO_FN_PORT129_LCD2HSYN, GPIO_FN_PORT129_LCD2CS_, \
|
||||
GPIO_FN_VIO2_HD, GPIO_FN_LCD2D1,
|
||||
GPIO_FN_VIO_D0, GPIO_FN_PORT130_MSIOF2_RXD, GPIO_FN_LCD2D10,
|
||||
GPIO_FN_VIO_D1, GPIO_FN_PORT131_KEYOUT6, GPIO_FN_PORT131_MSIOF2_SS1, \
|
||||
GPIO_FN_PORT131_KEYOUT11, GPIO_FN_LCD2D11,
|
||||
GPIO_FN_VIO_D2, GPIO_FN_PORT132_KEYOUT7, GPIO_FN_PORT132_MSIOF2_SS2, \
|
||||
GPIO_FN_PORT132_KEYOUT10, GPIO_FN_LCD2D12,
|
||||
GPIO_FN_VIO_D3, GPIO_FN_MSIOF2_TSYNC, GPIO_FN_LCD2D13,
|
||||
GPIO_FN_VIO_D4, GPIO_FN_MSIOF2_TXD, GPIO_FN_LCD2D14,
|
||||
GPIO_FN_VIO_D5, GPIO_FN_MSIOF2_TSCK, GPIO_FN_LCD2D15,
|
||||
GPIO_FN_VIO_D6, GPIO_FN_PORT136_KEYOUT8, GPIO_FN_LCD2D16,
|
||||
GPIO_FN_VIO_D7, GPIO_FN_PORT137_KEYOUT9, GPIO_FN_LCD2D17,
|
||||
GPIO_FN_VIO_D8, GPIO_FN_PORT138_KEYOUT8, GPIO_FN_VIO2_D0, \
|
||||
GPIO_FN_LCD2D6,
|
||||
GPIO_FN_VIO_D9, GPIO_FN_PORT139_KEYOUT9, GPIO_FN_VIO2_D1, \
|
||||
GPIO_FN_LCD2D7,
|
||||
GPIO_FN_VIO_D10, GPIO_FN_TPU0TO2, GPIO_FN_VIO2_D2, GPIO_FN_LCD2D8,
|
||||
GPIO_FN_VIO_D11, GPIO_FN_TPU0TO3, GPIO_FN_VIO2_D3, GPIO_FN_LCD2D9,
|
||||
GPIO_FN_VIO_D12, GPIO_FN_PORT142_KEYOUT10, GPIO_FN_VIO2_D4, \
|
||||
GPIO_FN_LCD2D2,
|
||||
GPIO_FN_VIO_D13, GPIO_FN_PORT143_KEYOUT11, GPIO_FN_PORT143_KEYOUT6, \
|
||||
GPIO_FN_VIO2_D5, GPIO_FN_LCD2D3,
|
||||
GPIO_FN_VIO_D14, GPIO_FN_PORT144_KEYOUT7, GPIO_FN_VIO2_D6, \
|
||||
GPIO_FN_LCD2D4,
|
||||
GPIO_FN_VIO_D15, GPIO_FN_TPU1TO3, GPIO_FN_PORT145_LCD2DISP, \
|
||||
GPIO_FN_PORT145_LCD2RS, GPIO_FN_VIO2_D7, GPIO_FN_LCD2D5,
|
||||
GPIO_FN_VIO_CLK, GPIO_FN_LCD2DCK, GPIO_FN_PORT146_LCD2WR_, \
|
||||
GPIO_FN_VIO2_CLK, GPIO_FN_LCD2D18,
|
||||
GPIO_FN_VIO_FIELD, GPIO_FN_LCD2RD_, GPIO_FN_VIO2_FIELD, GPIO_FN_LCD2D19,
|
||||
GPIO_FN_VIO_CKO,
|
||||
GPIO_FN_A27, GPIO_FN_PORT149_RDWR, GPIO_FN_MFG0_IN1, \
|
||||
GPIO_FN_PORT149_KEYOUT9,
|
||||
GPIO_FN_MFG0_IN2,
|
||||
GPIO_FN_TS_SPSYNC3, GPIO_FN_MSIOF2_RSCK,
|
||||
GPIO_FN_TS_SDAT3, GPIO_FN_MSIOF2_RSYNC,
|
||||
GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT153_MSIOF2_SS1,
|
||||
GPIO_FN_SCIFA2_TXD1, GPIO_FN_MSIOF2_MCK0,
|
||||
GPIO_FN_SCIFA2_RXD1, GPIO_FN_MSIOF2_MCK1,
|
||||
GPIO_FN_SCIFA2_RTS1_, GPIO_FN_PORT156_MSIOF2_SS2,
|
||||
GPIO_FN_SCIFA2_CTS1_, GPIO_FN_PORT157_MSIOF2_RXD,
|
||||
GPIO_FN_DINT_, GPIO_FN_SCIFA2_SCK1, GPIO_FN_TS_SCK3,
|
||||
GPIO_FN_PORT159_SCIFB_SCK, GPIO_FN_PORT159_SCIFA5_SCK, GPIO_FN_NMI,
|
||||
GPIO_FN_PORT160_SCIFB_TXD, GPIO_FN_PORT160_SCIFA5_TXD,
|
||||
GPIO_FN_PORT161_SCIFB_CTS_, GPIO_FN_PORT161_SCIFA5_CTS_,
|
||||
GPIO_FN_PORT162_SCIFB_RXD, GPIO_FN_PORT162_SCIFA5_RXD,
|
||||
GPIO_FN_PORT163_SCIFB_RTS_, GPIO_FN_PORT163_SCIFA5_RTS_, \
|
||||
GPIO_FN_TPU3TO0,
|
||||
GPIO_FN_LCDD0,
|
||||
GPIO_FN_LCDD1, GPIO_FN_PORT193_SCIFA5_CTS_, GPIO_FN_BBIF2_TSYNC1,
|
||||
GPIO_FN_LCDD2, GPIO_FN_PORT194_SCIFA5_RTS_, GPIO_FN_BBIF2_TSCK1,
|
||||
GPIO_FN_LCDD3, GPIO_FN_PORT195_SCIFA5_RXD, GPIO_FN_BBIF2_TXD1,
|
||||
GPIO_FN_LCDD4, GPIO_FN_PORT196_SCIFA5_TXD,
|
||||
GPIO_FN_LCDD5, GPIO_FN_PORT197_SCIFA5_SCK, GPIO_FN_MFG2_OUT2, \
|
||||
GPIO_FN_TPU2TO1,
|
||||
GPIO_FN_LCDD6,
|
||||
GPIO_FN_LCDD7, GPIO_FN_TPU4TO1, GPIO_FN_MFG4_OUT2,
|
||||
GPIO_FN_LCDD8, GPIO_FN_D16,
|
||||
GPIO_FN_LCDD9, GPIO_FN_D17,
|
||||
GPIO_FN_LCDD10, GPIO_FN_D18,
|
||||
GPIO_FN_LCDD11, GPIO_FN_D19,
|
||||
GPIO_FN_LCDD12, GPIO_FN_D20,
|
||||
GPIO_FN_LCDD13, GPIO_FN_D21,
|
||||
GPIO_FN_LCDD14, GPIO_FN_D22,
|
||||
GPIO_FN_LCDD15, GPIO_FN_PORT207_MSIOF0L_SS1, GPIO_FN_D23,
|
||||
GPIO_FN_LCDD16, GPIO_FN_PORT208_MSIOF0L_SS2, GPIO_FN_D24,
|
||||
GPIO_FN_LCDD17, GPIO_FN_D25,
|
||||
GPIO_FN_LCDD18, GPIO_FN_DREQ2, GPIO_FN_PORT210_MSIOF0L_SS1, GPIO_FN_D26,
|
||||
GPIO_FN_LCDD19, GPIO_FN_PORT211_MSIOF0L_SS2, GPIO_FN_D27,
|
||||
GPIO_FN_LCDD20, GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0, GPIO_FN_D28,
|
||||
GPIO_FN_LCDD21, GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1, GPIO_FN_D29,
|
||||
GPIO_FN_LCDD22, GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_RSCK, GPIO_FN_D30,
|
||||
GPIO_FN_LCDD23, GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_RSYNC, GPIO_FN_D31,
|
||||
GPIO_FN_LCDDCK, GPIO_FN_LCDWR_,
|
||||
GPIO_FN_LCDRD_, GPIO_FN_DACK2, GPIO_FN_PORT217_LCD2RS, \
|
||||
GPIO_FN_MSIOF0L_TSYNC, GPIO_FN_VIO2_FIELD3, GPIO_FN_PORT217_LCD2DISP,
|
||||
GPIO_FN_LCDHSYN, GPIO_FN_LCDCS_, GPIO_FN_LCDCS2_, GPIO_FN_DACK3, \
|
||||
GPIO_FN_PORT218_VIO_CKOR,
|
||||
GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_PORT219_LCD2WR_, \
|
||||
GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_TSCK, GPIO_FN_VIO2_CLK3, \
|
||||
GPIO_FN_LCD2DCK_2,
|
||||
GPIO_FN_LCDVSYN, GPIO_FN_LCDVSYN2,
|
||||
GPIO_FN_LCDLCLK, GPIO_FN_DREQ1, GPIO_FN_PORT221_LCD2CS_, \
|
||||
GPIO_FN_PWEN, GPIO_FN_MSIOF0L_RXD, GPIO_FN_VIO2_HD3, \
|
||||
GPIO_FN_PORT221_LCD2HSYN,
|
||||
GPIO_FN_LCDDON, GPIO_FN_LCDDON2, GPIO_FN_DACK1, GPIO_FN_OVCN, \
|
||||
GPIO_FN_MSIOF0L_TXD, GPIO_FN_VIO2_VD3, GPIO_FN_PORT222_LCD2VSYN,
|
||||
|
||||
GPIO_FN_SCIFA1_TXD, GPIO_FN_OVCN2,
|
||||
GPIO_FN_EXTLP, GPIO_FN_SCIFA1_SCK, GPIO_FN_PORT226_VIO_CKO2,
|
||||
GPIO_FN_SCIFA1_RTS_, GPIO_FN_IDIN,
|
||||
GPIO_FN_SCIFA1_RXD,
|
||||
GPIO_FN_SCIFA1_CTS_, GPIO_FN_MFG1_IN1,
|
||||
GPIO_FN_MSIOF1_TXD, GPIO_FN_SCIFA2_TXD2,
|
||||
GPIO_FN_MSIOF1_TSYNC, GPIO_FN_SCIFA2_CTS2_,
|
||||
GPIO_FN_MSIOF1_TSCK, GPIO_FN_SCIFA2_SCK2,
|
||||
GPIO_FN_MSIOF1_RXD, GPIO_FN_SCIFA2_RXD2,
|
||||
GPIO_FN_MSIOF1_RSCK, GPIO_FN_SCIFA2_RTS2_, GPIO_FN_VIO2_CLK2, \
|
||||
GPIO_FN_LCD2D20,
|
||||
GPIO_FN_MSIOF1_RSYNC, GPIO_FN_MFG1_IN2, GPIO_FN_VIO2_VD2, \
|
||||
GPIO_FN_LCD2D21,
|
||||
GPIO_FN_MSIOF1_MCK0, GPIO_FN_PORT236_I2C_SDA2,
|
||||
GPIO_FN_MSIOF1_MCK1, GPIO_FN_PORT237_I2C_SCL2,
|
||||
GPIO_FN_MSIOF1_SS1, GPIO_FN_VIO2_FIELD2, GPIO_FN_LCD2D22,
|
||||
GPIO_FN_MSIOF1_SS2, GPIO_FN_VIO2_HD2, GPIO_FN_LCD2D23,
|
||||
GPIO_FN_SCIFA6_TXD,
|
||||
GPIO_FN_PORT241_IRDA_OUT, GPIO_FN_PORT241_IROUT, GPIO_FN_MFG4_OUT1, \
|
||||
GPIO_FN_TPU4TO0,
|
||||
GPIO_FN_PORT242_IRDA_IN, GPIO_FN_MFG4_IN2,
|
||||
GPIO_FN_PORT243_IRDA_FIRSEL, GPIO_FN_PORT243_VIO_CKO2,
|
||||
GPIO_FN_PORT244_SCIFA5_CTS_, GPIO_FN_MFG2_IN1, \
|
||||
GPIO_FN_PORT244_SCIFB_CTS_, GPIO_FN_MSIOF2R_RXD,
|
||||
GPIO_FN_PORT245_SCIFA5_RTS_, GPIO_FN_MFG2_IN2, \
|
||||
GPIO_FN_PORT245_SCIFB_RTS_, GPIO_FN_MSIOF2R_TXD,
|
||||
GPIO_FN_PORT246_SCIFA5_RXD, GPIO_FN_MFG1_OUT1, \
|
||||
GPIO_FN_PORT246_SCIFB_RXD, GPIO_FN_TPU1TO0,
|
||||
GPIO_FN_PORT247_SCIFA5_TXD, GPIO_FN_MFG3_OUT2, \
|
||||
GPIO_FN_PORT247_SCIFB_TXD, GPIO_FN_TPU3TO1,
|
||||
GPIO_FN_PORT248_SCIFA5_SCK, GPIO_FN_MFG2_OUT1, \
|
||||
GPIO_FN_PORT248_SCIFB_SCK, GPIO_FN_TPU2TO0, \
|
||||
GPIO_FN_PORT248_I2C_SCL3, GPIO_FN_MSIOF2R_TSCK,
|
||||
GPIO_FN_PORT249_IROUT, GPIO_FN_MFG4_IN1, \
|
||||
GPIO_FN_PORT249_I2C_SDA3, GPIO_FN_MSIOF2R_TSYNC,
|
||||
GPIO_FN_SDHICLK0,
|
||||
GPIO_FN_SDHICD0,
|
||||
GPIO_FN_SDHID0_0,
|
||||
GPIO_FN_SDHID0_1,
|
||||
GPIO_FN_SDHID0_2,
|
||||
GPIO_FN_SDHID0_3,
|
||||
GPIO_FN_SDHICMD0,
|
||||
GPIO_FN_SDHIWP0,
|
||||
GPIO_FN_SDHICLK1,
|
||||
GPIO_FN_SDHID1_0, GPIO_FN_TS_SPSYNC2,
|
||||
GPIO_FN_SDHID1_1, GPIO_FN_TS_SDAT2,
|
||||
GPIO_FN_SDHID1_2, GPIO_FN_TS_SDEN2,
|
||||
GPIO_FN_SDHID1_3, GPIO_FN_TS_SCK2,
|
||||
GPIO_FN_SDHICMD1,
|
||||
GPIO_FN_SDHICLK2,
|
||||
GPIO_FN_SDHID2_0, GPIO_FN_TS_SPSYNC4,
|
||||
GPIO_FN_SDHID2_1, GPIO_FN_TS_SDAT4,
|
||||
GPIO_FN_SDHID2_2, GPIO_FN_TS_SDEN4,
|
||||
GPIO_FN_SDHID2_3, GPIO_FN_TS_SCK4,
|
||||
GPIO_FN_SDHICMD2,
|
||||
GPIO_FN_MMCCLK0,
|
||||
GPIO_FN_MMCD0_0,
|
||||
GPIO_FN_MMCD0_1,
|
||||
GPIO_FN_MMCD0_2,
|
||||
GPIO_FN_MMCD0_3,
|
||||
GPIO_FN_MMCD0_4, GPIO_FN_TS_SPSYNC5,
|
||||
GPIO_FN_MMCD0_5, GPIO_FN_TS_SDAT5,
|
||||
GPIO_FN_MMCD0_6, GPIO_FN_TS_SDEN5,
|
||||
GPIO_FN_MMCD0_7, GPIO_FN_TS_SCK5,
|
||||
GPIO_FN_MMCCMD0,
|
||||
GPIO_FN_RESETOUTS_, GPIO_FN_EXTAL2OUT,
|
||||
GPIO_FN_MCP_WAIT__MCP_FRB,
|
||||
GPIO_FN_MCP_CKO, GPIO_FN_MMCCLK1,
|
||||
GPIO_FN_MCP_D15_MCP_NAF15,
|
||||
GPIO_FN_MCP_D14_MCP_NAF14,
|
||||
GPIO_FN_MCP_D13_MCP_NAF13,
|
||||
GPIO_FN_MCP_D12_MCP_NAF12,
|
||||
GPIO_FN_MCP_D11_MCP_NAF11,
|
||||
GPIO_FN_MCP_D10_MCP_NAF10,
|
||||
GPIO_FN_MCP_D9_MCP_NAF9,
|
||||
GPIO_FN_MCP_D8_MCP_NAF8, GPIO_FN_MMCCMD1,
|
||||
GPIO_FN_MCP_D7_MCP_NAF7, GPIO_FN_MMCD1_7,
|
||||
|
||||
GPIO_FN_MCP_D6_MCP_NAF6, GPIO_FN_MMCD1_6,
|
||||
GPIO_FN_MCP_D5_MCP_NAF5, GPIO_FN_MMCD1_5,
|
||||
GPIO_FN_MCP_D4_MCP_NAF4, GPIO_FN_MMCD1_4,
|
||||
GPIO_FN_MCP_D3_MCP_NAF3, GPIO_FN_MMCD1_3,
|
||||
GPIO_FN_MCP_D2_MCP_NAF2, GPIO_FN_MMCD1_2,
|
||||
GPIO_FN_MCP_D1_MCP_NAF1, GPIO_FN_MMCD1_1,
|
||||
GPIO_FN_MCP_D0_MCP_NAF0, GPIO_FN_MMCD1_0,
|
||||
GPIO_FN_MCP_NBRSTOUT_,
|
||||
GPIO_FN_MCP_WE0__MCP_FWE, GPIO_FN_MCP_RDWR_MCP_FWE,
|
||||
|
||||
/* MSEL2 special case */
|
||||
GPIO_FN_TSIF2_TS_XX1,
|
||||
GPIO_FN_TSIF2_TS_XX2,
|
||||
GPIO_FN_TSIF2_TS_XX3,
|
||||
GPIO_FN_TSIF2_TS_XX4,
|
||||
GPIO_FN_TSIF2_TS_XX5,
|
||||
GPIO_FN_TSIF1_TS_XX1,
|
||||
GPIO_FN_TSIF1_TS_XX2,
|
||||
GPIO_FN_TSIF1_TS_XX3,
|
||||
GPIO_FN_TSIF1_TS_XX4,
|
||||
GPIO_FN_TSIF1_TS_XX5,
|
||||
GPIO_FN_TSIF0_TS_XX1,
|
||||
GPIO_FN_TSIF0_TS_XX2,
|
||||
GPIO_FN_TSIF0_TS_XX3,
|
||||
GPIO_FN_TSIF0_TS_XX4,
|
||||
GPIO_FN_TSIF0_TS_XX5,
|
||||
GPIO_FN_MST1_TS_XX1,
|
||||
GPIO_FN_MST1_TS_XX2,
|
||||
GPIO_FN_MST1_TS_XX3,
|
||||
GPIO_FN_MST1_TS_XX4,
|
||||
GPIO_FN_MST1_TS_XX5,
|
||||
GPIO_FN_MST0_TS_XX1,
|
||||
GPIO_FN_MST0_TS_XX2,
|
||||
GPIO_FN_MST0_TS_XX3,
|
||||
GPIO_FN_MST0_TS_XX4,
|
||||
GPIO_FN_MST0_TS_XX5,
|
||||
|
||||
/* MSEL3 special cases */
|
||||
GPIO_FN_SDHI0_VCCQ_MC0_ON,
|
||||
GPIO_FN_SDHI0_VCCQ_MC0_OFF,
|
||||
GPIO_FN_DEBUG_MON_VIO,
|
||||
GPIO_FN_DEBUG_MON_LCDD,
|
||||
GPIO_FN_LCDC_LCDC0,
|
||||
GPIO_FN_LCDC_LCDC1,
|
||||
|
||||
/* MSEL4 special cases */
|
||||
GPIO_FN_IRQ9_MEM_INT,
|
||||
GPIO_FN_IRQ9_MCP_INT,
|
||||
GPIO_FN_A11,
|
||||
GPIO_FN_KEYOUT8,
|
||||
GPIO_FN_TPU4TO3,
|
||||
GPIO_FN_RESETA_N_PU_ON,
|
||||
GPIO_FN_RESETA_N_PU_OFF,
|
||||
GPIO_FN_EDBGREQ_PD,
|
||||
GPIO_FN_EDBGREQ_PU,
|
||||
};
|
||||
|
||||
#endif /* __ASM_SH73A0_H__ */
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -208,6 +208,111 @@ static struct platform_device cmt10_device = {
|
|||
.num_resources = ARRAY_SIZE(cmt10_resources),
|
||||
};
|
||||
|
||||
static struct resource i2c0_resources[] = {
|
||||
[0] = {
|
||||
.name = "IIC0",
|
||||
.start = 0xe6820000,
|
||||
.end = 0xe6820425 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(167),
|
||||
.end = gic_spi(170),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource i2c1_resources[] = {
|
||||
[0] = {
|
||||
.name = "IIC1",
|
||||
.start = 0xe6822000,
|
||||
.end = 0xe6822425 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(51),
|
||||
.end = gic_spi(54),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource i2c2_resources[] = {
|
||||
[0] = {
|
||||
.name = "IIC2",
|
||||
.start = 0xe6824000,
|
||||
.end = 0xe6824425 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(171),
|
||||
.end = gic_spi(174),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource i2c3_resources[] = {
|
||||
[0] = {
|
||||
.name = "IIC3",
|
||||
.start = 0xe6826000,
|
||||
.end = 0xe6826425 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(183),
|
||||
.end = gic_spi(186),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource i2c4_resources[] = {
|
||||
[0] = {
|
||||
.name = "IIC4",
|
||||
.start = 0xe6828000,
|
||||
.end = 0xe6828425 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(187),
|
||||
.end = gic_spi(190),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c0_device = {
|
||||
.name = "i2c-sh_mobile",
|
||||
.id = 0,
|
||||
.resource = i2c0_resources,
|
||||
.num_resources = ARRAY_SIZE(i2c0_resources),
|
||||
};
|
||||
|
||||
static struct platform_device i2c1_device = {
|
||||
.name = "i2c-sh_mobile",
|
||||
.id = 1,
|
||||
.resource = i2c1_resources,
|
||||
.num_resources = ARRAY_SIZE(i2c1_resources),
|
||||
};
|
||||
|
||||
static struct platform_device i2c2_device = {
|
||||
.name = "i2c-sh_mobile",
|
||||
.id = 2,
|
||||
.resource = i2c2_resources,
|
||||
.num_resources = ARRAY_SIZE(i2c2_resources),
|
||||
};
|
||||
|
||||
static struct platform_device i2c3_device = {
|
||||
.name = "i2c-sh_mobile",
|
||||
.id = 3,
|
||||
.resource = i2c3_resources,
|
||||
.num_resources = ARRAY_SIZE(i2c3_resources),
|
||||
};
|
||||
|
||||
static struct platform_device i2c4_device = {
|
||||
.name = "i2c-sh_mobile",
|
||||
.id = 4,
|
||||
.resource = i2c4_resources,
|
||||
.num_resources = ARRAY_SIZE(i2c4_resources),
|
||||
};
|
||||
|
||||
static struct platform_device *sh73a0_early_devices[] __initdata = {
|
||||
&scif0_device,
|
||||
&scif1_device,
|
||||
|
@ -221,10 +326,20 @@ static struct platform_device *sh73a0_early_devices[] __initdata = {
|
|||
&cmt10_device,
|
||||
};
|
||||
|
||||
static struct platform_device *sh73a0_late_devices[] __initdata = {
|
||||
&i2c0_device,
|
||||
&i2c1_device,
|
||||
&i2c2_device,
|
||||
&i2c3_device,
|
||||
&i2c4_device,
|
||||
};
|
||||
|
||||
void __init sh73a0_add_standard_devices(void)
|
||||
{
|
||||
platform_add_devices(sh73a0_early_devices,
|
||||
ARRAY_SIZE(sh73a0_early_devices));
|
||||
platform_add_devices(sh73a0_late_devices,
|
||||
ARRAY_SIZE(sh73a0_late_devices));
|
||||
}
|
||||
|
||||
void __init sh73a0_add_early_devices(void)
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/user.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
|
|
@ -202,7 +202,7 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode)
|
|||
}
|
||||
|
||||
static int
|
||||
simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
||||
simscsi_queuecommand_lck (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
||||
{
|
||||
unsigned int target_id = sc->device->id;
|
||||
char fname[MAX_ROOT_LEN+16];
|
||||
|
@ -326,6 +326,8 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
|||
return 0;
|
||||
}
|
||||
|
||||
static DEF_SCSI_QCMD(simscsi_queuecommand)
|
||||
|
||||
static int
|
||||
simscsi_host_reset (struct scsi_cmnd *sc)
|
||||
{
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <linux/slab.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <linux/namei.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/utsname.h>
|
||||
#include <linux/vfs.h>
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <linux/times.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/sem.h>
|
||||
#include <linux/msg.h>
|
||||
#include <linux/shm.h>
|
||||
|
|
|
@ -4,6 +4,10 @@ config PPC32
|
|||
bool
|
||||
default y if !PPC64
|
||||
|
||||
config 32BIT
|
||||
bool
|
||||
default y if PPC32
|
||||
|
||||
config 64BIT
|
||||
bool
|
||||
default y if PPC64
|
||||
|
|
|
@ -33,9 +33,10 @@ __div64_32:
|
|||
cntlzw r0,r5 # we are shifting the dividend right
|
||||
li r10,-1 # to make it < 2^32, and shifting
|
||||
srw r10,r10,r0 # the divisor right the same amount,
|
||||
add r9,r4,r10 # rounding up (so the estimate cannot
|
||||
addc r9,r4,r10 # rounding up (so the estimate cannot
|
||||
andc r11,r6,r10 # ever be too large, only too small)
|
||||
andc r9,r9,r10
|
||||
addze r9,r9
|
||||
or r11,r5,r11
|
||||
rotlw r9,r9,r0
|
||||
rotlw r11,r11,r0
|
||||
|
|
|
@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
|
|||
/* FP registers 32 -> 63 */
|
||||
#if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
|
||||
if (current)
|
||||
memcpy(mem, current->thread.evr[regno-32],
|
||||
memcpy(mem, ¤t->thread.evr[regno-32],
|
||||
dbg_reg_def[regno].size);
|
||||
#else
|
||||
/* fp registers not used by kernel, leave zero */
|
||||
|
@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs)
|
|||
if (regno >= 32 && regno < 64) {
|
||||
/* FP registers 32 -> 63 */
|
||||
#if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
|
||||
memcpy(current->thread.evr[regno-32], mem,
|
||||
memcpy(¤t->thread.evr[regno-32], mem,
|
||||
dbg_reg_def[regno].size);
|
||||
#else
|
||||
/* fp registers not used by kernel, leave zero */
|
||||
|
|
|
@ -497,9 +497,8 @@ static void __init emergency_stack_init(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* Called into from start_kernel, after lock_kernel has been called.
|
||||
* Initializes bootmem, which is unsed to manage page allocation until
|
||||
* mem_init is called.
|
||||
* Called into from start_kernel this initializes bootmem, which is used
|
||||
* to manage page allocation until mem_init is called.
|
||||
*/
|
||||
void __init setup_arch(char **cmdline_p)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <linux/resource.h>
|
||||
#include <linux/times.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/sem.h>
|
||||
#include <linux/msg.h>
|
||||
#include <linux/shm.h>
|
||||
|
|
|
@ -1123,7 +1123,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
|
|||
else
|
||||
#endif /* CONFIG_PPC_HAS_HASH_64K */
|
||||
rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize,
|
||||
subpage_protection(pgdir, ea));
|
||||
subpage_protection(mm, ea));
|
||||
|
||||
/* Dump some info in case of hash insertion failure, they should
|
||||
* never happen so it is really useful to know if/when they do
|
||||
|
|
|
@ -138,8 +138,11 @@
|
|||
cmpldi cr0,r15,0 /* Check for user region */
|
||||
std r14,EX_TLB_ESR(r12) /* write crazy -1 to frame */
|
||||
beq normal_tlb_miss
|
||||
|
||||
li r11,_PAGE_PRESENT|_PAGE_BAP_SX /* Base perm */
|
||||
oris r11,r11,_PAGE_ACCESSED@h
|
||||
/* XXX replace the RMW cycles with immediate loads + writes */
|
||||
1: mfspr r10,SPRN_MAS1
|
||||
mfspr r10,SPRN_MAS1
|
||||
cmpldi cr0,r15,8 /* Check for vmalloc region */
|
||||
rlwinm r10,r10,0,16,1 /* Clear TID */
|
||||
mtspr SPRN_MAS1,r10
|
||||
|
|
|
@ -585,6 +585,6 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
|
|||
ppc64_rma_size = min_t(u64, first_memblock_size, 0x40000000);
|
||||
|
||||
/* Finally limit subsequent allocations */
|
||||
memblock_set_current_limit(ppc64_memblock_base + ppc64_rma_size);
|
||||
memblock_set_current_limit(first_memblock_base + ppc64_rma_size);
|
||||
}
|
||||
#endif /* CONFIG_PPC64 */
|
||||
|
|
|
@ -47,6 +47,12 @@ config LPARCFG
|
|||
config PPC_PSERIES_DEBUG
|
||||
depends on PPC_PSERIES && PPC_EARLY_DEBUG
|
||||
bool "Enable extra debug logging in platforms/pseries"
|
||||
help
|
||||
Say Y here if you want the pseries core to produce a bunch of
|
||||
debug messages to the system log. Select this if you are having a
|
||||
problem with the pseries core and want to see more of what is
|
||||
going on. This does not enable debugging in lpar.c, which must
|
||||
be manually done due to its verbosity.
|
||||
default y
|
||||
|
||||
config PPC_SMLPAR
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
* Please address comments and feedback to Linas Vepstas <linas@austin.ibm.com>
|
||||
*/
|
||||
|
||||
#undef DEBUG
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/list.h>
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#undef DEBUG
|
||||
|
||||
#include <linux/pci.h>
|
||||
#include <asm/pci-bridge.h>
|
||||
#include <asm/ppc-pci.h>
|
||||
|
|
|
@ -6,6 +6,18 @@ config TRACE_IRQFLAGS_SUPPORT
|
|||
|
||||
source "lib/Kconfig.debug"
|
||||
|
||||
config STRICT_DEVMEM
|
||||
def_bool y
|
||||
prompt "Filter access to /dev/mem"
|
||||
---help---
|
||||
This option restricts access to /dev/mem. If this option is
|
||||
disabled, you allow userspace access to all memory, including
|
||||
kernel and userspace memory. Accidental memory access is likely
|
||||
to be disastrous.
|
||||
Memory access is required for experts who want to debug the kernel.
|
||||
|
||||
If you are unsure, say Y.
|
||||
|
||||
config DEBUG_STRICT_USER_COPY_CHECKS
|
||||
bool "Strict user copy size checks"
|
||||
---help---
|
||||
|
|
|
@ -130,6 +130,11 @@ struct page;
|
|||
void arch_free_page(struct page *page, int order);
|
||||
void arch_alloc_page(struct page *page, int order);
|
||||
|
||||
static inline int devmem_is_allowed(unsigned long pfn)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define HAVE_ARCH_FREE_PAGE
|
||||
#define HAVE_ARCH_ALLOC_PAGE
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <linux/resource.h>
|
||||
#include <linux/times.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/sem.h>
|
||||
#include <linux/msg.h>
|
||||
#include <linux/shm.h>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <asm/sections.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/hardirq.h>
|
||||
|
||||
DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
|
||||
DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
|
||||
|
@ -212,7 +213,7 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
|
|||
/* Set the PER control regs, turns on single step for this address */
|
||||
__ctl_load(kprobe_per_regs, 9, 11);
|
||||
regs->psw.mask |= PSW_MASK_PER;
|
||||
regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK);
|
||||
regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT);
|
||||
}
|
||||
|
||||
static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
|
||||
|
@ -239,7 +240,7 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
|
|||
__get_cpu_var(current_kprobe) = p;
|
||||
/* Save the interrupt and per flags */
|
||||
kcb->kprobe_saved_imask = regs->psw.mask &
|
||||
(PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK);
|
||||
(PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT);
|
||||
/* Save the control regs that govern PER */
|
||||
__ctl_store(kcb->kprobe_saved_ctl, 9, 11);
|
||||
}
|
||||
|
@ -316,8 +317,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
|
|||
return 1;
|
||||
|
||||
ss_probe:
|
||||
if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO))
|
||||
local_irq_disable();
|
||||
prepare_singlestep(p, regs);
|
||||
kcb->kprobe_status = KPROBE_HIT_SS;
|
||||
return 1;
|
||||
|
@ -350,6 +349,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
|
|||
struct hlist_node *node, *tmp;
|
||||
unsigned long flags, orig_ret_address = 0;
|
||||
unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
|
||||
kprobe_opcode_t *correct_ret_addr = NULL;
|
||||
|
||||
INIT_HLIST_HEAD(&empty_rp);
|
||||
kretprobe_hash_lock(current, &head, &flags);
|
||||
|
@ -372,10 +372,32 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
|
|||
/* another task is sharing our hash bucket */
|
||||
continue;
|
||||
|
||||
if (ri->rp && ri->rp->handler)
|
||||
ri->rp->handler(ri, regs);
|
||||
orig_ret_address = (unsigned long)ri->ret_addr;
|
||||
|
||||
if (orig_ret_address != trampoline_address)
|
||||
/*
|
||||
* This is the real return address. Any other
|
||||
* instances associated with this task are for
|
||||
* other calls deeper on the call stack
|
||||
*/
|
||||
break;
|
||||
}
|
||||
|
||||
kretprobe_assert(ri, orig_ret_address, trampoline_address);
|
||||
|
||||
correct_ret_addr = ri->ret_addr;
|
||||
hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
|
||||
if (ri->task != current)
|
||||
/* another task is sharing our hash bucket */
|
||||
continue;
|
||||
|
||||
orig_ret_address = (unsigned long)ri->ret_addr;
|
||||
|
||||
if (ri->rp && ri->rp->handler) {
|
||||
ri->ret_addr = correct_ret_addr;
|
||||
ri->rp->handler(ri, regs);
|
||||
}
|
||||
|
||||
recycle_rp_inst(ri, &empty_rp);
|
||||
|
||||
if (orig_ret_address != trampoline_address) {
|
||||
|
@ -387,7 +409,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
|
|||
break;
|
||||
}
|
||||
}
|
||||
kretprobe_assert(ri, orig_ret_address, trampoline_address);
|
||||
|
||||
regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE;
|
||||
|
||||
reset_current_kprobe();
|
||||
|
@ -465,8 +487,6 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
|
|||
goto out;
|
||||
}
|
||||
reset_current_kprobe();
|
||||
if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO))
|
||||
local_irq_enable();
|
||||
out:
|
||||
preempt_enable_no_resched();
|
||||
|
||||
|
@ -482,7 +502,7 @@ out:
|
|||
return 1;
|
||||
}
|
||||
|
||||
int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
|
||||
static int __kprobes kprobe_trap_handler(struct pt_regs *regs, int trapnr)
|
||||
{
|
||||
struct kprobe *cur = kprobe_running();
|
||||
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
|
||||
|
@ -508,8 +528,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
|
|||
restore_previous_kprobe(kcb);
|
||||
else {
|
||||
reset_current_kprobe();
|
||||
if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO))
|
||||
local_irq_enable();
|
||||
}
|
||||
preempt_enable_no_resched();
|
||||
break;
|
||||
|
@ -553,6 +571,18 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT))
|
||||
local_irq_disable();
|
||||
ret = kprobe_trap_handler(regs, trapnr);
|
||||
if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT))
|
||||
local_irq_restore(regs->psw.mask & ~PSW_MASK_PER);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapper routine to for handling exceptions.
|
||||
*/
|
||||
|
@ -560,8 +590,12 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
|
|||
unsigned long val, void *data)
|
||||
{
|
||||
struct die_args *args = (struct die_args *)data;
|
||||
struct pt_regs *regs = args->regs;
|
||||
int ret = NOTIFY_DONE;
|
||||
|
||||
if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT))
|
||||
local_irq_disable();
|
||||
|
||||
switch (val) {
|
||||
case DIE_BPT:
|
||||
if (kprobe_handler(args->regs))
|
||||
|
@ -572,16 +606,17 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
|
|||
ret = NOTIFY_STOP;
|
||||
break;
|
||||
case DIE_TRAP:
|
||||
/* kprobe_running() needs smp_processor_id() */
|
||||
preempt_disable();
|
||||
if (kprobe_running() &&
|
||||
kprobe_fault_handler(args->regs, args->trapnr))
|
||||
if (!preemptible() && kprobe_running() &&
|
||||
kprobe_trap_handler(args->regs, args->trapnr))
|
||||
ret = NOTIFY_STOP;
|
||||
preempt_enable();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT))
|
||||
local_irq_restore(regs->psw.mask & ~PSW_MASK_PER);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -595,6 +630,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
|
|||
|
||||
/* setup return addr to the jprobe handler routine */
|
||||
regs->psw.addr = (unsigned long)(jp->entry) | PSW_ADDR_AMODE;
|
||||
regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT);
|
||||
|
||||
/* r14 is the function return address */
|
||||
kcb->jprobe_saved_r14 = (unsigned long)regs->gprs[14];
|
||||
|
|
|
@ -20,18 +20,17 @@
|
|||
static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
|
||||
unsigned long end, int write, struct page **pages, int *nr)
|
||||
{
|
||||
unsigned long mask, result;
|
||||
unsigned long mask;
|
||||
pte_t *ptep, pte;
|
||||
struct page *page;
|
||||
|
||||
result = write ? 0 : _PAGE_RO;
|
||||
mask = result | _PAGE_INVALID | _PAGE_SPECIAL;
|
||||
mask = (write ? _PAGE_RO : 0) | _PAGE_INVALID | _PAGE_SPECIAL;
|
||||
|
||||
ptep = ((pte_t *) pmd_deref(pmd)) + pte_index(addr);
|
||||
do {
|
||||
pte = *ptep;
|
||||
barrier();
|
||||
if ((pte_val(pte) & mask) != result)
|
||||
if ((pte_val(pte) & mask) != 0)
|
||||
return 0;
|
||||
VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
|
||||
page = pte_page(pte);
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/kernel_stat.h>
|
||||
#include <linux/init.h>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <linux/resource.h>
|
||||
#include <linux/times.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/sem.h>
|
||||
#include <linux/msg.h>
|
||||
#include <linux/shm.h>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include <linux/mman.h>
|
||||
#include <linux/utsname.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/ipc.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <asm/system.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/perf_event.h>
|
||||
|
||||
enum direction {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <linux/string.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <linux/kdev_t.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/signal.h>
|
||||
#include <asm/syscalls.h>
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/errno.h>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/errno.h>
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/kernel_stat.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/cpu.h>
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/mman.h>
|
||||
#include <linux/file.h>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <linux/mman.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/tty.h>
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/hugetlb.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/sysctl.h>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "linux/stddef.h"
|
||||
#include "linux/fs.h"
|
||||
#include "linux/smp_lock.h"
|
||||
#include "linux/ptrace.h"
|
||||
#include "linux/sched.h"
|
||||
#include "linux/slab.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <linux/syscalls.h>
|
||||
#include <linux/times.h>
|
||||
#include <linux/utsname.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/uio.h>
|
||||
#include <linux/poll.h>
|
||||
|
|
|
@ -61,9 +61,9 @@ DEFINE_GUEST_HANDLE(void);
|
|||
#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
|
||||
#endif
|
||||
|
||||
#ifndef machine_to_phys_mapping
|
||||
#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
|
||||
#endif
|
||||
#define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START)
|
||||
#define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END)
|
||||
#define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>__MACH2PHYS_SHIFT)
|
||||
|
||||
/* Maximum number of virtual CPUs in multi-processor guests. */
|
||||
#define MAX_VIRT_CPUS 32
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
/* And the trap vector is... */
|
||||
#define TRAP_INSTR "int $0x82"
|
||||
|
||||
#define __MACH2PHYS_VIRT_START 0xF5800000
|
||||
#define __MACH2PHYS_VIRT_END 0xF6800000
|
||||
|
||||
#define __MACH2PHYS_SHIFT 2
|
||||
|
||||
/*
|
||||
* Virtual addresses beyond this are not modifiable by guest OSes. The
|
||||
* machine->physical mapping table starts at this address, read-only.
|
||||
|
|
|
@ -39,18 +39,7 @@
|
|||
#define __HYPERVISOR_VIRT_END 0xFFFF880000000000
|
||||
#define __MACH2PHYS_VIRT_START 0xFFFF800000000000
|
||||
#define __MACH2PHYS_VIRT_END 0xFFFF804000000000
|
||||
|
||||
#ifndef HYPERVISOR_VIRT_START
|
||||
#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
|
||||
#define HYPERVISOR_VIRT_END mk_unsigned_long(__HYPERVISOR_VIRT_END)
|
||||
#endif
|
||||
|
||||
#define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START)
|
||||
#define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END)
|
||||
#define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>3)
|
||||
#ifndef machine_to_phys_mapping
|
||||
#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
|
||||
#endif
|
||||
#define __MACH2PHYS_SHIFT 3
|
||||
|
||||
/*
|
||||
* int HYPERVISOR_set_segment_base(unsigned int which, unsigned long base)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/pfn.h>
|
||||
#include <linux/mm.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/page.h>
|
||||
|
@ -35,6 +36,8 @@ typedef struct xpaddr {
|
|||
#define MAX_DOMAIN_PAGES \
|
||||
((unsigned long)((u64)CONFIG_XEN_MAX_DOMAIN_MEMORY * 1024 * 1024 * 1024 / PAGE_SIZE))
|
||||
|
||||
extern unsigned long *machine_to_phys_mapping;
|
||||
extern unsigned int machine_to_phys_order;
|
||||
|
||||
extern unsigned long get_phys_to_machine(unsigned long pfn);
|
||||
extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn);
|
||||
|
@ -69,10 +72,8 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
|
|||
if (xen_feature(XENFEAT_auto_translated_physmap))
|
||||
return mfn;
|
||||
|
||||
#if 0
|
||||
if (unlikely((mfn >> machine_to_phys_order) != 0))
|
||||
return max_mapnr;
|
||||
#endif
|
||||
return ~0;
|
||||
|
||||
pfn = 0;
|
||||
/*
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/device.h>
|
||||
|
|
|
@ -315,14 +315,18 @@ static void kgdb_remove_all_hw_break(void)
|
|||
if (!breakinfo[i].enabled)
|
||||
continue;
|
||||
bp = *per_cpu_ptr(breakinfo[i].pev, cpu);
|
||||
if (bp->attr.disabled == 1)
|
||||
if (!bp->attr.disabled) {
|
||||
arch_uninstall_hw_breakpoint(bp);
|
||||
bp->attr.disabled = 1;
|
||||
continue;
|
||||
}
|
||||
if (dbg_is_early)
|
||||
early_dr7 &= ~encode_dr7(i, breakinfo[i].len,
|
||||
breakinfo[i].type);
|
||||
else
|
||||
arch_uninstall_hw_breakpoint(bp);
|
||||
bp->attr.disabled = 1;
|
||||
else if (hw_break_release_slot(i))
|
||||
printk(KERN_ERR "KGDB: hw bpt remove failed %lx\n",
|
||||
breakinfo[i].addr);
|
||||
breakinfo[i].enabled = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/device.h>
|
||||
|
|
|
@ -3395,6 +3395,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|||
vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip;
|
||||
|
||||
load_host_msrs(vcpu);
|
||||
kvm_load_ldt(ldt_selector);
|
||||
loadsegment(fs, fs_selector);
|
||||
#ifdef CONFIG_X86_64
|
||||
load_gs_index(gs_selector);
|
||||
|
@ -3402,7 +3403,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|||
#else
|
||||
loadsegment(gs, gs_selector);
|
||||
#endif
|
||||
kvm_load_ldt(ldt_selector);
|
||||
|
||||
reload_tss(vcpu);
|
||||
|
||||
|
|
|
@ -821,10 +821,9 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
if (is_long_mode(&vmx->vcpu)) {
|
||||
rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
|
||||
rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
|
||||
if (is_long_mode(&vmx->vcpu))
|
||||
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
|
||||
}
|
||||
#endif
|
||||
for (i = 0; i < vmx->save_nmsrs; ++i)
|
||||
kvm_set_shared_msr(vmx->guest_msrs[i].index,
|
||||
|
@ -839,23 +838,23 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
|
|||
|
||||
++vmx->vcpu.stat.host_state_reload;
|
||||
vmx->host_state.loaded = 0;
|
||||
if (vmx->host_state.fs_reload_needed)
|
||||
loadsegment(fs, vmx->host_state.fs_sel);
|
||||
#ifdef CONFIG_X86_64
|
||||
if (is_long_mode(&vmx->vcpu))
|
||||
rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
|
||||
#endif
|
||||
if (vmx->host_state.gs_ldt_reload_needed) {
|
||||
kvm_load_ldt(vmx->host_state.ldt_sel);
|
||||
#ifdef CONFIG_X86_64
|
||||
load_gs_index(vmx->host_state.gs_sel);
|
||||
wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
|
||||
#else
|
||||
loadsegment(gs, vmx->host_state.gs_sel);
|
||||
#endif
|
||||
}
|
||||
if (vmx->host_state.fs_reload_needed)
|
||||
loadsegment(fs, vmx->host_state.fs_sel);
|
||||
reload_tss();
|
||||
#ifdef CONFIG_X86_64
|
||||
if (is_long_mode(&vmx->vcpu)) {
|
||||
rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
|
||||
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
|
||||
}
|
||||
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
|
||||
#endif
|
||||
if (current_thread_info()->status & TS_USEDFPU)
|
||||
clts();
|
||||
|
|
|
@ -75,6 +75,11 @@ DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
|
|||
enum xen_domain_type xen_domain_type = XEN_NATIVE;
|
||||
EXPORT_SYMBOL_GPL(xen_domain_type);
|
||||
|
||||
unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START;
|
||||
EXPORT_SYMBOL(machine_to_phys_mapping);
|
||||
unsigned int machine_to_phys_order;
|
||||
EXPORT_SYMBOL(machine_to_phys_order);
|
||||
|
||||
struct start_info *xen_start_info;
|
||||
EXPORT_SYMBOL_GPL(xen_start_info);
|
||||
|
||||
|
@ -1090,6 +1095,8 @@ static void __init xen_setup_stackprotector(void)
|
|||
/* First C function to be called on Xen boot */
|
||||
asmlinkage void __init xen_start_kernel(void)
|
||||
{
|
||||
struct physdev_set_iopl set_iopl;
|
||||
int rc;
|
||||
pgd_t *pgd;
|
||||
|
||||
if (!xen_start_info)
|
||||
|
@ -1097,6 +1104,8 @@ asmlinkage void __init xen_start_kernel(void)
|
|||
|
||||
xen_domain_type = XEN_PV_DOMAIN;
|
||||
|
||||
xen_setup_machphys_mapping();
|
||||
|
||||
/* Install Xen paravirt ops */
|
||||
pv_info = xen_info;
|
||||
pv_init_ops = xen_init_ops;
|
||||
|
@ -1202,10 +1211,18 @@ asmlinkage void __init xen_start_kernel(void)
|
|||
#else
|
||||
pv_info.kernel_rpl = 0;
|
||||
#endif
|
||||
|
||||
/* set the limit of our address space */
|
||||
xen_reserve_top();
|
||||
|
||||
/* We used to do this in xen_arch_setup, but that is too late on AMD
|
||||
* were early_cpu_init (run before ->arch_setup()) calls early_amd_init
|
||||
* which pokes 0xcf8 port.
|
||||
*/
|
||||
set_iopl.iopl = 1;
|
||||
rc = HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
|
||||
if (rc != 0)
|
||||
xen_raw_printk("physdev_op failed %d\n", rc);
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
/* set up basic CPUID stuff */
|
||||
cpu_detect(&new_cpu_data);
|
||||
|
|
|
@ -2034,6 +2034,20 @@ static __init void xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn)
|
|||
set_page_prot(pmd, PAGE_KERNEL_RO);
|
||||
}
|
||||
|
||||
void __init xen_setup_machphys_mapping(void)
|
||||
{
|
||||
struct xen_machphys_mapping mapping;
|
||||
unsigned long machine_to_phys_nr_ents;
|
||||
|
||||
if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) {
|
||||
machine_to_phys_mapping = (unsigned long *)mapping.v_start;
|
||||
machine_to_phys_nr_ents = mapping.max_mfn + 1;
|
||||
} else {
|
||||
machine_to_phys_nr_ents = MACH2PHYS_NR_ENTRIES;
|
||||
}
|
||||
machine_to_phys_order = fls(machine_to_phys_nr_ents - 1);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
static void convert_pfn_mfn(void *v)
|
||||
{
|
||||
|
@ -2627,7 +2641,8 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
|
|||
|
||||
prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
|
||||
|
||||
vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
|
||||
BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_RESERVED | VM_IO)) ==
|
||||
(VM_PFNMAP | VM_RESERVED | VM_IO)));
|
||||
|
||||
rmd.mfn = mfn;
|
||||
rmd.prot = prot;
|
||||
|
|
|
@ -248,8 +248,7 @@ char * __init xen_memory_setup(void)
|
|||
else
|
||||
extra_pages = 0;
|
||||
|
||||
if (!xen_initial_domain())
|
||||
xen_add_extra_mem(extra_pages);
|
||||
xen_add_extra_mem(extra_pages);
|
||||
|
||||
return "Xen";
|
||||
}
|
||||
|
@ -337,9 +336,6 @@ void __cpuinit xen_enable_syscall(void)
|
|||
|
||||
void __init xen_arch_setup(void)
|
||||
{
|
||||
struct physdev_set_iopl set_iopl;
|
||||
int rc;
|
||||
|
||||
xen_panic_handler_init();
|
||||
|
||||
HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
|
||||
|
@ -356,11 +352,6 @@ void __init xen_arch_setup(void)
|
|||
xen_enable_sysenter();
|
||||
xen_enable_syscall();
|
||||
|
||||
set_iopl.iopl = 1;
|
||||
rc = HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
|
||||
if (rc != 0)
|
||||
printk(KERN_INFO "physdev_op failed %d\n", rc);
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
|
||||
printk(KERN_INFO "ACPI in unprivileged domain disabled\n");
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <linux/hdreg.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include <linux/hdreg.h>
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/blktrace_api.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
|
|
@ -3166,8 +3166,8 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
|
|||
|
||||
/**
|
||||
* ata_scsi_queuecmd - Issue SCSI cdb to libata-managed device
|
||||
* @shost: SCSI host of command to be sent
|
||||
* @cmd: SCSI command to be sent
|
||||
* @done: Completion function, called when command is complete
|
||||
*
|
||||
* In some cases, this function translates SCSI commands into
|
||||
* ATA taskfiles, and queues the taskfiles to be sent to
|
||||
|
@ -3177,37 +3177,36 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
|
|||
* ATA and ATAPI devices appearing as SCSI devices.
|
||||
*
|
||||
* LOCKING:
|
||||
* Releases scsi-layer-held lock, and obtains host lock.
|
||||
* ATA host lock
|
||||
*
|
||||
* RETURNS:
|
||||
* Return value from __ata_scsi_queuecmd() if @cmd can be queued,
|
||||
* 0 otherwise.
|
||||
*/
|
||||
int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
|
||||
int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
|
||||
{
|
||||
struct ata_port *ap;
|
||||
struct ata_device *dev;
|
||||
struct scsi_device *scsidev = cmd->device;
|
||||
struct Scsi_Host *shost = scsidev->host;
|
||||
int rc = 0;
|
||||
unsigned long irq_flags;
|
||||
|
||||
ap = ata_shost_to_port(shost);
|
||||
|
||||
spin_unlock(shost->host_lock);
|
||||
spin_lock(ap->lock);
|
||||
spin_lock_irqsave(ap->lock, irq_flags);
|
||||
|
||||
ata_scsi_dump_cdb(ap, cmd);
|
||||
|
||||
dev = ata_scsi_find_dev(ap, scsidev);
|
||||
if (likely(dev))
|
||||
rc = __ata_scsi_queuecmd(cmd, done, dev);
|
||||
rc = __ata_scsi_queuecmd(cmd, cmd->scsi_done, dev);
|
||||
else {
|
||||
cmd->result = (DID_BAD_TARGET << 16);
|
||||
done(cmd);
|
||||
cmd->scsi_done(cmd);
|
||||
}
|
||||
|
||||
spin_unlock(ap->lock);
|
||||
spin_lock(shost->host_lock);
|
||||
spin_unlock_irqrestore(ap->lock, irq_flags);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
@ -538,7 +538,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void svia_configure(struct pci_dev *pdev)
|
||||
static void svia_configure(struct pci_dev *pdev, int board_id)
|
||||
{
|
||||
u8 tmp8;
|
||||
|
||||
|
@ -577,7 +577,7 @@ static void svia_configure(struct pci_dev *pdev)
|
|||
}
|
||||
|
||||
/*
|
||||
* vt6421 has problems talking to some drives. The following
|
||||
* vt6420/1 has problems talking to some drives. The following
|
||||
* is the fix from Joseph Chan <JosephChan@via.com.tw>.
|
||||
*
|
||||
* When host issues HOLD, device may send up to 20DW of data
|
||||
|
@ -596,8 +596,9 @@ static void svia_configure(struct pci_dev *pdev)
|
|||
*
|
||||
* https://bugzilla.kernel.org/show_bug.cgi?id=15173
|
||||
* http://article.gmane.org/gmane.linux.ide/46352
|
||||
* http://thread.gmane.org/gmane.linux.kernel/1062139
|
||||
*/
|
||||
if (pdev->device == 0x3249) {
|
||||
if (board_id == vt6420 || board_id == vt6421) {
|
||||
pci_read_config_byte(pdev, 0x52, &tmp8);
|
||||
tmp8 |= 1 << 2;
|
||||
pci_write_config_byte(pdev, 0x52, tmp8);
|
||||
|
@ -652,7 +653,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
svia_configure(pdev);
|
||||
svia_configure(pdev, board_id);
|
||||
|
||||
pci_set_master(pdev);
|
||||
return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
|
||||
|
|
|
@ -475,20 +475,33 @@ End:
|
|||
*/
|
||||
void dpm_resume_noirq(pm_message_t state)
|
||||
{
|
||||
struct device *dev;
|
||||
struct list_head list;
|
||||
ktime_t starttime = ktime_get();
|
||||
|
||||
INIT_LIST_HEAD(&list);
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
transition_started = false;
|
||||
list_for_each_entry(dev, &dpm_list, power.entry)
|
||||
while (!list_empty(&dpm_list)) {
|
||||
struct device *dev = to_device(dpm_list.next);
|
||||
|
||||
get_device(dev);
|
||||
if (dev->power.status > DPM_OFF) {
|
||||
int error;
|
||||
|
||||
dev->power.status = DPM_OFF;
|
||||
mutex_unlock(&dpm_list_mtx);
|
||||
|
||||
error = device_resume_noirq(dev, state);
|
||||
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
if (error)
|
||||
pm_dev_err(dev, state, " early", error);
|
||||
}
|
||||
if (!list_empty(&dev->power.entry))
|
||||
list_move_tail(&dev->power.entry, &list);
|
||||
put_device(dev);
|
||||
}
|
||||
list_splice(&list, &dpm_list);
|
||||
mutex_unlock(&dpm_list_mtx);
|
||||
dpm_show_time(starttime, state, "early");
|
||||
resume_device_irqs();
|
||||
|
@ -789,20 +802,33 @@ End:
|
|||
*/
|
||||
int dpm_suspend_noirq(pm_message_t state)
|
||||
{
|
||||
struct device *dev;
|
||||
struct list_head list;
|
||||
ktime_t starttime = ktime_get();
|
||||
int error = 0;
|
||||
|
||||
INIT_LIST_HEAD(&list);
|
||||
suspend_device_irqs();
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
list_for_each_entry_reverse(dev, &dpm_list, power.entry) {
|
||||
while (!list_empty(&dpm_list)) {
|
||||
struct device *dev = to_device(dpm_list.prev);
|
||||
|
||||
get_device(dev);
|
||||
mutex_unlock(&dpm_list_mtx);
|
||||
|
||||
error = device_suspend_noirq(dev, state);
|
||||
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
if (error) {
|
||||
pm_dev_err(dev, state, " late", error);
|
||||
put_device(dev);
|
||||
break;
|
||||
}
|
||||
dev->power.status = DPM_OFF_IRQ;
|
||||
if (!list_empty(&dev->power.entry))
|
||||
list_move(&dev->power.entry, &list);
|
||||
put_device(dev);
|
||||
}
|
||||
list_splice_tail(&list, &dpm_list);
|
||||
mutex_unlock(&dpm_list_mtx);
|
||||
if (error)
|
||||
dpm_resume_noirq(resume_event(state));
|
||||
|
|
|
@ -62,8 +62,8 @@ static int cciss_scsi_proc_info(
|
|||
int length, /* length of data in buffer */
|
||||
int func); /* 0 == read, 1 == write */
|
||||
|
||||
static int cciss_scsi_queue_command (struct scsi_cmnd *cmd,
|
||||
void (* done)(struct scsi_cmnd *));
|
||||
static int cciss_scsi_queue_command (struct Scsi_Host *h,
|
||||
struct scsi_cmnd *cmd);
|
||||
static int cciss_eh_device_reset_handler(struct scsi_cmnd *);
|
||||
static int cciss_eh_abort_handler(struct scsi_cmnd *);
|
||||
|
||||
|
@ -1406,7 +1406,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c,
|
|||
|
||||
|
||||
static int
|
||||
cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
|
||||
cciss_scsi_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
|
||||
{
|
||||
ctlr_info_t *h;
|
||||
int rc;
|
||||
|
@ -1504,6 +1504,8 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd
|
|||
return 0;
|
||||
}
|
||||
|
||||
static DEF_SCSI_QCMD(cciss_scsi_queue_command)
|
||||
|
||||
static void cciss_unregister_scsi(ctlr_info_t *h)
|
||||
{
|
||||
struct cciss_scsi_adapter_data_t *sa;
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include <linux/memcontrol.h>
|
||||
#include <linux/mm_inline.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/pkt_sched.h>
|
||||
#define __KERNEL_SYSCALLS__
|
||||
#include <linux/unistd.h>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/drbd.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/memcontrol.h>
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include "agp.h"
|
||||
|
|
|
@ -81,7 +81,6 @@ static char *serial_version = "4.30";
|
|||
#include <linux/mm.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/tty.h>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/major.h>
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/delay.h>
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/tty_flip.h>
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/serial.h>
|
||||
#include <linux/serialP.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
|
|
@ -87,7 +87,6 @@
|
|||
#include <linux/tty_flip.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/serial.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/delay.h>
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <linux/stallion.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/ctype.h>
|
||||
|
|
|
@ -216,7 +216,6 @@
|
|||
#include <linux/eisa.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/bitops.h>
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/math64.h>
|
||||
#include <linux/smp_lock.h>
|
||||
|
||||
#include <asm/genapic.h>
|
||||
#include <asm/uv/uv_hub.h>
|
||||
|
|
|
@ -1468,7 +1468,7 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb,
|
|||
|
||||
/* SCSI stack integration */
|
||||
|
||||
static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
|
||||
static int sbp2_scsi_queuecommand_lck(struct scsi_cmnd *cmd, scsi_done_fn_t done)
|
||||
{
|
||||
struct sbp2_logical_unit *lu = cmd->device->hostdata;
|
||||
struct fw_device *device = target_device(lu->tgt);
|
||||
|
@ -1534,6 +1534,8 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
|
|||
return retval;
|
||||
}
|
||||
|
||||
static DEF_SCSI_QCMD(sbp2_scsi_queuecommand)
|
||||
|
||||
static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
|
||||
{
|
||||
struct sbp2_logical_unit *lu = sdev->hostdata;
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "drmP.h"
|
||||
#include <linux/poll.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/smp_lock.h>
|
||||
|
||||
/* from BKL pushdown: note that nothing else serializes idr_find() */
|
||||
DEFINE_MUTEX(drm_global_mutex);
|
||||
|
|
|
@ -150,7 +150,8 @@ static const struct intel_device_info intel_ironlake_d_info = {
|
|||
|
||||
static const struct intel_device_info intel_ironlake_m_info = {
|
||||
.gen = 5, .is_mobile = 1,
|
||||
.need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1, .has_hotplug = 1,
|
||||
.need_gfx_hws = 1, .has_rc6 = 1, .has_hotplug = 1,
|
||||
.has_fbc = 0, /* disabled due to buggy hardware */
|
||||
.has_bsd_ring = 1,
|
||||
};
|
||||
|
||||
|
|
|
@ -1045,6 +1045,8 @@ void i915_gem_clflush_object(struct drm_gem_object *obj);
|
|||
int i915_gem_object_set_domain(struct drm_gem_object *obj,
|
||||
uint32_t read_domains,
|
||||
uint32_t write_domain);
|
||||
int i915_gem_object_flush_gpu(struct drm_i915_gem_object *obj,
|
||||
bool interruptible);
|
||||
int i915_gem_init_ringbuffer(struct drm_device *dev);
|
||||
void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
|
||||
int i915_gem_do_init(struct drm_device *dev, unsigned long start,
|
||||
|
|
|
@ -547,6 +547,19 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
|
|||
struct drm_i915_gem_object *obj_priv;
|
||||
int ret = 0;
|
||||
|
||||
if (args->size == 0)
|
||||
return 0;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE,
|
||||
(char __user *)(uintptr_t)args->data_ptr,
|
||||
args->size))
|
||||
return -EFAULT;
|
||||
|
||||
ret = fault_in_pages_writeable((char __user *)(uintptr_t)args->data_ptr,
|
||||
args->size);
|
||||
if (ret)
|
||||
return -EFAULT;
|
||||
|
||||
ret = i915_mutex_lock_interruptible(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@ -564,23 +577,6 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (args->size == 0)
|
||||
goto out;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE,
|
||||
(char __user *)(uintptr_t)args->data_ptr,
|
||||
args->size)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = fault_in_pages_writeable((char __user *)(uintptr_t)args->data_ptr,
|
||||
args->size);
|
||||
if (ret) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = i915_gem_object_get_pages_or_evict(obj);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
@ -981,7 +977,20 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
|
|||
struct drm_i915_gem_pwrite *args = data;
|
||||
struct drm_gem_object *obj;
|
||||
struct drm_i915_gem_object *obj_priv;
|
||||
int ret = 0;
|
||||
int ret;
|
||||
|
||||
if (args->size == 0)
|
||||
return 0;
|
||||
|
||||
if (!access_ok(VERIFY_READ,
|
||||
(char __user *)(uintptr_t)args->data_ptr,
|
||||
args->size))
|
||||
return -EFAULT;
|
||||
|
||||
ret = fault_in_pages_readable((char __user *)(uintptr_t)args->data_ptr,
|
||||
args->size);
|
||||
if (ret)
|
||||
return -EFAULT;
|
||||
|
||||
ret = i915_mutex_lock_interruptible(dev);
|
||||
if (ret)
|
||||
|
@ -994,30 +1003,12 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
|
|||
}
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
|
||||
/* Bounds check destination. */
|
||||
if (args->offset > obj->size || args->size > obj->size - args->offset) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (args->size == 0)
|
||||
goto out;
|
||||
|
||||
if (!access_ok(VERIFY_READ,
|
||||
(char __user *)(uintptr_t)args->data_ptr,
|
||||
args->size)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = fault_in_pages_readable((char __user *)(uintptr_t)args->data_ptr,
|
||||
args->size);
|
||||
if (ret) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* We can only do the GTT pwrite on untiled buffers, as otherwise
|
||||
* it would end up going through the fenced access, and we'll get
|
||||
* different detiling behavior between reading and writing.
|
||||
|
@ -2907,6 +2898,20 @@ i915_gem_object_set_to_display_plane(struct drm_gem_object *obj,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
i915_gem_object_flush_gpu(struct drm_i915_gem_object *obj,
|
||||
bool interruptible)
|
||||
{
|
||||
if (!obj->active)
|
||||
return 0;
|
||||
|
||||
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS)
|
||||
i915_gem_flush_ring(obj->base.dev, NULL, obj->ring,
|
||||
0, obj->base.write_domain);
|
||||
|
||||
return i915_gem_object_wait_rendering(&obj->base, interruptible);
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves a single object to the CPU read, and possibly write domain.
|
||||
*
|
||||
|
|
|
@ -34,6 +34,25 @@
|
|||
#include "i915_drm.h"
|
||||
#include "i915_drv.h"
|
||||
|
||||
/* Here's the desired hotplug mode */
|
||||
#define ADPA_HOTPLUG_BITS (ADPA_CRT_HOTPLUG_PERIOD_128 | \
|
||||
ADPA_CRT_HOTPLUG_WARMUP_10MS | \
|
||||
ADPA_CRT_HOTPLUG_SAMPLE_4S | \
|
||||
ADPA_CRT_HOTPLUG_VOLTAGE_50 | \
|
||||
ADPA_CRT_HOTPLUG_VOLREF_325MV | \
|
||||
ADPA_CRT_HOTPLUG_ENABLE)
|
||||
|
||||
struct intel_crt {
|
||||
struct intel_encoder base;
|
||||
bool force_hotplug_required;
|
||||
};
|
||||
|
||||
static struct intel_crt *intel_attached_crt(struct drm_connector *connector)
|
||||
{
|
||||
return container_of(intel_attached_encoder(connector),
|
||||
struct intel_crt, base);
|
||||
}
|
||||
|
||||
static void intel_crt_dpms(struct drm_encoder *encoder, int mode)
|
||||
{
|
||||
struct drm_device *dev = encoder->dev;
|
||||
|
@ -129,7 +148,7 @@ static void intel_crt_mode_set(struct drm_encoder *encoder,
|
|||
dpll_md & ~DPLL_MD_UDI_MULTIPLIER_MASK);
|
||||
}
|
||||
|
||||
adpa = 0;
|
||||
adpa = ADPA_HOTPLUG_BITS;
|
||||
if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
|
||||
adpa |= ADPA_HSYNC_ACTIVE_HIGH;
|
||||
if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
|
||||
|
@ -157,53 +176,44 @@ static void intel_crt_mode_set(struct drm_encoder *encoder,
|
|||
static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct intel_crt *crt = intel_attached_crt(connector);
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
u32 adpa, temp;
|
||||
u32 adpa;
|
||||
bool ret;
|
||||
bool turn_off_dac = false;
|
||||
|
||||
temp = adpa = I915_READ(PCH_ADPA);
|
||||
/* The first time through, trigger an explicit detection cycle */
|
||||
if (crt->force_hotplug_required) {
|
||||
bool turn_off_dac = HAS_PCH_SPLIT(dev);
|
||||
u32 save_adpa;
|
||||
|
||||
if (HAS_PCH_SPLIT(dev))
|
||||
turn_off_dac = true;
|
||||
crt->force_hotplug_required = 0;
|
||||
|
||||
adpa &= ~ADPA_CRT_HOTPLUG_MASK;
|
||||
if (turn_off_dac)
|
||||
adpa &= ~ADPA_DAC_ENABLE;
|
||||
save_adpa = adpa = I915_READ(PCH_ADPA);
|
||||
DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);
|
||||
|
||||
/* disable HPD first */
|
||||
I915_WRITE(PCH_ADPA, adpa);
|
||||
(void)I915_READ(PCH_ADPA);
|
||||
adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;
|
||||
if (turn_off_dac)
|
||||
adpa &= ~ADPA_DAC_ENABLE;
|
||||
|
||||
adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 |
|
||||
ADPA_CRT_HOTPLUG_WARMUP_10MS |
|
||||
ADPA_CRT_HOTPLUG_SAMPLE_4S |
|
||||
ADPA_CRT_HOTPLUG_VOLTAGE_50 | /* default */
|
||||
ADPA_CRT_HOTPLUG_VOLREF_325MV |
|
||||
ADPA_CRT_HOTPLUG_ENABLE |
|
||||
ADPA_CRT_HOTPLUG_FORCE_TRIGGER);
|
||||
I915_WRITE(PCH_ADPA, adpa);
|
||||
|
||||
DRM_DEBUG_KMS("pch crt adpa 0x%x", adpa);
|
||||
I915_WRITE(PCH_ADPA, adpa);
|
||||
if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
|
||||
1000))
|
||||
DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER");
|
||||
|
||||
if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
|
||||
1000))
|
||||
DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER");
|
||||
|
||||
if (turn_off_dac) {
|
||||
/* Make sure hotplug is enabled */
|
||||
I915_WRITE(PCH_ADPA, temp | ADPA_CRT_HOTPLUG_ENABLE);
|
||||
(void)I915_READ(PCH_ADPA);
|
||||
if (turn_off_dac) {
|
||||
I915_WRITE(PCH_ADPA, save_adpa);
|
||||
POSTING_READ(PCH_ADPA);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check the status to see if both blue and green are on now */
|
||||
adpa = I915_READ(PCH_ADPA);
|
||||
adpa &= ADPA_CRT_HOTPLUG_MONITOR_MASK;
|
||||
if ((adpa == ADPA_CRT_HOTPLUG_MONITOR_COLOR) ||
|
||||
(adpa == ADPA_CRT_HOTPLUG_MONITOR_MONO))
|
||||
if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)
|
||||
ret = true;
|
||||
else
|
||||
ret = false;
|
||||
DRM_DEBUG_KMS("ironlake hotplug adpa=0x%x, result %d\n", adpa, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -277,13 +287,12 @@ static bool intel_crt_ddc_probe(struct drm_i915_private *dev_priv, int ddc_bus)
|
|||
return i2c_transfer(&dev_priv->gmbus[ddc_bus].adapter, msgs, 1) == 1;
|
||||
}
|
||||
|
||||
static bool intel_crt_detect_ddc(struct drm_encoder *encoder)
|
||||
static bool intel_crt_detect_ddc(struct intel_crt *crt)
|
||||
{
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(encoder);
|
||||
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
|
||||
struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private;
|
||||
|
||||
/* CRT should always be at 0, but check anyway */
|
||||
if (intel_encoder->type != INTEL_OUTPUT_ANALOG)
|
||||
if (crt->base.type != INTEL_OUTPUT_ANALOG)
|
||||
return false;
|
||||
|
||||
if (intel_crt_ddc_probe(dev_priv, dev_priv->crt_ddc_pin)) {
|
||||
|
@ -291,7 +300,7 @@ static bool intel_crt_detect_ddc(struct drm_encoder *encoder)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (intel_ddc_probe(intel_encoder, dev_priv->crt_ddc_pin)) {
|
||||
if (intel_ddc_probe(&crt->base, dev_priv->crt_ddc_pin)) {
|
||||
DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
|
||||
return true;
|
||||
}
|
||||
|
@ -300,9 +309,9 @@ static bool intel_crt_detect_ddc(struct drm_encoder *encoder)
|
|||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
intel_crt_load_detect(struct drm_crtc *crtc, struct intel_encoder *intel_encoder)
|
||||
intel_crt_load_detect(struct drm_crtc *crtc, struct intel_crt *crt)
|
||||
{
|
||||
struct drm_encoder *encoder = &intel_encoder->base;
|
||||
struct drm_encoder *encoder = &crt->base.base;
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
||||
|
@ -434,7 +443,7 @@ static enum drm_connector_status
|
|||
intel_crt_detect(struct drm_connector *connector, bool force)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct intel_encoder *encoder = intel_attached_encoder(connector);
|
||||
struct intel_crt *crt = intel_attached_crt(connector);
|
||||
struct drm_crtc *crtc;
|
||||
int dpms_mode;
|
||||
enum drm_connector_status status;
|
||||
|
@ -443,28 +452,31 @@ intel_crt_detect(struct drm_connector *connector, bool force)
|
|||
if (intel_crt_detect_hotplug(connector)) {
|
||||
DRM_DEBUG_KMS("CRT detected via hotplug\n");
|
||||
return connector_status_connected;
|
||||
} else
|
||||
} else {
|
||||
DRM_DEBUG_KMS("CRT not detected via hotplug\n");
|
||||
return connector_status_disconnected;
|
||||
}
|
||||
}
|
||||
|
||||
if (intel_crt_detect_ddc(&encoder->base))
|
||||
if (intel_crt_detect_ddc(crt))
|
||||
return connector_status_connected;
|
||||
|
||||
if (!force)
|
||||
return connector->status;
|
||||
|
||||
/* for pre-945g platforms use load detect */
|
||||
if (encoder->base.crtc && encoder->base.crtc->enabled) {
|
||||
status = intel_crt_load_detect(encoder->base.crtc, encoder);
|
||||
crtc = crt->base.base.crtc;
|
||||
if (crtc && crtc->enabled) {
|
||||
status = intel_crt_load_detect(crtc, crt);
|
||||
} else {
|
||||
crtc = intel_get_load_detect_pipe(encoder, connector,
|
||||
crtc = intel_get_load_detect_pipe(&crt->base, connector,
|
||||
NULL, &dpms_mode);
|
||||
if (crtc) {
|
||||
if (intel_crt_detect_ddc(&encoder->base))
|
||||
if (intel_crt_detect_ddc(crt))
|
||||
status = connector_status_connected;
|
||||
else
|
||||
status = intel_crt_load_detect(crtc, encoder);
|
||||
intel_release_load_detect_pipe(encoder,
|
||||
status = intel_crt_load_detect(crtc, crt);
|
||||
intel_release_load_detect_pipe(&crt->base,
|
||||
connector, dpms_mode);
|
||||
} else
|
||||
status = connector_status_unknown;
|
||||
|
@ -536,17 +548,17 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = {
|
|||
void intel_crt_init(struct drm_device *dev)
|
||||
{
|
||||
struct drm_connector *connector;
|
||||
struct intel_encoder *intel_encoder;
|
||||
struct intel_crt *crt;
|
||||
struct intel_connector *intel_connector;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
intel_encoder = kzalloc(sizeof(struct intel_encoder), GFP_KERNEL);
|
||||
if (!intel_encoder)
|
||||
crt = kzalloc(sizeof(struct intel_crt), GFP_KERNEL);
|
||||
if (!crt)
|
||||
return;
|
||||
|
||||
intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
|
||||
if (!intel_connector) {
|
||||
kfree(intel_encoder);
|
||||
kfree(crt);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -554,20 +566,20 @@ void intel_crt_init(struct drm_device *dev)
|
|||
drm_connector_init(dev, &intel_connector->base,
|
||||
&intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
|
||||
|
||||
drm_encoder_init(dev, &intel_encoder->base, &intel_crt_enc_funcs,
|
||||
drm_encoder_init(dev, &crt->base.base, &intel_crt_enc_funcs,
|
||||
DRM_MODE_ENCODER_DAC);
|
||||
|
||||
intel_connector_attach_encoder(intel_connector, intel_encoder);
|
||||
intel_connector_attach_encoder(intel_connector, &crt->base);
|
||||
|
||||
intel_encoder->type = INTEL_OUTPUT_ANALOG;
|
||||
intel_encoder->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
|
||||
(1 << INTEL_ANALOG_CLONE_BIT) |
|
||||
(1 << INTEL_SDVO_LVDS_CLONE_BIT);
|
||||
intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
|
||||
crt->base.type = INTEL_OUTPUT_ANALOG;
|
||||
crt->base.clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT |
|
||||
1 << INTEL_ANALOG_CLONE_BIT |
|
||||
1 << INTEL_SDVO_LVDS_CLONE_BIT);
|
||||
crt->base.crtc_mask = (1 << 0) | (1 << 1);
|
||||
connector->interlace_allowed = 1;
|
||||
connector->doublescan_allowed = 0;
|
||||
|
||||
drm_encoder_helper_add(&intel_encoder->base, &intel_crt_helper_funcs);
|
||||
drm_encoder_helper_add(&crt->base.base, &intel_crt_helper_funcs);
|
||||
drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
|
||||
|
||||
drm_sysfs_connector_add(connector);
|
||||
|
@ -577,5 +589,22 @@ void intel_crt_init(struct drm_device *dev)
|
|||
else
|
||||
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
|
||||
|
||||
/*
|
||||
* Configure the automatic hotplug detection stuff
|
||||
*/
|
||||
crt->force_hotplug_required = 0;
|
||||
if (HAS_PCH_SPLIT(dev)) {
|
||||
u32 adpa;
|
||||
|
||||
adpa = I915_READ(PCH_ADPA);
|
||||
adpa &= ~ADPA_CRT_HOTPLUG_MASK;
|
||||
adpa |= ADPA_HOTPLUG_BITS;
|
||||
I915_WRITE(PCH_ADPA, adpa);
|
||||
POSTING_READ(PCH_ADPA);
|
||||
|
||||
DRM_DEBUG_KMS("pch crt adpa set to 0x%x\n", adpa);
|
||||
crt->force_hotplug_required = 1;
|
||||
}
|
||||
|
||||
dev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS;
|
||||
}
|
||||
|
|
|
@ -1611,6 +1611,18 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
|
|||
|
||||
wait_event(dev_priv->pending_flip_queue,
|
||||
atomic_read(&obj_priv->pending_flip) == 0);
|
||||
|
||||
/* Big Hammer, we also need to ensure that any pending
|
||||
* MI_WAIT_FOR_EVENT inside a user batch buffer on the
|
||||
* current scanout is retired before unpinning the old
|
||||
* framebuffer.
|
||||
*/
|
||||
ret = i915_gem_object_flush_gpu(obj_priv, false);
|
||||
if (ret) {
|
||||
i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue