* [PATCH v5 1/3] i2c-mpc: use __devinit[data] for initialization functions and data
From: Wolfgang Grandegger @ 2010-02-01 7:37 UTC (permalink / raw)
To: Linux-i2c
Cc: Devicetree-discuss, Linuxppc-dev, Wolfgang Grandegger, Ben Dooks
In-Reply-To: <1265009836-26398-1-git-send-email-wg@grandegger.com>
From: Wolfgang Grandegger <wg@denx.de>
"__devinit[data]" has not yet been used for all initialization functions
and data. To avoid truncating lines, the struct "mpc_i2c_match_data" has
been renamed to "mpc_i2c_data", which is even the better name.
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
---
drivers/i2c/busses/i2c-mpc.c | 103 +++++++++++++++++++----------------------
1 files changed, 48 insertions(+), 55 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index f627001..275ebe6 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -66,7 +66,7 @@ struct mpc_i2c_divider {
u16 fdr; /* including dfsrr */
};
-struct mpc_i2c_match_data {
+struct mpc_i2c_data {
void (*setclock)(struct device_node *node,
struct mpc_i2c *i2c,
u32 clock, u32 prescaler);
@@ -165,7 +165,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
}
#ifdef CONFIG_PPC_MPC52xx
-static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
+static const struct __devinitdata mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
{20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23},
{28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02},
{36, 0x26}, {40, 0x27}, {44, 0x04}, {48, 0x28},
@@ -186,7 +186,8 @@ static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
{10240, 0x9d}, {12288, 0x9e}, {15360, 0x9f}
};
-int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
+static int __devinit mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock,
+ int prescaler)
{
const struct mpc_i2c_divider *div = NULL;
unsigned int pvr = mfspr(SPRN_PVR);
@@ -215,9 +216,9 @@ int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
return div ? (int)div->fdr : -EINVAL;
}
-static void mpc_i2c_setclock_52xx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
int ret, fdr;
@@ -230,15 +231,15 @@ static void mpc_i2c_setclock_52xx(struct device_node *node,
dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr);
}
#else /* !CONFIG_PPC_MPC52xx */
-static void mpc_i2c_setclock_52xx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
}
#endif /* CONFIG_PPC_MPC52xx*/
#ifdef CONFIG_FSL_SOC
-static const struct mpc_i2c_divider mpc_i2c_dividers_8xxx[] = {
+static const struct __devinitdata mpc_i2c_divider mpc_i2c_dividers_8xxx[] = {
{160, 0x0120}, {192, 0x0121}, {224, 0x0122}, {256, 0x0123},
{288, 0x0100}, {320, 0x0101}, {352, 0x0601}, {384, 0x0102},
{416, 0x0602}, {448, 0x0126}, {480, 0x0103}, {512, 0x0127},
@@ -258,7 +259,7 @@ static const struct mpc_i2c_divider mpc_i2c_dividers_8xxx[] = {
{49152, 0x011e}, {61440, 0x011f}
};
-u32 mpc_i2c_get_sec_cfg_8xxx(void)
+static u32 __devinit mpc_i2c_get_sec_cfg_8xxx(void)
{
struct device_node *node = NULL;
u32 __iomem *reg;
@@ -287,7 +288,8 @@ u32 mpc_i2c_get_sec_cfg_8xxx(void)
return val;
}
-int mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock, u32 prescaler)
+static int __devinit mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock,
+ u32 prescaler)
{
const struct mpc_i2c_divider *div = NULL;
u32 divider;
@@ -320,9 +322,9 @@ int mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock, u32 prescaler)
return div ? (int)div->fdr : -EINVAL;
}
-static void mpc_i2c_setclock_8xxx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
int ret, fdr;
@@ -338,9 +340,9 @@ static void mpc_i2c_setclock_8xxx(struct device_node *node,
}
#else /* !CONFIG_FSL_SOC */
-static void mpc_i2c_setclock_8xxx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
}
#endif /* CONFIG_FSL_SOC */
@@ -529,8 +531,8 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
clock = *prop;
if (match->data) {
- struct mpc_i2c_match_data *data =
- (struct mpc_i2c_match_data *)match->data;
+ struct mpc_i2c_data *data =
+ (struct mpc_i2c_data *)match->data;
data->setclock(op->node, i2c, clock, data->prescaler);
} else {
/* Backwards compatibility */
@@ -582,44 +584,35 @@ static int __devexit fsl_i2c_remove(struct of_device *op)
return 0;
};
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_52xx = {
+ .setclock = mpc_i2c_setclock_52xx,
+};
+
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_8313 = {
+ .setclock = mpc_i2c_setclock_8xxx,
+};
+
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_8543 = {
+ .setclock = mpc_i2c_setclock_8xxx,
+ .prescaler = 2,
+};
+
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_8544 = {
+ .setclock = mpc_i2c_setclock_8xxx,
+ .prescaler = 3,
+};
+
static const struct of_device_id mpc_i2c_of_match[] = {
- {.compatible = "mpc5200-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_52xx,
- },
- },
- {.compatible = "fsl,mpc5200b-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_52xx,
- },
- },
- {.compatible = "fsl,mpc5200-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_52xx,
- },
- },
- {.compatible = "fsl,mpc8313-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_8xxx,
- },
- },
- {.compatible = "fsl,mpc8543-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_8xxx,
- .prescaler = 2,
- },
- },
- {.compatible = "fsl,mpc8544-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_8xxx,
- .prescaler = 3,
- },
+ {.compatible = "mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
+ {.compatible = "fsl,mpc5200b-i2c", .data = &mpc_i2c_data_52xx, },
+ {.compatible = "fsl,mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
+ {.compatible = "fsl,mpc8313-i2c", .data = &mpc_i2c_data_8313, },
+ {.compatible = "fsl,mpc8543-i2c", .data = &mpc_i2c_data_8543, },
+ {.compatible = "fsl,mpc8544-i2c", .data = &mpc_i2c_data_8544, },
/* Backward compatibility */
- },
{.compatible = "fsl-i2c", },
{},
};
-
MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
@@ -634,7 +627,7 @@ static struct of_platform_driver mpc_i2c_driver = {
},
};
-static int __init fsl_i2c_init(void)
+static int __devinit fsl_i2c_init(void)
{
int rv;
@@ -645,7 +638,7 @@ static int __init fsl_i2c_init(void)
return rv;
}
-static void __exit fsl_i2c_exit(void)
+static void __devexit fsl_i2c_exit(void)
{
of_unregister_platform_driver(&mpc_i2c_driver);
}
--
1.6.2.5
^ permalink raw reply related
* [PATCH v5 2/3] i2c-mpc: add support for the MPC512x processors from Freescale
From: Wolfgang Grandegger @ 2010-02-01 7:37 UTC (permalink / raw)
To: Linux-i2c
Cc: Devicetree-discuss, Linuxppc-dev, Wolfgang Grandegger, Ben Dooks
In-Reply-To: <1265009836-26398-2-git-send-email-wg@grandegger.com>
From: Wolfgang Grandegger <wg@denx.de>
The "setclock" initialization functions have been renamed to "setup"
because I2C interrupts must be enabled for the MPC512x. This requires
to handle "fsl,preserve-clocking" in a slighly different way. Also,
the old settings are now reported calling dev_dbg(). For the MPC512x
the clock setup function of the MPC52xx can be re-used. Furthermore,
the Kconfig help has been updated and corrected.
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
---
drivers/i2c/busses/Kconfig | 7 +-
drivers/i2c/busses/i2c-mpc.c | 131 ++++++++++++++++++++++++++++++------------
2 files changed, 96 insertions(+), 42 deletions(-)
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 5f318ce..5477e41 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -418,13 +418,12 @@ config I2C_IXP2000
instead.
config I2C_MPC
- tristate "MPC107/824x/85xx/52xx/86xx"
+ tristate "MPC107/824x/85xx/512x/52xx/83xx/86xx"
depends on PPC32
help
If you say yes to this option, support will be included for the
- built-in I2C interface on the MPC107/Tsi107/MPC8240/MPC8245 and
- MPC85xx/MPC8641 family processors. The driver may also work on 52xx
- family processors, though interrupts are known not to work.
+ built-in I2C interface on the MPC107, Tsi107, MPC512x, MPC52xx,
+ MPC8240, MPC8245, MPC83xx, MPC85xx and MPC8641 family processors.
This driver can also be built as a module. If so, the module
will be called i2c-mpc.
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 275ebe6..3a351c5 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -31,6 +31,9 @@
#define DRV_NAME "mpc-i2c"
+#define MPC_I2C_CLOCK_SAFE 0
+#define MPC_I2C_CLOCK_PRESERVE (~0U)
+
#define MPC_I2C_FDR 0x04
#define MPC_I2C_CR 0x08
#define MPC_I2C_SR 0x0c
@@ -67,9 +70,8 @@ struct mpc_i2c_divider {
};
struct mpc_i2c_data {
- void (*setclock)(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler);
+ void (*setup)(struct device_node *node, struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler);
u32 prescaler;
};
@@ -164,7 +166,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
return 0;
}
-#ifdef CONFIG_PPC_MPC52xx
+#if defined(CONFIG_PPC_MPC52xx) || defined(CONFIG_PPC_MPC512x)
static const struct __devinitdata mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
{20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23},
{28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02},
@@ -194,7 +196,7 @@ static int __devinit mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock,
u32 divider;
int i;
- if (!clock)
+ if (clock == MPC_I2C_CLOCK_SAFE)
return -EINVAL;
/* Determine divider value */
@@ -216,12 +218,18 @@ static int __devinit mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock,
return div ? (int)div->fdr : -EINVAL;
}
-static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setup_52xx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
int ret, fdr;
+ if (clock == MPC_I2C_CLOCK_PRESERVE) {
+ dev_dbg(i2c->dev, "using fdr %d\n",
+ readb(i2c->base + MPC_I2C_FDR));
+ return;
+ }
+
ret = mpc_i2c_get_fdr_52xx(node, clock, prescaler);
fdr = (ret >= 0) ? ret : 0x3f; /* backward compatibility */
@@ -230,13 +238,49 @@ static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
if (ret >= 0)
dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr);
}
-#else /* !CONFIG_PPC_MPC52xx */
-static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+#else /* !(CONFIG_PPC_MPC52xx || CONFIG_PPC_MPC512x) */
+static void __devinit mpc_i2c_setup_52xx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
+{
+}
+#endif /* CONFIG_PPC_MPC52xx || CONFIG_PPC_MPC512x */
+
+#ifdef CONFIG_PPC_MPC512x
+static void __devinit mpc_i2c_setup_512x(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
+{
+ struct device_node *node_ctrl;
+ void __iomem *ctrl;
+ const u32 *pval;
+ u32 idx;
+
+ /* Enable I2C interrupts for mpc5121 */
+ node_ctrl = of_find_compatible_node(NULL, NULL,
+ "fsl,mpc5121-i2c-ctrl");
+ if (node_ctrl) {
+ ctrl = of_iomap(node_ctrl, 0);
+ if (ctrl) {
+ /* Interrupt enable bits for i2c-0/1/2: bit 24/26/28 */
+ pval = of_get_property(node, "reg", NULL);
+ idx = (*pval & 0xff) / 0x20;
+ setbits32(ctrl, 1 << (24 + idx * 2));
+ iounmap(ctrl);
+ }
+ of_node_put(node_ctrl);
+ }
+
+ /* The clock setup for the 52xx works also fine for the 512x */
+ mpc_i2c_setup_52xx(node, i2c, clock, prescaler);
+}
+#else /* CONFIG_PPC_MPC512x */
+static void __devinit mpc_i2c_setup_512x(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
}
-#endif /* CONFIG_PPC_MPC52xx*/
+#endif /* CONFIG_PPC_MPC512x */
#ifdef CONFIG_FSL_SOC
static const struct __devinitdata mpc_i2c_divider mpc_i2c_dividers_8xxx[] = {
@@ -295,7 +339,7 @@ static int __devinit mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock,
u32 divider;
int i;
- if (!clock)
+ if (clock == MPC_I2C_CLOCK_SAFE)
return -EINVAL;
/* Determine proper divider value */
@@ -322,12 +366,19 @@ static int __devinit mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock,
return div ? (int)div->fdr : -EINVAL;
}
-static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setup_8xxx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
int ret, fdr;
+ if (clock == MPC_I2C_CLOCK_PRESERVE) {
+ dev_dbg(i2c->dev, "using dfsrr %d, fdr %d\n",
+ readb(i2c->base + MPC_I2C_DFSRR),
+ readb(i2c->base + MPC_I2C_FDR));
+ return;
+ }
+
ret = mpc_i2c_get_fdr_8xxx(node, clock, prescaler);
fdr = (ret >= 0) ? ret : 0x1031; /* backward compatibility */
@@ -340,9 +391,9 @@ static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
}
#else /* !CONFIG_FSL_SOC */
-static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setup_8xxx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
}
#endif /* CONFIG_FSL_SOC */
@@ -496,7 +547,7 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
{
struct mpc_i2c *i2c;
const u32 *prop;
- u32 clock = 0;
+ u32 clock = MPC_I2C_CLOCK_SAFE;
int result = 0;
int plen;
@@ -525,21 +576,21 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
}
}
- if (!of_get_property(op->node, "fsl,preserve-clocking", NULL)) {
+ if (of_get_property(op->node, "fsl,preserve-clocking", NULL)) {
+ clock = MPC_I2C_CLOCK_PRESERVE;
+ } else {
prop = of_get_property(op->node, "clock-frequency", &plen);
if (prop && plen == sizeof(u32))
clock = *prop;
+ }
- if (match->data) {
- struct mpc_i2c_data *data =
- (struct mpc_i2c_data *)match->data;
- data->setclock(op->node, i2c, clock, data->prescaler);
- } else {
- /* Backwards compatibility */
- if (of_get_property(op->node, "dfsrr", NULL))
- mpc_i2c_setclock_8xxx(op->node, i2c,
- clock, 0);
- }
+ if (match->data) {
+ struct mpc_i2c_data *data = match->data;
+ data->setup(op->node, i2c, clock, data->prescaler);
+ } else {
+ /* Backwards compatibility */
+ if (of_get_property(op->node, "dfsrr", NULL))
+ mpc_i2c_setup_8xxx(op->node, i2c, clock, 0);
}
dev_set_drvdata(&op->dev, i2c);
@@ -584,21 +635,25 @@ static int __devexit fsl_i2c_remove(struct of_device *op)
return 0;
};
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_512x = {
+ .setup = mpc_i2c_setup_512x,
+};
+
static struct mpc_i2c_data __devinitdata mpc_i2c_data_52xx = {
- .setclock = mpc_i2c_setclock_52xx,
+ .setup = mpc_i2c_setup_52xx,
};
static struct mpc_i2c_data __devinitdata mpc_i2c_data_8313 = {
- .setclock = mpc_i2c_setclock_8xxx,
+ .setup = mpc_i2c_setup_8xxx,
};
static struct mpc_i2c_data __devinitdata mpc_i2c_data_8543 = {
- .setclock = mpc_i2c_setclock_8xxx,
+ .setup = mpc_i2c_setup_8xxx,
.prescaler = 2,
};
static struct mpc_i2c_data __devinitdata mpc_i2c_data_8544 = {
- .setclock = mpc_i2c_setclock_8xxx,
+ .setup = mpc_i2c_setup_8xxx,
.prescaler = 3,
};
@@ -606,6 +661,7 @@ static const struct of_device_id mpc_i2c_of_match[] = {
{.compatible = "mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
{.compatible = "fsl,mpc5200b-i2c", .data = &mpc_i2c_data_52xx, },
{.compatible = "fsl,mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
+ {.compatible = "fsl,mpc5121-i2c", .data = &mpc_i2c_data_512x, },
{.compatible = "fsl,mpc8313-i2c", .data = &mpc_i2c_data_8313, },
{.compatible = "fsl,mpc8543-i2c", .data = &mpc_i2c_data_8543, },
{.compatible = "fsl,mpc8544-i2c", .data = &mpc_i2c_data_8544, },
@@ -615,7 +671,6 @@ static const struct of_device_id mpc_i2c_of_match[] = {
};
MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
-
/* Structure for a device driver */
static struct of_platform_driver mpc_i2c_driver = {
.match_table = mpc_i2c_of_match,
@@ -648,5 +703,5 @@ module_exit(fsl_i2c_exit);
MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>");
MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and "
- "MPC824x/85xx/52xx processors");
+ "MPC824x/83xx/85xx/86xx/512x/52xx processors");
MODULE_LICENSE("GPL");
--
1.6.2.5
^ permalink raw reply related
* [PATCH v5 3/3] powerpc: doc/dts-bindings: update doc of FSL I2C bindings
From: Wolfgang Grandegger @ 2010-02-01 7:37 UTC (permalink / raw)
To: Linux-i2c
Cc: Devicetree-discuss, Linuxppc-dev, Wolfgang Grandegger, Ben Dooks
In-Reply-To: <1265009836-26398-3-git-send-email-wg@grandegger.com>
From: Wolfgang Grandegger <wg@denx.de>
This patch adds the MPC5121 to the list of supported devices,
enhances the doc of the "clock-frequency" property and removes
the obsolete "cell-index" property from the example nodes.
Furthermore and example for the MPC5121 has been added.
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
---
Documentation/powerpc/dts-bindings/fsl/i2c.txt | 30 +++++++++++++++++++----
1 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
index b6d2e21..2f62dae 100644
--- a/Documentation/powerpc/dts-bindings/fsl/i2c.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
@@ -9,8 +9,9 @@ Recommended properties :
- compatible : compatibility list with 2 entries, the first should
be "fsl,CHIP-i2c" where CHIP is the name of a compatible processor,
- e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one
- should be "fsl-i2c".
+ e.g. mpc8313, mpc8543, mpc8544, mpc5121, mpc5200 or mpc5200b. The
+ second one should be "fsl-i2c". For the mpc5121, an additional node
+ "fsl,mpc5121-i2c-ctrl" is required as shown in the example below.
- interrupts : <a b> where a is the interrupt number and b is a
field that represents an encoding of the sense and level
information for the interrupt. This should be encoded based on
@@ -20,29 +21,46 @@ Recommended properties :
services interrupts for this device.
- fsl,preserve-clocking : boolean; if defined, the clock settings
from the bootloader are preserved (not touched).
- - clock-frequency : desired I2C bus clock frequency in Hz.
+ - clock-frequency : desired I2C bus clock frequency in Hz. If this
+ property and "fsl,preserve-clocking" is not defined, a safe fixed
+ clock divider value is used (resulting in a small clock frequency).
Examples :
+ /* MPC5121 based board */
+ i2c@1740 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "fsl,mpc5121-i2c", "fsl-i2c";
+ reg = <0x1740 0x20>;
+ interrupts = <11 0x8>;
+ interrupt-parent = <&ipic>;
+ clock-frequency = <100000>;
+ };
+
+ i2ccontrol@1760 {
+ compatible = "fsl,mpc5121-i2c-ctrl";
+ reg = <0x1760 0x8>;
+ };
+
+ /* MPC5200B based board */
i2c@3d00 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
- cell-index = <0>;
reg = <0x3d00 0x40>;
interrupts = <2 15 0>;
interrupt-parent = <&mpc5200_pic>;
fsl,preserve-clocking;
};
+ /* MPC8544 base board */
i2c@3100 {
#address-cells = <1>;
#size-cells = <0>;
- cell-index = <1>;
compatible = "fsl,mpc8544-i2c", "fsl-i2c";
reg = <0x3100 0x100>;
interrupts = <43 2>;
interrupt-parent = <&mpic>;
clock-frequency = <400000>;
};
-
--
1.6.2.5
^ permalink raw reply related
* Re: [PATCH 5/5] powerpc: Increase NR_IRQS Kconfig maximum to 32768
From: Gabriel Paubert @ 2010-02-01 9:09 UTC (permalink / raw)
To: Anton Blanchard; +Cc: linuxppc-dev
In-Reply-To: <20100131111403.GP2996@kryten>
On Sun, Jan 31, 2010 at 10:14:03PM +1100, Anton Blanchard wrote:
>
> With dynamic irq descriptors the overhead of a large NR_IRQS is much lower
> than it used to be. With more MSI-X capable adapters and drivers exploiting
> multiple vectors we may as well allow the user to increase it beyond the
> current maximum of 512.
>
> 32768 seems large enough that we'd never have to bump it again (although I bet
> my prediction is horribly wrong). It boot tests OK and the vmlinux footprint
> increase is only around 500kB due to:
Only 1/2 MB?
I'm running Linux on 12 year old PPC machines which have 16MB
or RAM (ok, they are still running an old kernel, but a few
patches like this and they wont't even boot). The kernels
I have are well below 1MB, code+data+bss.
Yes it is configurable, thanks, and 64 is enough for these
machines (8259 plus an MPIC), so it's not that crucial.
What I object to is calling 1/2MB negligible.
Gabriel
^ permalink raw reply
* Re: [resend] Make the kernel accept ePAPR style phandle information
From: Wolfram Sang @ 2010-02-01 10:00 UTC (permalink / raw)
To: Grant Likely, linuxppc-dev, devicetree-discuss
In-Reply-To: <20100201045242.GB8095@yookeroo>
[-- Attachment #1: Type: text/plain, Size: 2410 bytes --]
On Mon, Feb 01, 2010 at 03:52:42PM +1100, David Gibson wrote:
> Grant, I've updated this for your current test-devicetree branch.
> Please apply.
>
> Currently when processing flattened device trees, the kernel expects
> the phandle in a property called "linux,phandle". The ePAPR spec -
> not being Linux specific - instead requires phandles to be encoded in
> a property named simply "phandle". This patch makes the kernel accept
> either form when unflattening the device tree.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>
> Index: working-2.6/drivers/of/fdt.c
> ===================================================================
> --- working-2.6.orig/drivers/of/fdt.c 2010-02-01 15:51:44.000000000 +1100
> +++ working-2.6/drivers/of/fdt.c 2010-02-01 15:51:46.458557615 +1100
> @@ -310,10 +310,19 @@ unsigned long __init unflatten_dt_node(u
> pp = unflatten_dt_alloc(&mem, sizeof(struct property),
> __alignof__(struct property));
> if (allnextpp) {
> - if (strcmp(pname, "linux,phandle") == 0) {
> + /* We accept flattened tree phandles either in
> + * ePAPR-style "phandle" properties, or the
> + * legacy "linux,phandle" properties. If both
> + * appear and have different values, things
> + * will get weird. Don't do that. */
I don't want to be just pedantic, I really think the preferred way of
multi-line comments
/*
* foo
* bar
*/
will help readability a lot here.
> + if ((strcmp(pname, "phandle") == 0)
> + || (strcmp(pname, "linux,phandle") == 0)) {
> if (np->phandle == 0)
> np->phandle = *((u32 *)*p);
> }
> + /* And we process the "ibm,phandle" property
> + * used in pSeries dynamic device tree
> + * stuff */
> if (strcmp(pname, "ibm,phandle") == 0)
> np->phandle = *((u32 *)*p);
> pp->name = pname;
>
> --
> David Gibson | I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
> | _way_ _around_!
> http://www.ozlabs.org/~dgibson
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH 5/5] powerpc: Increase NR_IRQS Kconfig maximum to 32768
From: Benjamin Herrenschmidt @ 2010-02-01 10:04 UTC (permalink / raw)
To: Gabriel Paubert; +Cc: linuxppc-dev, Anton Blanchard
In-Reply-To: <20100201090946.GA22966@iram.es>
On Mon, 2010-02-01 at 10:09 +0100, Gabriel Paubert wrote:
> On Sun, Jan 31, 2010 at 10:14:03PM +1100, Anton Blanchard wrote:
> >
> > With dynamic irq descriptors the overhead of a large NR_IRQS is much lower
> > than it used to be. With more MSI-X capable adapters and drivers exploiting
> > multiple vectors we may as well allow the user to increase it beyond the
> > current maximum of 512.
> >
> > 32768 seems large enough that we'd never have to bump it again (although I bet
> > my prediction is horribly wrong). It boot tests OK and the vmlinux footprint
> > increase is only around 500kB due to:
>
> Only 1/2 MB?
>
> I'm running Linux on 12 year old PPC machines which have 16MB
> or RAM (ok, they are still running an old kernel, but a few
> patches like this and they wont't even boot). The kernels
> I have are well below 1MB, code+data+bss.
>
> Yes it is configurable, thanks, and 64 is enough for these
> machines (8259 plus an MPIC), so it's not that crucial.
>
> What I object to is calling 1/2MB negligible.
Yeah well, all Anton did was to push up the -max- value you can set in
the config, not the default :-)
But yeah, it's not "negligible" per-se.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 1/3] powerpc/pci: Add calls to set_pcie_port_type() and set_pcie_hotplug_bridge()
From: Breno Leitao @ 2010-02-01 13:35 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Linux PCI, linuxppc-dev, Jesse Barnes
In-Reply-To: <1264561803.3601.163.camel@pasglop>
Hi Ben,
Benjamin Herrenschmidt wrote:
> Breno, can you test ? Also if you could give a quick spin to the other ones
> too make sure they don't break anything else, it would be great !
I tested and also asked my team to test and the changes work fine, fixing
the problem. Also, we did a regression test and nothing seem to be broken.
Thanks,
Breno
^ permalink raw reply
* Re: [PATCH] powerpc: Add DMA mask to MPSC serial and network and UART device to serial
From: Corey Minyard @ 2010-02-01 18:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1265000313.8287.25.camel@pasglop>
Benjamin Herrenschmidt wrote:
> On Fri, 2010-01-29 at 18:04 -0600, Corey Minyard wrote:
>
>> From: Corey Minyard <cminyard@mvista.com>
>>
>> The MPSC drivers that use DMA need to set coherent_dma_mask to allow
>> dma_alloc_xxx routines to work properly. Also, the mpsc serial driver
>> needed to set pi->port.dev to register properly. With these fixes,
>> the MPSC drivers seem to work again.
>>
>> Signed-off-by: Corey Minyard <cminyard@mvista.com>
>> ---
>>
>
> Is that enough ? Since 2.6.31 we also need the dma ops to be filled
> properly and obviously that isn't going to happen for random platform
> devices... Or are those initialized elsewhere by your platform code ? In
> which case it might be a good place to also set the coherent mask...
>
That's done in ppc_dflt_bus_notify(), but that didn't seem an appropriate
place to do this. If it is, it's easy enough to add it there, but that
would
mean it would get set for all devices on any type of ppc system.
-corey
> Maybe we should have a more generic way to set the "default" dma
> information (including ops, masks etc...) for use by platform,
> of_platform etc... devices.
>
> Cheers,
> Ben.
>
>
>> I'm not really sure about where to set the coherent_dma_mask, it seems
>> like a more general place would be better but I couldn't find it.
>>
>> Without these, the console stops working after the switchover andantipode
>> the network driver fails to allocate buffers. With these, my board
>> boots up and works fine.
>>
>> Index: linux-2.6.31/drivers/serial/mpsc.c
>> ===================================================================
>> --- linux-2.6.31.orig/drivers/serial/mpsc.c
>> +++ linux-2.6.31/drivers/serial/mpsc.c
>> @@ -2071,6 +2071,9 @@ static int mpsc_drv_probe(struct platfor
>> if (!(rc = mpsc_drv_map_regs(pi, dev))) {
>> mpsc_drv_get_platform_data(pi, dev, dev->id);
>>
>> + dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
>> + pi->port.dev = &dev->dev;
>> +
>> if (!(rc = mpsc_make_ready(pi))) {
>> spin_lock_init(&pi->tx_lock);
>> if (!(rc = uart_add_one_port(&mpsc_reg,
>> Index: linux-2.6.31/drivers/net/mv643xx_eth.c
>> ===================================================================
>> --- linux-2.6.31.orig/drivers/net/mv643xx_eth.c
>> +++ linux-2.6.31/drivers/net/mv643xx_eth.c
>> @@ -2916,7 +2916,7 @@ static int mv643xx_eth_probe(struct plat
>> mp->shared = platform_get_drvdata(pd->shared);
>> mp->base = mp->shared->base + 0x0400 + (pd->port_number << 10);
>> mp->port_num = pd->port_number;
>> -
>> + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
>> mp->dev = dev;
>>
>> set_params(mp, pd);
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>>
>
>
>
^ permalink raw reply
* Re: BSE-IP
From: Dan.Geer @ 2010-02-01 18:08 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
I'm hoping someone can offer some advice on this:
I'm working with an embedded platform that does not pass anything from
firmware. I'm just trying to get some activity out the serial console at
this stage. simpleImage.bseip compiled with the following bseip.dts seems
to freeze before anything is written to the console. I'm assuming the
standard 8xx code will pickup this device tree, and work from there. Is
this correct? Shouldn't I see some output?
/dts-v1/;
/ {
model = "BSEIP";
compatible = "fsl,bseip";
#address-cells = <1>;
#size-cells = <1>;
cpus {
#address-cells = <1>;
#size-cells = <0>;
PowerPC,823@0 {
compatible = "PowerPC,8xx";
device_type = "cpu";
reg = <0x0>;
d-cache-line-size = <8>; // 8 bytes
per line
i-cache-line-size = <8>; // 8 bytes
per line
d-cache-size = <0x0400>; // L1, 1K
i-cache-size = <0x0800>; // L1, 2K
timebase-frequency = <48000000>;
bus-frequency = <48000000>;
clock-frequency = <48000000>;
interrupts = <15 2>;
// decrementer interrupt
interrupt-parent = <&PIC>;
};
};
memory {
device_type = "memory";
reg = <0 0x1000000>;
};
soc@ff000000 {
compatible = "fsl,mpc823", "fsl,pq1-soc";
#address-cells = <1>;
#size-cells = <1>;
device_type = "soc";
ranges = <0 0xff000000 0x00004000>;
reg = <0xff000000 0x4000>;
bus-frequency = <48000000>;
PIC: interrupt-controller@0 {
interrupt-controller;
#interrupt-cells = <2>;
reg = <0 0x24>;
compatible = "fsl,mpc823-pic",
"fsl,pq1-pic";
};
pcmcia@80 {
#address-cells = <3>;
#interrupt-cells = <1>;
#size-cells = <2>;
compatible = "fsl,pq-pcmcia";
device_type = "pcmcia";
reg = <0x80 0x80>;
interrupt-parent = <&PIC>;
interrupts = <13 1>;
};
cpm@9c0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "fsl,mpc823-cpm",
"fsl,cpm1";
command-proc = <0x9c0>;
interrupts = <0>; // cpm error
interrupt
interrupt-parent = <&CPM_PIC>;
reg = <0x9c0 0x40>;
ranges;
muram@2000 {
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x2000
0x2000>;
data@0 {
compatible =
"fsl,cpm-muram-data";
reg = <0
0x1c00>;
};
};
brg@9f0 {
compatible =
"fsl,mpc823-brg",
"fsl,cpm1-brg",
"fsl,cpm-brg";
reg = <0x9f0 0x10>;
clock-frequency =
<48000000>;
};
CPM_PIC: interrupt-controller@930 {
interrupt-controller;
#interrupt-cells = <1>;
interrupts = <5 2 0 2>;
interrupt-parent = <&PIC>;
reg = <0x930 0x20>;
compatible =
"fsl,mpc823-cpm-pic",
"fsl,cpm1-pic";
};
serial@a80 {
device_type = "serial";
compatible =
"fsl,mpc823-smc-uart",
"fsl,cpm1-smc-uart";
reg = <0xa80 0x10 0x3e80
0x40>;
interrupts = <4>;
interrupt-parent =
<&CPM_PIC>;
fsl,cpm-brg = <1>;
fsl,cpm-command = <0x90>;
current-speed = <9600>;
};
serial@a90 {
device_type = "serial";
compatible =
"fsl,mpc823-smc-uart",
"fsl,cpm1-smc-uart";
reg = <0xa90 0x10 0x3f80
0x40>;
interrupts = <3>;
interrupt-parent =
<&CPM_PIC>;
fsl,cpm-brg = <2>;
fsl,cpm-command = <0xd0>;
current-speed = <9600>;
};
ethernet@a20 {
device_type = "network";
compatible =
"fsl,mpc823-scc-enet",
"fsl,cpm1-scc-enet";
reg = <0xa20 0x18 0x3c00
0x100>;
local-mac-address = [ 00
00 00 00 00 00 ];
interrupts = <30>;
interrupt-parent =
<&CPM_PIC>;
fsl,cpm-command = <0x80>;
linux,network-index = <1>;
};
};
};
chosen {
linux,stdout-path = "/soc/cpm/serial@a80";
};
};
^ permalink raw reply
* Re: BSE-IP
From: Scott Wood @ 2010-02-01 18:24 UTC (permalink / raw)
To: Dan.Geer; +Cc: linuxppc-dev
In-Reply-To: <OF7C180968.43598D84-ON852576BD.006286D6-852576BD.0063AC38@faa.gov>
Dan.Geer@faa.gov wrote:
> I'm hoping someone can offer some advice on this:
>
> I'm working with an embedded platform that does not pass anything from
> firmware. I'm just trying to get some activity out the serial console at
> this stage. simpleImage.bseip compiled with the following bseip.dts seems
> to freeze before anything is written to the console. I'm assuming the
> standard 8xx code will pickup this device tree, and work from there. Is
> this correct? Shouldn't I see some output?
Has your firmware already set up the serial port? cpm-serial doesn't make
assumptions about specific addresses, but it does assume that the BRG, pins,
etc. have been set up for the serial port to work.
If this isn't the case, you'll need to do it from a custom bootwrapper platform
file.
> d-cache-line-size = <8>; // 8 bytes
> per line
> i-cache-line-size = <8>; // 8 bytes
> per line
Shouldn't this be 16 bytes?
> soc@ff000000 {
Is this the correct IMMR address for your firmware?
-Scott
^ permalink raw reply
* Re: [PATCH 01/10] arch/powerpc: Fix continuation line formats
From: Joe Perches @ 2010-02-01 18:30 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <1264990574.8287.15.camel@pasglop>
On Mon, 2010-02-01 at 13:16 +1100, Benjamin Herrenschmidt wrote:
> On Sun, 2010-01-31 at 12:02 -0800, Joe Perches wrote:
> > String constants that are continued on subsequent lines with \
> > are not good.
> > Signed-off-by: Joe Perches <joe@perches.com>
> You want me to take that in the powerpc tree ?
Yes please.
> A minor glitch below tho...
> > @@ -349,7 +349,7 @@ static int __init nvram_create_os_partition(void)
> > rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index);
> > if (rc <= 0) {
> > printk(KERN_ERR "nvram_create_os_partition: nvram_write "
> > - "failed (%d)\n", rc);
> > + "failed (%d)\n", rc);
> > return rc;
> > }
>
> The above is objectionable :-)
Can you drop that section or do you need another patch?
^ permalink raw reply
* Re: BSE-IP
From: Dan.Geer @ 2010-02-01 18:59 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <4B671C4D.5070806@freescale.com>
> Has your firmware already set up the serial port? cpm-serial doesn't
make
> assumptions about specific addresses, but it does assume that the BRG,
pins,
> etc. have been set up for the serial port to work.
Yes. Or, so I thought. First, I interrupt the bootstrap with <Esc>. Then,
I load the image into RAM with 'load simpleImage.bseip 200000' then 'go
200000'. All of which is echo'd out the serial console by the firmware.
I assumed that the low-level setups were complete. However, in the old
ppc/boot/m8xx_tty.c there is some initialization for SMC1 and the BRG
(serial_init()). Where should I do this in the new model? Is
platform_specific_init() the right place?
> If this isn't the case, you'll need to do it from a custom bootwrapper
platform
> file.
>
> > d-cache-line-size = <8>; //
8 bytes
> > per line
> > i-cache-line-size = <8>; //
8 bytes
> > per line
>
> Shouldn't this be 16 bytes?
Thanks! I read "4 word boundary" in the manual, and assumed 16bit words.
I fixed this, but same results. I think I have a little more init work
todo.
> > soc@ff000000 {
>
> Is this the correct IMMR address for your firmware?
Yes, this is the correct IMMR address.
Thanks for your help!
Dan
^ permalink raw reply
* Re: BSE-IP
From: Scott Wood @ 2010-02-01 19:06 UTC (permalink / raw)
To: Dan.Geer; +Cc: linuxppc-dev
In-Reply-To: <OF7ADBC091.CA74BF20-ON852576BD.0065FA13-852576BD.00685848@faa.gov>
Dan.Geer@faa.gov wrote:
>> Has your firmware already set up the serial port? cpm-serial doesn't
> make
>> assumptions about specific addresses, but it does assume that the BRG,
> pins,
>> etc. have been set up for the serial port to work.
>
> Yes. Or, so I thought. First, I interrupt the bootstrap with <Esc>. Then,
> I load the image into RAM with 'load simpleImage.bseip 200000' then 'go
> 200000'. All of which is echo'd out the serial console by the firmware.
> I assumed that the low-level setups were complete. However, in the old
> ppc/boot/m8xx_tty.c there is some initialization for SMC1 and the BRG
> (serial_init()). Where should I do this in the new model? Is
> platform_specific_init() the right place?
That'd be the place -- though it's also possible that it is already set up and
the old code simply didn't assume it, and the problem is somewhere else.
If you don't have an external debugger, you may want to dump some registers from
the firmware prompt and determine where it set up the tx ring, and use that for
early debugging.
-Scott
^ permalink raw reply
* powerpc/ps3 Update ps3_defconfig
From: Geoff Levand @ 2010-02-01 19:09 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
Subject: powerpc/ps3 Update ps3_defconfig
Refresh ps3_defconfig to latest kernel sources and change
these kernel config options:
o CONFIG_USB_ANNOUNCE_NEW_DEVICES: n -> y
o CONFIG_USB_EHCI_TT_NEWSCHED: n -> y
o CONFIG_CMDLINE_BOOL: n -> y
o CONFIG_CMDLINE: n -> ""
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
Hi Ben,
Please apply for 2.6.33.
-Geoff
arch/powerpc/configs/ps3_defconfig | 155 ++++++++++++++++++++++++++-----------
1 file changed, 109 insertions(+), 46 deletions(-)
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.31-rc7
-# Mon Aug 24 17:38:50 2009
+# Linux kernel version: 2.6.33-rc6
+# Mon Feb 1 10:18:13 2010
#
CONFIG_PPC64=y
@@ -9,6 +9,7 @@ CONFIG_PPC64=y
# Processor support
#
CONFIG_PPC_BOOK3S_64=y
+# CONFIG_PPC_BOOK3E_64 is not set
CONFIG_PPC_BOOK3S=y
# CONFIG_POWER4_ONLY is not set
CONFIG_POWER3=y
@@ -22,6 +23,7 @@ CONFIG_PPC_STD_MMU_64=y
CONFIG_PPC_MM_SLICES=y
CONFIG_VIRT_CPU_ACCOUNTING=y
CONFIG_PPC_HAVE_PMU_SUPPORT=y
+CONFIG_PPC_PERF_CTRS=y
CONFIG_SMP=y
CONFIG_NR_CPUS=2
CONFIG_64BIT=y
@@ -35,7 +37,9 @@ CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
+CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_IRQ_PER_CPU=y
+CONFIG_NR_IRQS=512
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
@@ -60,6 +64,7 @@ CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
CONFIG_DTC=y
# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
# CONFIG_PPC_DCR_NATIVE is not set
# CONFIG_PPC_DCR_MMIO is not set
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
@@ -86,11 +91,13 @@ CONFIG_POSIX_MQUEUE_SYSCTL=y
#
# RCU Subsystem
#
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_TINY_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=64
+# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=17
# CONFIG_GROUP_SCHED is not set
@@ -108,6 +115,7 @@ CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
+# CONFIG_RD_LZO is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
@@ -128,21 +136,22 @@ CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
-CONFIG_HAVE_PERF_COUNTERS=y
+CONFIG_HAVE_PERF_EVENTS=y
#
-# Performance Counters
+# Kernel Performance Events And Counters
#
+CONFIG_PERF_EVENTS=y
+CONFIG_EVENT_PROFILE=y
# CONFIG_PERF_COUNTERS is not set
+# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
-# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
-CONFIG_MARKERS=y
CONFIG_OPROFILE=m
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
@@ -154,12 +163,14 @@ CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
+CONFIG_HAVE_DMA_API_DEBUG=y
#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
-# CONFIG_SLOW_WORK is not set
+CONFIG_SLOW_WORK=y
+# CONFIG_SLOW_WORK_DEBUG is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
@@ -180,14 +191,41 @@ CONFIG_BLOCK_COMPAT=y
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
-CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_DEFAULT_IOSCHED="cfq"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_SPIN_UNLOCK is not set
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_READ_UNLOCK is not set
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_WRITE_UNLOCK is not set
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
# CONFIG_FREEZER is not set
#
@@ -226,7 +264,6 @@ CONFIG_PPC_CELL=y
#
CONFIG_SPU_FS=m
CONFIG_SPU_FS_64K_LS=y
-# CONFIG_SPU_TRACE is not set
CONFIG_SPU_BASE=y
# CONFIG_PQ2ADS is not set
# CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set
@@ -276,12 +313,15 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
# CONFIG_IRQ_ALL_CPUS is not set
+CONFIG_SPARSE_IRQ=y
# CONFIG_NUMA is not set
+CONFIG_MAX_ACTIVE_REGIONS=256
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SYS_SUPPORTS_HUGETLBFS=y
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -295,13 +335,12 @@ CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
# CONFIG_MEMORY_HOTREMOVE is not set
CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_SPLIT_PTLOCK_CPUS=999999
CONFIG_MIGRATION=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
-CONFIG_HAVE_MLOCK=y
-CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+# CONFIG_KSM is not set
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_MEMORY_PROBE=y
CONFIG_PPC_HAS_HASH_64K=y
@@ -312,11 +351,14 @@ CONFIG_PPC_4K_PAGES=y
CONFIG_FORCE_MAX_ZONEORDER=13
CONFIG_SCHED_SMT=y
CONFIG_PROC_DEVICETREE=y
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
CONFIG_EXTRA_TARGETS=""
CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_VERBOSE is not set
+# CONFIG_HIBERNATION is not set
+# CONFIG_PM_RUNTIME is not set
# CONFIG_SECCOMP is not set
CONFIG_ISA_DMA_API=y
@@ -337,6 +379,7 @@ CONFIG_PAGE_OFFSET=0xc000000000000000
CONFIG_KERNEL_START=0xc000000000000000
CONFIG_PHYSICAL_START=0x00000000
CONFIG_NET=y
+CONFIG_COMPAT_NETLINK_MESSAGES=y
#
# Networking options
@@ -392,6 +435,7 @@ CONFIG_INET6_XFRM_MODE_TUNNEL=y
CONFIG_INET6_XFRM_MODE_BEET=y
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
CONFIG_IPV6_SIT=y
+# CONFIG_IPV6_SIT_6RD is not set
CONFIG_IPV6_NDISC_NODETYPE=y
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
@@ -400,6 +444,7 @@ CONFIG_IPV6_NDISC_NODETYPE=y
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
@@ -445,27 +490,29 @@ CONFIG_BT_HCIBTUSB=m
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
# CONFIG_BT_HCIVHCI is not set
+# CONFIG_BT_MRVL is not set
# CONFIG_AF_RXRPC is not set
CONFIG_WIRELESS=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
CONFIG_CFG80211=m
+# CONFIG_NL80211_TESTMODE is not set
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_DEBUGFS is not set
# CONFIG_WIRELESS_OLD_REGULATORY is not set
-CONFIG_WIRELESS_EXT=y
+CONFIG_CFG80211_WEXT=y
# CONFIG_WIRELESS_EXT_SYSFS is not set
# CONFIG_LIB80211 is not set
CONFIG_MAC80211=m
-CONFIG_MAC80211_DEFAULT_PS=y
-CONFIG_MAC80211_DEFAULT_PS_VALUE=1
-
-#
-# Rate control algorithm selection
-#
CONFIG_MAC80211_RC_PID=y
# CONFIG_MAC80211_RC_MINSTREL is not set
CONFIG_MAC80211_RC_DEFAULT_PID=y
# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
# CONFIG_MAC80211_LEDS is not set
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
@@ -481,6 +528,7 @@ CONFIG_MAC80211_RC_DEFAULT="pid"
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_DEVTMPFS is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
@@ -498,6 +546,10 @@ CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+
+#
+# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
+#
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
@@ -590,31 +642,28 @@ CONFIG_MII=m
# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
# CONFIG_B44 is not set
# CONFIG_KS8842 is not set
+# CONFIG_KS8851_MLL is not set
CONFIG_NETDEV_1000=y
CONFIG_GELIC_NET=y
CONFIG_GELIC_WIRELESS=y
# CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set
# CONFIG_NETDEV_10000 is not set
-
-#
-# Wireless LAN
-#
-# CONFIG_WLAN_PRE80211 is not set
-CONFIG_WLAN_80211=y
-# CONFIG_LIBERTAS is not set
+CONFIG_WLAN=y
# CONFIG_LIBERTAS_THINFIRM is not set
# CONFIG_AT76C50X_USB is not set
# CONFIG_USB_ZD1201 is not set
# CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_RTL8187 is not set
# CONFIG_MAC80211_HWSIM is not set
-# CONFIG_P54_COMMON is not set
-# CONFIG_AR9170_USB is not set
-# CONFIG_HOSTAP is not set
+# CONFIG_ATH_COMMON is not set
# CONFIG_B43 is not set
# CONFIG_B43LEGACY is not set
-# CONFIG_ZD1211RW is not set
+# CONFIG_HOSTAP is not set
+# CONFIG_LIBERTAS is not set
+# CONFIG_P54_COMMON is not set
# CONFIG_RT2X00 is not set
+# CONFIG_WL12XX is not set
+# CONFIG_ZD1211RW is not set
#
# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -666,6 +715,7 @@ CONFIG_SLHC=m
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=m
# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
#
# Userland interfaces
@@ -713,6 +763,7 @@ CONFIG_DEVKMEM=y
#
# Non-8250 serial port support
#
+# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
@@ -736,7 +787,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
# CONFIG_POWER_SUPPLY is not set
# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
-# CONFIG_THERMAL_HWMON is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y
@@ -848,7 +898,6 @@ CONFIG_SND_USB_AUDIO=m
# CONFIG_SOUND_PRIME is not set
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
-# CONFIG_HID_DEBUG is not set
CONFIG_HIDRAW=y
#
@@ -877,6 +926,7 @@ CONFIG_HID_CHERRY=m
CONFIG_HID_EZKEY=m
# CONFIG_HID_KYE is not set
# CONFIG_HID_GYRATION is not set
+CONFIG_HID_TWINHAN=m
# CONFIG_HID_KENSINGTON is not set
CONFIG_HID_LOGITECH=m
# CONFIG_LOGITECH_FF is not set
@@ -902,7 +952,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
-# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
#
# Miscellaneous USB options
@@ -924,12 +974,13 @@ CONFIG_USB_MON=m
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_EHCI_HCD=m
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
-# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
# CONFIG_USB_EHCI_HCD_PPC_OF is not set
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
+# CONFIG_USB_ISP1362_HCD is not set
CONFIG_USB_OHCI_HCD=m
# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1049,7 +1100,9 @@ CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
#
@@ -1078,10 +1131,10 @@ CONFIG_EXT3_FS_XATTR=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
CONFIG_EXT4_FS=y
-# CONFIG_EXT4DEV_COMPAT is not set
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
+# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD=m
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=y
@@ -1094,6 +1147,7 @@ CONFIG_FS_MBCACHE=y
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
@@ -1165,7 +1219,6 @@ CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ROMFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
-# CONFIG_NILFS2_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
@@ -1271,6 +1324,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
+# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
@@ -1309,10 +1363,12 @@ CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_LIST=y
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1325,10 +1381,12 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
+CONFIG_RING_BUFFER_ALLOW_SWAP=y
CONFIG_TRACING=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_DMA_API_DEBUG is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
@@ -1353,13 +1411,16 @@ CONFIG_IRQSTACKS=y
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITYFS is not set
-# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_DEFAULT_SECURITY_SELINUX is not set
+# CONFIG_DEFAULT_SECURITY_SMACK is not set
+# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
CONFIG_CRYPTO=y
#
# Crypto core or helper
#
-# CONFIG_CRYPTO_FIPS is not set
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
@@ -1403,11 +1464,13 @@ CONFIG_CRYPTO_PCBC=m
#
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
+CONFIG_CRYPTO_GHASH=m
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m
^ permalink raw reply
* [PATCH] powerpc: Set the port device in the mpsc serial driver
From: Corey Minyard @ 2010-02-01 19:37 UTC (permalink / raw)
To: linuxppc-dev
From: Corey Minyard <cminyard@mvista.com>
The mpsc serial driver needx to set the port's device tree element
to register properly.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
Index: linux-2.6/drivers/serial/mpsc.c
===================================================================
--- linux-2.6.orig/drivers/serial/mpsc.c
+++ linux-2.6/drivers/serial/mpsc.c
@@ -2070,6 +2070,7 @@ static int mpsc_drv_probe(struct platfor
if (!(rc = mpsc_drv_map_regs(pi, dev))) {
mpsc_drv_get_platform_data(pi, dev, dev->id);
+ pi->port.dev = &dev->dev;
if (!(rc = mpsc_make_ready(pi))) {
spin_lock_init(&pi->tx_lock);
^ permalink raw reply
* [PATCH] powerpc: Add coherent_dma_mask setting to platform devices
From: Corey Minyard @ 2010-02-01 19:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1265000313.8287.25.camel@pasglop>
From: Corey Minyard <cminyard@mvista.com>
DMA ops requires that coherent_dma_mask be set properly for a device,
but this was not being done for platform devices on powerpc. The
MPSC drivers, in particular, need this for both serial and ethernet
or they won't be able to allocate memory.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
How about this patch? It seems to work ok and I suppose this makes
sense. I'll send the uart setting in another patch.
Index: linux-2.6/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/setup-common.c
+++ linux-2.6/arch/powerpc/kernel/setup-common.c
@@ -681,6 +681,7 @@ static int ppc_dflt_bus_notify(struct no
return 0;
set_dma_ops(dev, &dma_direct_ops);
+ pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
return NOTIFY_DONE;
}
^ permalink raw reply
* Re: [resend] Make the kernel accept ePAPR style phandle information
From: Grant Likely @ 2010-02-01 21:20 UTC (permalink / raw)
To: Grant Likely, linuxppc-dev, devicetree-discuss
In-Reply-To: <20100201045242.GB8095@yookeroo>
On Sun, Jan 31, 2010 at 9:52 PM, David Gibson
<david@gibson.dropbear.id.au> wrote:
> Grant, I've updated this for your current test-devicetree branch.
> Please apply.
>
> Currently when processing flattened device trees, the kernel expects
> the phandle in a property called "linux,phandle". =A0The ePAPR spec -
> not being Linux specific - instead requires phandles to be encoded in
> a property named simply "phandle". =A0This patch makes the kernel accept
> either form when unflattening the device tree.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied, thanks.
g.
^ permalink raw reply
* Re: [PATCH 1/4] dts/mpc8569mds: Cleanup tbi phy to support rtbi
From: Grant Likely @ 2010-02-01 21:46 UTC (permalink / raw)
To: Liu Yu; +Cc: netdev, linuxppc-dev, davem
In-Reply-To: <1263456799-3306-1-git-send-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LWNsb2NrLW5hbWUgPSAi
bm9uZSI7Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKB0eC1jbG9jay1uYW1lID0gIm5vbmUiOwo+
IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIHRiaS1oYW5kbGUgPSA8JnRiaTE+Owo+ICsgoCCgIKAg
oCCgIKAgoCCgIKAgoCCgIHRiaS1oYW5kbGUgPSA8JnRiaTg+Owo+IKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgcGh5LWhhbmRsZSA9IDwmcWVfcGh5Nz47Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBw
aHktY29ubmVjdGlvbi10eXBlID0gInNnbWlpIjsKPiCgIKAgoCCgIKAgoCCgIKB9Owo+IC0tCj4g
MS42LjQKPgo+IF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
Cj4gTGludXhwcGMtZGV2IG1haWxpbmcgbGlzdAo+IExpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMu
b3JnCj4gaHR0cHM6Ly9saXN0cy5vemxhYnMub3JnL2xpc3RpbmZvL2xpbnV4cHBjLWRldgo+CgoK
Ci0tIApHcmFudCBMaWtlbHksIEIuU2MuLCBQLkVuZy4KU2VjcmV0IExhYiBUZWNobm9sb2dpZXMg
THRkLgo=
^ permalink raw reply
* Re: [PATCH 2/4] mpc8569mds: Add bscr setting for rtbi mode
From: Grant Likely @ 2010-02-01 21:57 UTC (permalink / raw)
To: Liu Yu; +Cc: netdev, linuxppc-dev, davem
In-Reply-To: <1263456799-3306-2-git-send-email-yu.liu@freescale.com>
On Thu, Jan 14, 2010 at 1:13 AM, Liu Yu <yu.liu@freescale.com> wrote:
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> =A0arch/powerpc/platforms/85xx/mpc85xx_mds.c | =A0 24 +++++++++++++++++++=
+++++
> =A01 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/pla=
tforms/85xx/mpc85xx_mds.c
> index c5028a2..0872e4a 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> @@ -237,6 +237,8 @@ static void __init mpc85xx_mds_setup_arch(void)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else if (machine_is(mpc8569_mds)) {
> =A0#define BCSR7_UCC12_GETHnRST =A0 (0x1 << 2)
> =A0#define BCSR8_UEM_MARVELL_RST =A0(0x1 << 1)
> +#define BCSR_UCC_RGMII =A0 =A0 =A0 =A0 (0x1 << 6)
> +#define BCSR_UCC_RTBI =A0 =A0 =A0 =A0 =A0(0x1 << 5)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/*
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * U-Boot mangles interrup=
t polarity for Marvell PHYs,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * so reset built-in and U=
EM Marvell PHYs, this puts
> @@ -247,6 +249,28 @@ static void __init mpc85xx_mds_setup_arch(void)
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0setbits8(&bcsr_regs[7], BC=
SR7_UCC12_GETHnRST);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0clrbits8(&bcsr_regs[8], BC=
SR8_UEM_MARVELL_RST);
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 for (np =3D NULL; (np =3D o=
f_find_compatible_node(np,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "network",
Don't match on the 'type' field. Replace "network" with NULL and just
rely on "ucc_geth" for matching.
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "ucc_geth")) !=3D NULL;) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const unsig=
ned int *prop;
u32 please.
Also, rather than reusing 'prop' for both char* and u32 values, which
forces you to use ugly casts, use 2 local variables here.
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 int ucc_num=
;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 prop =3D of=
_get_property(np, "cell-index", NULL);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (prop =
=3D=3D NULL)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 continue;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ucc_num =3D=
*prop - 1;
Ugh. No bounds checking...
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 prop =3D of=
_get_property(np, "phy-connection-type", NULL);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (prop =
=3D=3D NULL)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 continue;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (strcmp(=
"rtbi", (const char *)prop) =3D=3D 0)
(This is the ugly cast I was talking about.)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 clrsetbits_8(&bcsr_regs[7 + ucc_num],
...not having bounds checking could result in badness in this array index.
This patch is dangerous as written.
Finally, while using cell-index seems convenient, I think it would be
better to have a lookup table of the index into the BCSR register
block from the UCC base address, which also gives you implicit bounds
checking.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 3/4] ucc_geth: update the tbi-phy setting
From: Grant Likely @ 2010-02-01 22:00 UTC (permalink / raw)
To: Liu Yu; +Cc: netdev, linuxppc-dev, davem
In-Reply-To: <1263456799-3306-3-git-send-email-yu.liu@freescale.com>
On Thu, Jan 14, 2010 at 1:13 AM, Liu Yu <yu.liu@freescale.com> wrote:
> Old method only set tbi-phy for eth0.
>
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> =A0drivers/net/ucc_geth.c | =A0 23 +++++++++++++++--------
> =A01 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index 750d86d..0e72013 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -37,6 +37,7 @@
> =A0#include <asm/qe.h>
> =A0#include <asm/ucc.h>
> =A0#include <asm/ucc_fast.h>
> +#include <asm/machdep.h>
>
> =A0#include "ucc_geth.h"
> =A0#include "fsl_pq_mdio.h"
> @@ -1334,7 +1335,7 @@ static int adjust_enet_interface(struct ucc_geth_pr=
ivate *ugeth)
> =A0 =A0 =A0 =A0struct ucc_geth __iomem *ug_regs;
> =A0 =A0 =A0 =A0struct ucc_fast __iomem *uf_regs;
> =A0 =A0 =A0 =A0int ret_val;
> - =A0 =A0 =A0 u32 upsmr, maccfg2, tbiBaseAddress;
> + =A0 =A0 =A0 u32 upsmr, maccfg2;
> =A0 =A0 =A0 =A0u16 value;
>
> =A0 =A0 =A0 =A0ugeth_vdbg("%s: IN", __func__);
> @@ -1389,14 +1390,20 @@ static int adjust_enet_interface(struct ucc_geth_=
private *ugeth)
> =A0 =A0 =A0 =A0/* Note that this depends on proper setting in utbipar reg=
ister. */
> =A0 =A0 =A0 =A0if ((ugeth->phy_interface =3D=3D PHY_INTERFACE_MODE_TBI) |=
|
> =A0 =A0 =A0 =A0 =A0 =A0(ugeth->phy_interface =3D=3D PHY_INTERFACE_MODE_RT=
BI)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 tbiBaseAddress =3D in_be32(&ug_regs->utbipa=
r);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 tbiBaseAddress &=3D UTBIPAR_PHY_ADDRESS_MAS=
K;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 tbiBaseAddress >>=3D UTBIPAR_PHY_ADDRESS_SH=
IFT;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 value =3D ugeth->phydev->bus->read(ugeth->p=
hydev->bus,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (u8) tbiBas=
eAddress, ENET_TBI_MII_CR);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct ucc_geth_info *ug_info =3D ugeth->ug=
_info;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct phy_device *tbiphy;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!ug_info->tbi_node)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ugeth_warn("TBI mode requir=
es that the device "
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "tree speci=
fy a tbi-handle\n");
Shouldn't the driver avoid calling of_phy_find_device() if this error
path is taken?
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 tbiphy =3D of_phy_find_device(ug_info->tbi_=
node);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!tbiphy)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ugeth_warn("Could not get T=
BI device\n");
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 value =3D phy_read(tbiphy, ENET_TBI_MII_CR)=
;
Ditto here; the code unconditionally tries to read the tbiphy, even if
it isn't there.
Looks wrong.
g.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0value &=3D ~0x1000; =A0 =A0 =A0 /* Turn of=
f autonegotiation */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 ugeth->phydev->bus->write(ugeth->phydev->bu=
s,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (u8) tbiBas=
eAddress, ENET_TBI_MII_CR, value);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 phy_write(tbiphy, ENET_TBI_MII_CR, value);
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0init_check_frame_length_mode(ug_info->lengthCheckRx, &ug_r=
egs->maccfg2);
> --
> 1.6.4
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 1/7] powerpc: Reduce footprint of irq_stat
From: Christoph Hellwig @ 2010-02-01 21:55 UTC (permalink / raw)
To: Anton Blanchard; +Cc: linuxppc-dev
In-Reply-To: <20100201063023.GT2996@kryten>
On Mon, Feb 01, 2010 at 05:30:23PM +1100, Anton Blanchard wrote:
>
> PowerPC is currently using asm-generic/hardirq.h which statically allocates an
> NR_CPUS irq_stat array. Switch to an arch specific implementation which uses
> per cpu data:
>
> On a kernel with NR_CPUS=1024, this saves quite a lot of memory:
>
> text data bss dec hex filename
> 8767938 2944132 1636796 13348866 cbb002 vmlinux.baseline
> 8767779 2944260 1505724 13217763 c9afe3 vmlinux.irq_cpustat
>
> A saving of around 128kB.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: linux-cpumask/arch/powerpc/include/asm/hardirq.h
> ===================================================================
> --- linux-cpumask.orig/arch/powerpc/include/asm/hardirq.h 2010-01-31 22:07:21.037211728 +1100
> +++ linux-cpumask/arch/powerpc/include/asm/hardirq.h 2010-02-01 17:28:56.990963256 +1100
> @@ -1 +1,22 @@
> -#include <asm-generic/hardirq.h>
> +#ifndef _ASM_POWERPC_HARDIRQ_H
> +#define _ASM_POWERPC_HARDIRQ_H
> +
> +#include <linux/threads.h>
> +#include <linux/irq.h>
> +
> +typedef struct {
> + unsigned int __softirq_pending;
> +} ____cacheline_aligned irq_cpustat_t;
No need to bother with an irq_cpustat_t type at all in this case, just
declare a softirq_pending per-cpu variable.
^ permalink raw reply
* [PATCHv2 0/2] Add max CPU nodes field to ibm,client-architecture call
From: Joel Schopp @ 2010-02-01 22:50 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1263501508.4869.133.camel@jschopp-laptop>
Large NUMA machines require Linux to indicate support for more than 64
cpu cores. This is done through the ibm,client-architecture call, and
is documented in the PAPR. There is also another new field added to
indicate that the OS is Linux as a hint for possible future performance
settings.
The first patch attempts to statically initialize the number of
supported cores with NR_CPUS, the maximum Linux could boot if the cpus
did not have multi-threading (SMT). It can overestimate by the factor
of SMT. For instance on Power6 with 2 way SMT it would overestimate by
a factor of 2. The result of this overestimation is that Linux might
not be able boot all the cpus assigned to it, but would still boot
NR_CPUS worth of SMT threads.
The second patch adjusts for SMT by reading the device tree before
unflattening.
I've updated patch 1 from previous comments. Patch 1 can be taken on its
own if Patch 2 seems like overkill.
v2 - Updated patch 2 style and messages. Basic functionality is the
same as v1.
^ permalink raw reply
* [PATCHv2 1/2] Add static fields to ibm,client-architecture call
From: Joel Schopp @ 2010-02-01 22:50 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1263510116.7445.5.camel@jschopp-laptop>
This patch adds 2 fields to the ibm_architecture_vec array.
The first of these fields indicates the number of cores which Linux can
boot. It does not account for SMT, so it may result in cpus assigned to
Linux which cannot be booted. A second patch follows that dynamically
updates this for SMT.
The second field just indicates that our OS is Linux, and not another
OS. The system may or may not use this hint to performance tune
settings for Linux.
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>
---
Index: linux-2.6.git/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-2.6.git.orig/arch/powerpc/kernel/prom_init.c
+++ linux-2.6.git/arch/powerpc/kernel/prom_init.c
@@ -654,6 +656,9 @@ static void __init early_cmdline_parse(v
#define OV5_CMO 0x00
#endif
+/* Option Vector 6: IBM PAPR hints */
+#define OV6_LINUX 0x02 /* Linux is our OS */
+
/*
* The architecture vector has an array of PVR mask/value pairs,
* followed by # option vectors - 1, followed by the option vectors.
@@ -665,7 +670,7 @@ static unsigned char ibm_architecture_ve
W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */
W(0xffffffff), W(0x0f000002), /* all 2.05-compliant */
W(0xfffffffe), W(0x0f000001), /* all 2.04-compliant and earlier */
- 5 - 1, /* 5 option vectors */
+ 6 - 1, /* 6 option vectors */
/* option vector 1: processor architectures supported */
3 - 2, /* length */
@@ -697,12 +702,24 @@ static unsigned char ibm_architecture_ve
0, /* don't halt */
/* option vector 5: PAPR/OF options */
- 5 - 2, /* length */
+ 13 - 2, /* length */
0, /* don't ignore, don't halt */
OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY |
OV5_DONATE_DEDICATE_CPU | OV5_MSI,
0,
OV5_CMO,
+ 0,
+ 0,
+ 0,
+ 0,
+ W(NR_CPUS), /* number of cores supported*/
+
+ /* option vector 6: IBM PAPR hints */
+ 4 - 2, /* length */
+ 0,
+ 0,
+ OV6_LINUX,
+
};
/* Old method - ELF header with PT_NOTE sections */
^ permalink raw reply
* [PATCHv2 2/2] Update ibm,client-architecture call field based on device tree
From: Joel Schopp @ 2010-02-01 22:51 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1263501674.4869.142.camel@jschopp-laptop>
In the previous patch the client-architecture field for the number of
cores supported is set statically as high as is possible. However, that
static setting could be too high if the system supports smt, resulting
in cpus assigned to Linux that are not booted. This patch reads the
device tree (before it is unflattened) to determine the amount of smt.
It then dynamically updates the entires in the array with the proper
number of cores supported. Tests show this correctly detecting SMT4 on
a Power7 and still booting all the supported cores on a large machine.
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>
---
Index: linux-2.6.git/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-2.6.git.orig/arch/powerpc/kernel/prom_init.c
+++ linux-2.6.git/arch/powerpc/kernel/prom_init.c
@@ -807,13 +807,55 @@ static struct fake_elf {
}
};
+static int __init prom_smt_way(void)
+{
+ phandle node;
+ char type[64];
+ unsigned int plen;
+
+ for (node = 0; prom_next_node(&node); ) {
+ type[0] = 0;
+ prom_getprop(node, "device_type", type, sizeof(type));
+
+ if (strcmp(type, RELOC("cpu")))
+ continue;
+
+ /*
+ * There is an entry for each smt thread, each entry being
+ * 4 bytes long. All cpus should have the same number of
+ * smt threads, so return after finding the first.
+ */
+ plen = prom_getproplen(node, "ibm,ppc-interrupt-server#s");
+ prom_printf("smt threads per core %x\n", (unsigned long) plen);
+ if (plen >= 4)
+ return plen / 4;
+ }
+ /*
+ * If things go wrong and we get here fallback to SMT1
+ */
+ prom_debug("unable to determine smt from device tree, guessing smt1\n");
+ return 1;
+
+}
+
+
static void __init prom_send_capabilities(void)
{
ihandle elfloader, root;
prom_arg_t ret;
+ u32 *cores;
root = call_prom("open", 1, 1, ADDR("/"));
if (root != 0) {
+ /*
+ * If you add to the struct, please be sure the 100 index
+ * didn't change. The BUILD_BUG_ON is a reminder.
+ */
+ cores = (u32 *) &ibm_architecture_vec[100];
+ if(*cores != NR_CPUS)
+ prom_printf("client-architecture structure corrupted\n");
+ *cores = (NR_CPUS / prom_smt_way());
+ prom_printf("setting client-architecture cores to %x\n", *cores);
/* try calling the ibm,client-architecture-support method */
prom_printf("Calling ibm,client-architecture-support...");
if (call_prom_ret("call-method", 3, 2, &ret,
^ permalink raw reply
* Re: [PATCH 1/7] powerpc: Reduce footprint of irq_stat
From: Benjamin Herrenschmidt @ 2010-02-01 23:07 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linuxppc-dev, Anton Blanchard
In-Reply-To: <20100201215504.GA17194@lst.de>
On Mon, 2010-02-01 at 22:55 +0100, Christoph Hellwig wrote:
> > +typedef struct {
> > + unsigned int __softirq_pending;
> > +} ____cacheline_aligned irq_cpustat_t;
>
> No need to bother with an irq_cpustat_t type at all in this case, just
> declare a softirq_pending per-cpu variable.
I think his subsequent patches add members to that struct for
CE, MCE etc... stats.
Cheers,
Ben.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox