* Re: [PATCH 4/5] Convert PowerPC MPC i2c to of_platform_driver from platform_driver
From: Jon Smirl @ 2008-01-02 19:49 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: Scott Wood, linuxppc-dev
In-Reply-To: <477BE8F8.9030804@scram.de>
On 1/2/08, Jochen Friedrich <jochen@scram.de> wrote:
>
> Should this go into some central file? Else we would have to copy it in any i2c bus driver that supports powerpc.
> This would at least be i2c-cpm and i2c-gpio.
I can change that in the next rev. I'm waiting to see if there are any
more changes.
> IMHO, there should be a node attribute to override i2c_adapter.class. Legacy i2c drivers (in particular v4l and dvb drivers) use this class to decide which adapter to bind to. dbox2 needs I2C_CLASS_TV_DIGITAL (4).
I hadn't paid any attention to i2c_adapter.class. Now that you mention
it I wonder why i2c has it. It appears to be a holdover from the
older mechanism of searching for devices and it is used as a filter to
reduce the number of device being searched. I would think a new style
driver could just ignore it.
It is probably best to fix it in a successive patch.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: [PATCH 4/5] Convert PowerPC MPC i2c to of_platform_driver from platform_driver
From: Jochen Friedrich @ 2008-01-02 19:41 UTC (permalink / raw)
To: Jon Smirl; +Cc: Scott Wood, linuxppc-dev
In-Reply-To: <20071220044144.20091.35917.stgit@terra.home>
Hi Jon,
> Convert MPC i2c driver from being a platform_driver to an open firmware version. Error returns were improved. Routine names were changed from fsl_ to mpc_ to make them match the file name
I did the same for my i2c-cpm. Tested with the frontprocessor driver (dbox2 specific) converted to new style. I'll post the new i2c-cpm, as well.
> +static void of_register_i2c_devices(struct i2c_adapter *adap, struct device_node *adap_node)
> +{
> + struct device_node *node = NULL;
> +
> + while ((node = of_get_next_child(adap_node, node))) {
> + struct i2c_board_info info;
> + const u32 *addr;
> + const char *compatible;
> + int len;
> +
> + addr = of_get_property(node, "reg", &len);
> + if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
> + printk(KERN_ERR "i2c-mpc.c: invalid entry, missing reg attribute\n");
> + continue;
> + }
> +
> + info.irq = irq_of_parse_and_map(node, 0);
> + if (info.irq == NO_IRQ)
> + info.irq = -1;
> +
> + compatible = of_get_property(node, "compatible", &len);
> + if (!compatible) {
> + printk(KERN_ERR "i2c-mpc.c: invalid entry, missing compatible attribute\n");
> + continue;
> + }
> +
> + /* need full alias i2c:NOF,vendor,device */
> + strcpy(info.driver_name, I2C_OF_MODULE_PREFIX);
> + strncat(info.driver_name, compatible, sizeof(info.driver_name));
> + request_module(info.driver_name);
> +
> + /* need module alias OF,vendor,device */
> + strcpy(info.driver_name, OF_I2C_PREFIX);
> + strncat(info.driver_name, compatible, sizeof(info.driver_name));
> +
> + info.type[0] = '\0';
> + info.platform_data = NULL;
> + info.addr = *addr;
> +
> + if (!i2c_new_device(adap, &info)) {
> + printk(KERN_ERR "i2c-mpc.c: Failed to load driver for %s\n", info.driver_name);
> + continue;
> + }
> + }
> +}
Should this go into some central file? Else we would have to copy it in any i2c bus driver that supports powerpc.
This would at least be i2c-cpm and i2c-gpio.
> +static int mpc_i2c_probe(struct of_device *op, const struct of_device_id *match)
> +{
> + int result = 0;
> + struct mpc_i2c *i2c;
> +
> + i2c = kzalloc(sizeof(*i2c), GFP_KERNEL);
> + if (!i2c)
> + return -ENOMEM;
> +
> + if (of_get_property(op->node, "dfsrr", NULL))
> + i2c->flags |= FSL_I2C_DEV_SEPARATE_DFSRR;
> +
> + if (of_device_is_compatible(op->node, "mpc5200-i2c"))
> + i2c->flags |= FSL_I2C_DEV_CLOCK_5200;
> +
> + init_waitqueue_head(&i2c->queue);
> +
> + i2c->base = of_iomap(op->node, 0);
> + if (!i2c->base) {
> + printk(KERN_ERR "i2c-mpc - failed to map controller\n");
> + result = -ENOMEM;
> + goto fail_map;
> + }
> +
> + i2c->irq = irq_of_parse_and_map(op->node, 0);
> + if (i2c->irq == NO_IRQ) {
> + result = -ENXIO;
> + goto fail_irq;
> + }
> +
> + result = request_irq(i2c->irq, mpc_i2c_isr, IRQF_SHARED, "i2c-mpc", i2c);
> + if (result < 0) {
> + printk(KERN_ERR "i2c-mpc - failed to attach interrupt\n");
> + goto fail_request;
> + }
> +
> + mpc_i2c_setclock(i2c);
> +
> + dev_set_drvdata(&op->dev, i2c);
> +
> + i2c->adap = mpc_ops;
> + i2c_set_adapdata(&i2c->adap, i2c);
> + i2c->adap.dev.parent = &op->dev;
> +
> + result = i2c_add_adapter(&i2c->adap);
> + if (result < 0) {
> + printk(KERN_ERR "i2c-mpc - failed to add adapter\n");
> + goto fail_add;
> + }
> +
> + of_register_i2c_devices(&i2c->adap, op->node);
> +
> + return result;
> +
> +fail_add:
> + free_irq(i2c->irq, i2c);
> +fail_request:
> + irq_dispose_mapping(i2c->irq);
> +fail_irq:
> + iounmap(i2c->base);
> +fail_map:
> + kfree(i2c);
> + return result;
> +};
IMHO, there should be a node attribute to override i2c_adapter.class. Legacy i2c drivers (in particular v4l and dvb drivers) use this class to decide which adapter to bind to. dbox2 needs I2C_CLASS_TV_DIGITAL (4).
Thanks,
Jochen
^ permalink raw reply
* [PATCH 5/5] [POWERPC] 8xxx and embedded6xx: Use machine_*_initcall() hooks in platform code
From: Grant Likely @ 2008-01-02 19:33 UTC (permalink / raw)
To: linuxppc-dev, benh, vitb, galak, olof
In-Reply-To: <20080102191135.24178.99973.stgit@trillian.secretlab.ca>
From: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/82xx/mpc8272_ads.c | 5 +----
arch/powerpc/platforms/82xx/pq2fads.c | 5 +----
arch/powerpc/platforms/83xx/mpc832x_mds.c | 5 +----
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 11 ++---------
arch/powerpc/platforms/83xx/mpc834x_mds.c | 5 +----
arch/powerpc/platforms/83xx/mpc836x_mds.c | 5 +----
arch/powerpc/platforms/83xx/mpc837x_mds.c | 5 +----
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 5 +----
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 6 +-----
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 5 +----
arch/powerpc/platforms/8xx/mpc86xads_setup.c | 5 ++---
arch/powerpc/platforms/embedded6xx/ls_uart.c | 5 +----
12 files changed, 14 insertions(+), 53 deletions(-)
diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c
index fd83440..3fce6b3 100644
--- a/arch/powerpc/platforms/82xx/mpc8272_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
@@ -165,14 +165,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
static int __init declare_of_platform_devices(void)
{
- if (!machine_is(mpc8272_ads))
- return 0;
-
/* Publish the QE devices */
of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
}
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc8272_ads, declare_of_platform_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/82xx/pq2fads.c b/arch/powerpc/platforms/82xx/pq2fads.c
index 1be5005..68196e3 100644
--- a/arch/powerpc/platforms/82xx/pq2fads.c
+++ b/arch/powerpc/platforms/82xx/pq2fads.c
@@ -176,14 +176,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
static int __init declare_of_platform_devices(void)
{
- if (!machine_is(pq2fads))
- return 0;
-
/* Publish the QE devices */
of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
}
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(pq2fads, declare_of_platform_devices);
define_machine(pq2fads)
{
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 1e570bb..dbdd4ad 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -110,15 +110,12 @@ static struct of_device_id mpc832x_ids[] = {
static int __init mpc832x_declare_of_platform_devices(void)
{
- if (!machine_is(mpc832x_mds))
- return 0;
-
/* Publish the QE devices */
of_platform_bus_probe(NULL, mpc832x_ids, NULL);
return 0;
}
-device_initcall(mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
static void __init mpc832x_sys_init_IRQ(void)
{
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index ffb2e93..1b57028 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -63,9 +63,6 @@ static struct spi_board_info mpc832x_spi_boardinfo = {
static int __init mpc832x_spi_init(void)
{
- if (!machine_is(mpc832x_rdb))
- return 0;
-
par_io_config_pin(3, 0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
par_io_config_pin(3, 1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
par_io_config_pin(3, 2, 3, 0, 1, 0); /* SPI1 CLK, I/O */
@@ -79,8 +76,7 @@ static int __init mpc832x_spi_init(void)
mpc83xx_spi_activate_cs,
mpc83xx_spi_deactivate_cs);
}
-
-device_initcall(mpc832x_spi_init);
+machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
/* ************************************************************************
*
@@ -123,15 +119,12 @@ static struct of_device_id mpc832x_ids[] = {
static int __init mpc832x_declare_of_platform_devices(void)
{
- if (!machine_is(mpc832x_rdb))
- return 0;
-
/* Publish the QE devices */
of_platform_bus_probe(NULL, mpc832x_ids, NULL);
return 0;
}
-device_initcall(mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
void __init mpc832x_rdb_init_IRQ(void)
{
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 459fb72..2b8a0a3 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -115,13 +115,10 @@ static struct of_device_id mpc834x_ids[] = {
static int __init mpc834x_declare_of_platform_devices(void)
{
- if (!machine_is(mpc834x_mds))
- return 0;
-
of_platform_bus_probe(NULL, mpc834x_ids, NULL);
return 0;
}
-device_initcall(mpc834x_declare_of_platform_devices);
+machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 2ac9890..db491ec 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -141,15 +141,12 @@ static struct of_device_id mpc836x_ids[] = {
static int __init mpc836x_declare_of_platform_devices(void)
{
- if (!machine_is(mpc836x_mds))
- return 0;
-
/* Publish the QE devices */
of_platform_bus_probe(NULL, mpc836x_ids, NULL);
return 0;
}
-device_initcall(mpc836x_declare_of_platform_devices);
+machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
static void __init mpc836x_mds_init_IRQ(void)
{
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 9cdc32b..cfd0548 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -50,15 +50,12 @@ static struct of_device_id mpc837x_ids[] = {
static int __init mpc837x_declare_of_platform_devices(void)
{
- if (!machine_is(mpc837x_mds))
- return 0;
-
/* Publish of_device */
of_platform_bus_probe(NULL, mpc837x_ids, NULL);
return 0;
}
-device_initcall(mpc837x_declare_of_platform_devices);
+machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
static void __init mpc837x_mds_init_IRQ(void)
{
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index bccdc25..a3fa1b0 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -233,13 +233,10 @@ static struct of_device_id __initdata of_bus_ids[] = {
static int __init declare_of_platform_devices(void)
{
- if (!machine_is(mpc85xx_ads))
- return 0;
-
of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
}
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 4d063ee..8b1de78 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -222,9 +222,6 @@ static int mpc85xx_cds_8259_attach(void)
struct device_node *cascade_node = NULL;
int cascade_irq;
- if (!machine_is(mpc85xx_cds))
- return 0;
-
/* Initialize the i8259 controller */
for_each_node_by_type(np, "interrupt-controller")
if (of_device_is_compatible(np, "chrp,iic")) {
@@ -262,8 +259,7 @@ static int mpc85xx_cds_8259_attach(void)
return 0;
}
-
-device_initcall(mpc85xx_cds_8259_attach);
+machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
#endif /* CONFIG_PPC_I8259 */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index e6c63a5..9f4f3aa 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -144,15 +144,12 @@ static struct of_device_id mpc85xx_ids[] = {
static int __init mpc85xx_publish_devices(void)
{
- if (!machine_is(mpc85xx_mds))
- return 0;
-
/* Publish the QE devices */
of_platform_bus_probe(NULL,mpc85xx_ids,NULL);
return 0;
}
-device_initcall(mpc85xx_publish_devices);
+machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices);
static void __init mpc85xx_mds_pic_init(void)
{
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index d2927a4..d7965f8 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -128,12 +128,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
static int __init declare_of_platform_devices(void)
{
- if (machine_is(mpc86x_ads))
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
+ of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
}
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc86x_ads, declare_of_platform_devices);
define_machine(mpc86x_ads) {
.name = "MPC86x ADS",
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index c99264c..9d891bd 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -117,9 +117,6 @@ static int __init ls_uarts_init(void)
phys_addr_t phys_addr;
int len;
- if (!machine_is(linkstation))
- return 0;
-
avr = of_find_node_by_path("/soc10x/serial@80004500");
if (!avr)
return -EINVAL;
@@ -142,4 +139,4 @@ static int __init ls_uarts_init(void)
return 0;
}
-late_initcall(ls_uarts_init);
+machine_late_initcall(linkstation, ls_uarts_init);
^ permalink raw reply related
* [PATCH 4/5] [POWERPC] 8xx: Use machine_*_initcall() hooks in platform code
From: Grant Likely @ 2008-01-02 19:32 UTC (permalink / raw)
To: linuxppc-dev, benh, vitb, galak, olof
In-Reply-To: <20080102191135.24178.99973.stgit@trillian.secretlab.ca>
From: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/8xx/ep88xc.c | 5 ++---
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
index c518b6c..88afa35 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -155,12 +155,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
static int __init declare_of_platform_devices(void)
{
/* Publish the QE devices */
- if (machine_is(ep88xc))
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
+ of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
}
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(ep88xc, declare_of_platform_devices);
define_machine(ep88xc) {
.name = "Embedded Planet EP88xC",
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 2cf1b6a..6ef8e9e 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -264,12 +264,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
static int __init declare_of_platform_devices(void)
{
/* Publish the QE devices */
- if (machine_is(mpc885_ads))
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
+ of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
}
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc885_ads, declare_of_platform_devices);
define_machine(mpc885_ads) {
.name = "Freescale MPC885 ADS",
^ permalink raw reply related
* [PATCH 3/5] [POWERPC] pasemi: Use machine_*_initcall() hooks in platform code
From: Grant Likely @ 2008-01-02 19:32 UTC (permalink / raw)
To: linuxppc-dev, benh, vitb, galak, olof
In-Reply-To: <20080102191135.24178.99973.stgit@trillian.secretlab.ca>
From: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/pasemi/idle.c | 5 +----
arch/powerpc/platforms/pasemi/setup.c | 10 ++--------
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c
index d8e1fcc..43911d8 100644
--- a/arch/powerpc/platforms/pasemi/idle.c
+++ b/arch/powerpc/platforms/pasemi/idle.c
@@ -74,9 +74,6 @@ static int pasemi_system_reset_exception(struct pt_regs *regs)
static int __init pasemi_idle_init(void)
{
- if (!machine_is(pasemi))
- return -ENODEV;
-
#ifndef CONFIG_PPC_PASEMI_CPUFREQ
printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
current_mode = 0;
@@ -88,7 +85,7 @@ static int __init pasemi_idle_init(void)
return 0;
}
-late_initcall(pasemi_idle_init);
+machine_late_initcall(pasemi, pasemi_idle_init);
static int __init idle_param(char *p)
{
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 1940e67..98c7f3b 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -135,9 +135,6 @@ static int __init pas_setup_mce_regs(void)
struct pci_dev *dev;
int reg;
- if (!machine_is(pasemi))
- return -ENODEV;
-
/* Remap various SoC status registers for use by the MCE handler */
reg = 0;
@@ -181,7 +178,7 @@ static int __init pas_setup_mce_regs(void)
return 0;
}
-device_initcall(pas_setup_mce_regs);
+machine_device_initcall(pasemi, pas_setup_mce_regs);
static __init void pas_init_IRQ(void)
{
@@ -405,9 +402,6 @@ static struct of_device_id pasemi_bus_ids[] = {
static int __init pasemi_publish_devices(void)
{
- if (!machine_is(pasemi))
- return 0;
-
pasemi_pcmcia_init();
/* Publish OF platform devices for SDC and other non-PCI devices */
@@ -415,7 +409,7 @@ static int __init pasemi_publish_devices(void)
return 0;
}
-device_initcall(pasemi_publish_devices);
+machine_device_initcall(pasemi, pasemi_publish_devices);
/*
^ permalink raw reply related
* Re: [PATCH 2/5] [POWERPC] cell: Use machine_*_initcall() hooks in platform code
From: Arnd Bergmann @ 2008-01-02 19:25 UTC (permalink / raw)
To: linuxppc-dev; +Cc: olof
In-Reply-To: <20080102191433.24178.68793.stgit@trillian.secretlab.ca>
On Wednesday 02 January 2008, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Looks good, thanks!
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply
* [PATCH 2/5] [POWERPC] cell: Use machine_*_initcall() hooks in platform code
From: Grant Likely @ 2008-01-02 19:14 UTC (permalink / raw)
To: linuxppc-dev, benh, vitb, galak, olof
In-Reply-To: <20080102191135.24178.99973.stgit@trillian.secretlab.ca>
From: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/cell/io-workarounds.c | 5 +----
arch/powerpc/platforms/cell/iommu.c | 7 ++-----
arch/powerpc/platforms/cell/pmu.c | 5 +----
arch/powerpc/platforms/cell/setup.c | 5 +----
arch/powerpc/platforms/celleb/iommu.c | 5 +----
arch/powerpc/platforms/celleb/setup.c | 7 ++-----
6 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
index b86076e..979d4b6 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.c
+++ b/arch/powerpc/platforms/cell/io-workarounds.c
@@ -309,9 +309,6 @@ static int __init spider_pci_workaround_init(void)
{
struct pci_controller *phb;
- if (!machine_is(cell))
- return 0;
-
/* Find spider bridges. We assume they have been all probed
* in setup_arch(). If that was to change, we would need to
* update this code to cope with dynamically added busses
@@ -343,4 +340,4 @@ static int __init spider_pci_workaround_init(void)
return 0;
}
-arch_initcall(spider_pci_workaround_init);
+machine_arch_initcall(cell, spider_pci_workaround_init);
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 1221c6d..bceb5e1 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -700,10 +700,6 @@ static int __init cell_iommu_init(void)
{
struct device_node *np;
- if (!machine_is(cell) &&
- !machine_is(celleb_native))
- return -ENODEV;
-
/* If IOMMU is disabled or we have little enough RAM to not need
* to enable it, we setup a direct mapping.
*
@@ -746,5 +742,6 @@ static int __init cell_iommu_init(void)
return 0;
}
-arch_initcall(cell_iommu_init);
+machine_arch_initcall(cell, cell_iommu_init);
+machine_arch_initcall(celleb_native, cell_iommu_init);
diff --git a/arch/powerpc/platforms/cell/pmu.c b/arch/powerpc/platforms/cell/pmu.c
index 99d688e..69ed0d7 100644
--- a/arch/powerpc/platforms/cell/pmu.c
+++ b/arch/powerpc/platforms/cell/pmu.c
@@ -381,9 +381,6 @@ static int __init cbe_init_pm_irq(void)
unsigned int irq;
int rc, node;
- if (!machine_is(cell))
- return 0;
-
for_each_node(node) {
irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
(node << IIC_IRQ_NODE_SHIFT));
@@ -404,7 +401,7 @@ static int __init cbe_init_pm_irq(void)
return 0;
}
-arch_initcall(cbe_init_pm_irq);
+machine_arch_initcall(cell, cbe_init_pm_irq);
void cbe_sync_irq(int node)
{
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 4f6347c..e6534b5 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -85,9 +85,6 @@ static int __init cell_publish_devices(void)
{
int node;
- if (!machine_is(cell))
- return 0;
-
/* Publish OF platform devices for southbridge IOs */
of_platform_bus_probe(NULL, NULL, NULL);
@@ -101,7 +98,7 @@ static int __init cell_publish_devices(void)
}
return 0;
}
-device_initcall(cell_publish_devices);
+machine_device_initcall(cell, cell_publish_devices);
static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
{
diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c
index fbe718d..41e1e6f 100644
--- a/arch/powerpc/platforms/celleb/iommu.c
+++ b/arch/powerpc/platforms/celleb/iommu.c
@@ -92,9 +92,6 @@ static struct notifier_block celleb_of_bus_notifier = {
static int __init celleb_init_iommu(void)
{
- if (!machine_is(celleb_beat))
- return -ENODEV;
-
celleb_init_direct_mapping();
set_pci_dma_ops(&dma_direct_ops);
bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
@@ -102,4 +99,4 @@ static int __init celleb_init_iommu(void)
return 0;
}
-arch_initcall(celleb_init_iommu);
+machine_arch_initcall(celleb_beat, celleb_init_iommu);
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index 0f0c468..f27ae1e 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -111,10 +111,6 @@ static struct of_device_id celleb_bus_ids[] __initdata = {
static int __init celleb_publish_devices(void)
{
- if (!machine_is(celleb_beat) &&
- !machine_is(celleb_native))
- return -ENODEV;
-
/* Publish OF platform devices for southbridge IOs */
of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
@@ -122,7 +118,8 @@ static int __init celleb_publish_devices(void)
return 0;
}
-device_initcall(celleb_publish_devices);
+machine_device_initcall(celleb_beat, celleb_publish_devices);
+machine_device_initcall(celleb_native, celleb_publish_devices);
/*
^ permalink raw reply related
* [PATCH 1/5] [POWERPC] powermac: Use machine_*_initcall() hooks in platform code
From: Grant Likely @ 2008-01-02 19:14 UTC (permalink / raw)
To: linuxppc-dev, benh, vitb, galak, olof
In-Reply-To: <20080102191135.24178.99973.stgit@trillian.secretlab.ca>
From: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/powermac/low_i2c.c | 7 ++-----
arch/powerpc/platforms/powermac/pfunc_base.c | 3 +--
arch/powerpc/platforms/powermac/pic.c | 3 +--
arch/powerpc/platforms/powermac/setup.c | 12 ++----------
4 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index da2007e..9c9299c 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -1462,9 +1462,6 @@ int __init pmac_i2c_init(void)
return 0;
i2c_inited = 1;
- if (!machine_is(powermac))
- return 0;
-
/* Probe keywest-i2c busses */
kw_i2c_probe();
@@ -1483,7 +1480,7 @@ int __init pmac_i2c_init(void)
return 0;
}
-arch_initcall(pmac_i2c_init);
+machine_arch_initcall(powermac, pmac_i2c_init);
/* Since pmac_i2c_init can be called too early for the platform device
* registration, we need to do it at a later time. In our case, subsys
@@ -1515,4 +1512,4 @@ static int __init pmac_i2c_create_platform_devices(void)
return 0;
}
-subsys_initcall(pmac_i2c_create_platform_devices);
+machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index 45d54b9..db20de5 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -363,8 +363,7 @@ int __init pmac_pfunc_base_install(void)
return 0;
}
-
-arch_initcall(pmac_pfunc_base_install);
+machine_arch_initcall(powermac, pmac_pfunc_base_install);
#ifdef CONFIG_PM
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 999f5e1..cd72164 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -690,6 +690,5 @@ static int __init init_pmacpic_sysfs(void)
sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
return 0;
}
-
-subsys_initcall(init_pmacpic_sysfs);
+machine_subsys_initcall(powermac, init_pmacpic_sysfs);
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index adad4e9..36ff1b6 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -397,17 +397,13 @@ static int initializing = 1;
static int pmac_late_init(void)
{
- if (!machine_is(powermac))
- return -ENODEV;
-
initializing = 0;
/* this is udbg (which is __init) and we can later use it during
* cpu hotplug (in smp_core99_kick_cpu) */
ppc_md.progress = NULL;
return 0;
}
-
-late_initcall(pmac_late_init);
+machine_late_initcall(powermac, pmac_late_init);
/*
* This is __init_refok because we check for "initializing" before
@@ -534,9 +530,6 @@ static int __init pmac_declare_of_platform_devices(void)
if (machine_is(chrp))
return -1;
- if (!machine_is(powermac))
- return 0;
-
np = of_find_node_by_name(NULL, "valkyrie");
if (np)
of_platform_device_create(np, "valkyrie", NULL);
@@ -551,8 +544,7 @@ static int __init pmac_declare_of_platform_devices(void)
return 0;
}
-
-device_initcall(pmac_declare_of_platform_devices);
+machine_device_initcall(powermac, pmac_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
^ permalink raw reply related
* [PATCH 0/5] Make platform code use machine_*_initcall() macros
From: Grant Likely @ 2008-01-02 19:14 UTC (permalink / raw)
To: linuxppc-dev, benh, vitb, galak, olof
This series makes the platform code use the new machine-specific initcall
hooks. This has the advantage of not needing to explicitly test
machine_is() at the top of every initcall function.
This time I split the changes out into separate patches so each platform
maintainer can pick up the ones they are responsible for. Please note;
these are untested as I don't have any of the hardware.
Cheers,
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 2/3] mpc82xx: Embedded Planet EP8248E support
From: Jon Loeliger @ 2008-01-02 19:15 UTC (permalink / raw)
To: Kumar Gala; +Cc: Scott Wood, linuxppc-dev@ozlabs.org
In-Reply-To: <5898D87A-231D-4CCB-9538-808562F08D57@kernel.crashing.org>
On Fri, 2007-12-14 at 10:28, Kumar Gala wrote:
> > Are there any tools to autoconvert (preferably without losing
> > comments)?
>
> Not sure of jon had a perl script or something.
No, I don't. It's hard to tell what should conceptually
remain hex, and what might need to be decimalized.
Sure, hard lists of properties could be done and all...
One can do a "-I dts -O dts" and get it all converted
to /dts-v1/, but with comments dropped on the floor.
Sorry.
jdl
^ permalink raw reply
* Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC
From: Jon Smirl @ 2008-01-02 18:56 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, alsa-devel, Timur Tabi
In-Reply-To: <fa686aa40801021050v7476fe54uc5589092d0661ac5@mail.gmail.com>
On 1/2/08, Grant Likely <grant.likely@secretlab.ca> wrote:
> On 1/2/08, Jon Smirl <jonsmirl@gmail.com> wrote:
> > On 1/2/08, Grant Likely <grant.likely@secretlab.ca> wrote:
> > > > Alternatively, the best place for this device would be on the ASOC
> > > > bus, but the ASOC bus hasn't been created when the platform code runs.
> > > > Maybe I can figure out a place in the platform code to create this
> > > > device after the ASOC driver has loaded and created the bus. Does the
> > > > platform code get control back after loading all of the device
> > > > drivers?
> > >
> > > Yes, but it requires the core ASoC code to not be a module. Then you
> > > can use machine_device_initcall() to register the device at a later
> > > time.
> >
> > How about this for a simpler solution? My mpc5200-psc-ac97 and
> > mpc5200-psc-i2c drivers can create a device on the ASOC bus named
> > after the first entry in the compatible field of the root node. That
> > will cause the correct driver to get activated. I'm in the process of
> > making ASOC drivers dynamically loadable like the i2c ones.
>
> I little icky, but it doesn't sound dangerous (as in shouldn't cause
> any name conflicts). That may be the best we can do for the time
> being. But I don't think it is a good idea for the long term.
Simplest long term fix is to allow drivers to bind on the root node.
Make this work:
> static struct of_device_id fabric_of_match[] = {
> {
> .compatible = "fsl,MPC8610HPCD",
> },
> {},
> };
>
> Cheers,
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
> grant.likely@secretlab.ca
> (403) 399-0195
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC
From: Grant Likely @ 2008-01-02 18:50 UTC (permalink / raw)
To: Jon Smirl; +Cc: linuxppc-dev, alsa-devel, Timur Tabi
In-Reply-To: <9e4733910801021043l7571ea00o7b8072b04ca68ad5@mail.gmail.com>
On 1/2/08, Jon Smirl <jonsmirl@gmail.com> wrote:
> On 1/2/08, Grant Likely <grant.likely@secretlab.ca> wrote:
> > > Alternatively, the best place for this device would be on the ASOC
> > > bus, but the ASOC bus hasn't been created when the platform code runs.
> > > Maybe I can figure out a place in the platform code to create this
> > > device after the ASOC driver has loaded and created the bus. Does the
> > > platform code get control back after loading all of the device
> > > drivers?
> >
> > Yes, but it requires the core ASoC code to not be a module. Then you
> > can use machine_device_initcall() to register the device at a later
> > time.
>
> How about this for a simpler solution? My mpc5200-psc-ac97 and
> mpc5200-psc-i2c drivers can create a device on the ASOC bus named
> after the first entry in the compatible field of the root node. That
> will cause the correct driver to get activated. I'm in the process of
> making ASOC drivers dynamically loadable like the i2c ones.
I little icky, but it doesn't sound dangerous (as in shouldn't cause
any name conflicts). That may be the best we can do for the time
being. But I don't think it is a good idea for the long term.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* File system problem
From: mojtaba @ 2008-01-02 18:50 UTC (permalink / raw)
To: Linuxppc-embedded
Dear all,
I am trying to boot a root file system build by buildroot. But I got this
error" init has generated signal 11 but has no handler for it".
My kernel version is 2.6.24-rc3
My target system is PPC 405 (XILINX VIRTEX II pro) I am using the 26-12-2007
snapshot of buildroot.
This is what I get on terminal:
loaded at: 00400000 004CE1A0
board data at: 004CC120 004CC19C
relocated to: 0040405C 004040D8
zimage at: 00404E94 004CB08A
avail ram: 004CF000 10000000
Linux/PPC load: console=ttyS0,9600 root=/dev/xsa2 init=/bin/sh
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.6.24-rc3 (mojtaba@ubuntu2) (gcc version 4.2.2) #1 Wed Jan 2
14:3
7:58 CET 2008
Xilinx ML300 Reference System (Virtex-II Pro)
Zone PFN ranges:
DMA 0 -> 65536
Normal 65536 -> 65536
HighMem 655
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0 -> 65536
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: console=ttyS0,9600 root=/dev/xsa2 init=/bin/sh
Xilinx INTC #0 at 0x41200000 mapped to 0xEF5FE000
PID hash table entries: 1024 (order: 10, 4096 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 258048k available (1288k kernel code, 436k data, 76k init, 0k
highmem)
Mount-cache hash table entries: 512
net_namespace: 64 bytes
NET: Registered protocol family 16
sysctl table check failed: /kernel/l2cr .1.31 Missing strategy
Call Trace:
[cfc1fe20] [c0008148] show_stack+0x58/0x188 (unreliable)
[cfc1fe68] [c0038908] set_fail+0x50/0x68
[cfc1fe80] [c0038f7c] sysctl_check_table+0x65c/0x6ac
[cfc1fee8] [c0038f8c] sysctl_check_table+0x66c/0x6ac
[cfc1ff50] [c0026c58] register_sysctl_table+0x64/0xb4
[cfc1ff68] [c019ed4c] register_ppc_htab_sysctl+0x18/0x2c
[cfc1ff70] [c019b228] kernel_init+0x104/0x290 [cfc1fff0] [c0004af8]
kernel_thread+0x44/0x60 io scheduler noop registered io scheduler
anticipatory registered io scheduler deadline registered io scheduler cfq
registered (default) Generic RTC Driver v1.07 Macintosh non-volatile memory
driver v1.1
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x40401003 (irq = 2) is a 16550A console [ttyS0]
enabled xsysace xsysace.0: Xilinx SystemACE revision 1.0.12 xsysace
xsysace.0: capacity: 1981728 sectors
xsa: xsa1 xsa2 xsa3
Xilinx SystemACE device driver, major=254
i8042.c: No controller found.
mice: PS/2 mouse device common for all mice
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 76k init
Warning: unable to open an initial console.
init has generated signal 11 but has no handler for it Kernel panic - not
syncing: Attempted to kill init!
Rebooting in 180 seconds..
Regards,
Mojtaba
^ permalink raw reply
* Re: [alsa-devel] [PATCH] ASoC drivers for the Freescale MPC8610 SoC
From: Mark Brown @ 2008-01-02 18:49 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, alsa-devel, Timur Tabi
In-Reply-To: <fa686aa40801020828u5103d09cn2aa5eab7dda2fcff@mail.gmail.com>
On Wed, Jan 02, 2008 at 09:28:12AM -0700, Grant Likely wrote:
> On 1/2/08, Timur Tabi <timur@freescale.com> wrote:
> > However, it doesn't make sense to have a node in the device tree for the
> > fabric driver, because there is no such "device". The fabric driver is
> > an abstraction. So I need to chose some other node to probe the fabric
> > driver with. I chose the SSI, since each SSI can have only one codec.
I'm not sure I'd go so far as to say that the fabric/machine driver is
purely an abstraction. It does represent real hardware, often with
software control.
> Does that mean with ASoC V2 you can instantiate it with the board
> specific platform code instead? I think that is the consensus we were
> leaning towards in the last discussion about this issue.
With ASoC v2 rather than having a single monolithic ASoC device which
probes everything ASoC is converted into a proper subsystem with each
component (codec, SoC CPU port, whatever) having a sysfs-visible driver.
These drivers register with the core as they are probed with the probing
happening through whatever mechanism is appropriate for the driver.
The machine support code (fabric driver in PowerPC terms, I think?)
tells the core how everything is connected together by registering
devices representing the links (eg, I2S) between the codecs, CPU and
other devices. The ASoC core is then responsible for ensuring that all
the required components are present before it registers with the ALSA
core.
^ permalink raw reply
* Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC
From: Jon Smirl @ 2008-01-02 18:43 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, alsa-devel, Timur Tabi
In-Reply-To: <fa686aa40801020922q6fbda176l5fc7c80b5e61281f@mail.gmail.com>
On 1/2/08, Grant Likely <grant.likely@secretlab.ca> wrote:
> > Alternatively, the best place for this device would be on the ASOC
> > bus, but the ASOC bus hasn't been created when the platform code runs.
> > Maybe I can figure out a place in the platform code to create this
> > device after the ASOC driver has loaded and created the bus. Does the
> > platform code get control back after loading all of the device
> > drivers?
>
> Yes, but it requires the core ASoC code to not be a module. Then you
> can use machine_device_initcall() to register the device at a later
> time.
How about this for a simpler solution? My mpc5200-psc-ac97 and
mpc5200-psc-i2c drivers can create a device on the ASOC bus named
after the first entry in the compatible field of the root node. That
will cause the correct driver to get activated. I'm in the process of
making ASOC drivers dynamically loadable like the i2c ones.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* [PATCH] [POWERPC] pasemi: Fix NMI handling check
From: Olof Johansson @ 2008-01-02 18:45 UTC (permalink / raw)
To: linuxppc-dev
[POWERPC] pasemi: Fix NMI handling check
The logic that checks to see if a machine check is caused by an NMI will
always match when NMI hasn't been initialized, since the mpic routine
will return NO_IRQ (and that's what the nmi_virq value is as well).
Signed-off-by: Olof Johansson <olof@lixom.net>
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 1940e67..a89d098 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -264,7 +264,7 @@ static int pas_machine_check_handler(struct pt_regs *regs)
srr0 = regs->nip;
srr1 = regs->msr;
- if (mpic_get_mcirq() == nmi_virq) {
+ if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) {
printk(KERN_ERR "NMI delivered\n");
debugger(regs);
mpic_end_irq(nmi_virq);
^ permalink raw reply related
* Outstanding DTC patches?
From: Jon Loeliger @ 2008-01-02 18:21 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org
Folks,
I'd like to release a DTC 1.1 Real Soon Now!
However, I've been back-logged due to the holidays.
If you have any outstanding DTC or libfdt patches
that I have not yet applied and that you would like
in that release, please remind me by reposting it
and CC:'ing jdl@jdl.com!
Thanks!
jdl
^ permalink raw reply
* Re:
From: rsa @ 2008-01-02 18:16 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 6 bytes --]
What?
[-- Attachment #2: Original Message.B64 --]
[-- Type: application/x-msdownload, Size: 134041 bytes --]
^ permalink raw reply
* Re: [PATCH v2] ucc_uart: add support for Freescale QUICCEngine UART
From: Scott Wood @ 2008-01-02 18:12 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <4776C5EE.70004@freescale.com>
On Sat, Dec 29, 2007 at 04:10:54PM -0600, Timur Tabi wrote:
> Anton Vorontsov wrote:
>
> >> + ucc@2400 {
> >> + device_type = "serial";
> >> + compatible = "ucc_uart";
> >> + model = "UCC";
> >
> > model isn't used, is it needed at all?
>
> I have no idea, but all the other UCC nodes have it, so I'm going to
> keep it. Maybe one day we'll merge QE and CPM drivers, so this would be
> useful.
No, it wouldn't -- that's what compatible is for.
> >> +static struct of_platform_driver ucc_uart_of_driver = {
> >> + .owner = THIS_MODULE,
> >> + .name = "ucc_uart",
> >
> > Maybe better fsl,ucc_uart?
fsl,qe-uart is defined by Documentation/powerpc/booting-without-of.txt.
> The CPM serial driver uses "cpm_uart" and the QE ethernet driver uses
> "ucc_geth", so ucc_uart matches the pattern.
cpm_uart is a legacy match -- the current binding specifies
fsl,cpm1-smc-uart, fsl,cpm2-scc-uart, etc.
-Scott
^ permalink raw reply
* Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC
From: Scott Wood @ 2008-01-02 18:08 UTC (permalink / raw)
To: Timur Tabi; +Cc: Olof Johansson, linuxppc-dev, alsa-devel
In-Reply-To: <476DCECD.6040008@freescale.com>
On Sat, Dec 22, 2007 at 08:58:21PM -0600, Timur Tabi wrote:
> Scott Wood wrote:
>
>>> None of the SOC nodes in any DTS have a "compatible" entry.
>>
>> Not quite true; ep88xc, mpc8272ads, and pq2fads have them.
>
> Ah ok. So what should the compatible entry for 8641 be?
>
> compatible = "fsl,mpc8641"
Yes.
> That looks a lot like what a compatible entry for the CPU should be.
I guess technically the cpu should list something like fsl,e600 (or
whatever suffix is relevant).
-Scott
^ permalink raw reply
* Re: [PATCH/RFC] powerpc: DBox2 Board Support
From: Scott Wood @ 2008-01-02 18:06 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: linuxppc-dev
In-Reply-To: <476D61DB.2090201@scram.de>
On Sat, Dec 22, 2007 at 08:13:31PM +0100, Jochen Friedrich wrote:
> + gtx@0 {
> + compatible = "c-cube,gtx";
> + reg = <400000 3000 0 200000>;
> + interrupts = <2 2>;
> + interrupt-parent = <&PIC>;
> + };
> +
> + fp@0 {
> + compatible = "betaresearch,dbox2-fp";
> + interrupts = <4 2>;
> + interrupt-parent = <&PIC>;
> + gpios = <0 e>;
> + gpio-parent = <&CPM1_PIO>;
> + };
> +
> + fe@0 {
> + compatible = "betaresearch,dbox2-fe";
> + interrupts = <e 2>;
> + interrupt-parent = <&PIC>;
> + };
These unit addresses look wrong.
> + cam@4000000 {
> + compatible = "betaresearch,dbox2-cam";
> + reg = <4000000 20000>;
> + interrupts = <6 2>;
> + interrupt-parent = <&PIC>;
> + gpios = <1 1c 1 1d 1 1e 1 1f>;
> + gpio-parent = <&CPM1_PIO>;
> + };
> +
> + cam@4040000 {
> + compatible = "betaresearch,dbox2-cam";
> + reg = <4040000 20000>;
> + interrupts = <6 2>;
> + interrupt-parent = <&PIC>;
> + gpios = <1 1c 1 1d 1 1e 1 1f>;
> + gpio-parent = <&CPM1_PIO>;
> + };
Maybe gpios should have a length field? Or maybe we should just
phandle to a separate node under the gpio controller node. What happens if
a device sits on two different gpio-parents?
> + flash@8000000 {
> + // Flash also has info about model needed by setup
> + compatible = "cfi-flash",
> + "betaresearch,dbox2-config";
What does dbox2-config mean?
> + ovpartition@20000 {
> + label = "Flash without bootloader";
> + reg = <20000 7e0000>;
> + };
> + ovpartition@0 {
> + label = "Complete Flash";
> + reg = <0 800000>;
> + read-only;
> + };
What is "ovpartition"?
> + wdt@0 {
> + device_type = "watchdog";
> + compatible = "fsl,mpc823-wdt",
> + "fsl,pq1-wdt";
> + reg = <0 10>;
> + };
No device_type.
> + cpm@9c0 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> + reg = <9c0 40>;
> + command-proc = <9c0>;
command-proc is obsolete.
> + muram@2000 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 2000 2000>;
> +
> + data@0 {
> + compatible = "fsl,cpm-muram-data";
> + reg = <0 1c00>;
> + };
> + };
Should have compatible of fsl,cpm-muram on the muram node as well, even
though the current code doesn't use it.
> + // Port D is LCD exclusive. Don't export as GPIO
> + CPM1_PIO: pio@970 {
> + compatible = "fsl,cpm1-pario";
> + reg = <970 180>;
> + num-ports = <3>;
> + #gpio-cells = <2>;
> + };
Why are we doing things differently just because all of the pins on this
port happen to be directed to one device? If it's because the Linux GPIO
API sucks, then either fix the API, or work around the suckage in software,
not the device tree.
> + lcd@970 {
> + reg = <970 10>;
> + compatible = "samsung,ks0713";
> + };
So some driver that matches on samsung,ks0713 has to know the details of the
mpc8xx GPIO registers?
> + brg@9f0 {
> + compatible = "fsl,mpc823-brg",
> + "fsl,cpm1-brg",
> + "fsl,cpm-brg";
> + reg = <9f0 10>;
> + };
Should have clock-frequency in the brg node.
> + i2c@860 {
> + compatible = "fsl,mpc823-i2c",
> + "fsl,cpm1-i2c",
> + "fsl,cpm-i2c";
> + reg = <860 20 3c80 30>;
> + interrupts = <10 3>;
> + interrupt-parent = <&CPM_PIC>;
> + fsl,cpm-command = <0010>;
> + };
Should have #address-cells and #size-cells.
> +enum dbox2_mid dbox2_get_mid(void)
> +{
> + return dbox2_manuf_id;
> +}
> +EXPORT_SYMBOL_GPL(dbox2_get_mid);
Honestly, you're claiming derived-work status by calling a function that
returns an integer, that was read directly from hardware?
> + if (dbox2_manuf_id == DBOX2_MID_NOKIA)
> + np = of_find_node_by_path("/localbus@8000000/enx@0");
> + else
> + np = of_find_node_by_path("/localbus@8000000/gtx@0");
> +
> + if (np) {
> + of_detach_node(np);
> + of_node_put(np);
> + }
> +
> + if (dbox2_manuf_id == DBOX2_MID_PHILIPS)
> + np = of_find_node_by_path("/localbus@8000000/cam@4000000");
> + else
> + np = of_find_node_by_path("/localbus@8000000/cam@4040000");
> +
> + if (np) {
> + of_detach_node(np);
> + of_node_put(np);
> + }
> +}
I'd use separate device trees (I only did this kind of thing in mpc885ads
because it's dip-switchable), but whatever...
> diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h
> index 2be014b..b6fd7d6 100644
> --- a/include/asm-powerpc/mpc8xx.h
> +++ b/include/asm-powerpc/mpc8xx.h
> @@ -23,6 +23,10 @@
> #include <platforms/8xx/mpc885ads.h>
> #endif
>
> +#if defined(CONFIG_DBOX2)
> +#include <platforms/8xx/dbox2.h>
> +#endif
This shouldn't be needed.
-Scott
^ permalink raw reply
* Re: Differences between git tree
From: Jon Loeliger @ 2008-01-02 18:04 UTC (permalink / raw)
To: Bizhan Gholikhamseh (bgholikh); +Cc: linuxppc-embedded@ozlabs.org
In-Reply-To: <F795765B112E7344AF36AA911279641502D1A907@xmb-sjc-212.amer.cisco.com>
On Thu, 2007-12-20 at 07:11, Bizhan Gholikhamseh (bgholikh) wrote:
> Hi,
> Could someone let me know what is the each of these git tree are?
>
> http://opensource.freescale.com/pub/scm/linux-2.6-jdl.git
> AND
> http://www.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
Hrm. I suppose I should answer that one...
Use Paul's tree from kernel.org.
My tree on opensource.freescale.com was my random patches
and crud, being published so others could get a hold of them.
Anything of value there has been moved or integrated into
Paul or Linus' tree by now.
HTH,
jdl
^ permalink raw reply
* Re: [2.6.24 patch] Fix Cell OProfile support
From: Mathieu Desnoyers @ 2008-01-02 17:47 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Randy Dunlap, phil.el, linux-kernel, linuxppc-dev, paulus,
oprofile-list, Adrian Bunk
In-Reply-To: <200712311710.08869.arnd@arndb.de>
* Arnd Bergmann (arnd@arndb.de) wrote:
> On Saturday 29 December 2007, Mathieu Desnoyers wrote:
> > This patch restores the Cell OProfile support that was killed by
> > commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.
> >
> > It puts it in arch/powerpc/Kconfig. Since I don't see any good reason to leave
> > this as a supplementary user-selectable option, it is now automatically enabled
> > whenever SPU_FS and OPROFILE are enabled.
>
> This one has already been superceded by the fix in
> aed3a8c9bb1a8623a618232087c5ff62718e3b9a, which made CONFIG_OPROFILE_CELL an
> automatically selected option, from arch/powerpc/platforms/cell/Kconfig.
>
Great, so my patch should be dropped. Thanks!
Mathieu
> Arnd <><
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply
* Re: [alsa-devel] [PATCH] ASoC drivers for the Freescale MPC8610 SoC
From: Mark Brown @ 2008-01-02 17:23 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, alsa-devel
In-Reply-To: <477BA974.8010308@freescale.com>
On Wed, Jan 02, 2008 at 09:10:44AM -0600, Timur Tabi wrote:
> Jon Smirl wrote:
> > Does this need to be bus-frequency? It's always called MCLK in all of
> > the literature.
> I'm trying to make this node as generic as possible. The fabric driver
> is the one that will parse this node and pass the data to the codec
> driver, so I can't use any codec-specific terms.
> The API from the fabric driver for passing clock information includes a
> clock ID, a direction, and a frequency. I can do something like this:
> clock1 = <0, bb8000>
> Would that be better?
To cover everything you'd need to be able to specify all the clocking
parameters, especially a PLL configuration, and also specify more than
one of each item. Even then you'd still have problems like...
> > In my case the MCLK comes from a chip on the i2c bus that is
> > programmable How would that be encoded?.
> I'm going under the assumption that MCLK does not change once the board
> is up and running. In your case, you'd need to do something quite
> different, because you're not reading the clock info from the device
> tree and passing it to the codec at initialization once. If you want to
> define an extension to the 'codec' child node that handles that, I'll
> add it to the documentation.
According to the documentation in your patch the bus frequency should
already be optional (though I don't immediately see that in the code,
but then I'm entirely unfamiliar with OpenFirmware device trees).
Boards that reconfigure the clocking at run time can then provide
code to set the clocking up at the appropriate times, which is probably
what they want anyway.
^ permalink raw reply
* Re: [PATCH] mpc85xx_ads: add in missing of_node_put()
From: Paul Gortmaker @ 2008-01-02 17:50 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20071223095038.ce1ad7a5.sfr@canb.auug.org.au>
In message: Re: [PATCH] mpc85xx_ads: add in missing of_node_put()
on 23/12/2007 Stephen Rothwell wrote:
> On Fri, 21 Dec 2007 10:40:09 -0500 Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> >
> > cpm2_pic_init() does its own of_node_get() so we should do an of_node_put()
> > before calling it.
>
> The of_node_put() should really go after the call to cpm2_pic_init(), that
> way you retain a raised ref count at all times. Sorry fo not being
> entirely clear before.
No problem. Updated version below.
Thanks,
Paul.
>From eea2826182b4b732ded224240ef9dc89a881ce4b Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Fri, 21 Dec 2007 10:12:38 -0500
Subject: [PATCH] mpc85xx_ads: add in missing of_node_put()
Add in missing of_node_put() after cpm2_pic_init(). This and other coding
style cleanups as suggested by Stephen Rothwell.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index bccdc25..91781a9 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -52,9 +52,9 @@ static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
{
int cascade_irq;
- while ((cascade_irq = cpm2_get_irq()) >= 0) {
+ while ((cascade_irq = cpm2_get_irq()) >= 0)
generic_handle_irq(cascade_irq);
- }
+
desc->chip->eoi(irq);
}
@@ -70,13 +70,12 @@ static void __init mpc85xx_ads_pic_init(void)
#endif
np = of_find_node_by_type(np, "open-pic");
-
- if (np == NULL) {
+ if (!np) {
printk(KERN_ERR "Could not find open-pic node\n");
return;
}
- if(of_address_to_resource(np, 0, &r)) {
+ if (of_address_to_resource(np, 0, &r)) {
printk(KERN_ERR "Could not map mpic register space\n");
of_node_put(np);
return;
@@ -100,6 +99,7 @@ static void __init mpc85xx_ads_pic_init(void)
irq = irq_of_parse_and_map(np, 0);
cpm2_pic_init(np);
+ of_node_put(np);
set_irq_chained_handler(irq, cpm2_cascade);
#endif
}
@@ -112,7 +112,7 @@ struct cpm_pin {
int port, pin, flags;
};
-static struct cpm_pin mpc8560_ads_pins[] = {
+static const struct cpm_pin mpc8560_ads_pins[] = {
/* SCC1 */
{3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
{3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
--
1.5.0.rc1.gf4b6c
^ permalink raw reply related
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