LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: HDLC synchronous
From: Wolfgang Denk @ 2006-05-21 19:55 UTC (permalink / raw)
  To: Antonio Di Bacco; +Cc: linuxppc-embedded
In-Reply-To: <200605211925.49946.antonio.dibacco@aruba.it>

In message <200605211925.49946.antonio.dibacco@aruba.it> you wrote:
> I had a look to hdlc_enet.c in 8xx_io and it seems to me that it only supports 
> asynchronous HDLC (speaks about cts rts). Is this true?

Our hdlc_enet.c driver is a custom driver that is designed to work in
a pretty specific environment. You can use it as a model for your own
implementation, but unless you understand exactly what it's doing you
better be careful.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
No, I'm not going to explain it. If you  can't  figure  it  out,  you
didn't want to know anyway... :-)
                   - Larry Wall in <1991Aug7.180856.2854@netlabs.com>

^ permalink raw reply

* Re: [PATCH] powerpc: Fix ide-pmac sysfs entry
From: Gabriel Paubert @ 2006-05-21 21:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Andrew Morton, Pete Popov, B.Zolnierkiewicz, linuxppc-dev, paulus,
	Alan Cox
In-Reply-To: <1147683156.21291.118.camel@localhost.localdomain>

On Mon, May 15, 2006 at 06:52:36PM +1000, Benjamin Herrenschmidt wrote:
> 
> > Actually I have one of these, and regularly use it and update 
> > the kernel to the latest git once or twice per month, but I 
> > typically have two batteries and have not swapped in the 
> > media bay under Linux for a long time.
> > 
> > If you are interested, I could test the patch when I find 
> > some time (not today: my 8 year old son went to the hospital
> > for an emergency last Thursday, he is cured now and should 
> > come out today).
> 
> Any test is welcome, glad to know your son is well !

The one liner works here, I can no more solidly hang
the machine. There is still a bunch of error messages
on drive removal though:

mediabay0: switching to 7
mediabay0: powering down
media bay 0 is empty
Unregistering mb 0 ide, index:2
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: DMA disabled
hde: ATAPI reset complete
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: ATAPI reset complete
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: ATAPI reset complete
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: ATAPI reset complete
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
mediabay0: end of power down

On insertion there are also a few messages
but they seem normal:

mediabay0: switching to 3
mediabay0: powering up
mediabay0: enabling (kind:3)
mediabay0: waiting reset (kind:3)
mediabay0: waiting IDE reset (kind:3)
mediabay0: waiting IDE ready (kind:3)
mediabay 0, registering IDE...
Probing IDE interface ide2...
hde: LG DVD-ROM DRN-8080B, ATAPI CD/DVD-ROM drive
hde: Enabling MultiWord DMA 2
ide2 at 0xf1022000-0xf1022007,0xf1022160 on irq 20
hde: ATAPI 24X DVD-ROM drive, 512kB Cache, DMA
media-bay 0 is ide2
mediabay 0 IDE ready

	Regards,
	Gabriel

^ permalink raw reply

* Re: [PATCH] powerpc: Fix ide-pmac sysfs entry
From: Benjamin Herrenschmidt @ 2006-05-21 21:46 UTC (permalink / raw)
  To: Gabriel Paubert
  Cc: Andrew Morton, Pete Popov, B.Zolnierkiewicz, linuxppc-dev, paulus,
	Alan Cox
In-Reply-To: <20060521213056.GA25721@iram.es>

On Sun, 2006-05-21 at 23:30 +0200, Gabriel Paubert wrote:
> On Mon, May 15, 2006 at 06:52:36PM +1000, Benjamin Herrenschmidt wrote:
> > 
> > > Actually I have one of these, and regularly use it and update 
> > > the kernel to the latest git once or twice per month, but I 
> > > typically have two batteries and have not swapped in the 
> > > media bay under Linux for a long time.
> > > 
> > > If you are interested, I could test the patch when I find 
> > > some time (not today: my 8 year old son went to the hospital
> > > for an emergency last Thursday, he is cured now and should 
> > > come out today).
> > 
> > Any test is welcome, glad to know your son is well !
> 
> The one liner works here, I can no more solidly hang
> the machine. There is still a bunch of error messages
> on drive removal though:

Yes, I noticed those. Looks like the IDE driver is trying to much around
with the drive when unregistered. In our case, it's not a very good idea
as we unregister it after we detect it's been physically removed :)
Seems harmless so far though.

Ben.

> mediabay0: switching to 7
> mediabay0: powering down
> media bay 0 is empty
> Unregistering mb 0 ide, index:2
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: DMA disabled
> hde: ATAPI reset complete
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: ATAPI reset complete
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: ATAPI reset complete
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: ATAPI reset complete
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> mediabay0: end of power down
> 
> On insertion there are also a few messages
> but they seem normal:
> 
> mediabay0: switching to 3
> mediabay0: powering up
> mediabay0: enabling (kind:3)
> mediabay0: waiting reset (kind:3)
> mediabay0: waiting IDE reset (kind:3)
> mediabay0: waiting IDE ready (kind:3)
> mediabay 0, registering IDE...
> Probing IDE interface ide2...
> hde: LG DVD-ROM DRN-8080B, ATAPI CD/DVD-ROM drive
> hde: Enabling MultiWord DMA 2
> ide2 at 0xf1022000-0xf1022007,0xf1022160 on irq 20
> hde: ATAPI 24X DVD-ROM drive, 512kB Cache, DMA
> media-bay 0 is ide2
> mediabay 0 IDE ready
> 
> 	Regards,
> 	Gabriel

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Mel Gorman @ 2006-05-21 22:23 UTC (permalink / raw)
  To: Andrew Morton
  Cc: davej, tony.luck, linux-mm, ak, bob.picco, linux-kernel,
	linuxppc-dev
In-Reply-To: <20060521120843.43babdc7.akpm@osdl.org>

On Sun, 21 May 2006, Andrew Morton wrote:

> Mel Gorman <mel@csn.ul.ie> wrote:
>>
>
>>> Anyway, I just don't get how this code can work.  We have an e820 map with
>>> up to 128 entries (this machine has ten) and we're trying to scrunch that
>>> all into the four-entry early_node_map[].
>>>
>>
>> Missing E820MAX was a mistake. On x86_64, CONFIG_MAX_ACTIVE_REGIONS should
>> have been used. I didn't expect x86_64 to have so many memory holes.
>
> x86 uses 128 e820 slots too.
>

That is true, but with x86, I am not expecting many regions. For flatmem, 
only one region will be registered. For NUMA, I would expect one 
registration per node *unless* SRAT is being used. With SRAT, MAXCHUNKS 
regions at most with is 4 * MAX_NUMNODES.

>>
>>> On my little x86 PC:
>>>
>>> BIOS-provided physical RAM map:
>>> BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
>>> BIOS-e820: 000000000009bc00 - 000000000009c000 (reserved)
>>> BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
>>> BIOS-e820: 0000000000100000 - 000000000ffc0000 (usable)
>>> BIOS-e820: 000000000ffc0000 - 000000000fff8000 (ACPI data)
>>> BIOS-e820: 000000000fff8000 - 0000000010000000 (ACPI NVS)
>>> BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
>>> BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
>>> BIOS-e820: 00000000ffb80000 - 00000000ffc00000 (reserved)
>>> BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
>>> 0MB HIGHMEM available.
>>> 255MB LOWMEM available.
>>> found SMP MP-table at 000ff780
>>> Range (nid 0) 0 -> 65472, max 4
>>> On node 0 totalpages: 65472
>>>  DMA zone: 4096 pages, LIFO batch:0
>>>  Normal zone: 61376 pages, LIFO batch:15
>>>
>>> So here, the architecture code only called add_active_range() the once, for
>>> the entire memory map.
>>
>> Because in this case, the architecture reported that there was just one
>> range of available pages with no holes.
>
> So..  we're registering a simgle blob of pfns which includes the "reserved"
> memory as well as the "ACPI data" and the "ACPI NVS" (with an apparent
> off-by-one here).
>

The off-by-one is a surprise. On this machine, it must be because the 
arch-specific code calculated highend_pfn wrong. I don't use the e820 on 
i386 because it didn't seem necessary.

> How come the machine still works?  I guess the architecture went and marked
> those pfns reserved.
>

Yes, that is what I'd expect to happen. The ranges are registered and a 
memmap allocated but the freeing of memory from bootmem is still the same 
on i386. For i386, my patchset reports the same size of zones and 
start_pfn on each node so there should be no difference in the end result 
between my code and the arch-specific initialisation.

>>> If so, perhaps the bug is that the x86_64 code isn't doing that.  And that
>> > x86 isn't doing it for some people either.
>> >
>>
>>  I'm hoping in this case that having MAX_ACTIVE_REGIONS match E820MAX will
>>  fix the issue on your machine.
>
> I expect it will.
>
> One does wonder whether it's worth all this fuss though.  It's only a
> 24-byte structure and it's all thrown away in free_initmem().  One _could_
> just go and do
>
> 	#define MAX_ACTIVE_REGIONS 10000
>
> and be happy.
>

I could, but I thought I'd be shot for trying something like that. A fixed 
value of 128 would cover the largest tables I'm aware of on all 
architectures. Should I just set that fixed value?

>> I'm still confused why Christian's failed
>>  to boot with the patch backed out though.
>
> He didn't get any "Too many memory regions" messages, so it's something
> different.
>
> Maybe he hit my off-by-one on his "ACPI data"?
>

Possibly but the off-by-one error for you was on x86 not x86_64 and I 
suspect that highend_pfn was wrong in this case. I'll be checking tomorrow 
where I can see an off-by-one error.

> hm, I didn't mention this in the earlier email.   On my x86 I have
>
>  BIOS-provided physical RAM map:
>  BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
>  BIOS-e820: 000000000009bc00 - 000000000009c000 (reserved)
>  BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
>  BIOS-e820: 0000000000100000 - 000000000ffc0000 (usable)
>  BIOS-e820: 000000000ffc0000 - 000000000fff8000 (ACPI data)
>  BIOS-e820: 000000000fff8000 - 0000000010000000 (ACPI NVS)
>  BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
>  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
>  BIOS-e820: 00000000ffb80000 - 00000000ffc00000 (reserved)
>  BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
>
> I added some debug and saw that add_active_range() was getting a
> start_pfn=0 and an end_pfn which corresponds with 0x0fffc000.  So my "ACPI
> NVS" is getting chopped off.
>

Yes. However, this just means that the memory for that the PFN range will 
not be backed by memmap. This would only be a problem if free_bootmem() is 
called on those range of pages. If that was happening, I would be 
expecting oops early or bad_page reports during the boot process.

> If Christian is seeing a similar thing then his "ACPI data" will be getting
> only part-registered.
>
> I'd suggest that the next rev be liberal in its printking.  This is the
> debug patch I used:
>

I also have an old debug patch that was very printk happy. I will dust it 
off and add it with the additional information from your patch.

> mm/page_alloc.c |   25 +++++++++++++++++++++----
> 1 file changed, 21 insertions(+), 4 deletions(-)
>
> diff -puN mm/page_alloc.c~a mm/page_alloc.c
> --- devel/mm/page_alloc.c~a	2006-05-20 13:19:58.000000000 -0700
> +++ devel-akpm/mm/page_alloc.c	2006-05-20 13:20:42.000000000 -0700
> @@ -2463,22 +2463,36 @@ void __init add_active_range(unsigned in
> 						unsigned long end_pfn)
> {
> 	unsigned int i;
> -	printk(KERN_DEBUG "Range (%d) %lu -> %lu\n", nid, start_pfn, end_pfn);
> +
> +	printk("Range (nid %d) %lu -> %lu, max %d\n",
> +			nid, start_pfn, end_pfn, MAX_ACTIVE_REGIONS - 1);
>
> 	/* Merge with existing active regions if possible */
> 	for (i = 0; early_node_map[i].end_pfn; i++) {
> -		if (early_node_map[i].nid != nid)
> +		printk("i=%d early_node_map[i].nid=%d "
> +				"early_node_map[i].start_pfn=%lu "
> +				"early_node_map[i].end_pfn=%lu",
> +			i, early_node_map[i].nid,
> +			early_node_map[i].start_pfn,
> +			early_node_map[i].end_pfn);
> +
> +		if (early_node_map[i].nid != nid) {
> +			printk(" continue 1\n");
> 			continue;
> +		}
>
> 		/* Skip if an existing region covers this new one */
> 		if (start_pfn >= early_node_map[i].start_pfn &&
> -				end_pfn <= early_node_map[i].end_pfn)
> +				end_pfn <= early_node_map[i].end_pfn) {
> +			printk(" return 1\n");
> 			return;
> +		}
>
> 		/* Merge forward if suitable */
> 		if (start_pfn <= early_node_map[i].end_pfn &&
> 				end_pfn > early_node_map[i].end_pfn) {
> 			early_node_map[i].end_pfn = end_pfn;
> +			printk(" return 2\n");
> 			return;
> 		}
>
> @@ -2486,13 +2500,16 @@ void __init add_active_range(unsigned in
> 		if (start_pfn < early_node_map[i].end_pfn &&
> 				end_pfn >= early_node_map[i].start_pfn) {
> 			early_node_map[i].start_pfn = start_pfn;
> +			printk(" return 3\n");
> 			return;
> 		}
> +		printk("\n");
> 	}
>
> 	/* Leave last entry NULL, we use range.end_pfn to terminate the walk */
> 	if (i >= MAX_ACTIVE_REGIONS - 1) {
> -		printk(KERN_ERR "Too many memory regions, truncating\n");
> +		printk(KERN_ERR "More than %d memory regions, truncating\n",
> +				MAX_ACTIVE_REGIONS - 1);
> 		return;
> 	}
>
> _
>

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply

* Re: [PATCH][resend] udbg_printf() formatting attribute
From: Michael Ellerman @ 2006-05-22  6:33 UTC (permalink / raw)
  To: Jimi Xenidis; +Cc: linuxppc-dev
In-Reply-To: <68EF7C38-A8DB-445A-BC7F-439102E19BB9@watson.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

On Thu, 2006-05-18 at 12:52 -0400, Jimi Xenidis wrote:
> On May 18, 2006, at 11:56 AM, Michael Ellerman wrote:
> >
> > I'm actually hoping to get rid of udbg_printf(), but if I can't we
> > should stick this in I guess. The real problem IMHO is that debug
> > printks rot because they're rarely compiled, not sure what to do about
> > that.
> 
> Yeah, debug code always has that problem.  But I must say, whenever I  
> work with the x86 guys and I see how long they are _blind_ when they  
> boot it blows my mind.  Lets hope we don't go there.

Yeah nuts. Don't worry, when I say "get rid of udbg_printf()" I mean
"replace with printk".

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply

* Re: snd-aoa status update / automatic driver loading
From: Johannes Berg @ 2006-05-22  6:42 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Benjamin Berg, debian-powerpc
In-Reply-To: <1148169389.13249.44.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 3021 bytes --]

On Sun, 2006-05-21 at 09:56 +1000, Benjamin Herrenschmidt wrote:

> What do you mean by lost interrupts ?

Well, when our interrupt handler isn't run for each expected interrupt.

> DBDMA sends edge interrupts. Thus, if it emits interrupts A, then B and
> C, and for any reason, your kenrel is not able to service interrupts (is
> doing something with IRQs disabled) from before B happens to after C
> happens, you'll indeed get called only twice (A and C) and "B" will be
> sort-of lost.

Right. But I have a hard time believing that we had such a high latency,
I expect an interrupt about every 10ms under normal alsa programming.

> First thing about that is: what the heck is causing us to have such a
> latency !!! that would be useful to figure out. A way to do that would
> be maybe to "detect" when C happens that we missed B (see below how to
> do that) and print something along with the regs->nip & lr (or even a
> backtrace). That might give us an idea of there interrupts are
> re-enabled after the long latency which could perhaps lead us to the
> cause of the latency.

Yeah ok, we might be able to figure out what's causing this, but on an
otherwise idle system I assumed actual hardware problems, but it also
never happened on my machine, only on my brother's (same as your pbook).

> Now for detecting lost interrupts (and for being immune to them), the
> technique is not to just assume IRQ -> 1 period completed, but instead,
> when an irq happens, to go read the DBDMA descriptors in memory to see
> which ones have actually been completed. Their status field should be
> updated as their get comleted. Thus, you keep track of the "previous"
> last completed descriptor and you walk from that to recycle them.

Right, that's how snd-powermac does it. It has the nasty side-effect of
polluting the cache a lot though, since dbdma commands are 16 bytes
long. Am I wrong?

> Since we can only update the framecounter on a per-period basis, 

Alsa calls this thing the 'pointer' :) The frame counter we currently
use is the frame counter register of the i2s bus controller, and I don't
see why we shouldn't do that instead of reading back all the dbdma
command status fields.

> the
> driver would benefit from having lots of very small periods. I don't
> know if we can provide "hints" to userland about that though. 

Yes, we can set the minimum period count or maximum period length. Not a
hint though, it then makes it required.

> Using the
> i2s frame counter means we need some kind of calibration... it might
> still be counting if for the reason the DBDMA "misses" something or gets
> stopped....

Since the i2s bus is not shut down it also counts when we are not
transferring data. We currently calibrate on the first interrupt. That's
fine, since having multiple periods means that we don't need to be
absolutely precise here. If we miss one, that's fine, we can make it up
the next time by saying that 2 have elapsed.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

^ permalink raw reply

* Re: [PATCH 1/5] powerpc: Make early xmon logic immune to location of early parsing
From: Michael Ellerman @ 2006-05-22  7:03 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20060518010826.GO22868@smtp.west.cox.net>

[-- Attachment #1: Type: text/plain, Size: 2437 bytes --]

On Wed, 2006-05-17 at 18:08 -0700, Tom Rini wrote:
> On Thu, May 18, 2006 at 10:03:05AM +1000, Michael Ellerman wrote:
> > On Wed, 2006-05-17 at 14:29 -0700, Tom Rini wrote:
> > > On Wed, May 17, 2006 at 06:00:41PM +1000, Michael Ellerman wrote:
> > > 
> > > > Currently early_xmon() calls directly into debugger() if xmon=early is passed.
> > > > This ties the invocation of early xmon to the location of parse_early_param(),
> > > > which might change.
> > > > 
> > > > Tested on P5 LPAR and F50.
> > > > 
> > > > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> > > 
> > > Please no, parse_early_param() is there so things like xmon or kgdb can
> > > be dropped into as soon as we're able to parse any params that might be
> > > usable early on.
> > 
> > Sure, did you read the rest of the series? I want to parse parameters
> > eariler, so early that xmon isn't ready to run when we parse them, so I
> > have to defer jumping into xmon until after xmon is initialised. The net
> > effect on when xmon runs is zero. Or did I miss your point?
> 
> My point would be that xmon should either be fixed to work that early or
> parse things a bit later as a regular param.  I know the current system
> is flawed but I really don't like the idea (especially as a comaintainer
> of kgdb) of having to do a special plug here or there for one param
> because we parse early stuff too early, but regular stuff not early
> enough (which is why Andrew Morton got me to poke at the early param
> stuff a while back and then I think Rusty did something better, or
> something along those lines, anyhow).

Ok. I don't know the history so I can't comment on that. I don't think
we can make xmon run that early, the early parsing in my patch is before
we know what machine type we're on.

But as far as xmon and kgdb is concerned it really shouldn't matter that
the parsing is happening earlier. Instead of calling directly into
xmon/kgdb from the parsing code you set a global which is tested later.
If we ever get around to consolidating the 32/64 bit early setup code we
might even be able to move all the xmon logic into xmon_init(), which
would be even cleaner.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply

* Re: I2C bus issues on MPC8248
From: Laurent Pinchart @ 2006-05-22  9:06 UTC (permalink / raw)
  To: hs; +Cc: linuxppc-embedded
In-Reply-To: <1148056646.5943.20.camel@Zeus.EmbLux>

Hi Heiko,

> > I'm trying to use the MPC8248 hardware I2C bus in a 2.6.16 kernel. The
> > mailing
> > list archives mention a driver for the MPC8260
> > (http://ozlabs.org/pipermail/linuxppc-embedded/2006-May/022837.html)
> > which I modified to reflect the memory map differences between the
> > MPC8260 and the MPC8248, as mentionned in the e-mail.
> >
> > The good news is that the driver works. The bad news is that it doesn't
> > work
>
> OK.
>
> > correctly.
> >
> :-(
> :
> > The Linux I2C layer probes the I2C bus for peripherals when drivers are
> > loaded. The probing function writes a single byte with the device address
> > and check if the data is acked. I monitored the SCL and SDA lines using
> > an
>
> [...]
>
> > Using that code, no data is sent on the bus, the BD_SC_READY bit is never
> > cleared and no interrupt is generated. Once again I suspected a CPM bug
> > when writing a single byte on the bus, so I increased cbd_datlen to 2:
> >
> > tbdf[0].cbd_bufaddr = __pa(tb);
> > tbdf[0].cbd_datlen = 2;
> > tbdf[0].cbd_sc = count ? BD_SC_READY | BD_IIC_START :
> >                  BD_SC_READY | BD_IIC_START | BD_SC_INTRPT |
> >                  BD_SC_LAST | BD_SC_WRAP;
> >
> > This worked, and two bytes were written on the bus, leading me to believe
> > that the CPM was at fault.
>
> I don t know, if this is a CPM Bug, but it seems so to me ...

I've contacted Freescale's technical support about that issue. They answered 
that 0-byte buffer descriptors are not legal (even though no documentation 
states so), and that the address byte is output on the I2C bus when the next 
byte is written to the internal TX FIFO, making it impossible to send a 
single byte on the bus. Basically, that's a "feature", and they don't intend 
to fix it.

> > Has anyone noticed the same behaviour ? Is there a workaround available ?
> > I tried searching Freescale's website for CPM microcode updates but
> > haven't found anything related to the I2C controller.
>
> Yes, Holger Speck had the same problem. He solved it by doing the
> following:
>
> If the cpm_iic_write is called with count = 0. He made a read with count =
> 1
>
> I think this is safer than writing 2 Bytes to the Slave.
> Could you try this?

I've tried that with success. The I2C bus still gets stuck from time to time, 
I'll try to investigate that.

Thanks for your help.

Best regards,

Laurent Pinchart

^ permalink raw reply

* Preferred way to configure MTD physical mapping and partitioning
From: Laurent Pinchart @ 2006-05-22 10:32 UTC (permalink / raw)
  To: linuxppc-embedded

Hi everybody,

while browsing the kernel sources to find out how other boards configure MTD 
physical mapping and partitioning, I noticed that a couple of different 
approaches were possible:

- adding a board specific "driver" in drivers/mtd/maps and handle all mapping 
manually
- adding board specific MTD configuration in arch/ppc/platforms with calls to 
physmap_set_partitions() and physmap_configure()
- adding board specific MTD configuration in arch/ppc/platforms with a call to 
physmap_set_partitions(), and using the CONFIG_MTD_PHYSMAP option with 
physical mapping values provided in the kernel configuration.

Could anyone comment on the preferred approach ?

Best regards,

Laurent Pinchart

^ permalink raw reply

* CRAMFS: Error -3 while decompressing!
From: Igor Luri @ 2006-05-22  9:40 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all!

We have a mpc5200liteB evaluation board with u-boot 1.1.4 and linux 
2.4.25 from Denx.  We have grabed a cramfs  root fs on a mtd partition 
and we are able to boot linux without problems:

    setenv bootargs root=/dev/mtdblock4 rw rootfstype=cramfs
    console=ttyS0 console=ttyS0 init=/sbin/init ip=on
    ....
    NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
    VFS: Mounted root (cramfs
    filesystem).                                                                         

    Freeing unused kernel memory: 96k
    init                                                                         
                                                                                                                                                                                                                                         

    BusyBox v1.00 (2006.03.06-10:43+0000) Built-in shell
    (ash)                                                     
    Enter 'help' for a list of built-in commands.           
    #


However, we are not able to boot linux with the same rootfs image (with 
the u-boot header) loaded from RAM.

        setenv bootargs root=/dev/rw rw console=ttyS0 console=ttyS0
        init=/sbin/init ip=on

        ## Booting image at 00500000 ...
           Image Name:   Linux-2.4.25-rthal5-TRACE
           Created:      2006-05-11   9:37:52 UTC
           Image Type:   PowerPC Linux Kernel Image (gzip compressed)
           Data Size:    1000166 Bytes = 976.7 kB
           Load Address: 00000000
           Entry Point:  00000000
           Verifying Checksum ... OK
           Uncompressing Kernel Image ... OK
        ## Loading RAMDisk Image at 01000000 ...
           Image Name:   Ramdisk Image
           Created:      2006-05-22   8:12:03 UTC
           Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
           Data Size:    1191936 Bytes =  1.1 MB
           Load Address: 00000000
           Entry Point:  00000000
           Verifying Checksum ... OK
           Loading Ramdisk to 0fe22000, end 0ff45000 ... OK
        Memory BAT mapping: BAT2=256Mb, BAT3=0Mb, residual: 0Mb
        Linux version 2.4.25-rthal5-TRACE (igor@ILURI_LINUX) (gcc
        version 3.3.6) #300 jue may 11 11:33:57 CEST 2006
        On node 0 totalpages: 65536
        zone(0): 65536 pages.
        zone(1): 0 pages.

        ....
        NET4: Unix domain sockets 1.0/SMP for Linux
        NET4.0.                                                             
        RAMDISK: cramfs filesystem found at block
        0                                                                   
         
        RAMDISK: Loading 1164 blocks [1 disk] into ram disk...
        done.                                                    
        Freeing initrd memory: 1164k
        freed                                                                            
         
        VFS: Mounted root (cramfs filesystem)
        readonly.                                                               
         
        Freeing unused kernel memory: 96k
        init                                                                        
         
        Error -3 while
        decompressing!                                                                                 
         
        c0224e84(1616147664)->c0214000(4096)                                                                          
         
        Error -3 while
        decompressing!                                                                                 
         
        c02286d8(-965246762)->cff41000(4096)                                                                          
         
        Kernel panic: No init found.  Try passing init= option to
        kernel.                                               
         <0>Rebooting in 180 seconds..                         

We have configured linux with option " Board uses U-Boot CONFIG_UBOOT " 
and CRAMFS image is built with correct endianess:

    file initrd.cramfs

    Linux Compressed ROM File System data, big endian size 1191936
    version #2 sorted_dirs CRC 0xac3c8f59, edition 0, 719 blocks, 433 files


We suspect it could be related with the SDRAM, but we are lost here.

Someone knows what we are doing wrong? Any help would be appretiated.


Thanks in advance.

^ permalink raw reply

* Re: MPC8xx: resolution of gettimeofday() ?
From: Steven Scholz @ 2006-05-22 11:03 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <20060519175513.GA12121@gate.ebshome.net>

Eugene,

>>> Usually on PPC we use timebase to interpolate time between Decrementer 
>>> interrupts. In this case gettimeofday resolution is determined by 
>>> timebase resolution which is quite high (megahertz range).
>> Sorry. I don't understand. What do you mean with "timebase"? Is there a
>> second timer/counter?
> 
> PowerPC has a facility called timebase. This is 64-bit counter which 
> can be accessed using special instructions (mftb, mftbu on 32-bit PPC).
> Counter resolution depends on particular chip implementation, some 
> use core clock, other use bus clock...
> 
> It's similar to the time-stamp counter in Intel CPUs (accessed 
> with rdtsc instruction).
Thanks very much for clearing this!

> Please, refer to PPC arch manuals for more information. Also, if you 
> really interested in how gettimeofday() is implemented, why don't you 
> look at the source code yourself?
I tried. But it's not obvious. Not for me anyway.

-- 
Steven

^ permalink raw reply

* RE: [PATCH] Gianfar SKB Recycling Support
From: Haruki Dai-r35557 @ 2006-05-22  1:38 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, linuxppc-dev

> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@osdl.org]=20
> Sent: Saturday, May 20, 2006 2:48 AM
> To: Haruki Dai-r35557
> Cc: netdev@vger.kernel.org; Fleming Andy-afleming; Kumar=20
> Gala; Haruki Dai-r35557
> Subject: Re: [PATCH] Gianfar SKB Recycling Support
>=20
> On Wed, 17 May 2006 15:45:14 -0700
> "Haruki Dai-r35557" <Dai.Haruki@freescale.com> wrote:
>=20
> > This patch improves the IP forwarding throughput of
> > the Freescale TSEC/eTSEC Gianfar driver. By recycling
> > the Socket buffer and Data buffer, reduce the unnecessary
> > memory allocation and de-allocation in the forwarding
> > processing chain.
> >=20
> > Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
> > Signed-off-by: Andy Fleming <afleming@freescale.com>
> >=20
>=20
> In case the general impression wasn't clear from the earlier comments.
> This patch is an interesting benchmark tweak, but unlikely to ever
> make it into the mainline kernel. The kernel needs to be a general
> purpose system and deal with multiple types of hardware and resource
> control.
>=20
> But don't give up looking at performance. If you can find ways to
> speed up the overall socket buffer handling without breaking existing
> semantics; then the patches would be positively received.
>

I admit the explanation of the implementation is indeed unclear. I will
put the recycling mechanism explanation. Is it better put as the
driver's comment? Or, the separate document like, say,
Document/net/skb_recycling.txt?

Just in case, I need to confirm that the patch is rejected even though
the expalanation is added?=20

I will surely work for making this mechanism more generic to the other
interface. I want to make sure that this patch is not the purpose of
benchmark tweak. This recycling mechanism makes the Linux's position in
the packet forwarding application better compare to the other
proprietary OS/Stack in terms of the throughput performance.=20
=20
 For the gianfar user, this patch also improves interrupt response under
the situation when previous gianfar tied up with the a lot of TX hw
interrupt even under NAPI (current gianfar NAPI implementation only help
Rx side since we have separate interrupt line). I will separate the
gianfar specific improvement, and post to this list again.



- Dai

^ permalink raw reply

* "How to change the Magic number"
From: nreddy @ 2006-05-22 12:21 UTC (permalink / raw)
  To: u-boot-users; +Cc: linuxppc-embedded

Hi ALL,

 I have a specific requirement to change the Magic number of the linux
kernel in my embedded system.

 I cound see the Magic number is defined in U-boot files:
 1.include/image.h:#define IH_MAGIC        0x27051956
 2.cpu/ppc4xx/start.S:     .long   0x27051956

  So i can modify in u-boot to make it compatible to my Kernel (i am using
montavista linux version 2.4.20), but i am not able to see this kindof
info anywhere in the kernel source files.
If anyone knows how the linux magic number is generated and what are the
files
 need modifications inorder to change magic number please let me know.


Thnaks in Advance,
Nagi

^ permalink raw reply

* Preferred way to configure MTD physical mapping and partitioning
From: Thiago Galesi @ 2006-05-22 12:27 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-embedded
In-Reply-To: <200605221232.14880.laurent.pinchart@tbox.biz>

What about configuring it in kernel configuration (using make
menuconfig for example). Most of the configurations can be done
through there (position, size, width, etc)?

Only if you have something out of the ordinary it would be advisable
to use a driver.

If you give us more detail we'll be able to help you better

BTW, you can partition your flash via cmdline

Cheers :)



-- 
-
Thiago Galesi

^ permalink raw reply

* Re: "How to change the Magic number"
From: Wolfgang Denk @ 2006-05-22 13:00 UTC (permalink / raw)
  To: nreddy; +Cc: u-boot-users, linuxppc-embedded
In-Reply-To: <45530.61.95.208.2.1148300461.squirrel@61.95.208.2>

In message <45530.61.95.208.2.1148300461.squirrel@61.95.208.2> you wrote:
> 
>  I have a specific requirement to change the Magic number of the linux
> kernel in my embedded system.

You are off track.

>  I cound see the Magic number is defined in U-boot files:
>  1.include/image.h:#define IH_MAGIC        0x27051956
>  2.cpu/ppc4xx/start.S:     .long   0x27051956

This magic number is only used by U-Boot, and  ther  e  only  in  the
image header. It has no relevance in any way to the LInu xkernel.

>   So i can modify in u-boot to make it compatible to my Kernel (i am using
> montavista linux version 2.4.20), but i am not able to see this kindof
> info anywhere in the kernel source files.

You are looking at the wrong place. This magic number is not used  or
accessed anywhere in the Linu xkernel.

> If anyone knows how the linux magic number is generated and what are the
> files
>  need modifications inorder to change magic number please let me know.

Linux itself has no such magic number. Especially not on PPC.

[But if you find a way to change  that  magic  number,  I  would  not
protest  if  you  added 10 or 20 to the last 4 digits. Just make sure
the change is propagated back to it's origin. :-) ]

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The easiest way to figure the cost of living is to take  your  income
and add ten percent.

^ permalink raw reply

* Preferred way to configure MTD physical mapping and partitioning
From: Thiago Galesi @ 2006-05-22 13:27 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-embedded
In-Reply-To: <200605221500.00634.laurent.pinchart@tbox.biz>

> >
> > BTW, you can partition your flash via cmdline
>
> So would that be the preferred way to configure MTD partitions ?
>
> Laurent Pinchart
>
Using the mtdparts option in the boot cmdline. example

mtdparts=256k(partition1)ro,333k(partition2),444k(partition3),-(partition 4)

This will create /dev/mtd1, /dev/mtd2, etc, etc (and the corresponding
mtdblock devices) - you still have to create the inodes manually
(AFAIK) with the corresponding size, etc Using the '-' in the last
option uses all the remaining space. (as the ro option that makes the
partition read only. Useful for not overwriting your bootloader)

-- 
-
Thiago Galesi

^ permalink raw reply

* SCC1 as serial console
From: Ladislav Klenovič @ 2006-05-22 13:33 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,
can anybody help me to setup the SCC1 port as serial console on MPC860 =
with kernel 2=2E6=2E15=2E4? I would like to use it as system console du=
ring the booting proccess=2E I can not get any output on serial console=
 during booting proccess, I use uboot=2E

thnx,
regards ladislav

^ permalink raw reply

* Re: SCC1 as serial console
From: Laurent Pinchart @ 2006-05-22 14:12 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <e65a39032a7d4cdbbf87ecc1daa271cd@pobox.sk>

Hi Ladislav,

> can anybody help me to setup the SCC1 port as serial console on MPC860 with
> kernel 2.6.15.4? I would like to use it as system console during the
> booting proccess. I can not get any output on serial console during booting
> proccess, I use uboot.

Does SCC1 work correctly in U-Boot ? If not, you should fix that first. I'll 
assume it does.

There are many issues which could lead to a silent serial console. The serial 
port could be misconfigured, or the kernel could crash for another reason 
before the serial port is initialized.

Have you been able to get a serial console on another serial port (SMC) ? Are 
the clock frequencies computed by U-Boot and passed to the Linux kernel 
correct ?

Do you have a hardware debugger (BDI2000) that you can connect to the 
processor to see if Linux crashes before initializing the serial port ? If 
not, you will probably have to take a try at led-debugging (make some leds 
blink at various point in the Linux kernel to try to find out what happens), 
but that's really no fun.

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH 1/5] powerpc: Make early xmon logic immune to location of early parsing
From: Tom Rini @ 2006-05-22 14:26 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <1148281388.24345.40.camel@localhost.localdomain>

On Mon, May 22, 2006 at 05:03:08PM +1000, Michael Ellerman wrote:
[snip]
> But as far as xmon and kgdb is concerned it really shouldn't matter that
> the parsing is happening earlier. Instead of calling directly into
> xmon/kgdb from the parsing code you set a global which is tested later.

Yes, so instead of one method of telling the kernel we want to have kgdb
asap, and one method of implementing that on all architectures we have
the command line parsed sometimes (and we just drop right in), other
architectures we need to write something to set a flag we check later,
and someone else writes something different for this on yet another
platform and we're back to where we started from.  That's my fear :)

-- 
Tom Rini

^ permalink raw reply

* Re: Re: SCC1 as serial console
From: Ladislav Klenovi? @ 2006-05-22 15:10 UTC (permalink / raw)
  To: linuxppc-embedded


>-----P?vodn? spr?va-----
>Od: Laurent Pinchart [mailto:laurent=2Epinchart@tbox=2Ebiz]
>Odoslan?: 22=2E m?ja 2006 14:12
>Komu: linuxppc-embedded@ozlabs=2Eorg
>Predmet: Re: SCC1 as serial console
>
>
>Hi Ladislav,
>
>> can anybody help me to setup the SCC1 port as serial console on MPC8=
60 with
>> kernel 2=2E6=2E15=2E4? I would like to use it as system console duri=
ng the
>> booting proccess=2E I can not get any output on serial console durin=
g booting
>> proccess, I use uboot=2E
>
>Does SCC1 work correctly in U-Boot ? If not, you should fix that first=
=2E I'll
>assume it does=2E

Yes, it works fine for kernel 2=2E4=2E22=2E

>There are many issues which could lead to a silent serial console=2E T=
he serial
>port could be misconfigured, or the kernel could crash for another rea=
son
>before the serial port is initialized=2E

I did a little experiment, I turn off the root file system so my kernel=
(system,=2E=2E) restart=20
after 180 seconds=2E When there was something wrong the there wasn't  s=
ystem restart=2E
But, ofcourse I CAN NOT be sure that this selince is due an another err=
or or I just can=20
not see the output=2E

>Have you been able to get a serial console on another serial port (SMC=
) ? Are
>the clock frequencies computed by U-Boot and passed to the Linux kerne=
l
>correct ?

Please can you explain how to get thi serial to SMC?

>
>Do you have a hardware debugger (BDI2000) that you can connect to the
>processor to see if Linux crashes before initializing the serial port =
? If
>not, you will probably have to take a try at led-debugging (make some =
leds
>blink at various point in the Linux kernel to try to find out what hap=
pens),
>but that's really no fun=2E
>
No I don't have any :(

Ladislav Klenovic_______________________________________________
>Linuxppc-embedded mailing list
>Linuxppc-embedded@ozlabs=2Eorg
>https://ozlabs=2Eorg/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* Gigabit ethernet support question about linux 2.6 on ML403 board
From: Ming Liu @ 2006-05-22 15:09 UTC (permalink / raw)
  To: akonovalov; +Cc: linuxppc-embedded

Hello Andrei,
I noticed that you are the owner of the Xilinx Virtex Development tree. Now 
I am trying to integrate a linux-xilinx-26 kernel in my ML403 Virtex 4 
platform, with tri-mode (or gigabit) ethernet supported. In the menuconfig, 
I haven't found an option in Ethernet (1000 Mbit) to enable the gigabit 
ethernet (I have chosen the processor as ppc 40x and the platform as 
ML403.). Also, in the Ethernet (10 or 100Mbit), there is no option for 
Xilinx on-chip ethernet. Could you please tell me how can I include a 
tri-mode ethernet MAC supported by my platform in linux-xilinx-26? Thanks a 
lot for your precious reply. 

Best Regards
Ming

_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com  

^ permalink raw reply

* Re: SCC1 as serial console
From: Jeff Angielski @ 2006-05-22 15:27 UTC (permalink / raw)
  To: Ladislav Klenovič; +Cc: linuxppc-embedded
In-Reply-To: <e65a39032a7d4cdbbf87ecc1daa271cd@pobox.sk>

On Mon, 2006-05-22 at 15:33 +0200, Ladislav Klenovič wrote:
> Hi,
> can anybody help me to setup the SCC1 port as serial console on MPC860 
> with kernel 2.6.15.4? I would like to use it as system console during 
> the booting proccess. I can not get any output on serial console during 
> booting proccess, I use uboot.

What are your kernel command line arguments?  Are you passing the right
ones in?

Have you configured the SCC correctly in the kernel?  Chosen SCC1? Baud
rates correct?  etc.  

Does your hardware need any special tweaks to the SCC code that is in
u-boot but not your kernel?


Jeff Angielski
The PTR Group

^ permalink raw reply

* Debbugging technique (was: Re: SCC1 as serial console)
From: Walter L. Wimer III @ 2006-05-22 16:00 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <200605221612.53452.laurent.pinchart@tbox.biz>

On Mon, 2006-05-22 at 16:12 +0200, Laurent Pinchart wrote:
> Do you have a hardware debugger (BDI2000) that you can connect to the 
> processor to see if Linux crashes before initializing the serial
> port ? If not, you will probably have to take a try at led-debugging
> (make some leds blink at various point in the Linux kernel to try to
> find out what happens), but that's really no fun.

If your U-Boot works successfully, here's another technique I've used
recently:

First, on the 8xx (and probably on some other PowerPC's) you'll want to
change the cache mode to "write-through" rather than "copy-back".  On
8xx, there is a kernel configuration option to do this.

If you're lucky and printk() is working internally (even though your
console isn't), you can put printk()s in your code wherever you want and
then use U-Boot to examine printk()'s buffer.  Boot up your kernel with
your debugging code, let it run for a second or two (long enough that
you suspect it has reached the likely problem area), then press the hard
reset button on the board.  This will restart U-Boot.  If necessary,
press a key to stop U-Boot from autobooting.

Next look at the kernel's System.map file and search for
"log_buf" (without quotes).  This is the kernel virtual address of
printk()'s log buffer and will be something like 0xc018469c.  You'll
need to translate this to a physical address.  On PowerPC, usually you
can do this simply by changing the leading "c" to a zero "0".

Now, use U-Boot's "md" (memory display) command to view the log_buf
physical address, e.g.:

                md 0x0018469c

Hopefully, now you'll see printk's log messages and you'll be able to
figure out why your console isn't working.

In my case recently, I was unlucky.  My kernel problem occurred long
before printk() was initialized, so printk() didn't work for me.  When I
examined the log_buf, it was empty.  If this happens to you, then try
the next idea:

Somewhere in the kernel (I chose arch/ppc/syslib/m8xx_setup.c, but it
shouldn't really matter, as long as the file you choose is compiled and
linked as part of your particular kernel configuration), declare a
buffer or two for storing debugging info.  For example:

                char mycharbuff[1024];
                int  myintbuff[256];

Also declare pointers that you can use to write debugging info into the
above arrays:

                char *mycharptr = mycharbuff;
                int  *myintptr  = myintbuff;

Then, wherever you need debugging information in your code, add lines
like:

                mycharptr += sprintf(mycharptr, "Something happened!
                \n");
or
                *myintptr++ = 29;    /* code number of your choosing */

After recompiling your kernel, find your buffer addresses in System.map
as we did previously with log_buf.  Convert the virtual addresses to
physical addresses.  Again run your kernel, hit the hard reset button,
and then use U-Boot's "md" command to examine your custom buffers.
You'll probably determine the problem area fairly quickly after a few
iterations of adding debugging code and examining your custom buffers.

DISCLAIMER:  The sample code I've shown above is not SMP or preemption
safe!  It also doesn't check for buffer overflow!  This is debugging
code, meant to be removed after you've found the problem.  This
simplistic code is often sufficient when debugging simple early-boot
problems that cause the machine to crash within the first few moments
after boot.  If your debugging requirements are more complicated, you'll
want correspondingly more complex debugging code.  E.g. you'll want to
check buffer lengths, you may want to wrap back to the beginning of your
buffer when you hit the end, etc.  You may also need to deal with
SMP/preemption issues.  This code is not to be taken internally.  Your
mileage may vary.  These statements have not been evaluated by the Food
and Drug Administration.  This product is not intended to treat or cure
any disease.  :-)



Good Luck!!!

Walt Wimer
TimeSys Corporation

^ permalink raw reply

* pseries softreset on cpus in 32bit mode
From: Olaf Hering @ 2006-05-22 16:41 UTC (permalink / raw)
  To: linuxppc-dev


Consider a simple app like this, which is placed as '/init' in an initrd
cpio archive:

hello32.c

#include <stdio.h>                                                                                                              
int main(void) {
        printf("foobar\n");
        asm("li 31,0; b .\n");
        return 0;
}

It will keep one cpu busy, and in 32bit mode. If a soft-reset is
triggered, this cpu remains in 32bit mode (I think) when
system_reset_fwnmi() is invoked. Then bad_stack is called via
STD_EXCEPTION_COMMON() and EXCEPTION_PROLOG_COMMON() because the 32bit
stackpointer is  > 0 and the cpu was in usermode. Finally panic is
called, which doesnt make much sense in this context.
machine_check_fwnmi has likely the same issue.

One bug is that something trashes regs->nip, it gets 0x3200 or similar.

I'm not really sure what is supposed to happen. Clearly a softreset
should not panic with bad stack pointer.

This is on a JS20, but a large p550 dies the same way.

Linux version 2.6.17-rc4-g353b28ba (olaf@pomegranate) (gcc version 4.1.0 (SUSE Linux)) #2 SMP Mon May 22 18:37:06 CEST 2006
[boot]0012 Setup Arch
Top of RAM: 0x1e000000, Total RAM: 0x1e000000
Memory hole size: 0MB
PPC64 nvram contains 16384 bytes
Using default idle loop
[boot]0015 Setup Done
Built 1 zonelists
Kernel command line:  root=/dev/hda2  xmon=on quiet panic=1
foobar
Bad kernel stack pointer ffa57ac0 at 3200
Oops: Bad kernel stack pointer, sig: 6 [#1]
SMP NR_CPUS=128 NUMA
Modules linked in:
NIP: 0000000000003200 LR: 0000000010000338 CTR: 0000000000032DDC
REGS: c000000007a5ed40 TRAP: c000000007a5ef10   Not tainted  (2.6.17-rc4-g353b28ba)
MSR: 0000000040001032 <ME,IR,DR>  CR: 20000042  XER: 200FFFFF
TASK = c00000001dfdb7e0[1] 'init' THREAD: c00000000ffcc000 CPU: 1
GPR00: 0000000010000338 00000000FFA57AC0 000000001009B470 0000000007ACEFF8
GPR04: 000000001002487C 0000000040000042 0000000000004000 000000001000B0E0
GPR08: 000000000000F932 0000000000000000 0000000000000000 0000000000000000
GPR12: 00000000200FFFFF C00000000052D100 C000000000442820 4000000002010000
GPR16: C000000000440ED8 0000000000000000 00000000000413DB 00000000004FA998
GPR20: 000000000250AC08 00000000004FAC08 000000000183FE00 00000000004420C0
GPR24: 000000000052CF00 0000000010000C70 0000000010000BF0 0000000000000000
GPR28: 0000000000000000 0000000010090000 00000000005123D8 0000000000000000
NIP [0000000000003200] 0x3200
LR [0000000010000338] 0x10000338
Call Trace:
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX

^ permalink raw reply

* RE: Preferred way to configure MTD physical mapping and partitioning
From: Guillaume Autran @ 2006-05-22 16:30 UTC (permalink / raw)
  To: Laurent Pinchart, linuxppc-embedded
In-Reply-To: <200605221232.14880.laurent.pinchart@tbox.biz>

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

Hi Laurent,

There is also the "RedBoot" approach that let you create and store your partition table in a reserved sector of your flash.
You can enable your kernel to parse and create your MTD partitions according. After that, all you need to do is make your boot loader write the table in flash. Have a look at the file "linux/drivers/mtd/redboot.c". 

Guillaume.



-----Original Message-----
From: linuxppc-embedded-bounces+gautran=mrv.com@ozlabs.org on behalf of Laurent Pinchart
Sent: Mon 5/22/2006 6:32 AM
To: linuxppc-embedded@ozlabs.org
Subject: Preferred way to configure MTD physical mapping and partitioning
 
Hi everybody,

while browsing the kernel sources to find out how other boards configure MTD 
physical mapping and partitioning, I noticed that a couple of different 
approaches were possible:

- adding a board specific "driver" in drivers/mtd/maps and handle all mapping 
manually
- adding board specific MTD configuration in arch/ppc/platforms with calls to 
physmap_set_partitions() and physmap_configure()
- adding board specific MTD configuration in arch/ppc/platforms with a call to 
physmap_set_partitions(), and using the CONFIG_MTD_PHYSMAP option with 
physical mapping values provided in the kernel configuration.

Could anyone comment on the preferred approach ?

Best regards,

Laurent Pinchart
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


[-- Attachment #2: Type: text/html, Size: 2185 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox