* [PATCH] powerpc: Fix platinumfb framebuffer
From: Benjamin Herrenschmidt @ 2007-09-19 4:50 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev list, Linux Fbdev development list
powerpc: Fix platinumfb resource handling
Current kernels have a non-working platinumfb due to some resource
management issues. This fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Note: platinumfb is a powermac only driver
Index: linux-work/drivers/video/platinumfb.c
===================================================================
--- linux-work.orig/drivers/video/platinumfb.c 2007-09-19 14:21:42.000000000 +1000
+++ linux-work/drivers/video/platinumfb.c 2007-09-19 14:47:11.000000000 +1000
@@ -17,6 +17,8 @@
* more details.
*/
+#undef DEBUG
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -535,33 +537,35 @@ static int __devinit platinumfb_probe(st
volatile __u8 *fbuffer;
int bank0, bank1, bank2, bank3, rc;
- printk(KERN_INFO "platinumfb: Found Apple Platinum video hardware\n");
+ dev_info(&odev->dev, "Found Apple Platinum video hardware\n");
info = framebuffer_alloc(sizeof(*pinfo), &odev->dev);
- if (info == NULL)
+ if (info == NULL) {
+ dev_err(&odev->dev, "Failed to allocate fbdev !\n");
return -ENOMEM;
+ }
pinfo = info->par;
if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) ||
of_address_to_resource(dp, 1, &pinfo->rsrc_fb)) {
- printk(KERN_ERR "platinumfb: Can't get resources\n");
- framebuffer_release(info);
- return -ENXIO;
- }
- if (!request_mem_region(pinfo->rsrc_reg.start,
- pinfo->rsrc_reg.start -
- pinfo->rsrc_reg.end + 1,
- "platinumfb registers")) {
+ dev_err(&odev->dev, "Can't get resources\n");
framebuffer_release(info);
return -ENXIO;
}
+ dev_dbg(&odev->dev, " registers : 0x%llx...0x%llx\n",
+ (unsigned long long)pinfo->rsrc_reg.start,
+ (unsigned long long)pinfo->rsrc_reg.end);
+ dev_dbg(&odev->dev, " framebuffer: 0x%llx...0x%llx\n",
+ (unsigned long long)pinfo->rsrc_fb.start,
+ (unsigned long long)pinfo->rsrc_fb.end);
+
+ /* Do not try to request register space, they overlap with the
+ * northbridge and that can fail. Only request framebuffer
+ */
if (!request_mem_region(pinfo->rsrc_fb.start,
- pinfo->rsrc_fb.start
- - pinfo->rsrc_fb.end + 1,
+ pinfo->rsrc_fb.end - pinfo->rsrc_fb.start + 1,
"platinumfb framebuffer")) {
- release_mem_region(pinfo->rsrc_reg.start,
- pinfo->rsrc_reg.end -
- pinfo->rsrc_reg.start + 1);
+ printk(KERN_ERR "platinumfb: Can't request framebuffer !\n");
framebuffer_release(info);
return -ENXIO;
}
@@ -600,7 +604,8 @@ static int __devinit platinumfb_probe(st
bank2 = fbuffer[0x200000] == 0x56;
bank3 = fbuffer[0x300000] == 0x78;
pinfo->total_vram = (bank0 + bank1 + bank2 + bank3) * 0x100000;
- printk(KERN_INFO "platinumfb: Total VRAM = %dMB (%d%d%d%d)\n", (int) (pinfo->total_vram / 1024 / 1024),
+ printk(KERN_INFO "platinumfb: Total VRAM = %dMB (%d%d%d%d)\n",
+ (unsigned int) (pinfo->total_vram / 1024 / 1024),
bank3, bank2, bank1, bank0);
/*
@@ -644,16 +649,15 @@ static int __devexit platinumfb_remove(s
unregister_framebuffer (info);
/* Unmap frame buffer and registers */
+ iounmap(pinfo->frame_buffer);
+ iounmap(pinfo->platinum_regs);
+ iounmap(pinfo->cmap_regs);
+
release_mem_region(pinfo->rsrc_fb.start,
pinfo->rsrc_fb.end -
pinfo->rsrc_fb.start + 1);
- release_mem_region(pinfo->rsrc_reg.start,
- pinfo->rsrc_reg.end -
- pinfo->rsrc_reg.start + 1);
- iounmap(pinfo->frame_buffer);
- iounmap(pinfo->platinum_regs);
+
release_mem_region(pinfo->cmap_regs_phys, 0x1000);
- iounmap(pinfo->cmap_regs);
framebuffer_release(info);
^ permalink raw reply
* Re: Jtag under Linux on MPC875
From: Sven Luther @ 2007-09-19 4:56 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-embedded
In-Reply-To: <20070918144905.GF441@ld0162-tx32.am.freescale.net>
On Tue, Sep 18, 2007 at 09:49:05AM -0500, Scott Wood wrote:
> On Tue, Sep 18, 2007 at 11:04:27AM +0200, fabien wrote:
> > I'm new in embedded system and i need some informations ...
> > Which tool could i use to connect my board througt the JTAG connector ?
> > My board is a custom board with a MPC875, and flash is S29GL032M. The probe
> > that can i use is
> > a PowerPC BDM windriver Probe 2.
> > I'm looking for a tool running on linux.
>
> The Abatron BDI2000 works well with Linux.
Indeed, but i was not able to put my MPC875 board in halt state once linux
started running. I hear Vitaly has had similar problems too.
Wolfgang said it worked though, so this may be due to a hardware quirk
or some misconfiguration or something. I am not really a bdi config file
expert myself.
Friendly,
Sven Luther
^ permalink raw reply
* Re: Linux based MPC855 SPI driver
From: Sven Luther @ 2007-09-19 4:57 UTC (permalink / raw)
To: Hesam Kohanteb; +Cc: linuxppc-embedded
In-Reply-To: <46F06313.8080007@Sun.COM>
On Tue, Sep 18, 2007 at 04:45:23PM -0700, Hesam Kohanteb wrote:
> Hi,
> I urgently need to implement a Linux based SPI driver for MPC855. Can
> please point me to one if exists or to a similar one MPC823.
I wrote something for the MPC875, need some cleanup, but i could send it
to you if you are interested. Please ask me personally.
Friendly,
Sven Luther
^ permalink raw reply
* [PATCH] powerpc mm init_32 gdb regions
From: Ed Swarthout @ 2007-09-19 5:09 UTC (permalink / raw)
To: galak, linuxppc-dev; +Cc: Ed Swarthout
Add memory regions to the kcore list for 32-bit machines.
Since the entries are only 32-bit, keep under 4G.
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
---
Adapted from init_64.c
arch/powerpc/mm/init_32.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index d65995a..d804c65 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -255,3 +255,37 @@ void free_initrd_mem(unsigned long start, unsigned long end)
}
}
#endif
+
+static struct kcore_list kcore_vmem;
+
+static int __init setup_kcore(void)
+{
+ int i;
+
+ for (i=0; i < lmb.memory.cnt; i++) {
+ unsigned long base, size;
+ struct kcore_list *kcore_mem;
+
+ base = lmb.memory.region[i].base;
+ size = lmb.memory.region[i].size;
+
+ kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
+ if (!kcore_mem)
+ panic("%s: kmalloc failed\n", __FUNCTION__);
+
+ /* must stay under 32 bits */
+ if ( 0xfffffffful - (unsigned long)__va(base) < size) {
+ size = 0xfffffffful - (unsigned long)(__va(base));
+ printk(KERN_DEBUG "setup_kcore: restrict size=%lx\n",
+ size);
+ }
+
+ kclist_add(kcore_mem, __va(base), size);
+ }
+
+ kclist_add(&kcore_vmem, (void *)VMALLOC_START,
+ VMALLOC_END-VMALLOC_START);
+
+ return 0;
+}
+module_init(setup_kcore);
--
1.5.3.rc6.63.gf7c18
^ permalink raw reply related
* Re: [PATCH 13/28] 8xx: Infrastructure code cleanup.
From: Scott Wood @ 2007-09-19 5:28 UTC (permalink / raw)
To: galak, linuxppc-dev
In-Reply-To: <20070919042533.GB30212@localhost.localdomain>
On Wed, Sep 19, 2007 at 02:25:33PM +1000, David Gibson wrote:
> On Mon, Sep 17, 2007 at 11:57:42AM -0500, Scott Wood wrote:
> > 1. Keep a global mpc8xx_immr mapping, rather than constantly
> > creating temporary mappings.
>
> Nice, but again, it seems a bit pointless to leave in all the
> immr_map() / immr_unmap() pairs now that they do basically nothing.
One step at a time. :-)
Once arch/ppc is gone, I'd like to do some heavier cleanup of the CPM
stuff, including merging with QE. For now, I want to touch code that's
shared between the architectures as little as possible.
-Scott
^ permalink raw reply
* Re: [PATCH 1/3] powerpc clk.h interface for platforms
From: Domen Puncer @ 2007-09-19 5:11 UTC (permalink / raw)
To: Paul Mackerras; +Cc: David Brownell, linuxppc-dev, Sylvain Munaut
In-Reply-To: <18160.39896.132391.625791@cargo.ozlabs.ibm.com>
On 19/09/07 13:47 +1000, Paul Mackerras wrote:
> Domen Puncer writes:
>
> > Paul, what do you say about this?
> > Sylvain suggested it could also be integrated with define_machine
> > interface.
>
> As it stands, your patch adds the clk_* functions on all platforms.
> What platforms would actually want to use them?
52xx
Reason for adding it to all was that EXPORT_SYMBOL's would clash if
one were to add clk support for another platform.
Domen
>
> Paul.
^ permalink raw reply
* [PATCH 4/5] Include hrtimer.h in tick.h.
From: Tony Breeds @ 2007-09-19 6:49 UTC (permalink / raw)
To: linuxppc-dev, Paul Mackerras; +Cc: Thomas Gleixner, Realtime Kernel
In-Reply-To: <1190184586.867449.381310088392.qpush@thor>
struct tick_shed uses struct hrtimer, explictly include the right header file.
preemtivly fixes the following warning
CC arch/powerpc/platforms/iseries/setup.o
In file included from arch/powerpc/platforms/iseries/setup.c:30:
include/linux/tick.h:45: error: field 'sched_timer' has incomplete type
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
include/linux/tick.h | 1 +
1 file changed, 1 insertion(+)
Index: working/include/linux/tick.h
===================================================================
--- working.orig/include/linux/tick.h
+++ working/include/linux/tick.h
@@ -7,6 +7,7 @@
#define _LINUX_TICK_H
#include <linux/clockchips.h>
+#include <linux/hrtimer.h>
#ifdef CONFIG_GENERIC_CLOCKEVENTS
^ permalink raw reply
* [PATCH 2/5] Implement generic time of day clocksource for powerpc machines.
From: Tony Breeds @ 2007-09-19 6:49 UTC (permalink / raw)
To: linuxppc-dev, Paul Mackerras; +Cc: Thomas Gleixner, Realtime Kernel
In-Reply-To: <1190184586.867449.381310088392.qpush@thor>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
arch/powerpc/Kconfig | 6
arch/powerpc/kernel/time.c | 255 ++++++++++++-------------------------
2 files changed, 91 insertions(+), 170 deletions(-)
Index: working/arch/powerpc/Kconfig
===================================================================
--- working.orig/arch/powerpc/Kconfig
+++ working/arch/powerpc/Kconfig
@@ -24,6 +24,12 @@ config MMU
config GENERIC_CMOS_UPDATE
def_bool y
+config GENERIC_TIME
+ def_bool y
+
+config GENERIC_TIME_VSYSCALL
+ def_bool y
+
config GENERIC_HARDIRQS
bool
default y
Index: working/arch/powerpc/kernel/time.c
===================================================================
--- working.orig/arch/powerpc/kernel/time.c
+++ working/arch/powerpc/kernel/time.c
@@ -74,9 +74,28 @@
#endif
#include <asm/smp.h>
+/* powerpc clocksource/clockevent code */
+
+#include <linux/clocksource.h>
+
+static cycle_t timebase_read(void);
+
+static struct clocksource clocksource_timebase = {
+ .name = "timebase",
+ .rating = 400,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ .mask = CLOCKSOURCE_MASK(64),
+ .shift = 22,
+ .mult = 0, /* To be filled in */
+ .read = timebase_read,
+};
+
#ifdef CONFIG_PPC_ISERIES
static unsigned long __initdata iSeries_recal_titan;
static signed long __initdata iSeries_recal_tb;
+
+/* Forward declaration is only needed for iSereis compiles */
+void __init clocksource_init(void);
#endif
#define XSEC_PER_SEC (1024*1024)
@@ -344,65 +363,6 @@ void udelay(unsigned long usecs)
}
EXPORT_SYMBOL(udelay);
-/*
- * This version of gettimeofday has microsecond resolution.
- */
-static inline void __do_gettimeofday(struct timeval *tv)
-{
- unsigned long sec, usec;
- u64 tb_ticks, xsec;
- struct gettimeofday_vars *temp_varp;
- u64 temp_tb_to_xs, temp_stamp_xsec;
-
- /*
- * These calculations are faster (gets rid of divides)
- * if done in units of 1/2^20 rather than microseconds.
- * The conversion to microseconds at the end is done
- * without a divide (and in fact, without a multiply)
- */
- temp_varp = do_gtod.varp;
-
- /* Sampling the time base must be done after loading
- * do_gtod.varp in order to avoid racing with update_gtod.
- */
- data_barrier(temp_varp);
- tb_ticks = get_tb() - temp_varp->tb_orig_stamp;
- temp_tb_to_xs = temp_varp->tb_to_xs;
- temp_stamp_xsec = temp_varp->stamp_xsec;
- xsec = temp_stamp_xsec + mulhdu(tb_ticks, temp_tb_to_xs);
- sec = xsec / XSEC_PER_SEC;
- usec = (unsigned long)xsec & (XSEC_PER_SEC - 1);
- usec = SCALE_XSEC(usec, 1000000);
-
- tv->tv_sec = sec;
- tv->tv_usec = usec;
-}
-
-void do_gettimeofday(struct timeval *tv)
-{
- if (__USE_RTC()) {
- /* do this the old way */
- unsigned long flags, seq;
- unsigned int sec, nsec, usec;
-
- do {
- seq = read_seqbegin_irqsave(&xtime_lock, flags);
- sec = xtime.tv_sec;
- nsec = xtime.tv_nsec + tb_ticks_since(tb_last_jiffy);
- } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
- usec = nsec / 1000;
- while (usec >= 1000000) {
- usec -= 1000000;
- ++sec;
- }
- tv->tv_sec = sec;
- tv->tv_usec = usec;
- return;
- }
- __do_gettimeofday(tv);
-}
-
-EXPORT_SYMBOL(do_gettimeofday);
/*
* There are two copies of tb_to_xs and stamp_xsec so that no
@@ -448,56 +408,6 @@ static inline void update_gtod(u64 new_t
++(vdso_data->tb_update_count);
}
-/*
- * When the timebase - tb_orig_stamp gets too big, we do a manipulation
- * between tb_orig_stamp and stamp_xsec. The goal here is to keep the
- * difference tb - tb_orig_stamp small enough to always fit inside a
- * 32 bits number. This is a requirement of our fast 32 bits userland
- * implementation in the vdso. If we "miss" a call to this function
- * (interrupt latency, CPU locked in a spinlock, ...) and we end up
- * with a too big difference, then the vdso will fallback to calling
- * the syscall
- */
-static __inline__ void timer_recalc_offset(u64 cur_tb)
-{
- unsigned long offset;
- u64 new_stamp_xsec;
- u64 tlen, t2x;
- u64 tb, xsec_old, xsec_new;
- struct gettimeofday_vars *varp;
-
- if (__USE_RTC())
- return;
- tlen = current_tick_length();
- offset = cur_tb - do_gtod.varp->tb_orig_stamp;
- if (tlen == last_tick_len && offset < 0x80000000u)
- return;
- if (tlen != last_tick_len) {
- t2x = mulhdu(tlen << TICKLEN_SHIFT, ticklen_to_xs);
- last_tick_len = tlen;
- } else
- t2x = do_gtod.varp->tb_to_xs;
- new_stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC;
- do_div(new_stamp_xsec, 1000000000);
- new_stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC;
-
- ++vdso_data->tb_update_count;
- smp_mb();
-
- /*
- * Make sure time doesn't go backwards for userspace gettimeofday.
- */
- tb = get_tb();
- varp = do_gtod.varp;
- xsec_old = mulhdu(tb - varp->tb_orig_stamp, varp->tb_to_xs)
- + varp->stamp_xsec;
- xsec_new = mulhdu(tb - cur_tb, t2x) + new_stamp_xsec;
- if (xsec_new < xsec_old)
- new_stamp_xsec += xsec_old - xsec_new;
-
- update_gtod(cur_tb, new_stamp_xsec, t2x);
-}
-
#ifdef CONFIG_SMP
unsigned long profile_pc(struct pt_regs *regs)
{
@@ -569,6 +479,8 @@ static int __init iSeries_tb_recal(void)
iSeries_recal_titan = titan;
iSeries_recal_tb = tb;
+ /* Called here as now we know accurate values for the timebase */
+ clocksource_init();
return 0;
}
late_initcall(iSeries_tb_recal);
@@ -651,7 +563,6 @@ void timer_interrupt(struct pt_regs * re
if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) {
tb_last_jiffy = tb_next_jiffy;
do_timer(1);
- timer_recalc_offset(tb_last_jiffy);
}
write_sequnlock(&xtime_lock);
}
@@ -723,66 +634,6 @@ unsigned long long sched_clock(void)
return mulhdu(get_tb() - boot_tb, tb_to_ns_scale) << tb_to_ns_shift;
}
-int do_settimeofday(struct timespec *tv)
-{
- time_t wtm_sec, new_sec = tv->tv_sec;
- long wtm_nsec, new_nsec = tv->tv_nsec;
- unsigned long flags;
- u64 new_xsec;
- unsigned long tb_delta;
-
- if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
- return -EINVAL;
-
- write_seqlock_irqsave(&xtime_lock, flags);
-
- /*
- * Updating the RTC is not the job of this code. If the time is
- * stepped under NTP, the RTC will be updated after STA_UNSYNC
- * is cleared. Tools like clock/hwclock either copy the RTC
- * to the system time, in which case there is no point in writing
- * to the RTC again, or write to the RTC but then they don't call
- * settimeofday to perform this operation.
- */
-
- /* Make userspace gettimeofday spin until we're done. */
- ++vdso_data->tb_update_count;
- smp_mb();
-
- /*
- * Subtract off the number of nanoseconds since the
- * beginning of the last tick.
- */
- tb_delta = tb_ticks_since(tb_last_jiffy);
- tb_delta = mulhdu(tb_delta, do_gtod.varp->tb_to_xs); /* in xsec */
- new_nsec -= SCALE_XSEC(tb_delta, 1000000000);
-
- wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - new_sec);
- wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - new_nsec);
-
- set_normalized_timespec(&xtime, new_sec, new_nsec);
- set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
-
- ntp_clear();
-
- new_xsec = xtime.tv_nsec;
- if (new_xsec != 0) {
- new_xsec *= XSEC_PER_SEC;
- do_div(new_xsec, NSEC_PER_SEC);
- }
- new_xsec += (u64)xtime.tv_sec * XSEC_PER_SEC;
- update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs);
-
- vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
- vdso_data->tz_dsttime = sys_tz.tz_dsttime;
-
- write_sequnlock_irqrestore(&xtime_lock, flags);
- clock_was_set();
- return 0;
-}
-
-EXPORT_SYMBOL(do_settimeofday);
-
static int __init get_freq(char *name, int cells, unsigned long *val)
{
struct device_node *cpu;
@@ -874,6 +725,64 @@ unsigned long read_persistent_clock(void
tm.tm_hour, tm.tm_min, tm.tm_sec);
}
+/* clocksource code */
+/* FIXME: provide an RTC clocksource /or/ use a better name */
+static cycle_t timebase_read(void)
+{
+ if (__USE_RTC())
+ return (cycle_t)get_rtc();
+ return (cycle_t)get_tb();
+}
+
+void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
+{
+ u64 t2x, stamp_xsec;
+
+ if (__USE_RTC() || clock != &clocksource_timebase)
+ return;
+
+ /* Make userspace gettimeofday spin until we're done. */
+ ++vdso_data->tb_update_count;
+ smp_mb();
+
+ /* XXX this assumes clock->shift == 22 */
+ /* 4611686018 ~= 2^(20+64-22) / 1e9 */
+ t2x = (u64) clock->mult * 4611686018ULL;
+ stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC;
+ do_div(stamp_xsec, 1000000000);
+ stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC;
+ update_gtod(clock->cycle_last, stamp_xsec, t2x);
+}
+
+void update_vsyscall_tz(void)
+{
+ /* Make userspace gettimeofday spin until we're done. */
+ ++vdso_data->tb_update_count;
+ smp_mb();
+ vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
+ vdso_data->tz_dsttime = sys_tz.tz_dsttime;
+ smp_mb();
+ ++vdso_data->tb_update_count;
+}
+
+void __init clocksource_init(void)
+{
+ int mult = clocksource_hz2mult(tb_ticks_per_sec,
+ clocksource_timebase.shift);
+
+ clocksource_timebase.mult = mult;
+
+ if (clocksource_register(&clocksource_timebase)) {
+ printk(KERN_ERR "clocksource: %s is already registered\n",
+ clocksource_timebase.name);
+ return;
+ }
+
+ printk(KERN_INFO "clocksource: %s mult[%x] shift[%d] registered\n",
+ clocksource_timebase.name,
+ clocksource_timebase.mult, clocksource_timebase.shift);
+}
+
/* This function is only called on the boot processor */
void __init time_init(void)
{
@@ -983,6 +892,12 @@ void __init time_init(void)
write_sequnlock_irqrestore(&xtime_lock, flags);
+ /* Register the clocksource, if we're not running on iSeries */
+#ifdef CONFIG_ISERIES
+ if (!firmware_has_feature(FW_FEATURE_ISERIES))
+#endif
+ clocksource_init();
+
/* Not exact, but the timer interrupt takes care of this */
set_dec(tb_ticks_per_jiffy);
}
^ permalink raw reply
* [PATCH 5/5] Enable tickless idle and high res timers for powerpc
From: Tony Breeds @ 2007-09-19 6:49 UTC (permalink / raw)
To: linuxppc-dev, Paul Mackerras; +Cc: Thomas Gleixner, Realtime Kernel
In-Reply-To: <1190184586.867449.381310088392.qpush@thor>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/kernel/idle.c | 3 +++
arch/powerpc/platforms/iseries/setup.c | 5 +++++
3 files changed, 9 insertions(+)
Index: working/arch/powerpc/Kconfig
===================================================================
--- working.orig/arch/powerpc/Kconfig
+++ working/arch/powerpc/Kconfig
@@ -168,6 +168,7 @@ config HIGHMEM
bool "High memory support"
depends on PPC32
+source kernel/time/Kconfig
source kernel/Kconfig.hz
source kernel/Kconfig.preempt
source "fs/Kconfig.binfmt"
Index: working/arch/powerpc/kernel/idle.c
===================================================================
--- working.orig/arch/powerpc/kernel/idle.c
+++ working/arch/powerpc/kernel/idle.c
@@ -24,6 +24,7 @@
#include <linux/smp.h>
#include <linux/cpu.h>
#include <linux/sysctl.h>
+#include <linux/tick.h>
#include <asm/system.h>
#include <asm/processor.h>
@@ -59,6 +60,7 @@ void cpu_idle(void)
set_thread_flag(TIF_POLLING_NRFLAG);
while (1) {
+ tick_nohz_stop_sched_tick();
while (!need_resched() && !cpu_should_die()) {
ppc64_runlatch_off();
@@ -90,6 +92,7 @@ void cpu_idle(void)
HMT_medium();
ppc64_runlatch_on();
+ tick_nohz_restart_sched_tick();
if (cpu_should_die())
cpu_die();
preempt_enable_no_resched();
Index: working/arch/powerpc/platforms/iseries/setup.c
===================================================================
--- working.orig/arch/powerpc/platforms/iseries/setup.c
+++ working/arch/powerpc/platforms/iseries/setup.c
@@ -26,6 +26,7 @@
#include <linux/major.h>
#include <linux/root_dev.h>
#include <linux/kernel.h>
+#include <linux/tick.h>
#include <asm/processor.h>
#include <asm/machdep.h>
@@ -562,6 +563,7 @@ static void yield_shared_processor(void)
static void iseries_shared_idle(void)
{
while (1) {
+ tick_nohz_stop_sched_tick();
while (!need_resched() && !hvlpevent_is_pending()) {
local_irq_disable();
ppc64_runlatch_off();
@@ -575,6 +577,7 @@ static void iseries_shared_idle(void)
}
ppc64_runlatch_on();
+ tick_nohz_restart_sched_tick();
if (hvlpevent_is_pending())
process_iSeries_events();
@@ -590,6 +593,7 @@ static void iseries_dedicated_idle(void)
set_thread_flag(TIF_POLLING_NRFLAG);
while (1) {
+ tick_nohz_stop_sched_tick();
if (!need_resched()) {
while (!need_resched()) {
ppc64_runlatch_off();
@@ -606,6 +610,7 @@ static void iseries_dedicated_idle(void)
}
ppc64_runlatch_on();
+ tick_nohz_restart_sched_tick();
preempt_enable_no_resched();
schedule();
preempt_disable();
^ permalink raw reply
* [PATCH 1/5] Implement {read,update}_persistent_clock.
From: Tony Breeds @ 2007-09-19 6:49 UTC (permalink / raw)
To: linuxppc-dev, Paul Mackerras; +Cc: Thomas Gleixner, Realtime Kernel
With these functions implemented we cooperate better with the generic
timekeeping code. This obsoletes the need for the timer sysdev as a bonus.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
* Compile tested for arch/powerpc/configs/*_defconfig
* Booted on pSeries, iSeries, Cell and PS3
arch/powerpc/Kconfig | 3 +
arch/powerpc/kernel/time.c | 85 ++++++++++-------------------------
arch/powerpc/sysdev/Makefile | 5 --
arch/powerpc/sysdev/timer.c | 81 ---------------------------------
4 files changed, 29 insertions(+), 145 deletions(-)
Index: working/arch/powerpc/Kconfig
===================================================================
--- working.orig/arch/powerpc/Kconfig
+++ working/arch/powerpc/Kconfig
@@ -21,6 +21,9 @@ config MMU
bool
default y
+config GENERIC_CMOS_UPDATE
+ def_bool y
+
config GENERIC_HARDIRQS
bool
default y
Index: working/arch/powerpc/kernel/time.c
===================================================================
--- working.orig/arch/powerpc/kernel/time.c
+++ working/arch/powerpc/kernel/time.c
@@ -74,16 +74,11 @@
#endif
#include <asm/smp.h>
-/* keep track of when we need to update the rtc */
-time_t last_rtc_update;
#ifdef CONFIG_PPC_ISERIES
static unsigned long __initdata iSeries_recal_titan;
static signed long __initdata iSeries_recal_tb;
#endif
-/* The decrementer counts down by 128 every 128ns on a 601. */
-#define DECREMENTER_COUNT_601 (1000000000 / HZ)
-
#define XSEC_PER_SEC (1024*1024)
#ifdef CONFIG_PPC64
@@ -349,39 +344,6 @@ void udelay(unsigned long usecs)
}
EXPORT_SYMBOL(udelay);
-static __inline__ void timer_check_rtc(void)
-{
- /*
- * update the rtc when needed, this should be performed on the
- * right fraction of a second. Half or full second ?
- * Full second works on mk48t59 clocks, others need testing.
- * Note that this update is basically only used through
- * the adjtimex system calls. Setting the HW clock in
- * any other way is a /dev/rtc and userland business.
- * This is still wrong by -0.5/+1.5 jiffies because of the
- * timer interrupt resolution and possible delay, but here we
- * hit a quantization limit which can only be solved by higher
- * resolution timers and decoupling time management from timer
- * interrupts. This is also wrong on the clocks
- * which require being written at the half second boundary.
- * We should have an rtc call that only sets the minutes and
- * seconds like on Intel to avoid problems with non UTC clocks.
- */
- if (ppc_md.set_rtc_time && ntp_synced() &&
- xtime.tv_sec - last_rtc_update >= 659 &&
- abs((xtime.tv_nsec/1000) - (1000000-1000000/HZ)) < 500000/HZ) {
- struct rtc_time tm;
- to_tm(xtime.tv_sec + 1 + timezone_offset, &tm);
- tm.tm_year -= 1900;
- tm.tm_mon -= 1;
- if (ppc_md.set_rtc_time(&tm) == 0)
- last_rtc_update = xtime.tv_sec + 1;
- else
- /* Try again one minute later */
- last_rtc_update += 60;
- }
-}
-
/*
* This version of gettimeofday has microsecond resolution.
*/
@@ -690,7 +652,6 @@ void timer_interrupt(struct pt_regs * re
tb_last_jiffy = tb_next_jiffy;
do_timer(1);
timer_recalc_offset(tb_last_jiffy);
- timer_check_rtc();
}
write_sequnlock(&xtime_lock);
}
@@ -802,11 +763,6 @@ int do_settimeofday(struct timespec *tv)
set_normalized_timespec(&xtime, new_sec, new_nsec);
set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
- /* In case of a large backwards jump in time with NTP, we want the
- * clock to be updated as soon as the PLL is again in lock.
- */
- last_rtc_update = new_sec - 658;
-
ntp_clear();
new_xsec = xtime.tv_nsec;
@@ -882,12 +838,35 @@ void __init generic_calibrate_decr(void)
#endif
}
-unsigned long get_boot_time(void)
+int update_persistent_clock(struct timespec now)
{
struct rtc_time tm;
- if (ppc_md.get_boot_time)
- return ppc_md.get_boot_time();
+ if (!ppc_md.set_rtc_time)
+ return 0;
+
+ to_tm(now.tv_sec + 1 + timezone_offset, &tm);
+ tm.tm_year -= 1900;
+ tm.tm_mon -= 1;
+
+ return ppc_md.set_rtc_time(&tm);
+}
+
+unsigned long read_persistent_clock(void)
+{
+ struct rtc_time tm;
+ static int first = 1;
+
+ /* XXX this is a litle fragile but will work okay in the short term */
+ if (first) {
+ first = 0;
+ if (ppc_md.time_init)
+ timezone_offset = ppc_md.time_init();
+
+ /* get_boot_time() isn't guaranteed to be safe to call late */
+ if (ppc_md.get_boot_time)
+ return ppc_md.get_boot_time() -timezone_offset;
+ }
if (!ppc_md.get_rtc_time)
return 0;
ppc_md.get_rtc_time(&tm);
@@ -899,14 +878,10 @@ unsigned long get_boot_time(void)
void __init time_init(void)
{
unsigned long flags;
- unsigned long tm = 0;
struct div_result res;
u64 scale, x;
unsigned shift;
- if (ppc_md.time_init != NULL)
- timezone_offset = ppc_md.time_init();
-
if (__USE_RTC()) {
/* 601 processor: dec counts down by 128 every 128ns */
ppc_tb_freq = 1000000000;
@@ -981,19 +956,14 @@ void __init time_init(void)
/* Save the current timebase to pretty up CONFIG_PRINTK_TIME */
boot_tb = get_tb_or_rtc();
- tm = get_boot_time();
-
write_seqlock_irqsave(&xtime_lock, flags);
/* If platform provided a timezone (pmac), we correct the time */
if (timezone_offset) {
sys_tz.tz_minuteswest = -timezone_offset / 60;
sys_tz.tz_dsttime = 0;
- tm -= timezone_offset;
}
- xtime.tv_sec = tm;
- xtime.tv_nsec = 0;
do_gtod.varp = &do_gtod.vars[0];
do_gtod.var_idx = 0;
do_gtod.varp->tb_orig_stamp = tb_last_jiffy;
@@ -1011,9 +981,6 @@ void __init time_init(void)
time_freq = 0;
- last_rtc_update = xtime.tv_sec;
- set_normalized_timespec(&wall_to_monotonic,
- -xtime.tv_sec, -xtime.tv_nsec);
write_sequnlock_irqrestore(&xtime_lock, flags);
/* Not exact, but the timer interrupt takes care of this */
Index: working/arch/powerpc/sysdev/Makefile
===================================================================
--- working.orig/arch/powerpc/sysdev/Makefile
+++ working/arch/powerpc/sysdev/Makefile
@@ -20,11 +20,6 @@ obj-$(CONFIG_MV64X60) += $(mv64x60-y) m
obj-$(CONFIG_RTC_DRV_CMOS) += rtc_cmos_setup.o
obj-$(CONFIG_AXON_RAM) += axonram.o
-# contains only the suspend handler for time
-ifeq ($(CONFIG_RTC_CLASS),)
-obj-$(CONFIG_PM) += timer.o
-endif
-
ifeq ($(CONFIG_PPC_MERGE),y)
obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
obj-$(CONFIG_PPC_I8259) += i8259.o
Index: working/arch/powerpc/sysdev/timer.c
===================================================================
--- working.orig/arch/powerpc/sysdev/timer.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Common code to keep time when machine suspends.
- *
- * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPLv2
- */
-
-#include <linux/time.h>
-#include <linux/sysdev.h>
-#include <asm/rtc.h>
-
-static unsigned long suspend_rtc_time;
-
-/*
- * Reset the time after a sleep.
- */
-static int timer_resume(struct sys_device *dev)
-{
- struct timeval tv;
- struct timespec ts;
- struct rtc_time cur_rtc_tm;
- unsigned long cur_rtc_time, diff;
-
- /* get current RTC time and convert to seconds */
- get_rtc_time(&cur_rtc_tm);
- cur_rtc_time = mktime(cur_rtc_tm.tm_year + 1900,
- cur_rtc_tm.tm_mon + 1,
- cur_rtc_tm.tm_mday,
- cur_rtc_tm.tm_hour,
- cur_rtc_tm.tm_min,
- cur_rtc_tm.tm_sec);
-
- diff = cur_rtc_time - suspend_rtc_time;
-
- /* adjust time of day by seconds that elapsed while
- * we were suspended */
- do_gettimeofday(&tv);
- ts.tv_sec = tv.tv_sec + diff;
- ts.tv_nsec = tv.tv_usec * NSEC_PER_USEC;
- do_settimeofday(&ts);
-
- return 0;
-}
-
-static int timer_suspend(struct sys_device *dev, pm_message_t state)
-{
- struct rtc_time suspend_rtc_tm;
- WARN_ON(!ppc_md.get_rtc_time);
-
- get_rtc_time(&suspend_rtc_tm);
- suspend_rtc_time = mktime(suspend_rtc_tm.tm_year + 1900,
- suspend_rtc_tm.tm_mon + 1,
- suspend_rtc_tm.tm_mday,
- suspend_rtc_tm.tm_hour,
- suspend_rtc_tm.tm_min,
- suspend_rtc_tm.tm_sec);
-
- return 0;
-}
-
-static struct sysdev_class timer_sysclass = {
- .resume = timer_resume,
- .suspend = timer_suspend,
- set_kset_name("timer"),
-};
-
-static struct sys_device device_timer = {
- .id = 0,
- .cls = &timer_sysclass,
-};
-
-static int time_init_device(void)
-{
- int error = sysdev_class_register(&timer_sysclass);
- if (!error)
- error = sysdev_register(&device_timer);
- return error;
-}
-
-device_initcall(time_init_device);
^ permalink raw reply
* [PATCH 3/5] Implement clockevents driver for powerpc
From: Tony Breeds @ 2007-09-19 6:49 UTC (permalink / raw)
To: linuxppc-dev, Paul Mackerras; +Cc: Thomas Gleixner, Realtime Kernel
In-Reply-To: <1190184586.867449.381310088392.qpush@thor>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
arch/powerpc/Kconfig | 3
arch/powerpc/kernel/smp.c | 3
arch/powerpc/kernel/time.c | 134 +++++++++++++++++++++++++------------
include/asm-powerpc/time.h | 1
4 files changed, 98 insertions(+), 43 deletions(-)
Index: working/arch/powerpc/Kconfig
===================================================================
--- working.orig/arch/powerpc/Kconfig
+++ working/arch/powerpc/Kconfig
@@ -30,6 +30,9 @@ config GENERIC_TIME
config GENERIC_TIME_VSYSCALL
def_bool y
+config GENERIC_CLOCKEVENTS
+ def_bool y
+
config GENERIC_HARDIRQS
bool
default y
Index: working/arch/powerpc/kernel/smp.c
===================================================================
--- working.orig/arch/powerpc/kernel/smp.c
+++ working/arch/powerpc/kernel/smp.c
@@ -560,6 +560,9 @@ int __devinit start_secondary(void *unus
if (system_state > SYSTEM_BOOTING)
snapshot_timebase();
+ /* FIXME: should be in if() above */
+ secondary_cpu_time_init();
+
spin_lock(&call_lock);
cpu_set(cpu, cpu_online_map);
spin_unlock(&call_lock);
Index: working/arch/powerpc/kernel/time.c
===================================================================
--- working.orig/arch/powerpc/kernel/time.c
+++ working/arch/powerpc/kernel/time.c
@@ -76,6 +76,7 @@
/* powerpc clocksource/clockevent code */
+#include <linux/clockchips.h>
#include <linux/clocksource.h>
static cycle_t timebase_read(void);
@@ -90,6 +91,27 @@ static struct clocksource clocksource_ti
.read = timebase_read,
};
+#define DECREMENTER_MAX 0x7fffffff
+
+static int decrementer_set_next_event(unsigned long evt,
+ struct clock_event_device *dev);
+static void decrementer_set_mode(enum clock_event_mode mode,
+ struct clock_event_device *dev);
+
+static struct clock_event_device decrementer_clockevent = {
+ .name = "decrementer",
+ .rating = 200,
+ .shift = 32,
+ .mult = 0, /* To be filled in */
+ .irq = -1,
+ .set_next_event = decrementer_set_next_event,
+ .set_mode = decrementer_set_mode,
+ .features = CLOCK_EVT_FEAT_ONESHOT,
+};
+
+static DEFINE_PER_CPU(struct clock_event_device, decrementers);
+void init_decrementer_clockevent(void);
+
#ifdef CONFIG_PPC_ISERIES
static unsigned long __initdata iSeries_recal_titan;
static signed long __initdata iSeries_recal_tb;
@@ -510,10 +532,12 @@ void __init iSeries_time_init_early(void
void timer_interrupt(struct pt_regs * regs)
{
struct pt_regs *old_regs;
- int next_dec;
int cpu = smp_processor_id();
- unsigned long ticks;
- u64 tb_next_jiffy;
+ struct clock_event_device *evt = &per_cpu(decrementers, cpu);
+
+ /* Ensure a positive value is written to the decrementer, or else
+ * some CPUs will continuue to take decrementer exceptions */
+ set_dec(DECREMENTER_MAX);
#ifdef CONFIG_PPC32
if (atomic_read(&ppc_n_lost_interrupts) != 0)
@@ -523,7 +547,6 @@ void timer_interrupt(struct pt_regs * re
old_regs = set_irq_regs(regs);
irq_enter();
- profile_tick(CPU_PROFILING);
calculate_steal_time();
#ifdef CONFIG_PPC_ISERIES
@@ -531,44 +554,20 @@ void timer_interrupt(struct pt_regs * re
get_lppaca()->int_dword.fields.decr_int = 0;
#endif
- while ((ticks = tb_ticks_since(per_cpu(last_jiffy, cpu)))
- >= tb_ticks_per_jiffy) {
- /* Update last_jiffy */
- per_cpu(last_jiffy, cpu) += tb_ticks_per_jiffy;
- /* Handle RTCL overflow on 601 */
- if (__USE_RTC() && per_cpu(last_jiffy, cpu) >= 1000000000)
- per_cpu(last_jiffy, cpu) -= 1000000000;
-
- /*
- * We cannot disable the decrementer, so in the period
- * between this cpu's being marked offline in cpu_online_map
- * and calling stop-self, it is taking timer interrupts.
- * Avoid calling into the scheduler rebalancing code if this
- * is the case.
- */
- if (!cpu_is_offline(cpu))
- account_process_time(regs);
-
- /*
- * No need to check whether cpu is offline here; boot_cpuid
- * should have been fixed up by now.
- */
- if (cpu != boot_cpuid)
- continue;
+ /*
+ * We cannot disable the decrementer, so in the period
+ * between this cpu's being marked offline in cpu_online_map
+ * and calling stop-self, it is taking timer interrupts.
+ * Avoid calling into the scheduler rebalancing code if this
+ * is the case.
+ */
+ if (!cpu_is_offline(cpu))
+ account_process_time(regs);
- write_seqlock(&xtime_lock);
- tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy;
- if (__USE_RTC() && tb_next_jiffy >= 1000000000)
- tb_next_jiffy -= 1000000000;
- if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) {
- tb_last_jiffy = tb_next_jiffy;
- do_timer(1);
- }
- write_sequnlock(&xtime_lock);
- }
-
- next_dec = tb_ticks_per_jiffy - ticks;
- set_dec(next_dec);
+ if (evt->event_handler)
+ evt->event_handler(evt);
+ else
+ evt->set_next_event(DECREMENTER_MAX, evt);
#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending())
@@ -781,8 +780,58 @@ void __init clocksource_init(void)
printk(KERN_INFO "clocksource: %s mult[%x] shift[%d] registered\n",
clocksource_timebase.name,
clocksource_timebase.mult, clocksource_timebase.shift);
+
+ return;
+}
+
+static int decrementer_set_next_event(unsigned long evt,
+ struct clock_event_device *dev)
+{
+ set_dec(evt);
+ return 0;
+}
+
+static void decrementer_set_mode(enum clock_event_mode mode,
+ struct clock_event_device *dev)
+{
+ if (mode != CLOCK_EVT_MODE_ONESHOT)
+ decrementer_set_next_event(DECREMENTER_MAX, dev);
+}
+
+static void register_decrementer_clockevent(int cpu)
+{
+ struct clock_event_device *dec = &per_cpu(decrementers, cpu);
+
+ *dec = decrementer_clockevent;
+ dec->cpumask = cpumask_of_cpu(cpu);
+
+ printk(KERN_ERR "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
+ dec->name, dec->mult, dec->shift, cpu);
+
+ clockevents_register_device(dec);
+}
+
+void init_decrementer_clockevent(void)
+{
+ int cpu = smp_processor_id();
+
+ decrementer_clockevent.mult = div_sc(ppc_tb_freq, NSEC_PER_SEC,
+ decrementer_clockevent.shift);
+ decrementer_clockevent.max_delta_ns =
+ clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent);
+ decrementer_clockevent.min_delta_ns = 1000;
+
+ register_decrementer_clockevent(cpu);
}
+void secondary_cpu_time_init(void)
+{
+ /* FIME: Should make unrelatred change to move snapshot_timebase
+ * call here ! */
+ register_decrementer_clockevent(smp_processor_id());
+}
+
+
/* This function is only called on the boot processor */
void __init time_init(void)
{
@@ -898,8 +947,7 @@ void __init time_init(void)
#endif
clocksource_init();
- /* Not exact, but the timer interrupt takes care of this */
- set_dec(tb_ticks_per_jiffy);
+ init_decrementer_clockevent();
}
Index: working/include/asm-powerpc/time.h
===================================================================
--- working.orig/include/asm-powerpc/time.h
+++ working/include/asm-powerpc/time.h
@@ -245,6 +245,7 @@ extern void snapshot_timebases(void);
#define snapshot_timebases() do { } while (0)
#endif
+extern void secondary_cpu_time_init(void);
extern void iSeries_time_init_early(void);
#endif /* __KERNEL__ */
^ permalink raw reply
* Re: [PATCH 1/5] Implement {read,update}_persistent_clock.
From: Tony Breeds @ 2007-09-19 6:53 UTC (permalink / raw)
To: linuxppc-dev, Paul Mackerras; +Cc: Thomas Gleixner, Realtime Kernel
In-Reply-To: <1190184586.867449.381310088392.qpush@thor>
On Wed, Sep 19, 2007 at 04:49:46PM +1000, Tony Breeds wrote:
> With these functions implemented we cooperate better with the generic
> timekeeping code. This obsoletes the need for the timer sysdev as a bonus.
I should have added that this patch series applies on top of Benh's 601
fixes.
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 1/1] ppc64: Convert cpu_sibling_map to a per_cpu data array ppc64 v2
From: Stephen Rothwell @ 2007-09-19 6:56 UTC (permalink / raw)
To: travis
Cc: linux-mm, Andi Kleen, linux-kernel, linuxppc-dev, sparclinux,
Andrew Morton, Christoph Lameter
In-Reply-To: <20070917183507.506104000@sgi.com>
[-- Attachment #1: Type: text/plain, Size: 541 bytes --]
Hi Mike,
On Mon, 17 Sep 2007 11:35:08 -0700 travis@sgi.com wrote:
>
> v2:
>
> This patch applies after:
>
> convert-cpu_sibling_map-to-a-per_cpu-data-array-ppc64.patch
>
> and should fix the "reference cpu_sibling_map before setup_per_cpu_areas()
> has been called" problem. In addtion, the cpu_sibiling_map macro has been
> removed [this was missed in my original submission.]
This one make it work, thanks.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: PSC in UART mode on TQM5200S
From: Leopold Stotch @ 2007-09-19 7:04 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <fa686aa40709180701w17273a11wda8c9ece79aad483@mail.gmail.com>
Thank you for the answer, Grant !
I knew nothing about port_config register before your answer :-(
I haven't changed any processor registers yet
because i'm still searching where i can do this.
Can you tell me, is it UBoot specific or kernel specific or both ?
And i already know about MPC5200's device tree in 2.6.x kernel but not
in 2.4.x...
On 9/18/07, Grant Likely <grant.likely@secretlab.ca> wrote:
> On 9/18/07, Leopold Stotch <l.butterz@gmail.com> wrote:
> > Hello, everyone !
> >
> > I have TQM5200S module and development board.
> > It runs factory UBoot and latest DENX's linuxppc_2_4_devel kernel.
> > I want to configure all TQM5200S's onboard PSC's as UART's.
> > TQM5200S's onboard PSC's are connected to custom board
> > that makes all electrical things as my hardware engineer says...
> > So changed
> > $HOME/linuxppc_2_4_devel/arch/ppc/platforms/tqm5200.h
> > the following way:
> >
> > #ifdef CONFIG_PS2MULT
> > #define RS_TABLE_SIZE 4
> > #else
> > #if defined(CONFIG_SPI_EVAL) || defined(CONFIG_TB5200)
> > #define RS_TABLE_SIZE 2
> > #elif defined(CONFIG_CAM5200)
> > #define RS_TABLE_SIZE 6
> > #else
> > #define RS_TABLE_SIZE 3
> > #endif
> > #endif
> >
> > changed to
> >
> > #ifdef CONFIG_PS2MULT
> > #define RS_TABLE_SIZE 4
> > #else
> > #if defined(CONFIG_SPI_EVAL) || defined(CONFIG_TB5200)
> > #define RS_TABLE_SIZE 2
> > #elif defined(CONFIG_CAM5200)
> > #define RS_TABLE_SIZE 6
> > #else
> > #define RS_TABLE_SIZE 6
> > #endif
> > #endif
> >
> > and
> >
> > #else /* default */
> > #define SERIAL_PORT_DFNS \
> > STD_PSC_OP(1) \
> > STD_PSC_OP(2) \
> > STD_PSC_OP(3)
> > #endif
> >
> > changed to
> >
> > #else /* default */
> > #define SERIAL_PORT_DFNS \
> > STD_PSC_OP(1) \
> > STD_PSC_OP(2) \
> > STD_PSC_OP(3) \
> > STD_PSC_OP(4) \
> > STD_PSC_OP(5) \
> > STD_PSC_OP(6)
> > #endif
> >
> > After rebuilding the kernel, dmesg says:
> >
> > ...
> > ttyS0 on PSC1
> > ttyS1 on PSC2
> > ttyS2 on PSC3
> > ttyS3 on PSC4
> > ttyS4 on PSC5
> > ttyS5 on PSC6
> > ...
> >
> > But when i do "echo 1 > /dev/ttyS4" i receive nothing at the other end.
>
> Have you made the appropriate changes to the port_config register?
>
> Cheers,
> g.
>
>
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
> grant.likely@secretlab.ca
> (403) 399-0195
>
--
Best regards,
Leopold Stotch
^ permalink raw reply
* Where did the fs_enet patches go?
From: Esben Haabendal @ 2007-09-19 7:05 UTC (permalink / raw)
To: LinuxPPC-dev
Hi
Where did the patches containing the reworked fs_enet drivers and the generic bitbanged MDIO library go?
I am talking about these 8 patches: http://www.mail-archive.com/linuxppc-dev@ozlabs.org/msg03184.html
They seem to have been removed from http://patchwork.ozlabs.org/linuxppc/ ...
AFAICS, they have not been merged in neither galak or paulus git.
It works nicely here at my mpc8270 target btw. :-)
--
Esben Haabendal
Embedded Software Consultant
Doré Development ApS
^ permalink raw reply
* Re: [NEWBIE] Interrupt-problem mpc5200
From: S. Fricke @ 2007-09-19 7:16 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fa686aa40709121229h6bb2902etffcd197e2e5af722@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]
Hello,
> > Can u give me an example with a single IRQ of a configuration-node for a
> > dts?
>
> myreallycooldevice@0 {
> interrupts = <1 2 3>;
> interrupt-parent = <&mpc5200_pic>;
> };
Ahh - oh weh - so simple! Thank you!
> The interrupts property matches the size of the #interrupt-cells
> property in the interrupt controller node. For the 5200-intc, each
> interrupt is described by 3 cells; l1, l2 and sense which is a
> reflection of the interrupt controller architecture. For IRQ0, l1=0,
> l2=0; IRQ1, l1=1, l2=1; IRQ2, l1=1 and l2=2; IRQ3, l1=1, l2=3 Sense is
> described in mpc52xx-device-tree-bindings.txt
OK, my dts is now:
/ {
/* ... */
soc5200@f0000000 {
/* ... */
intpin@0 {
interrupt-parent = <500>;
interrupts = <1 2 2>;
};
/* ... */
};
/* ... */
};
And the corresponding code is:
struct intmod_priv {
/** Interrupt-Number */
int own_irq;
/** The of-device-node */
struct device_node *intmod_dev_node;
};
static int __init mod_init( void )
{
// ...
priv.intmod_dev_node = NULL;
priv.intmod_dev_node = of_find_node_by_name(NULL, "intpin");
priv.own_irq = irq_of_parse_and_map(priv.intmod_dev_node, 0);
request_irq(priv.own_irq, intmod_isr, IRQF_DISABLED , "intmod", INTMOD_IRQ_BOARD);
// ...
Thank you and bye, my next question is following :-)
Silvio Fricke
--
-- S. Fricke ----------------------------- MAILTO:silvio.fricke@gmail.com --
Diplom-Informatiker (FH)
Linux-Entwicklung
----------------------------------------------------------------------------
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* cuImage generation
From: Gerhard Pircher @ 2007-09-19 7:28 UTC (permalink / raw)
To: linuxppc-dev
Hi,
I tried to compile a 2.6.23-rc6 kernel yesterday, but wasn't able to get a
cuImage.<platform) out of it (only the uImage file was generated). My
platform config defines DEFAULT_UIMAGE and WANT_DEVICE_TREE. Do I need to
generate it manually or is there a makefile where I have to specify it?
Naturally I added my cuboot wrapper code to the arch/powerpc/boot/Makefile.
Thanks!
regards,
Gerhard
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
^ permalink raw reply
* Re: PSC in UART mode on TQM5200S
From: Leopold Stotch @ 2007-09-19 7:40 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-embedded
In-Reply-To: <20070918223857.11329247FE@gemini.denx.de>
Thank you for the answer, Wolfgang !
Yes, we made a custom board which implements UART's
instead of USB, keyboard, mouse and others...
I checked the baudrate and i think it's ok.
Can you tell me, please, is there any HOWTO about MPC5200's
PSC's reconfiguration or something for newbies ?
On 9/19/07, Wolfgang Denk <wd@denx.de> wrote:
> In message <53b5d6e90709180313n7ef053ddqfb771f44d9bd44ef@mail.gmail.com> you wrote:
> >
> > So changed $HOME/linuxppc_2_4_devel/arch/ppc/platforms/tqm5200.h
> > the following way:
>
> Well, you have to unserstand *exactly* what the CPU and the board are
> doing - the MPC5200 has multiplexed pins, and if you select one
> function you lose a few others, so you must carefully check for
> conflicts. Probably you will have to disable some other functions.
> Also you have to usnerstand what the board is designed like - some
> ports have specific and reserved functions.
>
> Finally, there are such things like wrong baud rate on a serial port
> which may make you think it's not working while you are just using bad
> user mode settings.
>
> > Is it possible to reconfigure all PSC's as UART's ?
>
> Yes, it is. But you have to know what you are doing.
>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
> All a hacker needs is a tight PUSHJ, a loose pair of UUOs, and a warm
> place to shift.
>
--
Best regards,
Leopold Stotch
^ permalink raw reply
* Re: Where did the fs_enet patches go?
From: Vitaly Bordug @ 2007-09-19 7:40 UTC (permalink / raw)
To: Esben Haabendal; +Cc: LinuxPPC-dev
In-Reply-To: <fe1de3834843c215554ca03da0bc7eb3@127.0.0.1>
Hello Esben,
On Wed, 19 Sep 2007 09:05:16 +0200
Esben Haabendal wrote:
>
> Hi
>
> Where did the patches containing the reworked fs_enet drivers and the generic bitbanged MDIO library go?
> I am talking about these 8 patches: http://www.mail-archive.com/linuxppc-dev@ozlabs.org/msg03184.html
>
> They seem to have been removed from http://patchwork.ozlabs.org/linuxppc/ ...
>
> AFAICS, they have not been merged in neither galak or paulus git.
>
> It works nicely here at my mpc8270 target btw. :-)
>
iirc they are slowly spinning with netdev/Jeff Garzik... Scott would know for sure :)
--
Sincerely, Vitaly
^ permalink raw reply
* Re: Where did the fs_enet patches go?
From: Esben Haabendal @ 2007-09-19 8:25 UTC (permalink / raw)
To: Vitaly Bordug, Scott Wood; +Cc: LinuxPPC-dev
In-Reply-To: <20070919114035.075acafb@localhost.localdomain>
On Wed, 19 Sep 2007 11:40:35 +0400, Vitaly Bordug <vitb@kernel.crashing.org> wrote:
> On Wed, 19 Sep 2007 09:05:16 +0200
>> Where did the patches containing the reworked fs_enet drivers and the
>> generic bitbanged MDIO library go?
>> I am talking about these 8 patches:
>> http://www.mail-archive.com/linuxppc-dev@ozlabs.org/msg03184.html
>>
>> They seem to have been removed from
>> http://patchwork.ozlabs.org/linuxppc/ ...
>>
>> AFAICS, they have not been merged in neither galak or paulus git.
>>
>> It works nicely here at my mpc8270 target btw. :-)
>>
> iirc they are slowly spinning with netdev/Jeff Garzik... Scott would know
> for sure :)
Ah, I see. Thanks.
Most of it is at least ack'ed by Jeff. But he did not seem to like
the generic bitbanged MDIO library.
Scott, what is the plan with that part? I need it :-)
/Esben
--
Esben Haabendal
Embedded Software Consultant
Doré Development ApS
^ permalink raw reply
* Re: cross compiling a library with ELDK
From: Murat Artun @ 2007-09-19 8:28 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-embedded
In-Reply-To: <20070918224126.48196247FE@gemini.denx.de>
Wolfgang,
Thanks for your response...
I confess I did not read the whole documentation from scratch, but I
have browsed many sections especially related with my issue. I should
say it is always said in documentation that setting $CROSS_COMPILE
environment variable is necessary, but that did not work for me.
Specifically, I am trying to cross compile osip library with EDLK (not
an ELDK component). When I execute the configure script I want the
config.h to be generated to reflect the target system. As from your
last response I understand that I always need to make sure by checking
config.h file myself.
After I have posted this problem I found the below thread:
http://ozlabs.org/pipermail/linuxppc-embedded/2003-July/011785.html
Following the same, I have achieved generation of config.h by checking
ELDK components and GNU cross tools to be prefixed with ppc_8xx.
Although I was not able to build shared libraries with the generated
makefile, building static libraries was OK. But it seems as if it is
somehow difficult to cross build a SW component that is not a part of
ELDK, and this is harder than "Rebuilding ELDK Components" which is
specified to be so straightforward in the documentation.
Thanks and regards...
On 9/19/07, Wolfgang Denk <wd@denx.de> wrote:
> In message <4e5a3720709180602g20ccc060hbf7f091839a18c99@mail.gmail.com> you wrote:
> >
> > I want to cross compile a free software library with ELDK 3.1.1 for
> > powerpc. I have ELDK installed under directory /opt and my system and
> > PATH is set properly. I have a few points to be clarified:
>
> May I recommend that, as a first step, you read the documentation?
>
> > - For a cross compilation with ELDK how can we be sure that config.h
> > file for a software packet is generated properly? I mean, how can we
>
> You cannot be sure. You will always have to check.
>
> > be sure that ELDK components is checked instead of our host linux
> > system for generating a config.h file by the configure script?
>
> RTFM. See especially the two bullets at
> http://www.denx.de/wiki/view/DULG/ELDKRebuildingComponents#Section_3.7.2.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
> Wisdom is one of the few things that looks bigger the further away it
> is. - Terry Pratchett, _Witches Abroad_
>
--
M u r at A r t u n, MSc.
Design Engineer
"be conservative in what you do, be liberal in what you accept from others"
^ permalink raw reply
* RE: [PATCH] phy: export phy_mii_ioctl
From: Pedro Luis D. L. @ 2007-09-19 8:54 UTC (permalink / raw)
To: Jon Smirl, Domen Puncer; +Cc: netdev, linuxppc-embedded
In-Reply-To: <9e4733910709181229m4afe7ecr56e2411f52a84232@mail.gmail.com>
Hello Jon,
I=B4m also working with a Phytec pcm030, but I can=B4t get it booted...
Which kernel are you using?
I tried to apply the 7 bestcomm patches from Sylvain and patch over these w=
ith this new ones that Domen released.
The base kernel I=B4m using is 2.6.22.6 from kernel.org.
Although I used the patch that creates pcm030.c in arch/platforms/52xx/ and=
compiled using this file, it gets halted at booting time.
Bytes transferred =3D 5091 (13e3 hex)
## Booting image at 00500000 ...
Image Name: Linux-2.6.22.6
Created: 2007-09-19 8:53:02 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1196911 Bytes =3D 1.1 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Booting using flat device tree at 0x400000
(No more output and boot is halted)
Are you using any other patch for the platform or any other kernel, because=
I tried to apply these patches to a 2.6.20 kernel and are not successful.
Bests,
Pedro.
> Date: Tue, 18 Sep 2007 15:29:09 -0400> From: jonsmirl@gmail.com=20
> To: domen@coderock.org> Subject: Re: [PATCH] phy: export phy_mii_ioctl=20
> CC: netdev@vger.kernel.org; linuxppc-embedded@ozlabs.org=20
>> On 9/18/07, Domen Puncer wrote:=20
>> More testing and getting it to work properly on Phytec pcm030 would=20
>> be great.>> Do we want to do anything about this?=20
>> [ 1.569657] net eth0: attached phy 0 to driver Generic PHY=20
> [ 2.576013] Sending DHCP requests .PHY: f0003000:00 - Link is Up=20
> - 100/Full> [ 4.612000] ., OK=20
> [ 6.764005] IP-Config: Got DHCP answer from 192.168.1.200, my=20
> address is 192.168.1.5
>> What is happening is the printk for "PHY: f0003000:00 - Link is Up=20
> - 100/Full" is done in an interrupt and it comes in the middle of the> ke=
rnel doing DHCP and printing ... without a CR.=20
>> Two possible solutions, get rid of the link-up message or wait in in=20
> the initial driver load until the link is up. Or we could leave it the=20
> way it is, but some people may report this as a bug.
>>> --> Jon Smirl> jonsmirl@gmail.com=20
> _______________________________________________=20
> Linuxppc-embedded mailing list> Linuxppc-embedded@ozlabs.org> https://ozl=
abs.org/mailman/listinfo/linuxppc-embedded
_________________________________________________________________
Busca desde cualquier p=E1gina Web con una protecci=F3n excepcional. Consig=
ue la Barra de herramientas de Windows Live hoy mismo y GRATUITAMENTE.
http://www.toolbar.live.com=
^ permalink raw reply
* RE: [PATCH] phy: export phy_mii_ioctl
From: Pedro Luis D. L. @ 2007-09-19 8:54 UTC (permalink / raw)
To: Jon Smirl, Domen Puncer; +Cc: netdev, linuxppc-embedded
In-Reply-To: <9e4733910709181229m4afe7ecr56e2411f52a84232@mail.gmail.com>
Hello Jon,
I=B4m also working with a Phytec pcm030, but I can=B4t get it booted...
Which kernel are you using?
I tried to apply the 7 bestcomm patches from Sylvain and patch over these w=
ith this new ones that Domen released.
The base kernel I=B4m using is 2.6.22.6 from kernel.org.
Although I used the patch that creates pcm030.c in arch/platforms/52xx/ and=
compiled using this file, it gets halted at booting time.
Bytes transferred =3D 5091 (13e3 hex)
## Booting image at 00500000 ...
Image Name: Linux-2.6.22.6
Created: 2007-09-19 8:53:02 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1196911 Bytes =3D 1.1 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Booting using flat device tree at 0x400000
(No more output and boot is halted)
Are you using any other patch for the platform or any other kernel, because=
I tried to apply these patches to a 2.6.20 kernel and are not successful.
Bests,
Pedro.
> Date: Tue, 18 Sep 2007 15:29:09 -0400> From: jonsmirl@gmail.com=20
> To: domen@coderock.org> Subject: Re: [PATCH] phy: export phy_mii_ioctl=20
> CC: netdev@vger.kernel.org; linuxppc-embedded@ozlabs.org=20
>> On 9/18/07, Domen Puncer wrote:=20
>> More testing and getting it to work properly on Phytec pcm030 would=20
>> be great.>> Do we want to do anything about this?=20
>> [ 1.569657] net eth0: attached phy 0 to driver Generic PHY=20
> [ 2.576013] Sending DHCP requests .PHY: f0003000:00 - Link is Up=20
> - 100/Full> [ 4.612000] ., OK=20
> [ 6.764005] IP-Config: Got DHCP answer from 192.168.1.200, my=20
> address is 192.168.1.5
>> What is happening is the printk for "PHY: f0003000:00 - Link is Up=20
> - 100/Full" is done in an interrupt and it comes in the middle of the> ke=
rnel doing DHCP and printing ... without a CR.=20
>> Two possible solutions, get rid of the link-up message or wait in in=20
> the initial driver load until the link is up. Or we could leave it the=20
> way it is, but some people may report this as a bug.
>>> --> Jon Smirl> jonsmirl@gmail.com=20
> _______________________________________________=20
> Linuxppc-embedded mailing list> Linuxppc-embedded@ozlabs.org> https://ozl=
abs.org/mailman/listinfo/linuxppc-embedded
_________________________________________________________________
Busca desde cualquier p=E1gina Web con una protecci=F3n excepcional. Consig=
ue la Barra de herramientas de Windows Live hoy mismo y GRATUITAMENTE.
http://www.toolbar.live.com=
^ permalink raw reply
* 2.6.23-rc6-mm1 -- powerpc link failure
From: Andy Whitcroft @ 2007-09-19 9:28 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20070918011841.2381bd93.akpm@linux-foundation.org>
I am seeing this strange link error from a PowerMac G5 (powerpc):
[...]
KSYM .tmp_kallsyms2.S
AS .tmp_kallsyms2.o
LD vmlinux.o
ld: dynreloc miscount for fs/built-in.o, section .opd
ld: can not edit opd Bad value
make: *** [vmlinux.o] Error 1
Compiler version below.
root@elm3b19:~# gcc -v
Using built-in specs.
Target: powerpc-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-awt=gtk-default
--enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre
--enable-mpfr --disable-softfloat
--enable-targets=powerpc-linux,powerpc64-linux --with-cpu=default32
--disable-werror --enable-checking=release powerpc-linux-gnu
Thread model: posix
gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
-apw
^ permalink raw reply
* 2.6.23-rc6-mm1 -- powerpc pSeries_log_error panic in rtas_call/early_enable_eeh
From: Andy Whitcroft @ 2007-09-19 9:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20070918011841.2381bd93.akpm@linux-foundation.org>
Seeing the following panic booting an old powerpc LPAR:
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc000000000047b48
cpu 0x0: Vector: 300 (Data Access) at [c0000000006a3750]
pc: c000000000047b48: .pSeries_log_error+0x364/0x420
lr: c000000000047acc: .pSeries_log_error+0x2e8/0x420
sp: c0000000006a39d0
msr: 8000000000001032
dar: 0
dsisr: 42000000
current = 0xc0000000005acab0
paca = 0xc0000000005ad700
pid = 0, comm = swapper
enter ? for help
[c0000000006a3af0] c000000000021164 .rtas_call+0x200/0x250
[c0000000006a3ba0] c000000000049d50 .early_enable_eeh+0x168/0x360
[c0000000006a3c70] c00000000002f674 .traverse_pci_devices+0x8c/0x138
[c0000000006a3d10] c000000000560ce8 .eeh_init+0x1a8/0x200
[c0000000006a3db0] c00000000055fb70 .pSeries_setup_arch+0x128/0x234
[c0000000006a3e40] c00000000054f830 .setup_arch+0x214/0x24c
[c0000000006a3ee0] c000000000546a38 .start_kernel+0xd4/0x3e4
[c0000000006a3f90] c00000000045adc4 .start_here_common+0x54/0x58
0:mon>
This machine is:
# cat /proc/cpuinfo
processor : 0
cpu : POWER4+ (gq)
clock : 1703.965296MHz
revision : 19.0
[...]
machine : CHRP IBM,7040-681
-apw
^ 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