* [PATCH] Slight refactor of interrupt mapping for FSL parts
From: Andy Fleming @ 2006-10-16 20:57 UTC (permalink / raw)
To: linuxppc-dev, galak; +Cc: Jeff Garzik
* Cleaned up interrupt mapping a little by adding a helper
function which parses the irq out of the device-tree, and puts
it into a resource.
* Changed the PHY Layer to use NO_IRQ instead of -1 for PHY_POLL.
This means that polling will always be used if mapping the
interrupt fails for any reason.
---
arch/powerpc/sysdev/fsl_soc.c | 33 ++++++++++++++++-----------------
include/linux/phy.h | 2 +-
2 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index dbe92ae..aa24b51 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -146,7 +146,7 @@ static int __init gfar_mdio_of_init(void
}
for (k = 0; k < 32; k++)
- mdio_data.irq[k] = -1;
+ mdio_data.irq[k] = NO_IRQ;
while ((child = of_get_next_child(np, child)) != NULL) {
int irq = irq_of_parse_and_map(child, 0);
@@ -177,6 +177,13 @@ static const char *gfar_tx_intr = "tx";
static const char *gfar_rx_intr = "rx";
static const char *gfar_err_intr = "error";
+
+void of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
+{
+ r->start = r->end = irq_of_parse_and_map(dev, index);
+ r->flags = IORESOURCE_IRQ;
+}
+
static int __init gfar_of_init(void)
{
struct device_node *np;
@@ -204,8 +211,7 @@ static int __init gfar_of_init(void)
if (ret)
goto err;
- r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
- r[1].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[1]);
model = get_property(np, "model", NULL);
@@ -214,12 +220,10 @@ static int __init gfar_of_init(void)
r[1].name = gfar_tx_intr;
r[2].name = gfar_rx_intr;
- r[2].start = r[2].end = irq_of_parse_and_map(np, 1);
- r[2].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 1, &r[2]);
r[3].name = gfar_err_intr;
- r[3].start = r[3].end = irq_of_parse_and_map(np, 2);
- r[3].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 2, &r[3]);
n_res += 2;
}
@@ -323,8 +327,7 @@ static int __init fsl_i2c_of_init(void)
if (ret)
goto err;
- r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
- r[1].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[1]);
i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2);
if (IS_ERR(i2c_dev)) {
@@ -459,8 +462,7 @@ static int __init fsl_usb_of_init(void)
if (ret)
goto err;
- r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
- r[1].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[1]);
usb_dev_mph =
platform_device_register_simple("fsl-ehci", i, r, 2);
@@ -507,8 +509,7 @@ static int __init fsl_usb_of_init(void)
if (ret)
goto unreg_mph;
- r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
- r[1].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[1]);
usb_dev_dr =
platform_device_register_simple("fsl-ehci", i, r, 2);
@@ -591,8 +592,7 @@ static int __init fs_enet_of_init(void)
r[2].name = fcc_regs_c;
fs_enet_data.fcc_regs_c = r[2].start;
- r[3].start = r[3].end = irq_of_parse_and_map(np, 0);
- r[3].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[3]);
fs_enet_dev =
platform_device_register_simple("fsl-cpm-fcc", i, &r[0], 4);
@@ -754,8 +754,7 @@ static int __init cpm_uart_of_init(void)
goto err;
r[1].name = scc_pram;
- r[2].start = r[2].end = irq_of_parse_and_map(np, 0);
- r[2].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[2]);
cpm_uart_dev =
platform_device_register_simple("fsl-cpm-scc:uart", i, &r[0], 3);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 9447a57..d7b3751 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -37,7 +37,7 @@ #define PHY_GBIT_FEATURES (PHY_BASIC_FEA
* or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
* the attached driver handles the interrupt
*/
-#define PHY_POLL -1
+#define PHY_POLL NO_IRQ
#define PHY_IGNORE_INTERRUPT -2
#define PHY_HAS_INTERRUPT 0x00000001
--
1.4.2.3
^ permalink raw reply related
* [PATCH] Fixed up the OF functions to only do PCI stuff if PCI is actually configured
From: Andy Fleming @ 2006-10-16 21:03 UTC (permalink / raw)
To: linuxppc-dev, Kumar Gala
The original problem that inspired this patch was solved quite some time
ago (Turning off PCI didn't work), but this patch neatens things up a
little (I think), by putting all the PCI stuff inside a single CONFIG_PCI
block. It also removes the OF PCI bus matching entries if CONFIG_PCI is
off.
---
arch/powerpc/kernel/prom_parse.c | 288 ++++++++++++++++++++------------------
1 files changed, 148 insertions(+), 140 deletions(-)
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 603dff3..346fb7b 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -25,6 +25,12 @@ #define OF_MAX_ADDR_CELLS 4
#define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
(ns) > 0)
+static struct of_bus *of_match_bus(struct device_node *np);
+static int __of_address_to_resource(struct device_node *dev,
+ const u32 *addrp, u64 size, unsigned int flags,
+ struct resource *r);
+
+
/* Debug utility */
#ifdef DEBUG
static void of_dump_addr(const char *s, const u32 *addr, int na)
@@ -101,6 +107,7 @@ static unsigned int of_bus_default_get_f
}
+#ifdef CONFIG_PCI
/*
* PCI bus specific translator
*/
@@ -162,6 +169,145 @@ static unsigned int of_bus_pci_get_flags
return flags;
}
+const u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
+ unsigned int *flags)
+{
+ const u32 *prop;
+ unsigned int psize;
+ struct device_node *parent;
+ struct of_bus *bus;
+ int onesize, i, na, ns;
+
+ /* Get parent & match bus type */
+ parent = of_get_parent(dev);
+ if (parent == NULL)
+ return NULL;
+ bus = of_match_bus(parent);
+ if (strcmp(bus->name, "pci")) {
+ of_node_put(parent);
+ return NULL;
+ }
+ bus->count_cells(dev, &na, &ns);
+ of_node_put(parent);
+ if (!OF_CHECK_COUNTS(na, ns))
+ return NULL;
+
+ /* Get "reg" or "assigned-addresses" property */
+ prop = get_property(dev, bus->addresses, &psize);
+ if (prop == NULL)
+ return NULL;
+ psize /= 4;
+
+ onesize = na + ns;
+ for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++)
+ if ((prop[0] & 0xff) == ((bar_no * 4) + PCI_BASE_ADDRESS_0)) {
+ if (size)
+ *size = of_read_number(prop + na, ns);
+ if (flags)
+ *flags = bus->get_flags(prop);
+ return prop;
+ }
+ return NULL;
+}
+EXPORT_SYMBOL(of_get_pci_address);
+
+int of_pci_address_to_resource(struct device_node *dev, int bar,
+ struct resource *r)
+{
+ const u32 *addrp;
+ u64 size;
+ unsigned int flags;
+
+ addrp = of_get_pci_address(dev, bar, &size, &flags);
+ if (addrp == NULL)
+ return -EINVAL;
+ return __of_address_to_resource(dev, addrp, size, flags, r);
+}
+EXPORT_SYMBOL_GPL(of_pci_address_to_resource);
+
+static u8 of_irq_pci_swizzle(u8 slot, u8 pin)
+{
+ return (((pin - 1) + slot) % 4) + 1;
+}
+
+int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
+{
+ struct device_node *dn, *ppnode;
+ struct pci_dev *ppdev;
+ u32 lspec;
+ u32 laddr[3];
+ u8 pin;
+ int rc;
+
+ /* Check if we have a device node, if yes, fallback to standard OF
+ * parsing
+ */
+ dn = pci_device_to_OF_node(pdev);
+ if (dn)
+ return of_irq_map_one(dn, 0, out_irq);
+
+ /* Ok, we don't, time to have fun. Let's start by building up an
+ * interrupt spec. we assume #interrupt-cells is 1, which is standard
+ * for PCI. If you do different, then don't use that routine.
+ */
+ rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
+ if (rc != 0)
+ return rc;
+ /* No pin, exit */
+ if (pin == 0)
+ return -ENODEV;
+
+ /* Now we walk up the PCI tree */
+ lspec = pin;
+ for (;;) {
+ /* Get the pci_dev of our parent */
+ ppdev = pdev->bus->self;
+
+ /* Ouch, it's a host bridge... */
+ if (ppdev == NULL) {
+#ifdef CONFIG_PPC64
+ ppnode = pci_bus_to_OF_node(pdev->bus);
+#else
+ struct pci_controller *host;
+ host = pci_bus_to_host(pdev->bus);
+ ppnode = host ? host->arch_data : NULL;
+#endif
+ /* No node for host bridge ? give up */
+ if (ppnode == NULL)
+ return -EINVAL;
+ } else
+ /* We found a P2P bridge, check if it has a node */
+ ppnode = pci_device_to_OF_node(ppdev);
+
+ /* Ok, we have found a parent with a device-node, hand over to
+ * the OF parsing code.
+ * We build a unit address from the linux device to be used for
+ * resolution. Note that we use the linux bus number which may
+ * not match your firmware bus numbering.
+ * Fortunately, in most cases, interrupt-map-mask doesn't include
+ * the bus number as part of the matching.
+ * You should still be careful about that though if you intend
+ * to rely on this function (you ship a firmware that doesn't
+ * create device nodes for all PCI devices).
+ */
+ if (ppnode)
+ break;
+
+ /* We can only get here if we hit a P2P bridge with no node,
+ * let's do standard swizzling and try again
+ */
+ lspec = of_irq_pci_swizzle(PCI_SLOT(pdev->devfn), lspec);
+ pdev = ppdev;
+ }
+
+ laddr[0] = (pdev->bus->number << 16)
+ | (pdev->devfn << 8);
+ laddr[1] = laddr[2] = 0;
+ return of_irq_map_raw(ppnode, &lspec, 1, laddr, out_irq);
+}
+EXPORT_SYMBOL_GPL(of_irq_map_pci);
+#endif /* CONFIG_PCI */
+
/*
* ISA bus specific translator
*/
@@ -223,6 +369,7 @@ static unsigned int of_bus_isa_get_flags
*/
static struct of_bus of_busses[] = {
+#ifdef CONFIG_PCI
/* PCI */
{
.name = "pci",
@@ -233,6 +380,7 @@ static struct of_bus of_busses[] = {
.translate = of_bus_pci_translate,
.get_flags = of_bus_pci_get_flags,
},
+#endif /* CONFIG_PCI */
/* ISA */
{
.name = "isa",
@@ -445,48 +593,6 @@ const u32 *of_get_address(struct device_
}
EXPORT_SYMBOL(of_get_address);
-const u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
- unsigned int *flags)
-{
- const u32 *prop;
- unsigned int psize;
- struct device_node *parent;
- struct of_bus *bus;
- int onesize, i, na, ns;
-
- /* Get parent & match bus type */
- parent = of_get_parent(dev);
- if (parent == NULL)
- return NULL;
- bus = of_match_bus(parent);
- if (strcmp(bus->name, "pci")) {
- of_node_put(parent);
- return NULL;
- }
- bus->count_cells(dev, &na, &ns);
- of_node_put(parent);
- if (!OF_CHECK_COUNTS(na, ns))
- return NULL;
-
- /* Get "reg" or "assigned-addresses" property */
- prop = get_property(dev, bus->addresses, &psize);
- if (prop == NULL)
- return NULL;
- psize /= 4;
-
- onesize = na + ns;
- for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++)
- if ((prop[0] & 0xff) == ((bar_no * 4) + PCI_BASE_ADDRESS_0)) {
- if (size)
- *size = of_read_number(prop + na, ns);
- if (flags)
- *flags = bus->get_flags(prop);
- return prop;
- }
- return NULL;
-}
-EXPORT_SYMBOL(of_get_pci_address);
-
static int __of_address_to_resource(struct device_node *dev, const u32 *addrp,
u64 size, unsigned int flags,
struct resource *r)
@@ -529,20 +635,6 @@ int of_address_to_resource(struct device
}
EXPORT_SYMBOL_GPL(of_address_to_resource);
-int of_pci_address_to_resource(struct device_node *dev, int bar,
- struct resource *r)
-{
- const u32 *addrp;
- u64 size;
- unsigned int flags;
-
- addrp = of_get_pci_address(dev, bar, &size, &flags);
- if (addrp == NULL)
- return -EINVAL;
- return __of_address_to_resource(dev, addrp, size, flags, r);
-}
-EXPORT_SYMBOL_GPL(of_pci_address_to_resource);
-
void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
unsigned long *busno, unsigned long *phys, unsigned long *size)
{
@@ -898,87 +990,3 @@ int of_irq_map_one(struct device_node *d
return res;
}
EXPORT_SYMBOL_GPL(of_irq_map_one);
-
-#ifdef CONFIG_PCI
-static u8 of_irq_pci_swizzle(u8 slot, u8 pin)
-{
- return (((pin - 1) + slot) % 4) + 1;
-}
-
-int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
-{
- struct device_node *dn, *ppnode;
- struct pci_dev *ppdev;
- u32 lspec;
- u32 laddr[3];
- u8 pin;
- int rc;
-
- /* Check if we have a device node, if yes, fallback to standard OF
- * parsing
- */
- dn = pci_device_to_OF_node(pdev);
- if (dn)
- return of_irq_map_one(dn, 0, out_irq);
-
- /* Ok, we don't, time to have fun. Let's start by building up an
- * interrupt spec. we assume #interrupt-cells is 1, which is standard
- * for PCI. If you do different, then don't use that routine.
- */
- rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
- if (rc != 0)
- return rc;
- /* No pin, exit */
- if (pin == 0)
- return -ENODEV;
-
- /* Now we walk up the PCI tree */
- lspec = pin;
- for (;;) {
- /* Get the pci_dev of our parent */
- ppdev = pdev->bus->self;
-
- /* Ouch, it's a host bridge... */
- if (ppdev == NULL) {
-#ifdef CONFIG_PPC64
- ppnode = pci_bus_to_OF_node(pdev->bus);
-#else
- struct pci_controller *host;
- host = pci_bus_to_host(pdev->bus);
- ppnode = host ? host->arch_data : NULL;
-#endif
- /* No node for host bridge ? give up */
- if (ppnode == NULL)
- return -EINVAL;
- } else
- /* We found a P2P bridge, check if it has a node */
- ppnode = pci_device_to_OF_node(ppdev);
-
- /* Ok, we have found a parent with a device-node, hand over to
- * the OF parsing code.
- * We build a unit address from the linux device to be used for
- * resolution. Note that we use the linux bus number which may
- * not match your firmware bus numbering.
- * Fortunately, in most cases, interrupt-map-mask doesn't include
- * the bus number as part of the matching.
- * You should still be careful about that though if you intend
- * to rely on this function (you ship a firmware that doesn't
- * create device nodes for all PCI devices).
- */
- if (ppnode)
- break;
-
- /* We can only get here if we hit a P2P bridge with no node,
- * let's do standard swizzling and try again
- */
- lspec = of_irq_pci_swizzle(PCI_SLOT(pdev->devfn), lspec);
- pdev = ppdev;
- }
-
- laddr[0] = (pdev->bus->number << 16)
- | (pdev->devfn << 8);
- laddr[1] = laddr[2] = 0;
- return of_irq_map_raw(ppnode, &lspec, 1, laddr, out_irq);
-}
-EXPORT_SYMBOL_GPL(of_irq_map_pci);
-#endif /* CONFIG_PCI */
--
1.4.2.3
^ permalink raw reply related
* [PATCH] fixup ARCH=ppc timer_interrupt after global pt_regs
From: Peter Korsgaard @ 2006-10-16 19:20 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
Hi,
2.6.19-rc2 doesn't boot on arch/ppc (atleast of 4xx), because the
'global-pt_regs' megapatch forgot to fix up the arch/ppc
timer_interrupt handler. This patch fixes it.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
diff -urpN linux-2.6.19-rc2.orig/arch/ppc/kernel/time.c linux-2.6.19-rc2/arch/ppc/kernel/time.c
--- linux-2.6.19-rc2.orig/arch/ppc/kernel/time.c 2006-10-16 21:05:52.000000000 +0200
+++ linux-2.6.19-rc2/arch/ppc/kernel/time.c 2006-10-16 21:12:42.000000000 +0200
@@ -56,6 +56,7 @@
#include <linux/time.h>
#include <linux/init.h>
#include <linux/profile.h>
+#include <linux/irq.h>
#include <asm/io.h>
#include <asm/nvram.h>
@@ -129,6 +130,7 @@ void wakeup_decrementer(void)
*/
void timer_interrupt(struct pt_regs * regs)
{
+ struct pt_regs *old_regs;
int next_dec;
unsigned long cpu = smp_processor_id();
unsigned jiffy_stamp = last_jiffy_stamp(cpu);
@@ -137,6 +139,7 @@ void timer_interrupt(struct pt_regs * re
if (atomic_read(&ppc_n_lost_interrupts) != 0)
do_IRQ(regs);
+ old_regs = set_irq_regs(regs);
irq_enter();
while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) {
@@ -188,6 +191,7 @@ void timer_interrupt(struct pt_regs * re
ppc_md.heartbeat();
irq_exit();
+ set_irq_regs(old_regs);
}
/*
--
Bye, Peter Korsgaard
^ permalink raw reply
* Re: [PATCH] Slight refactor of interrupt mapping for FSL parts
From: Kumar Gala @ 2006-10-16 21:37 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-dev, Jeff Garzik
In-Reply-To: <Pine.LNX.4.61.0610161554580.6266@ld0175-tx32.am.freescale.net>
On Oct 16, 2006, at 3:57 PM, Andy Fleming wrote:
>
> * Cleaned up interrupt mapping a little by adding a helper
> function which parses the irq out of the device-tree, and puts
> it into a resource.
> * Changed the PHY Layer to use NO_IRQ instead of -1 for PHY_POLL.
> This means that polling will always be used if mapping the
> interrupt fails for any reason.
You forgot to fixup the arch/ppc users of this.
> ---
> arch/powerpc/sysdev/fsl_soc.c | 33 +++++++++++++++
> +-----------------
> include/linux/phy.h | 2 +-
> 2 files changed, 17 insertions(+), 18 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/
> fsl_soc.c
> index dbe92ae..aa24b51 100644
> --- a/arch/powerpc/sysdev/fsl_soc.c
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -146,7 +146,7 @@ static int __init gfar_mdio_of_init(void
> }
>
> for (k = 0; k < 32; k++)
> - mdio_data.irq[k] = -1;
> + mdio_data.irq[k] = NO_IRQ;
>
> while ((child = of_get_next_child(np, child)) != NULL) {
> int irq = irq_of_parse_and_map(child, 0);
> @@ -177,6 +177,13 @@ static const char *gfar_tx_intr = "tx";
> static const char *gfar_rx_intr = "rx";
> static const char *gfar_err_intr = "error";
>
> +
> +void of_irq_to_resource(struct device_node *dev, int index, struct
> resource *r)
> +{
> + r->start = r->end = irq_of_parse_and_map(dev, index);
> + r->flags = IORESOURCE_IRQ;
> +}
Why don't you stick this in prom_parse.c (and add a prototype to prom.h)
> +
> static int __init gfar_of_init(void)
> {
> struct device_node *np;
> @@ -204,8 +211,7 @@ static int __init gfar_of_init(void)
> if (ret)
> goto err;
>
> - r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
> - r[1].flags = IORESOURCE_IRQ;
> + of_irq_to_resource(np, 0, &r[1]);
>
> model = get_property(np, "model", NULL);
>
> @@ -214,12 +220,10 @@ static int __init gfar_of_init(void)
> r[1].name = gfar_tx_intr;
>
> r[2].name = gfar_rx_intr;
> - r[2].start = r[2].end = irq_of_parse_and_map(np, 1);
> - r[2].flags = IORESOURCE_IRQ;
> + of_irq_to_resource(np, 1, &r[2]);
>
> r[3].name = gfar_err_intr;
> - r[3].start = r[3].end = irq_of_parse_and_map(np, 2);
> - r[3].flags = IORESOURCE_IRQ;
> + of_irq_to_resource(np, 2, &r[3]);
>
> n_res += 2;
> }
> @@ -323,8 +327,7 @@ static int __init fsl_i2c_of_init(void)
> if (ret)
> goto err;
>
> - r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
> - r[1].flags = IORESOURCE_IRQ;
> + of_irq_to_resource(np, 0, &r[1]);
>
> i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2);
> if (IS_ERR(i2c_dev)) {
> @@ -459,8 +462,7 @@ static int __init fsl_usb_of_init(void)
> if (ret)
> goto err;
>
> - r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
> - r[1].flags = IORESOURCE_IRQ;
> + of_irq_to_resource(np, 0, &r[1]);
>
> usb_dev_mph =
> platform_device_register_simple("fsl-ehci", i, r, 2);
> @@ -507,8 +509,7 @@ static int __init fsl_usb_of_init(void)
> if (ret)
> goto unreg_mph;
>
> - r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
> - r[1].flags = IORESOURCE_IRQ;
> + of_irq_to_resource(np, 0, &r[1]);
>
> usb_dev_dr =
> platform_device_register_simple("fsl-ehci", i, r, 2);
> @@ -591,8 +592,7 @@ static int __init fs_enet_of_init(void)
> r[2].name = fcc_regs_c;
> fs_enet_data.fcc_regs_c = r[2].start;
>
> - r[3].start = r[3].end = irq_of_parse_and_map(np, 0);
> - r[3].flags = IORESOURCE_IRQ;
> + of_irq_to_resource(np, 0, &r[3]);
>
> fs_enet_dev =
> platform_device_register_simple("fsl-cpm-fcc", i, &r[0], 4);
> @@ -754,8 +754,7 @@ static int __init cpm_uart_of_init(void)
> goto err;
> r[1].name = scc_pram;
>
> - r[2].start = r[2].end = irq_of_parse_and_map(np, 0);
> - r[2].flags = IORESOURCE_IRQ;
> + of_irq_to_resource(np, 0, &r[2]);
>
> cpm_uart_dev =
> platform_device_register_simple("fsl-cpm-scc:uart", i, &r
> [0], 3);
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 9447a57..d7b3751 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -37,7 +37,7 @@ #define PHY_GBIT_FEATURES (PHY_BASIC_FEA
> * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
> * the attached driver handles the interrupt
> */
> -#define PHY_POLL -1
> +#define PHY_POLL NO_IRQ
> #define PHY_IGNORE_INTERRUPT -2
>
> #define PHY_HAS_INTERRUPT 0x00000001
> --
> 1.4.2.3
^ permalink raw reply
* RE: [PATCH] Slight refactor of interrupt mapping for FSL parts
From: Joakim Tjernlund @ 2006-10-16 21:51 UTC (permalink / raw)
To: 'Kumar Gala', 'Andy Fleming'
Cc: linuxppc-dev, 'Jeff Garzik'
In-Reply-To: <C6870308-059D-40F8-8567-7A11AFAD2AE2@kernel.crashing.org>
> > -#define PHY_POLL -1
> > +#define PHY_POLL NO_IRQ
> > #define PHY_IGNORE_INTERRUPT -2
What does PHY_IGNORE_INTERRUPT mean? Can I use that in a dummy PHY
driver that just pretends that all is well? Got a ethernet port that
is connect to a switch directly over MII.
How do I express -2 in a dts file?
Jocke
^ permalink raw reply
* Re: [PATCH] Slight refactor of interrupt mapping for FSL parts
From: Kumar Gala @ 2006-10-16 21:54 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-dev@ozlabs.org list, Jeff Garzik
In-Reply-To: <C6870308-059D-40F8-8567-7A11AFAD2AE2@kernel.crashing.org>
On Oct 16, 2006, at 4:37 PM, Kumar Gala wrote:
>
> On Oct 16, 2006, at 3:57 PM, Andy Fleming wrote:
>
>>
>> * Cleaned up interrupt mapping a little by adding a helper
>> function which parses the irq out of the device-tree, and puts
>> it into a resource.
>> * Changed the PHY Layer to use NO_IRQ instead of -1 for PHY_POLL.
>> This means that polling will always be used if mapping the
>> interrupt fails for any reason.
>
> You forgot to fixup the arch/ppc users of this.
>
>
>> ---
>> arch/powerpc/sysdev/fsl_soc.c | 33 +++++++++++++++
>> +-----------------
>> include/linux/phy.h | 2 +-
>> 2 files changed, 17 insertions(+), 18 deletions(-)
>>
>> diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/
>> fsl_soc.c
>> index dbe92ae..aa24b51 100644
>> --- a/arch/powerpc/sysdev/fsl_soc.c
>> +++ b/arch/powerpc/sysdev/fsl_soc.c
>> @@ -146,7 +146,7 @@ static int __init gfar_mdio_of_init(void
>> }
>>
>> for (k = 0; k < 32; k++)
>> - mdio_data.irq[k] = -1;
>> + mdio_data.irq[k] = NO_IRQ;
>>
>> while ((child = of_get_next_child(np, child)) != NULL) {
>> int irq = irq_of_parse_and_map(child, 0);
>> @@ -177,6 +177,13 @@ static const char *gfar_tx_intr = "tx";
>> static const char *gfar_rx_intr = "rx";
>> static const char *gfar_err_intr = "error";
>>
>> +
>> +void of_irq_to_resource(struct device_node *dev, int index, struct
>> resource *r)
>> +{
>> + r->start = r->end = irq_of_parse_and_map(dev, index);
>> + r->flags = IORESOURCE_IRQ;
>> +}
>
> Why don't you stick this in prom_parse.c (and add a prototype to
> prom.h)
Actually, just implement it in the header.
- k
^ permalink raw reply
* Re: [PATCH] Xilinx UART Lite 2.6.18 driver
From: Peter Korsgaard @ 2006-10-16 19:42 UTC (permalink / raw)
To: David H. Lynch Jr.; +Cc: linuxppc-embedded
In-Reply-To: <45329C42.3030000@dlasys.net>
>>>>> "David" == David H Lynch <dhlii@dlasys.net> writes:
Hi,
David> The 8250 is certainly the oldest driver - but it is also
David> by far the most used. It is also the most heavily maintained,
Yes, because there's so many more-or-less compatible variants of the
hardware. Most drivers don't see a lot of development once they are
past the initial development/testing..
David> There are complexities to the 8250 that proved to be difficult
David> and troubling when I based my UartLite driver on it, Those
David> problems were because the 8250driver suports so many 8250
David> variants with so many idiosyncracies.
Exactly. Try to compare it to one of the "modern" drivers like
atmel_serial.c - It's almost 3 times as big.
>> Remove support? I don't remember anything about that.
David> I may have misread something there - I thought your
David> initial driver allowed stting the number of Uarts, and I
David> beleive your current one does not. If I am wrong, then I
David> think support for more Uarts needs to get added to the todo
David> list. That is not something important to me. But it probably
David> will be for others.
There was a discussion about how many device nodes to register with
lanana.org and hence how many devices to support. I went with 4 which
seems to be pretty standard (E.G. virtex.c supports up to 4 8250s). If
more is needed a bigger range can be requested with lanana.org.
Again, let's see a real need before changing anything.
David> Despite the fact hat you apear to run combined 16550/Uartlite
David> implimentations, My expectation is that will be rare. A small
David> savings in FPGA spare is rarely going to justify more complex
David> hardware and software. Multiple port systems are mostly
David> likely to be all one type or another.
Almost all our designs use both.
P.S.: Would it be possible to fix up your quoting?
--
Bye, Peter Korsgaard
^ permalink raw reply
* Re: [PATCH] Slight refactor of interrupt mapping for FSL parts
From: Benjamin Herrenschmidt @ 2006-10-16 22:58 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-dev, Jeff Garzik
In-Reply-To: <Pine.LNX.4.61.0610161554580.6266@ld0175-tx32.am.freescale.net>
> +void of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
> +{
> + r->start = r->end = irq_of_parse_and_map(dev, index);
> + r->flags = IORESOURCE_IRQ;
> +}
> +
What about having that one in prom_parse.c ?
Ben.
^ permalink raw reply
* Re: kernel BUG in __cache_alloc_node at linux-2.6.git/mm/slab.c:3177!
From: Christoph Lameter @ 2006-10-16 23:37 UTC (permalink / raw)
To: Will Schmidt; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <1161031821.31903.28.camel@farscape>
On Mon, 16 Oct 2006, Will Schmidt wrote:
> This is output from 2.6.18-rc2. MemFree, MemTotal, MemUsed still
> wrong. Node0 slab is still zero. I've also attached the numa=debug
> boot log from this boot, in case it has any clues that were missing from
> the other boot log.
It looks as if node 0 is allready full on bootup. The new code in 2.6.19
controls locality in a more strict form in the slab. 2.6.18 and earlier
were able to tolerate if a request for a page from the slab allocator for
node 0 returns memory on node1 even if node 1 has not been bootstrapped
yet. But this resulted in a problem in the slab because the node lists
dedicated for node 0 now had memory from node 1 in it (which led to
latency problems since slab code subsequently assumes that node local
memory is very fast, which with corrupted per node lists is no longer
true.).
You must bootstrap on a node that has memory available. If you would
bootstrap the slab on node 1 that would work.
> Node 0 MemTotal: 229376 kB
> Node 0 MemUsed: 229376 kB
^^^^^ This node should not be full!!!
Increase memory on node 0 so that the slab can bootstrap.
^ permalink raw reply
* Re: Failed to boot kernel 2.6.19-rc2 due to IBM veth problem.
From: David Gibson @ 2006-10-17 0:15 UTC (permalink / raw)
To: Yao Fei Zhu; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <4533C4E9.1040504@cn.ibm.com>
On Tue, Oct 17, 2006 at 01:44:09AM +0800, Yao Fei Zhu wrote:
[snip]
> >
> David, I have verified this fix, it works fine for me, Thanks. What's the status of it? Submitted?
Yes, I've sent it to Santiago Leon, the ibmveth maintainer and also to
Jeff Garzik and Andrew Morton. It is in Andrew's -mm tree already,
haven't heard from Santiago or Jeff.
--
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
^ permalink raw reply
* Please pull powerpc.git 'merge' branch
From: Paul Mackerras @ 2006-10-17 4:02 UTC (permalink / raw)
To: torvalds; +Cc: linuxppc-dev
Linus,
Please do:
git pull \
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge
to get some more PowerPC bugfixes, as listed below.
Paul.
arch/powerpc/configs/mpc834x_itx_defconfig | 2 +-
arch/powerpc/kernel/cputable.c | 2 +-
arch/powerpc/kernel/pci_32.c | 12 ++++++------
arch/powerpc/kernel/pci_64.c | 10 ++++++++--
arch/powerpc/kernel/process.c | 10 ++--------
arch/powerpc/kernel/traps.c | 3 +--
arch/powerpc/platforms/83xx/Kconfig | 13 +++++++++++++
arch/powerpc/platforms/83xx/Makefile | 2 ++
arch/powerpc/platforms/83xx/mpc8360e_pb.c | 19 +++++++++++++++++++
arch/powerpc/platforms/cell/spu_base.c | 15 +++++++++++----
arch/powerpc/platforms/cell/spufs/file.c | 1 +
arch/ppc/kernel/time.c | 4 ++++
arch/ppc/platforms/mpc8272ads_setup.c | 4 ++--
arch/ppc/platforms/mpc866ads_setup.c | 4 ++--
arch/ppc/platforms/mpc885ads_setup.c | 4 ++--
15 files changed, 75 insertions(+), 30 deletions(-)
Anton Blanchard:
[POWERPC] Never panic when taking altivec exceptions from userspace
[POWERPC] POWER6 has 6 PMCs
[POWERPC] Better check in show_instructions
[POWERPC] Check for offline nodes in pci NUMA code
Benjamin Herrenschmidt:
[POWERPC] Don't crash on cell with 2 BEs when !CONFIG_NUMA
Eric Sesterhenn:
[POWERPC] Off-by-one in /arch/ppc/platforms/mpc8*
Kumar Gala:
[POWERPC] ppc: Add missing calls to set_irq_regs
Li Yang:
[POWERPC] Fix MPC8360EMDS PB board support
[POWERPC] Add Makefile entry for MPC832x_mds support
Noguchi, Masato:
[POWERPC] spufs: fix support for read/write on cntl
Randy Vinson:
[POWERPC] Fix IO Window Updates on P2P bridges.
Timur Tabi:
[POWERPC] Add DOS partition table support to mpc834x_itx_defconfig
^ permalink raw reply
* [PATCH] Slight refactor of interrupt mapping for FSL parts
From: Andy Fleming @ 2006-10-17 6:27 UTC (permalink / raw)
To: linuxppc-dev, Kumar Gala, Jeff Garzik
* Cleaned up interrupt mapping a little by adding a helper
function which parses the irq out of the device-tree, and puts
it into a resource.
* Changed the PHY Layer to use NO_IRQ instead of -1 for PHY_POLL.
This means that polling will always be used if mapping the
interrupt fails for any reason.
* Changed the arch/ppc platform files to specify PHY_POLL, instead of -1
* Changed the fixed phy to use PHY_IGNORE_INTERRUPT
---
This is a respin of the patch to reply to comments from the community
arch/powerpc/sysdev/fsl_soc.c | 27 ++++++++++----------------
arch/ppc/platforms/85xx/mpc8540_ads.c | 4 ++--
arch/ppc/platforms/85xx/mpc8560_ads.c | 4 ++--
arch/ppc/platforms/85xx/mpc85xx_cds_common.c | 6 +++---
arch/ppc/platforms/85xx/sbc8560.c | 2 +-
arch/ppc/platforms/85xx/stx_gp3.c | 2 +-
arch/ppc/platforms/85xx/tqm85xx.c | 4 ++--
drivers/net/phy/fixed.c | 2 +-
include/asm-powerpc/prom.h | 7 +++++++
include/linux/phy.h | 7 ++++++-
10 files changed, 35 insertions(+), 30 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index dbe92ae..9ed3b27 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -146,7 +146,7 @@ static int __init gfar_mdio_of_init(void
}
for (k = 0; k < 32; k++)
- mdio_data.irq[k] = -1;
+ mdio_data.irq[k] = NO_IRQ;
while ((child = of_get_next_child(np, child)) != NULL) {
int irq = irq_of_parse_and_map(child, 0);
@@ -177,6 +177,7 @@ static const char *gfar_tx_intr = "tx";
static const char *gfar_rx_intr = "rx";
static const char *gfar_err_intr = "error";
+
static int __init gfar_of_init(void)
{
struct device_node *np;
@@ -204,8 +205,7 @@ static int __init gfar_of_init(void)
if (ret)
goto err;
- r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
- r[1].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[1]);
model = get_property(np, "model", NULL);
@@ -214,12 +214,10 @@ static int __init gfar_of_init(void)
r[1].name = gfar_tx_intr;
r[2].name = gfar_rx_intr;
- r[2].start = r[2].end = irq_of_parse_and_map(np, 1);
- r[2].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 1, &r[2]);
r[3].name = gfar_err_intr;
- r[3].start = r[3].end = irq_of_parse_and_map(np, 2);
- r[3].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 2, &r[3]);
n_res += 2;
}
@@ -323,8 +321,7 @@ static int __init fsl_i2c_of_init(void)
if (ret)
goto err;
- r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
- r[1].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[1]);
i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2);
if (IS_ERR(i2c_dev)) {
@@ -459,8 +456,7 @@ static int __init fsl_usb_of_init(void)
if (ret)
goto err;
- r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
- r[1].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[1]);
usb_dev_mph =
platform_device_register_simple("fsl-ehci", i, r, 2);
@@ -507,8 +503,7 @@ static int __init fsl_usb_of_init(void)
if (ret)
goto unreg_mph;
- r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
- r[1].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[1]);
usb_dev_dr =
platform_device_register_simple("fsl-ehci", i, r, 2);
@@ -591,8 +586,7 @@ static int __init fs_enet_of_init(void)
r[2].name = fcc_regs_c;
fs_enet_data.fcc_regs_c = r[2].start;
- r[3].start = r[3].end = irq_of_parse_and_map(np, 0);
- r[3].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[3]);
fs_enet_dev =
platform_device_register_simple("fsl-cpm-fcc", i, &r[0], 4);
@@ -754,8 +748,7 @@ static int __init cpm_uart_of_init(void)
goto err;
r[1].name = scc_pram;
- r[2].start = r[2].end = irq_of_parse_and_map(np, 0);
- r[2].flags = IORESOURCE_IRQ;
+ of_irq_to_resource(np, 0, &r[2]);
cpm_uart_dev =
platform_device_register_simple("fsl-cpm-scc:uart", i, &r[0], 3);
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index 4f839da..00a3ba5 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -92,9 +92,9 @@ #endif
mdata->irq[0] = MPC85xx_IRQ_EXT5;
mdata->irq[1] = MPC85xx_IRQ_EXT5;
- mdata->irq[2] = -1;
+ mdata->irq[2] = PHY_POLL;
mdata->irq[3] = MPC85xx_IRQ_EXT5;
- mdata->irq[31] = -1;
+ mdata->irq[31] = PHY_POLL;
/* setup the board related information for the enet controllers */
pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c
index 14ecec7..3a06046 100644
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -156,9 +156,9 @@ #endif
mdata->irq[0] = MPC85xx_IRQ_EXT5;
mdata->irq[1] = MPC85xx_IRQ_EXT5;
- mdata->irq[2] = -1;
+ mdata->irq[2] = PHY_POLL;
mdata->irq[3] = MPC85xx_IRQ_EXT5;
- mdata->irq[31] = -1;
+ mdata->irq[31] = PHY_POLL;
/* setup the board related information for the enet controllers */
pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
index 5ce0f69..2d59eb7 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -451,9 +451,9 @@ #endif
mdata->irq[0] = MPC85xx_IRQ_EXT5;
mdata->irq[1] = MPC85xx_IRQ_EXT5;
- mdata->irq[2] = -1;
- mdata->irq[3] = -1;
- mdata->irq[31] = -1;
+ mdata->irq[2] = PHY_POLL;
+ mdata->irq[3] = PHY_POLL;
+ mdata->irq[31] = PHY_POLL;
/* setup the board related information for the enet controllers */
pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
index 764d580..1d10ab9 100644
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -129,7 +129,7 @@ #endif
mdata->irq[25] = MPC85xx_IRQ_EXT6;
mdata->irq[26] = MPC85xx_IRQ_EXT7;
- mdata->irq[31] = -1;
+ mdata->irq[31] = PHY_POLL;
/* setup the board related information for the enet controllers */
pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
index 4bb18ab..b1f5b73 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -123,7 +123,7 @@ #endif
mdata->irq[2] = MPC85xx_IRQ_EXT5;
mdata->irq[4] = MPC85xx_IRQ_EXT5;
- mdata->irq[31] = -1;
+ mdata->irq[31] = PHY_POLL;
/* setup the board related information for the enet controllers */
pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
diff --git a/arch/ppc/platforms/85xx/tqm85xx.c b/arch/ppc/platforms/85xx/tqm85xx.c
index dd45f2e..4ee2bd1 100644
--- a/arch/ppc/platforms/85xx/tqm85xx.c
+++ b/arch/ppc/platforms/85xx/tqm85xx.c
@@ -137,9 +137,9 @@ #endif /* CONFIG_MPC8560 */
mdata->irq[0] = MPC85xx_IRQ_EXT8;
mdata->irq[1] = MPC85xx_IRQ_EXT8;
- mdata->irq[2] = -1;
+ mdata->irq[2] = PHY_POLL;
mdata->irq[3] = MPC85xx_IRQ_EXT8;
- mdata->irq[31] = -1;
+ mdata->irq[31] = PHY_POLL;
/* setup the board related information for the enet controllers */
pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index f14e992..096d4a1 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -254,7 +254,7 @@ static int fixed_mdio_register_device(in
goto device_create_fail;
}
- phydev->irq = -1;
+ phydev->irq = PHY_IGNORE_INTERRUPT;
phydev->dev.bus = &mdio_bus_type;
if(number)
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 5246297..39f04ef 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -17,6 +17,7 @@ #ifdef __KERNEL__
*/
#include <linux/types.h>
#include <linux/proc_fs.h>
+#include <linux/platform_device.h>
#include <asm/atomic.h>
/* Definitions used by the flattened device tree */
@@ -331,6 +332,12 @@ extern int of_irq_map_one(struct device_
struct pci_dev;
extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
+static inline void of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
+{
+ r->start = r->end = irq_of_parse_and_map(dev, index);
+ r->flags = IORESOURCE_IRQ;
+}
+
#endif /* __KERNEL__ */
#endif /* _POWERPC_PROM_H */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 9447a57..4dbffe4 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -20,6 +20,7 @@ #define __PHY_H
#include <linux/spinlock.h>
#include <linux/device.h>
+#include <asm/irq.h>
#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
SUPPORTED_10baseT_Full | \
@@ -37,7 +38,11 @@ #define PHY_GBIT_FEATURES (PHY_BASIC_FEA
* or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
* the attached driver handles the interrupt
*/
-#define PHY_POLL -1
+#ifndef NO_IRQ
+#define NO_IRQ 0
+#endif
+
+#define PHY_POLL NO_IRQ
#define PHY_IGNORE_INTERRUPT -2
#define PHY_HAS_INTERRUPT 0x00000001
--
1.4.2.3
^ permalink raw reply related
* Re: Linux on custom Xilinx board with PPC405 hangs on boot
From: Peter N. Andreasen @ 2006-10-17 9:06 UTC (permalink / raw)
To: Liu Dave-r63238, Linas Vepstas, linuxppc-dev
In-Reply-To: <36468a5c0609210040o3f2fad38r7f6f9848ffa48ec8@mail.gmail.com>
On 9/21/06, Peter N. Andreasen <peterarbejde@gmail.com> wrote:
> Liu, Linas, list
> Thanks a lot for the answers. It helped me to review the hardware configuration again.
> The problem was the definition of the Flash size.
> It turns out that the Xilinx generated header files define the size of the Flash. But the kernel also has a configuration option: Memory Technology Devices / Mapping Drivers for Chip Access / Physical Length of Chip Mapping
> My arch/ppc/platforms/xilinx_ocp/xparameters_ml300.h defines this as 4Mbyte, but the option in the kernel was set to 64 Mbyte (an extra 0 which I had not seen)
Hello list,
I have successfully booted the kernel, but the uartlite device seems
to give me a lot of headache. I am using Busybox v. 1.0 and made some
changes to the libb.h:
# define CURRENT_VC "/dev/ttl0"
# define VC_1 "/dev/ttl1"
# define VC_2 "/dev/ttl2"
# define VC_3 "/dev/ttl3"
# define VC_4 "/dev/ttl4"
# define VC_5 "/dev/ttl5"
# define SC_0 "/dev/ttl0"
# define SC_1 "/dev/ttl1"
# define SC_FORMAT "/dev/ttl%d"
# define VC_FORMAT "/dev/ttl%d"
To make sure I get the correct device node I also changed this in
xuartllite_serial.h:
#define XULITE_MINOR_START 187
#define UARTLITE_TTY_NAME "ttl"
#define UARTLITE_TTY_DEVFS_NAME "ttl/%d"
#define UARTLITE_CU_NAME "cul"
#define UARTLITE_CU_DEVFS_NAME "cul/%d"
#define XULITE_MAJOR 204
#define XULITE_AUX_MAJOR 205
The system stops when init launches the busybox init process. This is
the message I get just after "Freeing unused kernel memory: 44k init"
First I got an assert() from the Xilinx Uartlite driver:
...
init started: Bu
<2>Xilinx OS Independent Code XAssert: xuartlite.c:194
Code may crash due to unhandled errors.
...
and the system stops.
The check made in the driver is for a 0 length string. If I change it
to ignore that, the console show this instead:
init started: Bu
init started: B
trying to run init_process
...
(the "trying to run init process" is a message I put in
run_init_process in init.c in the kernel, and the message it tries to
output is "init started: Busybox version 1.0 .....")
Now my question is:
What exactly are the device nodes I have to make in /dev/ on the
ramdisk on target? I made a ttl, ttl0, and tty which have major
204/minor 187, and ttl1, ttl2 minor 188 and 189. I also
Hope someone can help me on this
Peter
^ permalink raw reply
* JFFS2 on Lite5200
From: Andrea Galbusera @ 2006-10-17 10:33 UTC (permalink / raw)
To: linuxppc-embedded, linux-mtd
Hello.
I'm currently using linux-2.6.16 from denx on a Lite5200 V2.0. I need to
access a JFFS2 filesystem on the onboard flash ( 16MB Am29L652D ).
I see the flash using physmap driver and cmdline partitions.
I experience a problem when creating files on JFFS2 with filename longer
than a few characters. They appear to be created correctly with the
content I want, but, after unmounting and remounting the filesystem they
result unreadable and ls complains with "no such file or
directory" (short-named files are ok).
I can deterministically reproduce the problem this way:
$ eraseall /dev/mtd1 (start with a fresh MTD partition)
$ mount -t jffs2 /dev/mtdblock1 /mnt/flash
$ date > /mnt/flash/short
$ date > /mnt/flash/timestamp
$ ls /mnt/flash/
short timestamp
$ umount /dev/mtdblock1
$ mount -t jffs2 /dev/mtdblock1 /mnt/flash
$ ls /mnt/flash
ls: /mnt/flash/time: No such file or directory
short
...than I cannot access /mnt/flash/timestamp anymore,
while /mnt/flash/short is ok!
These are the kernel relevant settings:
#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=3
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CMDLINE_PARTS=y
#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_AMDSTD_RETRY=0
CONFIG_MTD_CFI_UTIL=y
#
# Mapping drivers for chip access
#
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=0xff000000
CONFIG_MTD_PHYSMAP_LEN=0x01000000
CONFIG_MTD_PHYSMAP_BANKWIDTH=1
#
# Miscellaneous filesystems
#
CONFIG_JFFS_FS=y
CONFIG_JFFS_FS_VERBOSE=0
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=2
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
I enabled both MTD and JFFS2 maximum verbosity debug messages. If
relevant, I can post them for any of the commands in the sequence. Btw I
have the same problem with crafted filesystem images built with
mkfs.jffs2 (they fail at first mount).
Trying to exclude MTD issues I tested the same with JFFS and I don't
have any problem, but JFFS is not suitable for my needs :-(
By digging the net, I can't find any reference to this problem. Hope
anybody out there is using this setup (lite5200_defconfig as MTD
disabled) and can help. TIA.
Regards,
Andrea
^ permalink raw reply
* [PATCH] enable RTAS /proc for PowerPC/CHRP platform
From: Nicolas DET @ 2006-10-17 11:29 UTC (permalink / raw)
To: linuxppc-dev, akpm, Sven Luther, tilmann
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
This patch enables RTAS /proc support for PowerPC 32bits / CHRP platform.
A new entry is created (/proc/ppc/rtas/) which contains the RTAS nodes.
Theses nodes and the code are the exact same than with the ppc64
architecture.
This patch has been succefully applied on the kernel 2.6.18.1 and tested
on bPlan's OpenFirmware.
Signed-off-by: Nicolas DET <nd@bplan-gmbh.de>
[-- Attachment #2: rtas-proc_ppc32.patch --]
[-- Type: text/plain, Size: 2707 bytes --]
--- a/arch/powerpc/kernel/rtas-proc.c 2006-10-14 05:34:03.000000000 +0200
+++ b/arch/powerpc/kernel/rtas-proc.c 2006-10-16 10:46:16.000000000 +0200
@@ -253,43 +253,70 @@ static void get_location_code(struct seq
static void check_location_string(struct seq_file *m, char *c);
static void check_location(struct seq_file *m, char *c);
+#ifdef CONFIG_PPC64
+#define PROCRTAS_ROOT "ppc64"
+#else
+#define PROCRTAS_ROOT "ppc"
+static int __init proc_ppc32_create(void)
+{
+ struct proc_dir_entry *root;
+
+ root = proc_mkdir(PROCRTAS_ROOT , NULL);
+ if (!root)
+ return -1;
+
+ if (!proc_mkdir("rtas", root))
+ return -1;
+
+ if (!proc_symlink("rtas", NULL, PROCRTAS_ROOT "/rtas"))
+ return -1;
+
+ return 0;
+}
+#endif
+
static int __init proc_rtas_init(void)
{
struct proc_dir_entry *entry;
- if (!machine_is(pseries))
+ if ( ! ( machine_is(pseries) || machine_is(chrp) ) )
return -ENODEV;
rtas_node = of_find_node_by_name(NULL, "rtas");
if (rtas_node == NULL)
return -ENODEV;
- entry = create_proc_entry("ppc64/rtas/progress", S_IRUGO|S_IWUSR, NULL);
+#ifndef CONFIG_PPC64
+ if (proc_ppc32_create() != 0)
+ return -ENODEV;
+#endif
+
+ entry = create_proc_entry(PROCRTAS_ROOT "/rtas/progress", S_IRUGO|S_IWUSR, NULL);
if (entry)
entry->proc_fops = &ppc_rtas_progress_operations;
- entry = create_proc_entry("ppc64/rtas/clock", S_IRUGO|S_IWUSR, NULL);
+ entry = create_proc_entry(PROCRTAS_ROOT "/rtas/clock", S_IRUGO|S_IWUSR, NULL);
if (entry)
entry->proc_fops = &ppc_rtas_clock_operations;
- entry = create_proc_entry("ppc64/rtas/poweron", S_IWUSR|S_IRUGO, NULL);
+ entry = create_proc_entry(PROCRTAS_ROOT "/rtas/poweron", S_IWUSR|S_IRUGO, NULL);
if (entry)
entry->proc_fops = &ppc_rtas_poweron_operations;
- entry = create_proc_entry("ppc64/rtas/sensors", S_IRUGO, NULL);
+ entry = create_proc_entry(PROCRTAS_ROOT "/rtas/sensors", S_IRUGO, NULL);
if (entry)
entry->proc_fops = &ppc_rtas_sensors_operations;
- entry = create_proc_entry("ppc64/rtas/frequency", S_IWUSR|S_IRUGO,
+ entry = create_proc_entry(PROCRTAS_ROOT "/rtas/frequency", S_IWUSR|S_IRUGO,
NULL);
if (entry)
entry->proc_fops = &ppc_rtas_tone_freq_operations;
- entry = create_proc_entry("ppc64/rtas/volume", S_IWUSR|S_IRUGO, NULL);
+ entry = create_proc_entry(PROCRTAS_ROOT "/rtas/volume", S_IWUSR|S_IRUGO, NULL);
if (entry)
entry->proc_fops = &ppc_rtas_tone_volume_operations;
- entry = create_proc_entry("ppc64/rtas/rmo_buffer", S_IRUSR, NULL);
+ entry = create_proc_entry(PROCRTAS_ROOT "/rtas/rmo_buffer", S_IRUSR, NULL);
if (entry)
entry->proc_fops = &ppc_rtas_rmo_buf_ops;
[-- Attachment #3: nd.vcf --]
[-- Type: text/x-vcard, Size: 249 bytes --]
begin:vcard
fn:Nicolas DET ( bplan GmbH )
n:DET;Nicolas
org:bplan GmbH
adr:;;;;;;Germany
email;internet:nd@bplan-gmbh.de
title:Software Entwicklung
tel;work:+49 6171 9187 - 31
x-mozilla-html:FALSE
url:http://www.bplan-gmbh.de
version:2.1
end:vcard
^ permalink raw reply
* [POWERPC] simplify stolen time calculation
From: Stephen Rothwell @ 2006-10-17 13:08 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
In calculating stolen time, we were trying to actually account for time
spent in the hypervisor. We don't really have enough information to do
that accurately, so don't try. Instead, we now calculate stolen time as
time that the current cpu thread is not actually dispatching instructions.
On chips without a PURR, we cannot do this, so stolen time will always
be zero. On chips with a PURR, this is merely the difference between
the elapsed PURR values and the elapsed TB values.
This gives us much more sane vaules from tools such as mpstat, even if
they are still a bit strange e.g. 2 busy threads on one cpu will both
appear to have 50% user time and 50% stolen time while 1 busy thread on
a cpu will look like 100% user on one of them and 100% idle on the other.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/time.c | 63 +++++++++++---------------------------------
1 files changed, 16 insertions(+), 47 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index a124499..73e73dd 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -221,11 +221,8 @@ #ifdef CONFIG_PPC_SPLPAR
*/
struct cpu_purr_data {
int initialized; /* thread is running */
- u64 tb0; /* timebase at origin time */
- u64 purr0; /* PURR at origin time */
u64 tb; /* last TB value read */
u64 purr; /* last PURR value read */
- u64 stolen; /* stolen time so far */
spinlock_t lock;
};
@@ -235,10 +232,8 @@ static void snapshot_tb_and_purr(void *d
{
struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data);
- p->tb0 = mftb();
- p->purr0 = mfspr(SPRN_PURR);
- p->tb = p->tb0;
- p->purr = 0;
+ p->tb = mftb();
+ p->purr = mfspr(SPRN_PURR);
wmb();
p->initialized = 1;
}
@@ -259,37 +254,24 @@ void snapshot_timebases(void)
void calculate_steal_time(void)
{
- u64 tb, purr, t0;
+ u64 tb, purr;
s64 stolen;
- struct cpu_purr_data *p0, *pme, *phim;
- int cpu;
+ struct cpu_purr_data *pme;
if (!cpu_has_feature(CPU_FTR_PURR))
return;
- cpu = smp_processor_id();
- pme = &per_cpu(cpu_purr_data, cpu);
+ pme = &per_cpu(cpu_purr_data, smp_processor_id());
if (!pme->initialized)
return; /* this can happen in early boot */
- p0 = &per_cpu(cpu_purr_data, cpu & ~1);
- phim = &per_cpu(cpu_purr_data, cpu ^ 1);
- spin_lock(&p0->lock);
+ spin_lock(&pme->lock);
tb = mftb();
- purr = mfspr(SPRN_PURR) - pme->purr0;
- if (!phim->initialized || !cpu_online(cpu ^ 1)) {
- stolen = (tb - pme->tb) - (purr - pme->purr);
- } else {
- t0 = pme->tb0;
- if (phim->tb0 < t0)
- t0 = phim->tb0;
- stolen = phim->tb - t0 - phim->purr - purr - p0->stolen;
- }
- if (stolen > 0) {
+ purr = mfspr(SPRN_PURR);
+ stolen = (tb - pme->tb) - (purr - pme->purr);
+ if (stolen > 0)
account_steal_time(current, stolen);
- p0->stolen += stolen;
- }
pme->tb = tb;
pme->purr = purr;
- spin_unlock(&p0->lock);
+ spin_unlock(&pme->lock);
}
/*
@@ -298,30 +280,17 @@ void calculate_steal_time(void)
*/
static void snapshot_purr(void)
{
- int cpu;
- u64 purr;
- struct cpu_purr_data *p0, *pme, *phim;
+ struct cpu_purr_data *pme;
unsigned long flags;
if (!cpu_has_feature(CPU_FTR_PURR))
return;
- cpu = smp_processor_id();
- pme = &per_cpu(cpu_purr_data, cpu);
- p0 = &per_cpu(cpu_purr_data, cpu & ~1);
- phim = &per_cpu(cpu_purr_data, cpu ^ 1);
- spin_lock_irqsave(&p0->lock, flags);
- pme->tb = pme->tb0 = mftb();
- purr = mfspr(SPRN_PURR);
- if (!phim->initialized) {
- pme->purr = 0;
- pme->purr0 = purr;
- } else {
- /* set p->purr and p->purr0 for no change in p0->stolen */
- pme->purr = phim->tb - phim->tb0 - phim->purr - p0->stolen;
- pme->purr0 = purr - pme->purr;
- }
+ pme = &per_cpu(cpu_purr_data, smp_processor_id());
+ spin_lock_irqsave(&pme->lock, flags);
+ pme->tb = mftb();
+ pme->purr = mfspr(SPRN_PURR);
pme->initialized = 1;
- spin_unlock_irqrestore(&p0->lock, flags);
+ spin_unlock_irqrestore(&pme->lock, flags);
}
#endif /* CONFIG_PPC_SPLPAR */
--
1.4.2.3
^ permalink raw reply related
* [Regression] cpu hotplug failed on kernel 2.6.19-rc2
From: Yao Fei Zhu @ 2006-10-17 13:16 UTC (permalink / raw)
To: linuxppc-dev, linux-kernel
Running cpu hotplug regression tsstcase lhcs_regression on kernel 2.6.19-rc2/IBM System p5 will fall into xmon.
1:mon> e
cpu 0x1: Vector: 300 (Data Access) at [c000000023fa3570]
pc: c0000000000abfa0: .__drain_pages+0x50/0xbc
lr: c0000000000abfd8: .__drain_pages+0x88/0xbc
sp: c000000023fa37f0
msr: 8000000000001032
dar: 0
dsisr: 40010000
current = 0xc000000002a5d070
paca = 0xc000000000494800
pid = 3345, comm = hotplug01.sh
1:mon> t
[c000000023fa3890] c0000000000ac040 .page_alloc_cpu_notify+0x34/0x70
[c000000023fa3910] c000000000378190 .notifier_call_chain+0x4c/0x90
[c000000023fa39a0] c000000000076b2c .blocking_notifier_call_chain+0x3c/0x6c
[c000000023fa3a40] c00000000008989c .cpu_down+0x218/0x32c
[c000000023fa3b30] c000000000242a0c .store_online+0x44/0xa0
[c000000023fa3bc0] c00000000023d0e0 .sysdev_store+0x44/0x60
[c000000023fa3c40] c00000000013f160 .sysfs_write_file+0x134/0x1b8
[c000000023fa3cf0] c0000000000dd814 .vfs_write+0x118/0x200
[c000000023fa3d90] c0000000000ddf84 .sys_write+0x4c/0x8c
[c000000023fa3e30] c00000000000871c syscall_exit+0x0/0x40
--- Exception: c01 (System Call) at 000000000fe0de7c
SP (f8ccc0c0) is in userspace
1:mon> r
R00 = 8000000000001032 R16 = 00000000100a0000
R01 = c000000023fa37f0 R17 = 00000000100c2cd8
R02 = c0000000005cc460 R18 = 000000000000003f
R03 = c000000049fff600 R19 = 0000000000000000
R04 = 0000000000000000 R20 = c0000000004c9078
R05 = c000000020dc3250 R21 = 0000000000000005
R06 = 0000000000000000 R22 = c000000000665180
R07 = 0000000000000000 R23 = 0000000000008002
R08 = 0000000000000008 R24 = 0000000000000005
R09 = c000000049fff628 R25 = 0000000000000005
R10 = 0000000000000100 R26 = 0000000000000005
R11 = c000000049fff600 R27 = 0000000000000000
R12 = 0000000000000000 R28 = c000000049fff600
R13 = c000000000494800 R29 = 8000000000001032
R14 = 0000000010080000 R30 = c0000000004d31c8
R15 = 0000000000000000 R31 = 0000000000000000
pc = c0000000000abfa0 .__drain_pages+0x50/0xbc
lr = c0000000000abfd8 .__drain_pages+0x88/0xbc
msr = 8000000000001032 cr = 24242448
ctr = c0000000000ac00c xer = 0000000000000001 trap = 300
dar = 0000000000000000 dsisr = 40010000
1:mon> di c0000000000abfa0
c0000000000abfa0 e89f0002 lwa r4,0(r31)
c0000000000abfa4 7f83e378 mr r3,r28
c0000000000abfa8 38bf0010 addi r5,r31,16
c0000000000abfac 38c00000 li r6,0
c0000000000abfb0 4bfff9c1 bl c0000000000ab970 #
.free_pages_bulk+0x0/0x2b4
c0000000000abfb4 38000000 li r0,0
c0000000000abfb8 901f0000 stw r0,0(r31)
c0000000000abfbc 7fa10164 mtmsrd r29,1
c0000000000abfc0 3b7b0001 addi r27,r27,1
c0000000000abfc4 3bff0020 addi r31,r31,32
c0000000000abfc8 2fbb0002 cmpdi cr7,r27,2
c0000000000abfcc 409effc4 bne cr7,c0000000000abf90 #
.__drain_pages+0x40/0xbc
c0000000000abfd0 7f83e378 mr r3,r28
c0000000000abfd4 48008c09 bl c0000000000b4bdc #
.next_zone+0x0/0x48
c0000000000abfd8 60000000 nop
c0000000000abfdc 2fa30000 cmpdi cr7,r3,0
1:mon> mi
1:mon>
^ permalink raw reply
* Re: JFFS2 on Lite5200
From: Andrey Volkov @ 2006-10-17 13:20 UTC (permalink / raw)
To: Andrea Galbusera; +Cc: dedekind, linux-mtd, linuxppc-embedded
In-Reply-To: <1161081183.22948.58.camel@localhost.localdomain>
Hello Andrea,
Andrea Galbusera wrote:
> Hello.
>
> I'm currently using linux-2.6.16 from denx on a Lite5200 V2.0. I need to
> access a JFFS2 filesystem on the onboard flash ( 16MB Am29L652D ).
>
> I see the flash using physmap driver and cmdline partitions.
> I experience a problem when creating files on JFFS2 with filename longer
> than a few characters. They appear to be created correctly with the
> content I want, but, after unmounting and remounting the filesystem they
> result unreadable and ls complains with "no such file or
> directory" (short-named files are ok).
--snip--
OMG, again same question,
Andrea, check ml archive, I already sent patch half-year ago
(http://ozlabs.org/pipermail/linuxppc-embedded/2006-April/022566.html)
Problem is in alignment/memcpy: JFFS2 code assumed that memory at
unaligned addresses could be touched, but access to an external MMIO
on MPC5200 _must_ be aligned (i.e. you could not read u32 from odd address).
P.S. Artem, I repeat, I sent this patch _HALF_YEAR_AGO_
how about to fix scan.c?
--
Regards
Andrey
^ permalink raw reply
* Re: [PATCH] enable RTAS /proc for PowerPC/CHRP platform
From: Christoph Hellwig @ 2006-10-17 13:22 UTC (permalink / raw)
To: Nicolas DET; +Cc: akpm, linuxppc-dev, Sven Luther, tilmann
In-Reply-To: <4534BE9D.7030908@bplan-gmbh.de>
> --- a/arch/powerpc/kernel/rtas-proc.c 2006-10-14 05:34:03.000000000 +0200
> +++ b/arch/powerpc/kernel/rtas-proc.c 2006-10-16 10:46:16.000000000 +0200
> @@ -253,43 +253,70 @@ static void get_location_code(struct seq
> static void check_location_string(struct seq_file *m, char *c);
> static void check_location(struct seq_file *m, char *c);
>
> +#ifdef CONFIG_PPC64
> +#define PROCRTAS_ROOT "ppc64"
> +#else
> +#define PROCRTAS_ROOT "ppc"
Please don't do any pathname changes. Even if ppc64 isn't correct it's
what applications expect and what we should provide for a coherent user
interface.
> - if (!machine_is(pseries))
> + if ( ! ( machine_is(pseries) || machine_is(chrp) ) )
> return -ENODEV;
This should be the only change you need, and it should follow kernel
coding style, aka:
if (!machine_is(pseries) && !machine_is(chrp))
return -ENODEV;
> rtas_node = of_find_node_by_name(NULL, "rtas");
> if (rtas_node == NULL)
> return -ENODEV;
And given this check I wonder why we need the platform check at all. It
should be safe to just remove it.
^ permalink raw reply
* Re: JFFS2 on Lite5200
From: Andrey Volkov @ 2006-10-17 13:54 UTC (permalink / raw)
To: dedekind; +Cc: Andrea Galbusera, linux-mtd, linuxppc-embedded
In-Reply-To: <1161092193.3260.61.camel@sauron>
Artem Bityutskiy wrote:
> On Tue, 2006-10-17 at 17:20 +0400, Andrey Volkov wrote:
>> P.S. Artem, I repeat, I sent this patch _HALF_YEAR_AGO_
>> how about to fix scan.c?
>
> Andrey,
>
> I am not JFFS2 maintainer, David Woodhouse is.
Ok, I'll keep it in mind.
>
> Just looked into your patch. I agree that it may make sense to teach
> JFFS2 to use only aligned addresses, but your patch changes
> include/asm-ppc/io.h which is probably not MTD's business.
> It probably
> makes sense to submit these changes to a PPC maintainer separately.
>
> A question - does this mean that one can write only 4-byte chunks to
> this NOR (?) flash?
>
No, MPC5200 could write any size chunks, but it must be aligned (same
restrictions as in SH4), and this restriction applied only to LPB, but
not SDRAM.
Also, I've in view that jffs2(jffs3 ?) read/write stuff already used
functions which MTD drivers exported, but jffs2_scan_dirent_node and
friends - doesn't.
Andrey
^ permalink raw reply
* Re: JFFS2 on Lite5200
From: Artem Bityutskiy @ 2006-10-17 13:36 UTC (permalink / raw)
To: Andrey Volkov; +Cc: Andrea Galbusera, linux-mtd, linuxppc-embedded
In-Reply-To: <4534D8A5.7060206@varma-el.com>
On Tue, 2006-10-17 at 17:20 +0400, Andrey Volkov wrote:
> P.S. Artem, I repeat, I sent this patch _HALF_YEAR_AGO_
> how about to fix scan.c?
Andrey,
I am not JFFS2 maintainer, David Woodhouse is.
Just looked into your patch. I agree that it may make sense to teach
JFFS2 to use only aligned addresses, but your patch changes
include/asm-ppc/io.h which is probably not MTD's business. It probably
makes sense to submit these changes to a PPC maintainer separately.
A question - does this mean that one can write only 4-byte chunks to
this NOR (?) flash?
--=20
Best regards,
Artem Bityutskiy (=D0=91=D0=B8=D1=82=D1=8E=D1=86=D0=BA=D0=B8=D0=B9 =D0=90=
=D1=80=D1=82=D1=91=D0=BC)
^ permalink raw reply
* Re: JFFS2 on Lite5200
From: Artem Bityutskiy @ 2006-10-17 14:18 UTC (permalink / raw)
To: Andrey Volkov; +Cc: Andrea Galbusera, linux-mtd, linuxppc-embedded
In-Reply-To: <4534D8A5.7060206@varma-el.com>
On Tue, 2006-10-17 at 17:20 +0400, Andrey Volkov wrote:
> Andrea, check ml archive, I already sent patch half-year ago
> (http://ozlabs.org/pipermail/linuxppc-embedded/2006-April/022566.html)
> Problem is in alignment/memcpy: JFFS2 code assumed that memory at
> unaligned addresses could be touched, but access to an external MMIO
> on MPC5200 _must_ be aligned (i.e. you could not read u32 from odd addres=
s).
>=20
> P.S. Artem, I repeat, I sent this patch _HALF_YEAR_AGO_
> how about to fix scan.c?
Just talked to David. Please, find the result of our discussion in my
edition below.
Strictly speaking, JFFS2 *does not* do anything wrong, so it should not
be fixed. Indeed, JFFS2 does have full right to use memcpy() for that.
The question is: does memcpy() make sense for flash adresses at your
board? Is it a valid operation for flash addresses at your board?
If the answer is yes - then please fix memcpy() for your platform.
If no - then please, do not pretend that your flash may be treated as
memory and fix your platform MTD driver. Namely, set point()/unpoint()
to NULL in your mapping driver - JFFS2 should work then.
--=20
Best regards,
Artem Bityutskiy (=D0=91=D0=B8=D1=82=D1=8E=D1=86=D0=BA=D0=B8=D0=B9 =D0=90=
=D1=80=D1=82=D1=91=D0=BC)
^ permalink raw reply
* Re: [PATCH] Slight refactor of interrupt mapping for FSL parts
From: Kumar Gala @ 2006-10-17 15:50 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-dev, Jeff Garzik
In-Reply-To: <Pine.LNX.4.61.0610170125160.10940@ld0175-tx32.am.freescale.net>
On Oct 17, 2006, at 1:27 AM, Andy Fleming wrote:
> * Cleaned up interrupt mapping a little by adding a helper
> function which parses the irq out of the device-tree, and puts
> it into a resource.
> * Changed the PHY Layer to use NO_IRQ instead of -1 for PHY_POLL.
> This means that polling will always be used if mapping the
> interrupt fails for any reason.
> * Changed the arch/ppc platform files to specify PHY_POLL, instead
> of -1
> * Changed the fixed phy to use PHY_IGNORE_INTERRUPT
> ---
> This is a respin of the patch to reply to comments from the community
>
> arch/powerpc/sysdev/fsl_soc.c | 27 +++++++++
> +----------------
> arch/ppc/platforms/85xx/mpc8540_ads.c | 4 ++--
> arch/ppc/platforms/85xx/mpc8560_ads.c | 4 ++--
> arch/ppc/platforms/85xx/mpc85xx_cds_common.c | 6 +++---
> arch/ppc/platforms/85xx/sbc8560.c | 2 +-
> arch/ppc/platforms/85xx/stx_gp3.c | 2 +-
> arch/ppc/platforms/85xx/tqm85xx.c | 4 ++--
> drivers/net/phy/fixed.c | 2 +-
> include/asm-powerpc/prom.h | 7 +++++++
> include/linux/phy.h | 7 ++++++-
> 10 files changed, 35 insertions(+), 30 deletions(-)
What about arch/ppc/platforms/83xx? also arch/ppc/platforms/
mpc8272ads_setup.c
[snip]
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 9447a57..4dbffe4 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -20,6 +20,7 @@ #define __PHY_H
>
> #include <linux/spinlock.h>
> #include <linux/device.h>
> +#include <asm/irq.h>
>
> #define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
> SUPPORTED_10baseT_Full | \
> @@ -37,7 +38,11 @@ #define PHY_GBIT_FEATURES (PHY_BASIC_FEA
> * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
> * the attached driver handles the interrupt
> */
> -#define PHY_POLL -1
> +#ifndef NO_IRQ
> +#define NO_IRQ 0
> +#endif
> +
> +#define PHY_POLL NO_IRQ
> #define PHY_IGNORE_INTERRUPT -2
>
> #define PHY_HAS_INTERRUPT 0x00000001
We really should run this by the larger kernel community
- k
^ permalink raw reply
* 2.6.19-rc2: known unfixed regressions (v2)
From: Adrian Bunk @ 2006-10-17 15:59 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Russell King, Thierry Vignaud, Jan Beulich, Andi Kleen,
linuxppc-dev, paulus, Jens Axboe, linux-visws-devel, Greg Banks,
Patrick Jefferson, Meelis Roos, Christian, art, linux-acpi,
Alan Cox, Michael S. Tsirkin, Ingo Molnar, jgarzik, Martin Lorenz,
len.brown, Olaf Hering, discuss, cpufreq, Alex Romosan,
Kenny Graunke, James.Bottomley, linux-fbdev-devel, linux-ide,
pazke, Jesper Juhl, Linux Kernel Mailing List, davej,
Mark Langsdorf
In-Reply-To: <Pine.LNX.4.64.0610130941550.3952@g5.osdl.org>
This email lists some known unfixed regressions in 2.6.19-rc2 compared
to 2.6.18 that are not yet fixed Linus' tree.
If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you caused a breakage or I'm considering you in any other way possibly
involved with one or more of these issues.
Due to the huge amount of recipients, please trim the Cc when answering.
Subject : ppc prep boot hang
References : http://lkml.org/lkml/2006/10/14/58
Submitter : Meelis Roos <mroos@linux.ee>
Status : unknown
Subject : X60s: BUG()s, lose ACPI events after suspend/resume
References : http://lkml.org/lkml/2006/10/10/39
Submitter : Martin Lorenz <martin@lorenz.eu.org>
Status : unknown
Subject : T60 stops triggering any ACPI events
References : http://lkml.org/lkml/2006/10/4/425
http://lkml.org/lkml/2006/10/16/262
Submitter : "Michael S. Tsirkin" <mst@mellanox.co.il>
Status : unknown
Subject : x86_64: build error: unknown pseudo-op: `.cfi_signal_frame'
References : http://lkml.org/lkml/2006/10/16/8
Submitter : Ingo Molnar <mingo@elte.hu>
Caused-By : Jan Beulich <jbeulich@novell.com>
Andi Kleen <ak@suse.de>
commit adf1423698f00d00b267f7dca8231340ce7d65ef
Status : Jan: That is nothing I added, I suppose Andi did.
But the fix is obvious and trivial.
Subject : undefined reference to highest_possible_node_id
References : http://lkml.org/lkml/2006/9/4/233
http://lkml.org/lkml/2006/10/15/11
Submitter : Olaf Hering <olaf@aepfle.de>
Caused-By : Greg Banks <gnb@melbourne.sgi.com>
commit 0f532f3861d2c4e5aa7dcd33fb18e9975eb28457
Status : unknown
Subject : many ARM compile failures after the post -rc1 IRQ patches
References : http://lkml.org/lkml/2006/10/15/29
http://armlinux.simtec.co.uk/kautobuild/2.6.19-rc2/index.html
Submitter : Russell King <rmk+lkml@arm.linux.org.uk>
Caused-By : David Howells <dhowells@redhat.com>
Status : unknown
Subject : CONFIG_X86_VOYAGER=y, CONFIG_SMP=n compile error
References : http://lkml.org/lkml/2006/10/7/51
Submitter : Jesper Juhl <jesper.juhl@gmail.com>
Caused-By : David Howells <dhowells@redhat.com>
commit 7d12e780e003f93433d49ce78cfedf4b4c52adc5
Status : unknown
Subject : CONFIG_X86_VISWS=y, CONFIG_SMP=n compile error
References : http://lkml.org/lkml/2006/10/7/51
Submitter : Jesper Juhl <jesper.juhl@gmail.com>
Caused-By : David Howells <dhowells@redhat.com>
commit 7d12e780e003f93433d49ce78cfedf4b4c52adc5
Status : unknown
Subject : sata-via doesn't detect anymore disks attached to VIA vt6421
References : http://bugzilla.kernel.org/show_bug.cgi?id=7255
Submitter : Thierry Vignaud <tvignaud@mandriva.com>
Status : unknown
Subject : SMP x86_64 boot problem
References : http://lkml.org/lkml/2006/9/28/330
http://lkml.org/lkml/2006/10/5/289
Submitter : art@usfltd.com
Status : submitter was asked to git bisect
result of bisecting seems to be wrong
Subject : monitor not active after boot
References : http://lkml.org/lkml/2006/10/5/338
Submitter : Olaf Hering <olaf@aepfle.de>
Caused-By : Antonino Daplas <adaplas@pol.net>
commit 346bc21026e7a92e1d7a4a1b3792c5e8b686133d
Status : unknown
Subject : unable to rip cd
References : http://lkml.org/lkml/2006/10/13/100
Submitter : Alex Romosan <romosan@sycorax.lbl.gov>
Status : unknown
Subject : ide-generic no longer finds marvell controller
References : http://bugzilla.kernel.org/show_bug.cgi?id=7353
Submitter : Kenny Graunke <kenny@whitecape.org>
Caused-By : Patrick Jefferson <henj@hp.com>
commit a4bea10eca68152e84ffc4eaeb9d20ec2ac34664
Handled-By : Alan Cox <alan@redhat.com>
Status : Alan is investigating
Subject : cpufreq not working on AMD K8
References : http://lkml.org/lkml/2006/10/10/114
Submitter : Christian <christiand59@web.de>
Handled-By : Mark Langsdorf <mark.langsdorf@amd.com>
Status : Mark is investigating
^ permalink raw reply
* Re: [Regression] cpu hotplug failed on kernel 2.6.19-rc2
From: Nathan Lynch @ 2006-10-17 16:12 UTC (permalink / raw)
To: Yao Fei Zhu; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <4534D7C6.2080402@cn.ibm.com>
Yao Fei Zhu wrote:
> Running cpu hotplug regression tsstcase lhcs_regression on kernel
> 2.6.19-rc2/IBM System p5 will fall into xmon.
Your subject implies this is a regression; what is the most recent
kernel that worked?
^ 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