* General question on upgrading Linux version
From: Bizhan Gholikhamseh (bgholikh) @ 2007-06-20 21:29 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 351 bytes --]
Hi All,
We are using MPC8541 processor from freescale. Our current kernel
version is based on 2.6.11 plus some patches provided by Freescale. I
would like to update our Kernel version to a more recent version.
I would greatly appreciate if you could provide me with some general
guideline on how to proceed .....
Many thanks in advance,
B
[-- Attachment #2: Type: text/html, Size: 1083 bytes --]
^ permalink raw reply
* Re: General question on upgrading Linux version
From: Andy Fleming @ 2007-06-20 21:52 UTC (permalink / raw)
To: Bizhan Gholikhamseh; +Cc: linuxppc-embedded
In-Reply-To: <F795765B112E7344AF36AA911279641502D1A3FA@xmb-sjc-212.amer.cisco.com>
On Jun 20, 2007, at 16:29, Bizhan Gholikhamseh ((bgholikh)) wrote:
> Hi All,
> We are using MPC8541 processor from freescale. Our current kernel
> version is based on 2.6.11 plus some patches provided by Freescale.
> I would like to update our Kernel version to a more recent version.
> I would greatly appreciate if you could provide me with some
> general guideline on how to proceed .....
You should be able to check out the latest sources from git://
git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
You will probably also need a newer u-boot from here:
git://www.denx.de/git/u-boot-mpc85xx.git
Please tell me if you have any problems using these.
Andy
^ permalink raw reply
* RE: General question on upgrading Linux version
From: Bizhan Gholikhamseh (bgholikh) @ 2007-06-20 21:53 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-embedded
In-Reply-To: <33351C82-D56D-4414-81F1-328D36A7993D@freescale.com>
=20
> -----Original Message-----
> From: Andy Fleming [mailto:afleming@freescale.com]=20
> Sent: Wednesday, June 20, 2007 2:52 PM
> To: Bizhan Gholikhamseh (bgholikh)
> Cc: linuxppc-embedded@ozlabs.org
> Subject: Re: General question on upgrading Linux version
>=20
>=20
> On Jun 20, 2007, at 16:29, Bizhan Gholikhamseh ((bgholikh)) wrote:
>=20
> > Hi All,
> > We are using MPC8541 processor from freescale. Our current kernel=20
> > version is based on 2.6.11 plus some patches provided by Freescale.
> > I would like to update our Kernel version to a more recent version.
> > I would greatly appreciate if you could provide me with=20
> some general=20
> > guideline on how to proceed .....
>=20
> You should be able to check out the latest sources from=20
> git:// git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
>=20
> You will probably also need a newer u-boot from here:
>=20
> git://www.denx.de/git/u-boot-mpc85xx.git
>=20
> Please tell me if you have any problems using these.
Thanks will do.
>=20
> Andy
>=20
^ permalink raw reply
* Re: [PATCH/RFC] Modify sched_clock() to make CONFIG_PRINTK_TIME more sane.
From: Tony Breeds @ 2007-06-21 4:29 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Olof Johansson, LinuxPPC-dev
In-Reply-To: <Pine.LNX.4.62.0706200936300.27011@pademelon.sonytel.be>
On Wed, Jun 20, 2007 at 09:37:51AM +0200, Geert Uytterhoeven wrote:
Hi Geert,
> Just wondering, does the INITIAL_JIFFIES mechanism to catch wrap bugs still
> work after this patch?
>
> include/linux/jiffies.h:
> | /*
> | * Have the 32 bit jiffies value wrap 5 minutes after boot
> | * so jiffies wrap bugs show up earlier.
> | */
> | #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ))
I've done a quick check and I can't see how my patch would break
anything, given that sched_clock() on powerpc returns a timebase value
generally not related to jiffies.
I hope I haven't missed anything.
Yours Tony
linux.conf.au http://linux.conf.au/ || http://lca2008.linux.org.au/
Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
^ permalink raw reply
* Re: [PATCH/RFC] Make certain timekeeping variables __read_mostly
From: Tony Breeds @ 2007-06-21 4:41 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: LinuxPPC-dev
In-Reply-To: <Pine.LNX.4.62.0706200940260.27011@pademelon.sonytel.be>
On Wed, Jun 20, 2007 at 09:41:47AM +0200, Geert Uytterhoeven wrote:
Hi Geert,
> There's no __read_mostly support for powerpc yet (is there?), so __read_mostly
> just expands to nothing?
That's true but we may in the future! :)
Perhaps something like the patch below will start discussion.
From: Tony Breeds <tony@bakeyournoodle.com>
Initial cut to add __read_mostly support for powerpc.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
arch/powerpc/kernel/vmlinux.lds.S | 6 ++++++
include/asm-powerpc/cache.h | 2 ++
2 files changed, 8 insertions(+)
Index: working/arch/powerpc/kernel/vmlinux.lds.S
===================================================================
--- working.orig/arch/powerpc/kernel/vmlinux.lds.S
+++ working/arch/powerpc/kernel/vmlinux.lds.S
@@ -7,6 +7,7 @@
#define PROVIDE32(x) PROVIDE(x)
#endif
#include <asm-generic/vmlinux.lds.h>
+#include <asm/cache.h>
ENTRY(_stext)
@@ -211,6 +212,11 @@ SECTIONS
*(.data.cacheline_aligned)
}
+ . = ALIGN(L1_CACHE_BYTES);
+ .data.read_mostly : {
+ *(.data.read_mostly)
+ }
+
. = ALIGN(PAGE_SIZE);
__data_nosave : {
__nosave_begin = .;
Index: working/include/asm-powerpc/cache.h
===================================================================
--- working.orig/include/asm-powerpc/cache.h
+++ working/include/asm-powerpc/cache.h
@@ -34,5 +34,9 @@ struct ppc64_caches {
extern struct ppc64_caches ppc64_caches;
#endif /* __powerpc64__ && ! __ASSEMBLY__ */
+#if !defined(__ASSEMBLY__)
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#endif
+
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_CACHE_H */
Yours Tony
linux.conf.au http://linux.conf.au/ || http://lca2008.linux.org.au/
Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
^ permalink raw reply
* [PATCH] mpc52xx: sparse fixes
From: Domen Puncer @ 2007-06-21 7:45 UTC (permalink / raw)
To: linuxppc-embedded
sparse caught these static functions / __iomem annotations
under arch/powerpc/platform/52xx/
Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
---
arch/powerpc/platforms/52xx/efika.c | 4 ++--
arch/powerpc/platforms/52xx/lite5200.c | 2 +-
arch/powerpc/platforms/52xx/mpc52xx_pm.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
Index: work-powerpc.git/arch/powerpc/platforms/52xx/efika.c
===================================================================
--- work-powerpc.git.orig/arch/powerpc/platforms/52xx/efika.c
+++ work-powerpc.git/arch/powerpc/platforms/52xx/efika.c
@@ -83,7 +83,7 @@ static struct pci_ops rtas_pci_ops = {
};
-void __init efika_pcisetup(void)
+static void __init efika_pcisetup(void)
{
const int *bus_range;
int len;
@@ -145,7 +145,7 @@ void __init efika_pcisetup(void)
}
#else
-void __init efika_pcisetup(void)
+static void __init efika_pcisetup(void)
{}
#endif
Index: work-powerpc.git/arch/powerpc/platforms/52xx/lite5200.c
===================================================================
--- work-powerpc.git.orig/arch/powerpc/platforms/52xx/lite5200.c
+++ work-powerpc.git/arch/powerpc/platforms/52xx/lite5200.c
@@ -158,7 +158,7 @@ static void __init lite5200_setup_arch(v
}
-void lite5200_show_cpuinfo(struct seq_file *m)
+static void lite5200_show_cpuinfo(struct seq_file *m)
{
struct device_node* np = of_find_all_nodes(NULL);
const char *model = NULL;
Index: work-powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_pm.c
===================================================================
--- work-powerpc.git.orig/arch/powerpc/platforms/52xx/mpc52xx_pm.c
+++ work-powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_pm.c
@@ -9,8 +9,8 @@
/* these are defined in mpc52xx_sleep.S, and only used here */
-extern void mpc52xx_deep_sleep(void *sram, void *sdram_regs,
- struct mpc52xx_cdm *, struct mpc52xx_intr *);
+extern void mpc52xx_deep_sleep(void __iomem *sram, void __iomem *sdram_regs,
+ struct mpc52xx_cdm __iomem *, struct mpc52xx_intr __iomem*);
extern void mpc52xx_ds_sram(void);
extern const long mpc52xx_ds_sram_size;
extern void mpc52xx_ds_cached(void);
@@ -21,7 +21,7 @@ static void __iomem *sdram;
static struct mpc52xx_cdm __iomem *cdm;
static struct mpc52xx_intr __iomem *intr;
static struct mpc52xx_gpio_wkup __iomem *gpiow;
-static void *sram;
+static void __iomem *sram;
static int sram_size;
struct mpc52xx_suspend mpc52xx_suspend;
@@ -100,7 +100,7 @@ int mpc52xx_pm_enter(suspend_state_t sta
u32 clk_enables;
u32 msr, hid0;
u32 intr_main_mask;
- void __iomem * irq_0x500 = (void *)CONFIG_KERNEL_START + 0x500;
+ void __iomem * irq_0x500 = (void __iomem *)CONFIG_KERNEL_START + 0x500;
unsigned long irq_0x500_stop = (unsigned long)irq_0x500 + mpc52xx_ds_cached_size;
char saved_0x500[mpc52xx_ds_cached_size];
^ permalink raw reply
* Fujitsu MB86276 (Lime) graphic controller
From: Igor Luri @ 2007-06-21 9:17 UTC (permalink / raw)
To: linuxppc-embedded
Hi all.
We are planning to use Fujitsu's Lime graphic controller in a custom
board based in MPC5200B processor. Lime is based on the 'Coral' device
family, and Linux 2.4.x kernel from Denx supports Coral P controller.
¿Someone has modified Coral P driver to support Lime? ¿Someone knows
how to do it?
Microsys offers MPX5200G board with a MPC5200B processor and Fujitsu's
Lime graphic controller running Linux 2.6, but we haven't found any
Fujitsu's Lime driver.
http://www.microsys.de/index.php?p=Products/miriac_Modules/CPU_Modules/MPX5200G
http://www.microsys.de/index.php?p=News/Linux_2.6
Any reference would be welcome.
Best regards.
^ permalink raw reply
* [patch 0/5] cell: cpufreq and pmi patches
From: Christian Krafft @ 2007-06-21 11:09 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org, krafft
[-- Attachment #1: Type: text/plain, Size: 482 bytes --]
Hi,
The following patches contain fixes in the cbe_cpufreq
driver and the pmi driver.
There are some minor bugfixes, but most of it is cleanup stuff.
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [patch 1/5] cell: pmi remove support for mutiple devices.
From: Christian Krafft @ 2007-06-21 11:16 UTC (permalink / raw)
To: Christian Krafft; +Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
In-Reply-To: <20070621130944.083f8fa5@localhost>
[-- Attachment #1: Type: text/plain, Size: 8477 bytes --]
From: Christian Krafft <krafft@de.ibm.com>
The pmi driver got simplified by removing support for multiple devices.
As there is no more than one pmi device per maschine, there is no need to
specify the device for listening and sending messages.
This way the caller (cbe_cpufreq) doesn't need to scan the device tree.
When registering the handler on a board without a pmi
interface, pmi.c will just return -ENODEV.
Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Index: linux/arch/powerpc/platforms/cell/cbe_cpufreq.c
===================================================================
--- linux.orig/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ linux/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -68,12 +68,14 @@ static u64 MIC_Slow_Next_Timer_table[] =
};
static unsigned int pmi_frequency_limit = 0;
+
/*
* hardware specific functions
*/
-static struct of_device *pmi_dev;
+static bool cbe_cpufreq_has_pmi;
+#ifdef CONFIG_PPC_PMI
static int set_pmode_pmi(int cpu, unsigned int pmode)
{
int ret;
@@ -90,7 +92,7 @@ static int set_pmode_pmi(int cpu, unsign
time = (u64) get_cycles();
#endif
- pmi_send_message(pmi_dev, pmi_msg);
+ pmi_send_message(pmi_msg);
ret = pmi_msg.data2;
pr_debug("PMI returned slow mode %d\n", ret);
@@ -102,7 +104,7 @@ static int set_pmode_pmi(int cpu, unsign
#endif
return ret;
}
-
+#endif
static int get_pmode(int cpu)
{
@@ -156,14 +158,16 @@ static int set_pmode_reg(int cpu, unsign
return 0;
}
-static int set_pmode(int cpu, unsigned int slow_mode) {
- if (pmi_dev)
+static int set_pmode(int cpu, unsigned int slow_mode)
+{
+#ifdef CONFIG_PPC_PMI
+ if (cbe_cpufreq_has_pmi)
return set_pmode_pmi(cpu, slow_mode);
- else
- return set_pmode_reg(cpu, slow_mode);
+#endif
+ return set_pmode_reg(cpu, slow_mode);
}
-static void cbe_cpufreq_handle_pmi(struct of_device *dev, pmi_message_t pmi_msg)
+static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg)
{
u8 cpu;
u8 cbe_pmode_new;
@@ -250,7 +254,7 @@ static int cbe_cpufreq_cpu_init(struct c
cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu);
- if (pmi_dev) {
+ if (cbe_cpufreq_has_pmi) {
/* frequency might get limited later, initialize limit with max_freq */
pmi_frequency_limit = max_freq;
cpufreq_register_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
@@ -262,7 +266,7 @@ static int cbe_cpufreq_cpu_init(struct c
static int cbe_cpufreq_cpu_exit(struct cpufreq_policy *policy)
{
- if (pmi_dev)
+ if (cbe_cpufreq_has_pmi)
cpufreq_unregister_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
cpufreq_frequency_table_put_attr(policy->cpu);
@@ -323,27 +327,20 @@ static struct cpufreq_driver cbe_cpufreq
static int __init cbe_cpufreq_init(void)
{
- struct device_node *np;
-
if (!machine_is(cell))
return -ENODEV;
- np = of_find_node_by_type(NULL, "ibm,pmi");
-
- pmi_dev = of_find_device_by_node(np);
-
- if (pmi_dev)
- pmi_register_handler(pmi_dev, &cbe_pmi_handler);
+ cbe_cpufreq_has_pmi = pmi_register_handler(&cbe_pmi_handler) == 0;
return cpufreq_register_driver(&cbe_cpufreq_driver);
}
static void __exit cbe_cpufreq_exit(void)
{
- if (pmi_dev)
- pmi_unregister_handler(pmi_dev, &cbe_pmi_handler);
-
cpufreq_unregister_driver(&cbe_cpufreq_driver);
+
+ if (cbe_cpufreq_has_pmi)
+ pmi_unregister_handler(&cbe_pmi_handler);
}
module_init(cbe_cpufreq_init);
Index: linux/arch/powerpc/sysdev/pmi.c
===================================================================
--- linux.orig/arch/powerpc/sysdev/pmi.c
+++ linux/arch/powerpc/sysdev/pmi.c
@@ -48,15 +48,13 @@ struct pmi_data {
struct work_struct work;
};
+static struct pmi_data *data;
static int pmi_irq_handler(int irq, void *dev_id)
{
- struct pmi_data *data;
u8 type;
int rc;
- data = dev_id;
-
spin_lock(&data->pmi_spinlock);
type = ioread8(data->pmi_reg + PMI_READ_TYPE);
@@ -111,16 +109,13 @@ MODULE_DEVICE_TABLE(of, pmi_match);
static void pmi_notify_handlers(struct work_struct *work)
{
- struct pmi_data *data;
struct pmi_handler *handler;
- data = container_of(work, struct pmi_data, work);
-
spin_lock(&data->handler_spinlock);
list_for_each_entry(handler, &data->handler, node) {
pr_debug(KERN_INFO "pmi: notifying handler %p\n", handler);
if (handler->type == data->msg.type)
- handler->handle_pmi_message(data->dev, data->msg);
+ handler->handle_pmi_message(data->msg);
}
spin_unlock(&data->handler_spinlock);
}
@@ -129,9 +124,14 @@ static int pmi_of_probe(struct of_device
const struct of_device_id *match)
{
struct device_node *np = dev->node;
- struct pmi_data *data;
int rc;
+ if (data) {
+ printk(KERN_ERR "pmi: driver has already been initialized.\n");
+ rc = -EBUSY;
+ goto out;
+ }
+
data = kzalloc(sizeof(struct pmi_data), GFP_KERNEL);
if (!data) {
printk(KERN_ERR "pmi: could not allocate memory.\n");
@@ -154,7 +154,6 @@ static int pmi_of_probe(struct of_device
INIT_WORK(&data->work, pmi_notify_handlers);
- dev->dev.driver_data = data;
data->dev = dev;
data->irq = irq_of_parse_and_map(np, 0);
@@ -164,7 +163,7 @@ static int pmi_of_probe(struct of_device
goto error_cleanup_iomap;
}
- rc = request_irq(data->irq, pmi_irq_handler, 0, "pmi", data);
+ rc = request_irq(data->irq, pmi_irq_handler, 0, "pmi", NULL);
if (rc) {
printk(KERN_ERR "pmi: can't request IRQ %d: returned %d\n",
data->irq, rc);
@@ -187,11 +186,8 @@ out:
static int pmi_of_remove(struct of_device *dev)
{
- struct pmi_data *data;
struct pmi_handler *handler, *tmp;
- data = dev->dev.driver_data;
-
free_irq(data->irq, data);
iounmap(data->pmi_reg);
@@ -202,7 +198,7 @@ static int pmi_of_remove(struct of_devic
spin_unlock(&data->handler_spinlock);
- kfree(dev->dev.driver_data);
+ kfree(data);
return 0;
}
@@ -226,13 +222,13 @@ static void __exit pmi_module_exit(void)
}
module_exit(pmi_module_exit);
-void pmi_send_message(struct of_device *device, pmi_message_t msg)
+int pmi_send_message(pmi_message_t msg)
{
- struct pmi_data *data;
unsigned long flags;
DECLARE_COMPLETION_ONSTACK(completion);
- data = device->dev.driver_data;
+ if (!data)
+ return -ENODEV;
mutex_lock(&data->msg_mutex);
@@ -256,30 +252,26 @@ void pmi_send_message(struct of_device *
data->completion = NULL;
mutex_unlock(&data->msg_mutex);
+
+ return 0;
}
EXPORT_SYMBOL_GPL(pmi_send_message);
-void pmi_register_handler(struct of_device *device,
- struct pmi_handler *handler)
+int pmi_register_handler(struct pmi_handler *handler)
{
- struct pmi_data *data;
- data = device->dev.driver_data;
-
if (!data)
- return;
+ return -ENODEV;
spin_lock(&data->handler_spinlock);
list_add_tail(&handler->node, &data->handler);
spin_unlock(&data->handler_spinlock);
+
+ return 0;
}
EXPORT_SYMBOL_GPL(pmi_register_handler);
-void pmi_unregister_handler(struct of_device *device,
- struct pmi_handler *handler)
+void pmi_unregister_handler(struct pmi_handler *handler)
{
- struct pmi_data *data;
- data = device->dev.driver_data;
-
if (!data)
return;
Index: linux/include/asm-powerpc/pmi.h
===================================================================
--- linux.orig/include/asm-powerpc/pmi.h
+++ linux/include/asm-powerpc/pmi.h
@@ -55,13 +55,13 @@ typedef struct {
struct pmi_handler {
struct list_head node;
u8 type;
- void (*handle_pmi_message) (struct of_device *, pmi_message_t);
+ void (*handle_pmi_message) (pmi_message_t);
};
-void pmi_register_handler(struct of_device *, struct pmi_handler *);
-void pmi_unregister_handler(struct of_device *, struct pmi_handler *);
+int pmi_register_handler(struct pmi_handler *);
+void pmi_unregister_handler(struct pmi_handler *);
-void pmi_send_message(struct of_device *, pmi_message_t);
+int pmi_send_message(pmi_message_t);
#endif /* __KERNEL__ */
#endif /* _POWERPC_PMI_H */
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [patch 2/5] cell: cbe_cpufreq fix latency measurement
From: Christian Krafft @ 2007-06-21 11:20 UTC (permalink / raw)
To: Christian Krafft; +Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
In-Reply-To: <20070621130944.083f8fa5@localhost>
[-- Attachment #1.1: Type: text/plain, Size: 2929 bytes --]
From: Christian Krafft <krafft@de.ibm.com>
This patch fixes the debug code that calculates the transition time when
changing the slow modes on a Cell BE cpu.
Singed-off-by: Christian Krafft <krafft@de.ibm.com>
Index: linux/arch/powerpc/platforms/cell/cbe_cpufreq.c
===================================================================
--- linux.orig/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ linux/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -81,7 +81,7 @@ static int set_pmode_pmi(int cpu, unsign
int ret;
pmi_message_t pmi_msg;
#ifdef DEBUG
- u64 time;
+ long time;
#endif
pmi_msg.type = PMI_TYPE_FREQ_CHANGE;
@@ -89,7 +89,7 @@ static int set_pmode_pmi(int cpu, unsign
pmi_msg.data2 = pmode;
#ifdef DEBUG
- time = (u64) get_cycles();
+ time = jiffies;
#endif
pmi_send_message(pmi_msg);
@@ -98,9 +98,9 @@ static int set_pmode_pmi(int cpu, unsign
pr_debug("PMI returned slow mode %d\n", ret);
#ifdef DEBUG
- time = (u64) get_cycles() - time; /* actual cycles (not cpu cycles!) */
- time = 1000000000 * time / CLOCK_TICK_RATE; /* time in ns (10^-9) */
- pr_debug("had to wait %lu ns for a transition\n", time);
+ time = jiffies - time; /* actual cycles (not cpu cycles!) */
+ time = jiffies_to_msecs(time);
+ pr_debug("had to wait %lu ms for a transition using PMI.\n", time);
#endif
return ret;
}
@@ -123,15 +123,18 @@ static int set_pmode_reg(int cpu, unsign
struct cbe_mic_tm_regs __iomem *mic_tm_regs;
u64 flags;
u64 value;
+#ifdef DEBUG
+ long time;
+#endif
local_irq_save(flags);
mic_tm_regs = cbe_get_cpu_mic_tm_regs(cpu);
pmd_regs = cbe_get_cpu_pmd_regs(cpu);
- pr_debug("pm register is mapped at %p\n", &pmd_regs->pmcr);
- pr_debug("mic register is mapped at %p\n", &mic_tm_regs->slow_fast_timer_0);
-
+#ifdef DEBUG
+ time = jiffies;
+#endif
out_be64(&mic_tm_regs->slow_fast_timer_0, MIC_Slow_Fast_Timer_table[pmode]);
out_be64(&mic_tm_regs->slow_fast_timer_1, MIC_Slow_Fast_Timer_table[pmode]);
@@ -146,6 +149,7 @@ static int set_pmode_reg(int cpu, unsign
out_be64(&pmd_regs->pmcr, value);
+#ifdef DEBUG
/* wait until new pmode appears in status register */
value = in_be64(&pmd_regs->pmsr) & 0x07;
while(value != pmode) {
@@ -153,6 +157,11 @@ static int set_pmode_reg(int cpu, unsign
value = in_be64(&pmd_regs->pmsr) & 0x07;
}
+ time = jiffies - time;
+ time = jiffies_to_msecs(time);
+ pr_debug("had to wait %lu ms for a transition using " \
+ "the pervasive unit.\n", time);
+#endif
local_irq_restore(flags);
return 0;
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: cbe_cpufreq-fix-latency-measurement.diff --]
[-- Type: text/x-patch; name=cbe_cpufreq-fix-latency-measurement.diff, Size: 2655 bytes --]
Subject: cell: cbe_cpufreq fix latency measurement
From: Christian Krafft <krafft@de.ibm.com>
This patch fixes the debug code that calculates the transition time when
changing the slow modes on a Cell BE cpu.
Singed-off-by: Christian Krafft <krafft@de.ibm.com>
Index: linux/arch/powerpc/platforms/cell/cbe_cpufreq.c
===================================================================
--- linux.orig/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ linux/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -81,7 +81,7 @@ static int set_pmode_pmi(int cpu, unsign
int ret;
pmi_message_t pmi_msg;
#ifdef DEBUG
- u64 time;
+ long time;
#endif
pmi_msg.type = PMI_TYPE_FREQ_CHANGE;
@@ -89,7 +89,7 @@ static int set_pmode_pmi(int cpu, unsign
pmi_msg.data2 = pmode;
#ifdef DEBUG
- time = (u64) get_cycles();
+ time = jiffies;
#endif
pmi_send_message(pmi_msg);
@@ -98,9 +98,9 @@ static int set_pmode_pmi(int cpu, unsign
pr_debug("PMI returned slow mode %d\n", ret);
#ifdef DEBUG
- time = (u64) get_cycles() - time; /* actual cycles (not cpu cycles!) */
- time = 1000000000 * time / CLOCK_TICK_RATE; /* time in ns (10^-9) */
- pr_debug("had to wait %lu ns for a transition\n", time);
+ time = jiffies - time; /* actual cycles (not cpu cycles!) */
+ time = jiffies_to_msecs(time);
+ pr_debug("had to wait %lu ms for a transition using PMI.\n", time);
#endif
return ret;
}
@@ -123,15 +123,18 @@ static int set_pmode_reg(int cpu, unsign
struct cbe_mic_tm_regs __iomem *mic_tm_regs;
u64 flags;
u64 value;
+#ifdef DEBUG
+ long time;
+#endif
local_irq_save(flags);
mic_tm_regs = cbe_get_cpu_mic_tm_regs(cpu);
pmd_regs = cbe_get_cpu_pmd_regs(cpu);
- pr_debug("pm register is mapped at %p\n", &pmd_regs->pmcr);
- pr_debug("mic register is mapped at %p\n", &mic_tm_regs->slow_fast_timer_0);
-
+#ifdef DEBUG
+ time = jiffies;
+#endif
out_be64(&mic_tm_regs->slow_fast_timer_0, MIC_Slow_Fast_Timer_table[pmode]);
out_be64(&mic_tm_regs->slow_fast_timer_1, MIC_Slow_Fast_Timer_table[pmode]);
@@ -146,6 +149,7 @@ static int set_pmode_reg(int cpu, unsign
out_be64(&pmd_regs->pmcr, value);
+#ifdef DEBUG
/* wait until new pmode appears in status register */
value = in_be64(&pmd_regs->pmsr) & 0x07;
while(value != pmode) {
@@ -153,6 +157,11 @@ static int set_pmode_reg(int cpu, unsign
value = in_be64(&pmd_regs->pmsr) & 0x07;
}
+ time = jiffies - time;
+ time = jiffies_to_msecs(time);
+ pr_debug("had to wait %lu ms for a transition using " \
+ "the pervasive unit.\n", time);
+#endif
local_irq_restore(flags);
return 0;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [patch 3/5] cell: cbe_cpufreq: fix initialization
From: Christian Krafft @ 2007-06-21 11:23 UTC (permalink / raw)
To: Christian Krafft; +Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
In-Reply-To: <20070621130944.083f8fa5@localhost>
[-- Attachment #1: Type: text/plain, Size: 2891 bytes --]
From: Christian Krafft <krafft@de.ibm.com>
This patch fixes the initialization of the cbe_cpufreq driver.
The code that initializes the PMI related functions was called per cpu:
* registering cpufreq notifier block
* registering a pmi handler
This ends in a bug that the notifier block gets called in an endless loop.
The initialization code is being put to the
module init code path by this patch. This way it only gets called once.
Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Index: linux/arch/powerpc/platforms/cell/cbe_cpufreq.c
===================================================================
--- linux.orig/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ linux/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -196,10 +196,9 @@ static int pmi_notifier(struct notifier_
{
struct cpufreq_policy *policy = data;
- if (event != CPUFREQ_INCOMPATIBLE)
- return 0;
+ if (pmi_frequency_limit)
+ cpufreq_verify_within_limits(policy, 0, pmi_frequency_limit);
- cpufreq_verify_within_limits(policy, 0, pmi_frequency_limit);
return 0;
}
@@ -263,11 +262,6 @@ static int cbe_cpufreq_cpu_init(struct c
cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu);
- if (cbe_cpufreq_has_pmi) {
- /* frequency might get limited later, initialize limit with max_freq */
- pmi_frequency_limit = max_freq;
- cpufreq_register_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
- }
/* this ensures that policy->cpuinfo_min and policy->cpuinfo_max are set correctly */
return cpufreq_frequency_table_cpuinfo(policy, cbe_freqs);
@@ -275,9 +269,6 @@ static int cbe_cpufreq_cpu_init(struct c
static int cbe_cpufreq_cpu_exit(struct cpufreq_policy *policy)
{
- if (cbe_cpufreq_has_pmi)
- cpufreq_unregister_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
-
cpufreq_frequency_table_put_attr(policy->cpu);
return 0;
}
@@ -341,6 +332,9 @@ static int __init cbe_cpufreq_init(void)
cbe_cpufreq_has_pmi = pmi_register_handler(&cbe_pmi_handler) == 0;
+ if (cbe_cpufreq_has_pmi)
+ cpufreq_register_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
+
return cpufreq_register_driver(&cbe_cpufreq_driver);
}
@@ -348,8 +342,10 @@ static void __exit cbe_cpufreq_exit(void
{
cpufreq_unregister_driver(&cbe_cpufreq_driver);
- if (cbe_cpufreq_has_pmi)
+ if (cbe_cpufreq_has_pmi) {
+ cpufreq_unregister_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
pmi_unregister_handler(&cbe_pmi_handler);
+ }
}
module_init(cbe_cpufreq_init);
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [patch 4/5] cell: cpufreq and pmi patches
From: Christian Krafft @ 2007-06-21 11:26 UTC (permalink / raw)
To: Christian Krafft; +Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
In-Reply-To: <20070621130944.083f8fa5@localhost>
[-- Attachment #1: Type: text/plain, Size: 4858 bytes --]
Subject: cbe_cpufreq: fix minor issues
From: Christian Krafft <krafft@de.ibm.com>
Minor issues have been fixed:
* added a missing call to of_node_put()
* signedness of a function parameter
* added some line breaks
* changed global pmi_frequency_limit to a
per node pmi_slow_mode_limit array
Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Index: linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq.c
===================================================================
--- linux-2.6.22-rc5.orig/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -67,7 +67,7 @@ static u64 MIC_Slow_Next_Timer_table[] =
0x00003FC000000000ull,
};
-static unsigned int pmi_frequency_limit = 0;
+static u8 pmi_slow_mode_limit[MAX_BE];
/*
* hardware specific functions
@@ -169,35 +169,50 @@ static int set_pmode_reg(int cpu, unsign
static int set_pmode(int cpu, unsigned int slow_mode)
{
+ int rc;
#ifdef CONFIG_PPC_PMI
if (cbe_cpufreq_has_pmi)
- return set_pmode_pmi(cpu, slow_mode);
+ rc = set_pmode_pmi(cpu, slow_mode);
+ else
#endif
- return set_pmode_reg(cpu, slow_mode);
+ rc = set_pmode_reg(cpu, slow_mode);
+
+ pr_debug("register contains slow mode %d\n", get_pmode(cpu));
+
+ return rc;
}
static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg)
{
- u8 cpu;
- u8 cbe_pmode_new;
+ u8 node; slow_mode;
BUG_ON(pmi_msg.type != PMI_TYPE_FREQ_CHANGE);
- cpu = cbe_node_to_cpu(pmi_msg.data1);
- cbe_pmode_new = pmi_msg.data2;
+ node = pmi_msg.data1;
+ slow_mode = pmi_msg.data2;
- pmi_frequency_limit = cbe_freqs[cbe_pmode_new].frequency;
+ pmi_slow_mode_limit[node] = slow_mode;
- pr_debug("cbe_handle_pmi: max freq=%d\n", pmi_frequency_limit);
+ pr_debug("cbe_handle_pmi: node: %d, max slow_mode=%d\n", slow_mode);
}
static int pmi_notifier(struct notifier_block *nb,
unsigned long event, void *data)
{
struct cpufreq_policy *policy = data;
+ u8 node;
+
+ node = cbe_cpu_to_node(policy->cpu);
+
+ pr_debug("got notified, event=%lu, node=%u\n", event, node);
- if (pmi_frequency_limit)
- cpufreq_verify_within_limits(policy, 0, pmi_frequency_limit);
+ if (pmi_slow_mode_limit[node] != 0) {
+ pr_debug("limiting node %d to slow mode %d\n",
+ node, pmi_slow_mode_limit[node]);
+
+ cpufreq_verify_within_limits(policy, 0,
+ cbe_freqs[pmi_slow_mode_limit[node]].frequency);
+ }
return 0;
}
@@ -232,6 +247,8 @@ static int cbe_cpufreq_cpu_init(struct c
max_freqp = of_get_property(cpu, "clock-frequency", NULL);
+ of_node_put(cpu);
+
if (!max_freqp)
return -EINVAL;
@@ -248,7 +265,9 @@ static int cbe_cpufreq_cpu_init(struct c
}
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- /* if DEBUG is enabled set_pmode() measures the correct latency of a transition */
+
+ /* if DEBUG is enabled set_pmode() measures the latency
+ * of a transition */
policy->cpuinfo.transition_latency = 25000;
cur_pmode = get_pmode(policy->cpu);
@@ -262,8 +281,8 @@ static int cbe_cpufreq_cpu_init(struct c
cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu);
-
- /* this ensures that policy->cpuinfo_min and policy->cpuinfo_max are set correctly */
+ /* this ensures that policy->cpuinfo_min
+ * and policy->cpuinfo_max are set correctly */
return cpufreq_frequency_table_cpuinfo(policy, cbe_freqs);
}
@@ -279,12 +298,13 @@ static int cbe_cpufreq_verify(struct cpu
}
-static int cbe_cpufreq_target(struct cpufreq_policy *policy, unsigned int target_freq,
- unsigned int relation)
+static int cbe_cpufreq_target(struct cpufreq_policy *policy,
+ unsigned int target_freq,
+ unsigned int relation)
{
int rc;
struct cpufreq_freqs freqs;
- int cbe_pmode_new;
+ unsigned int cbe_pmode_new;
cpufreq_frequency_table_target(policy,
cbe_freqs,
@@ -299,12 +319,14 @@ static int cbe_cpufreq_target(struct cpu
mutex_lock(&cbe_switch_mutex);
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
- pr_debug("setting frequency for cpu %d to %d kHz, 1/%d of max frequency\n",
+ pr_debug("setting frequency for cpu %d to %d kHz, " \
+ "1/%d of max frequency\n",
policy->cpu,
cbe_freqs[cbe_pmode_new].frequency,
cbe_freqs[cbe_pmode_new].index);
rc = set_pmode(policy->cpu, cbe_pmode_new);
+
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
mutex_unlock(&cbe_switch_mutex);
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [patch 5/5] cell: cbe_cpufreq: reorganize code
From: Christian Krafft @ 2007-06-21 11:41 UTC (permalink / raw)
To: Christian Krafft; +Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
In-Reply-To: <20070621130944.083f8fa5@localhost>
[-- Attachment #1: Type: text/plain, Size: 17353 bytes --]
Subject: cbe_cpufreq: reorganize code and fix some bugs
From: Christian Krafft <krafft@de.ibm.com>
This patch reorganizes the code of the driver into three files.
Two cbe_cpufreq_pmi.c and cbe_cpufreq_pervasive.c care about hardware.
cbe_cpufreq.c contains the logic.
There is no changed behaviour, except that the PMI related function
is now located in a seperate module cbe_cpufreq_pmi. This module
will be required by cbe_cpufreq, if CONFIG_CBE_CPUFREQ_PMI has been set.
Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Index: linux-2.6.22-rc5/arch/powerpc/platforms/cell/Kconfig
===================================================================
--- linux-2.6.22-rc5.orig/arch/powerpc/platforms/cell/Kconfig
+++ linux-2.6.22-rc5/arch/powerpc/platforms/cell/Kconfig
@@ -73,4 +73,14 @@ config CBE_CPUFREQ
For details, take a look at <file:Documentation/cpu-freq/>.
If you don't have such processor, say N
+config CBE_CPUFREQ_PMI
+ tristate "CBE frequency scaling using PMI interface"
+ depends on CBE_CPUFREQ && PPC_PMI && EXPERIMENTAL
+ default n
+ help
+ Select this, if you want to use the PMI interface
+ to switch frequencies. Using PMI, the
+ processor will not only be able to run at lower speed,
+ but also at lower core voltage.
+
endmenu
Index: linux-2.6.22-rc5/arch/powerpc/platforms/cell/Makefile
===================================================================
--- linux-2.6.22-rc5.orig/arch/powerpc/platforms/cell/Makefile
+++ linux-2.6.22-rc5/arch/powerpc/platforms/cell/Makefile
@@ -4,7 +4,9 @@ obj-$(CONFIG_PPC_CELL_NATIVE) += interr
obj-$(CONFIG_CBE_RAS) += ras.o
obj-$(CONFIG_CBE_THERM) += cbe_thermal.o
-obj-$(CONFIG_CBE_CPUFREQ) += cbe_cpufreq.o
+obj-$(CONFIG_CBE_CPUFREQ_PMI) += cbe_cpufreq_pmi.o
+obj-$(CONFIG_CBE_CPUFREQ) += cbe-cpufreq.o
+cbe-cpufreq-y += cbe_cpufreq_pervasive.o cbe_cpufreq.o
ifeq ($(CONFIG_SMP),y)
obj-$(CONFIG_PPC_CELL_NATIVE) += smp.o
Index: linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq.c
===================================================================
--- linux-2.6.22-rc5.orig/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -1,7 +1,7 @@
/*
* cpufreq driver for the cell processor
*
- * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
+ * (C) Copyright IBM Deutschland Entwicklung GmbH 2005-2007
*
* Author: Christian Krafft <krafft@de.ibm.com>
*
@@ -21,18 +21,10 @@
*/
#include <linux/cpufreq.h>
-#include <linux/timer.h>
-
-#include <asm/hw_irq.h>
-#include <asm/io.h>
#include <asm/machdep.h>
-#include <asm/processor.h>
-#include <asm/prom.h>
-#include <asm/time.h>
-#include <asm/pmi.h>
#include <asm/of_platform.h>
-
-#include "cbe_regs.h"
+#include <asm/prom.h>
+#include "cbe_cpufreq.h"
static DEFINE_MUTEX(cbe_switch_mutex);
@@ -50,183 +42,24 @@ static struct cpufreq_frequency_table cb
{0, CPUFREQ_TABLE_END},
};
-/* to write to MIC register */
-static u64 MIC_Slow_Fast_Timer_table[] = {
- [0 ... 7] = 0x007fc00000000000ull,
-};
-
-/* more values for the MIC */
-static u64 MIC_Slow_Next_Timer_table[] = {
- 0x0000240000000000ull,
- 0x0000268000000000ull,
- 0x000029C000000000ull,
- 0x00002D0000000000ull,
- 0x0000300000000000ull,
- 0x0000334000000000ull,
- 0x000039C000000000ull,
- 0x00003FC000000000ull,
-};
-
-static u8 pmi_slow_mode_limit[MAX_BE];
-
/*
* hardware specific functions
*/
-static bool cbe_cpufreq_has_pmi;
-
-#ifdef CONFIG_PPC_PMI
-static int set_pmode_pmi(int cpu, unsigned int pmode)
-{
- int ret;
- pmi_message_t pmi_msg;
-#ifdef DEBUG
- long time;
-#endif
-
- pmi_msg.type = PMI_TYPE_FREQ_CHANGE;
- pmi_msg.data1 = cbe_cpu_to_node(cpu);
- pmi_msg.data2 = pmode;
-
-#ifdef DEBUG
- time = jiffies;
-#endif
-
- pmi_send_message(pmi_msg);
- ret = pmi_msg.data2;
-
- pr_debug("PMI returned slow mode %d\n", ret);
-
-#ifdef DEBUG
- time = jiffies - time; /* actual cycles (not cpu cycles!) */
- time = jiffies_to_msecs(time);
- pr_debug("had to wait %lu ms for a transition using PMI.\n", time);
-#endif
- return ret;
-}
-#endif
-
-static int get_pmode(int cpu)
-{
- int ret;
- struct cbe_pmd_regs __iomem *pmd_regs;
-
- pmd_regs = cbe_get_cpu_pmd_regs(cpu);
- ret = in_be64(&pmd_regs->pmsr) & 0x07;
-
- return ret;
-}
-
-static int set_pmode_reg(int cpu, unsigned int pmode)
-{
- struct cbe_pmd_regs __iomem *pmd_regs;
- struct cbe_mic_tm_regs __iomem *mic_tm_regs;
- u64 flags;
- u64 value;
-#ifdef DEBUG
- long time;
-#endif
-
- local_irq_save(flags);
-
- mic_tm_regs = cbe_get_cpu_mic_tm_regs(cpu);
- pmd_regs = cbe_get_cpu_pmd_regs(cpu);
-
-#ifdef DEBUG
- time = jiffies;
-#endif
- out_be64(&mic_tm_regs->slow_fast_timer_0, MIC_Slow_Fast_Timer_table[pmode]);
- out_be64(&mic_tm_regs->slow_fast_timer_1, MIC_Slow_Fast_Timer_table[pmode]);
-
- out_be64(&mic_tm_regs->slow_next_timer_0, MIC_Slow_Next_Timer_table[pmode]);
- out_be64(&mic_tm_regs->slow_next_timer_1, MIC_Slow_Next_Timer_table[pmode]);
-
- value = in_be64(&pmd_regs->pmcr);
- /* set bits to zero */
- value &= 0xFFFFFFFFFFFFFFF8ull;
- /* set bits to next pmode */
- value |= pmode;
-
- out_be64(&pmd_regs->pmcr, value);
-
-#ifdef DEBUG
- /* wait until new pmode appears in status register */
- value = in_be64(&pmd_regs->pmsr) & 0x07;
- while(value != pmode) {
- cpu_relax();
- value = in_be64(&pmd_regs->pmsr) & 0x07;
- }
-
- time = jiffies - time;
- time = jiffies_to_msecs(time);
- pr_debug("had to wait %lu ms for a transition using " \
- "the pervasive unit.\n", time);
-#endif
- local_irq_restore(flags);
-
- return 0;
-}
-
-static int set_pmode(int cpu, unsigned int slow_mode)
+static int set_pmode(unsigned int cpu, unsigned int slow_mode)
{
int rc;
-#ifdef CONFIG_PPC_PMI
+
if (cbe_cpufreq_has_pmi)
- rc = set_pmode_pmi(cpu, slow_mode);
+ rc = cbe_cpufreq_set_pmode_pmi(cpu, slow_mode);
else
-#endif
- rc = set_pmode_reg(cpu, slow_mode);
+ rc = cbe_cpufreq_set_pmode(cpu, slow_mode);
- pr_debug("register contains slow mode %d\n", get_pmode(cpu));
+ pr_debug("register contains slow mode %d\n", cbe_cpufreq_get_pmode(cpu));
return rc;
}
-static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg)
-{
- u8 node; slow_mode;
-
- BUG_ON(pmi_msg.type != PMI_TYPE_FREQ_CHANGE);
-
- node = pmi_msg.data1;
- slow_mode = pmi_msg.data2;
-
- pmi_slow_mode_limit[node] = slow_mode;
-
- pr_debug("cbe_handle_pmi: node: %d, max slow_mode=%d\n", slow_mode);
-}
-
-static int pmi_notifier(struct notifier_block *nb,
- unsigned long event, void *data)
-{
- struct cpufreq_policy *policy = data;
- u8 node;
-
- node = cbe_cpu_to_node(policy->cpu);
-
- pr_debug("got notified, event=%lu, node=%u\n", event, node);
-
- if (pmi_slow_mode_limit[node] != 0) {
- pr_debug("limiting node %d to slow mode %d\n",
- node, pmi_slow_mode_limit[node]);
-
- cpufreq_verify_within_limits(policy, 0,
- cbe_freqs[pmi_slow_mode_limit[node]].frequency);
- }
-
- return 0;
-}
-
-static struct notifier_block pmi_notifier_block = {
- .notifier_call = pmi_notifier,
-};
-
-static struct pmi_handler cbe_pmi_handler = {
- .type = PMI_TYPE_FREQ_CHANGE,
- .handle_pmi_message = cbe_cpufreq_handle_pmi,
-};
-
-
/*
* cpufreq functions
*/
@@ -270,7 +103,7 @@ static int cbe_cpufreq_cpu_init(struct c
* of a transition */
policy->cpuinfo.transition_latency = 25000;
- cur_pmode = get_pmode(policy->cpu);
+ cur_pmode = cbe_cpufreq_get_pmode(policy->cpu);
pr_debug("current pmode is at %d\n",cur_pmode);
policy->cur = cbe_freqs[cur_pmode].frequency;
@@ -297,7 +130,6 @@ static int cbe_cpufreq_verify(struct cpu
return cpufreq_frequency_table_verify(policy, cbe_freqs);
}
-
static int cbe_cpufreq_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
@@ -352,22 +184,12 @@ static int __init cbe_cpufreq_init(void)
if (!machine_is(cell))
return -ENODEV;
- cbe_cpufreq_has_pmi = pmi_register_handler(&cbe_pmi_handler) == 0;
-
- if (cbe_cpufreq_has_pmi)
- cpufreq_register_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
-
return cpufreq_register_driver(&cbe_cpufreq_driver);
}
static void __exit cbe_cpufreq_exit(void)
{
cpufreq_unregister_driver(&cbe_cpufreq_driver);
-
- if (cbe_cpufreq_has_pmi) {
- cpufreq_unregister_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
- pmi_unregister_handler(&cbe_pmi_handler);
- }
}
module_init(cbe_cpufreq_init);
Index: linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq.h
===================================================================
--- /dev/null
+++ linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq.h
@@ -0,0 +1,24 @@
+/*
+ * cbe_cpufreq.h
+ *
+ * This file contains the definitions used by the cbe_cpufreq driver.
+ *
+ * (C) Copyright IBM Deutschland Entwicklung GmbH 2005-2007
+ *
+ * Author: Christian Krafft <krafft@de.ibm.com>
+ *
+ */
+
+#include <linux/cpufreq.h>
+#include <linux/types.h>
+
+int cbe_cpufreq_set_pmode(int cpu, unsigned int pmode);
+int cbe_cpufreq_get_pmode(int cpu);
+
+int cbe_cpufreq_set_pmode_pmi(int cpu, unsigned int pmode);
+
+#if defined(CONFIG_CBE_CPUFREQ_PMI) || defined(CONFIG_CBE_CPUFREQ_PMI_MODULE)
+extern bool cbe_cpufreq_has_pmi;
+#else
+#define cbe_cpufreq_has_pmi (0)
+#endif
Index: linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
===================================================================
--- /dev/null
+++ linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
@@ -0,0 +1,118 @@
+/*
+ * pervasive backend for the cbe_cpufreq driver
+ *
+ * This driver makes use of the pervasive unit to
+ * engage the desired frequency.
+ *
+ * (C) Copyright IBM Deutschland Entwicklung GmbH 2005-2007
+ *
+ * Author: Christian Krafft <krafft@de.ibm.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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/kernel.h>
+#include <asm/machdep.h>
+#include <asm/hw_irq.h>
+#include <asm/io.h>
+
+#ifdef DEBUG
+#include <asm/time.h>
+#endif
+
+#include "cbe_regs.h"
+#include "cbe_cpufreq.h"
+
+/* to write to MIC register */
+static u64 MIC_Slow_Fast_Timer_table[] = {
+ [0 ... 7] = 0x007fc00000000000ull,
+};
+
+/* more values for the MIC */
+static u64 MIC_Slow_Next_Timer_table[] = {
+ 0x0000240000000000ull,
+ 0x0000268000000000ull,
+ 0x000029C000000000ull,
+ 0x00002D0000000000ull,
+ 0x0000300000000000ull,
+ 0x0000334000000000ull,
+ 0x000039C000000000ull,
+ 0x00003FC000000000ull,
+};
+
+
+int cbe_cpufreq_set_pmode(int cpu, unsigned int pmode)
+{
+ struct cbe_pmd_regs __iomem *pmd_regs;
+ struct cbe_mic_tm_regs __iomem *mic_tm_regs;
+ u64 flags;
+ u64 value;
+#ifdef DEBUG
+ long time;
+#endif
+
+ local_irq_save(flags);
+
+ mic_tm_regs = cbe_get_cpu_mic_tm_regs(cpu);
+ pmd_regs = cbe_get_cpu_pmd_regs(cpu);
+
+#ifdef DEBUG
+ time = jiffies;
+#endif
+
+ out_be64(&mic_tm_regs->slow_fast_timer_0, MIC_Slow_Fast_Timer_table[pmode]);
+ out_be64(&mic_tm_regs->slow_fast_timer_1, MIC_Slow_Fast_Timer_table[pmode]);
+
+ out_be64(&mic_tm_regs->slow_next_timer_0, MIC_Slow_Next_Timer_table[pmode]);
+ out_be64(&mic_tm_regs->slow_next_timer_1, MIC_Slow_Next_Timer_table[pmode]);
+
+ value = in_be64(&pmd_regs->pmcr);
+ /* set bits to zero */
+ value &= 0xFFFFFFFFFFFFFFF8ull;
+ /* set bits to next pmode */
+ value |= pmode;
+
+ out_be64(&pmd_regs->pmcr, value);
+
+#ifdef DEBUG
+ /* wait until new pmode appears in status register */
+ value = in_be64(&pmd_regs->pmsr) & 0x07;
+ while(value != pmode) {
+ cpu_relax();
+ value = in_be64(&pmd_regs->pmsr) & 0x07;
+ }
+
+ time = jiffies - time;
+ time = jiffies_to_msecs(time);
+ pr_debug("had to wait %lu ms for a transition using " \
+ "pervasive unit\n", time);
+#endif
+ local_irq_restore(flags);
+
+ return 0;
+}
+
+
+int cbe_cpufreq_get_pmode(int cpu)
+{
+ int ret;
+ struct cbe_pmd_regs __iomem *pmd_regs;
+
+ pmd_regs = cbe_get_cpu_pmd_regs(cpu);
+ ret = in_be64(&pmd_regs->pmsr) & 0x07;
+
+ return ret;
+}
+
Index: linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
===================================================================
--- /dev/null
+++ linux-2.6.22-rc5/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
@@ -0,0 +1,148 @@
+/*
+ * pmi backend for the cbe_cpufreq driver
+ *
+ * (C) Copyright IBM Deutschland Entwicklung GmbH 2005-2007
+ *
+ * Author: Christian Krafft <krafft@de.ibm.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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <asm/of_platform.h>
+#include <asm/processor.h>
+#include <asm/prom.h>
+#include <asm/pmi.h>
+
+#ifdef DEBUG
+#include <asm/time.h>
+#endif
+
+#include "cbe_regs.h"
+#include "cbe_cpufreq.h"
+
+static u8 pmi_slow_mode_limit[MAX_CBE];
+
+bool cbe_cpufreq_has_pmi = false;
+EXPORT_SYMBOL_GPL(cbe_cpufreq_has_pmi);
+
+/*
+ * hardware specific functions
+ */
+
+int cbe_cpufreq_set_pmode_pmi(int cpu, unsigned int pmode)
+{
+ int ret;
+ pmi_message_t pmi_msg;
+#ifdef DEBUG
+ long time;
+#endif
+ pmi_msg.type = PMI_TYPE_FREQ_CHANGE;
+ pmi_msg.data1 = cbe_cpu_to_node(cpu);
+ pmi_msg.data2 = pmode;
+
+#ifdef DEBUG
+ time = jiffies;
+#endif
+ pmi_send_message(pmi_msg);
+
+#ifdef DEBUG
+ time = jiffies - time;
+ time = jiffies_to_msecs(time);
+ pr_debug("had to wait %lu ms for a transition using " \
+ "PMI\n", time);
+#endif
+ ret = pmi_msg.data2;
+ pr_debug("PMI returned slow mode %d\n", ret);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(cbe_cpufreq_set_pmode_pmi);
+
+
+static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg)
+{
+ u8 node, slow_mode;
+
+ BUG_ON(pmi_msg.type != PMI_TYPE_FREQ_CHANGE);
+
+ node = pmi_msg.data1;
+ slow_mode = pmi_msg.data2;
+
+ pmi_slow_mode_limit[node] = slow_mode;
+
+ pr_debug("cbe_handle_pmi: node: %d max_freq: %d\n", node, slow_mode);
+}
+
+static int pmi_notifier(struct notifier_block *nb,
+ unsigned long event, void *data)
+{
+ struct cpufreq_policy *policy = data;
+ struct cpufreq_frequency_table *cbe_freqs;
+ u8 node;
+
+ cbe_freqs = cpufreq_frequency_get_table(policy->cpu);
+ node = cbe_cpu_to_node(policy->cpu);
+
+ pr_debug("got notified, event=%lu, node=%u\n", event, node);
+
+ if (pmi_slow_mode_limit[node] != 0) {
+ pr_debug("limiting node %d to slow mode %d\n",
+ node, pmi_slow_mode_limit[node]);
+
+ cpufreq_verify_within_limits(policy, 0,
+
+ cbe_freqs[pmi_slow_mode_limit[node]].frequency);
+ }
+
+ return 0;
+}
+
+static struct notifier_block pmi_notifier_block = {
+ .notifier_call = pmi_notifier,
+};
+
+static struct pmi_handler cbe_pmi_handler = {
+ .type = PMI_TYPE_FREQ_CHANGE,
+ .handle_pmi_message = cbe_cpufreq_handle_pmi,
+};
+
+
+
+static int __init cbe_cpufreq_pmi_init(void)
+{
+ cbe_cpufreq_has_pmi = pmi_register_handler(&cbe_pmi_handler) == 0;
+
+ if (!cbe_cpufreq_has_pmi)
+ return -ENODEV;
+
+ cpufreq_register_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
+
+ return 0;
+}
+
+static void __exit cbe_cpufreq_pmi_exit(void)
+{
+ cpufreq_unregister_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
+ pmi_unregister_handler(&cbe_pmi_handler);
+}
+
+module_init(cbe_cpufreq_pmi_init);
+module_exit(cbe_cpufreq_pmi_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* RE: General question on upgrading Linux version
From: Bizhan Gholikhamseh (bgholikh) @ 2007-06-21 12:29 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-embedded
In-Reply-To: <33351C82-D56D-4414-81F1-328D36A7993D@freescale.com>
=20
> -----Original Message-----
> From: Andy Fleming [mailto:afleming@freescale.com]=20
> Sent: Wednesday, June 20, 2007 2:52 PM
> To: Bizhan Gholikhamseh (bgholikh)
> Cc: linuxppc-embedded@ozlabs.org
> Subject: Re: General question on upgrading Linux version
>=20
>=20
> On Jun 20, 2007, at 16:29, Bizhan Gholikhamseh ((bgholikh)) wrote:
>=20
> > Hi All,
> > We are using MPC8541 processor from freescale. Our current kernel=20
> > version is based on 2.6.11 plus some patches provided by Freescale.
> > I would like to update our Kernel version to a more recent version.
> > I would greatly appreciate if you could provide me with=20
> some general=20
> > guideline on how to proceed .....
>=20
> You should be able to check out the latest sources from=20
> git:// git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
The current stable kernel release is 2.6.21. Could I use that tree
instead ?
>=20
> You will probably also need a newer u-boot from here:
>=20
> git://www.denx.de/git/u-boot-mpc85xx.git
Currently we are using uboot 1.2. Do I have to update the u-boot version
also or I can bypass that for now?
Thanks,
Bizhan
>=20
> Please tell me if you have any problems using these.
>=20
> Andy
>=20
^ permalink raw reply
* start_kernel does not get called on Virtex 4 FX 12 ppc 405
From: Thomas Glanzmann @ 2007-06-21 12:33 UTC (permalink / raw)
To: linuxppc-embedded
Hello,
I still have the problem that embedded kernel boot loader "load_kernel"
is working but "start_kernel" is never reached AFAIT. The last message
that I see is: "Now booting the kernel".
So I turned some LEDs on the Development board off in "load_kernel" and
tried to turn them back on in "start_kernel" I would like to know if
that still works. Or is not possible because the IO addresses are not
mapped via the MMU at the time. When I try to turn them back on in
"start_kernel"?
I used the following code:
*(volatile unsigned int *) (0x40000000 + 4) = 0x0;
__asm__ volatile ("eieio");
*(volatile unsigned int *) (0x40000000 + 0) = 0x0;
__asm__ volatile ("eieio");
First memory mapped io is direction register and the second call turns the leds
on/off. It works in the "load_kernel" routine.
Thomas
^ permalink raw reply
* 'mmap' memory access causes Bus Error
From: Sachin Rane @ 2007-06-21 12:23 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]
Hi,
I got an 'Bus Error' when tried to access 'mmap' PCI memory on PPC440GX machine.
I verified this behavior with D-Link Ethernet Network card and Broadcom device.
I have appeneded the log for reference.
But the same program works fine on i386 machine i.e. accessing 'mmap' PCI memory works fine.
Any clue or solution for this problem on PPC440GX machine?
Regards,
Sachin Rane
8<--------------------------------------------------------------------
Machine check in kernel mode.
Data Write PLB Error
PLB0: BEAR=0x00000000fffe0000 ACR= 0x9b000000 BESR= 0x00800000
POB0: BEAR=0x00000005dfff74df BESR0=0x00000000 BESR1=0x00000000
OPB0: BEAR=0x0000000f7fffffef BSTAT=0x00000000
Oops: machine check, sig: 7 [#3]
NIP: C0002420 LR: C00022C4 CTR: 00000000
REGS: c020ff50 TRAP: 0202 Not tainted (2.6.16.1)
MSR: 00029000 <EE,ME> CR: 22000484 XER: 00000000
TASK = c7d63450[40] 'cdksim' THREAD: c79dc000
GPR00: 00000000 C79DDF40 C7D63450 00004000 00000001 00000000 C785B940 7FA18498
GPR08: 00000000 00000004 00029002 00000000 22000482 100AFAA0 07FF5000 007FFF3C
GPR16: 00000000 00000001 00000000 7FA18480 00000000 10195BA0 7FA18498 10195BB8
GPR24: 00000000 00000001 30021800 7FD75C50 00000000 00000000 10047234 7FD745E0
NIP [C0002420] do_user_signal+0x8/0xc4
LR [C00022C4] ret_from_mcheck_exc+0x0/0xe0
Call Trace:
[C79DDF40] [C00022C4] ret_from_mcheck_exc+0x0/0xe0 (unreliable)
Instruction dump:
48182ccd 3d400002 614a1002 7d400124 54290024 81290024 71200008 40a2ffdc
71200004 4182fc74 614a8000 7d400124 <806100b0> 70600001 41820058 91a10044
8<--------------------------------------------------------------------
[-- Attachment #2: Type: text/html, Size: 2499 bytes --]
^ permalink raw reply
* Re: [RFC] Device tree for new desktop platform in arch/powerpc
From: Benjamin Herrenschmidt @ 2007-06-21 12:36 UTC (permalink / raw)
To: Gerhard Pircher; +Cc: list
In-Reply-To: <20070618185715.321010@gmx.net>
> 2. I tried to define all ISA devices, which are integrated in the
> southbridge (VT82C686B). Currently these are child nodes of the device
> tree root. Should they be child nodes of the southbridge's PCI-to-ISA
> device node? If so, where should I specify the register address ranges
> (reg property)? In the PCI device node or in the ISA device nodes, as
> it is now?
You should have /pci/isa <--- this is the PCI2ISA bridge
and the ISA devices below that. Best is I send you an example of a CHRP
or pSeries devie-tree with ISA stuff on it tomorrow. Ping me if I
forget.
> 3. The dts files define the device_type of a serial port as "serial",
> whereas the OF spec says "pnpPNP,501". What's the difference between
> the two?
Use the pnp stuff for "compatible", you can mostly ignore device_type or
set it to the same as name.
> 4. I couldn't find any information for a device tree representation of
> the i8259 interrupt controller in the booting-without-of.txt file. Is
> my implementation correct (inspired by the OF documents)?
Haven't looked at your .dts yet but it should be "interrupt-controller",
compatible "chrp,iic" or "i8259", with a #interrupt-cells of 2 and
interrupts following the standard ISA encoding. You probably also want
an interrupt-parent property in the isa bridge node pointing back to the
8259 so it becomes the default for all ISA devices.
> I would be grateful, if you could take a look at my dts file and
> comment on every line that doesn't meet your views.
Will do as soon as I find some time...
Ben.
^ permalink raw reply
* Re: [RFC/PATCH] powerpc: MPC7450 L2 HW cache flush feature utilization
From: Benjamin Herrenschmidt @ 2007-06-21 12:37 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev list
In-Reply-To: <20070615212016.GB18055@mag.az.mvista.com>
On Fri, 2007-06-15 at 14:20 -0700, Mark A. Greer wrote:
> On Fri, Jun 15, 2007 at 10:14:24AM +0200, Segher Boessenkool wrote:
>
> > > I've double checked this. All processors considered 7450 in the kernel
> > > are covered by MPC7450 RISC Microprocessor Family Reference Manual
> > > where hardware cache flushing procedure is described.
> >
> > Nice. Now all that remains to be done is for the patch to
> > be tested on actual hardware for at least a few of those
> > other CPUs. Any volunteers?
>
> I just booted & played around on a prpmc2800e (7447A, 512MB) with
> this patch and it seemed to work fine.
>
> I *may* have some old sandpoint 745x modules that still work but
> I'll have to get the sandpoint working in arch/powerpc again.
> I'll try to get to that in a week or so.
The thing that needs torture is the powerbook sleep/wakeup code. That's
where all the cache flushing issues have been biting in the past.
Ben.
^ permalink raw reply
* Re: [RFC] Device tree for new desktop platform in arch/powerpc
From: Benjamin Herrenschmidt @ 2007-06-21 12:42 UTC (permalink / raw)
To: David Gibson; +Cc: list
In-Reply-To: <20070619054232.GB32039@localhost.localdomain>
On Tue, 2007-06-19 at 15:42 +1000, David Gibson wrote:
>
> Is there a device binding defined somewhere for "chrp,iic"?
Yes, it's the standard for 8259 on chrp and chrp-like platforms.
> > interrupt-controller;
> > reg = <20 2 a0 2 4d0 2>;
> > reserved-interrupts = <2>;
I'm currious about the above though, what is it ?
> > #address-cells = <1>;
Why #address-cells set to 1 ? In a PIC node, in fact, I would expect it
to be 0 to avoid any spurrious "reg" matching for interrupts.
> > #size-cells = <0>;
> > #interrupt-cells = <2>;
> > };
>
> > 8042@60 {
> > device_type = "8042";
> > compatible = "chrp,8042";
> > reg = <60 10>;
> > interrupts = <1 3 c 3>; // IRQ1, IRQ12
> (rising edge)
> > interrupt-parent = <&interrupt-controller>;
Just put the interrupt-parent pointer once in the isa bridge and all isa
devices below the bridge.
> This should cause a dtc error. Either you want &/interrupt-controller
> or give the interrupt-controller node a label and refer to that. It's
> either '&/some/full/path' or '&label'.
>
> > #address-cells = <1>;
> > #size-cells = <0>; // No physical
> address.
>
> Comment is arguably incorrect.
Yeah, not sure what that is supposed to be.
Ben.
^ permalink raw reply
* Re: General question on upgrading Linux version
From: Clemens Koller @ 2007-06-28 12:52 UTC (permalink / raw)
To: Bizhan Gholikhamseh (bgholikh); +Cc: linuxppc-embedded
In-Reply-To: <F795765B112E7344AF36AA911279641502D1A3FA@xmb-sjc-212.amer.cisco.com>
Hello, Bizhan!
Bizhan Gholikhamseh (bgholikh) schrieb:
> Hi All,
> We are using MPC8541 processor from freescale. Our current kernel
> version is based on 2.6.11 plus some patches provided by Freescale. I
> would like to update our Kernel version to a more recent version.
I am not sure about the exact versions but you propably need to switch
over from devfs to udev. (usually no big deal)
> I would greatly appreciate if you could provide me with some general
> guideline on how to proceed .....
I follow the latest stable and latest-git from kernel.org. I didn't run
into major problems over here for MPC8540, however I am still on the old
ARCH=ppc. ARCH=powerpc compiles fine as well. I just had no time to have
a closer look at the DeviceTree/OpenFirmware/U-Boot stuff.
Is there any brief HowTo migrate from ppc to powerpc including u-boot?
Best greets,
--
Clemens Koller
__________________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Straße 45/1
Linhof Werksgelände
D-81379 München
Tel.089-741518-50
Fax 089-741518-19
http://www.anagramm-technology.com
^ permalink raw reply
* Re: OPB vs. PLB DDR Memory Controller
From: Andrei Konovalov @ 2007-06-21 13:23 UTC (permalink / raw)
To: Thomas Glanzmann; +Cc: linuxppc-embedded
In-Reply-To: <20070620134537.GA11302@cip.informatik.uni-erlangen.de>
Hello Thomas,
Thomas Glanzmann wrote:
> Hello,
> I used secretlabs kernel tree and build my hardware once with the obp
> uart and once with the uart lite and compiled in the coresponding
> drivers into the linux kernel.
>
> loaded at: 00400000 004951A0
> board data at: 00000000 0000007C
> relocated to: 0040402C 004040A8
> zimage at: 00404EE5 00492F1A
> avail ram: 00496000 7C9E2378
>
> Linux/PPC load: root=/dev/nfs rw ip=on
This cmd line doesn't tell the kernel where the console is.
You could try
"console=ttyS0,9600 root=/dev/nfs rw ip=on" (if the UART is 16x50)
or
"console=ttyUL0 root=/dev/nfs rw ip=on" (if the UART is UART Lite)
Thanks,
Andrei
> Uncompressing Linux...done.
> Now booting the kernel
>
> As you can see the embedded boot loader works, but the kernel does not
> produce any output. I wonder if I have to configure Linux that it has a
> OPB Memory Controller instead of a PLB Memory Controller. I used the
> ml403 Option in my kernel config.
>
> Thomas
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* Re: [RFC] Device tree for new desktop platform in arch/powerpc
From: Gerhard Pircher @ 2007-06-21 13:20 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1182429406.24740.6.camel@localhost.localdomain>
-------- Original-Nachricht --------
Datum: Thu, 21 Jun 2007 22:36:46 +1000
Von: Benjamin Herrenschmidt <benh@kernel.crashing.org>
An: Gerhard Pircher <gerhard_pircher@gmx.net>
CC: linuxppc-dev@ozlabs.org, list <linuxppc-dev@ozlabs.org>
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc
> You should have /pci/isa <--- this is the PCI2ISA bridge
>
> and the ISA devices below that. Best is I send you an example of a CHRP
> or pSeries devie-tree with ISA stuff on it tomorrow. Ping me if I
> forget.
That would help a lot. Thank you!
> Haven't looked at your .dts yet but it should be "interrupt-controller",
> compatible "chrp,iic" or "i8259", with a #interrupt-cells of 2 and
> interrupts following the standard ISA encoding. You probably also want
> an interrupt-parent property in the isa bridge node pointing back to the
> 8259 so it becomes the default for all ISA devices.
What about PCI devices? Wouldn't it better to define the interrupt-parent property in the PCI bus node?
Gerhard
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
^ permalink raw reply
* Re: [RFC] Device tree for new desktop platform in arch/powerpc
From: Gerhard Pircher @ 2007-06-21 13:28 UTC (permalink / raw)
To: Benjamin Herrenschmidt, david; +Cc: linuxppc-dev
In-Reply-To: <1182429733.24740.12.camel@localhost.localdomain>
-------- Original-Nachricht --------
Datum: Thu, 21 Jun 2007 22:42:13 +1000
Von: Benjamin Herrenschmidt <benh@kernel.crashing.org>
An: David Gibson <david@gibson.dropbear.id.au>
CC: Gerhard Pircher <gerhard_pircher@gmx.net>, linuxppc-dev@ozlabs.org, list <linuxppc-dev@ozlabs.org>
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc
> > > interrupt-controller;
> > > reg = <20 2 a0 2 4d0 2>;
> > > reserved-interrupts = <2>;
>
> I'm currious about the above though, what is it ?
Quote from the CHRP ISA interrupt controller device binding document:
“reserved-interrupts”
Standard property name to define reserved interrupts.
prop-encoded-array: An integer array, encoded with encode-int.
The value of this property shall be a list of ISA interrupts which cannot
be assigned due to cascading, wiring, or other reasons. Only the irq# part
of the property is pertinent to this use.
- End -
> > > #address-cells = <1>;
>
> Why #address-cells set to 1 ? In a PIC node, in fact, I would expect it
> to be 0 to avoid any spurrious "reg" matching for interrupts.
Yeah, I got them wrong almost everywhere.
regards,
Gerhard
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
^ permalink raw reply
* network load 8245 vs. 8347E
From: Marc Leeman @ 2007-06-21 14:15 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1.1: Type: text/plain, Size: 804 bytes --]
Ok, I guess it's comparing apples to lemons here, but I'll have a go at
it anyway.
I'm trying to figure out why partial network decoding on an 8347E is
disappointingly slow wrt an older 8245 processor.
When simply receiving (cf. att) a multicast stream of 12 Mbps, an
8245/uclibc 0.9.28 @350 MHz, ppc arch , the system runs smoothly at a
load of around 4% on a e100 based MAC (pci: 8086:1209 ).
When doing the same thing on 8347e/0.9.28 @400 Mhz, powerpc arch, the
system is loaded at around 34%.
any clues?
This program just takes in data and does nothing with it, to limit the
search area :)
--
greetz, marc
You know until today, I never really realized how much I love my feet.
Chiana - Vitas Mortis
chiana 2.6.18-4-ixp4xx #1 Tue Mar 27 18:01:56 BST 2007 GNU/Linux
[-- Attachment #1.2: recv_mcast.c --]
[-- Type: text/x-csrc, Size: 3067 bytes --]
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFSIZE 64*1024 /* Maximal packet content is 64k bytes */
#define MAXPARAMLEN 80
void error(char *msg);
int main(int argc, char *argv[])
{
int socket_val, bind_val, recvfromval, ctrlboardlen, cameralen,
i, rc, recvbuff, optlen;
u_short ctrlboardPort;
struct ip_mreq mreq;
struct sockaddr_in ctrlboard, camera;
struct in_addr mcast_address;
struct hostent *h;
unsigned char buffer[BUFSIZE], ctrlboardip[16], sendseq[11];
FILE *fc,*fp;
/* Initialize the buffer */
bzero(buffer,BUFSIZE);
if(argc!=3) {
fprintf(stdout,"usage : %s <mcast address> <mcast port>\n",argv[0]);
exit(0);
}
/* Get mcast address to listen to */
h=gethostbyname(argv[1]);
if(h==NULL) {
fprintf(stdout,"Unknown group %s\n",ctrlboardip);
exit(1);
}
ctrlboardPort=atoi(argv[2]);
memcpy(&mcast_address, h->h_addr_list[0],h->h_length);
/* Check given address is multicast */
if(!IN_MULTICAST(ntohl(mcast_address.s_addr))) {
fprintf(stdout,"Given address '%s' is not multicast\n",
inet_ntoa(mcast_address));
exit(1);
}
/* Create socket for incoming connections */
socket_val=socket(AF_INET, SOCK_DGRAM, 0);
if (socket_val < 0)
error("Error opening socket");
/* Set content of ctrlboard */
ctrlboardlen = sizeof(ctrlboard);
bzero(&ctrlboard,ctrlboardlen);
/* Fill in the UDP Receiver properties */
ctrlboard.sin_family=AF_INET;
ctrlboard.sin_addr.s_addr=htonl(INADDR_ANY);
ctrlboard.sin_port=htons(ctrlboardPort);
/* Set socket options */
recvbuff=128*1024;
if (setsockopt(socket_val,SOL_SOCKET,SO_RCVBUF,(char *) &recvbuff, sizeof(recvbuff)) < 0)
error("Error setting socket options");
/* Get socket options */
optlen=sizeof(recvbuff);
if (getsockopt(socket_val,SOL_SOCKET,SO_RCVBUF,(char *) &recvbuff, &optlen) < 0)
error("Error getting socket options");
fprintf(stdout,"Receive buffer size: %d \n",recvbuff);
/* Bind to associate port number with the socket */
bind_val = bind(socket_val,(struct sockaddr *)&ctrlboard,ctrlboardlen);
if (bind_val < 0)
error("Error bind");
/* join multicast group */
mreq.imr_multiaddr.s_addr=mcast_address.s_addr;
mreq.imr_interface.s_addr=htonl(INADDR_ANY);
rc = setsockopt(socket_val,IPPROTO_IP,IP_ADD_MEMBERSHIP, (void *) &mreq, sizeof(mreq));
if(rc<0)
{
fprintf(stdout,"Cannot join multicast group '%s'", inet_ntoa(mcast_address));
exit(1);
}
else
fprintf(stdout,"Listening to mgroup %s:%d\n", inet_ntoa(mcast_address), ctrlboardPort);
/* Fill in length of struct sockaddr_in camera */
cameralen = sizeof(camera);
/* Loop */
while (1) {
recvfromval = recvfrom(socket_val,buffer,BUFSIZE,0,(struct sockaddr *)&camera,&cameralen);
if (recvfromval < 0) error("Error recvfrom");
}
close(socket_val);
fclose(fp);
}
void error(char *msg) {
perror(msg);
exit(0);
}
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [patch 0/6] PS3 Storage Drivers for 2.6.23, take 3
From: Geert Uytterhoeven @ 2007-06-21 14:14 UTC (permalink / raw)
To: Paul Mackerras, linuxppc-dev
Cc: Jens Axboe, James E.J. Bottomley, linux-kernel, linux-scsi
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]
Hi,
This is the third submission of the new PS3 storage drivers:
[1] ps3: Preallocate bootmem memory for the PS3 FLASH ROM storage driver
[2] ps3: Storage Driver Core
[3] ps3: Storage device registration routines.
[4] ps3: Disk Storage Driver
[5] ps3: BD/DVD/CD-ROM Storage Driver
[6] ps3: FLASH ROM Storage Driver
They are based on:
- the current Linux kernel source tree,
- plus the PS3 patches already submitted by Geoff Levand on linuxppc-dev,
- plus the shost_priv() patch in scsi-misc.
All issues raised during the previous review rounds should be fixed.
If there are no more comments, please apply for 2.6.23. Since they depend on
other PS3 work, I think it's most logical to let Paul integrate them.
Thanks in advance!
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply
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