* Re: [PATCH 1/3] powerpc: mv64x60 - Fix PCI MEM->System Mem window setup
From: Paul Mackerras @ 2007-11-13 2:59 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20071108015415.GA14900@mag.az.mvista.com>
Mark A. Greer writes:
> mv64x60_config_pci_windows() is now changed to make the windows match
> as described above.
>
> Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Are any of this series required for 2.6.24?
Paul.
^ permalink raw reply
* how to improve linux tcp/ip(UDP) efficiency on mpc8541 833Mhz.
From: huangyun @ 2007-11-13 2:48 UTC (permalink / raw)
To: linuxppc-embedded
hi,everbody:
I have run linux-2.6.15 on my mpc8541 custom board. but when i test
TSEC use UDP, i found it's efficinecy is lower.
my test enviroment: i only run a UDP recieve program and not to handle data
recieved. when i recevie 400Mbps data, 79% of MPC8541 have be consumed.
so i think tcp/ip protocal have consume my mpc8541 resource. i dont know
how to improve tcp/ip code or TSEC driver(gianfar.c).
can somebody help me ?
lucky.huang
^ permalink raw reply
* Re: MPC5200B - Mapping Micrel Ethernet Controller Chip
From: Grant Likely @ 2007-11-13 3:50 UTC (permalink / raw)
To: Sri nava kala devi Valteti, TLS-Chennai
Cc: Prakash Palanisamy, TLS-Chennai, linuxppc-embedded
In-Reply-To: <66E8AEE9980BB44CA5FCAD39EBA56AC602D55576@CHN-HCLT-EVS02.HCLT.CORP.HCL.IN>
On 11/12/07, Sri nava kala devi Valteti, TLS-Chennai
<srinavakalav@hcl.in> wrote:
>
> We are using MPC5200B based custom board. In that we have an external Micrel's ethernet controller mapped at 0xE0000000.
>
> We have taken Lite5200 code as a reference to port linux to our new board. We have integrated the ethernet driver given by the vendor (Micrel).
>
> Unfortunately, we are not able to access the chip mapped at 0xE0000000.
Are you *sure* it's mapped at physical address 0xe0000000? (ie. have
you verified that you can access the device registers via u-boot or a
debugger?) The chip selects on the 5200 are programmable so you need
to make sure that the chip select wired to the Micrel device is
actually configured for base address 0xe0000000.
There are up to 8 CS pins on the MPC5200B; LP_CS0 through LP_CS7. See
section 9.7.1 in the MPC5200B user manual for details on how to
configure them.
> We performed the following steps to access the chip:
>
> i) We mapped this address range of the Ethernet Controller Chip in function "mpc52xx_map_io" as
>
> "io_block_mapping(0xE0000000, 0xE0000000, 0x10000000, _PAGE_IO)"
You don't want to call this. ioremap is the only function you should
need to call. But *first*, you must make sure the CS pin is
configured correctly.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* Re: [PATCH] [POWERPC] Optimize counting distinct entries in therelocation sections
From: Rusty Russell @ 2007-11-13 4:27 UTC (permalink / raw)
To: Paul Mackerras; +Cc: sfr, linuxppc-embedded, linuxppc-dev
In-Reply-To: <18233.4267.193447.339119@cargo.ozlabs.ibm.com>
On Tuesday 13 November 2007 13:49:15 Paul Mackerras wrote:
> Medve Emilian writes:
> > Seems like there are R_PPC_REL24 with r_addend != 0. Within a set of 41
> > modules (featuring 5457 R_PPC_REL24 relocations) already included within
> > the kernel tree I found 37 such relocations (R_PPC_REL24) with r_addend
> > != 0. In my test case, from 35K relocations, 7K are R_PPC_REL24 and from
> > those only 8 have r_addend != 0.
>
> I did a quick scan and the ones with r_addend != 0 all seem to be
> references to .text from the .init.text, .exit.text or .fixup
> sections. Assuming we can get those allocated near each other they
> shouldn't need trampolines.
>
> Rusty, do we manage to put .init.text and .fixup near .text?
Definitely not. That's why we trampoline between them. But since we discard
the init sections and the tramps with them, I wouldn't bother uniquifing
them: just alloc that many.
> Also, do you know what we see in r_info for a relocation that is
> relative to a section rather than a symbol?
Can't remember off the top of my head, sorry.
Rusty.
^ permalink raw reply
* [PATCH] [POWERPC] Silence an annoying boot message
From: Stephen Rothwell @ 2007-11-13 4:41 UTC (permalink / raw)
To: paulus; +Cc: Olof Johansson, ppc-dev
In-Reply-To: <1194857556.18185.33.camel@pasglop>
vmemmap_populate will printk (with KERN_WARNING) for a lot of pages
if CONFIG_SPARSEMEM_VMEMMAP is enabled (at least it does on iSeries).
Use pr_debug for it instead.
Replace the only other use of DBG in this file with pr_debug as well.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/mm/init_64.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index d9c82d3..c0f5cff 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -19,8 +19,6 @@
*
*/
-#undef DEBUG
-
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
@@ -66,12 +64,6 @@
#include "mmu_decl.h"
-#ifdef DEBUG
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
#if PGTABLE_RANGE > USER_VSID_RANGE
#warning Limited user VSID range means pagetable space is wasted
#endif
@@ -175,8 +167,8 @@ void pgtable_cache_init(void)
int size = pgtable_cache_size[i];
const char *name = pgtable_cache_name[i];
- DBG("Allocating page table cache %s (#%d) "
- "for size: %08x...\n", name, i, size);
+ pr_debug("Allocating page table cache %s (#%d) "
+ "for size: %08x...\n", name, i, size);
pgtable_cache[i] = kmem_cache_create(name,
size, size,
SLAB_PANIC,
@@ -239,8 +231,8 @@ int __meminit vmemmap_populate(struct page *start_page,
if (!p)
return -ENOMEM;
- printk(KERN_WARNING "vmemmap %08lx allocated at %p, "
- "physical %08lx.\n", start, p, __pa(p));
+ pr_debug("vmemmap %08lx allocated at %p, physical %08lx.\n",
+ start, p, __pa(p));
mapped = htab_bolt_mapping(start, start + page_size,
__pa(p), mode_rw, mmu_linear_psize,
--
1.5.3.5
^ permalink raw reply related
* [PATCH 1/2] powerpc: Make isa_mem_base common to 32 and 64 bits
From: Benjamin Herrenschmidt @ 2007-11-13 4:43 UTC (permalink / raw)
To: linuxppc-dev
This defines isa_mem_base on both 32 and 64 bits (it used to be 32 bits
only). This avoids a few ifdef's in later patches and potentially can
allow support for VGA text mode on 64 bits powerpc.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Small cleanup pre-requisite for my next patch
arch/powerpc/kernel/pci-common.c | 4 ++++
arch/powerpc/kernel/pci_32.c | 1 -
include/asm-powerpc/io.h | 5 +++--
3 files changed, 7 insertions(+), 3 deletions(-)
Index: linux-work/arch/powerpc/kernel/pci-common.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci-common.c 2007-11-13 14:11:11.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci-common.c 2007-11-13 14:15:43.000000000 +1100
@@ -52,6 +52,10 @@ int global_phb_number; /* Global phb co
extern struct list_head hose_list;
+/* ISA Memory physical address (or 0 if none) */
+resource_size_t isa_mem_base = 0;
+
+
/*
* pci_controller(phb) initialized common variables.
*/
Index: linux-work/include/asm-powerpc/io.h
===================================================================
--- linux-work.orig/include/asm-powerpc/io.h 2007-11-13 14:12:01.000000000 +1100
+++ linux-work/include/asm-powerpc/io.h 2007-11-13 14:12:48.000000000 +1100
@@ -50,15 +50,16 @@ extern int check_legacy_ioport(unsigned
#define PCI_DRAM_OFFSET pci_dram_offset
#else
#define _IO_BASE pci_io_base
-#define _ISA_MEM_BASE 0
+#define _ISA_MEM_BASE isa_mem_base
#define PCI_DRAM_OFFSET 0
#endif
extern unsigned long isa_io_base;
-extern unsigned long isa_mem_base;
extern unsigned long pci_io_base;
extern unsigned long pci_dram_offset;
+extern resource_size_t isa_mem_base;
+
#if defined(CONFIG_PPC32) && defined(CONFIG_PPC_INDIRECT_IO)
#error CONFIG_PPC_INDIRECT_IO is not yet supported on 32 bits
#endif
Index: linux-work/arch/powerpc/kernel/pci_32.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci_32.c 2007-11-13 14:16:15.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci_32.c 2007-11-13 14:16:17.000000000 +1100
@@ -32,7 +32,6 @@
#endif
unsigned long isa_io_base = 0;
-unsigned long isa_mem_base = 0;
unsigned long pci_dram_offset = 0;
int pcibios_assign_bus_offset = 1;
^ permalink raw reply
* [PATCH 2/2] powerpc: Merge pci_process_bridge_OF_ranges()
From: Benjamin Herrenschmidt @ 2007-11-13 4:43 UTC (permalink / raw)
To: linuxppc-dev
This patch merges the 32 and 64 bits implementations of
pci_process_bridge_OF_ranges(). The new function is cleaner than both
the old ones supports 64 bits ranges on ppc32 which is necessary for
the 4xx port.
It also adds some better (hopefully) output to the kernel log which
should help disagnose problems and makes better use of existing OF
parsing helpers (avoiding a few bugs of both implementations along
the way).
There are still a few unfortunate ifdef's but there is no way around
these for now at least not until some other bits of the PCI code are
made common.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Tested on a few pSeries, PowerMac G5, and a 32 bits PowerMacs and
a BriQ. Please let me know if it misbehaves anywhere else.
arch/powerpc/kernel/pci-common.c | 176 +++++++++++++++++++++++++++++++++++++++
arch/powerpc/kernel/pci_32.c | 114 -------------------------
arch/powerpc/kernel/pci_64.c | 93 --------------------
include/asm-powerpc/pci-bridge.h | 1
4 files changed, 177 insertions(+), 207 deletions(-)
Index: linux-work/arch/powerpc/kernel/pci-common.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci-common.c 2007-11-13 14:15:43.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci-common.c 2007-11-13 14:41:54.000000000 +1100
@@ -479,3 +479,179 @@ void pci_resource_to_user(const struct p
*start = rsrc->start - offset;
*end = rsrc->end - offset;
}
+
+/**
+ * pci_process_bridge_OF_ranges - Parse PCI bridge resources from device tree
+ * @hose: newly allocated pci_controller to be setup
+ * @dev: device node of the host bridge
+ * @primary: set if primary bus (32 bits only, soon to be deprecated)
+ *
+ * This function will parse the "ranges" property of a PCI host bridge device
+ * node and setup the resource mapping of a pci controller based on its
+ * content.
+ *
+ * Life would be boring if it wasn't for a few issues that we have to deal
+ * with here:
+ *
+ * - We can only cope with one IO space range and up to 3 Memory space
+ * ranges. However, some machines (thanks Apple !) tend to split their
+ * space into lots of small contiguous ranges. So we have to coalesce.
+ *
+ * - We can only cope with all memory ranges having the same offset
+ * between CPU addresses and PCI addresses. Unfortunately, some bridges
+ * are setup for a large 1:1 mapping along with a small "window" which
+ * maps PCI address 0 to some arbitrary high address of the CPU space in
+ * order to give access to the ISA memory hole.
+ * The way out of here that I've chosen for now is to always set the
+ * offset based on the first resource found, then override it if we
+ * have a different offset and the previous was set by an ISA hole.
+ *
+ * - Some busses have IO space not starting at 0, which causes trouble with
+ * the way we do our IO resource renumbering. The code somewhat deals with
+ * it for 64 bits but I would expect problems on 32 bits.
+ *
+ * - Some 32 bits platforms such as 4xx can have physical space larger than
+ * 32 bits so we need to use 64 bits values for the parsing
+ */
+void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
+ struct device_node *dev,
+ int primary)
+{
+ const u32 *ranges;
+ int rlen;
+ int pna = of_n_addr_cells(dev);
+ int np = pna + 5;
+ int memno = 0, isa_hole = -1;
+ u32 pci_space;
+ unsigned long long pci_addr, cpu_addr, pci_next, cpu_next, size;
+ unsigned long long isa_mb = 0;
+ struct resource *res;
+
+ printk(KERN_INFO "PCI host bridge %s %s ranges:\n",
+ dev->full_name, primary ? "(primary)" : "");
+
+ /* Get ranges property */
+ ranges = of_get_property(dev, "ranges", &rlen);
+ if (ranges == NULL)
+ return;
+
+ /* Parse it */
+ while ((rlen -= np * 4) >= 0) {
+ /* Read next ranges element */
+ pci_space = ranges[0];
+ pci_addr = of_read_number(ranges + 1, 2);
+ cpu_addr = of_translate_address(dev, ranges + 3);
+ size = of_read_number(ranges + pna + 3, 2);
+ ranges += np;
+ if (cpu_addr == OF_BAD_ADDR || size == 0)
+ continue;
+
+ /* Now consume following elements while they are contiguous */
+ for (;rlen >= np * sizeof(u32); ranges += np, rlen -= np * 4) {
+ if (ranges[0] != pci_space)
+ break;
+ pci_next = of_read_number(ranges + 1, 2);
+ cpu_next = of_translate_address(dev, ranges + 3);
+ if (pci_next != pci_addr + size ||
+ cpu_next != cpu_addr + size)
+ break;
+ size += of_read_number(ranges + pna + 3, 2);
+ }
+
+ /* Act based on address space type */
+ res = NULL;
+ switch ((pci_space >> 24) & 0x3) {
+ case 1: /* PCI IO space */
+ printk(KERN_INFO
+ " IO 0x%016llx..0x%016llx -> 0x%016llx\n",
+ cpu_addr, cpu_addr + size - 1, pci_addr);
+
+ /* We support only one IO range */
+ if (hose->pci_io_size) {
+ printk(KERN_WARNING
+ " \\--> Skipped (too many) !\n");
+ continue;
+ }
+#ifdef CONFIG_PPC32
+ /* On 32 bits, limit I/O space to 16MB */
+ if (size > 0x01000000)
+ size = 0x01000000;
+
+ /* 32 bits needs to map IOs here */
+ hose->io_base_virt = ioremap(cpu_addr, size);
+
+ /* Expect trouble if pci_addr is not 0 */
+ if (primary)
+ isa_io_base =
+ (unsigned long)hose->io_base_virt;
+#endif /* CONFIG_PPC32 */
+ /* pci_io_size and io_base_phys always represent IO
+ * space starting at 0 so we factor in pci_addr
+ */
+ hose->pci_io_size = pci_addr + size;
+ hose->io_base_phys = cpu_addr - pci_addr;
+
+ /* Build resource */
+ res = &hose->io_resource;
+ res->flags = IORESOURCE_IO;
+ res->start = pci_addr;
+ break;
+ case 2: /* PCI Memory space */
+ printk(KERN_INFO
+ " MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n",
+ cpu_addr, cpu_addr + size - 1, pci_addr,
+ (pci_space & 0x40000000) ? "Prefetch" : "");
+
+ /* We support only 3 memory ranges */
+ if (memno >= 3) {
+ printk(KERN_WARNING
+ " \\--> Skipped (too many) !\n");
+ continue;
+ }
+ /* Handles ISA memory hole space here */
+ if (pci_addr == 0) {
+ isa_mb = cpu_addr;
+ isa_hole = memno;
+ if (primary)
+ isa_mem_base = cpu_addr;
+ }
+
+ /* We get the PCI/Mem offset from the first range or the,
+ * current one if the offset came from an ISA hole.
+ * If they don't match, bugger.
+ */
+ if (memno == 0 ||
+ (isa_hole >= 0 && pci_addr != 0 &&
+ hose->pci_mem_offset == isa_mb))
+ hose->pci_mem_offset = cpu_addr - pci_addr;
+ else if (pci_addr != 0 &&
+ hose->pci_mem_offset != cpu_addr - pci_addr) {
+ printk(KERN_WARNING
+ " \\--> Skipped (offset mismatch) !\n");
+ continue;
+ }
+
+ /* Build resource */
+ res = &hose->mem_resources[memno++];
+ res->flags = IORESOURCE_MEM;
+ if (pci_space & 0x40000000)
+ res->flags |= IORESOURCE_PREFETCH;
+ res->start = cpu_addr;
+ break;
+ }
+ if (res != NULL) {
+ res->name = dev->full_name;
+ res->end = res->start + size - 1;
+ res->parent = NULL;
+ res->sibling = NULL;
+ res->child = NULL;
+ }
+ }
+
+ /* Out of paranoia, let's put the ISA hole last if any */
+ if (isa_hole >= 0 && memno > 0 && isa_hole != (memno-1)) {
+ struct resource tmp = hose->mem_resources[isa_hole];
+ hose->mem_resources[isa_hole] = hose->mem_resources[memno-1];
+ hose->mem_resources[memno-1] = tmp;
+ }
+}
Index: linux-work/arch/powerpc/kernel/pci_32.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci_32.c 2007-11-13 14:16:17.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci_32.c 2007-11-13 14:16:24.000000000 +1100
@@ -842,120 +842,6 @@ pci_device_from_OF_node(struct device_no
}
EXPORT_SYMBOL(pci_device_from_OF_node);
-void __init
-pci_process_bridge_OF_ranges(struct pci_controller *hose,
- struct device_node *dev, int primary)
-{
- static unsigned int static_lc_ranges[256] __initdata;
- const unsigned int *dt_ranges;
- unsigned int *lc_ranges, *ranges, *prev, size;
- int rlen = 0, orig_rlen;
- int memno = 0;
- struct resource *res;
- int np, na = of_n_addr_cells(dev);
- np = na + 5;
-
- /* First we try to merge ranges to fix a problem with some pmacs
- * that can have more than 3 ranges, fortunately using contiguous
- * addresses -- BenH
- */
- dt_ranges = of_get_property(dev, "ranges", &rlen);
- if (!dt_ranges)
- return;
- /* Sanity check, though hopefully that never happens */
- if (rlen > sizeof(static_lc_ranges)) {
- printk(KERN_WARNING "OF ranges property too large !\n");
- rlen = sizeof(static_lc_ranges);
- }
- lc_ranges = static_lc_ranges;
- memcpy(lc_ranges, dt_ranges, rlen);
- orig_rlen = rlen;
-
- /* Let's work on a copy of the "ranges" property instead of damaging
- * the device-tree image in memory
- */
- ranges = lc_ranges;
- prev = NULL;
- while ((rlen -= np * sizeof(unsigned int)) >= 0) {
- if (prev) {
- if (prev[0] == ranges[0] && prev[1] == ranges[1] &&
- (prev[2] + prev[na+4]) == ranges[2] &&
- (prev[na+2] + prev[na+4]) == ranges[na+2]) {
- prev[na+4] += ranges[na+4];
- ranges[0] = 0;
- ranges += np;
- continue;
- }
- }
- prev = ranges;
- ranges += np;
- }
-
- /*
- * The ranges property is laid out as an array of elements,
- * each of which comprises:
- * cells 0 - 2: a PCI address
- * cells 3 or 3+4: a CPU physical address
- * (size depending on dev->n_addr_cells)
- * cells 4+5 or 5+6: the size of the range
- */
- ranges = lc_ranges;
- rlen = orig_rlen;
- while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
- res = NULL;
- size = ranges[na+4];
- switch ((ranges[0] >> 24) & 0x3) {
- case 1: /* I/O space */
- if (ranges[2] != 0)
- break;
- hose->io_base_phys = ranges[na+2];
- /* limit I/O space to 16MB */
- if (size > 0x01000000)
- size = 0x01000000;
- hose->io_base_virt = ioremap(ranges[na+2], size);
- if (primary)
- isa_io_base = (unsigned long) hose->io_base_virt;
- res = &hose->io_resource;
- res->flags = IORESOURCE_IO;
- res->start = ranges[2];
- DBG("PCI: IO 0x%llx -> 0x%llx\n",
- (u64)res->start, (u64)res->start + size - 1);
- break;
- case 2: /* memory space */
- memno = 0;
- if (ranges[1] == 0 && ranges[2] == 0
- && ranges[na+4] <= (16 << 20)) {
- /* 1st 16MB, i.e. ISA memory area */
- if (primary)
- isa_mem_base = ranges[na+2];
- memno = 1;
- }
- while (memno < 3 && hose->mem_resources[memno].flags)
- ++memno;
- if (memno == 0)
- hose->pci_mem_offset = ranges[na+2] - ranges[2];
- if (memno < 3) {
- res = &hose->mem_resources[memno];
- res->flags = IORESOURCE_MEM;
- if(ranges[0] & 0x40000000)
- res->flags |= IORESOURCE_PREFETCH;
- res->start = ranges[na+2];
- DBG("PCI: MEM[%d] 0x%llx -> 0x%llx\n", memno,
- (u64)res->start, (u64)res->start + size - 1);
- }
- break;
- }
- if (res != NULL) {
- res->name = dev->full_name;
- res->end = res->start + size - 1;
- res->parent = NULL;
- res->sibling = NULL;
- res->child = NULL;
- }
- ranges += np;
- }
-}
-
/* We create the "pci-OF-bus-map" property now so it appears in the
* /proc device tree
*/
Index: linux-work/arch/powerpc/kernel/pci_64.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci_64.c 2007-11-13 14:15:43.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci_64.c 2007-11-13 14:16:24.000000000 +1100
@@ -592,99 +592,6 @@ int pci_proc_domain(struct pci_bus *bus)
}
}
-void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
- struct device_node *dev, int prim)
-{
- const unsigned int *ranges;
- unsigned int pci_space;
- unsigned long size;
- int rlen = 0;
- int memno = 0;
- struct resource *res;
- int np, na = of_n_addr_cells(dev);
- unsigned long pci_addr, cpu_phys_addr;
-
- np = na + 5;
-
- /* From "PCI Binding to 1275"
- * The ranges property is laid out as an array of elements,
- * each of which comprises:
- * cells 0 - 2: a PCI address
- * cells 3 or 3+4: a CPU physical address
- * (size depending on dev->n_addr_cells)
- * cells 4+5 or 5+6: the size of the range
- */
- ranges = of_get_property(dev, "ranges", &rlen);
- if (ranges == NULL)
- return;
- hose->io_base_phys = 0;
- while ((rlen -= np * sizeof(unsigned int)) >= 0) {
- res = NULL;
- pci_space = ranges[0];
- pci_addr = ((unsigned long)ranges[1] << 32) | ranges[2];
- cpu_phys_addr = of_translate_address(dev, &ranges[3]);
- size = ((unsigned long)ranges[na+3] << 32) | ranges[na+4];
- ranges += np;
- if (size == 0)
- continue;
-
- /* Now consume following elements while they are contiguous */
- while (rlen >= np * sizeof(unsigned int)) {
- unsigned long addr, phys;
-
- if (ranges[0] != pci_space)
- break;
- addr = ((unsigned long)ranges[1] << 32) | ranges[2];
- phys = ranges[3];
- if (na >= 2)
- phys = (phys << 32) | ranges[4];
- if (addr != pci_addr + size ||
- phys != cpu_phys_addr + size)
- break;
-
- size += ((unsigned long)ranges[na+3] << 32)
- | ranges[na+4];
- ranges += np;
- rlen -= np * sizeof(unsigned int);
- }
-
- switch ((pci_space >> 24) & 0x3) {
- case 1: /* I/O space */
- hose->io_base_phys = cpu_phys_addr - pci_addr;
- /* handle from 0 to top of I/O window */
- hose->pci_io_size = pci_addr + size;
-
- res = &hose->io_resource;
- res->flags = IORESOURCE_IO;
- res->start = pci_addr;
- DBG("phb%d: IO 0x%lx -> 0x%lx\n", hose->global_number,
- res->start, res->start + size - 1);
- break;
- case 2: /* memory space */
- memno = 0;
- while (memno < 3 && hose->mem_resources[memno].flags)
- ++memno;
-
- if (memno == 0)
- hose->pci_mem_offset = cpu_phys_addr - pci_addr;
- if (memno < 3) {
- res = &hose->mem_resources[memno];
- res->flags = IORESOURCE_MEM;
- res->start = cpu_phys_addr;
- DBG("phb%d: MEM 0x%lx -> 0x%lx\n", hose->global_number,
- res->start, res->start + size - 1);
- }
- break;
- }
- if (res != NULL) {
- res->name = dev->full_name;
- res->end = res->start + size - 1;
- res->parent = NULL;
- res->sibling = NULL;
- res->child = NULL;
- }
- }
-}
#ifdef CONFIG_HOTPLUG
Index: linux-work/include/asm-powerpc/pci-bridge.h
===================================================================
--- linux-work.orig/include/asm-powerpc/pci-bridge.h 2007-11-13 14:15:43.000000000 +1100
+++ linux-work/include/asm-powerpc/pci-bridge.h 2007-11-13 14:16:24.000000000 +1100
@@ -27,6 +27,7 @@ struct pci_controller {
void __iomem *io_base_virt;
resource_size_t io_base_phys;
+ resource_size_t pci_io_size;
/* Some machines (PReP) have a non 1:1 mapping of
* the PCI memory space in the CPU bus space
^ permalink raw reply
* Re: [PATCH] Xilinx TEMAC driver
From: John Williams @ 2007-11-13 4:38 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <fa686aa40707242129p1b5f5299i44818ead5ed4d2f3@mail.gmail.com>
Hi David, GRant
Grant Likely wrote:
> On 7/24/07, David H. Lynch Jr. <dhlii@dlasys.net> wrote:
>
>> Hopefully this is not too much of a mess.
> Hooray! Thanks for posting your work. I'm keen to try this on my
> platform. Comments below.
>
[snip]
Any progress on the ll_temac driver since July? In EDK9.2, ll_temac is
really the only supported ethernet solution, apart from ethernet lite
(yuck).
If there's a PPC version in a reasonable state, i'm happy to see what's
requierd to port it across to MicroBlaze.
cheers,
John
^ permalink raw reply
* Re: [PATCH] [POWERPC] Silence an annoying boot message
From: Olof Johansson @ 2007-11-13 4:51 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus
In-Reply-To: <20071113154149.ef77d37f.sfr@canb.auug.org.au>
On Tue, Nov 13, 2007 at 03:41:49PM +1100, Stephen Rothwell wrote:
> vmemmap_populate will printk (with KERN_WARNING) for a lot of pages
> if CONFIG_SPARSEMEM_VMEMMAP is enabled (at least it does on iSeries).
> Use pr_debug for it instead.
>
> Replace the only other use of DBG in this file with pr_debug as well.
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Olof Johansson <olof@lixom.net>
-Olof
^ permalink raw reply
* Re: [PATCH v2] fix multiple bugs in rtas_ibm_suspend_me code
From: Paul Mackerras @ 2007-11-13 5:11 UTC (permalink / raw)
To: Nathan Lynch; +Cc: linuxppc-dev
In-Reply-To: <20071109204408.GS9695@localdomain>
Nathan Lynch writes:
> There are several issues with the rtas_ibm_suspend_me code, which
> enables platform-assisted suspension of an LPAR for migration or
> hibernation as covered in PAPR 2.2.
On a uniprocessor configuration, with this patch I get:
CC arch/powerpc/kernel/rtas.o
/home/paulus/kernel/powerpc/arch/powerpc/kernel/rtas.c: In function ‘rtas_percpu_suspend_me’:
/home/paulus/kernel/powerpc/arch/powerpc/kernel/rtas.c:702: error: implicit declaration of function ‘get_hard_smp_processor_id’
make[2]: *** [arch/powerpc/kernel/rtas.o] Error 1
I think you need to #include <asm/smp.h> in rtas.c.
Paul.
^ permalink raw reply
* Re: [PATCH 2/2] powerpc: Merge pci_process_bridge_OF_ranges()
From: Stephen Rothwell @ 2007-11-13 5:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071113044432.F1389DDE2E@ozlabs.org>
[-- Attachment #1: Type: text/plain, Size: 606 bytes --]
On Tue, 13 Nov 2007 15:43:51 +1100 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> Tested on a few pSeries, PowerMac G5, and a 32 bits PowerMacs and
> a BriQ. Please let me know if it misbehaves anywhere else.
It seems to work fine on my legacy iSeries (iseries_defconfig and
ppc64_defconfig), though I only have one PCI device.
Due to another patch I have, I changed pci_io_size to be a
reasource_size_t on 64 bit as well which should be a noop as it was
unsigned long.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH][POWERPC] pSeries: remove dependency on pci_dn bussubno
From: Stephen Rothwell @ 2007-11-13 5:31 UTC (permalink / raw)
To: ppc-dev
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/pseries/iommu.c | 24 +++++++-----------------
1 files changed, 7 insertions(+), 17 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index d4e9d85..ebb9313 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -296,11 +296,12 @@ static void iommu_table_setparms(struct pci_controller *phb,
static void iommu_table_setparms_lpar(struct pci_controller *phb,
struct device_node *dn,
struct iommu_table *tbl,
- const void *dma_window)
+ const void *dma_window,
+ int bussubno)
{
unsigned long offset, size;
- tbl->it_busno = PCI_DN(dn)->bussubno;
+ tbl->it_busno = bussubno;
of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size);
tbl->it_base = 0;
@@ -420,17 +421,10 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
pdn->full_name, ppci->iommu_table);
if (!ppci->iommu_table) {
- /* Bussubno hasn't been copied yet.
- * Do it now because iommu_table_setparms_lpar needs it.
- */
-
- ppci->bussubno = bus->number;
-
tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
ppci->phb->node);
-
- iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
-
+ iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window,
+ bus->number);
ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
DBG(" created table: %p\n", ppci->iommu_table);
}
@@ -523,14 +517,10 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
pci = PCI_DN(pdn);
if (!pci->iommu_table) {
- /* iommu_table_setparms_lpar needs bussubno. */
- pci->bussubno = pci->phb->bus->number;
-
tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
pci->phb->node);
-
- iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
-
+ iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window,
+ pci->phb->bus->number);
pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
DBG(" created table: %p\n", pci->iommu_table);
} else {
--
1.5.3.5
^ permalink raw reply related
* [PATCH 1/2] [POWERPC] clean up pci-bidge.h
From: Stephen Rothwell @ 2007-11-13 5:34 UTC (permalink / raw)
To: ppc-dev
No semantic changes.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/asm-powerpc/pci-bridge.h | 95 +++++++++++++++++---------------------
1 files changed, 42 insertions(+), 53 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index dc31845..d28185e 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -1,16 +1,17 @@
#ifndef _ASM_POWERPC_PCI_BRIDGE_H
#define _ASM_POWERPC_PCI_BRIDGE_H
#ifdef __KERNEL__
-
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
#include <linux/pci.h>
#include <linux/list.h>
#include <linux/ioport.h>
#ifndef CONFIG_PPC64
-
-struct device_node;
-struct pci_controller;
-
/*
* Structure of a PCI controller (host bridge)
*/
@@ -51,11 +52,11 @@ struct pci_controller {
* set.
* BIG_ENDIAN - cfg_addr is a big endian register
*/
-#define PPC_INDIRECT_TYPE_SET_CFG_TYPE (0x00000001)
-#define PPC_INDIRECT_TYPE_EXT_REG (0x00000002)
-#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004)
-#define PPC_INDIRECT_TYPE_NO_PCIE_LINK (0x00000008)
-#define PPC_INDIRECT_TYPE_BIG_ENDIAN (0x00000010)
+#define PPC_INDIRECT_TYPE_SET_CFG_TYPE 0x00000001
+#define PPC_INDIRECT_TYPE_EXT_REG 0x00000002
+#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS 0x00000004
+#define PPC_INDIRECT_TYPE_NO_PCIE_LINK 0x00000008
+#define PPC_INDIRECT_TYPE_BIG_ENDIAN 0x00000010
u32 indirect_type;
/* Currently, we limit ourselves to 1 IO range and 3 mem
@@ -81,18 +82,18 @@ static inline int isa_vaddr_is_ioport(void __iomem *address)
/* These are used for config access before all the PCI probing
has been done. */
-int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
- int where, u8 *val);
-int early_read_config_word(struct pci_controller *hose, int bus, int dev_fn,
- int where, u16 *val);
-int early_read_config_dword(struct pci_controller *hose, int bus, int dev_fn,
- int where, u32 *val);
-int early_write_config_byte(struct pci_controller *hose, int bus, int dev_fn,
- int where, u8 val);
-int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn,
- int where, u16 val);
-int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
- int where, u32 val);
+extern int early_read_config_byte(struct pci_controller *hose, int bus,
+ int dev_fn, int where, u8 *val);
+extern int early_read_config_word(struct pci_controller *hose, int bus,
+ int dev_fn, int where, u16 *val);
+extern int early_read_config_dword(struct pci_controller *hose, int bus,
+ int dev_fn, int where, u32 *val);
+extern int early_write_config_byte(struct pci_controller *hose, int bus,
+ int dev_fn, int where, u8 val);
+extern int early_write_config_word(struct pci_controller *hose, int bus,
+ int dev_fn, int where, u16 val);
+extern int early_write_config_dword(struct pci_controller *hose, int bus,
+ int dev_fn, int where, u32 val);
extern int early_find_capability(struct pci_controller *hose, int bus,
int dev_fn, int cap);
@@ -104,15 +105,7 @@ extern void setup_grackle(struct pci_controller *hose);
extern void __init update_bridge_resource(struct pci_dev *dev,
struct resource *res);
-#else
-
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
+#else /* CONFIG_PPC64 */
/*
* Structure of a PCI controller (host bridge)
@@ -159,8 +152,8 @@ struct pci_controller {
* PCI stuff, for nodes representing PCI devices, pointed to
* by device_node->data.
*/
-struct pci_controller;
struct iommu_table;
+struct device_node;
struct pci_dn {
int busno; /* pci bus number */
@@ -179,9 +172,9 @@ struct pci_dn {
int eeh_mode; /* See eeh.h for possible EEH_MODEs */
int eeh_config_addr;
int eeh_pe_config_addr; /* new-style partition endpoint address */
- int eeh_check_count; /* # times driver ignored error */
- int eeh_freeze_count; /* # times this device froze up. */
- int eeh_false_positives; /* # times this device reported #ff's */
+ int eeh_check_count; /* # times driver ignored error */
+ int eeh_freeze_count; /* # times this device froze up. */
+ int eeh_false_positives; /* # times this device reported #ff's */
u32 config_space[16]; /* saved PCI config space */
#endif
};
@@ -189,7 +182,7 @@ struct pci_dn {
/* Get the pointer to a device_node's pci_dn */
#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)
-struct device_node *fetch_dev_dn(struct pci_dev *dev);
+extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
/* Get a device_node from a pci_dev. This code must be fast except
* in the case where the sysdata is incorrect and needs to be fixed
@@ -227,14 +220,14 @@ static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
}
/** Find the bus corresponding to the indicated device node */
-struct pci_bus * pcibios_find_pci_bus(struct device_node *dn);
+extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);
/** Remove all of the PCI devices under this bus */
-void pcibios_remove_pci_devices(struct pci_bus *bus);
+extern void pcibios_remove_pci_devices(struct pci_bus *bus);
/** Discover new pci devices under this bus, and add them */
-void pcibios_add_pci_devices(struct pci_bus * bus);
-void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus);
+extern void pcibios_add_pci_devices(struct pci_bus *bus);
+extern void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus);
extern int pcibios_remove_root_bus(struct pci_controller *phb);
@@ -271,20 +264,18 @@ extern int pcibios_map_io_space(struct pci_bus *bus);
#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1)
#endif
-#endif /* CONFIG_PPC64 */
+#endif /* CONFIG_PPC64 */
/* Get the PCI host controller for an OF device */
-extern struct pci_controller*
-pci_find_hose_for_OF_device(struct device_node* node);
+extern struct pci_controller *pci_find_hose_for_OF_device(
+ struct device_node* node);
/* Fill up host controller resources from the OF node */
-extern void
-pci_process_bridge_OF_ranges(struct pci_controller *hose,
- struct device_node *dev, int primary);
+extern void pci_process_bridge_OF_ranges(struct pci_controller *hose,
+ struct device_node *dev, int primary);
/* Allocate a new PCI host bridge structure */
-extern struct pci_controller *
-pcibios_alloc_controller(struct device_node *dev);
+extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev);
#ifdef CONFIG_PCI
extern unsigned long pci_address_to_pio(phys_addr_t address);
extern int pcibios_vaddr_is_ioport(void __iomem *address);
@@ -297,9 +288,7 @@ static inline int pcibios_vaddr_is_ioport(void __iomem *address)
{
return 0;
}
-#endif
+#endif /* CONFIG_PCI */
-
-
-#endif /* __KERNEL__ */
-#endif
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_PCI_BRIDGE_H */
--
1.5.3.5
^ permalink raw reply related
* [PATCH 2/2] [POWERPC] consolidate struct pci_controller
From: Stephen Rothwell @ 2007-11-13 5:37 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071113163427.2ab3fdb0.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/asm-powerpc/pci-bridge.h | 65 +++++++++++++-------------------------
1 files changed, 22 insertions(+), 43 deletions(-)
This one clashes slightly with Benh's "Merge pci_process_bridge_OF_ranges()"
patch.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index d28185e..b4e2a81 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -11,33 +11,44 @@
#include <linux/list.h>
#include <linux/ioport.h>
-#ifndef CONFIG_PPC64
/*
* Structure of a PCI controller (host bridge)
*/
struct pci_controller {
struct pci_bus *bus;
char is_dynamic;
+#ifdef CONFIG_PPC64
+ int node;
+#endif
void *arch_data;
struct list_head list_node;
struct device *parent;
int first_busno;
int last_busno;
+#ifndef CONFIG_PPC64
int self_busno;
+#endif
void __iomem *io_base_virt;
+#ifdef CONFIG_PPC64
+ void *io_base_alloc;
+#endif
resource_size_t io_base_phys;
/* Some machines (PReP) have a non 1:1 mapping of
* the PCI memory space in the CPU bus space
*/
resource_size_t pci_mem_offset;
+#ifdef CONFIG_PPC64
+ unsigned long pci_io_size;
+#endif
struct pci_ops *ops;
volatile unsigned int __iomem *cfg_addr;
volatile void __iomem *cfg_data;
+#ifndef CONFIG_PPC64
/*
* Used for variants of PCI indirect handling and possible quirks:
* SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1
@@ -58,15 +69,24 @@ struct pci_controller {
#define PPC_INDIRECT_TYPE_NO_PCIE_LINK 0x00000008
#define PPC_INDIRECT_TYPE_BIG_ENDIAN 0x00000010
u32 indirect_type;
-
+#endif /* !CONFIG_PPC64 */
/* Currently, we limit ourselves to 1 IO range and 3 mem
* ranges since the common pci_bus structure can't handle more
*/
struct resource io_resource;
struct resource mem_resources[3];
int global_number; /* PCI domain number */
+#ifdef CONFIG_PPC64
+ unsigned long buid;
+ unsigned long dma_window_base_cur;
+ unsigned long dma_window_size;
+
+ void *private_data;
+#endif /* CONFIG_PPC64 */
};
+#ifndef CONFIG_PPC64
+
static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
{
return bus->sysdata;
@@ -108,47 +128,6 @@ extern void __init update_bridge_resource(struct pci_dev *dev,
#else /* CONFIG_PPC64 */
/*
- * Structure of a PCI controller (host bridge)
- */
-struct pci_controller {
- struct pci_bus *bus;
- char is_dynamic;
- int node;
- void *arch_data;
- struct list_head list_node;
- struct device *parent;
-
- int first_busno;
- int last_busno;
-
- void __iomem *io_base_virt;
- void *io_base_alloc;
- resource_size_t io_base_phys;
-
- /* Some machines have a non 1:1 mapping of
- * the PCI memory space in the CPU bus space
- */
- resource_size_t pci_mem_offset;
- unsigned long pci_io_size;
-
- struct pci_ops *ops;
- volatile unsigned int __iomem *cfg_addr;
- volatile void __iomem *cfg_data;
-
- /* Currently, we limit ourselves to 1 IO range and 3 mem
- * ranges since the common pci_bus structure can't handle more
- */
- struct resource io_resource;
- struct resource mem_resources[3];
- int global_number;
- unsigned long buid;
- unsigned long dma_window_base_cur;
- unsigned long dma_window_size;
-
- void *private_data;
-};
-
-/*
* PCI stuff, for nodes representing PCI devices, pointed to
* by device_node->data.
*/
--
1.5.3.5
^ permalink raw reply related
* Re: [PATCH 2/2] powerpc: Merge pci_process_bridge_OF_ranges()
From: Olof Johansson @ 2007-11-13 7:06 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071113044432.F1389DDE2E@ozlabs.org>
On Tue, Nov 13, 2007 at 03:43:51PM +1100, Benjamin Herrenschmidt wrote:
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> Tested on a few pSeries, PowerMac G5, and a 32 bits PowerMacs and
> a BriQ. Please let me know if it misbehaves anywhere else.
Looks good on the eval boards I tested here.
Acked-by: Olof Johansson <olof@lixom.net>
^ permalink raw reply
* Re: small bootloader that passes arguments
From: Lorenz Kolb @ 2007-11-13 7:35 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <13712778.post@talk.nabble.com>
Hi,
the normal operation of a bootloader is:
memcpy() -- copy the programme to boot to some new location maybe some
decoding done here, too
jump_to_addr() -- the easiest way to jump to some address in a higher level
language is to make a function call to some pointer. You can pass arguments
to this function, that is what bootloaders like u-boot do.
Personally I would recommand you to use some small first-stage-loader
loading U-Boot and make U-Boot do the rest. There is a U-Boot 1.1.4 port on
Xilinx' website for some Xilinx boards that can easily be adapted to Your
board (if it is no yet supported), I guess.
You can find Xilinx' U-Boot-"tree" here:
http://www.xilinx.com/ml410-p/81i_19.5/designs/u-boot.zip
Regards,
Lorenz Kolb
khollan wrote:
>
> Hi,
>
> I would like to create a small bootloader that is able to pass kernel
> arguments and boot a linux kernel. Im using a xilinx PPC, and have
> already booted a working kernel with a Xilinx provided XMD bootloader over
> USB. My main question is how does a bootloader pass these arguments to
> the kernel before booting it? Most specifically the root=/dev/xsa1
> command so I can tell it to either boot from compact flash or NFS.
>
> I really don't want to try and port U-boot since I don't need the bells
> and whistles and I want it to fit in the BRAM of the FPGA so it will load
> when I load the hardware configuration.
>
--
View this message in context: http://www.nabble.com/small-bootloader-that-passes-arguments-tf4793411.html#a13721038
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [PATCH 2/2] [POWERPC] consolidate struct pci_controller
From: Olof Johansson @ 2007-11-13 8:06 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev
In-Reply-To: <20071113163707.cfefe98a.sfr@canb.auug.org.au>
On Tue, Nov 13, 2007 at 04:37:07PM +1100, Stephen Rothwell wrote:
> This one clashes slightly with Benh's "Merge pci_process_bridge_OF_ranges()"
> patch.
Hi Stephen,
For the small fields that use standard types, you should just be able
to still define them for ppc32 and just not use them. Alternatively,
if the 32-bit guys complain about wasted bytes of memory, bunch up the
ppc64-only fields together for a single ifdef.
-Olof
^ permalink raw reply
* Re: [PATCH 2/2] [POWERPC] consolidate struct pci_controller
From: Kumar Gala @ 2007-11-13 8:13 UTC (permalink / raw)
To: Olof Johansson; +Cc: Stephen Rothwell, ppc-dev
In-Reply-To: <20071113080631.GA17756@lixom.net>
On Nov 13, 2007, at 2:06 AM, Olof Johansson wrote:
> On Tue, Nov 13, 2007 at 04:37:07PM +1100, Stephen Rothwell wrote:
>
>> This one clashes slightly with Benh's "Merge
>> pci_process_bridge_OF_ranges()"
>> patch.
>
> Hi Stephen,
>
> For the small fields that use standard types, you should just be able
> to still define them for ppc32 and just not use them. Alternatively,
> if the 32-bit guys complain about wasted bytes of memory, bunch up the
> ppc64-only fields together for a single ifdef.
I doubt we'll complain too much for a struct that might have one or
two instances at most.
But I think the ifdef's might be useful to people to see what code
still needs to get merged between ppc32 & ppc64.
- k
^ permalink raw reply
* Re: printk/console_init
From: Geert Uytterhoeven @ 2007-11-13 8:16 UTC (permalink / raw)
To: Siva Prasad; +Cc: linuxppc-dev, linuxppc-embedded
In-Reply-To: <D83235F0F3C86D4D889D8B9A0DA8C6D7F73BF1@corpexc01.corp.networkrobots.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2724 bytes --]
On Mon, 12 Nov 2007, Siva Prasad wrote:
> I am using 2.6.19 Linux on 8641D based system.
>
> I am using early printk's and it works fine until console_init() is
> executed. After that it does not, as the early printk's get disabled,
> which is fine. However, I don't see any prints after that at all, that
> are based on regular printk statements. I looked directly into the
> memory at __log_buf and found all the print messages. It is just not
> coming out to the serial port properly.
>
> It would be great if some one can tell me various parameters that I need
> to consider changing, to successfully port the serial driver for a new
> board.
>
> Based on the early printk's, I am getting the following messages...
>
> Using MPC86xx HPCN machine description
> Total memory = 1024MB; using 2048kB for hash table (at cfe00000)
> Linux version 2.6.19 (sprasad@cider.bivio.net) (gcc version 4.1.1
> 20060525 (Red Hat 4.1.1-1)) #115 SMP Mon Nov 12 18:21:43 PST 2007
> Found legacy serial port 0 for /soc8641@ff700000/serial@4500
> mem=ff704500, taddr=ff704500, irq=1a, clk=1496250, speed=0
> Found MPC86xx PCIE host bridge at 0x00000000ff708000. Firmware bus
> number: 0->254
> Found MPC86xx PCIE host bridge at 0x00000000ff709000. Firmware bus
> number: 0->255
> MPC86xx HPCN board from Freescale Semiconductor
> Zone PFN ranges:
> DMA 0 -> 196608
> Normal 196608 -> 196608
> HighMem 196608 -> 262144
> early_node_map[1] active PFN ranges
> 0: 0 -> 262144
> start_kernel: 8 22000000.
> Built 1 zonelists. Total pages: 260096
> Kernel command line: console=ttyS0,115200 root=/dev/sda8
^^^^^^^^^^^^
> mpic: Setting up MPIC " MPIC " version 1.2 at ff740000, max 2 CPUs
> mpic: ISU size: 16, shift: 4, mask: f
> mpic: Initializing for 80 sources
> PID hash table entries: 4096 (order: 12, 16384 bytes)
> time_init: decrementer frequency = 150.000000 MHz
> time_init: processor frequency = 1496.250000 MHz
> <........ Nothing gets printed after this .......>
Did your serial driver (a) call register_console() (b) using the correct name?
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply
* Re: [PATCH 1/2] powerpc: Make isa_mem_base common to 32 and 64 bits
From: Geert Uytterhoeven @ 2007-11-13 8:18 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071113044429.461B1DDE2E@ozlabs.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1828 bytes --]
On Tue, 13 Nov 2007, Benjamin Herrenschmidt wrote:
> This defines isa_mem_base on both 32 and 64 bits (it used to be 32 bits
> only). This avoids a few ifdef's in later patches and potentially can
> allow support for VGA text mode on 64 bits powerpc.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> Small cleanup pre-requisite for my next patch
>
> arch/powerpc/kernel/pci-common.c | 4 ++++
> arch/powerpc/kernel/pci_32.c | 1 -
> include/asm-powerpc/io.h | 5 +++--
> 3 files changed, 7 insertions(+), 3 deletions(-)
>
> Index: linux-work/arch/powerpc/kernel/pci-common.c
> ===================================================================
> --- linux-work.orig/arch/powerpc/kernel/pci-common.c 2007-11-13 14:11:11.000000000 +1100
> +++ linux-work/arch/powerpc/kernel/pci-common.c 2007-11-13 14:15:43.000000000 +1100
> @@ -52,6 +52,10 @@ int global_phb_number; /* Global phb co
>
> extern struct list_head hose_list;
>
> +/* ISA Memory physical address (or 0 if none) */
^^^^^^^^^^^^
> +resource_size_t isa_mem_base = 0;
Let's hope this doesn't confuse too many people, as 0 is the valid value on
legacy PC hardware ;-)
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply
* Re: [PATCH 1/2] powerpc: Make isa_mem_base common to 32 and 64 bits
From: Benjamin Herrenschmidt @ 2007-11-13 9:55 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.62.0711130917350.31003@pademelon.sonytel.be>
> > +/* ISA Memory physical address (or 0 if none) */
> ^^^^^^^^^^^^
> > +resource_size_t isa_mem_base = 0;
>
> Let's hope this doesn't confuse too many people, as 0 is the valid value on
> legacy PC hardware ;-)
True, but that's been our default so far so I'm just not changing
existing behaviour. If it's bogus, it will need a separate fix.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 2/2] powerpc: Merge pci_process_bridge_OF_ranges()
From: Benjamin Herrenschmidt @ 2007-11-13 9:56 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev
In-Reply-To: <20071113070604.GA16842@lixom.net>
On Tue, 2007-11-13 at 01:06 -0600, Olof Johansson wrote:
> On Tue, Nov 13, 2007 at 03:43:51PM +1100, Benjamin Herrenschmidt wrote:
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > ---
> >
> > Tested on a few pSeries, PowerMac G5, and a 32 bits PowerMacs and
> > a BriQ. Please let me know if it misbehaves anywhere else.
>
> Looks good on the eval boards I tested here.
>
> Acked-by: Olof Johansson <olof@lixom.net>
Thanks for testing.
Ben.
^ permalink raw reply
* Re: printk/console_init
From: Benjamin Herrenschmidt @ 2007-11-13 10:01 UTC (permalink / raw)
To: Siva Prasad; +Cc: linuxppc-dev, linuxppc-embedded
In-Reply-To: <D83235F0F3C86D4D889D8B9A0DA8C6D7F73BF1@corpexc01.corp.networkrobots.com>
On Mon, 2007-11-12 at 18:54 -0800, Siva Prasad wrote:
> Hi,
>
> I am using 2.6.19 Linux on 8641D based system.
>
> I am using early printk's and it works fine until console_init() is
> executed. After that it does not, as the early printk's get disabled,
> which is fine. However, I don't see any prints after that at all, that
> are based on regular printk statements. I looked directly into the
> memory at __log_buf and found all the print messages. It is just not
> coming out to the serial port properly.
>
> It would be great if some one can tell me various parameters that I need
> to consider changing, to successfully port the serial driver for a new
> board.
>
> Based on the early printk's, I am getting the following messages...
You can use udbg-immortal to force the udbg early printk to stay around,
and then use printk to see what's going on with your serial driver.
Ben.
^ permalink raw reply
* MTD Devices
From: schardt @ 2007-11-13 10:29 UTC (permalink / raw)
To: Linux PPC Linux PPC
Hi again,
i have some problems to copy a cramfs image to flash. the situation as
follows:
cat /proc/mtd:
dev: size erasesize name
mtd0: 00180000 00010000 "kernel"
mtd1: 00280000 00010000 "rootfs"
cat /proc/partitions:
major minor #blocks name
254 0 62720 xsa
254 1 9840 xsa1
254 2 52864 xsa2
31 0 1536 mtdblock0
31 1 2560 mtdblock1
ls -l /dev/mtd*:
crw-r--r-- 1 root root 90, 0 Jan 1 00:14 /dev/mtd0
crw-r--r-- 1 root root 90, 2 Jan 1 00:21 /dev/mtd1
brw-r--r-- 1 root root 31, 0 Jan 1 00:01 /dev/mtdblock0
brw-r--r-- 1 root root 31, 1 Jan 1 00:08 /dev/mtdblock1
now, imho it is possible to make a
- eraseall /dev/mtd1 to erase the flash
- dd if=cramfs.img of=/dev/mtd1 to copy image to flash
but if i read the mtd1 device back, the flash is emtpy :(((
what is my mistake ?
Georg
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
Forschungszentrum Jülich GmbH
52425 Jülich
Sitz der Gesellschaft: Jülich
Eingetragen im Handelsregister des Amtsgerichts Düren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDirig'in Bärbel Brumme-Bothe
Geschäftsführung: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv.
Vorsitzender)
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
^ permalink raw reply
* (beginner) Kernel fail during local_irq_enable()
From: fabien @ 2007-11-13 11:04 UTC (permalink / raw)
To: linuxppc-embedded
I work on a custom board based on MPC8xx.
The bootloader on it is a ppcboot 1.1.5. I'm a beginner with Linux port
and ppc.
I'm trying to pass the board working with a 2.4.4 kernel to a 2.6.19 kernel
from denx.
The kernel hang when trying to enable interrupt in local_irq_enable()
in init/main.c.
Nothing happened after. Look at the printk log dumped from __log_buf
adresse with md ppcboot command.
PPCBoot 1.1.5 (May 3 2002 - 10:26:09)
CPU: PPC860TZPnnE0 at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC present
Board: FAST2100
DRAM: (16 MB SDRAM) 16 MB
FLASH: 4 MB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
=>bdinfo
memstart = 0x00000000
memsize = 0x01000000
flashstart = 0x02800000
flashsize = 0x00400000
flashoffset = 0x00020000
sramstart = 0x00000000
sramsize = 0x00000000
immr_base = 0xFF000000
bootflags = 0x00000001
intfreq = 50 MHz
busfreq = 50 MHz
ethaddr = 00:60:4C:08:21:FF
IP addr = 10.0.0.148
baudrate = 9600 bps
=>tftpboot 0x400000
ARP broadcast 1
TFTP from server 10.0.0.147; our IP address is 10.0.0.148
Filename 'uImage'.
Load address: 0x400000
Loading: #################################################################
#############################################
done
Bytes transferred = 561058 (88fa2 hex)
=>bootm 0x400000
## Booting image at 00400000 ...
Image Name: Linux-2.6.19.2
Created: 2007-11-12 15:08:44 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 560994 Bytes = 547 kB = 0 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
=>md 1273c4
001273c4: 3c353e4c 696e7578 20766572 73696f6e <5>Linux version
001273d4: 20322e36 2e31392e 32202866 61626965 2.6.19.2 (fabie
001273e4: 6e406c6f 63616c68 6f737429 20286763 n@localhost) (gc
001273f4: 63207665 7273696f 6e20342e 302e3020 c version 4.0.0
00127404: 2844454e 5820454c 444b2034 2e312034 (DENX ELDK 4.1 4
00127414: 2e302e30 29292023 3135204d 6f6e204e .0.0)) #15 Mon N
00127424: 6f762031 32203136 3a32323a 30382043 ov 12 16:22:08 C
00127434: 45542032 3030370a 3c373e45 6e746572 ET 2007.<7>Enter
00127444: 696e6720 6164645f 61637469 76655f72 ing add_active_r
00127454: 616e6765 28302c20 302c2034 30393629 ange(0, 0, 4096)
00127464: 20302065 6e747269 6573206f 66203235 0 entries of 25
00127474: 36207573 65640a3c 343e5a6f 6e652050 6 used.<4>Zone P
00127484: 464e2072 616e6765 733a0a3c 343e2020 FN ranges:.<4>
00127494: 444d4120 20202020 20202020 20202020 DMA
001274a4: 30202d3e 20202020 20343039 360a3c34 0 -> 4096.<4
001274b4: 3e20204e 6f726d61 6c202020 20202020 > Normal
=>
001274c4: 34303936 202d3e20 20202020 34303936 4096 -> 4096
001274d4: 0a3c343e 6561726c 795f6e6f 64655f6d .<4>early_node_m
001274e4: 61705b31 5d206163 74697665 2050464e ap[1] active PFN
001274f4: 2072616e 6765730a 3c343e20 20202030 ranges.<4> 0
00127504: 3a202020 20202020 2030202d 3e202020 : 0 ->
00127514: 20203430 39360a3c 373e4f6e 206e6f64 4096.<7>On nod
00127524: 65203020 746f7461 6c706167 65733a20 e 0 totalpages:
00127534: 34303936 0a3c373e 2020444d 41207a6f 4096.<7> DMA zo
00127544: 6e653a20 33322070 61676573 20757365 ne: 32 pages use
00127554: 6420666f 72206d65 6d6d6170 0a3c373e d for memmap.<7>
00127564: 2020444d 41207a6f 6e653a20 30207061 DMA zone: 0 pa
00127574: 67657320 72657365 72766564 0a3c373e ges reserved.<7>
00127584: 2020444d 41207a6f 6e653a20 34303634 DMA zone: 4064
00127594: 20706167 65732c20 4c49464f 20626174 pages, LIFO bat
001275a4: 63683a30 0a3c373e 20204e6f 726d616c ch:0.<7> Normal
001275b4: 207a6f6e 653a2030 20706167 65732075 zone: 0 pages u
=>
001275c4: 73656420 666f7220 6d656d6d 61700a3c sed for memmap.<
001275d4: 343e4275 696c7420 31207a6f 6e656c69 4>Built 1 zoneli
001275e4: 7374732e 2020546f 74616c20 70616765 sts. Total page
001275f4: 733a2034 3036340a 3c353e4b 65726e65 s: 4064.<5>Kerne
00127604: 6c20636f 6d6d616e 64206c69 6e653a20 l command line:
00127614: 0a3c343e 50494420 68617368 20746162 .<4>PID hash tab
00127624: 6c652065 6e747269 65733a20 36342028 le entries: 64 (
00127634: 6f726465 723a2036 2c203235 36206279 order: 6, 256 by
00127644: 74657329 0a3c343e 44656372 656d656e tes).<4>Decremen
00127654: 74657220 46726571 75656e63 79203d20 ter Frequency =
00127664: 3138302f 36300a3c 343e2046 41425f44 180/60.<4> FAB_D
00127674: 45425547 20414654 45522045 41524c59 EBUG AFTER EARLY
00127684: 5f424f4f 545f4952 51535f4f 4e282920 _BOOT_IRQS_ON()
00127694: 00000000 00000000 00000000 00000000 ................
001276a4: 00000000 00000000 00000000 00000000 ................
001276b4: 00000000 00000000 00000000 00000000 ...............
Could someone give me some help about where to seek for isolate the problem ?
^ 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