* [PATCH] Performance Monitor/Oprofile support for e500
From: Andy Fleming @ 2004-11-29 22:16 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 88 bytes --]
This patch adds support for using the performance monitors on e500, and
for oprofile.
[-- Attachment #2: op_kernel_patch_11292004 --]
[-- Type: application/octet-stream, Size: 23932 bytes --]
diff -Nru a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
--- a/arch/ppc/kernel/Makefile 2004-11-29 15:04:37 -06:00
+++ b/arch/ppc/kernel/Makefile 2004-11-29 15:04:37 -06:00
@@ -14,7 +14,7 @@
obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
process.o signal.o ptrace.o align.o \
semaphore.o syscalls.o setup.o \
- cputable.o ppc_htab.o
+ cputable.o ppc_htab.o perfmon.o
obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
obj-$(CONFIG_POWER4) += cpu_setup_power4.o
obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o
@@ -24,6 +24,7 @@
obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
obj-$(CONFIG_TAU) += temp.o
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
+obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o
ifndef CONFIG_MATH_EMULATION
obj-$(CONFIG_8xx) += softemu8xx.o
diff -Nru a/arch/ppc/kernel/head_e500.S b/arch/ppc/kernel/head_e500.S
--- a/arch/ppc/kernel/head_e500.S 2004-11-29 15:04:37 -06:00
+++ b/arch/ppc/kernel/head_e500.S 2004-11-29 15:04:37 -06:00
@@ -666,7 +666,8 @@
EXCEPTION(0x2050, SPEFloatingPointRound, UnknownException, EXC_XFER_EE)
/* Performance Monitor */
- EXCEPTION(0x2060, PerformanceMonitor, UnknownException, EXC_XFER_EE)
+ EXCEPTION(0x2060, PerformanceMonitor, PerformanceMonitorException, EXC_XFER_STD)
+
/* Debug Interrupt */
DEBUG_EXCEPTION
diff -Nru a/arch/ppc/kernel/perfmon.c b/arch/ppc/kernel/perfmon.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/kernel/perfmon.c 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,94 @@
+/* kernel/perfmon.c
+ * PPC 32 Performance Monitor Infrastructure
+ *
+ * Author: Andy Fleming
+ * Copyright (c) 2004 Freescale Semiconductor, Inc
+ *
+ * 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/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
+#include <linux/ptrace.h>
+#include <linux/slab.h>
+#include <linux/user.h>
+#include <linux/a.out.h>
+#include <linux/interrupt.h>
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/prctl.h>
+
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/reg.h>
+#include <asm/xmon.h>
+
+/* A lock to regulate grabbing the interrupt */
+spinlock_t perfmon_lock = SPIN_LOCK_UNLOCKED;
+
+#ifdef CONFIG_FSL_BOOKE
+static void dummy_perf(struct pt_regs *regs)
+{
+ unsigned int pmgc0 = mfpmr(PMRN_PMGC0);
+
+ pmgc0 &= ~PMGC0_PMIE;
+ mtpmr(PMRN_PMGC0, pmgc0);
+}
+
+#else
+/* Ensure exceptions are disabled */
+#define MMCR0_PMXE (1UL << (31 - 5))
+
+static void dummy_perf(struct pt_regs *regs)
+{
+ unsigned int mmcr0 = mfspr(SPRN_MMCR0);
+
+ mmcr0 &= ~MMCR0_PMXE;
+ mtspr(SPRN_MMCR0, mmcr0);
+}
+#endif
+
+void (*perf_irq)(struct pt_regs *) = dummy_perf;
+
+/* Grab the interrupt, if it's free.
+ * Returns 0 on success, -1 if the interrupt is taken already */
+int request_perfmon_irq(void (*handler)(struct pt_regs *))
+{
+ int err = 0;
+
+ spin_lock(&perfmon_lock);
+
+ if (perf_irq == dummy_perf)
+ perf_irq = handler;
+ else {
+ pr_info("perfmon irq already handled by %p\n", perf_irq);
+ err = -1;
+ }
+
+ spin_unlock(&perfmon_lock);
+
+ return err;
+}
+
+void free_perfmon_irq(void)
+{
+ spin_lock(&perfmon_lock);
+
+ perf_irq = dummy_perf;
+
+ spin_unlock(&perfmon_lock);
+}
+
+EXPORT_SYMBOL(perf_irq);
+EXPORT_SYMBOL(request_perfmon_irq);
+EXPORT_SYMBOL(free_perfmon_irq);
diff -Nru a/arch/ppc/kernel/perfmon_fsl_booke.c b/arch/ppc/kernel/perfmon_fsl_booke.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/kernel/perfmon_fsl_booke.c 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,230 @@
+/* kernel/perfmon_fsl_booke.c
+ * Freescale Book-E Performance Monitor code
+ *
+ * Author: Andy Fleming
+ * Copyright (c) 2004 Freescale Semiconductor, Inc
+ *
+ * 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/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
+#include <linux/ptrace.h>
+#include <linux/slab.h>
+#include <linux/user.h>
+#include <linux/a.out.h>
+#include <linux/interrupt.h>
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/prctl.h>
+
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/reg.h>
+#include <asm/xmon.h>
+
+void init_pmc_stop(int ctr);
+void set_pmc_event(int ctr, int event);
+void set_pmc_user_kernel(int ctr, int user, int kernel);
+void set_pmc_marked(int ctr, int mark0, int mark1);
+void pmc_start_ctr(int ctr, int enable);
+void pmc_start_ctrs(int enable);
+void pmc_stop_ctrs(void);
+void dump_pmcs(void);
+
+static inline u32 get_pmlca(int ctr);
+static inline void set_pmlca(int ctr, u32 pmlca);
+
+static inline u32 get_pmlca(int ctr)
+{
+ u32 pmlca;
+
+ switch (ctr) {
+ case 0:
+ pmlca = mfpmr(PMRN_PMLCA0);
+ break;
+ case 1:
+ pmlca = mfpmr(PMRN_PMLCA1);
+ break;
+ case 2:
+ pmlca = mfpmr(PMRN_PMLCA2);
+ break;
+ case 3:
+ pmlca = mfpmr(PMRN_PMLCA3);
+ break;
+ default:
+ panic("Bad ctr number\n");
+ }
+
+ return pmlca;
+}
+
+static inline void set_pmlca(int ctr, u32 pmlca)
+{
+ switch (ctr) {
+ case 0:
+ mtpmr(PMRN_PMLCA0, pmlca);
+ break;
+ case 1:
+ mtpmr(PMRN_PMLCA1, pmlca);
+ break;
+ case 2:
+ mtpmr(PMRN_PMLCA2, pmlca);
+ break;
+ case 3:
+ mtpmr(PMRN_PMLCA3, pmlca);
+ break;
+ default:
+ panic("Bad ctr number\n");
+ }
+}
+
+void init_pmc_stop(int ctr)
+{
+ u32 pmlca = (PMLCA_FC | PMLCA_FCS | PMLCA_FCU |
+ PMLCA_FCM1 | PMLCA_FCM0);
+ u32 pmlcb = 0;
+
+ switch (ctr) {
+ case 0:
+ mtpmr(PMRN_PMLCA0, pmlca);
+ mtpmr(PMRN_PMLCB0, pmlcb);
+ break;
+ case 1:
+ mtpmr(PMRN_PMLCA1, pmlca);
+ mtpmr(PMRN_PMLCB1, pmlcb);
+ break;
+ case 2:
+ mtpmr(PMRN_PMLCA2, pmlca);
+ mtpmr(PMRN_PMLCB2, pmlcb);
+ break;
+ case 3:
+ mtpmr(PMRN_PMLCA3, pmlca);
+ mtpmr(PMRN_PMLCB3, pmlcb);
+ break;
+ default:
+ panic("Bad ctr number!\n");
+ }
+}
+
+void set_pmc_event(int ctr, int event)
+{
+ u32 pmlca;
+
+ pmlca = get_pmlca(ctr);
+
+ pmlca = (pmlca & ~PMLCA_EVENT_MASK) |
+ ((event << PMLCA_EVENT_SHIFT) &
+ PMLCA_EVENT_MASK);
+
+ set_pmlca(ctr, pmlca);
+}
+
+void set_pmc_user_kernel(int ctr, int user, int kernel)
+{
+ u32 pmlca;
+
+ pmlca = get_pmlca(ctr);
+
+ if(user)
+ pmlca &= ~PMLCA_FCU;
+ else
+ pmlca |= PMLCA_FCU;
+
+ if(kernel)
+ pmlca &= ~PMLCA_FCS;
+ else
+ pmlca |= PMLCA_FCS;
+
+ set_pmlca(ctr, pmlca);
+}
+
+void set_pmc_marked(int ctr, int mark0, int mark1)
+{
+ u32 pmlca = get_pmlca(ctr);
+
+ if(mark0)
+ pmlca &= ~PMLCA_FCM0;
+ else
+ pmlca |= PMLCA_FCM0;
+
+ if(mark1)
+ pmlca &= ~PMLCA_FCM1;
+ else
+ pmlca |= PMLCA_FCM1;
+
+ set_pmlca(ctr, pmlca);
+}
+
+void pmc_start_ctr(int ctr, int enable)
+{
+ u32 pmlca = get_pmlca(ctr);
+
+ pmlca &= ~PMLCA_FC;
+
+ if (enable)
+ pmlca |= PMLCA_CE;
+ else
+ pmlca &= ~PMLCA_CE;
+
+ set_pmlca(ctr, pmlca);
+}
+
+void pmc_start_ctrs(int enable)
+{
+ u32 pmgc0 = mfpmr(PMRN_PMGC0);
+
+ pmgc0 &= ~PMGC0_FAC;
+ pmgc0 |= PMGC0_FCECE;
+
+ if (enable)
+ pmgc0 |= PMGC0_PMIE;
+ else
+ pmgc0 &= ~PMGC0_PMIE;
+
+ mtpmr(PMRN_PMGC0, pmgc0);
+}
+
+void pmc_stop_ctrs(void)
+{
+ u32 pmgc0 = mfpmr(PMRN_PMGC0);
+
+ pmgc0 |= PMGC0_FAC;
+
+ pmgc0 &= ~(PMGC0_PMIE | PMGC0_FCECE);
+
+ mtpmr(PMRN_PMGC0, pmgc0);
+}
+
+void dump_pmcs(void)
+{
+ printk("pmgc0: %x\n", mfpmr(PMRN_PMGC0));
+ printk("pmc\t\tpmlca\t\tpmlcb\n");
+ printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC0),
+ mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
+ printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC1),
+ mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
+ printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC2),
+ mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
+ printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC3),
+ mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
+}
+
+EXPORT_SYMBOL(init_pmc_stop);
+EXPORT_SYMBOL(set_pmc_event);
+EXPORT_SYMBOL(set_pmc_user_kernel);
+EXPORT_SYMBOL(set_pmc_marked);
+EXPORT_SYMBOL(pmc_start_ctr);
+EXPORT_SYMBOL(pmc_start_ctrs);
+EXPORT_SYMBOL(pmc_stop_ctrs);
+EXPORT_SYMBOL(dump_pmcs);
diff -Nru a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
--- a/arch/ppc/kernel/traps.c 2004-11-29 15:04:37 -06:00
+++ b/arch/ppc/kernel/traps.c 2004-11-29 15:04:37 -06:00
@@ -71,6 +71,7 @@
* Trap & Exception support
*/
+extern void (*perf_irq)(struct pt_regs *);
spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
@@ -725,6 +726,11 @@
}
}
#endif /* CONFIG_ALTIVEC */
+
+void PerformanceMonitorException(struct pt_regs *regs)
+{
+ perf_irq(regs);
+}
#ifdef CONFIG_FSL_BOOKE
void CacheLockingException(struct pt_regs *regs, unsigned long address,
diff -Nru a/arch/ppc/oprofile/Makefile b/arch/ppc/oprofile/Makefile
--- a/arch/ppc/oprofile/Makefile 2004-11-29 15:04:37 -06:00
+++ b/arch/ppc/oprofile/Makefile 2004-11-29 15:04:37 -06:00
@@ -6,4 +6,4 @@
oprofilefs.o oprofile_stats.o \
timer_int.o )
-oprofile-y := $(DRIVER_OBJS) init.o
+oprofile-y := $(DRIVER_OBJS) common.o op_model_fsl_booke.o
diff -Nru a/arch/ppc/oprofile/common.c b/arch/ppc/oprofile/common.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/oprofile/common.c 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,163 @@
+/*
+ * PPC 32 oprofile support
+ * Based on PPC64 oprofile support
+ * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
+ *
+ * Copyright (C) Freescale Semiconductor, Inc 2004
+ *
+ * Author: Andy Fleming
+ *
+ * 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/oprofile.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/errno.h>
+#include <asm/ptrace.h>
+#include <asm/system.h>
+#include <asm/perfmon.h>
+#include <asm/cputable.h>
+
+#include "op_impl.h"
+
+extern struct op_ppc32_model op_model_fsl_booke;
+static struct op_ppc32_model *model;
+
+static struct op_counter_config ctr[OP_MAX_COUNTER];
+static struct op_system_config sys;
+
+static void op_handle_interrupt(struct pt_regs *regs)
+{
+ model->handle_interrupt(regs, ctr);
+}
+
+static int op_ppc32_setup(void)
+{
+ /* Install our interrupt handler into the existing hook. */
+ if(request_perfmon_irq(&op_handle_interrupt))
+ return -EBUSY;
+
+ mb();
+
+ /* Pre-compute the values to stuff in the hardware registers. */
+ model->reg_setup(ctr, &sys, model->num_counters);
+
+#if 0
+ /* FIXME: Make multi-cpu work */
+ /* Configure the registers on all cpus. */
+ on_each_cpu(model->reg_setup, NULL, 0, 1);
+#endif
+
+ return 0;
+}
+
+static void op_ppc32_shutdown(void)
+{
+ mb();
+
+ /* Remove our interrupt handler. We may be removing this module. */
+ free_perfmon_irq();
+}
+
+static void op_ppc32_cpu_start(void *dummy)
+{
+ model->start(ctr);
+}
+
+static int op_ppc32_start(void)
+{
+ on_each_cpu(op_ppc32_cpu_start, NULL, 0, 1);
+ return 0;
+}
+
+static inline void op_ppc32_cpu_stop(void *dummy)
+{
+ model->stop();
+}
+
+static void op_ppc32_stop(void)
+{
+ on_each_cpu(op_ppc32_cpu_stop, NULL, 0, 1);
+}
+
+static int op_ppc32_create_files(struct super_block *sb, struct dentry *root)
+{
+ int i;
+
+ for (i = 0; i < model->num_counters; ++i) {
+ struct dentry *dir;
+ char buf[3];
+
+ snprintf(buf, sizeof buf, "%d", i);
+ dir = oprofilefs_mkdir(sb, root, buf);
+
+ oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
+ oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
+ oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
+ oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
+ oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
+
+ /* FIXME: Not sure if this is used */
+ oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
+ }
+
+ oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel);
+ oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user);
+
+ /* Default to tracing both kernel and user */
+ sys.enable_kernel = 1;
+ sys.enable_user = 1;
+
+ return 0;
+}
+
+static struct oprofile_operations oprof_ppc32_ops = {
+ .create_files = op_ppc32_create_files,
+ .setup = op_ppc32_setup,
+ .shutdown = op_ppc32_shutdown,
+ .start = op_ppc32_start,
+ .stop = op_ppc32_stop,
+ .cpu_type = NULL /* To be filled in below. */
+};
+
+int __init oprofile_arch_init(struct oprofile_operations **ops)
+{
+ char *name;
+ int cpu_id = smp_processor_id();
+
+#ifdef CONFIG_FSL_BOOKE
+ model = &op_model_fsl_booke;
+#else
+ printk(KERN_ERR "oprofile enabled on unsupported processor!\n");
+ return -ENODEV;
+#endif
+
+ name = kmalloc(32, GFP_KERNEL);
+
+ if (NULL == name)
+ return -ENOMEM;
+
+ sprintf(name, "ppc/%s", cur_cpu_spec[cpu_id]->cpu_name);
+
+ oprof_ppc32_ops.cpu_type = name;
+
+ model->num_counters = cur_cpu_spec[cpu_id]->num_pmcs;
+
+ *ops = &oprof_ppc32_ops;
+
+ printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
+ oprof_ppc32_ops.cpu_type);
+
+ return 0;
+}
+
+void oprofile_arch_exit(void)
+{
+ kfree(oprof_ppc32_ops.cpu_type);
+ oprof_ppc32_ops.cpu_type = NULL;
+}
diff -Nru a/arch/ppc/oprofile/init.c b/arch/ppc/oprofile/init.c
--- a/arch/ppc/oprofile/init.c 2004-11-29 15:04:37 -06:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,23 +0,0 @@
-/**
- * @file init.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- */
-
-#include <linux/kernel.h>
-#include <linux/oprofile.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-
-int __init oprofile_arch_init(struct oprofile_operations ** ops)
-{
- return -ENODEV;
-}
-
-
-void oprofile_arch_exit(void)
-{
-}
diff -Nru a/arch/ppc/oprofile/op_impl.h b/arch/ppc/oprofile/op_impl.h
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/oprofile/op_impl.h 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
+ *
+ * Based on alpha version.
+ *
+ * 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.
+ */
+
+#ifndef OP_IMPL_H
+#define OP_IMPL_H 1
+
+#define OP_MAX_COUNTER 8
+
+/* Per-counter configuration as set via oprofilefs. */
+struct op_counter_config {
+ unsigned long enabled;
+ unsigned long event;
+ unsigned long count;
+ unsigned long kernel;
+ unsigned long user;
+ unsigned long unit_mask;
+};
+
+/* System-wide configuration as set via oprofilefs. */
+struct op_system_config {
+ unsigned long enable_kernel;
+ unsigned long enable_user;
+};
+
+/* Per-arch configuration */
+struct op_ppc32_model {
+ void (*reg_setup) (struct op_counter_config *,
+ struct op_system_config *,
+ int num_counters);
+ void (*start) (struct op_counter_config *);
+ void (*stop) (void);
+ void (*handle_interrupt) (struct pt_regs *,
+ struct op_counter_config *);
+ int num_counters;
+};
+
+#endif /* OP_IMPL_H */
diff -Nru a/arch/ppc/oprofile/op_model_fsl_booke.c b/arch/ppc/oprofile/op_model_fsl_booke.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/oprofile/op_model_fsl_booke.c 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,185 @@
+/*
+ * oprofile/op_model_e500.c
+ *
+ * Freescale Book-E oprofile support, based on ppc64 oprofile support
+ * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
+ *
+ * Copyright (c) 2004 Freescale Semiconductor, Inc
+ *
+ * Author: Andy Fleming
+ * Maintainer: Kumar Gala <Kumar.Gala@freescale.com>
+ *
+ * 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/oprofile.h>
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <asm/ptrace.h>
+#include <asm/system.h>
+#include <asm/processor.h>
+#include <asm/cputable.h>
+#include <asm/reg_booke.h>
+#include <asm/page.h>
+#include <asm/perfmon.h>
+
+#include "op_impl.h"
+
+static unsigned long reset_value[OP_MAX_COUNTER];
+
+static int num_counters;
+static int oprofile_running;
+
+static inline unsigned int ctr_read(unsigned int i)
+{
+ switch(i) {
+ case 0:
+ return mfpmr(PMRN_PMC0);
+ case 1:
+ return mfpmr(PMRN_PMC1);
+ case 2:
+ return mfpmr(PMRN_PMC2);
+ case 3:
+ return mfpmr(PMRN_PMC3);
+ default:
+ return 0;
+ }
+}
+
+static inline void ctr_write(unsigned int i, unsigned int val)
+{
+ switch(i) {
+ case 0:
+ mtpmr(PMRN_PMC0, val);
+ break;
+ case 1:
+ mtpmr(PMRN_PMC1, val);
+ break;
+ case 2:
+ mtpmr(PMRN_PMC2, val);
+ break;
+ case 3:
+ mtpmr(PMRN_PMC3, val);
+ break;
+ default:
+ break;
+ }
+}
+
+
+static void fsl_booke_reg_setup(struct op_counter_config *ctr,
+ struct op_system_config *sys,
+ int num_ctrs)
+{
+ int i;
+
+ num_counters = num_ctrs;
+
+ /* freeze all counters */
+ pmc_stop_ctrs();
+
+ /* Our counters count up, and "count" refers to
+ * how much before the next interrupt, and we interrupt
+ * on overflow. So we calculate the starting value
+ * which will give us "count" until overflow.
+ * Then we set the events on the enabled counters */
+ for (i = 0; i < num_counters; ++i) {
+ reset_value[i] = 0x80000000UL - ctr[i].count;
+
+ init_pmc_stop(i);
+
+ set_pmc_event(i, ctr[i].event);
+
+ set_pmc_user_kernel(i, ctr[i].user, ctr[i].kernel);
+ }
+}
+
+static void fsl_booke_start(struct op_counter_config *ctr)
+{
+ int i;
+
+ mtmsr(mfmsr() | MSR_PMM);
+
+ for (i = 0; i < num_counters; ++i) {
+ if (ctr[i].enabled) {
+ ctr_write(i, reset_value[i]);
+ /* Set Each enabled counterd to only
+ * count when the Mark bit is not set */
+ set_pmc_marked(i, 1, 0);
+ pmc_start_ctr(i, 1);
+ } else {
+ ctr_write(i, 0);
+
+ /* Set the ctr to be stopped */
+ pmc_start_ctr(i, 0);
+ }
+ }
+
+ /* Clear the freeze bit, and enable the interrupt.
+ * The counters won't actually start until the rfi clears
+ * the PMM bit */
+ pmc_start_ctrs(1);
+
+ oprofile_running = 1;
+
+ pr_debug("start on cpu %d, pmgc0 %x\n", smp_processor_id(),
+ mfpmr(PMRN_PMGC0));
+}
+
+static void fsl_booke_stop(void)
+{
+ /* freeze counters */
+ pmc_stop_ctrs();
+
+ oprofile_running = 0;
+
+ pr_debug("stop on cpu %d, pmgc0 %x\n", smp_processor_id(),
+ mfpmr(PMRN_PMGC0));
+
+ mb();
+}
+
+
+static void fsl_booke_handle_interrupt(struct pt_regs *regs,
+ struct op_counter_config *ctr)
+{
+ unsigned long pc;
+ int is_kernel;
+ int val;
+ int i;
+ unsigned int cpu = smp_processor_id();
+
+ /* set the PMM bit (see comment below) */
+ mtmsr(mfmsr() | MSR_PMM);
+
+ pc = regs->nip;
+ is_kernel = (pc >= KERNELBASE);
+
+ for (i = 0; i < num_counters; ++i) {
+ val = ctr_read(i);
+ if (val < 0) {
+ if (oprofile_running && ctr[i].enabled) {
+ oprofile_add_sample(pc, is_kernel, i, cpu);
+ ctr_write(i, reset_value[i]);
+ } else {
+ ctr_write(i, 0);
+ }
+ }
+ }
+
+ /* The freeze bit was set by the interrupt. */
+ /* Clear the freeze bit, and reenable the interrupt.
+ * The counters won't actually start until the rfi clears
+ * the PMM bit */
+ pmc_start_ctrs(1);
+}
+
+struct op_ppc32_model op_model_fsl_booke = {
+ .reg_setup = fsl_booke_reg_setup,
+ .start = fsl_booke_start,
+ .stop = fsl_booke_stop,
+ .handle_interrupt = fsl_booke_handle_interrupt,
+};
diff -Nru a/include/asm-ppc/cputable.h b/include/asm-ppc/cputable.h
--- a/include/asm-ppc/cputable.h 2004-11-29 15:04:37 -06:00
+++ b/include/asm-ppc/cputable.h 2004-11-29 15:04:37 -06:00
@@ -71,7 +71,6 @@
#define CPU_FTR_TAU 0x00000010
#define CPU_FTR_CAN_DOZE 0x00000020
#define CPU_FTR_USE_TB 0x00000040
-#define CPU_FTR_604_PERF_MON 0x00000080
#define CPU_FTR_601 0x00000100
#define CPU_FTR_HPTE_TABLE 0x00000200
#define CPU_FTR_CAN_NAP 0x00000400
diff -Nru a/include/asm-ppc/perfmon.h b/include/asm-ppc/perfmon.h
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/include/asm-ppc/perfmon.h 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,18 @@
+#ifndef __PERFMON_H
+#define __PERFMON_H
+
+int request_perfmon_irq(void (*handler)(struct pt_regs *));
+void free_perfmon_irq(void);
+
+#ifdef CONFIG_FSL_BOOKE
+void init_pmc_stop(int ctr);
+void set_pmc_event(int ctr, int event);
+void set_pmc_user_kernel(int ctr, int user, int kernel);
+void set_pmc_marked(int ctr, int mark0, int mark1);
+void pmc_start_ctr(int ctr, int enable);
+void pmc_start_ctrs(int enable);
+void pmc_stop_ctrs(void);
+void dump_pmcs(void);
+#endif
+
+#endif /* __PERFMON_H */
diff -Nru a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
--- a/include/asm-ppc/reg_booke.h 2004-11-29 15:04:37 -06:00
+++ b/include/asm-ppc/reg_booke.h 2004-11-29 15:04:37 -06:00
@@ -51,6 +51,59 @@
#define mtpmr(rn, v) asm volatile("mtpmr " __stringify(rn) ",%0" : : "r" (v))
#endif /* __ASSEMBLY__ */
+/* Freescale Book E Performance Monitor APU Registers */
+#define PMRN_PMC0 0x010 /* Performance Monitor Counter 0 */
+#define PMRN_PMC1 0x011 /* Performance Monitor Counter 1 */
+#define PMRN_PMC2 0x012 /* Performance Monitor Counter 1 */
+#define PMRN_PMC3 0x013 /* Performance Monitor Counter 1 */
+#define PMRN_PMLCA0 0x090 /* PM Local Control A0 */
+#define PMRN_PMLCA1 0x091 /* PM Local Control A1 */
+#define PMRN_PMLCA2 0x092 /* PM Local Control A2 */
+#define PMRN_PMLCA3 0x093 /* PM Local Control A3 */
+
+#define PMLCA_FC 0x80000000 /* Freeze Counter */
+#define PMLCA_FCS 0x40000000 /* Freeze in Supervisor */
+#define PMLCA_FCU 0x20000000 /* Freeze in User */
+#define PMLCA_FCM1 0x10000000 /* Freeze when PMM==1 */
+#define PMLCA_FCM0 0x08000000 /* Freeze when PMM==0 */
+#define PMLCA_CE 0x04000000 /* Condition Enable */
+
+#define PMLCA_EVENT_MASK 0x007f0000 /* Event field */
+#define PMLCA_EVENT_SHIFT 16
+
+#define PMRN_PMLCB0 0x110 /* PM Local Control B0 */
+#define PMRN_PMLCB1 0x111 /* PM Local Control B1 */
+#define PMRN_PMLCB2 0x112 /* PM Local Control B2 */
+#define PMRN_PMLCB3 0x113 /* PM Local Control B3 */
+
+#define PMLCB_THRESHMUL_MASK 0x0700 /* Threshhold Multiple Field */
+#define PMLCB_THRESHMUL_SHIFT 8
+
+#define PMLCB_THRESHOLD_MASK 0x003f /* Threshold Field */
+#define PMLCB_THRESHOLD_SHIFT 0
+
+#define PMRN_PMGC0 0x190 /* PM Global Control 0 */
+
+#define PMGC0_FAC 0x80000000 /* Freeze all Counters */
+#define PMGC0_PMIE 0x40000000 /* Interrupt Enable */
+#define PMGC0_FCECE 0x20000000 /* Freeze countes on
+ Enabled Condition or
+ Event */
+
+#define PMRN_UPMC0 0x000 /* User Performance Monitor Counter 0 */
+#define PMRN_UPMC1 0x001 /* User Performance Monitor Counter 1 */
+#define PMRN_UPMC2 0x002 /* User Performance Monitor Counter 1 */
+#define PMRN_UPMC3 0x003 /* User Performance Monitor Counter 1 */
+#define PMRN_UPMLCA0 0x080 /* User PM Local Control A0 */
+#define PMRN_UPMLCA1 0x081 /* User PM Local Control A1 */
+#define PMRN_UPMLCA2 0x082 /* User PM Local Control A2 */
+#define PMRN_UPMLCA3 0x083 /* User PM Local Control A3 */
+#define PMRN_UPMLCB0 0x100 /* User PM Local Control B0 */
+#define PMRN_UPMLCB1 0x101 /* User PM Local Control B1 */
+#define PMRN_UPMLCB2 0x102 /* User PM Local Control B2 */
+#define PMRN_UPMLCB3 0x103 /* User PM Local Control B3 */
+#define PMRN_UPMGC0 0x180 /* User PM Global Control 0 */
+
/* Machine State Register (MSR) Fields */
#define MSR_UCLE (1<<26) /* User-mode cache lock enable */
^ permalink raw reply
* [PATCH] Remove 604 perfmon from ppc_htab
From: Andy Fleming @ 2004-11-29 22:21 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 197 bytes --]
This patch removes the 604 performance monitor counters from ppc_htab.
The reason is that people have said that no one uses them, and ppc_htab
is not the right place for them. Any objections?
[-- Attachment #2: htab_patch --]
[-- Type: application/octet-stream, Size: 5377 bytes --]
--- linux-2.5-gfar/arch/ppc/kernel/ppc_htab.c 2004-10-28 10:54:04.000000000 -0500
+++ linux-2.5-oprofile/arch/ppc/kernel/ppc_htab.c 2004-10-29 10:50:20.000000000 -0500
@@ -59,42 +59,6 @@
.release = single_release,
};
-static char *pmc1_lookup(unsigned long mmcr0)
-{
- switch ( mmcr0 & (0x7f<<7) )
- {
- case 0x0:
- return "none";
- case MMCR0_PMC1_CYCLES:
- return "cycles";
- case MMCR0_PMC1_ICACHEMISS:
- return "ic miss";
- case MMCR0_PMC1_DTLB:
- return "dtlb miss";
- default:
- return "unknown";
- }
-}
-
-static char *pmc2_lookup(unsigned long mmcr0)
-{
- switch ( mmcr0 & 0x3f )
- {
- case 0x0:
- return "none";
- case MMCR0_PMC2_CYCLES:
- return "cycles";
- case MMCR0_PMC2_DCACHEMISS:
- return "dc miss";
- case MMCR0_PMC2_ITLB:
- return "itlb miss";
- case MMCR0_PMC2_LOADMISSTIME:
- return "load miss time";
- default:
- return "unknown";
- }
-}
-
/*
* print some useful info about the hash table. This function
* is _REALLY_ slow (see the nested for loops below) but nothing
@@ -102,29 +66,11 @@
*/
static int ppc_htab_show(struct seq_file *m, void *v)
{
- unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
#if defined(CONFIG_PPC_STD_MMU) && !defined(CONFIG_PPC64BRIDGE)
unsigned int kptes = 0, uptes = 0;
PTE *ptr;
#endif /* CONFIG_PPC_STD_MMU */
- if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
- mmcr0 = mfspr(SPRN_MMCR0);
- pmc1 = mfspr(SPRN_PMC1);
- pmc2 = mfspr(SPRN_PMC2);
- seq_printf(m,
- "604 Performance Monitoring\n"
- "MMCR0\t\t: %08lx %s%s ",
- mmcr0,
- ( mmcr0>>28 & 0x2 ) ? "(user mode counted)" : "",
- ( mmcr0>>28 & 0x4 ) ? "(kernel mode counted)" : "");
- seq_printf(m,
- "\nPMC1\t\t: %08lx (%s)\n"
- "PMC2\t\t: %08lx (%s)\n",
- pmc1, pmc1_lookup(mmcr0),
- pmc2, pmc2_lookup(mmcr0));
- }
-
#ifdef CONFIG_PPC_STD_MMU
/* if we don't have a htab */
if ( Hash_size == 0 ) {
@@ -188,7 +134,7 @@
}
/*
- * Allow user to define performance counters and resize the hash table
+ * Allow user to resize the hash table
*/
static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
size_t count, loff_t *ppos)
@@ -209,108 +155,12 @@
if ( !strncmp( buffer, "reset", 5) )
{
- if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
- /* reset PMC1 and PMC2 */
- mtspr(SPRN_PMC1, 0);
- mtspr(SPRN_PMC2, 0);
- }
htab_reloads = 0;
htab_evicts = 0;
pte_misses = 0;
pte_errors = 0;
}
- /* Everything below here requires the performance monitor feature. */
- if ( !cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON )
- return count;
-
- /* turn off performance monitoring */
- if ( !strncmp( buffer, "off", 3) )
- {
- mtspr(SPRN_MMCR0, 0);
- mtspr(SPRN_PMC1, 0);
- mtspr(SPRN_PMC2, 0);
- }
-
- if ( !strncmp( buffer, "user", 4) )
- {
- /* setup mmcr0 and clear the correct pmc */
- tmp = (mfspr(SPRN_MMCR0) & ~(0x60000000)) | 0x20000000;
- mtspr(SPRN_MMCR0, tmp);
- mtspr(SPRN_PMC1, 0);
- mtspr(SPRN_PMC2, 0);
- }
-
- if ( !strncmp( buffer, "kernel", 6) )
- {
- /* setup mmcr0 and clear the correct pmc */
- tmp = (mfspr(SPRN_MMCR0) & ~(0x60000000)) | 0x40000000;
- mtspr(SPRN_MMCR0, tmp);
- mtspr(SPRN_PMC1, 0);
- mtspr(SPRN_PMC2, 0);
- }
-
- /* PMC1 values */
- if ( !strncmp( buffer, "dtlb", 4) )
- {
- /* setup mmcr0 and clear the correct pmc */
- tmp = (mfspr(SPRN_MMCR0) & ~(0x7F << 7)) | MMCR0_PMC1_DTLB;
- mtspr(SPRN_MMCR0, tmp);
- mtspr(SPRN_PMC1, 0);
- }
-
- if ( !strncmp( buffer, "ic miss", 7) )
- {
- /* setup mmcr0 and clear the correct pmc */
- tmp = (mfspr(SPRN_MMCR0) & ~(0x7F<<7)) | MMCR0_PMC1_ICACHEMISS;
- mtspr(SPRN_MMCR0, tmp);
- mtspr(SPRN_PMC1, 0);
- }
-
- /* PMC2 values */
- if ( !strncmp( buffer, "load miss time", 14) )
- {
- /* setup mmcr0 and clear the correct pmc */
- asm volatile(
- "mfspr %0,%1\n\t" /* get current mccr0 */
- "rlwinm %0,%0,0,0,31-6\n\t" /* clear bits [26-31] */
- "ori %0,%0,%2 \n\t" /* or in mmcr0 settings */
- "mtspr %1,%0 \n\t" /* set new mccr0 */
- "mtspr %3,%4 \n\t" /* reset the pmc */
- : "=r" (tmp)
- : "i" (SPRN_MMCR0),
- "i" (MMCR0_PMC2_LOADMISSTIME),
- "i" (SPRN_PMC2), "r" (0) );
- }
-
- if ( !strncmp( buffer, "itlb", 4) )
- {
- /* setup mmcr0 and clear the correct pmc */
- asm volatile(
- "mfspr %0,%1\n\t" /* get current mccr0 */
- "rlwinm %0,%0,0,0,31-6\n\t" /* clear bits [26-31] */
- "ori %0,%0,%2 \n\t" /* or in mmcr0 settings */
- "mtspr %1,%0 \n\t" /* set new mccr0 */
- "mtspr %3,%4 \n\t" /* reset the pmc */
- : "=r" (tmp)
- : "i" (SPRN_MMCR0), "i" (MMCR0_PMC2_ITLB),
- "i" (SPRN_PMC2), "r" (0) );
- }
-
- if ( !strncmp( buffer, "dc miss", 7) )
- {
- /* setup mmcr0 and clear the correct pmc */
- asm volatile(
- "mfspr %0,%1\n\t" /* get current mccr0 */
- "rlwinm %0,%0,0,0,31-6\n\t" /* clear bits [26-31] */
- "ori %0,%0,%2 \n\t" /* or in mmcr0 settings */
- "mtspr %1,%0 \n\t" /* set new mccr0 */
- "mtspr %3,%4 \n\t" /* reset the pmc */
- : "=r" (tmp)
- : "i" (SPRN_MMCR0), "i" (MMCR0_PMC2_DCACHEMISS),
- "i" (SPRN_PMC2), "r" (0) );
- }
-
return count;
#else /* CONFIG_PPC_STD_MMU */
return 0;
^ permalink raw reply
* Re: TEST: Sleep patch #5
From: David Woodhouse @ 2004-11-29 23:25 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: fedora-ppc, linuxppc-dev list
In-Reply-To: <1101280145.4511.4.camel@gaston>
< Added fedora-ppc list to Cc, again. >
On Wed, 2004-11-24 at 18:09 +1100, Benjamin Herrenschmidt wrote:
> Ok, here's the 5th version of the sleep patch for ATI based albooks &
> iBook G4. Other machine users, please test too as it may cause
> regressions (or improvements) as well.
>
> Not many changes since last version, I don't know why sometimes, the
> panel doesn't come back properly (though a new sleep cycle tends to fix
> it) and I have no fix for the USB issues. However, I added some hacks to
> the cache flush code based on what Apple does in Darwin that may help
> make the thing more robust, and I added a hook mecanism that allow the
> video to be restored _very_ early on wakeup, pretty much before
> everything else, thus making it easier to spot & debug crashes on
> wakeup.
>
> There are still pending issues, like cpufreq on some machines will
> "think" it's running at full speed on wakeup while it's in fact running
> at slow speed (thankfully not the opposite), I will try to fix those in
> the next iteration.
>
> http://gate.crashing.org/~benh/albook-ibookg4-sleep-5.diff
Fedora Core 3 kernels in yum repo at
ftp://ftp.uk.linux.org/pub/people/dwmw2/fc3-kernel-ppc/kernel*688*.rpm
I had to update the stack abuse patch to cope...
Suppose I ought to do those signal and single-stepping patches for ppc
too.
--- linux/drivers/video/aty/radeon_base.c.stk 2004-11-29 15:46:08.118064048 +0000
+++ linux/drivers/video/aty/radeon_base.c 2004-11-29 15:50:19.362937880 +0000
@@ -1483,20 +1483,24 @@ static int radeonfb_set_par(struct fb_in
{
struct radeonfb_info *rinfo = info->par;
struct fb_var_screeninfo *mode = &info->var;
- struct radeon_regs newmode;
+ struct radeon_regs *newmode;
int hTotal, vTotal, hSyncStart, hSyncEnd,
hSyncPol, vSyncStart, vSyncEnd, vSyncPol, cSync;
u8 hsync_adj_tab[] = {0, 0x12, 9, 9, 6, 5};
u8 hsync_fudge_fp[] = {2, 2, 0, 0, 5, 5};
u32 sync, h_sync_pol, v_sync_pol, dotClock, pixClock;
int i, freq;
- int format = 0;
+ int format = 0;
int nopllcalc = 0;
int hsync_start, hsync_fudge, bytpp, hsync_wid, vsync_wid;
int primary_mon = PRIMARY_MONITOR(rinfo);
int depth = var_to_depth(mode);
int use_rmx = 0;
+ newmode = kmalloc(sizeof(struct radeon_regs), GFP_KERNEL);
+ if (!newmode)
+ return -ENOMEM;
+
/* We always want engine to be idle on a mode switch, even
* if we won't actually change the mode
*/
@@ -1536,9 +1540,9 @@ static int radeonfb_set_par(struct fb_in
if (rinfo->panel_info.use_bios_dividers) {
nopllcalc = 1;
- newmode.ppll_div_3 = rinfo->panel_info.fbk_divider |
+ newmode->ppll_div_3 = rinfo->panel_info.fbk_divider |
(rinfo->panel_info.post_divider << 16);
- newmode.ppll_ref_div = rinfo->panel_info.ref_divider;
+ newmode->ppll_ref_div = rinfo->panel_info.ref_divider;
}
}
dotClock = 1000000000 / pixClock;
@@ -1576,38 +1580,38 @@ static int radeonfb_set_par(struct fb_in
hsync_start = hSyncStart - 8 + hsync_fudge;
- newmode.crtc_gen_cntl = CRTC_EXT_DISP_EN | CRTC_EN |
+ newmode->crtc_gen_cntl = CRTC_EXT_DISP_EN | CRTC_EN |
(format << 8);
/* Clear auto-center etc... */
- newmode.crtc_more_cntl = rinfo->init_state.crtc_more_cntl;
- newmode.crtc_more_cntl &= 0xfffffff0;
+ newmode->crtc_more_cntl = rinfo->init_state.crtc_more_cntl;
+ newmode->crtc_more_cntl &= 0xfffffff0;
if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) {
- newmode.crtc_ext_cntl = VGA_ATI_LINEAR | XCRT_CNT_EN;
+ newmode->crtc_ext_cntl = VGA_ATI_LINEAR | XCRT_CNT_EN;
if (mirror)
- newmode.crtc_ext_cntl |= CRTC_CRT_ON;
+ newmode->crtc_ext_cntl |= CRTC_CRT_ON;
- newmode.crtc_gen_cntl &= ~(CRTC_DBL_SCAN_EN |
+ newmode->crtc_gen_cntl &= ~(CRTC_DBL_SCAN_EN |
CRTC_INTERLACE_EN);
} else {
- newmode.crtc_ext_cntl = VGA_ATI_LINEAR | XCRT_CNT_EN |
+ newmode->crtc_ext_cntl = VGA_ATI_LINEAR | XCRT_CNT_EN |
CRTC_CRT_ON;
}
- newmode.dac_cntl = /* INREG(DAC_CNTL) | */ DAC_MASK_ALL | DAC_VGA_ADR_EN |
+ newmode->dac_cntl = /* INREG(DAC_CNTL) | */ DAC_MASK_ALL | DAC_VGA_ADR_EN |
DAC_8BIT_EN;
- newmode.crtc_h_total_disp = ((((hTotal / 8) - 1) & 0x3ff) |
+ newmode->crtc_h_total_disp = ((((hTotal / 8) - 1) & 0x3ff) |
(((mode->xres / 8) - 1) << 16));
- newmode.crtc_h_sync_strt_wid = ((hsync_start & 0x1fff) |
+ newmode->crtc_h_sync_strt_wid = ((hsync_start & 0x1fff) |
(hsync_wid << 16) | (h_sync_pol << 23));
- newmode.crtc_v_total_disp = ((vTotal - 1) & 0xffff) |
+ newmode->crtc_v_total_disp = ((vTotal - 1) & 0xffff) |
((mode->yres - 1) << 16);
- newmode.crtc_v_sync_strt_wid = (((vSyncStart - 1) & 0xfff) |
+ newmode->crtc_v_sync_strt_wid = (((vSyncStart - 1) & 0xfff) |
(vsync_wid << 16) | (v_sync_pol << 23));
if (!(info->flags & FBINFO_HWACCEL_DISABLED)) {
@@ -1616,18 +1620,18 @@ static int radeonfb_set_par(struct fb_in
& ~(0x3f)) >> 6;
/* Then, re-multiply it to get the CRTC pitch */
- newmode.crtc_pitch = (rinfo->pitch << 3) / ((mode->bits_per_pixel + 1) / 8);
+ newmode->crtc_pitch = (rinfo->pitch << 3) / ((mode->bits_per_pixel + 1) / 8);
} else
- newmode.crtc_pitch = (mode->xres_virtual >> 3);
+ newmode->crtc_pitch = (mode->xres_virtual >> 3);
- newmode.crtc_pitch |= (newmode.crtc_pitch << 16);
+ newmode->crtc_pitch |= (newmode->crtc_pitch << 16);
/*
* It looks like recent chips have a problem with SURFACE_CNTL,
* setting SURF_TRANSLATION_DIS completely disables the
* swapper as well, so we leave it unset now.
*/
- newmode.surface_cntl = 0;
+ newmode->surface_cntl = 0;
#if defined(__BIG_ENDIAN)
@@ -1637,28 +1641,28 @@ static int radeonfb_set_par(struct fb_in
*/
switch (mode->bits_per_pixel) {
case 16:
- newmode.surface_cntl |= NONSURF_AP0_SWP_16BPP;
- newmode.surface_cntl |= NONSURF_AP1_SWP_16BPP;
+ newmode->surface_cntl |= NONSURF_AP0_SWP_16BPP;
+ newmode->surface_cntl |= NONSURF_AP1_SWP_16BPP;
break;
case 24:
case 32:
- newmode.surface_cntl |= NONSURF_AP0_SWP_32BPP;
- newmode.surface_cntl |= NONSURF_AP1_SWP_32BPP;
+ newmode->surface_cntl |= NONSURF_AP0_SWP_32BPP;
+ newmode->surface_cntl |= NONSURF_AP1_SWP_32BPP;
break;
}
#endif
/* Clear surface registers */
for (i=0; i<8; i++) {
- newmode.surf_lower_bound[i] = 0;
- newmode.surf_upper_bound[i] = 0x1f;
- newmode.surf_info[i] = 0;
+ newmode->surf_lower_bound[i] = 0;
+ newmode->surf_upper_bound[i] = 0x1f;
+ newmode->surf_info[i] = 0;
}
RTRACE("h_total_disp = 0x%x\t hsync_strt_wid = 0x%x\n",
- newmode.crtc_h_total_disp, newmode.crtc_h_sync_strt_wid);
+ newmode->crtc_h_total_disp, newmode->crtc_h_sync_strt_wid);
RTRACE("v_total_disp = 0x%x\t vsync_strt_wid = 0x%x\n",
- newmode.crtc_v_total_disp, newmode.crtc_v_sync_strt_wid);
+ newmode->crtc_v_total_disp, newmode->crtc_v_sync_strt_wid);
rinfo->bpp = mode->bits_per_pixel;
rinfo->depth = depth;
@@ -1667,13 +1671,13 @@ static int radeonfb_set_par(struct fb_in
RTRACE("freq = %lu\n", (unsigned long)freq);
/* We use PPLL_DIV_3 */
- newmode.clk_cntl_index = 0x300;
+ newmode->clk_cntl_index = 0x300;
/* Calculate PPLL value if necessary */
if (!nopllcalc)
- radeon_calc_pll_regs(rinfo, &newmode, freq);
+ radeon_calc_pll_regs(rinfo, newmode, freq);
- newmode.vclk_ecp_cntl = rinfo->init_state.vclk_ecp_cntl;
+ newmode->vclk_ecp_cntl = rinfo->init_state.vclk_ecp_cntl;
if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) {
unsigned int hRatio, vRatio;
@@ -1683,37 +1687,37 @@ static int radeonfb_set_par(struct fb_in
if (mode->yres > rinfo->panel_info.yres)
mode->yres = rinfo->panel_info.yres;
- newmode.fp_horz_stretch = (((rinfo->panel_info.xres / 8) - 1)
+ newmode->fp_horz_stretch = (((rinfo->panel_info.xres / 8) - 1)
<< HORZ_PANEL_SHIFT);
- newmode.fp_vert_stretch = ((rinfo->panel_info.yres - 1)
+ newmode->fp_vert_stretch = ((rinfo->panel_info.yres - 1)
<< VERT_PANEL_SHIFT);
if (mode->xres != rinfo->panel_info.xres) {
hRatio = round_div(mode->xres * HORZ_STRETCH_RATIO_MAX,
rinfo->panel_info.xres);
- newmode.fp_horz_stretch = (((((unsigned long)hRatio) & HORZ_STRETCH_RATIO_MASK)) |
- (newmode.fp_horz_stretch &
+ newmode->fp_horz_stretch = (((((unsigned long)hRatio) & HORZ_STRETCH_RATIO_MASK)) |
+ (newmode->fp_horz_stretch &
(HORZ_PANEL_SIZE | HORZ_FP_LOOP_STRETCH |
HORZ_AUTO_RATIO_INC)));
- newmode.fp_horz_stretch |= (HORZ_STRETCH_BLEND |
+ newmode->fp_horz_stretch |= (HORZ_STRETCH_BLEND |
HORZ_STRETCH_ENABLE);
use_rmx = 1;
}
- newmode.fp_horz_stretch &= ~HORZ_AUTO_RATIO;
+ newmode->fp_horz_stretch &= ~HORZ_AUTO_RATIO;
if (mode->yres != rinfo->panel_info.yres) {
vRatio = round_div(mode->yres * VERT_STRETCH_RATIO_MAX,
rinfo->panel_info.yres);
- newmode.fp_vert_stretch = (((((unsigned long)vRatio) & VERT_STRETCH_RATIO_MASK)) |
- (newmode.fp_vert_stretch &
+ newmode->fp_vert_stretch = (((((unsigned long)vRatio) & VERT_STRETCH_RATIO_MASK)) |
+ (newmode->fp_vert_stretch &
(VERT_PANEL_SIZE | VERT_STRETCH_RESERVED)));
- newmode.fp_vert_stretch |= (VERT_STRETCH_BLEND |
+ newmode->fp_vert_stretch |= (VERT_STRETCH_BLEND |
VERT_STRETCH_ENABLE);
use_rmx = 1;
}
- newmode.fp_vert_stretch &= ~VERT_AUTO_RATIO_EN;
+ newmode->fp_vert_stretch &= ~VERT_AUTO_RATIO_EN;
- newmode.fp_gen_cntl = (rinfo->init_state.fp_gen_cntl & (u32)
+ newmode->fp_gen_cntl = (rinfo->init_state.fp_gen_cntl & (u32)
~(FP_SEL_CRTC2 |
FP_RMX_HVSYNC_CONTROL_EN |
FP_DFP_SYNC_SEL |
@@ -1723,56 +1727,56 @@ static int radeonfb_set_par(struct fb_in
FP_CRTC_USE_SHADOW_VEND |
FP_CRT_SYNC_ALT));
- newmode.fp_gen_cntl |= (FP_CRTC_DONT_SHADOW_VPAR |
+ newmode->fp_gen_cntl |= (FP_CRTC_DONT_SHADOW_VPAR |
FP_CRTC_DONT_SHADOW_HEND |
FP_PANEL_FORMAT);
if (IS_R300_VARIANT(rinfo) ||
(rinfo->family == CHIP_FAMILY_R200)) {
- newmode.fp_gen_cntl &= ~R200_FP_SOURCE_SEL_MASK;
+ newmode->fp_gen_cntl &= ~R200_FP_SOURCE_SEL_MASK;
if (use_rmx)
- newmode.fp_gen_cntl |= R200_FP_SOURCE_SEL_RMX;
+ newmode->fp_gen_cntl |= R200_FP_SOURCE_SEL_RMX;
else
- newmode.fp_gen_cntl |= R200_FP_SOURCE_SEL_CRTC1;
+ newmode->fp_gen_cntl |= R200_FP_SOURCE_SEL_CRTC1;
} else
- newmode.fp_gen_cntl |= FP_SEL_CRTC1;
+ newmode->fp_gen_cntl |= FP_SEL_CRTC1;
- newmode.lvds_gen_cntl = rinfo->init_state.lvds_gen_cntl;
- newmode.lvds_pll_cntl = rinfo->init_state.lvds_pll_cntl;
- newmode.tmds_crc = rinfo->init_state.tmds_crc;
- newmode.tmds_transmitter_cntl = rinfo->init_state.tmds_transmitter_cntl;
+ newmode->lvds_gen_cntl = rinfo->init_state.lvds_gen_cntl;
+ newmode->lvds_pll_cntl = rinfo->init_state.lvds_pll_cntl;
+ newmode->tmds_crc = rinfo->init_state.tmds_crc;
+ newmode->tmds_transmitter_cntl = rinfo->init_state.tmds_transmitter_cntl;
if (primary_mon == MT_LCD) {
- newmode.lvds_gen_cntl |= (LVDS_ON | LVDS_BLON);
- newmode.fp_gen_cntl &= ~(FP_FPON | FP_TMDS_EN);
+ newmode->lvds_gen_cntl |= (LVDS_ON | LVDS_BLON);
+ newmode->fp_gen_cntl &= ~(FP_FPON | FP_TMDS_EN);
} else {
/* DFP */
- newmode.fp_gen_cntl |= (FP_FPON | FP_TMDS_EN);
- newmode.tmds_transmitter_cntl = (TMDS_RAN_PAT_RST | TMDS_ICHCSEL) &
+ newmode->fp_gen_cntl |= (FP_FPON | FP_TMDS_EN);
+ newmode->tmds_transmitter_cntl = (TMDS_RAN_PAT_RST | TMDS_ICHCSEL) &
~(TMDS_PLLRST);
/* TMDS_PLL_EN bit is reversed on RV (and mobility) chips */
if (IS_R300_VARIANT(rinfo) ||
(rinfo->family == CHIP_FAMILY_R200) || !rinfo->has_CRTC2)
- newmode.tmds_transmitter_cntl &= ~TMDS_PLL_EN;
+ newmode->tmds_transmitter_cntl &= ~TMDS_PLL_EN;
else
- newmode.tmds_transmitter_cntl |= TMDS_PLL_EN;
- newmode.crtc_ext_cntl &= ~CRTC_CRT_ON;
+ newmode->tmds_transmitter_cntl |= TMDS_PLL_EN;
+ newmode->crtc_ext_cntl &= ~CRTC_CRT_ON;
}
- newmode.fp_crtc_h_total_disp = (((rinfo->panel_info.hblank / 8) & 0x3ff) |
+ newmode->fp_crtc_h_total_disp = (((rinfo->panel_info.hblank / 8) & 0x3ff) |
(((mode->xres / 8) - 1) << 16));
- newmode.fp_crtc_v_total_disp = (rinfo->panel_info.vblank & 0xffff) |
+ newmode->fp_crtc_v_total_disp = (rinfo->panel_info.vblank & 0xffff) |
((mode->yres - 1) << 16);
- newmode.fp_h_sync_strt_wid = ((rinfo->panel_info.hOver_plus & 0x1fff) |
+ newmode->fp_h_sync_strt_wid = ((rinfo->panel_info.hOver_plus & 0x1fff) |
(hsync_wid << 16) | (h_sync_pol << 23));
- newmode.fp_v_sync_strt_wid = ((rinfo->panel_info.vOver_plus & 0xfff) |
+ newmode->fp_v_sync_strt_wid = ((rinfo->panel_info.vOver_plus & 0xfff) |
(vsync_wid << 16) | (v_sync_pol << 23));
}
/* do it! */
if (!rinfo->asleep) {
- memcpy(&rinfo->state, &newmode, sizeof(newmode));
- radeon_write_mode (rinfo, &newmode, 0);
+ memcpy(&rinfo->state, newmode, sizeof(*newmode));
+ radeon_write_mode (rinfo, newmode, 0);
/* (re)initialize the engine */
if (!(info->flags & FBINFO_HWACCEL_DISABLED))
radeonfb_engine_init (rinfo);
@@ -1792,6 +1796,7 @@ static int radeonfb_set_par(struct fb_in
rinfo->depth, info->fix.line_length);
#endif
+ kfree(newmode);
return 0;
}
--
dwmw2
^ permalink raw reply
* problems on USB
From: zhonglei @ 2004-11-30 2:32 UTC (permalink / raw)
To: Linuxppc-embedded
hi
My system is Lite5200 with DENX Embedded Linux running on it.When I tried to enable my USB port to use my u-disk,
the problem occured.
I have enabled USB support with 'make xconfig'. The reports are as follows:
********************************************************************
U-Boot 1.1.2 (Nov 12 2004 - 11:46:06)
CPU: MPC5200 v1.2 at 462 MHz
Bus 132 MHz, IPB 132 MHz, PCI 33 MHz
Board: Motorola MPC5200 (IceCube)
I2C: 85 kHz, ready
DRAM: 64 MB
FLASH: 16 MB
PCI: Bus Dev VenId DevId Class Int
00 1a 1057 5803 0680 00
In: serial
Out: serial
Err: serial
Net: FEC ETHERNET
IDE: Bus 0: OK
Device 0: Model: Flash Card Firm: 2N3-0925 Ser#: CF00000000
Type: Removable Hard Disk
Capacity: 123.0 MB = 0.1 GB (251904 x 512)
Device 1: not available
Autostarting.Press any key to abort..
Hit any key to stop autoboot: 0
Using FEC ETHERNET device
TFTP from server 198.87.102.60; our IP address is 198.87.102.210
Filename 'MPC5200/uImage'.
Load address: 0x100000
Loading: #################################################################
###############################################################
######################################
done
Bytes transferred = 857559 (d15d7 hex)
## Booting image at 00100000 ...
Image Name: Linux-2.4.25
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 857495 Bytes = 837.4 kB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Memory BAT mapping: BAT2=64Mb, BAT3=0Mb, residual: 0Mb
Linux version 2.4.25 (root@198.87.102.60.netdial.caribe.net) (gcc version 3.2.24
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/nfs rw nfsroot=198.87.102.60:/home/zl/ELDK/ppc_8f
Calibrating delay loop... 307.20 BogoMIPS
Memory: 62212k available (1500k kernel code, 464k data, 76k init, 0k highmem)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
PCI: Cannot allocate resource region 0 of device 00:1a.0
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
pty: 256 Unix98 ptys configured
ttyS0 on PSC1
ttyS1 on PSC2
ttyS2 on PSC3
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
Port Config is: 0x11050004
ipb=132MHz, set clock period to 7
GPIO config: 11050004
ATA invalid: 01000000
ATA hostcnf: 03000000
ATA pio1 : 100a0a00
ATA pio2 : 02040600
XLB Arb cnf: 0000a366
mpc5xxx_ide: Setting up IDE interface ide0...
ATA DMA task: 5
Probing IDE interface ide0...
hda: Flash Card, CFA DISK drive
ide0 at 0xf0003a60-0xf0003a67,0xf0003a5c on irq 45
hda: attached ide-disk driver.
hda: 251904 sectors (129 MB) w/0KiB Cache, CHS=984/16/16
Partition check:
hda: hda1
Icecube Bank 0: Found 1 x8 devices at 0x0 in 8-bit mode
Icecube Bank 0: Found 1 x8 devices at 0x800000 in 8-bit mode
Amd/Fujitsu Extended Query Table at 0x0040
Icecube Bank 0: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 2
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Icecube flash bank 0: Using static image partition definition
Creating 5 MTD partitions on "Icecube Bank 0":
0x00000000-0x00800000 : "Spare"
0x00800000-0x00900000 : "kernel"
0x00900000-0x00c00000 : "initrd"
0x00c00000-0x00f00000 : "jffs"
0x00f00000-0x01000000 : "Firmware"
usb.c: registered new driver hub
host/usb-ohci.c: USB OHCI at membase 0xf0001000, IRQ 44
host/usb-ohci.c: usb-0, Built-In ohci
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 1 port detected
NET4: Linux TCP/IP 1.0 for NET4.0
eth0: Phy @ 0x0, type LXT971 (0x001378e2)
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
eth0: Waiting for the link to be up...
eth0: status: link up, 100 Mbps Full Duplex, auto-negotiation complete.
IP-Config: Complete:
device=eth0, addr=198.87.102.210, mask=255.0.0.0, gw=198.87.102.60,
host=icecube, domain=, nis-domain=(none),
bootserver=198.87.102.60, rootserver=198.87.102.60, rootpath=
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Looking up port of RPC 100003/2 on 198.87.102.60
Looking up port of RPC 100005/1 on 198.87.102.60
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 76k init
INIT: version 2.84 booting
Welcome to DENX Embedded Linux Environment
Press 'I' to enter interactive startup.
Building the cache [ OK ]
Mounting proc filesystem: [ OK ]
Configuring kernel parameters: [ OK ]
RTC_RD_TIME: Invalid argument
ioctl() to /dev/rtc to read the time failed.
Setting clock : Wed Dec 31 19:00:09 EST 1969 [ OK ]
Setting hostname icecube: [ OK ]
Mounting USB filesystem: mount: mount point /proc/bus/usb does not exist
[FAILED]
Activating swap partitions: [ OK ]
Checking filesystems
[ OK ]
Mounting local filesystems: [ OK ]
Enabling swap space: [ OK ]
modprobe: Can't open dependencies file /lib/modules/2.4.25/modules.dep (No such)
INIT: Entering runlevel: 3
Entering non-interactive startup
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
Initializing random number generator: [ OK ]
Starting portmapper: [ OK ]
Mounting NFS filesystems: [ OK ]
Mounting other filesystems: [ OK ]
Starting xinetd: [ OK ]
icecube login: root
Last login: Wed Dec 31 19:02:11 on console
bash-2.05b#
****************************************************************
It seems that the USB port has been detected.But the filesystem mounted unsuccessfully!(Mounting USB filesystem:
mount: mount point /proc/bus/usb does not exist)
Please give a hand! Thanks in advance!!!!!
BestRegards
zhonglei
^ permalink raw reply
* Re: problems on USB
From: Jaap-Jan Boor @ 2004-11-30 6:00 UTC (permalink / raw)
To: zhonglei; +Cc: Linuxppc-embedded
In-Reply-To: <200411301032.AA40894774@RCS-9000.COM>
Hi,
did you have a
none /proc/bus/usb usbdevfs defaults 0 0
entry in your fstab?
Jaap-Jan
On 30-nov-04, at 3:32, zhonglei wrote:
> hi
> My system is Lite5200 with DENX Embedded Linux running on it.When I
> tried to enable my USB port to use my u-disk,
>
> the problem occured.
> I have enabled USB support with 'make xconfig'. The reports are as
> follows:
> ********************************************************************
> U-Boot 1.1.2 (Nov 12 2004 - 11:46:06)
>
> CPU: MPC5200 v1.2 at 462 MHz
> Bus 132 MHz, IPB 132 MHz, PCI 33 MHz
> Board: Motorola MPC5200 (IceCube)
> I2C: 85 kHz, ready
> DRAM: 64 MB
> FLASH: 16 MB
> PCI: Bus Dev VenId DevId Class Int
> 00 1a 1057 5803 0680 00
> In: serial
> Out: serial
> Err: serial
> Net: FEC ETHERNET
> IDE: Bus 0: OK
> Device 0: Model: Flash Card Firm: 2N3-0925 Ser#: CF00000000
> Type: Removable Hard Disk
> Capacity: 123.0 MB = 0.1 GB (251904 x 512)
> Device 1: not available
>
> Autostarting.Press any key to abort..
>
> Hit any key to stop autoboot: 0
> Using FEC ETHERNET device
> TFTP from server 198.87.102.60; our IP address is 198.87.102.210
> Filename 'MPC5200/uImage'.
> Load address: 0x100000
> Loading:
> #################################################################
> ###############################################################
> ######################################
> done
> Bytes transferred = 857559 (d15d7 hex)
> ## Booting image at 00100000 ...
> Image Name: Linux-2.4.25
> Image Type: PowerPC Linux Kernel Image (gzip compressed)
> Data Size: 857495 Bytes = 837.4 kB
> Load Address: 00000000
> Entry Point: 00000000
> Verifying Checksum ... OK
> Uncompressing Kernel Image ... OK
> Memory BAT mapping: BAT2=64Mb, BAT3=0Mb, residual: 0Mb
> Linux version 2.4.25 (root@198.87.102.60.netdial.caribe.net) (gcc
> version 3.2.24
> On node 0 totalpages: 16384
> zone(0): 16384 pages.
> zone(1): 0 pages.
> zone(2): 0 pages.
> Kernel command line: root=/dev/nfs rw
> nfsroot=198.87.102.60:/home/zl/ELDK/ppc_8f
> Calibrating delay loop... 307.20 BogoMIPS
> Memory: 62212k available (1500k kernel code, 464k data, 76k init, 0k
> highmem)
> Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
> Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
> Mount cache hash table entries: 512 (order: 0, 4096 bytes)
> Buffer cache hash table entries: 4096 (order: 2, 16384 bytes)
> Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
> POSIX conformance testing by UNIFIX
> PCI: Probing PCI hardware
> PCI: Cannot allocate resource region 0 of device 00:1a.0
> Linux NET4.0 for Linux 2.4
> Based upon Swansea University Computer Society NET3.039
> Initializing RT netlink socket
> Starting kswapd
> Journalled Block Device driver loaded
> JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
> pty: 256 Unix98 ptys configured
> ttyS0 on PSC1
> ttyS1 on PSC2
> ttyS2 on PSC3
> RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
> loop: loaded (max 8 devices)
> Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
> ide: Assuming 33MHz system bus speed for PIO modes; override with
> idebus=xx
> Port Config is: 0x11050004
> ipb=132MHz, set clock period to 7
> GPIO config: 11050004
> ATA invalid: 01000000
> ATA hostcnf: 03000000
> ATA pio1 : 100a0a00
> ATA pio2 : 02040600
> XLB Arb cnf: 0000a366
> mpc5xxx_ide: Setting up IDE interface ide0...
> ATA DMA task: 5
> Probing IDE interface ide0...
> hda: Flash Card, CFA DISK drive
> ide0 at 0xf0003a60-0xf0003a67,0xf0003a5c on irq 45
> hda: attached ide-disk driver.
> hda: 251904 sectors (129 MB) w/0KiB Cache, CHS=984/16/16
> Partition check:
> hda: hda1
> Icecube Bank 0: Found 1 x8 devices at 0x0 in 8-bit mode
> Icecube Bank 0: Found 1 x8 devices at 0x800000 in 8-bit mode
> Amd/Fujitsu Extended Query Table at 0x0040
> Icecube Bank 0: CFI does not contain boot bank location. Assuming top.
> number of CFI chips: 2
> cfi_cmdset_0002: Disabling erase-suspend-program due to code
> brokenness.
> Icecube flash bank 0: Using static image partition definition
> Creating 5 MTD partitions on "Icecube Bank 0":
> 0x00000000-0x00800000 : "Spare"
> 0x00800000-0x00900000 : "kernel"
> 0x00900000-0x00c00000 : "initrd"
> 0x00c00000-0x00f00000 : "jffs"
> 0x00f00000-0x01000000 : "Firmware"
> usb.c: registered new driver hub
> host/usb-ohci.c: USB OHCI at membase 0xf0001000, IRQ 44
> host/usb-ohci.c: usb-0, Built-In ohci
> usb.c: new USB bus registered, assigned bus number 1
> hub.c: USB hub found
> hub.c: 1 port detected
> NET4: Linux TCP/IP 1.0 for NET4.0
> eth0: Phy @ 0x0, type LXT971 (0x001378e2)
> IP Protocols: ICMP, UDP, TCP, IGMP
> IP: routing cache hash table of 512 buckets, 4Kbytes
> TCP: Hash tables configured (established 4096 bind 8192)
> eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
> eth0: Waiting for the link to be up...
> eth0: status: link up, 100 Mbps Full Duplex, auto-negotiation complete.
> IP-Config: Complete:
> device=eth0, addr=198.87.102.210, mask=255.0.0.0,
> gw=198.87.102.60,
> host=icecube, domain=, nis-domain=(none),
> bootserver=198.87.102.60, rootserver=198.87.102.60, rootpath=
> NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
> Looking up port of RPC 100003/2 on 198.87.102.60
> Looking up port of RPC 100005/1 on 198.87.102.60
> VFS: Mounted root (nfs filesystem).
> Freeing unused kernel memory: 76k init
> INIT: version 2.84 booting
> Welcome to DENX Embedded Linux Environment
> Press 'I' to enter interactive startup.
> Building the cache [ OK ]
> Mounting proc filesystem: [ OK ]
> Configuring kernel parameters: [ OK ]
> RTC_RD_TIME: Invalid argument
> ioctl() to /dev/rtc to read the time failed.
> Setting clock : Wed Dec 31 19:00:09 EST 1969 [ OK ]
> Setting hostname icecube: [ OK ]
> Mounting USB filesystem: mount: mount point /proc/bus/usb does not
> exist
> [FAILED]
> Activating swap partitions: [ OK ]
> Checking filesystems
> [ OK ]
> Mounting local filesystems: [ OK ]
> Enabling swap space: [ OK ]
> modprobe: Can't open dependencies file /lib/modules/2.4.25/modules.dep
> (No such)
> INIT: Entering runlevel: 3
> Entering non-interactive startup
> Setting network parameters: [ OK ]
> Bringing up loopback interface: [ OK ]
> Starting system logger: [ OK ]
> Starting kernel logger: [ OK ]
> Initializing random number generator: [ OK ]
> Starting portmapper: [ OK ]
> Mounting NFS filesystems: [ OK ]
> Mounting other filesystems: [ OK ]
> Starting xinetd: [ OK ]
>
> icecube login: root
> Last login: Wed Dec 31 19:02:11 on console
> bash-2.05b#
> ****************************************************************
>
> It seems that the USB port has been detected.But the filesystem
> mounted unsuccessfully!(Mounting USB filesystem:
>
> mount: mount point /proc/bus/usb does not exist)
>
> Please give a hand! Thanks in advance!!!!!
>
> BestRegards
> zhonglei
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* Re: fbmem.c compile problem
From: Sam Song @ 2004-11-30 6:44 UTC (permalink / raw)
To: Frank; +Cc: linuxppc-embedded
In-Reply-To: <20041129175045.9279.qmail@web13807.mail.yahoo.com>
Frank <frannk_m1@yahoo.com> wrote:
> #
> # Console drivers
> #
> CONFIG_VGA_CONSOLE=y
> #
> # Frame-buffer support
> #
> CONFIG_FB=y
> CONFIG_DUMMY_CONSOLE=y
> # CONFIG_FB_VOYAGER is not set
> # CONFIG_FB_MB86290 is not set
> # CONFIG_FB_RIVA is not set
> # CONFIG_FB_CLGEN is not set
> # CONFIG_FB_PM2 is not set
> # CONFIG_FB_PM3 is not set
> # CONFIG_FB_CYBER2000 is not set
> # CONFIG_FB_CT65550 is not set
> # CONFIG_FB_IMSTT is not set
> # CONFIG_FB_S3TRIO is not set
> CONFIG_FB_VESA=y
> # CONFIG_FB_VGA16 is not set
> # CONFIG_FB_LYNX is not set
> # CONFIG_FB_SM712 is not set
> # CONFIG_FB_MATROX is not set
> # CONFIG_FB_ATY is not set
> CONFIG_FB_RADEON=y
> # CONFIG_FB_ATY128 is not set
It seems that you haven't enabled enough configuration
about framebuffer support. Following is the my extra
LCD kernel configuration on 2.4.18. Just a reference.
#
# Frame-buffer support
#
CONFIG_FBCON_ADVANCED=y
CONFIG_FBCON_CFB8=y
CONFIG_FBCON_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
=====
Best regards,
Sam
_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
^ permalink raw reply
* MPC8272ADS - devices on PCI bus 'freezing' board
From: Adam Kent @ 2004-11-30 7:33 UTC (permalink / raw)
To: linuxppc-embedded
Hi all,
I am working on a project involving an MPC8272ADS development board
with a MPC8247 processor, and am experiencing some issues with the PCI
bus.
The problem is basically that generating traffic flow over an Ethernet
card connected via the PCI bus on the board results in a board
'freeze'. Specifically, flooding another host on the network with
ICMP ping packets will reproduce the problem. This happens after a
variable amount of time, anywhere from around 5 seconds to a few
minutes of network activity. It will crash even faster if the other
host also pings the development board at the same time. The freeze
results in the board becoming totally unresponsive to any connections
over the standard board Ethernet ports or further communication over
the default serial console. The board's "run" LED (LD18) also becomes
permanently lit, indicating an infinite loop of some kind.
Details of setup:
- Using the monolithic Linux kernel image (2.4.26) provided by
Arabella, a company that provides a free board support package for
this board, and the standard Arabella-provided board file system
mounted over NFS.
- A stock-standard PCI Ethernet card based on the RTL8139 chip set.
- Standard Linux kernel driver for the PCI Ethernet card (8139too)
built using the Linux source tree provided by Arabella, and inserted
as a module into the running kernel.
- A simple local network setup between another host running Linux, via
a crossover CAT5 cable.
Has anyone experienced similar problems with the PCI bus on the
MPC8272ADS? More broadly, what kernel sources are people using on
this board to use PCI-based devices?
We are also trying to get the latest linuxppc-2.4.28 kernel
(downloaded yesterday from ppc.bkbits.net) running, but it seems that
PCI support is not actually included in the standard kernel code for
this board; it seems that the PCI support code is something that
Arabella has specifically added to their kernel tree.
Thanks in advance for any help anyone can offer,
Adam Kent
Gecko Audio
^ permalink raw reply
* Re: G3 iBook LCD brightness in X under kernel 2.4.25 and 2.6.8
From: Christof Petig @ 2004-11-30 8:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Frank Murphy; +Cc: linuxppc-dev list, debian-x
In-Reply-To: <41AB5995.9080009@petig-baender.de>
Christof Petig schrieb:
> My last experiment with 2.6.9 gave me (IIRC): The console is switched to
> a text console, some power management transition messages appear, the
> hard disc parks, the text remains readable ... Pressing a screen gives
> CD spinup, more messages and the computer switches back to the X console.
>
> I will retry with Linus latest tree.
I can confirm that everything works well with Linus' 2.6.10-rc2-bk6. So
consider the problem as solved (writing from said version).
snooze and the brightness keys work well.
Christof
PS: related (?) config settings
CONFIG_ADB=y
# CONFIG_ADB_CUDA is not set
CONFIG_ADB_PMU=y
CONFIG_PMAC_PBOOK=y
CONFIG_PMAC_APM_EMU=y
CONFIG_PMAC_BACKLIGHT=y
# CONFIG_ADB_MACIO is not set
CONFIG_INPUT_ADBHID=y
CONFIG_MAC_EMUMOUSEBTN=y
# CONFIG_FB_ATY128 is not set
CONFIG_FB_ATY=y
CONFIG_FB_ATY_CT=y
CONFIG_FB_ATY_GENERIC_LCD=y
# CONFIG_FB_ATY_XL_INIT is not set
# CONFIG_FB_ATY_GX is not set
^ permalink raw reply
* Re: problems on USB
From: Jaap-Jan Boor @ 2004-11-30 8:13 UTC (permalink / raw)
To: zhonglei; +Cc: linuxppc embedded
In-Reply-To: <200411301445.AA46072118@RCS-9000.COM>
On 30-nov-04, at 7:45, zhonglei wrote:
> hi
> thank you for your help!
> But I am not very clear about your meaning. I have a NFS mount
> directory in my host computer. In the /home/zl/ELDK/ppc_82xx/proc(in
> my host),there is no files in it.
that's ok, because it should only show on target the pseudo proc
filesystem
containing runtime system information.
Do you have something in /home/zl/ELDK/ppc_82xx/etc/fstab?
if so, try the: mount -a
command on your target
Jaap-Jan
> So what can I do next?
> BestRegards
> zhonglei
> ---------- Original Message ----------------------------------
> From: Jaap-Jan Boor <jjboor@aimsys.nl>
> Date: Tue, 30 Nov 2004 07:00:49 +0100
>
>> Hi,
>>
>> did you have a
>> none /proc/bus/usb usbdevfs defaults 0 0
>>
>> entry in your fstab?
>>
>> Jaap-Jan
>>
>> On 30-nov-04, at 3:32, zhonglei wrote:
>>
>>> hi
>>> My system is Lite5200 with DENX Embedded Linux running on it.When
>>> I
>>> tried to enable my USB port to use my u-disk,
>>>
>>> the problem occured.
>>> I have enabled USB support with 'make xconfig'. The reports are as
>>> follows:
>>> ********************************************************************
>>> U-Boot 1.1.2 (Nov 12 2004 - 11:46:06)
>>>
>>> CPU: MPC5200 v1.2 at 462 MHz
>>> Bus 132 MHz, IPB 132 MHz, PCI 33 MHz
>>> Board: Motorola MPC5200 (IceCube)
>>> I2C: 85 kHz, ready
>>> DRAM: 64 MB
>>> FLASH: 16 MB
>>> PCI: Bus Dev VenId DevId Class Int
>>> 00 1a 1057 5803 0680 00
>>> In: serial
>>> Out: serial
>>> Err: serial
>>> Net: FEC ETHERNET
>>> IDE: Bus 0: OK
>>> Device 0: Model: Flash Card Firm: 2N3-0925 Ser#: CF00000000
>>> Type: Removable Hard Disk
>>> Capacity: 123.0 MB = 0.1 GB (251904 x 512)
>>> Device 1: not available
>>>
>>> Autostarting.Press any key to abort..
>>>
>>> Hit any key to stop autoboot: 0
>>> Using FEC ETHERNET device
>>> TFTP from server 198.87.102.60; our IP address is 198.87.102.210
>>> Filename 'MPC5200/uImage'.
>>> Load address: 0x100000
>>> Loading:
>>> #################################################################
>>> ###############################################################
>>> ######################################
>>> done
>>> Bytes transferred = 857559 (d15d7 hex)
>>> ## Booting image at 00100000 ...
>>> Image Name: Linux-2.4.25
>>> Image Type: PowerPC Linux Kernel Image (gzip compressed)
>>> Data Size: 857495 Bytes = 837.4 kB
>>> Load Address: 00000000
>>> Entry Point: 00000000
>>> Verifying Checksum ... OK
>>> Uncompressing Kernel Image ... OK
>>> Memory BAT mapping: BAT2=64Mb, BAT3=0Mb, residual: 0Mb
>>> Linux version 2.4.25 (root@198.87.102.60.netdial.caribe.net) (gcc
>>> version 3.2.24
>>> On node 0 totalpages: 16384
>>> zone(0): 16384 pages.
>>> zone(1): 0 pages.
>>> zone(2): 0 pages.
>>> Kernel command line: root=/dev/nfs rw
>>> nfsroot=198.87.102.60:/home/zl/ELDK/ppc_8f
>>> Calibrating delay loop... 307.20 BogoMIPS
>>> Memory: 62212k available (1500k kernel code, 464k data, 76k init, 0k
>>> highmem)
>>> Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
>>> Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
>>> Mount cache hash table entries: 512 (order: 0, 4096 bytes)
>>> Buffer cache hash table entries: 4096 (order: 2, 16384 bytes)
>>> Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
>>> POSIX conformance testing by UNIFIX
>>> PCI: Probing PCI hardware
>>> PCI: Cannot allocate resource region 0 of device 00:1a.0
>>> Linux NET4.0 for Linux 2.4
>>> Based upon Swansea University Computer Society NET3.039
>>> Initializing RT netlink socket
>>> Starting kswapd
>>> Journalled Block Device driver loaded
>>> JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
>>> pty: 256 Unix98 ptys configured
>>> ttyS0 on PSC1
>>> ttyS1 on PSC2
>>> ttyS2 on PSC3
>>> RAMDISK driver initialized: 16 RAM disks of 16384K size 1024
>>> blocksize
>>> loop: loaded (max 8 devices)
>>> Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
>>> ide: Assuming 33MHz system bus speed for PIO modes; override with
>>> idebus=xx
>>> Port Config is: 0x11050004
>>> ipb=132MHz, set clock period to 7
>>> GPIO config: 11050004
>>> ATA invalid: 01000000
>>> ATA hostcnf: 03000000
>>> ATA pio1 : 100a0a00
>>> ATA pio2 : 02040600
>>> XLB Arb cnf: 0000a366
>>> mpc5xxx_ide: Setting up IDE interface ide0...
>>> ATA DMA task: 5
>>> Probing IDE interface ide0...
>>> hda: Flash Card, CFA DISK drive
>>> ide0 at 0xf0003a60-0xf0003a67,0xf0003a5c on irq 45
>>> hda: attached ide-disk driver.
>>> hda: 251904 sectors (129 MB) w/0KiB Cache, CHS=984/16/16
>>> Partition check:
>>> hda: hda1
>>> Icecube Bank 0: Found 1 x8 devices at 0x0 in 8-bit mode
>>> Icecube Bank 0: Found 1 x8 devices at 0x800000 in 8-bit mode
>>> Amd/Fujitsu Extended Query Table at 0x0040
>>> Icecube Bank 0: CFI does not contain boot bank location. Assuming
>>> top.
>>> number of CFI chips: 2
>>> cfi_cmdset_0002: Disabling erase-suspend-program due to code
>>> brokenness.
>>> Icecube flash bank 0: Using static image partition definition
>>> Creating 5 MTD partitions on "Icecube Bank 0":
>>> 0x00000000-0x00800000 : "Spare"
>>> 0x00800000-0x00900000 : "kernel"
>>> 0x00900000-0x00c00000 : "initrd"
>>> 0x00c00000-0x00f00000 : "jffs"
>>> 0x00f00000-0x01000000 : "Firmware"
>>> usb.c: registered new driver hub
>>> host/usb-ohci.c: USB OHCI at membase 0xf0001000, IRQ 44
>>> host/usb-ohci.c: usb-0, Built-In ohci
>>> usb.c: new USB bus registered, assigned bus number 1
>>> hub.c: USB hub found
>>> hub.c: 1 port detected
>>> NET4: Linux TCP/IP 1.0 for NET4.0
>>> eth0: Phy @ 0x0, type LXT971 (0x001378e2)
>>> IP Protocols: ICMP, UDP, TCP, IGMP
>>> IP: routing cache hash table of 512 buckets, 4Kbytes
>>> TCP: Hash tables configured (established 4096 bind 8192)
>>> eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
>>> eth0: Waiting for the link to be up...
>>> eth0: status: link up, 100 Mbps Full Duplex, auto-negotiation
>>> complete.
>>> IP-Config: Complete:
>>> device=eth0, addr=198.87.102.210, mask=255.0.0.0,
>>> gw=198.87.102.60,
>>> host=icecube, domain=, nis-domain=(none),
>>> bootserver=198.87.102.60, rootserver=198.87.102.60, rootpath=
>>> NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
>>> Looking up port of RPC 100003/2 on 198.87.102.60
>>> Looking up port of RPC 100005/1 on 198.87.102.60
>>> VFS: Mounted root (nfs filesystem).
>>> Freeing unused kernel memory: 76k init
>>> INIT: version 2.84 booting
>>> Welcome to DENX Embedded Linux Environment
>>> Press 'I' to enter interactive startup.
>>> Building the cache [ OK ]
>>> Mounting proc filesystem: [ OK ]
>>> Configuring kernel parameters: [ OK ]
>>> RTC_RD_TIME: Invalid argument
>>> ioctl() to /dev/rtc to read the time failed.
>>> Setting clock : Wed Dec 31 19:00:09 EST 1969 [ OK ]
>>> Setting hostname icecube: [ OK ]
>>> Mounting USB filesystem: mount: mount point /proc/bus/usb does not
>>> exist
>>> [FAILED]
>>> Activating swap partitions: [ OK ]
>>> Checking filesystems
>>> [ OK ]
>>> Mounting local filesystems: [ OK ]
>>> Enabling swap space: [ OK ]
>>> modprobe: Can't open dependencies file
>>> /lib/modules/2.4.25/modules.dep
>>> (No such)
>>> INIT: Entering runlevel: 3
>>> Entering non-interactive startup
>>> Setting network parameters: [ OK ]
>>> Bringing up loopback interface: [ OK ]
>>> Starting system logger: [ OK ]
>>> Starting kernel logger: [ OK ]
>>> Initializing random number generator: [ OK ]
>>> Starting portmapper: [ OK ]
>>> Mounting NFS filesystems: [ OK ]
>>> Mounting other filesystems: [ OK ]
>>> Starting xinetd: [ OK ]
>>>
>>> icecube login: root
>>> Last login: Wed Dec 31 19:02:11 on console
>>> bash-2.05b#
>>> ****************************************************************
>>>
>>> It seems that the USB port has been detected.But the filesystem
>>> mounted unsuccessfully!(Mounting USB filesystem:
>>>
>>> mount: mount point /proc/bus/usb does not exist)
>>>
>>> Please give a hand! Thanks in advance!!!!!
>>>
>>> BestRegards
>>> zhonglei
>>> _______________________________________________
>>> Linuxppc-embedded mailing list
>>> Linuxppc-embedded@ozlabs.org
>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>
>> _______________________________________________
>> Linuxppc-embedded mailing list
>> Linuxppc-embedded@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>
^ permalink raw reply
* Re: G3 iBook LCD brightness in X under kernel 2.4.25 and 2.6.8
From: Frank Murphy @ 2004-11-30 9:05 UTC (permalink / raw)
To: Christof Petig, Benjamin Herrenschmidt, Frank Murphy
Cc: linuxppc-dev list, debian-x
In-Reply-To: <41AC292C.70301@petig-baender.de>
On Tue, 30 Nov 2004 09:02:52 +0100, "Christof Petig"
<lists@petig-baender.de> said:
> I can confirm that everything works well with Linus' 2.6.10-rc2-bk6. So
> consider the problem as solved (writing from said version).
>
> snooze and the brightness keys work well.
Well *that's* good news. I'll retry here as well and confirm.
Frank
^ permalink raw reply
* Re: problems on USB
From: Jaap-Jan Boor @ 2004-11-30 9:20 UTC (permalink / raw)
To: zhonglei; +Cc: linuxppc embedded
In-Reply-To: <200411301701.AA45351144@RCS-9000.COM>
On 30-nov-04, at 10:01, zhonglei wrote:
> It seems we are in the right track!
> This is the content of /home/zl/ELDK/ppc_82xx/etc/fstab:
> /dev/nfs / nfs defaults 0 0
> none /proc proc defaults 0 0
>
> And I have mount -a,but it seems nothing happend! :)
ja, now add the line:
none /proc/bus/usb usbdevfs defaults 0 0
to fstab, and mount -a again
after that you have the linux usb core pseudo filesystem,
in which you should find a /proc/bus/usb/devices file that
shows all usb devices.
> How can I see the files in my u-disk?
I don't know what a u-disk is, but usb sticks are normally
mounted using the scsi emulation layer.
Jaap-Jan
> ---------- Original Message ----------------------------------
> From: Jaap-Jan Boor <jjboor@aimsys.nl>
> Date: Tue, 30 Nov 2004 09:13:42 +0100
>
>>
>> On 30-nov-04, at 7:45, zhonglei wrote:
>>
>>> hi
>>> thank you for your help!
>>> But I am not very clear about your meaning. I have a NFS mount
>>> directory in my host computer. In the /home/zl/ELDK/ppc_82xx/proc(in
>>> my host),there is no files in it.
>>
>> that's ok, because it should only show on target the pseudo proc
>> filesystem
>> containing runtime system information.
>> Do you have something in /home/zl/ELDK/ppc_82xx/etc/fstab?
>> if so, try the: mount -a
>> command on your target
>>
>> Jaap-Jan
>>
>>
>>> So what can I do next?
>>> BestRegards
>>> zhonglei
>>> ---------- Original Message ----------------------------------
>>> From: Jaap-Jan Boor <jjboor@aimsys.nl>
>>> Date: Tue, 30 Nov 2004 07:00:49 +0100
>>>
>>>> Hi,
>>>>
>>>> did you have a
>>>> none /proc/bus/usb usbdevfs defaults 0 0
>>>>
>>>> entry in your fstab?
>>>>
>>>> Jaap-Jan
>>>>
>>>> On 30-nov-04, at 3:32, zhonglei wrote:
>>>>
>>>>> hi
>>>>> My system is Lite5200 with DENX Embedded Linux running on
>>>>> it.When
>>>>> I
>>>>> tried to enable my USB port to use my u-disk,
>>>>>
>>>>> the problem occured.
>>>>> I have enabled USB support with 'make xconfig'. The reports are
>>>>> as
>>>>> follows:
>>>>> *******************************************************************
>>>>> *
>>>>> U-Boot 1.1.2 (Nov 12 2004 - 11:46:06)
>>>>>
>>>>> CPU: MPC5200 v1.2 at 462 MHz
>>>>> Bus 132 MHz, IPB 132 MHz, PCI 33 MHz
>>>>> Board: Motorola MPC5200 (IceCube)
>>>>> I2C: 85 kHz, ready
>>>>> DRAM: 64 MB
>>>>> FLASH: 16 MB
>>>>> PCI: Bus Dev VenId DevId Class Int
>>>>> 00 1a 1057 5803 0680 00
>>>>> In: serial
>>>>> Out: serial
>>>>> Err: serial
>>>>> Net: FEC ETHERNET
>>>>> IDE: Bus 0: OK
>>>>> Device 0: Model: Flash Card Firm: 2N3-0925 Ser#: CF00000000
>>>>> Type: Removable Hard Disk
>>>>> Capacity: 123.0 MB = 0.1 GB (251904 x 512)
>>>>> Device 1: not available
>>>>>
>>>>> Autostarting.Press any key to abort..
>>>>>
>>>>> Hit any key to stop autoboot: 0
>>>>> Using FEC ETHERNET device
>>>>> TFTP from server 198.87.102.60; our IP address is 198.87.102.210
>>>>> Filename 'MPC5200/uImage'.
>>>>> Load address: 0x100000
>>>>> Loading:
>>>>> #################################################################
>>>>> ###############################################################
>>>>> ######################################
>>>>> done
>>>>> Bytes transferred = 857559 (d15d7 hex)
>>>>> ## Booting image at 00100000 ...
>>>>> Image Name: Linux-2.4.25
>>>>> Image Type: PowerPC Linux Kernel Image (gzip compressed)
>>>>> Data Size: 857495 Bytes = 837.4 kB
>>>>> Load Address: 00000000
>>>>> Entry Point: 00000000
>>>>> Verifying Checksum ... OK
>>>>> Uncompressing Kernel Image ... OK
>>>>> Memory BAT mapping: BAT2=64Mb, BAT3=0Mb, residual: 0Mb
>>>>> Linux version 2.4.25 (root@198.87.102.60.netdial.caribe.net) (gcc
>>>>> version 3.2.24
>>>>> On node 0 totalpages: 16384
>>>>> zone(0): 16384 pages.
>>>>> zone(1): 0 pages.
>>>>> zone(2): 0 pages.
>>>>> Kernel command line: root=/dev/nfs rw
>>>>> nfsroot=198.87.102.60:/home/zl/ELDK/ppc_8f
>>>>> Calibrating delay loop... 307.20 BogoMIPS
>>>>> Memory: 62212k available (1500k kernel code, 464k data, 76k init,
>>>>> 0k
>>>>> highmem)
>>>>> Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
>>>>> Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
>>>>> Mount cache hash table entries: 512 (order: 0, 4096 bytes)
>>>>> Buffer cache hash table entries: 4096 (order: 2, 16384 bytes)
>>>>> Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
>>>>> POSIX conformance testing by UNIFIX
>>>>> PCI: Probing PCI hardware
>>>>> PCI: Cannot allocate resource region 0 of device 00:1a.0
>>>>> Linux NET4.0 for Linux 2.4
>>>>> Based upon Swansea University Computer Society NET3.039
>>>>> Initializing RT netlink socket
>>>>> Starting kswapd
>>>>> Journalled Block Device driver loaded
>>>>> JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
>>>>> pty: 256 Unix98 ptys configured
>>>>> ttyS0 on PSC1
>>>>> ttyS1 on PSC2
>>>>> ttyS2 on PSC3
>>>>> RAMDISK driver initialized: 16 RAM disks of 16384K size 1024
>>>>> blocksize
>>>>> loop: loaded (max 8 devices)
>>>>> Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
>>>>> ide: Assuming 33MHz system bus speed for PIO modes; override with
>>>>> idebus=xx
>>>>> Port Config is: 0x11050004
>>>>> ipb=132MHz, set clock period to 7
>>>>> GPIO config: 11050004
>>>>> ATA invalid: 01000000
>>>>> ATA hostcnf: 03000000
>>>>> ATA pio1 : 100a0a00
>>>>> ATA pio2 : 02040600
>>>>> XLB Arb cnf: 0000a366
>>>>> mpc5xxx_ide: Setting up IDE interface ide0...
>>>>> ATA DMA task: 5
>>>>> Probing IDE interface ide0...
>>>>> hda: Flash Card, CFA DISK drive
>>>>> ide0 at 0xf0003a60-0xf0003a67,0xf0003a5c on irq 45
>>>>> hda: attached ide-disk driver.
>>>>> hda: 251904 sectors (129 MB) w/0KiB Cache, CHS=984/16/16
>>>>> Partition check:
>>>>> hda: hda1
>>>>> Icecube Bank 0: Found 1 x8 devices at 0x0 in 8-bit mode
>>>>> Icecube Bank 0: Found 1 x8 devices at 0x800000 in 8-bit mode
>>>>> Amd/Fujitsu Extended Query Table at 0x0040
>>>>> Icecube Bank 0: CFI does not contain boot bank location. Assuming
>>>>> top.
>>>>> number of CFI chips: 2
>>>>> cfi_cmdset_0002: Disabling erase-suspend-program due to code
>>>>> brokenness.
>>>>> Icecube flash bank 0: Using static image partition definition
>>>>> Creating 5 MTD partitions on "Icecube Bank 0":
>>>>> 0x00000000-0x00800000 : "Spare"
>>>>> 0x00800000-0x00900000 : "kernel"
>>>>> 0x00900000-0x00c00000 : "initrd"
>>>>> 0x00c00000-0x00f00000 : "jffs"
>>>>> 0x00f00000-0x01000000 : "Firmware"
>>>>> usb.c: registered new driver hub
>>>>> host/usb-ohci.c: USB OHCI at membase 0xf0001000, IRQ 44
>>>>> host/usb-ohci.c: usb-0, Built-In ohci
>>>>> usb.c: new USB bus registered, assigned bus number 1
>>>>> hub.c: USB hub found
>>>>> hub.c: 1 port detected
>>>>> NET4: Linux TCP/IP 1.0 for NET4.0
>>>>> eth0: Phy @ 0x0, type LXT971 (0x001378e2)
>>>>> IP Protocols: ICMP, UDP, TCP, IGMP
>>>>> IP: routing cache hash table of 512 buckets, 4Kbytes
>>>>> TCP: Hash tables configured (established 4096 bind 8192)
>>>>> eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
>>>>> eth0: Waiting for the link to be up...
>>>>> eth0: status: link up, 100 Mbps Full Duplex, auto-negotiation
>>>>> complete.
>>>>> IP-Config: Complete:
>>>>> device=eth0, addr=198.87.102.210, mask=255.0.0.0,
>>>>> gw=198.87.102.60,
>>>>> host=icecube, domain=, nis-domain=(none),
>>>>> bootserver=198.87.102.60, rootserver=198.87.102.60, rootpath=
>>>>> NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
>>>>> Looking up port of RPC 100003/2 on 198.87.102.60
>>>>> Looking up port of RPC 100005/1 on 198.87.102.60
>>>>> VFS: Mounted root (nfs filesystem).
>>>>> Freeing unused kernel memory: 76k init
>>>>> INIT: version 2.84 booting
>>>>> Welcome to DENX Embedded Linux Environment
>>>>> Press 'I' to enter interactive startup.
>>>>> Building the cache [ OK ]
>>>>> Mounting proc filesystem: [ OK ]
>>>>> Configuring kernel parameters: [ OK ]
>>>>> RTC_RD_TIME: Invalid argument
>>>>> ioctl() to /dev/rtc to read the time failed.
>>>>> Setting clock : Wed Dec 31 19:00:09 EST 1969 [ OK ]
>>>>> Setting hostname icecube: [ OK ]
>>>>> Mounting USB filesystem: mount: mount point /proc/bus/usb does not
>>>>> exist
>>>>> [FAILED]
>>>>> Activating swap partitions: [ OK ]
>>>>> Checking filesystems
>>>>> [ OK ]
>>>>> Mounting local filesystems: [ OK ]
>>>>> Enabling swap space: [ OK ]
>>>>> modprobe: Can't open dependencies file
>>>>> /lib/modules/2.4.25/modules.dep
>>>>> (No such)
>>>>> INIT: Entering runlevel: 3
>>>>> Entering non-interactive startup
>>>>> Setting network parameters: [ OK ]
>>>>> Bringing up loopback interface: [ OK ]
>>>>> Starting system logger: [ OK ]
>>>>> Starting kernel logger: [ OK ]
>>>>> Initializing random number generator: [ OK ]
>>>>> Starting portmapper: [ OK ]
>>>>> Mounting NFS filesystems: [ OK ]
>>>>> Mounting other filesystems: [ OK ]
>>>>> Starting xinetd: [ OK ]
>>>>>
>>>>> icecube login: root
>>>>> Last login: Wed Dec 31 19:02:11 on console
>>>>> bash-2.05b#
>>>>> ****************************************************************
>>>>>
>>>>> It seems that the USB port has been detected.But the filesystem
>>>>> mounted unsuccessfully!(Mounting USB filesystem:
>>>>>
>>>>> mount: mount point /proc/bus/usb does not exist)
>>>>>
>>>>> Please give a hand! Thanks in advance!!!!!
>>>>>
>>>>> BestRegards
>>>>> zhonglei
>>>>> _______________________________________________
>>>>> Linuxppc-embedded mailing list
>>>>> Linuxppc-embedded@ozlabs.org
>>>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>>>
>>>> _______________________________________________
>>>> Linuxppc-embedded mailing list
>>>> Linuxppc-embedded@ozlabs.org
>>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>>>
>>
>> _______________________________________________
>> Linuxppc-embedded mailing list
>> Linuxppc-embedded@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>
^ permalink raw reply
* USB driver
From: zhonglei @ 2004-11-30 11:19 UTC (permalink / raw)
To: Linuxppc-embedded
hi:
My system is Lite5200 with DENX Embedded Linux running on it.I want to connect USB mass storage devices to my computer's USB port.But I found there is no driver in kernel.(when I use 'make xconfig' the USB mass storage devices driver is in grey).How can I download/install the driver and active my USB disk?
BestRegards
zhonglei
^ permalink raw reply
* AW: USB driver
From: Martin Krause @ 2004-11-30 11:26 UTC (permalink / raw)
To: zhonglei; +Cc: Linuxppc-embedded
Hi zhonglei
zhonglei wrotes on Dienstag, 30. November 2004 12:19:
> hi:
> My system is Lite5200 with DENX Embedded Linux running on
> it.I want to connect USB mass storage devices to my
> computer's USB port.But I found there is no driver in
> kernel.(when I use 'make xconfig' the USB mass storage
> devices driver is in grey).How can I download/install the
> driver and active my USB disk?
SCSI support has to be enabled before USB mass storage support
could be enabled. AFAIR it is saver to use make menuconfig
instead of make xconfig.
Regards,
Martin
^ permalink raw reply
* USB driver
From: zhonglei @ 2004-11-30 11:58 UTC (permalink / raw)
To: linuxppc-dev
hi:
My system is Lite5200 with DENX Embedded Linux running on it.I want to connect USB mass storage devices to my computer's USB port.But I found there is no driver in kernel.(when I use 'make xconfig' the USB mass storage devices driver is in grey).How can I download/install the driver and active my USB disk?
BestRegards
zhonglei
^ permalink raw reply
* Mounting usb pendrive
From: Isidoro Reyes de Zuloaga @ 2004-11-30 11:06 UTC (permalink / raw)
To: linuxppc-dev list
Hi folks,
I'm trying to mount my usb pendrive device and i'm getty a strange error
message. I compiled my kernel with the scsi modules and all the stuff, and i
can mount it on my x86, but in the powerbook i can't.
this is the /var/log/messages:
Nov 30 12:01:18 yoda kernel: usb 2-1.1: new full speed USB device using
address 11
Nov 30 12:01:18 yoda kernel: usb 2-1.1: new full speed USB device using
address 12
Nov 30 12:02:04 yoda kernel: ohci_hcd 0001:10:1b.1: wakeup
Nov 30 12:02:04 yoda kernel: usb 3-1: new full speed USB device using address
5
Nov 30 12:02:05 yoda kernel: uba: device 5 capacity nsec 50 bsize 512
Nov 30 12:02:05 yoda kernel: uba: made changed
Nov 30 12:02:05 yoda kernel: uba: device 5 capacity nsec 50 bsize 512
Nov 30 12:02:05 yoda kernel: uba: device 5 capacity nsec 50 bsize 512
Nov 30 12:02:05 yoda kernel: /dev/ub/a:end_request: I/O error, dev uba,
sector 0
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 2
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 4
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 6
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 6
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 4
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 2
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 0
Nov 30 12:02:05 yoda kernel: unable to read partition table
Nov 30 12:02:05 yoda kernel: /dev/ub/a:end_request: I/O error, dev uba,
sector 2
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 4
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 6
Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 0
Nov 30 12:02:05 yoda kernel: unable to read partition table
Nov 30 12:02:05 yoda usb.agent[4698]: ub: already loaded
I don't know what's happening, it's the same when i try to mount the ipod. my
modules are:
usb_storage 107772 0
scsi_mod 69856 3 sd_mod,sg,usb_storage
usbhid 46592 0
hci_usb 11104 2
bluetooth 44100 7 rfcomm,l2cap,hci_usb
usbcore 105204 9
ehci_hcd,ub,ohci_hcd,usb_storage,uhci_hcd,usbhid,hci_usb
Everything seems to be right, uh??
Thanks for your help.
isidoro
^ permalink raw reply
* Re: Mounting usb pendrive
From: Isidoro Reyes de Zuloaga @ 2004-11-30 11:12 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <200411301206.44403.isidoro@qassessorament.net>
whith the 2.6.9 kernel.
i've forgotten.
cheers
isidoro
^ permalink raw reply
* AW: AW: USB driver
From: Martin Krause @ 2004-11-30 12:40 UTC (permalink / raw)
To: zhonglei; +Cc: Linuxppc-embedded
Hi zhonglei,
zhonglei wrotes on Dienstag, 30. November 2004 12:50:
> Thank you!
> After enabled SCSI support and SCSI disk support,I can enable
> USB mass storage devices . I enabled USB mass storage support
> and reboot my kernel.The system run into a deadlock!
Sorry, I haven't tested usb mass storage support on the lite5200,
so I could not tell if it works.
=20
> U-Boot 1.1.2 (Nov 12 2004 - 11:46:06)
>=20
> CPU: MPC5200 v1.2 at 462 MHz
The cpu clock seems a bit fast to me. AFAIR the maximum is 400 MHz
for actual cpu revisions.
> Bus 132 MHz, IPB 132 MHz, PCI 33 MHz
> Board: Motorola MPC5200 (IceCube)
> I2C: 85 kHz, ready
> DRAM: 64 MB
> FLASH: 16 MB
> PCI: Bus Dev VenId DevId Class Int
> 00 1a 1057 5803 0680 00
> In: serial
> Out: serial
> Err: serial
> Net: FEC ETHERNET
> IDE: Bus 0: OK
> Device 0: Model: Flash Card Firm: 2N3-0925 Ser#: CF00000000
> Type: Removable Hard Disk
> Capacity: 123.0 MB =3D 0.1 GB (251904 x 512) Device 1:
> not available=20
>=20
> Autostarting.Press any key to abort..
>=20
> Hit any key to stop autoboot: 0
> Using FEC ETHERNET device
> TFTP from server 198.87.102.60; our IP address is 198.87.102.210
> Filename 'MPC5200/uImage'. Load address: 0x100000
> Loading:
> #################################################################
>=20
> #################################################################
> #################################################
> done
> Bytes transferred =3D 914801 (df571 hex)
> ## Booting image at 00100000 ...
> Image Name: Linux-2.4.25
> Image Type: PowerPC Linux Kernel Image (gzip compressed)
> Data Size: 914737 Bytes =3D 893.3 kB
> Load Address: 00000000
> Entry Point: 00000000
> Verifying Checksum ... OK
> Uncompressing Kernel Image ... OK
>=20
> What can I do next?
A good starting point for error searching is the FAQ-Section in the =
DULG:
http://www.denx.de/twiki/bin/view/DULG/Manual
Regards,
Martin
^ permalink raw reply
* Re: Mounting usb pendrive
From: Mark Ferry @ 2004-11-30 12:38 UTC (permalink / raw)
To: linuxppc-dev list
In-Reply-To: <200411301206.44403.isidoro@qassessorament.net>
Have you compiled in PC BIOS (DOS) partition table support?
CONFIG_MSDOS_PARTITION=y
menuconfig: File Systems | Partition Types | PC BIOS (MS DOS partition
tables) support.
I assume your ipod may well have been fat formatted.
Also note that it's using the UB driver introduced in 2.6.9(?) rather
than the older scsi usb_storage driver.
Many of the features in the old driver may not yet have been implemented
in the UB driver (CONFIG_SCSI_MULTI_LUN equivalent ?!).
The solution is to remove the UB driver from the kernel...
(CONFIG_BLK_DEV_UB)
- Mark
Isidoro Reyes de Zuloaga wrote:
> Hi folks,
> I'm trying to mount my usb pendrive device and i'm getty a strange error
> message. I compiled my kernel with the scsi modules and all the stuff, and i
> can mount it on my x86, but in the powerbook i can't.
> this is the /var/log/messages:
>
> Nov 30 12:01:18 yoda kernel: usb 2-1.1: new full speed USB device using
> address 11
> Nov 30 12:01:18 yoda kernel: usb 2-1.1: new full speed USB device using
> address 12
> Nov 30 12:02:04 yoda kernel: ohci_hcd 0001:10:1b.1: wakeup
> Nov 30 12:02:04 yoda kernel: usb 3-1: new full speed USB device using address
> 5
> Nov 30 12:02:05 yoda kernel: uba: device 5 capacity nsec 50 bsize 512
> Nov 30 12:02:05 yoda kernel: uba: made changed
> Nov 30 12:02:05 yoda kernel: uba: device 5 capacity nsec 50 bsize 512
> Nov 30 12:02:05 yoda kernel: uba: device 5 capacity nsec 50 bsize 512
> Nov 30 12:02:05 yoda kernel: /dev/ub/a:end_request: I/O error, dev uba,
> sector 0
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 2
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 4
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 6
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 6
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 4
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 2
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 0
> Nov 30 12:02:05 yoda kernel: unable to read partition table
> Nov 30 12:02:05 yoda kernel: /dev/ub/a:end_request: I/O error, dev uba,
> sector 2
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 4
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 6
> Nov 30 12:02:05 yoda kernel: end_request: I/O error, dev uba, sector 0
> Nov 30 12:02:05 yoda kernel: unable to read partition table
> Nov 30 12:02:05 yoda usb.agent[4698]: ub: already loaded
>
> I don't know what's happening, it's the same when i try to mount the ipod. my
> modules are:
> usb_storage 107772 0
> scsi_mod 69856 3 sd_mod,sg,usb_storage
> usbhid 46592 0
> hci_usb 11104 2
> bluetooth 44100 7 rfcomm,l2cap,hci_usb
> usbcore 105204 9
> ehci_hcd,ub,ohci_hcd,usb_storage,uhci_hcd,usbhid,hci_usb
>
^ permalink raw reply
* Re: Kernel 2.6.10-rc1 yet not running on ads8272
From: alebas @ 2004-11-30 13:08 UTC (permalink / raw)
To: Mark Chambers; +Cc: linuxppc-embedded
In-Reply-To: <006b01c4d61e$707f2440$0301a8c0@chuck2>
Dan,
I have finally found what I was doing wrong.
Checking mem as you suggested I found that
the breakpoint I was setting to virtual
address 0xc00035f8 has to be set to physical
0x000035f8, otherwise it doesn't stop.
So problem was here with BDI2000 debugging,
MMU and me. Sorry about my misknowledge.
Nevertheless kernel is still hanging.
Now I have continued debugging and I have
arrived to start_kernel ... and go on till
do_basic_setup. But still seeing nothing in
the serial console before kernel hanging.
I think I have some problem with serial
console I have to solve before going on.
Thanks
Alex
Citando Mark Chambers <markc@mail.com>:
> So it's not the simple stuff. Never is.
>
> I probably shouldn't jump in here, I'm over my head,
> but in the spirit of brainstorming: Is there any chance
> the bl load_up_mmu instruction isn't in memory at
> physical address 35f8? It looks like this code is
> bouncing back to physical addressing after having
> the mmu enabled - maybe look at physical
> memory at 35f8 and see if there's a problem?
>
> Mark
>
^ permalink raw reply
* USB driver for ISP1362 very slow
From: Jörg Huwig @ 2004-11-30 15:24 UTC (permalink / raw)
To: Linuxppc-embedded
Hi all,
I'm using an ISP1362 as an USB host controller connected to a MPC880 running
under Linux 2.4.25.
The Driver seems to work fine as I can mount an USB memory stick.
But the performance is very bad. To copy a 1MByte big file from the USB
memory stick to the RAM disk takes about 3 minutes.
Does anyone has experience with the ISP1362 driver in Kernel 2.4.25??
Regards
Joerg Huwig
^ permalink raw reply
* Re: USB driver for ISP1362 very slow
From: Wolfgang Denk @ 2004-11-30 16:24 UTC (permalink / raw)
To: Jörg Huwig; +Cc: Linuxppc-embedded
In-Reply-To: <04113016200014900@intec-isdn.de>
Hello,
in message <04113016200014900@intec-isdn.de> you wrote:
>
> I'm using an ISP1362 as an USB host controller connected to a MPC880 running
> under Linux 2.4.25.
> The Driver seems to work fine as I can mount an USB memory stick.
> But the performance is very bad. To copy a 1MByte big file from the USB
> memory stick to the RAM disk takes about 3 minutes.
Are there any error messages in the log files? Did you try another
USB memory stick, especially any USB 2.0 stick?
> Does anyone has experience with the ISP1362 driver in Kernel 2.4.25??
Sure. We implemented it and tested it with mass storage devices, USB
modems, network adapters and in combination with RNDIS on Windoze.
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
"I find this a nice feature but it is not according to the documen-
tation. Or is it a BUG?" "Let's call it an accidental feature. :-)"
- Larry Wall in <6909@jpl-devvax.JPL.NASA.GOV>
^ permalink raw reply
* Re: [PATCH] Remove 604 perfmon from ppc_htab
From: Tom Rini @ 2004-11-30 21:04 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-dev
In-Reply-To: <F9AAB23C-4254-11D9-A096-000393C30512@freescale.com>
On Mon, Nov 29, 2004 at 04:21:11PM -0600, Andy Fleming wrote:
> This patch removes the 604 performance monitor counters from ppc_htab.
> The reason is that people have said that no one uses them, and ppc_htab
> is not the right place for them. Any objections?
Is all of this properly hooked into oprofile(/is perfmon in -Linus now?)
etc now? If so, this sounds like a fine thing to get into 2.6.11.
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply
* [PATCH][PPC32] Performance Monitor/Oprofile support for e500
From: Kumar Gala @ 2004-11-30 21:21 UTC (permalink / raw)
To: akpm; +Cc: linuxppc-embedded
Andrew,
Adds oprofile support for the e500 PowerPC core.
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
--
diff -Nru a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
--- a/arch/ppc/kernel/Makefile 2004-11-29 15:04:37 -06:00
+++ b/arch/ppc/kernel/Makefile 2004-11-29 15:04:37 -06:00
@@ -14,7 +14,7 @@
obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
process.o signal.o ptrace.o align.o \
semaphore.o syscalls.o setup.o \
- cputable.o ppc_htab.o
+ cputable.o ppc_htab.o perfmon.o
obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
obj-$(CONFIG_POWER4) += cpu_setup_power4.o
obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o
@@ -24,6 +24,7 @@
obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
obj-$(CONFIG_TAU) += temp.o
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
+obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o
ifndef CONFIG_MATH_EMULATION
obj-$(CONFIG_8xx) += softemu8xx.o
diff -Nru a/arch/ppc/kernel/head_e500.S b/arch/ppc/kernel/head_e500.S
--- a/arch/ppc/kernel/head_e500.S 2004-11-29 15:04:37 -06:00
+++ b/arch/ppc/kernel/head_e500.S 2004-11-29 15:04:37 -06:00
@@ -666,7 +666,8 @@
EXCEPTION(0x2050, SPEFloatingPointRound, UnknownException, EXC_XFER_EE)
/* Performance Monitor */
- EXCEPTION(0x2060, PerformanceMonitor, UnknownException, EXC_XFER_EE)
+ EXCEPTION(0x2060, PerformanceMonitor, PerformanceMonitorException, EXC_XFER_STD)
+
/* Debug Interrupt */
DEBUG_EXCEPTION
diff -Nru a/arch/ppc/kernel/perfmon.c b/arch/ppc/kernel/perfmon.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/kernel/perfmon.c 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,94 @@
+/* kernel/perfmon.c
+ * PPC 32 Performance Monitor Infrastructure
+ *
+ * Author: Andy Fleming
+ * Copyright (c) 2004 Freescale Semiconductor, Inc
+ *
+ * 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/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
+#include <linux/ptrace.h>
+#include <linux/slab.h>
+#include <linux/user.h>
+#include <linux/a.out.h>
+#include <linux/interrupt.h>
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/prctl.h>
+
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/reg.h>
+#include <asm/xmon.h>
+
+/* A lock to regulate grabbing the interrupt */
+spinlock_t perfmon_lock = SPIN_LOCK_UNLOCKED;
+
+#ifdef CONFIG_FSL_BOOKE
+static void dummy_perf(struct pt_regs *regs)
+{
+ unsigned int pmgc0 = mfpmr(PMRN_PMGC0);
+
+ pmgc0 &= ~PMGC0_PMIE;
+ mtpmr(PMRN_PMGC0, pmgc0);
+}
+
+#else
+/* Ensure exceptions are disabled */
+#define MMCR0_PMXE (1UL << (31 - 5))
+
+static void dummy_perf(struct pt_regs *regs)
+{
+ unsigned int mmcr0 = mfspr(SPRN_MMCR0);
+
+ mmcr0 &= ~MMCR0_PMXE;
+ mtspr(SPRN_MMCR0, mmcr0);
+}
+#endif
+
+void (*perf_irq)(struct pt_regs *) = dummy_perf;
+
+/* Grab the interrupt, if it's free.
+ * Returns 0 on success, -1 if the interrupt is taken already */
+int request_perfmon_irq(void (*handler)(struct pt_regs *))
+{
+ int err = 0;
+
+ spin_lock(&perfmon_lock);
+
+ if (perf_irq == dummy_perf)
+ perf_irq = handler;
+ else {
+ pr_info("perfmon irq already handled by %p\n", perf_irq);
+ err = -1;
+ }
+
+ spin_unlock(&perfmon_lock);
+
+ return err;
+}
+
+void free_perfmon_irq(void)
+{
+ spin_lock(&perfmon_lock);
+
+ perf_irq = dummy_perf;
+
+ spin_unlock(&perfmon_lock);
+}
+
+EXPORT_SYMBOL(perf_irq);
+EXPORT_SYMBOL(request_perfmon_irq);
+EXPORT_SYMBOL(free_perfmon_irq);
diff -Nru a/arch/ppc/kernel/perfmon_fsl_booke.c b/arch/ppc/kernel/perfmon_fsl_booke.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/kernel/perfmon_fsl_booke.c 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,230 @@
+/* kernel/perfmon_fsl_booke.c
+ * Freescale Book-E Performance Monitor code
+ *
+ * Author: Andy Fleming
+ * Copyright (c) 2004 Freescale Semiconductor, Inc
+ *
+ * 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/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
+#include <linux/ptrace.h>
+#include <linux/slab.h>
+#include <linux/user.h>
+#include <linux/a.out.h>
+#include <linux/interrupt.h>
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/prctl.h>
+
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/reg.h>
+#include <asm/xmon.h>
+
+void init_pmc_stop(int ctr);
+void set_pmc_event(int ctr, int event);
+void set_pmc_user_kernel(int ctr, int user, int kernel);
+void set_pmc_marked(int ctr, int mark0, int mark1);
+void pmc_start_ctr(int ctr, int enable);
+void pmc_start_ctrs(int enable);
+void pmc_stop_ctrs(void);
+void dump_pmcs(void);
+
+static inline u32 get_pmlca(int ctr);
+static inline void set_pmlca(int ctr, u32 pmlca);
+
+static inline u32 get_pmlca(int ctr)
+{
+ u32 pmlca;
+
+ switch (ctr) {
+ case 0:
+ pmlca = mfpmr(PMRN_PMLCA0);
+ break;
+ case 1:
+ pmlca = mfpmr(PMRN_PMLCA1);
+ break;
+ case 2:
+ pmlca = mfpmr(PMRN_PMLCA2);
+ break;
+ case 3:
+ pmlca = mfpmr(PMRN_PMLCA3);
+ break;
+ default:
+ panic("Bad ctr number\n");
+ }
+
+ return pmlca;
+}
+
+static inline void set_pmlca(int ctr, u32 pmlca)
+{
+ switch (ctr) {
+ case 0:
+ mtpmr(PMRN_PMLCA0, pmlca);
+ break;
+ case 1:
+ mtpmr(PMRN_PMLCA1, pmlca);
+ break;
+ case 2:
+ mtpmr(PMRN_PMLCA2, pmlca);
+ break;
+ case 3:
+ mtpmr(PMRN_PMLCA3, pmlca);
+ break;
+ default:
+ panic("Bad ctr number\n");
+ }
+}
+
+void init_pmc_stop(int ctr)
+{
+ u32 pmlca = (PMLCA_FC | PMLCA_FCS | PMLCA_FCU |
+ PMLCA_FCM1 | PMLCA_FCM0);
+ u32 pmlcb = 0;
+
+ switch (ctr) {
+ case 0:
+ mtpmr(PMRN_PMLCA0, pmlca);
+ mtpmr(PMRN_PMLCB0, pmlcb);
+ break;
+ case 1:
+ mtpmr(PMRN_PMLCA1, pmlca);
+ mtpmr(PMRN_PMLCB1, pmlcb);
+ break;
+ case 2:
+ mtpmr(PMRN_PMLCA2, pmlca);
+ mtpmr(PMRN_PMLCB2, pmlcb);
+ break;
+ case 3:
+ mtpmr(PMRN_PMLCA3, pmlca);
+ mtpmr(PMRN_PMLCB3, pmlcb);
+ break;
+ default:
+ panic("Bad ctr number!\n");
+ }
+}
+
+void set_pmc_event(int ctr, int event)
+{
+ u32 pmlca;
+
+ pmlca = get_pmlca(ctr);
+
+ pmlca = (pmlca & ~PMLCA_EVENT_MASK) |
+ ((event << PMLCA_EVENT_SHIFT) &
+ PMLCA_EVENT_MASK);
+
+ set_pmlca(ctr, pmlca);
+}
+
+void set_pmc_user_kernel(int ctr, int user, int kernel)
+{
+ u32 pmlca;
+
+ pmlca = get_pmlca(ctr);
+
+ if(user)
+ pmlca &= ~PMLCA_FCU;
+ else
+ pmlca |= PMLCA_FCU;
+
+ if(kernel)
+ pmlca &= ~PMLCA_FCS;
+ else
+ pmlca |= PMLCA_FCS;
+
+ set_pmlca(ctr, pmlca);
+}
+
+void set_pmc_marked(int ctr, int mark0, int mark1)
+{
+ u32 pmlca = get_pmlca(ctr);
+
+ if(mark0)
+ pmlca &= ~PMLCA_FCM0;
+ else
+ pmlca |= PMLCA_FCM0;
+
+ if(mark1)
+ pmlca &= ~PMLCA_FCM1;
+ else
+ pmlca |= PMLCA_FCM1;
+
+ set_pmlca(ctr, pmlca);
+}
+
+void pmc_start_ctr(int ctr, int enable)
+{
+ u32 pmlca = get_pmlca(ctr);
+
+ pmlca &= ~PMLCA_FC;
+
+ if (enable)
+ pmlca |= PMLCA_CE;
+ else
+ pmlca &= ~PMLCA_CE;
+
+ set_pmlca(ctr, pmlca);
+}
+
+void pmc_start_ctrs(int enable)
+{
+ u32 pmgc0 = mfpmr(PMRN_PMGC0);
+
+ pmgc0 &= ~PMGC0_FAC;
+ pmgc0 |= PMGC0_FCECE;
+
+ if (enable)
+ pmgc0 |= PMGC0_PMIE;
+ else
+ pmgc0 &= ~PMGC0_PMIE;
+
+ mtpmr(PMRN_PMGC0, pmgc0);
+}
+
+void pmc_stop_ctrs(void)
+{
+ u32 pmgc0 = mfpmr(PMRN_PMGC0);
+
+ pmgc0 |= PMGC0_FAC;
+
+ pmgc0 &= ~(PMGC0_PMIE | PMGC0_FCECE);
+
+ mtpmr(PMRN_PMGC0, pmgc0);
+}
+
+void dump_pmcs(void)
+{
+ printk("pmgc0: %x\n", mfpmr(PMRN_PMGC0));
+ printk("pmc\t\tpmlca\t\tpmlcb\n");
+ printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC0),
+ mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
+ printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC1),
+ mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
+ printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC2),
+ mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
+ printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC3),
+ mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
+}
+
+EXPORT_SYMBOL(init_pmc_stop);
+EXPORT_SYMBOL(set_pmc_event);
+EXPORT_SYMBOL(set_pmc_user_kernel);
+EXPORT_SYMBOL(set_pmc_marked);
+EXPORT_SYMBOL(pmc_start_ctr);
+EXPORT_SYMBOL(pmc_start_ctrs);
+EXPORT_SYMBOL(pmc_stop_ctrs);
+EXPORT_SYMBOL(dump_pmcs);
diff -Nru a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
--- a/arch/ppc/kernel/traps.c 2004-11-29 15:04:37 -06:00
+++ b/arch/ppc/kernel/traps.c 2004-11-29 15:04:37 -06:00
@@ -71,6 +71,7 @@
* Trap & Exception support
*/
+extern void (*perf_irq)(struct pt_regs *);
spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
@@ -725,6 +726,11 @@
}
}
#endif /* CONFIG_ALTIVEC */
+
+void PerformanceMonitorException(struct pt_regs *regs)
+{
+ perf_irq(regs);
+}
#ifdef CONFIG_FSL_BOOKE
void CacheLockingException(struct pt_regs *regs, unsigned long address,
diff -Nru a/arch/ppc/oprofile/Makefile b/arch/ppc/oprofile/Makefile
--- a/arch/ppc/oprofile/Makefile 2004-11-29 15:04:37 -06:00
+++ b/arch/ppc/oprofile/Makefile 2004-11-29 15:04:37 -06:00
@@ -6,4 +6,4 @@
oprofilefs.o oprofile_stats.o \
timer_int.o )
-oprofile-y := $(DRIVER_OBJS) init.o
+oprofile-y := $(DRIVER_OBJS) common.o op_model_fsl_booke.o
diff -Nru a/arch/ppc/oprofile/common.c b/arch/ppc/oprofile/common.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/oprofile/common.c 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,163 @@
+/*
+ * PPC 32 oprofile support
+ * Based on PPC64 oprofile support
+ * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
+ *
+ * Copyright (C) Freescale Semiconductor, Inc 2004
+ *
+ * Author: Andy Fleming
+ *
+ * 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/oprofile.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/errno.h>
+#include <asm/ptrace.h>
+#include <asm/system.h>
+#include <asm/perfmon.h>
+#include <asm/cputable.h>
+
+#include "op_impl.h"
+
+extern struct op_ppc32_model op_model_fsl_booke;
+static struct op_ppc32_model *model;
+
+static struct op_counter_config ctr[OP_MAX_COUNTER];
+static struct op_system_config sys;
+
+static void op_handle_interrupt(struct pt_regs *regs)
+{
+ model->handle_interrupt(regs, ctr);
+}
+
+static int op_ppc32_setup(void)
+{
+ /* Install our interrupt handler into the existing hook. */
+ if(request_perfmon_irq(&op_handle_interrupt))
+ return -EBUSY;
+
+ mb();
+
+ /* Pre-compute the values to stuff in the hardware registers. */
+ model->reg_setup(ctr, &sys, model->num_counters);
+
+#if 0
+ /* FIXME: Make multi-cpu work */
+ /* Configure the registers on all cpus. */
+ on_each_cpu(model->reg_setup, NULL, 0, 1);
+#endif
+
+ return 0;
+}
+
+static void op_ppc32_shutdown(void)
+{
+ mb();
+
+ /* Remove our interrupt handler. We may be removing this module. */
+ free_perfmon_irq();
+}
+
+static void op_ppc32_cpu_start(void *dummy)
+{
+ model->start(ctr);
+}
+
+static int op_ppc32_start(void)
+{
+ on_each_cpu(op_ppc32_cpu_start, NULL, 0, 1);
+ return 0;
+}
+
+static inline void op_ppc32_cpu_stop(void *dummy)
+{
+ model->stop();
+}
+
+static void op_ppc32_stop(void)
+{
+ on_each_cpu(op_ppc32_cpu_stop, NULL, 0, 1);
+}
+
+static int op_ppc32_create_files(struct super_block *sb, struct dentry *root)
+{
+ int i;
+
+ for (i = 0; i < model->num_counters; ++i) {
+ struct dentry *dir;
+ char buf[3];
+
+ snprintf(buf, sizeof buf, "%d", i);
+ dir = oprofilefs_mkdir(sb, root, buf);
+
+ oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
+ oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
+ oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
+ oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
+ oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
+
+ /* FIXME: Not sure if this is used */
+ oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
+ }
+
+ oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel);
+ oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user);
+
+ /* Default to tracing both kernel and user */
+ sys.enable_kernel = 1;
+ sys.enable_user = 1;
+
+ return 0;
+}
+
+static struct oprofile_operations oprof_ppc32_ops = {
+ .create_files = op_ppc32_create_files,
+ .setup = op_ppc32_setup,
+ .shutdown = op_ppc32_shutdown,
+ .start = op_ppc32_start,
+ .stop = op_ppc32_stop,
+ .cpu_type = NULL /* To be filled in below. */
+};
+
+int __init oprofile_arch_init(struct oprofile_operations **ops)
+{
+ char *name;
+ int cpu_id = smp_processor_id();
+
+#ifdef CONFIG_FSL_BOOKE
+ model = &op_model_fsl_booke;
+#else
+ printk(KERN_ERR "oprofile enabled on unsupported processor!\n");
+ return -ENODEV;
+#endif
+
+ name = kmalloc(32, GFP_KERNEL);
+
+ if (NULL == name)
+ return -ENOMEM;
+
+ sprintf(name, "ppc/%s", cur_cpu_spec[cpu_id]->cpu_name);
+
+ oprof_ppc32_ops.cpu_type = name;
+
+ model->num_counters = cur_cpu_spec[cpu_id]->num_pmcs;
+
+ *ops = &oprof_ppc32_ops;
+
+ printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
+ oprof_ppc32_ops.cpu_type);
+
+ return 0;
+}
+
+void oprofile_arch_exit(void)
+{
+ kfree(oprof_ppc32_ops.cpu_type);
+ oprof_ppc32_ops.cpu_type = NULL;
+}
diff -Nru a/arch/ppc/oprofile/init.c b/arch/ppc/oprofile/init.c
--- a/arch/ppc/oprofile/init.c 2004-11-29 15:04:37 -06:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,23 +0,0 @@
-/**
- * @file init.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- */
-
-#include <linux/kernel.h>
-#include <linux/oprofile.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-
-int __init oprofile_arch_init(struct oprofile_operations ** ops)
-{
- return -ENODEV;
-}
-
-
-void oprofile_arch_exit(void)
-{
-}
diff -Nru a/arch/ppc/oprofile/op_impl.h b/arch/ppc/oprofile/op_impl.h
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/oprofile/op_impl.h 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
+ *
+ * Based on alpha version.
+ *
+ * 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.
+ */
+
+#ifndef OP_IMPL_H
+#define OP_IMPL_H 1
+
+#define OP_MAX_COUNTER 8
+
+/* Per-counter configuration as set via oprofilefs. */
+struct op_counter_config {
+ unsigned long enabled;
+ unsigned long event;
+ unsigned long count;
+ unsigned long kernel;
+ unsigned long user;
+ unsigned long unit_mask;
+};
+
+/* System-wide configuration as set via oprofilefs. */
+struct op_system_config {
+ unsigned long enable_kernel;
+ unsigned long enable_user;
+};
+
+/* Per-arch configuration */
+struct op_ppc32_model {
+ void (*reg_setup) (struct op_counter_config *,
+ struct op_system_config *,
+ int num_counters);
+ void (*start) (struct op_counter_config *);
+ void (*stop) (void);
+ void (*handle_interrupt) (struct pt_regs *,
+ struct op_counter_config *);
+ int num_counters;
+};
+
+#endif /* OP_IMPL_H */
diff -Nru a/arch/ppc/oprofile/op_model_fsl_booke.c b/arch/ppc/oprofile/op_model_fsl_booke.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/oprofile/op_model_fsl_booke.c 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,185 @@
+/*
+ * oprofile/op_model_e500.c
+ *
+ * Freescale Book-E oprofile support, based on ppc64 oprofile support
+ * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
+ *
+ * Copyright (c) 2004 Freescale Semiconductor, Inc
+ *
+ * Author: Andy Fleming
+ * Maintainer: Kumar Gala <Kumar.Gala@freescale.com>
+ *
+ * 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/oprofile.h>
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <asm/ptrace.h>
+#include <asm/system.h>
+#include <asm/processor.h>
+#include <asm/cputable.h>
+#include <asm/reg_booke.h>
+#include <asm/page.h>
+#include <asm/perfmon.h>
+
+#include "op_impl.h"
+
+static unsigned long reset_value[OP_MAX_COUNTER];
+
+static int num_counters;
+static int oprofile_running;
+
+static inline unsigned int ctr_read(unsigned int i)
+{
+ switch(i) {
+ case 0:
+ return mfpmr(PMRN_PMC0);
+ case 1:
+ return mfpmr(PMRN_PMC1);
+ case 2:
+ return mfpmr(PMRN_PMC2);
+ case 3:
+ return mfpmr(PMRN_PMC3);
+ default:
+ return 0;
+ }
+}
+
+static inline void ctr_write(unsigned int i, unsigned int val)
+{
+ switch(i) {
+ case 0:
+ mtpmr(PMRN_PMC0, val);
+ break;
+ case 1:
+ mtpmr(PMRN_PMC1, val);
+ break;
+ case 2:
+ mtpmr(PMRN_PMC2, val);
+ break;
+ case 3:
+ mtpmr(PMRN_PMC3, val);
+ break;
+ default:
+ break;
+ }
+}
+
+
+static void fsl_booke_reg_setup(struct op_counter_config *ctr,
+ struct op_system_config *sys,
+ int num_ctrs)
+{
+ int i;
+
+ num_counters = num_ctrs;
+
+ /* freeze all counters */
+ pmc_stop_ctrs();
+
+ /* Our counters count up, and "count" refers to
+ * how much before the next interrupt, and we interrupt
+ * on overflow. So we calculate the starting value
+ * which will give us "count" until overflow.
+ * Then we set the events on the enabled counters */
+ for (i = 0; i < num_counters; ++i) {
+ reset_value[i] = 0x80000000UL - ctr[i].count;
+
+ init_pmc_stop(i);
+
+ set_pmc_event(i, ctr[i].event);
+
+ set_pmc_user_kernel(i, ctr[i].user, ctr[i].kernel);
+ }
+}
+
+static void fsl_booke_start(struct op_counter_config *ctr)
+{
+ int i;
+
+ mtmsr(mfmsr() | MSR_PMM);
+
+ for (i = 0; i < num_counters; ++i) {
+ if (ctr[i].enabled) {
+ ctr_write(i, reset_value[i]);
+ /* Set Each enabled counterd to only
+ * count when the Mark bit is not set */
+ set_pmc_marked(i, 1, 0);
+ pmc_start_ctr(i, 1);
+ } else {
+ ctr_write(i, 0);
+
+ /* Set the ctr to be stopped */
+ pmc_start_ctr(i, 0);
+ }
+ }
+
+ /* Clear the freeze bit, and enable the interrupt.
+ * The counters won't actually start until the rfi clears
+ * the PMM bit */
+ pmc_start_ctrs(1);
+
+ oprofile_running = 1;
+
+ pr_debug("start on cpu %d, pmgc0 %x\n", smp_processor_id(),
+ mfpmr(PMRN_PMGC0));
+}
+
+static void fsl_booke_stop(void)
+{
+ /* freeze counters */
+ pmc_stop_ctrs();
+
+ oprofile_running = 0;
+
+ pr_debug("stop on cpu %d, pmgc0 %x\n", smp_processor_id(),
+ mfpmr(PMRN_PMGC0));
+
+ mb();
+}
+
+
+static void fsl_booke_handle_interrupt(struct pt_regs *regs,
+ struct op_counter_config *ctr)
+{
+ unsigned long pc;
+ int is_kernel;
+ int val;
+ int i;
+ unsigned int cpu = smp_processor_id();
+
+ /* set the PMM bit (see comment below) */
+ mtmsr(mfmsr() | MSR_PMM);
+
+ pc = regs->nip;
+ is_kernel = (pc >= KERNELBASE);
+
+ for (i = 0; i < num_counters; ++i) {
+ val = ctr_read(i);
+ if (val < 0) {
+ if (oprofile_running && ctr[i].enabled) {
+ oprofile_add_sample(pc, is_kernel, i, cpu);
+ ctr_write(i, reset_value[i]);
+ } else {
+ ctr_write(i, 0);
+ }
+ }
+ }
+
+ /* The freeze bit was set by the interrupt. */
+ /* Clear the freeze bit, and reenable the interrupt.
+ * The counters won't actually start until the rfi clears
+ * the PMM bit */
+ pmc_start_ctrs(1);
+}
+
+struct op_ppc32_model op_model_fsl_booke = {
+ .reg_setup = fsl_booke_reg_setup,
+ .start = fsl_booke_start,
+ .stop = fsl_booke_stop,
+ .handle_interrupt = fsl_booke_handle_interrupt,
+};
diff -Nru a/include/asm-ppc/perfmon.h b/include/asm-ppc/perfmon.h
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/include/asm-ppc/perfmon.h 2004-11-29 15:04:37 -06:00
@@ -0,0 +1,18 @@
+#ifndef __PERFMON_H
+#define __PERFMON_H
+
+int request_perfmon_irq(void (*handler)(struct pt_regs *));
+void free_perfmon_irq(void);
+
+#ifdef CONFIG_FSL_BOOKE
+void init_pmc_stop(int ctr);
+void set_pmc_event(int ctr, int event);
+void set_pmc_user_kernel(int ctr, int user, int kernel);
+void set_pmc_marked(int ctr, int mark0, int mark1);
+void pmc_start_ctr(int ctr, int enable);
+void pmc_start_ctrs(int enable);
+void pmc_stop_ctrs(void);
+void dump_pmcs(void);
+#endif
+
+#endif /* __PERFMON_H */
diff -Nru a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
--- a/include/asm-ppc/reg_booke.h 2004-11-29 15:04:37 -06:00
+++ b/include/asm-ppc/reg_booke.h 2004-11-29 15:04:37 -06:00
@@ -51,6 +51,59 @@
#define mtpmr(rn, v) asm volatile("mtpmr " __stringify(rn) ",%0" : : "r" (v))
#endif /* __ASSEMBLY__ */
+/* Freescale Book E Performance Monitor APU Registers */
+#define PMRN_PMC0 0x010 /* Performance Monitor Counter 0 */
+#define PMRN_PMC1 0x011 /* Performance Monitor Counter 1 */
+#define PMRN_PMC2 0x012 /* Performance Monitor Counter 1 */
+#define PMRN_PMC3 0x013 /* Performance Monitor Counter 1 */
+#define PMRN_PMLCA0 0x090 /* PM Local Control A0 */
+#define PMRN_PMLCA1 0x091 /* PM Local Control A1 */
+#define PMRN_PMLCA2 0x092 /* PM Local Control A2 */
+#define PMRN_PMLCA3 0x093 /* PM Local Control A3 */
+
+#define PMLCA_FC 0x80000000 /* Freeze Counter */
+#define PMLCA_FCS 0x40000000 /* Freeze in Supervisor */
+#define PMLCA_FCU 0x20000000 /* Freeze in User */
+#define PMLCA_FCM1 0x10000000 /* Freeze when PMM==1 */
+#define PMLCA_FCM0 0x08000000 /* Freeze when PMM==0 */
+#define PMLCA_CE 0x04000000 /* Condition Enable */
+
+#define PMLCA_EVENT_MASK 0x007f0000 /* Event field */
+#define PMLCA_EVENT_SHIFT 16
+
+#define PMRN_PMLCB0 0x110 /* PM Local Control B0 */
+#define PMRN_PMLCB1 0x111 /* PM Local Control B1 */
+#define PMRN_PMLCB2 0x112 /* PM Local Control B2 */
+#define PMRN_PMLCB3 0x113 /* PM Local Control B3 */
+
+#define PMLCB_THRESHMUL_MASK 0x0700 /* Threshhold Multiple Field */
+#define PMLCB_THRESHMUL_SHIFT 8
+
+#define PMLCB_THRESHOLD_MASK 0x003f /* Threshold Field */
+#define PMLCB_THRESHOLD_SHIFT 0
+
+#define PMRN_PMGC0 0x190 /* PM Global Control 0 */
+
+#define PMGC0_FAC 0x80000000 /* Freeze all Counters */
+#define PMGC0_PMIE 0x40000000 /* Interrupt Enable */
+#define PMGC0_FCECE 0x20000000 /* Freeze countes on
+ Enabled Condition or
+ Event */
+
+#define PMRN_UPMC0 0x000 /* User Performance Monitor Counter 0 */
+#define PMRN_UPMC1 0x001 /* User Performance Monitor Counter 1 */
+#define PMRN_UPMC2 0x002 /* User Performance Monitor Counter 1 */
+#define PMRN_UPMC3 0x003 /* User Performance Monitor Counter 1 */
+#define PMRN_UPMLCA0 0x080 /* User PM Local Control A0 */
+#define PMRN_UPMLCA1 0x081 /* User PM Local Control A1 */
+#define PMRN_UPMLCA2 0x082 /* User PM Local Control A2 */
+#define PMRN_UPMLCA3 0x083 /* User PM Local Control A3 */
+#define PMRN_UPMLCB0 0x100 /* User PM Local Control B0 */
+#define PMRN_UPMLCB1 0x101 /* User PM Local Control B1 */
+#define PMRN_UPMLCB2 0x102 /* User PM Local Control B2 */
+#define PMRN_UPMLCB3 0x103 /* User PM Local Control B3 */
+#define PMRN_UPMGC0 0x180 /* User PM Global Control 0 */
+
/* Machine State Register (MSR) Fields */
#define MSR_UCLE (1<<26) /* User-mode cache lock enable */
^ permalink raw reply
* Implementing PowerManagment for a ppc target
From: Sylvain Munaut @ 2004-11-30 21:40 UTC (permalink / raw)
To: Linux PPC Dev
Hi,
I'm trying to implement Deep Sleep support for a ppc platform based on
5200 and I have some questions :
- How should I "integrate" it to linux, what the proper way ? I've been
trying #defining CONFIG_PM and
using the set_pm_ops operation but my call backs never get called
when doing a echo standby > /sys/power/state
It justs says :
$ echo standby >
/sys/power/state
Stopping tasks:
===
stopping tasks failed (2 tasks
remaining)
Restarting tasks...<6> Strange, init not
stopped
Strange, sh not
stopped
done
Stopping tasks:
===
stopping tasks failed (2 tasks
remaining)
Restarting tasks...<6> Strange, init not
stopped
Strange, sh not
stopped
done
I've been trying to look at Documentation/ and the sources but still I'm
not sure ...
- How can I ensure that one of my function runs out of I Cache ? Some
pieces of assembler needs to not
acces memory when the last 'orders' are sent. Does just keeping it
small and aligned enough ?
Thanks,
Sylvain Munaut
^ permalink raw reply
* Keyboad blacklight on new powerbook
From: Isidoro Reyes de Zuloaga @ 2004-11-30 21:40 UTC (permalink / raw)
To: linuxppc-dev list
Hi folks,
I'm trying to get the blacklight on my new powerbook. I installed pbbuttonsd
and also powerprefs. The sound and the light of the LCD screen works fine,
but i can get the blacklight working.
I've doing some research at google and it seems that the new powerbooks (I
bought it two months ago) are different than the others.
Does anyone know how to enable the keyboard light??? Also, the powerprefs
(last version), don't let me to change anything about this. I mean, the
blacklighting part is grey, like i can't edit.
Anyway, i edited the pbbuttonsd.conf (quite simple) but is not working. On the
macOS works fine.
Any clues?
Thanks in advance.
isidoro
^ 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