* RE: PPC Linux support for Tundra TSI148
From: Martin, Tim @ 2006-04-26 16:24 UTC (permalink / raw)
To: Gerhard Jaeger, linuxppc-embedded
Gerhard,
Thanks for the information. More questions...
What type of transfers were you doing? (e.g. A32/D64? SST320 or SST267?)
Are these transfer from userspace data, from kernelspace data, or from
the Tundra's pattern buffer?
What was your PCI bus speed & width?
Were you using inbound/outbound windows or Tundra's DMA controller?
What was the Tundra chipset configuration for the 168 MBps?
Thanks,
Tim
> -----Original Message-----
> From: linuxppc-embedded-bounces+tmartin=3Dviasat.com@ozlabs.org
> [mailto:linuxppc-embedded-bounces+tmartin=3Dviasat.com@ozlabs.org] On
Behalf
> Of Gerhard Jaeger
> Sent: Wednesday, April 26, 2006 12:26 AM
> To: linuxppc-embedded@ozlabs.org
> Subject: Re: PPC Linux support for Tundra TSI148
>=20
> On Wednesday 26 April 2006 01:47, Martin, Tim wrote:
> > Does anyone out there have any real world measured performance of a
> > Linux PowerPC (kernel module + user space application) doing 2eSST
VME
> > transfers with the Tundra TSI148 chipset?
> >
> > Tundra has a Linux driver available for the Motorola MVME6100 , but
told
> > me they don't have any performance data available. I'm looking for
> > sustained throughput rates, not the peak burst rates (e.g. 320 MBps,
267
> > MBps).
> >
>=20
> Hi,
>=20
> I've done here some tests between two MVME6100, while updating the
6100
> BSP
> for our embedded Linux distro. Depending on the buffersize, alignment,
VME
> and
> PCI FIFO settings we have (without further optimizations) throughput
rates
> ranging
> from 100MBps up to 168MBps. I think some tuning could still be done.
>=20
> HTH
> Gerhard
>=20
> --
> Gerhard Jaeger <gjaeger@sysgo.com>
> SYSGO AG Embedded and Real-Time Software
> www.sysgo.com | www.elinos.com | www.pikeos.com | www.osek.de
>=20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* [PATCH] ppc64-xmon-stop-cpu.patch
From: David Wilder @ 2006-04-26 18:37 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 477 bytes --]
Please pick up this patch
- During CPU(s) hang scenarios, kdump could not stop these CPUs.
However, the user could invoke soft-reset to shoot down CPUs reliably.
But, when the debugger is enabled, these CPUs are returned to hang state
after they exited from the debugger. This patch fixes this issue by
calling crash_kexec_secondary() before returns to previous state.
--
David Wilder
IBM Linux Technology Center
Beaverton, Oregon, USA
dwilder@us.ibm.com
(503)578-3789
[-- Attachment #2: ppc64-xmon-stop-cpu.patch --]
[-- Type: text/x-patch, Size: 1283 bytes --]
- During CPU(s) hang scenarios, kdump could not stop these CPUs. However, the user could invoke soft-reset to shoot down CPUs reliably. But, when the debugger is enabled, these CPUs are returned to hang state after they exited from the debugger. This patch fixes this issue by calling crash_kexec_secondary() before returns to previous state.
Signed-off-by: David Wilder <dwilder@us.ibm.com>
Signed-off-by: Haren Myneni <haren@us.ibm.com>
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 064a525..9a509f8 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -208,6 +208,16 @@ void system_reset_exception(struct pt_re
die("System Reset", regs, SIGABRT);
+ /*
+ * Some CPUs which got released from debugger will execute this path.
+ * These CPUs entered debugger first time via soft-reset - Means,
+ * could be possible that these CPUs may not repond to an IPI later.
+ * Therefore, has to call kdump func directly.
+ * Not a problem if we exited from debugger to recover. In this case
+ * there will not be any primary kexec CPU. Hence, will be returned.
+ */
+ crash_kexec_secondary(regs);
+
/* Must die if the interrupt is not recoverable */
if (!(regs->msr & MSR_RI))
panic("Unrecoverable System Reset");
^ permalink raw reply related
* How do you make linux 2.6.10 U-Boot aware?
From: Howard, Marc @ 2006-04-26 18:54 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I'm using MontaVista linux 4.01 for the PPC440GX which is based on
2.6.10. It doesn't read the bootargs from U-Boot however. Does anyone
out there have a synopsis of what needs to be modified (bd_info, etc.)
to make this work with a 2.6.10 based release?
Thanks,
Marc W. Howard
^ permalink raw reply
* Re: How do you make linux 2.6.10 U-Boot aware?
From: Eugene Surovegin @ 2006-04-26 19:02 UTC (permalink / raw)
To: Howard, Marc; +Cc: linuxppc-embedded
In-Reply-To: <91B22F93A880FA48879475E134D6F0BE027DEF15@CA1EXCLV02.adcorp.kla-tencor.com>
On Wed, Apr 26, 2006 at 11:54:13AM -0700, Howard, Marc wrote:
> Hi,
>
> I'm using MontaVista linux 4.01 for the PPC440GX which is based on
> 2.6.10. It doesn't read the bootargs from U-Boot however. Does anyone
> out there have a synopsis of what needs to be modified (bd_info, etc.)
> to make this work with a 2.6.10 based release?
Please, take a look at Ocotea port in the latest 2.6 kernel. It
supports booting from PIBS and U-Boot.
--
^ permalink raw reply
* [PATCH] ppc64_softreset_patch
From: David Wilder @ 2006-04-26 18:03 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 329 bytes --]
Please pick up this patch.
This is a re-do of the ppc64-soft-reset-fix.patch. I have included
changes suggested by Olaf and Andrew and combined it with the
ppc64-kexec-tools-rm-platform-fix.patch to remove the dependency.
--
David Wilder
IBM Linux Technology Center
Beaverton, Oregon, USA
dwilder@us.ibm.com
(503)578-3789
[-- Attachment #2: ppc64-softreset-fixes.patch --]
[-- Type: text/x-patch, Size: 12385 bytes --]
- When a system hangs, user will activate the soft-reset to initiate the kdump boot. But, soft-reset behavior is indeterminate on sending FWNMI to all CPUS. i.e, all CPUs will not get FW NMI at the same time. When the first CPU entered (calling primary CPU here onwards) kdump using crash_kexec(), sends an IPI to other CPUs. Some CPUs will respond to this IPI and execute crash_ipi_callback() before receive NMI. When they receive FW NMI, will execute die() and waiting forever since no more kdump IPI coming from the primary CPU. This issue will be fixed by invoking crash_kexec_secondary() directly from die().
Since the secondary CPUs will enter the IPI_callback function two times, CPU states have to be saved only once and the primary CPU has to start kdump boot after all CPUs are stopped. Hence, cpus_in_crash bitmap is used to determine whether pt_regs is saved. If the bit is not set, regs will be saved. Introduced cpus_in_sr bitmap and enter_on_soft_reset counter which are used to let the primary CPU know that all secondary CPUs entered via soft-reset and ready to do down.
- For the crash scenario, when a CPU hangs with interrupts disabled and the other CPUs panic or user invoked kdump boot using sysrq-c. In this case, the hung CPU can not be stopped and causes the kdump boot not successful. This case can be treated as complete system hang and asks the user to activate soft-reset if all secondary CPUs are not stopped.
Signed-off-by: David Wilder <dwilder@us.ibm.com>
Signed-off-by: Haren Myneni <haren@us.ibm.com>
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index 778f22f..20ef5d2 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -23,9 +23,11 @@
#include <linux/elfcore.h>
#include <linux/init.h>
#include <linux/types.h>
+#include <linux/irq.h>
#include <asm/processor.h>
#include <asm/machdep.h>
+#include <asm/kexec.h>
#include <asm/kdump.h>
#include <asm/lmb.h>
#include <asm/firmware.h>
@@ -40,6 +42,7 @@
/* This keeps a track of which one is crashing cpu. */
int crashing_cpu = -1;
+static cpumask_t cpus_in_crash = CPU_MASK_NONE;
static u32 *append_elf_note(u32 *buf, char *name, unsigned type, void *data,
size_t data_len)
@@ -97,34 +100,66 @@ static void crash_save_this_cpu(struct p
}
#ifdef CONFIG_SMP
-static atomic_t waiting_for_crash_ipi;
+static atomic_t enter_on_soft_reset = ATOMIC_INIT(0);
void crash_ipi_callback(struct pt_regs *regs)
{
int cpu = smp_processor_id();
- if (cpu == crashing_cpu)
- return;
-
if (!cpu_online(cpu))
return;
- if (ppc_md.kexec_cpu_down)
- ppc_md.kexec_cpu_down(1, 1);
-
local_irq_disable();
+ if (!cpu_isset(cpu, cpus_in_crash))
+ crash_save_this_cpu(regs, cpu);
+ cpu_set(cpu, cpus_in_crash);
- crash_save_this_cpu(regs, cpu);
- atomic_dec(&waiting_for_crash_ipi);
+ /*
+ * Entered via soft-reset - could be the kdump
+ * process is invoked using soft-reset or user activated
+ * it if some CPU did not respond to an IPI.
+ * For soft-reset, the secondary CPU can enter this func
+ * twice. 1 - using IPI, and 2. soft-reset.
+ * Tell the kexec CPU that entered via soft-reset and ready
+ * to go down.
+ */
+ if (cpu_isset(cpu, cpus_in_sr)) {
+ cpu_clear(cpu, cpus_in_sr);
+ atomic_inc(&enter_on_soft_reset);
+ }
+
+ /*
+ * Starting the kdump boot.
+ * This barrier is needed to make sure that all CPUs are stopped.
+ * If not, soft-reset will be invoked to bring other CPUs.
+ */
+ while (!cpu_isset(crashing_cpu, cpus_in_crash))
+ cpu_relax();
+
+ if (ppc_md.kexec_cpu_down)
+ ppc_md.kexec_cpu_down(1, 1);
kexec_smp_wait();
/* NOTREACHED */
}
-static void crash_kexec_prepare_cpus(void)
+/*
+ * Wait until all CPUs are entered via soft-reset.
+ */
+static void crash_soft_reset_check(int cpu)
+{
+ unsigned int ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */
+
+ cpu_clear(cpu, cpus_in_sr);
+ while (atomic_read(&enter_on_soft_reset) != ncpus)
+ cpu_relax();
+}
+
+
+static void crash_kexec_prepare_cpus(int cpu)
{
unsigned int msecs;
- atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
+ unsigned int ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */
crash_send_ipi(crash_ipi_callback);
smp_wmb();
@@ -132,14 +167,13 @@ static void crash_kexec_prepare_cpus(voi
/*
* FIXME: Until we will have the way to stop other CPUSs reliabally,
* the crash CPU will send an IPI and wait for other CPUs to
- * respond. If not, proceed the kexec boot even though we failed to
- * capture other CPU states.
+ * respond.
* Delay of at least 10 seconds.
*/
- printk(KERN_ALERT "Sending IPI to other cpus...\n");
+ printk(KERN_EMERG "Sending IPI to other cpus...\n");
msecs = 10000;
- while ((atomic_read(&waiting_for_crash_ipi) > 0) && (--msecs > 0)) {
- barrier();
+ while ((cpus_weight(cpus_in_crash) < ncpus) && (--msecs > 0)) {
+ cpu_relax();
mdelay(1);
}
@@ -148,18 +182,71 @@ static void crash_kexec_prepare_cpus(voi
/*
* FIXME: In case if we do not get all CPUs, one possibility: ask the
* user to do soft reset such that we get all.
- * IPI handler is already set by the panic cpu initially. Therefore,
- * all cpus could invoke this handler from die() and the panic CPU
- * will call machine_kexec() directly from this handler to do
- * kexec boot.
- */
- if (atomic_read(&waiting_for_crash_ipi))
- printk(KERN_ALERT "done waiting: %d cpus not responding\n",
- atomic_read(&waiting_for_crash_ipi));
+ * Soft-reset will be used until better mechanism is implemented.
+ */
+ if (cpus_weight(cpus_in_crash) < ncpus) {
+ printk(KERN_EMERG "done waiting: %d cpu(s) not responding\n",
+ ncpus - cpus_weight(cpus_in_crash));
+ printk(KERN_EMERG "Activate soft-reset to stop other cpu(s)\n");
+ cpus_in_sr = CPU_MASK_NONE;
+ atomic_set(&enter_on_soft_reset, 0);
+ while (cpus_weight(cpus_in_crash) < ncpus)
+ cpu_relax();
+ }
+ /*
+ * Make sure all CPUs are entered via soft-reset if the kdump is
+ * invoked using soft-reset.
+ */
+ if (cpu_isset(cpu, cpus_in_sr))
+ crash_soft_reset_check(cpu);
/* Leave the IPI callback set */
}
+
+/*
+ * This function will be called by secondary cpus or by kexec cpu
+ * if soft-reset is activated to stop some CPUs.
+ */
+void crash_kexec_secondary(struct pt_regs *regs)
+{
+ int cpu = smp_processor_id();
+ unsigned long flags;
+ int msecs = 5;
+
+ local_irq_save(flags);
+ /* Wait 5ms if the kexec CPU is not entered yet. */
+ while (crashing_cpu < 0) {
+ if (--msecs < 0) {
+ /*
+ * Either kdump image is not loaded or
+ * kdump process is not started - Probably xmon
+ * exited using 'x'(exit and recover) or
+ * kexec_should_crash() failed for all running tasks.
+ */
+ cpu_clear(cpu, cpus_in_sr);
+ local_irq_restore(flags);
+ return;
+ }
+ mdelay(1);
+ cpu_relax();
+ }
+ if (cpu == crashing_cpu) {
+ /*
+ * Panic CPU will enter this func only via soft-reset.
+ * Wait until all secondary CPUs entered and
+ * then start kexec boot.
+ */
+ crash_soft_reset_check(cpu);
+ cpu_set(crashing_cpu, cpus_in_crash);
+ if (ppc_md.kexec_cpu_down)
+ ppc_md.kexec_cpu_down(1, 0);
+ machine_kexec(kexec_crash_image);
+ /* NOTREACHED */
+ }
+ crash_ipi_callback(regs);
+}
+
#else
-static void crash_kexec_prepare_cpus(void)
+static void crash_kexec_prepare_cpus(int cpu)
{
/*
* move the secondarys to us so that we can copy
@@ -170,6 +257,10 @@ static void crash_kexec_prepare_cpus(voi
smp_release_cpus();
}
+void crash_kexec_secondary(struct pt_regs *regs)
+{
+ cpus_in_sr = CPU_MASK_NONE;
+}
#endif
void default_machine_crash_shutdown(struct pt_regs *regs)
@@ -185,15 +276,14 @@ void default_machine_crash_shutdown(stru
* The kernel is broken so disable interrupts.
*/
local_irq_disable();
-
- if (ppc_md.kexec_cpu_down)
- ppc_md.kexec_cpu_down(1, 0);
-
/*
* Make a note of crashing cpu. Will be used in machine_kexec
* such that another IPI will not be sent.
*/
crashing_cpu = smp_processor_id();
- crash_kexec_prepare_cpus();
crash_save_this_cpu(regs, crashing_cpu);
+ crash_kexec_prepare_cpus(crashing_cpu);
+ cpu_set(crashing_cpu, cpus_in_crash);
+ if (ppc_md.kexec_cpu_down)
+ ppc_md.kexec_cpu_down(1, 0);
}
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 064a525..ad6500e 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -51,9 +51,13 @@
#include <asm/firmware.h>
#include <asm/processor.h>
#endif
+#include <asm/kexec.h>
#ifdef CONFIG_PPC64 /* XXX */
#define _IO_BASE pci_io_base
+#ifdef CONFIG_KEXEC
+cpumask_t cpus_in_sr = CPU_MASK_NONE;
+#endif
#endif
#ifdef CONFIG_DEBUGGER
@@ -96,7 +100,7 @@ static DEFINE_SPINLOCK(die_lock);
int die(const char *str, struct pt_regs *regs, long err)
{
- static int die_counter, crash_dump_start = 0;
+ static int die_counter;
if (debugger(regs))
return 1;
@@ -128,22 +132,12 @@ int die(const char *str, struct pt_regs
print_modules();
show_regs(regs);
bust_spinlocks(0);
-
- if (!crash_dump_start && kexec_should_crash(current)) {
- crash_dump_start = 1;
- spin_unlock_irq(&die_lock);
- crash_kexec(regs);
- /* NOTREACHED */
- }
spin_unlock_irq(&die_lock);
- if (crash_dump_start)
- /*
- * Only for soft-reset: Other CPUs will be responded to an IPI
- * sent by first kexec CPU.
- */
- for(;;)
- ;
+ if (kexec_should_crash(current))
+ crash_kexec(regs);
+ crash_kexec_secondary(regs);
+
if (in_interrupt())
panic("Fatal exception in interrupt");
@@ -205,6 +199,10 @@ void system_reset_exception(struct pt_re
if (ppc_md.system_reset_exception(regs))
return;
}
+
+#ifdef CONFIG_KEXEC
+ cpu_set(smp_processor_id(), cpus_in_sr);
+#endif
die("System Reset", regs, SIGABRT);
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index 6a2af2f..7eb2bb2 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -31,9 +31,8 @@
#define KEXEC_ARCH KEXEC_ARCH_PPC
#endif
-#ifdef CONFIG_KEXEC
-
#ifndef __ASSEMBLY__
+#ifdef CONFIG_KEXEC
#ifdef __powerpc64__
/*
* This function is responsible for capturing register states if coming
@@ -114,6 +113,7 @@ extern void kexec_smp_wait(void); /* get
extern void __init kexec_setup(void);
extern int crashing_cpu;
extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *));
+extern cpumask_t cpus_in_sr;
#endif /* __powerpc64 __ */
struct kimage;
@@ -123,8 +123,10 @@ extern int default_machine_kexec_prepare
extern void default_machine_crash_shutdown(struct pt_regs *regs);
extern void machine_kexec_simple(struct kimage *image);
-
-#endif /* ! __ASSEMBLY__ */
+extern void crash_kexec_secondary(struct pt_regs *regs);
+#else
+static inline void crash_kexec_secondary(struct pt_regs *regs) { }
#endif /* CONFIG_KEXEC */
+#endif /* ! __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_KEXEC_H */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index cfb3410..6427949 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -106,6 +106,7 @@ extern struct page *kimage_alloc_control
extern void crash_kexec(struct pt_regs *);
int kexec_should_crash(struct task_struct *);
extern struct kimage *kexec_image;
+extern struct kimage *kexec_crash_image;
#define KEXEC_ON_CRASH 0x00000001
#define KEXEC_ARCH_MASK 0xffff0000
diff --git a/kernel/kexec.c b/kernel/kexec.c
index bf39d28..950559d 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -903,7 +903,7 @@ static int kimage_load_segment(struct ki
* that to happen you need to do that yourself.
*/
struct kimage *kexec_image = NULL;
-static struct kimage *kexec_crash_image = NULL;
+struct kimage *kexec_crash_image = NULL;
/*
* A home grown binary mutex.
* Nothing can wait so this mutex is safe to use
@@ -1042,7 +1042,6 @@ asmlinkage long compat_sys_kexec_load(un
void crash_kexec(struct pt_regs *regs)
{
- struct kimage *image;
int locked;
@@ -1056,12 +1055,11 @@ void crash_kexec(struct pt_regs *regs)
*/
locked = xchg(&kexec_lock, 1);
if (!locked) {
- image = xchg(&kexec_crash_image, NULL);
- if (image) {
+ if (kexec_crash_image) {
struct pt_regs fixed_regs;
crash_setup_regs(&fixed_regs, regs);
machine_crash_shutdown(&fixed_regs);
- machine_kexec(image);
+ machine_kexec(kexec_crash_image);
}
xchg(&kexec_lock, 0);
}
^ permalink raw reply related
* Re: FT u-boot shim
From: Wolfgang Denk @ 2006-04-26 19:19 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <A8793E99-83C1-4FD9-8735-D2E8F98B3003@kernel.crashing.org>
In message <A8793E99-83C1-4FD9-8735-D2E8F98B3003@kernel.crashing.org> you wrote:
>
> I think thats part of the idea with arch/powerpc defining a standard
> mechanism for how a boot loader should pass information to the kernel
> (via a flat device tree).
Yet another standard.
> How would you propose that we handle booting arch/powerpc kernels
> from u-boot going forward? (for new board ports and existing board
> ports).
Ideally, I'd like to see a common kernel interface for all archi-
tectures, PowerPC and ARM and MIPS and ... But last time I dared to
suggest this I've been told what a nincompoop I am.
I will accept what is decided by the P.T.B., but I request not to
break backwards compatibility with existing systems.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Monday is an awful way to spend one seventh of your life.
^ permalink raw reply
* RE: How do you make linux 2.6.10 U-Boot aware?
From: Steven Blakeslee @ 2006-04-26 18:57 UTC (permalink / raw)
To: Howard, Marc, linuxppc-embedded
> I'm using MontaVista linux 4.01 for the PPC440GX which is=20
> based on 2.6.10. It doesn't read the bootargs from U-Boot=20
> however. Does anyone out there have a synopsis of what needs=20
> to be modified (bd_info, etc.) to make this work with a=20
> 2.6.10 based release?
>=20
The bd_info structure needs to come from ppcboot.h and the make command
is "make uImage" That should be about it.
^ permalink raw reply
* Re: FT u-boot shim
From: Geert Uytterhoeven @ 2006-04-26 19:46 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <20060426191957.14C4F353DAC@atlas.denx.de>
On Wed, 26 Apr 2006, Wolfgang Denk wrote:
> In message <A8793E99-83C1-4FD9-8735-D2E8F98B3003@kernel.crashing.org> you wrote:
> > How would you propose that we handle booting arch/powerpc kernels
> > from u-boot going forward? (for new board ports and existing board
> > ports).
>
> Ideally, I'd like to see a common kernel interface for all archi-
> tectures, PowerPC and ARM and MIPS and ... But last time I dared to
> suggest this I've been told what a nincompoop I am.
Let's hope Linux Darwinism will convergenge to a common kernel interface...
> I will accept what is decided by the P.T.B., but I request not to
> break backwards compatibility with existing systems.
[ dict ptb -> Physikalisch-Technische Bundesanstalt ? ]
Ah, Powers That Be!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Xilinx SysACE drivers for Linux 2.4
From: Stephen Williams @ 2006-04-26 21:46 UTC (permalink / raw)
To: linuxppc-embedded
So I'm now looking at moving from my bk based linuxppc-2.4 devel
tree to the kernel.org sources, but the latter doesn't have the
Xilinx SystemACE drivers. Is there a repository for the latest
port (to kernel 2.4) of this driver, or should I just lift it
from the kernel tree I have?
Also, I'd be going from linuxppc-2.4.30-pre1 (or thereabouts) to
kernel.org 2.4.32. This is likely to be fine for my PPC405GPr, yes?
--
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
^ permalink raw reply
* Re: [PATCH 4/4] ppc32 CPM_UART: Fixed odd address translations
From: Marcelo Tosatti @ 2006-04-26 21:41 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: Paul Mackerras, linuxppc-embedded
In-Reply-To: <20060425162646.23551.61674.stgit@vitb.ru.mvista.com>
Ouch.
I would convert the warning printk() to a BUG(), since such an address
error
indicates deep trouble anyway...
And add a "likely()" indication around the range check.
Looks great otherwise!
On Tue, 2006-04-25 at 20:26 +0400, Vitaly Bordug wrote:
> Current address translation methods can produce wrong results, because
> virt_to_bus and vice versa may not produce correct offsets on dma-allocated
> memory. The right way is, while tracking both phys and virt address of the
> window that has been allocated for boffer descriptors, and use those
> numbers to compute the offset and make translation properly.
>
> Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
> ---
>
> drivers/serial/cpm_uart/cpm_uart.h | 33 +++++++++++++++++++++++++++++++
> drivers/serial/cpm_uart/cpm_uart_core.c | 31 ++++++++---------------------
> drivers/serial/cpm_uart/cpm_uart_cpm1.c | 7 ++++---
> drivers/serial/cpm_uart/cpm_uart_cpm2.c | 5 ++++-
> 4 files changed, 50 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h
> index 17f2c7a..9db402c 100644
> --- a/drivers/serial/cpm_uart/cpm_uart.h
> +++ b/drivers/serial/cpm_uart/cpm_uart.h
> @@ -66,6 +66,7 @@ struct uart_cpm_port {
> uint dp_addr;
> void *mem_addr;
> dma_addr_t dma_addr;
> + u32 mem_size;
> /* helpers */
> int baud;
> int bits;
> @@ -92,4 +93,36 @@ void scc2_lineif(struct uart_cpm_port *p
> void scc3_lineif(struct uart_cpm_port *pinfo);
> void scc4_lineif(struct uart_cpm_port *pinfo);
>
> +/*
> + virtual to phys transtalion
> +*/
> +static inline unsigned long cpu2cpm_addr(void* addr, struct uart_cpm_port *pinfo)
> +{
> + int offset;
> + u32 val = (u32)addr;
> + /* sane check */
> + if ((val >= (u32)pinfo->mem_addr) &&
> + (val<((u32)pinfo->mem_addr + pinfo->mem_size))) {
> + offset = val - (u32)pinfo->mem_addr;
> + return pinfo->dma_addr+offset;
> + }
> + printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val);
> + return 0;
> +}
> +
> +static inline void *cpm2cpu_addr(unsigned long addr, struct uart_cpm_port *pinfo)
> +{
> + int offset;
> + u32 val = addr;
> + /* sane check */
> + if ((val >= pinfo->dma_addr) &&
> + (val<(pinfo->dma_addr + pinfo->mem_size))) {
> + offset = val - (u32)pinfo->dma_addr;
> + return (void*)(pinfo->mem_addr+offset);
> + }
> + printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val);
> + return 0;
> +}
> +
> +
> #endif /* CPM_UART_H */
> diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
> index 8f33815..3549073 100644
> --- a/drivers/serial/cpm_uart/cpm_uart_core.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_core.c
> @@ -72,19 +72,6 @@ static void cpm_uart_initbd(struct uart_
>
> /**************************************************************/
>
> -static inline unsigned long cpu2cpm_addr(void *addr)
> -{
> - if ((unsigned long)addr >= CPM_ADDR)
> - return (unsigned long)addr;
> - return virt_to_bus(addr);
> -}
> -
> -static inline void *cpm2cpu_addr(unsigned long addr)
> -{
> - if (addr >= CPM_ADDR)
> - return (void *)addr;
> - return bus_to_virt(addr);
> -}
>
> /* Place-holder for board-specific stuff */
> struct platform_device* __attribute__ ((weak)) __init
> @@ -290,7 +277,7 @@ static void cpm_uart_int_rx(struct uart_
> }
>
> /* get pointer */
> - cp = cpm2cpu_addr(bdp->cbd_bufaddr);
> + cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
>
> /* loop through the buffer */
> while (i-- > 0) {
> @@ -633,7 +620,7 @@ static int cpm_uart_tx_pump(struct uart_
> /* Pick next descriptor and fill from buffer */
> bdp = pinfo->tx_cur;
>
> - p = cpm2cpu_addr(bdp->cbd_bufaddr);
> + p = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
>
> *p++ = port->x_char;
> bdp->cbd_datlen = 1;
> @@ -660,7 +647,7 @@ static int cpm_uart_tx_pump(struct uart_
>
> while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) {
> count = 0;
> - p = cpm2cpu_addr(bdp->cbd_bufaddr);
> + p = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
> while (count < pinfo->tx_fifosize) {
> *p++ = xmit->buf[xmit->tail];
> xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
> @@ -709,12 +696,12 @@ static void cpm_uart_initbd(struct uart_
> mem_addr = pinfo->mem_addr;
> bdp = pinfo->rx_cur = pinfo->rx_bd_base;
> for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) {
> - bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
> + bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo);
> bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
> mem_addr += pinfo->rx_fifosize;
> }
>
> - bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
> + bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo);
> bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT;
>
> /* Set the physical address of the host memory
> @@ -724,12 +711,12 @@ static void cpm_uart_initbd(struct uart_
> mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
> bdp = pinfo->tx_cur = pinfo->tx_bd_base;
> for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
> - bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
> + bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo);
> bdp->cbd_sc = BD_SC_INTRPT;
> mem_addr += pinfo->tx_fifosize;
> }
>
> - bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
> + bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo);
> bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT;
> }
>
> @@ -1099,7 +1086,7 @@ static void cpm_uart_console_write(struc
> * If the buffer address is in the CPM DPRAM, don't
> * convert it.
> */
> - cp = cpm2cpu_addr(bdp->cbd_bufaddr);
> + cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
>
> *cp = *s;
>
> @@ -1116,7 +1103,7 @@ static void cpm_uart_console_write(struc
> while ((bdp->cbd_sc & BD_SC_READY) != 0)
> ;
>
> - cp = cpm2cpu_addr(bdp->cbd_bufaddr);
> + cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
>
> *cp = 13;
> bdp->cbd_datlen = 1;
> diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
> index 31223aa..a5a3062 100644
> --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
> @@ -144,7 +144,7 @@ int cpm_uart_allocbuf(struct uart_cpm_po
> /* was hostalloc but changed cause it blows away the */
> /* large tlb mapping when pinning the kernel area */
> mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
> - dma_addr = 0;
> + dma_addr = (u32)mem_addr;
> } else
> mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
> GFP_KERNEL);
> @@ -157,8 +157,9 @@ int cpm_uart_allocbuf(struct uart_cpm_po
> }
>
> pinfo->dp_addr = dp_offset;
> - pinfo->mem_addr = mem_addr;
> - pinfo->dma_addr = dma_addr;
> + pinfo->mem_addr = mem_addr; /* virtual address*/
> + pinfo->dma_addr = dma_addr; /* physical address*/
> + pinfo->mem_size = memsz;
>
> pinfo->rx_buf = mem_addr;
> pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
> diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> index c9c3b1d..7c6b07a 100644
> --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> @@ -209,8 +209,10 @@ int cpm_uart_allocbuf(struct uart_cpm_po
>
> memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
> L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
> - if (is_con)
> + if (is_con) {
> mem_addr = alloc_bootmem(memsz);
> + dma_addr = mem_addr;
> + }
> else
> mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
> GFP_KERNEL);
> @@ -225,6 +227,7 @@ int cpm_uart_allocbuf(struct uart_cpm_po
> pinfo->dp_addr = dp_offset;
> pinfo->mem_addr = mem_addr;
> pinfo->dma_addr = dma_addr;
> + pinfo->mem_size = memsz;
>
> pinfo->rx_buf = mem_addr;
> pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
^ permalink raw reply
* PPC 405GPr support in linux 2.4.32
From: Stephen Williams @ 2006-04-26 23:19 UTC (permalink / raw)
To: linuxppc-embedded
... seems completely missing in the linux-2.3.32 tree from kernel.org.
This used to be in the linuxppc-2.4 BK tree that no longer exists, so
what happened to the ppc405GPr support?!
--
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
^ permalink raw reply
* Re: 85xx FDT updates?
From: Dan Malek @ 2006-04-26 23:27 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <20060425213622.B116F352B18@atlas.denx.de>
On Apr 25, 2006, at 5:36 PM, Wolfgang Denk wrote:
> Others (and not a small number) use them for testing application
> code. In your definition these are probably "end users", too.
I'm surprised by how much of this I see as well. People will
buy various evaluation boards for the purposes of evaluation
(imagine that :-)). They will try different kernel versions, write
some test applications, before making a choice of what
processor and tools to purchase. Only after that point will
they likely have some debugger capability that will allow
them to update flash parts. Based on this behavior, it's not
good to assume that just because someone has an eval
board they have the ability to update the flash on it. A failed
flash update and the inability to recover is a good way to
ensure the board/processor is not chosen for a product :-)
Thanks.
-- Dan
^ permalink raw reply
* Re: [Fastboot] Documentation feedback request.
From: Michael Ellerman @ 2006-04-26 23:44 UTC (permalink / raw)
To: David Wilder; +Cc: linuxppc-dev list, fastboot
In-Reply-To: <444FB2AF.3020802@us.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 11643 bytes --]
Hi David,
Nice work. Few comments below ...
On Wed, 2006-04-26 at 10:49 -0700, David Wilder wrote:
> Attached is a updated Documentation/kdump/kdump.txt. Please provide
> comments. I will incorporate your feedback and send up to Linus.
>
> plain text document attachment (kdump-final-20060425.txt)
> ================================================================
> Documentation for Kdump - The kexec-based Crash Dumping Solution
> ================================================================
>
> This document includes overview, setup and installation, and analysis
> information.
>
> Overview
> ========
>
> Kdump uses kexec to quickly boot to a dump-capture kernel whenever a
> dump of the system kernel's memory needs to be taken (for example, when
> the system panics). The system kernel's memory image is preserved across
> the reboot and is accessible to the dump-capture kernel.
>
> You can use common Linux commands, such as cp and scp, to copy the
> memory image to a dump file on the local disk, or across the network to
> a remote system.
>
> Kdump and kexec are currently supported on the x86, x86_64, and ppc64
> architectures.
s/ppc64/64-bit powerpc/ ?
> When the system kernel boots, it reserves a small section of memory for
> the dump-capture kernel. This ensures that ongoing Direct Memory Access
> (DMA) from the system kernel does not corrupt the dump-capture kernel.
> The kexec -p command loads the dump-capture kernel into this reserved
> memory.
Well hopefully ;)
> On x86 machines, the first 640 KB of physical memory is needed to boot,
> regardless of where the kernel loads. Therefore, kexec backs up this
> region just before rebooting into the dump-capture kernel.
>
> All of the necessary information about the system kernel's core image is
> encoded in the ELF format, and stored in a reserved area of memory
> before a crash. The physical address of the start of the ELF header is
> passed to the dump-capture kernel through the elfcorehdr= boot
> parameter.
>
> With the dump-capture kernel, you can access the memory image, or "old
> memory," in two ways:
>
> - Through a /dev/oldmem device interface. A capture utility can read the
> device file and write out the memory in raw format. This is a raw dump
> of memory. Analysis and capture tools must be intelligent enough to
> determine where to look for the right information.
>
> - Through /proc/vmcore. This exports the dump as an ELF-format file that
> you can write out using file copy commands such as cp or scp. Further,
> you can use analysis tools such as the GNU Debugger (GDB) and the Crash
> tool to debug the dump file. This method ensures that the dump pages are
> correctly ordered.
>
>
> Setup and Installation
> ======================
>
> Install kexec-tools and the Kdump patch
> ---------------------------------------
>
> 1) Login as the root user.
>
> 2) Download the kexec-tools user-space package from the following URL:
>
> http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz
>
> 3) Unpack the tarball with the tar command, as follows:
>
> tar xvpzf kexec-tools-1.101.tar.gz
>
> 4) Download the latest consolidated Kdump patch from the following URL:
>
> http://lse.sourceforge.net/kdump/
>
> (This location is being used until all the user-space Kdump patches
> are integrated with the kexec-tools package.)
>
> 5) Change to the kexec-tools-1.101 directory, as follows:
>
> cd kexec-tools-1.101
>
> 6) Apply the consolidated patch to the kexec-tools-1.101 source tree
> with the patch command, as follows. (Modify the path to the downloaded
> patch as necessary.)
>
> patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch
>
> 7) Configure the package, as follows:
>
> ./configure
>
> 8) Compile the package, as follows:
>
> make
>
> 9) Install the package, as follows:
>
> make install
>
>
> Download and build the system and dump-capture kernels
> ------------------------------------------------------
>
> Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer)
> from http://www.kernel.org. Two kernels must be built: a system kernel
> and a dump-capture kernel. Use the following steps to configure these
> kernels with the necessary kexec and Kdump features:
>
> System kernel
> -------------
>
> 1) Enable "kexec system call" in "Processor type and features."
>
> CONFIG_KEXEC=y
>
> 2) Enable "sysfs file system support" in "Filesystem" -> "Pseudo
> filesystems." This is usually enabled by default.
>
> CONFIG_SYSFS=y
>
> Note that "sysfs file system support" might not appear in the "Pseudo
> filesystems" menu if "Configure standard kernel features (for small
> systems)" is not enabled in "General Setup." In this case, check the
> .config file itself to ensure that sysfs is turned on, as follows:
>
> grep 'CONFIG_SYSFS' .config
Is there a particular requirement for sysfs?
> 3) Enable "Compile the kernel with debug info" in "Kernel hacking."
>
> CONFIG_DEBUG_INFO=Y
>
> This causes the kernel to be built with debug symbols. The dump
> analysis tools require a vmlinux with debug symbols in order to read
> and analyze a dump file.
>
> 4) Make and install the kernel and its modules. Update the boot loader
> (such as grub, yaboot, or lilo) configuration files as necessary.
>
> 5) Boot the system kernel with the boot parameter "crashkernel=Y@X",
> where Y specifies how much memory to reserve for the dump-capture kernel
> and X specifies the beginning of this reserved memory. For example,
> "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
> starting at physical address 0x01000000 for the dump-capture kernel.
Most of this doesn't apply to powerpc.
> On x86 and x86_64, use "crashkernel=64M@16M".
>
> On ppc64, use "crashkernel=128M@32M".
No just use "crashkernel=128M".
> The dump-capture kernel
> -----------------------
>
> 1) Under "General setup," append "-kdump" to the current string in
> "Local version."
>
> 2) On x86, enable high memory support under "Processor type and
> features":
>
> CONFIG_HIGHMEM=y
>
> 3) On x86 and x86_64, disable symmetric multi-processing support
> under "Processor type and features":
>
> CONFIG_SMP=n
>
> 4) On ppc64, disable NUMA support and enable EMBEDDED support:
>
> CONFIG_NUMA=n
> CONFIG_EMBEDDED=y
> CONFIG_EEH=N for the dump-capture kernel
Why are we disabling NUMA? AFAIK we work on more systems with NUMA than
without?
And why are we turning off EMBEDDED and EEH?
> 5) Enable "kernel crash dumps" support under "Processor type and
> features":
>
> CONFIG_CRASH_DUMP=y
>
> 6) Use a suitable value for "Physical address where the kernel is
> loaded" (under "Processor type and features"). This only appears when
> "kernel crash dumps" is enabled. By default this value is 0x1000000
> (16MB). It should be the same as X in the "crashkernel=Y@X" boot
> parameter discussed above.
>
> On x86 and x86_64, use "CONFIG_PHYSICAL_START=0x1000000".
>
> On ppc64 the value is automatically set at 32MB when
> CONFIG_CRASH_DUMP is set.
This whole step should start "On x86 ..."
> 6) Optionally enable "/proc/vmcore support" under "Filesystems" ->
> "Pseudo filesystems".
6 + 1 = 6 :D
> CONFIG_PROC_VMCORE=y
>
> 7) Make and install the kernel and its modules. DO NOT add this kernel
> to the boot loader configuration files.
>
>
> Load the Dump-capture Kernel
> ============================
>
> After booting to the system kernel, load the dump-capture kernel using
> the following command:
>
> kexec -p <dump-capture-kernel> \
> --initrd=<initrd-for-dump-capture-kernel> --args-linux \
> --append="root=<root-dev> init 1 irqpoll"
I've never tested irqpoll on powerpc, I'm not sure we want to recommend
it, has someone tested it?
> Notes on loading the dump-capture kernel:
>
> * <dump-capture-kernel> must be a vmlinux image (that is, an
> uncompressed ELF image). bzImage does not work at this time.
>
> * By default, the ELF headers are stored in ELF64 format to support
> systems with more than 4GB memory. The --elf32-core-headers option can
> be used to force the generation of ELF32 headers. This is necessary
> because GDB currently cannot open vmcore files with ELF64 headers on
> 32-bit systems. ELF32 headers can be used on non-PAE systems (that is,
> less than 4GB of memory).
>
> * The "irqpoll" boot parameter reduces driver initialization failures
> due to shared interrupts in the dump-capture kernel.
>
> * You must specify <root-dev> in the format corresponding to the root
> device name in the output of mount command.
> * "init 1" boots the dump-capture kernel into single-user mode without
> networking. If you want networking, use "init 3."
>
>
> Kernel Panic
> ============
>
> After successfully loading the dump-capture kernel as previously
> described, the system will reboot into the dump-capture kernel if a
> panic occurs. You can write a module to force the panic, or use
> "ALT-SysRq-c" to initiate a crash dump for testing purposes.
>
>
> Write Out the Dump File
> =======================
>
> After the dump-capture kernel is booted, write out the dump file with
> the following command:
>
> cp /proc/vmcore <dump-file>
>
> You can also access dumped memory as a /dev/oldmem device for a linear
> and raw view. To create the device, use the following command:
>
> mknod /dev/oldmem c 1 12
>
> Use the dd command with suitable options for count, bs, and skip to
> access specific portions of the dump.
>
> To see the entire memory, use the following command:
>
> dd if=/dev/oldmem of=oldmem.001
>
>
> Analysis
> ========
>
> Before analyzing the dump image, you should reboot into a stable kernel.
>
> You can do limited analysis using GDB on the dump file copied out of
> /proc/vmcore. Use the debug vmlinux built with -g and run the following
> command:
>
> gdb vmlinux <dump-file>
>
> Stack trace for the task on processor 0, register display, and memory
> display work fine.
>
> Note: GDB cannot analyze core files generated in ELF64 format for x86.
> On systems with a maximum of 4GB of memory, you can generate
> ELF32-format headers using the --elf32-core-headers kernel option on the
> dump kernel.
>
> You can also use the Crash utility to analyze dump files in Kdump
> format. Crash is available on Dave Anderson's site at the following URL:
>
> http://people.redhat.com/~anderson/
>
>
> To Do
> =====
>
> 1) Provide a kernel pages filtering mechanism, so core file size is not
> extreme on systems with huge memory banks.
>
> 2) Relocatable kernel can help in maintaining multiple kernels for
> crash_dump, and the same kernel as the system kernel can be used to
> capture the dump.
>
>
> Contact
> =======
>
> Vivek Goyal (vgoyal@in.ibm.com)
> Maneesh Soni (maneesh@in.ibm.com)
fastboot@lists.osdl.org
cheers
--
Michael Ellerman
IBM OzLabs
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* Re: PPC 405GPr support in linux 2.4.32
From: Tolunay Orkun @ 2006-04-26 23:48 UTC (permalink / raw)
To: Stephen Williams; +Cc: linuxppc-embedded
In-Reply-To: <e2ov5s$1hn$1@sea.gmane.org>
Stephen Williams wrote:
> ... seems completely missing in the linux-2.3.32 tree from kernel.org.
> This used to be in the linuxppc-2.4 BK tree that no longer exists, so
> what happened to the ppc405GPr support?!
I guess nobody sent patches upstream and development shifted to 2.6
kernel. 405Gpr is not alone. 405EP and a number of other CPU support
that was present never got its way up kernel.org sources.
^ permalink raw reply
* Re: PPC 405GPr support in linux 2.4.32
From: Matt Porter @ 2006-04-26 23:35 UTC (permalink / raw)
To: Stephen Williams; +Cc: linuxppc-embedded
In-Reply-To: <e2ov5s$1hn$1@sea.gmane.org>
On Wed, Apr 26, 2006 at 04:19:23PM -0700, Stephen Williams wrote:
> ... seems completely missing in the linux-2.3.32 tree from kernel.org.
> This used to be in the linuxppc-2.4 BK tree that no longer exists, so
> what happened to the ppc405GPr support?!
There's some stuff that never got submitted upstream to kernel.org
during 2.4 due partially to 2.5 appearing. All upstream devel
moved to 2.5/2.6 and no effort was made to merge stuff from the
linuxppc-2.4 tree to linux-2.4. Oh, and Marcelo didn't want
to take "new stuff" into linux-2.4 at that time either.
There's still rsync://source.mvista.com/linuxppc-2.4 available with
the 405gpr/sycamore support.
-Matt
^ permalink raw reply
* Re: PPC 405GPr support in linux 2.4.32
From: Stephen Williams @ 2006-04-26 23:57 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <20060426163540.H16236@cox.net>
Matt Porter wrote:
> On Wed, Apr 26, 2006 at 04:19:23PM -0700, Stephen Williams wrote:
>> ... seems completely missing in the linux-2.3.32 tree from kernel.org.
>> This used to be in the linuxppc-2.4 BK tree that no longer exists, so
>> what happened to the ppc405GPr support?!
>
> There's some stuff that never got submitted upstream to kernel.org
> during 2.4 due partially to 2.5 appearing. All upstream devel
> moved to 2.5/2.6 and no effort was made to merge stuff from the
> linuxppc-2.4 tree to linux-2.4. Oh, and Marcelo didn't want
> to take "new stuff" into linux-2.4 at that time either.
>
> There's still rsync://source.mvista.com/linuxppc-2.4 available with
> the 405gpr/sycamore support.
Well then I guess for 405GPr support and the SystemACE drivers
I'm on my own. Is there a git tree for main line 2.4 maintenance
(against which I could maintain patches) or am I on my own there
too?
It should be easy enough to rescue the gpr support form the bk
working dir that I have (or the mvista repository as you point
out) and make up patches.
--
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
^ permalink raw reply
* Re: Linux 2.6 sources for MPC852T processor
From: Dan Malek @ 2006-04-26 23:32 UTC (permalink / raw)
To: David Jander; +Cc: linuxppc-embedded
In-Reply-To: <200604261350.05295.david.jander@protonic.nl>
On Apr 26, 2006, at 7:50 AM, David Jander wrote:
> Yes, MPC852T is supported, although I might add that I have been
> using 2.6.14
> and 2.6.15 sucessfully with our own MPC852T-based board, but 2.6.16
> did not
> boot and as of today I don't know why, or whether this is an issue
> at all
> with boards other than ours.
There is a horrible bug in the 8xx TLB miss handler that is in the
2.6.16
sources. I don't know when it appeared. Enable the CPU6 Errata
workaround to see if that solves the problem and please report back
to me. I'm working on a solution.
Thanks.
-- Dan
^ permalink raw reply
* Linux 2.4 devel on ML403 board : problem with prompt
From: jean-francois.hasson @ 2006-04-27 6:06 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I am trying to port linux 2.4 devel to ML403. I have used advices from this
mailing list and some websites and finally got to th epoint where
everything seems find except I cannot get the boot prompt. I have used
busybox 1.0.1 and it seems init runs well, rcS runs well and afterr that I
do not get the prompt. I have activated the askfirst line in inittab and I
am asked to hit enter to go further but all I get is, automatically,
without hitting the keyboard, is character X. I do not seem to have any
echo. I have the console node defined in /dev. Has anyone an idea as to
what I have done wrong ?
Best regards,
JF Hasson
#
This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, please advise the sender immediately and delete this e-mail and all attached documents from your computer system. Any unauthorised disclosure, distribution or copying hereof is prohibited.
Ce courriel et les documents qui y sont attaches peuvent contenir des informations confidentielles. Au cas ou vous ne seriez pas le destinataire de ce courriel, vous etes prie d'en informer l'expediteur immediatement et de le detruire ainsi que tous les documents attaches de votre systeme informatique. Toute divulgation, distribution ou copie du present courriel et des documents attaches sans autorisation prealable de son emetteur est interdite.
#
^ permalink raw reply
* linux 2.4.26 bummer problem
From: Prakash N @ 2006-04-27 6:06 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 7060 bytes --]
Hi,
Iam trying to run linux 2.4.26 from mvista in xilinx XUPV2P board.
During booting I get this error message,
Mounted devfs on /dev
.
Freeing unused kernel memory: 60k init
init started: BusyBox v1.1.2 (2006.04.24-13:20+0000) multi-call binary
Starting pid 11, console /dev/console: '/etc/init.d/rcS'
Bummer, could not run '/etc/init.d/rcS': No such file or directory
Bummer, could not run
ML300 powerpc linux 2.4.21-pre7 E.I.S. edition
(none) login:
.
But I could see in the generated root file system this file is there.
Even its not logging with anything.
My inittab file is
::sysinit:/etc/init.d/rcS
#::askfirst:-/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init
::respawn:/sbin/getty 9600 tts/0
Without init options specified in busybox configuration I got,
.
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
mount_devfs_fs(): unable to mount devfs, err: -5
Freeing unused kernel memory: 60k init
Warning: unable to open an initial console.
Kernel panic: No init found. Try passing init= option to kernel.
Some replies in usenet, which I answered,
- x bits set for this shell script?
SInce Iam new to this embedded linux, could you tell whats that x bits means, is it exec permission (if so for whom,root?).
- does a shell run?
Iam not clear why does it say /etc/init.d/rcS is not there, while its definitely there.
I feel shell is not running. I want to just put what I get in minicom
----------------------------------------------------------------------------------------------------------------------------------------
loaded at: 00400000 004C11E4
board data at: 004BE13C 004BE154
relocated to: 00405634 0040564C
zimage at: 00405BF9 004BDD33
avail ram: 004C2000 10000000
Linux/PPC load: console=ttyS0,9600 root=/dev/xsysace/disc0/part2 rw
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.4.26 (root@edvl28.cedt.iisc.ernet.in) (gcc version 3.4.1) #16 Sat Apr 22 15:19:6Xilinx Virtex-II Pro port (C) 2002 MontaVista Software, Inc. (source@mvista.com)
On node 0 totalpages: 65536
zone(0): 65536 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=ttyS0,9600 root=/dev/xsysace/disc0/part2 rw
Xilinx INTC #0 at 0x41200000 mapped to 0xFDFFE000
Calibrating delay loop... 299.00 BogoMIPS
Memory: 257332k available (1284k kernel code, 380k data, 60k init, 0k highmem)
Dentry cache hash table entries: 32768 (order: 6, 262144 bytes)
Inode cache hash table entries: 16384 (order: 5, 131072 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 16384 (order: 4, 65536 bytes)
Page-cache hash table entries: 65536 (order: 6, 262144 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with no serial options enabled
ttyS00 at 0xfdfff003 (irq = 29) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
Partition check:
xsysacea: p1 p2
System ACE at 0x41800000 mapped to 0xD1070000, irq=30, 250880KB
eth0: using fifo mode.
eth0: No PHY detected. Assuming a PHY at address 0.
eth0: Xilinx EMAC #0 at 0x40C00000 mapped to 0xD1083000, irq=31
eth0: id 2.0h; block id 7, type 1
SCSI subsystem driver Revision: 1.00
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 2048 buckets, 16Kbytes
TCP: Hash tables configured (established 16384 bind 32768)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Mounted devfs on /dev
Freeing unused kernel memory: 60k init
init started: BusyBox v1.1.2 (2006.04.27-03:52+0000) multi-call binary
Starting pid 11, console /dev/console: '/etc/init.d/rcS'
Bummer, could not run '/etc/init.d/rcS': No such file or directory
Bummer, could not run '/etc/init.d/rcS': No such file
ML300 powerpc linux 2.4.21-pre7 E.I.S. edition
(none) login:
-----------------------------------------------------------------------------------------------------------------------------------
Here If I type su or root or whatever it asks password but always says incorrect login.
- try init=/bin/sh as a kernel parameter. Does it run?
My init tab file is
----------------------------------------------------------------------------------------------------------------------------
::init=/bin/sh
::sysinit:/etc/init.d/rcS
#::askfirst:-/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init
::respawn:/sbin/getty 9600 tts/0
------------------------------------------------------------------------------------------------------------------------------
The log is
..........
VFS: Mounted root (ext2 filesystem).
mount_devfs_fs(): unable to mount devfs, err: -5
Freeing unused kernel memory: 60k init
Warning: unable to open an initial console.
Kernel panic: No init found. Try passing init= option to kernel.
<0>Rebooting in 180 seconds..
-----------------------------------------------------------------------------------------------------------------
- all needed libraries to run available on your target?
I feel yes, as I could see these in lib folder of my RFS.
ld-2.3.3.so libdl.so.2 libnss_dns.so.2 libpthread.so.0
ld.so.1 libgcc_s_nof.so.1 libnss_files-2.3.3.so libresolv-2.3.3.so
libanl-2.3.3.so libgcc_s.so.1 libnss_files.so.2 libresolv.so.2
libanl.so.1 libm-2.3.3.so libnss_hesiod-2.3.3.so librt-2.3.3.so
libBrokenLocale-2.3.3.so libmemusage.so libnss_hesiod.so.2 librt.so.1
libBrokenLocale.so.1 libm.so.6 libnss_nis-2.3.3.so libSegFault.so
libc-2.3.3.so libnsl-2.3.3.so libnss_nisplus-2.3.3.so libstdc++.so.6
libcrypt-2.3.3.so libnsl.so.1 libnss_nisplus.so.2 libthread_db-1.0.so
libcrypt.so.1 libnss_compat-2.3.3.so libnss_nis.so.2 libthread_db.so.1
libc.so.6 libnss_compat.so.2 libpcprofile.so libutil-2.3.3.so
libdl-2.3.3.so libnss_dns-2.3.3.so libpthread-0.10.so libutil.so.1
guide me where Iam wrong
Prakash
---------------------------------
Jiyo cricket on Yahoo! India cricket
Yahoo! Messenger Mobile Stay in touch with your buddies all the time.
[-- Attachment #2: Type: text/html, Size: 9201 bytes --]
^ permalink raw reply
* Re: PPC Linux support for Tundra TSI148
From: Gerhard Jaeger @ 2006-04-27 7:13 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: Martin, Tim
In-Reply-To: <821B2170E9E7F04FA38DF7EC21DE4871049711CD@VCAEXCH01.hq.corp.viasat.com>
See my comments inline:
On Wednesday 26 April 2006 18:24, Martin, Tim wrote:
> Gerhard,
>
> Thanks for the information. More questions...
>
> What type of transfers were you doing? (e.g. A32/D64? SST320 or SST267?)
A32/D64 and 2eSST @ SST320
> Are these transfer from userspace data, from kernelspace data, or from
> the Tundra's pattern buffer?
They are from userspace.
> What was your PCI bus speed & width?
???
> Were you using inbound/outbound windows or Tundra's DMA controller?
DMA - via /dev/vme_dma0 interface
> What was the Tundra chipset configuration for the 168 MBps?
i.e. Buffersize 64K, 4K alignment, 2K PCI Fifo and 1K VME Fifo.
Using the Tundra driver and its interface structure, I used a
request level of 2, fairmode is set to normal, timeon timeout timer
is set to 7 and timeoff is set to no waiting (0).
>
> Thanks,
> Tim
>
> > -----Original Message-----
> > From: linuxppc-embedded-bounces+tmartin=viasat.com@ozlabs.org
> > [mailto:linuxppc-embedded-bounces+tmartin=viasat.com@ozlabs.org] On
> Behalf
> > Of Gerhard Jaeger
> > Sent: Wednesday, April 26, 2006 12:26 AM
> > To: linuxppc-embedded@ozlabs.org
> > Subject: Re: PPC Linux support for Tundra TSI148
> >
> > On Wednesday 26 April 2006 01:47, Martin, Tim wrote:
> > > Does anyone out there have any real world measured performance of a
> > > Linux PowerPC (kernel module + user space application) doing 2eSST
> VME
> > > transfers with the Tundra TSI148 chipset?
> > >
> > > Tundra has a Linux driver available for the Motorola MVME6100 , but
> told
> > > me they don't have any performance data available. I'm looking for
> > > sustained throughput rates, not the peak burst rates (e.g. 320 MBps,
> 267
> > > MBps).
> > >
> >
> > Hi,
> >
> > I've done here some tests between two MVME6100, while updating the
> 6100
> > BSP
> > for our embedded Linux distro. Depending on the buffersize, alignment,
> VME
> > and
> > PCI FIFO settings we have (without further optimizations) throughput
> rates
> > ranging
> > from 100MBps up to 168MBps. I think some tuning could still be done.
> >
> >HTH
> > Gerhard
--
Gerhard Jaeger <gjaeger@sysgo.com>
SYSGO AG Embedded and Real-Time Software
www.sysgo.com | www.elinos.com | www.pikeos.com | www.osek.de
^ permalink raw reply
* [PATCH 1/4] powerpc: add all the iSeries virtual devices to the device tree
From: Stephen Rothwell @ 2006-04-27 7:09 UTC (permalink / raw)
To: ppc-dev
We do this by putting them in the flattened device tree at setup time.
This required the flattened device tree blob to be made bigger.
Currenly we don't do anything with these.
Also make a function static.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/setup.c | 88 ++++++++++++++++++++++++++++++++
arch/powerpc/platforms/iseries/vio.c | 2 -
2 files changed, 88 insertions(+), 2 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
ea41f9a9099decfb4f7b9c061e7e38defa6b4744
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 3c51448..4862b8e 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -28,6 +28,7 @@ #include <linux/kdev_t.h>
#include <linux/major.h>
#include <linux/root_dev.h>
#include <linux/kernel.h>
+#include <linux/if_ether.h> /* ETH_ALEN */
#include <asm/processor.h>
#include <asm/machdep.h>
@@ -45,6 +46,7 @@ #include <asm/paca.h>
#include <asm/cache.h>
#include <asm/sections.h>
#include <asm/abs_addr.h>
+#include <asm/iseries/hv_types.h>
#include <asm/iseries/hv_lp_config.h>
#include <asm/iseries/hv_call_event.h>
#include <asm/iseries/hv_call_xm.h>
@@ -710,7 +712,7 @@ define_machine(iseries) {
};
struct blob {
- unsigned char data[PAGE_SIZE];
+ unsigned char data[PAGE_SIZE * 2];
unsigned long next;
};
@@ -911,6 +913,88 @@ void dt_model(struct iseries_flat_dt *dt
dt_prop_str(dt, "compatible", "IBM,iSeries");
}
+void dt_vdevices(struct iseries_flat_dt *dt)
+{
+ u32 reg = 0;
+ HvLpIndexMap vlan_map;
+ int i;
+ char buf[32];
+
+ dt_start_node(dt, "vdevice");
+ dt_prop_u32(dt, "#address-cells", 1);
+ dt_prop_u32(dt, "#size-cells", 0);
+
+ snprintf(buf, sizeof(buf), "viocons@%08x", reg);
+ dt_start_node(dt, buf);
+ dt_prop_str(dt, "device_type", "serial");
+ dt_prop_empty(dt, "compatible");
+ dt_prop_u32(dt, "reg", reg);
+ dt_end_node(dt);
+ reg++;
+
+ snprintf(buf, sizeof(buf), "v-scsi@%08x", reg);
+ dt_start_node(dt, buf);
+ dt_prop_str(dt, "device_type", "vscsi");
+ dt_prop_str(dt, "compatible", "IBM,v-scsi");
+ dt_prop_u32(dt, "reg", reg);
+ dt_end_node(dt);
+ reg++;
+
+ vlan_map = HvLpConfig_getVirtualLanIndexMap();
+ for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
+ unsigned char mac_addr[ETH_ALEN];
+
+ if ((vlan_map & (0x8000 >> i)) == 0)
+ continue;
+ snprintf(buf, 32, "vlan@%08x", reg + i);
+ dt_start_node(dt, buf);
+ dt_prop_str(dt, "device_type", "vlan");
+ dt_prop_empty(dt, "compatible");
+ dt_prop_u32(dt, "reg", reg + i);
+
+ mac_addr[0] = 0x02;
+ mac_addr[1] = 0x01;
+ mac_addr[2] = 0xff;
+ mac_addr[3] = i;
+ mac_addr[4] = 0xff;
+ mac_addr[5] = HvLpConfig_getLpIndex_outline();
+ dt_prop(dt, "local-mac-address", (char *)mac_addr, ETH_ALEN);
+ dt_prop(dt, "mac-address", (char *)mac_addr, ETH_ALEN);
+
+ dt_end_node(dt);
+ }
+ reg += HVMAXARCHITECTEDVIRTUALLANS;
+
+ for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++) {
+ snprintf(buf, 32, "viodasd@%08x", reg + i);
+ dt_start_node(dt, buf);
+ dt_prop_str(dt, "device_type", "viodasd");
+ dt_prop_empty(dt, "compatible");
+ dt_prop_u32(dt, "reg", reg + i);
+ dt_end_node(dt);
+ }
+ reg += HVMAXARCHITECTEDVIRTUALDISKS;
+ for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++) {
+ snprintf(buf, 32, "viocd@%08x", reg + i);
+ dt_start_node(dt, buf);
+ dt_prop_str(dt, "device_type", "viocd");
+ dt_prop_empty(dt, "compatible");
+ dt_prop_u32(dt, "reg", reg + i);
+ dt_end_node(dt);
+ }
+ reg += HVMAXARCHITECTEDVIRTUALCDROMS;
+ for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++) {
+ snprintf(buf, 32, "viotape@%08x", reg + i);
+ dt_start_node(dt, buf);
+ dt_prop_str(dt, "device_type", "viotape");
+ dt_prop_empty(dt, "compatible");
+ dt_prop_u32(dt, "reg", reg + i);
+ dt_end_node(dt);
+ }
+
+ dt_end_node(dt);
+}
+
void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
{
u64 tmp[2];
@@ -941,6 +1025,8 @@ void build_flat_dt(struct iseries_flat_d
dt_cpus(dt);
+ dt_vdevices(dt);
+
dt_end_node(dt);
dt_push_u32(dt, OF_DT_END);
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
index ad36ab0..22045a2 100644
--- a/arch/powerpc/platforms/iseries/vio.c
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -71,7 +71,7 @@ static struct vio_dev *__init vio_regist
return viodev;
}
-void __init probe_bus_iseries(void)
+static void __init probe_bus_iseries(void)
{
HvLpIndexMap vlan_map;
struct vio_dev *viodev;
--
1.3.1
^ permalink raw reply related
* [PATCH 2/4] powerpc: use the device tree for the iSeries vio bus probe
From: Stephen Rothwell @ 2006-04-27 7:18 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20060427170902.51a5a098.sfr@canb.auug.org.au>
As an added bonus, since every vio_dev now has a device_node
associated with it, hotplug now works.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/vio.c | 171 +++++++++++++++++++++++++++-----
arch/powerpc/platforms/iseries/setup.c | 4 +
arch/powerpc/platforms/iseries/vio.c | 70 ++-----------
arch/powerpc/platforms/pseries/vio.c | 147 ++--------------------------
include/asm-powerpc/vio.h | 9 +-
5 files changed, 169 insertions(+), 232 deletions(-)
Booted on an iSeries 270 and built for pSeries.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
457201dcad29a4a3fdb7230a6260dcee2c223ddb
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 971020c..9b46eed 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -22,9 +22,7 @@ #include <asm/iommu.h>
#include <asm/dma.h>
#include <asm/vio.h>
#include <asm/prom.h>
-
-static const struct vio_device_id *vio_match_device(
- const struct vio_device_id *, const struct vio_dev *);
+#include <asm/firmware.h>
struct vio_dev vio_bus_device = { /* fake "parent" device */
.name = vio_bus_device.dev.bus_id,
@@ -35,6 +33,27 @@ struct vio_dev vio_bus_device = { /* fa
static struct vio_bus_ops vio_bus_ops;
+/**
+ * vio_match_device: - Tell if a VIO device has a matching
+ * VIO device id structure.
+ * @ids: array of VIO device id structures to search in
+ * @dev: the VIO device structure to match against
+ *
+ * Used by a driver to check whether a VIO device present in the
+ * system is in its list of supported devices. Returns the matching
+ * vio_device_id structure or NULL if there is no match.
+ */
+static const struct vio_device_id *vio_match_device(
+ const struct vio_device_id *ids, const struct vio_dev *dev)
+{
+ while (ids->type[0] != '\0') {
+ if (vio_bus_ops.match(ids, dev))
+ return ids;
+ ids++;
+ }
+ return NULL;
+}
+
/*
* Convert from struct device to struct vio_dev and pass to driver.
* dev->driver has already been set by generic code because vio_bus_match
@@ -107,25 +126,76 @@ void vio_unregister_driver(struct vio_dr
EXPORT_SYMBOL(vio_unregister_driver);
/**
- * vio_match_device: - Tell if a VIO device has a matching
- * VIO device id structure.
- * @ids: array of VIO device id structures to search in
- * @dev: the VIO device structure to match against
+ * vio_register_device_node: - Register a new vio device.
+ * @of_node: The OF node for this device.
*
- * Used by a driver to check whether a VIO device present in the
- * system is in its list of supported devices. Returns the matching
- * vio_device_id structure or NULL if there is no match.
+ * Creates and initializes a vio_dev structure from the data in
+ * of_node (dev.platform_data) and adds it to the list of virtual devices.
+ * Returns a pointer to the created vio_dev or NULL if node has
+ * NULL device_type or compatible fields.
*/
-static const struct vio_device_id *vio_match_device(
- const struct vio_device_id *ids, const struct vio_dev *dev)
+struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
{
- while (ids->type[0] != '\0') {
- if (vio_bus_ops.match(ids, dev))
- return ids;
- ids++;
+ struct vio_dev *viodev;
+ unsigned int *unit_address;
+ unsigned int *irq_p;
+
+ /* we need the 'device_type' property, in order to match with drivers */
+ if (of_node->type == NULL) {
+ printk(KERN_WARNING "%s: node %s missing 'device_type'\n",
+ __FUNCTION__,
+ of_node->name ? of_node->name : "<unknown>");
+ return NULL;
}
- return NULL;
+
+ unit_address = (unsigned int *)get_property(of_node, "reg", NULL);
+ if (unit_address == NULL) {
+ printk(KERN_WARNING "%s: node %s missing 'reg'\n",
+ __FUNCTION__,
+ of_node->name ? of_node->name : "<unknown>");
+ return NULL;
+ }
+
+ /* allocate a vio_dev for this node */
+ viodev = kzalloc(sizeof(struct vio_dev), GFP_KERNEL);
+ if (viodev == NULL)
+ return NULL;
+
+ viodev->dev.platform_data = of_node_get(of_node);
+
+ viodev->irq = NO_IRQ;
+ irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
+ if (irq_p) {
+ int virq = virt_irq_create_mapping(*irq_p);
+ if (virq == NO_IRQ) {
+ printk(KERN_ERR "Unable to allocate interrupt "
+ "number for %s\n", of_node->full_name);
+ } else
+ viodev->irq = irq_offset_up(virq);
+ }
+
+ snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
+ viodev->name = of_node->name;
+ viodev->type = of_node->type;
+ viodev->unit_address = *unit_address;
+ if (firmware_has_feature(FW_FEATURE_ISERIES)) {
+ unit_address = (unsigned int *)get_property(of_node,
+ "linux,unit_address", NULL);
+ if (unit_address != NULL)
+ viodev->unit_address = *unit_address;
+ }
+ viodev->iommu_table = vio_bus_ops.build_iommu_table(viodev);
+
+ /* register with generic device framework */
+ if (vio_register_device(viodev) == NULL) {
+ /* XXX free TCE table */
+ kfree(viodev);
+ return NULL;
+ }
+
+ return viodev;
}
+EXPORT_SYMBOL(vio_register_device_node);
/**
* vio_bus_init: - Initialize the virtual IO bus
@@ -133,6 +203,7 @@ static const struct vio_device_id *vio_m
int __init vio_bus_init(struct vio_bus_ops *ops)
{
int err;
+ struct device_node *node_vroot;
vio_bus_ops = *ops;
@@ -153,23 +224,54 @@ int __init vio_bus_init(struct vio_bus_o
return err;
}
+ node_vroot = find_devices("vdevice");
+ if (node_vroot) {
+ struct device_node *of_node;
+
+ /*
+ * Create struct vio_devices for each virtual device in
+ * the device tree. Drivers will associate with them later.
+ */
+ for (of_node = node_vroot->child; of_node != NULL;
+ of_node = of_node->sibling) {
+ printk(KERN_DEBUG "%s: processing %p\n",
+ __FUNCTION__, of_node);
+ vio_register_device_node(of_node);
+ }
+ }
+
return 0;
}
/* vio_dev refcount hit 0 */
static void __devinit vio_dev_release(struct device *dev)
{
- if (vio_bus_ops.release_device)
- vio_bus_ops.release_device(dev);
+ if (dev->platform_data) {
+ /* XXX free TCE table */
+ of_node_put(dev->platform_data);
+ }
kfree(to_vio_dev(dev));
}
-static ssize_t viodev_show_name(struct device *dev,
+static ssize_t name_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
}
-DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL);
+
+static ssize_t devspec_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct device_node *of_node = dev->platform_data;
+
+ return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
+}
+
+static struct device_attribute vio_dev_attrs[] = {
+ __ATTR_RO(name),
+ __ATTR_RO(devspec),
+ __ATTR_NULL
+};
struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev)
{
@@ -184,16 +286,12 @@ struct vio_dev * __devinit vio_register_
__FUNCTION__, viodev->dev.bus_id);
return NULL;
}
- device_create_file(&viodev->dev, &dev_attr_name);
return viodev;
}
void __devinit vio_unregister_device(struct vio_dev *viodev)
{
- if (vio_bus_ops.unregister_device)
- vio_bus_ops.unregister_device(viodev);
- device_remove_file(&viodev->dev, &dev_attr_name);
device_unregister(&viodev->dev);
}
EXPORT_SYMBOL(vio_unregister_device);
@@ -267,22 +365,23 @@ static int vio_hotplug(struct device *de
char *buffer, int buffer_size)
{
const struct vio_dev *vio_dev = to_vio_dev(dev);
+ struct device_node *dn = dev->platform_data;
char *cp;
int length;
if (!num_envp)
return -ENOMEM;
- if (!vio_dev->dev.platform_data)
+ if (!dn)
return -ENODEV;
- cp = (char *)get_property(vio_dev->dev.platform_data, "compatible", &length);
+ cp = (char *)get_property(dn, "compatible", &length);
if (!cp)
return -ENODEV;
envp[0] = buffer;
length = scnprintf(buffer, buffer_size, "MODALIAS=vio:T%sS%s",
vio_dev->type, cp);
- if (buffer_size - length <= 0)
+ if ((buffer_size - length) <= 0)
return -ENOMEM;
envp[1] = NULL;
return 0;
@@ -290,9 +389,25 @@ static int vio_hotplug(struct device *de
struct bus_type vio_bus_type = {
.name = "vio",
+ .dev_attrs = vio_dev_attrs,
.uevent = vio_hotplug,
.match = vio_bus_match,
.probe = vio_bus_probe,
.remove = vio_bus_remove,
.shutdown = vio_bus_shutdown,
};
+
+/**
+ * vio_get_attribute: - get attribute for virtual device
+ * @vdev: The vio device to get property.
+ * @which: The property/attribute to be extracted.
+ * @length: Pointer to length of returned data size (unused if NULL).
+ *
+ * Calls prom.c's get_property() to return the value of the
+ * attribute specified by @which
+*/
+const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length)
+{
+ return get_property(vdev->dev.platform_data, which, length);
+}
+EXPORT_SYMBOL(vio_get_attribute);
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 4862b8e..901acbc 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -951,6 +951,7 @@ void dt_vdevices(struct iseries_flat_dt
dt_prop_str(dt, "device_type", "vlan");
dt_prop_empty(dt, "compatible");
dt_prop_u32(dt, "reg", reg + i);
+ dt_prop_u32(dt, "linux,unit_address", i);
mac_addr[0] = 0x02;
mac_addr[1] = 0x01;
@@ -971,6 +972,7 @@ void dt_vdevices(struct iseries_flat_dt
dt_prop_str(dt, "device_type", "viodasd");
dt_prop_empty(dt, "compatible");
dt_prop_u32(dt, "reg", reg + i);
+ dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
}
reg += HVMAXARCHITECTEDVIRTUALDISKS;
@@ -980,6 +982,7 @@ void dt_vdevices(struct iseries_flat_dt
dt_prop_str(dt, "device_type", "viocd");
dt_prop_empty(dt, "compatible");
dt_prop_u32(dt, "reg", reg + i);
+ dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
}
reg += HVMAXARCHITECTEDVIRTUALCDROMS;
@@ -989,6 +992,7 @@ void dt_vdevices(struct iseries_flat_dt
dt_prop_str(dt, "device_type", "viotape");
dt_prop_empty(dt, "compatible");
dt_prop_u32(dt, "reg", reg + i);
+ dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
}
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
index 22045a2..a689da6 100644
--- a/arch/powerpc/platforms/iseries/vio.c
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -43,58 +43,11 @@ static void __init iommu_vio_init(void)
printk("Virtual Bus VIO TCE table failed.\n");
}
-/**
- * vio_register_device_iseries: - Register a new iSeries vio device.
- * @voidev: The device to register.
- */
-static struct vio_dev *__init vio_register_device_iseries(char *type,
- uint32_t unit_num)
+static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
{
- struct vio_dev *viodev;
-
- /* allocate a vio_dev for this device */
- viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
- if (!viodev)
- return NULL;
- memset(viodev, 0, sizeof(struct vio_dev));
-
- snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s%d", type, unit_num);
-
- viodev->name = viodev->dev.bus_id;
- viodev->type = type;
- viodev->unit_address = unit_num;
- viodev->iommu_table = &vio_iommu_table;
- if (vio_register_device(viodev) == NULL) {
- kfree(viodev);
- return NULL;
- }
- return viodev;
-}
-
-static void __init probe_bus_iseries(void)
-{
- HvLpIndexMap vlan_map;
- struct vio_dev *viodev;
- int i;
-
- /* there is only one of each of these */
- vio_register_device_iseries("viocons", 0);
- vio_register_device_iseries("vscsi", 0);
-
- vlan_map = HvLpConfig_getVirtualLanIndexMap();
- for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
- if ((vlan_map & (0x8000 >> i)) == 0)
- continue;
- viodev = vio_register_device_iseries("vlan", i);
- /* veth is special and has it own iommu_table */
- viodev->iommu_table = &veth_iommu_table;
- }
- for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++)
- vio_register_device_iseries("viodasd", i);
- for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++)
- vio_register_device_iseries("viocd", i);
- for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++)
- vio_register_device_iseries("viotape", i);
+ if (strcmp(dev->type, "vlan") == 0)
+ return &veth_iommu_table;
+ return &vio_iommu_table;
}
/**
@@ -109,6 +62,7 @@ static int vio_match_device_iseries(cons
static struct vio_bus_ops vio_bus_ops_iseries = {
.match = vio_match_device_iseries,
+ .build_iommu_table = vio_build_iommu_table,
};
/**
@@ -116,16 +70,10 @@ static struct vio_bus_ops vio_bus_ops_is
*/
static int __init vio_bus_init_iseries(void)
{
- int err;
-
- err = vio_bus_init(&vio_bus_ops_iseries);
- if (err == 0) {
- iommu_vio_init();
- vio_bus_device.iommu_table = &vio_iommu_table;
- iSeries_vio_dev = &vio_bus_device.dev;
- probe_bus_iseries();
- }
- return err;
+ iommu_vio_init();
+ vio_bus_device.iommu_table = &vio_iommu_table;
+ iSeries_vio_dev = &vio_bus_device.dev;
+ return vio_bus_init(&vio_bus_ops_iseries);
}
__initcall(vio_bus_init_iseries);
diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 8e53e04..b3925ae 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -26,26 +26,6 @@ #include <asm/tce.h>
extern struct subsystem devices_subsys; /* needed for vio_find_name() */
-static void probe_bus_pseries(void)
-{
- struct device_node *node_vroot, *of_node;
-
- node_vroot = find_devices("vdevice");
- if ((node_vroot == NULL) || (node_vroot->child == NULL))
- /* this machine doesn't do virtual IO, and that's ok */
- return;
-
- /*
- * Create struct vio_devices for each virtual device in the device tree.
- * Drivers will associate with them later.
- */
- for (of_node = node_vroot->child; of_node != NULL;
- of_node = of_node->sibling) {
- printk(KERN_DEBUG "%s: processing %p\n", __FUNCTION__, of_node);
- vio_register_device_node(of_node);
- }
-}
-
/**
* vio_match_device_pseries: - Tell if a pSeries VIO device matches a
* vio_device_id
@@ -57,47 +37,6 @@ static int vio_match_device_pseries(cons
device_is_compatible(dev->dev.platform_data, id->compat);
}
-static void vio_release_device_pseries(struct device *dev)
-{
- /* XXX free TCE table */
- of_node_put(dev->platform_data);
-}
-
-static ssize_t viodev_show_devspec(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct device_node *of_node = dev->platform_data;
-
- return sprintf(buf, "%s\n", of_node->full_name);
-}
-DEVICE_ATTR(devspec, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_devspec, NULL);
-
-static void vio_unregister_device_pseries(struct vio_dev *viodev)
-{
- device_remove_file(&viodev->dev, &dev_attr_devspec);
-}
-
-static struct vio_bus_ops vio_bus_ops_pseries = {
- .match = vio_match_device_pseries,
- .unregister_device = vio_unregister_device_pseries,
- .release_device = vio_release_device_pseries,
-};
-
-/**
- * vio_bus_init_pseries: - Initialize the pSeries virtual IO bus
- */
-static int __init vio_bus_init_pseries(void)
-{
- int err;
-
- err = vio_bus_init(&vio_bus_ops_pseries);
- if (err == 0)
- probe_bus_pseries();
- return err;
-}
-
-__initcall(vio_bus_init_pseries);
-
/**
* vio_build_iommu_table: - gets the dma information from OF and
* builds the TCE tree.
@@ -136,88 +75,20 @@ static struct iommu_table *vio_build_iom
return iommu_init_table(newTceTable);
}
+static struct vio_bus_ops vio_bus_ops_pseries = {
+ .match = vio_match_device_pseries,
+ .build_iommu_table = vio_build_iommu_table,
+};
+
/**
- * vio_register_device_node: - Register a new vio device.
- * @of_node: The OF node for this device.
- *
- * Creates and initializes a vio_dev structure from the data in
- * of_node (dev.platform_data) and adds it to the list of virtual devices.
- * Returns a pointer to the created vio_dev or NULL if node has
- * NULL device_type or compatible fields.
+ * vio_bus_init_pseries: - Initialize the pSeries virtual IO bus
*/
-struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
+static int __init vio_bus_init_pseries(void)
{
- struct vio_dev *viodev;
- unsigned int *unit_address;
- unsigned int *irq_p;
-
- /* we need the 'device_type' property, in order to match with drivers */
- if ((NULL == of_node->type)) {
- printk(KERN_WARNING
- "%s: node %s missing 'device_type'\n", __FUNCTION__,
- of_node->name ? of_node->name : "<unknown>");
- return NULL;
- }
-
- unit_address = (unsigned int *)get_property(of_node, "reg", NULL);
- if (!unit_address) {
- printk(KERN_WARNING "%s: node %s missing 'reg'\n", __FUNCTION__,
- of_node->name ? of_node->name : "<unknown>");
- return NULL;
- }
-
- /* allocate a vio_dev for this node */
- viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
- if (!viodev) {
- return NULL;
- }
- memset(viodev, 0, sizeof(struct vio_dev));
-
- viodev->dev.platform_data = of_node_get(of_node);
-
- viodev->irq = NO_IRQ;
- irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
- if (irq_p) {
- int virq = virt_irq_create_mapping(*irq_p);
- if (virq == NO_IRQ) {
- printk(KERN_ERR "Unable to allocate interrupt "
- "number for %s\n", of_node->full_name);
- } else
- viodev->irq = irq_offset_up(virq);
- }
-
- snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
- viodev->name = of_node->name;
- viodev->type = of_node->type;
- viodev->unit_address = *unit_address;
- viodev->iommu_table = vio_build_iommu_table(viodev);
-
- /* register with generic device framework */
- if (vio_register_device(viodev) == NULL) {
- /* XXX free TCE table */
- kfree(viodev);
- return NULL;
- }
- device_create_file(&viodev->dev, &dev_attr_devspec);
-
- return viodev;
+ return vio_bus_init(&vio_bus_ops_pseries);
}
-EXPORT_SYMBOL(vio_register_device_node);
-/**
- * vio_get_attribute: - get attribute for virtual device
- * @vdev: The vio device to get property.
- * @which: The property/attribute to be extracted.
- * @length: Pointer to length of returned data size (unused if NULL).
- *
- * Calls prom.c's get_property() to return the value of the
- * attribute specified by the preprocessor constant @which
-*/
-const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length)
-{
- return get_property(vdev->dev.platform_data, (char*)which, length);
-}
-EXPORT_SYMBOL(vio_get_attribute);
+__initcall(vio_bus_init_pseries);
/* vio_find_name() - internal because only vio.c knows how we formatted the
* kobject name
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h
index 0544ece..0055d8e 100644
--- a/include/asm-powerpc/vio.h
+++ b/include/asm-powerpc/vio.h
@@ -66,8 +66,7 @@ struct vio_driver {
struct vio_bus_ops {
int (*match)(const struct vio_device_id *id, const struct vio_dev *dev);
- void (*unregister_device)(struct vio_dev *);
- void (*release_device)(struct device *);
+ struct iommu_table *(*build_iommu_table)(struct vio_dev *dev);
};
extern struct dma_mapping_ops vio_dma_ops;
@@ -82,14 +81,14 @@ extern void __devinit vio_unregister_dev
extern int vio_bus_init(struct vio_bus_ops *);
-#ifdef CONFIG_PPC_PSERIES
struct device_node;
extern struct vio_dev * __devinit vio_register_device_node(
struct device_node *node_vdev);
-extern struct vio_dev *vio_find_node(struct device_node *vnode);
-extern const void *vio_get_attribute(struct vio_dev *vdev, void *which,
+extern const void *vio_get_attribute(struct vio_dev *vdev, char *which,
int *length);
+#ifdef CONFIG_PPC_PSERIES
+extern struct vio_dev *vio_find_node(struct device_node *vnode);
extern int vio_enable_interrupts(struct vio_dev *dev);
extern int vio_disable_interrupts(struct vio_dev *dev);
#endif
--
1.3.1
^ permalink raw reply related
* [PATCH 3/4] powerpc: use a common vio_match_device routine
From: Stephen Rothwell @ 2006-04-27 7:21 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20060427171821.6ebdf3fb.sfr@canb.auug.org.au>
This requires the compatible properties having vaules that are empty
strings instead of just being empty properties.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/vio.c | 3 ++-
arch/powerpc/platforms/iseries/setup.c | 10 +++++-----
arch/powerpc/platforms/iseries/vio.c | 12 ------------
arch/powerpc/platforms/pseries/vio.c | 12 ------------
include/asm-powerpc/vio.h | 1 -
5 files changed, 7 insertions(+), 31 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
2c0c46b1d70d543203c547034bc1a78ab0fb10a9
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 9b46eed..1952929 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -47,7 +47,8 @@ static const struct vio_device_id *vio_m
const struct vio_device_id *ids, const struct vio_dev *dev)
{
while (ids->type[0] != '\0') {
- if (vio_bus_ops.match(ids, dev))
+ if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) &&
+ device_is_compatible(dev->dev.platform_data, ids->compat))
return ids;
ids++;
}
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 901acbc..befd36a 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -927,7 +927,7 @@ void dt_vdevices(struct iseries_flat_dt
snprintf(buf, sizeof(buf), "viocons@%08x", reg);
dt_start_node(dt, buf);
dt_prop_str(dt, "device_type", "serial");
- dt_prop_empty(dt, "compatible");
+ dt_prop_str(dt, "compatible", "");
dt_prop_u32(dt, "reg", reg);
dt_end_node(dt);
reg++;
@@ -949,7 +949,7 @@ void dt_vdevices(struct iseries_flat_dt
snprintf(buf, 32, "vlan@%08x", reg + i);
dt_start_node(dt, buf);
dt_prop_str(dt, "device_type", "vlan");
- dt_prop_empty(dt, "compatible");
+ dt_prop_str(dt, "compatible", "");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
@@ -970,7 +970,7 @@ void dt_vdevices(struct iseries_flat_dt
snprintf(buf, 32, "viodasd@%08x", reg + i);
dt_start_node(dt, buf);
dt_prop_str(dt, "device_type", "viodasd");
- dt_prop_empty(dt, "compatible");
+ dt_prop_str(dt, "compatible", "");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
@@ -980,7 +980,7 @@ void dt_vdevices(struct iseries_flat_dt
snprintf(buf, 32, "viocd@%08x", reg + i);
dt_start_node(dt, buf);
dt_prop_str(dt, "device_type", "viocd");
- dt_prop_empty(dt, "compatible");
+ dt_prop_str(dt, "compatible", "");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
@@ -990,7 +990,7 @@ void dt_vdevices(struct iseries_flat_dt
snprintf(buf, 32, "viotape@%08x", reg + i);
dt_start_node(dt, buf);
dt_prop_str(dt, "device_type", "viotape");
- dt_prop_empty(dt, "compatible");
+ dt_prop_str(dt, "compatible", "");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
index a689da6..bdd2b7d 100644
--- a/arch/powerpc/platforms/iseries/vio.c
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -50,18 +50,7 @@ static struct iommu_table *vio_build_iom
return &vio_iommu_table;
}
-/**
- * vio_match_device_iseries: - Tell if a iSeries VIO device matches a
- * vio_device_id
- */
-static int vio_match_device_iseries(const struct vio_device_id *id,
- const struct vio_dev *dev)
-{
- return strncmp(dev->type, id->type, strlen(id->type)) == 0;
-}
-
static struct vio_bus_ops vio_bus_ops_iseries = {
- .match = vio_match_device_iseries,
.build_iommu_table = vio_build_iommu_table,
};
@@ -75,5 +64,4 @@ static int __init vio_bus_init_iseries(v
iSeries_vio_dev = &vio_bus_device.dev;
return vio_bus_init(&vio_bus_ops_iseries);
}
-
__initcall(vio_bus_init_iseries);
diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index b3925ae..d289166 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -27,17 +27,6 @@ #include <asm/tce.h>
extern struct subsystem devices_subsys; /* needed for vio_find_name() */
/**
- * vio_match_device_pseries: - Tell if a pSeries VIO device matches a
- * vio_device_id
- */
-static int vio_match_device_pseries(const struct vio_device_id *id,
- const struct vio_dev *dev)
-{
- return (strncmp(dev->type, id->type, strlen(id->type)) == 0) &&
- device_is_compatible(dev->dev.platform_data, id->compat);
-}
-
-/**
* vio_build_iommu_table: - gets the dma information from OF and
* builds the TCE tree.
* @dev: the virtual device.
@@ -76,7 +65,6 @@ static struct iommu_table *vio_build_iom
}
static struct vio_bus_ops vio_bus_ops_pseries = {
- .match = vio_match_device_pseries,
.build_iommu_table = vio_build_iommu_table,
};
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h
index 0055d8e..9c09a8f 100644
--- a/include/asm-powerpc/vio.h
+++ b/include/asm-powerpc/vio.h
@@ -65,7 +65,6 @@ struct vio_driver {
};
struct vio_bus_ops {
- int (*match)(const struct vio_device_id *id, const struct vio_dev *dev);
struct iommu_table *(*build_iommu_table)(struct vio_dev *dev);
};
--
1.3.1
^ permalink raw reply related
* [PATCH 4/4] powerpc: merge the rest of the vio code
From: Stephen Rothwell @ 2006-04-27 7:23 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20060427172146.4660a953.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/vio.c | 198 ++++++++++++++++++++++++++-----
arch/powerpc/platforms/iseries/Makefile | 1
arch/powerpc/platforms/iseries/iommu.c | 3
arch/powerpc/platforms/iseries/iommu.h | 35 -----
arch/powerpc/platforms/iseries/pci.c | 2
arch/powerpc/platforms/iseries/vio.c | 67 ----------
arch/powerpc/platforms/pseries/Makefile | 1
arch/powerpc/platforms/pseries/vio.c | 133 ---------------------
include/asm-powerpc/iseries/iommu.h | 35 +++++
include/asm-powerpc/vio.h | 8 -
10 files changed, 201 insertions(+), 282 deletions(-)
delete mode 100644 arch/powerpc/platforms/iseries/iommu.h
delete mode 100644 arch/powerpc/platforms/iseries/vio.c
delete mode 100644 arch/powerpc/platforms/pseries/vio.c
create mode 100644 include/asm-powerpc/iseries/iommu.h
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
d79e3d667af2d5babcc931a71aa536ff150ba541
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 1952929..ac5c7bf 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -13,25 +13,102 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/types.h>
+#include <linux/device.h>
#include <linux/init.h>
#include <linux/console.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/dma-mapping.h>
+#include <linux/kobject.h>
+
#include <asm/iommu.h>
#include <asm/dma.h>
#include <asm/vio.h>
#include <asm/prom.h>
#include <asm/firmware.h>
-
-struct vio_dev vio_bus_device = { /* fake "parent" device */
+#include <asm/tce.h>
+#include <asm/abs_addr.h>
+#include <asm/page.h>
+#include <asm/hvcall.h>
+#include <asm/iseries/vio.h>
+#include <asm/iseries/hv_types.h>
+#include <asm/iseries/hv_lp_config.h>
+#include <asm/iseries/hv_call_xm.h>
+#include <asm/iseries/iommu.h>
+
+extern struct subsystem devices_subsys; /* needed for vio_find_name() */
+
+static struct vio_dev vio_bus_device = { /* fake "parent" device */
.name = vio_bus_device.dev.bus_id,
.type = "",
.dev.bus_id = "vio",
.dev.bus = &vio_bus_type,
};
-static struct vio_bus_ops vio_bus_ops;
+#ifdef CONFIG_PPC_ISERIES
+struct device *iSeries_vio_dev = &vio_bus_device.dev;
+EXPORT_SYMBOL(iSeries_vio_dev);
+
+static struct iommu_table veth_iommu_table;
+static struct iommu_table vio_iommu_table;
+
+static void __init iommu_vio_init(void)
+{
+ iommu_table_getparms_iSeries(255, 0, 0xff, &veth_iommu_table);
+ veth_iommu_table.it_size /= 2;
+ vio_iommu_table = veth_iommu_table;
+ vio_iommu_table.it_offset += veth_iommu_table.it_size;
+
+ if (!iommu_init_table(&veth_iommu_table))
+ printk("Virtual Bus VETH TCE table failed.\n");
+ if (!iommu_init_table(&vio_iommu_table))
+ printk("Virtual Bus VIO TCE table failed.\n");
+}
+#endif
+
+static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
+{
+#ifdef CONFIG_PPC_ISERIES
+ if (firmware_has_feature(FW_FEATURE_ISERIES)) {
+ if (strcmp(dev->type, "vlan") == 0)
+ return &veth_iommu_table;
+ return &vio_iommu_table;
+ } else
+#endif
+ {
+ unsigned int *dma_window;
+ struct iommu_table *newTceTable;
+ unsigned long offset;
+ int dma_window_property_size;
+
+ dma_window = (unsigned int *)get_property(
+ dev->dev.platform_data, "ibm,my-dma-window",
+ &dma_window_property_size);
+ if (!dma_window)
+ return NULL;
+
+ newTceTable = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
+
+ /*
+ * There should be some code to extract the phys-encoded
+ * offset using prom_n_addr_cells(). However, according to
+ * a comment on earlier versions, it's always zero, so we
+ * don't bother
+ */
+ offset = dma_window[1] >> PAGE_SHIFT;
+
+ /* TCE table size - measured in tce entries */
+ newTceTable->it_size = dma_window[4] >> PAGE_SHIFT;
+ /* offset for VIO should always be 0 */
+ newTceTable->it_offset = offset;
+ newTceTable->it_busno = 0;
+ newTceTable->it_index = (unsigned long)dma_window[0];
+ newTceTable->it_type = TCE_VB;
+
+ return iommu_init_table(newTceTable);
+ }
+}
/**
* vio_match_device: - Tell if a VIO device has a matching
@@ -126,6 +203,16 @@ void vio_unregister_driver(struct vio_dr
}
EXPORT_SYMBOL(vio_unregister_driver);
+/* vio_dev refcount hit 0 */
+static void __devinit vio_dev_release(struct device *dev)
+{
+ if (dev->platform_data) {
+ /* XXX free TCE table */
+ of_node_put(dev->platform_data);
+ }
+ kfree(to_vio_dev(dev));
+}
+
/**
* vio_register_device_node: - Register a new vio device.
* @of_node: The OF node for this device.
@@ -185,10 +272,17 @@ struct vio_dev * __devinit vio_register_
if (unit_address != NULL)
viodev->unit_address = *unit_address;
}
- viodev->iommu_table = vio_bus_ops.build_iommu_table(viodev);
+ viodev->iommu_table = vio_build_iommu_table(viodev);
+
+ /* init generic 'struct device' fields: */
+ viodev->dev.parent = &vio_bus_device.dev;
+ viodev->dev.bus = &vio_bus_type;
+ viodev->dev.release = vio_dev_release;
/* register with generic device framework */
- if (vio_register_device(viodev) == NULL) {
+ if (device_register(&viodev->dev)) {
+ printk(KERN_ERR "%s: failed to register device %s\n",
+ __FUNCTION__, viodev->dev.bus_id);
/* XXX free TCE table */
kfree(viodev);
return NULL;
@@ -201,12 +295,18 @@ EXPORT_SYMBOL(vio_register_device_node);
/**
* vio_bus_init: - Initialize the virtual IO bus
*/
-int __init vio_bus_init(struct vio_bus_ops *ops)
+static int __init vio_bus_init(void)
{
int err;
struct device_node *node_vroot;
- vio_bus_ops = *ops;
+#ifdef CONFIG_PPC_ISERIES
+ if (firmware_has_feature(FW_FEATURE_ISERIES)) {
+ iommu_vio_init();
+ vio_bus_device.iommu_table = &vio_iommu_table;
+ iSeries_vio_dev = &vio_bus_device.dev;
+ }
+#endif
err = bus_register(&vio_bus_type);
if (err) {
@@ -243,16 +343,7 @@ int __init vio_bus_init(struct vio_bus_o
return 0;
}
-
-/* vio_dev refcount hit 0 */
-static void __devinit vio_dev_release(struct device *dev)
-{
- if (dev->platform_data) {
- /* XXX free TCE table */
- of_node_put(dev->platform_data);
- }
- kfree(to_vio_dev(dev));
-}
+__initcall(vio_bus_init);
static ssize_t name_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -274,23 +365,6 @@ static struct device_attribute vio_dev_a
__ATTR_NULL
};
-struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev)
-{
- /* init generic 'struct device' fields: */
- viodev->dev.parent = &vio_bus_device.dev;
- viodev->dev.bus = &vio_bus_type;
- viodev->dev.release = vio_dev_release;
-
- /* register with generic device framework */
- if (device_register(&viodev->dev)) {
- printk(KERN_ERR "%s: failed to register device %s\n",
- __FUNCTION__, viodev->dev.bus_id);
- return NULL;
- }
-
- return viodev;
-}
-
void __devinit vio_unregister_device(struct vio_dev *viodev)
{
device_unregister(&viodev->dev);
@@ -412,3 +486,59 @@ const void *vio_get_attribute(struct vio
return get_property(vdev->dev.platform_data, which, length);
}
EXPORT_SYMBOL(vio_get_attribute);
+
+#ifdef CONFIG_PPC_PSERIES
+/* vio_find_name() - internal because only vio.c knows how we formatted the
+ * kobject name
+ * XXX once vio_bus_type.devices is actually used as a kset in
+ * drivers/base/bus.c, this function should be removed in favor of
+ * "device_find(kobj_name, &vio_bus_type)"
+ */
+static struct vio_dev *vio_find_name(const char *kobj_name)
+{
+ struct kobject *found;
+
+ found = kset_find_obj(&devices_subsys.kset, kobj_name);
+ if (!found)
+ return NULL;
+
+ return to_vio_dev(container_of(found, struct device, kobj));
+}
+
+/**
+ * vio_find_node - find an already-registered vio_dev
+ * @vnode: device_node of the virtual device we're looking for
+ */
+struct vio_dev *vio_find_node(struct device_node *vnode)
+{
+ uint32_t *unit_address;
+ char kobj_name[BUS_ID_SIZE];
+
+ /* construct the kobject name from the device node */
+ unit_address = (uint32_t *)get_property(vnode, "reg", NULL);
+ if (!unit_address)
+ return NULL;
+ snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address);
+
+ return vio_find_name(kobj_name);
+}
+EXPORT_SYMBOL(vio_find_node);
+
+int vio_enable_interrupts(struct vio_dev *dev)
+{
+ int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
+ if (rc != H_SUCCESS)
+ printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
+ return rc;
+}
+EXPORT_SYMBOL(vio_enable_interrupts);
+
+int vio_disable_interrupts(struct vio_dev *dev)
+{
+ int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
+ if (rc != H_SUCCESS)
+ printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
+ return rc;
+}
+EXPORT_SYMBOL(vio_disable_interrupts);
+#endif /* CONFIG_PPC_PSERIES */
diff --git a/arch/powerpc/platforms/iseries/Makefile b/arch/powerpc/platforms/iseries/Makefile
index ce8c0b9..7e67a20 100644
--- a/arch/powerpc/platforms/iseries/Makefile
+++ b/arch/powerpc/platforms/iseries/Makefile
@@ -3,7 +3,6 @@ EXTRA_CFLAGS += -mno-minimal-toc
obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o mf.o lpevents.o \
hvcall.o proc.o htab.o iommu.o misc.o irq.o
obj-$(CONFIG_PCI) += pci.o vpdinfo.o
-obj-$(CONFIG_IBMVIO) += vio.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_VIOPATH) += viopath.o
obj-$(CONFIG_MODULES) += ksyms.o
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index bea0b70..a8d9631 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -33,8 +33,7 @@ #include <asm/machdep.h>
#include <asm/abs_addr.h>
#include <asm/pci-bridge.h>
#include <asm/iseries/hv_call_xm.h>
-
-#include "iommu.h"
+#include <asm/iseries/iommu.h>
extern struct list_head iSeries_Global_Device_List;
diff --git a/arch/powerpc/platforms/iseries/iommu.h b/arch/powerpc/platforms/iseries/iommu.h
deleted file mode 100644
index cb5658f..0000000
--- a/arch/powerpc/platforms/iseries/iommu.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef _PLATFORMS_ISERIES_IOMMU_H
-#define _PLATFORMS_ISERIES_IOMMU_H
-
-/*
- * Copyright (C) 2005 Stephen Rothwell, IBM Corporation
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the:
- * Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- */
-
-struct device_node;
-struct iommu_table;
-
-/* Creates table for an individual device node */
-extern void iommu_devnode_init_iSeries(struct device_node *dn);
-
-/* Get table parameters from HV */
-extern void iommu_table_getparms_iSeries(unsigned long busno,
- unsigned char slotno, unsigned char virtbus,
- struct iommu_table *tbl);
-
-#endif /* _PLATFORMS_ISERIES_IOMMU_H */
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 5a61c6f..428ffb5 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -37,13 +37,13 @@ #include <asm/abs_addr.h>
#include <asm/iseries/hv_call_xm.h>
#include <asm/iseries/mf.h>
+#include <asm/iseries/iommu.h>
#include <asm/ppc-pci.h>
#include "irq.h"
#include "pci.h"
#include "call_pci.h"
-#include "iommu.h"
/*
* Forward declares of prototypes.
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
deleted file mode 100644
index bdd2b7d..0000000
--- a/arch/powerpc/platforms/iseries/vio.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * IBM PowerPC iSeries Virtual I/O Infrastructure Support.
- *
- * Copyright (c) 2005 Stephen Rothwell, IBM Corp.
- *
- * 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/types.h>
-#include <linux/device.h>
-#include <linux/init.h>
-
-#include <asm/vio.h>
-#include <asm/iommu.h>
-#include <asm/tce.h>
-#include <asm/abs_addr.h>
-#include <asm/page.h>
-#include <asm/iseries/vio.h>
-#include <asm/iseries/hv_types.h>
-#include <asm/iseries/hv_lp_config.h>
-#include <asm/iseries/hv_call_xm.h>
-
-#include "iommu.h"
-
-struct device *iSeries_vio_dev = &vio_bus_device.dev;
-EXPORT_SYMBOL(iSeries_vio_dev);
-
-static struct iommu_table veth_iommu_table;
-static struct iommu_table vio_iommu_table;
-
-static void __init iommu_vio_init(void)
-{
- iommu_table_getparms_iSeries(255, 0, 0xff, &veth_iommu_table);
- veth_iommu_table.it_size /= 2;
- vio_iommu_table = veth_iommu_table;
- vio_iommu_table.it_offset += veth_iommu_table.it_size;
-
- if (!iommu_init_table(&veth_iommu_table))
- printk("Virtual Bus VETH TCE table failed.\n");
- if (!iommu_init_table(&vio_iommu_table))
- printk("Virtual Bus VIO TCE table failed.\n");
-}
-
-static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
-{
- if (strcmp(dev->type, "vlan") == 0)
- return &veth_iommu_table;
- return &vio_iommu_table;
-}
-
-static struct vio_bus_ops vio_bus_ops_iseries = {
- .build_iommu_table = vio_build_iommu_table,
-};
-
-/**
- * vio_bus_init_iseries: - Initialize the iSeries virtual IO bus
- */
-static int __init vio_bus_init_iseries(void)
-{
- iommu_vio_init();
- vio_bus_device.iommu_table = &vio_iommu_table;
- iSeries_vio_dev = &vio_bus_device.dev;
- return vio_bus_init(&vio_bus_ops_iseries);
-}
-__initcall(vio_bus_init_iseries);
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index 9308986..b46ce3b 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -2,7 +2,6 @@ obj-y := pci.o lpar.o hvCall.o nvram.o
setup.o iommu.o ras.o rtasd.o pci_dlpar.o \
firmware.o
obj-$(CONFIG_SMP) += smp.o
-obj-$(CONFIG_IBMVIO) += vio.o
obj-$(CONFIG_XICS) += xics.o
obj-$(CONFIG_SCANLOG) += scanlog.o
obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o
diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
deleted file mode 100644
index d289166..0000000
--- a/arch/powerpc/platforms/pseries/vio.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * IBM PowerPC pSeries Virtual I/O Infrastructure Support.
- *
- * Copyright (c) 2003-2005 IBM Corp.
- * Dave Engebretsen engebret@us.ibm.com
- * Santiago Leon santil@us.ibm.com
- * Hollis Blanchard <hollisb@us.ibm.com>
- * Stephen Rothwell
- *
- * 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/init.h>
-#include <linux/module.h>
-#include <linux/mm.h>
-#include <linux/kobject.h>
-#include <asm/iommu.h>
-#include <asm/dma.h>
-#include <asm/prom.h>
-#include <asm/vio.h>
-#include <asm/hvcall.h>
-#include <asm/tce.h>
-
-extern struct subsystem devices_subsys; /* needed for vio_find_name() */
-
-/**
- * vio_build_iommu_table: - gets the dma information from OF and
- * builds the TCE tree.
- * @dev: the virtual device.
- *
- * Returns a pointer to the built tce tree, or NULL if it can't
- * find property.
-*/
-static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
-{
- unsigned int *dma_window;
- struct iommu_table *newTceTable;
- unsigned long offset;
- int dma_window_property_size;
-
- dma_window = (unsigned int *) get_property(dev->dev.platform_data, "ibm,my-dma-window", &dma_window_property_size);
- if(!dma_window) {
- return NULL;
- }
-
- newTceTable = (struct iommu_table *) kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
-
- /* There should be some code to extract the phys-encoded offset
- using prom_n_addr_cells(). However, according to a comment
- on earlier versions, it's always zero, so we don't bother */
- offset = dma_window[1] >> PAGE_SHIFT;
-
- /* TCE table size - measured in tce entries */
- newTceTable->it_size = dma_window[4] >> PAGE_SHIFT;
- /* offset for VIO should always be 0 */
- newTceTable->it_offset = offset;
- newTceTable->it_busno = 0;
- newTceTable->it_index = (unsigned long)dma_window[0];
- newTceTable->it_type = TCE_VB;
-
- return iommu_init_table(newTceTable);
-}
-
-static struct vio_bus_ops vio_bus_ops_pseries = {
- .build_iommu_table = vio_build_iommu_table,
-};
-
-/**
- * vio_bus_init_pseries: - Initialize the pSeries virtual IO bus
- */
-static int __init vio_bus_init_pseries(void)
-{
- return vio_bus_init(&vio_bus_ops_pseries);
-}
-
-__initcall(vio_bus_init_pseries);
-
-/* vio_find_name() - internal because only vio.c knows how we formatted the
- * kobject name
- * XXX once vio_bus_type.devices is actually used as a kset in
- * drivers/base/bus.c, this function should be removed in favor of
- * "device_find(kobj_name, &vio_bus_type)"
- */
-static struct vio_dev *vio_find_name(const char *kobj_name)
-{
- struct kobject *found;
-
- found = kset_find_obj(&devices_subsys.kset, kobj_name);
- if (!found)
- return NULL;
-
- return to_vio_dev(container_of(found, struct device, kobj));
-}
-
-/**
- * vio_find_node - find an already-registered vio_dev
- * @vnode: device_node of the virtual device we're looking for
- */
-struct vio_dev *vio_find_node(struct device_node *vnode)
-{
- uint32_t *unit_address;
- char kobj_name[BUS_ID_SIZE];
-
- /* construct the kobject name from the device node */
- unit_address = (uint32_t *)get_property(vnode, "reg", NULL);
- if (!unit_address)
- return NULL;
- snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address);
-
- return vio_find_name(kobj_name);
-}
-EXPORT_SYMBOL(vio_find_node);
-
-int vio_enable_interrupts(struct vio_dev *dev)
-{
- int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
- if (rc != H_SUCCESS)
- printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
- return rc;
-}
-EXPORT_SYMBOL(vio_enable_interrupts);
-
-int vio_disable_interrupts(struct vio_dev *dev)
-{
- int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
- if (rc != H_SUCCESS)
- printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
- return rc;
-}
-EXPORT_SYMBOL(vio_disable_interrupts);
diff --git a/include/asm-powerpc/iseries/iommu.h b/include/asm-powerpc/iseries/iommu.h
new file mode 100644
index 0000000..0edbfe1
--- /dev/null
+++ b/include/asm-powerpc/iseries/iommu.h
@@ -0,0 +1,35 @@
+#ifndef _ASM_POWERPC_ISERIES_IOMMU_H
+#define _ASM_POWERPC_ISERIES_IOMMU_H
+
+/*
+ * Copyright (C) 2005 Stephen Rothwell, IBM Corporation
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the:
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ */
+
+struct device_node;
+struct iommu_table;
+
+/* Creates table for an individual device node */
+extern void iommu_devnode_init_iSeries(struct device_node *dn);
+
+/* Get table parameters from HV */
+extern void iommu_table_getparms_iSeries(unsigned long busno,
+ unsigned char slotno, unsigned char virtbus,
+ struct iommu_table *tbl);
+
+#endif /* _ASM_POWERPC_ISERIES_IOMMU_H */
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h
index 9c09a8f..10da7f3 100644
--- a/include/asm-powerpc/vio.h
+++ b/include/asm-powerpc/vio.h
@@ -64,22 +64,14 @@ struct vio_driver {
struct device_driver driver;
};
-struct vio_bus_ops {
- struct iommu_table *(*build_iommu_table)(struct vio_dev *dev);
-};
-
extern struct dma_mapping_ops vio_dma_ops;
extern struct bus_type vio_bus_type;
-extern struct vio_dev vio_bus_device;
extern int vio_register_driver(struct vio_driver *drv);
extern void vio_unregister_driver(struct vio_driver *drv);
-extern struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev);
extern void __devinit vio_unregister_device(struct vio_dev *dev);
-extern int vio_bus_init(struct vio_bus_ops *);
-
struct device_node;
extern struct vio_dev * __devinit vio_register_device_node(
--
1.3.1
^ permalink raw reply related
* Re: Linux 2.6 sources for MPC852T processor
From: David Jander @ 2006-04-27 10:41 UTC (permalink / raw)
To: Dan Malek; +Cc: chandrasekhar_n, linuxppc-embedded
In-Reply-To: <0606BE3C-7751-4E71-B724-FEFE2FF252C8@embeddededge.com>
On Thursday 27 April 2006 01:32, Dan Malek wrote:
> There is a horrible bug in the 8xx TLB miss handler that is in the
> 2.6.16
> sources. I don't know when it appeared. Enable the CPU6 Errata
> workaround to see if that solves the problem and please report back
> to me. I'm working on a solution.
I received instructions from Marcelo to reverse two patches he sent me this
morning, that did solve the problem. In fact those patches changed some
TLB-related assembly code in head_8xx.S
Greetings,
--
David Jander
^ 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