From: "John Lenz" <lenz@cs.wisc.edu>
To: "Pavel Machek" <pavel@ucw.cz>
Cc: "kernel list" <linux-kernel@vger.kernel.org>,
"Russell King" <rmk+lkml@arm.linux.org.uk>
Subject: Re: arm: how to operate leds on zaurus?
Date: Mon, 11 Jul 2005 20:07:18 -0500 (CDT) [thread overview]
Message-ID: <33703.127.0.0.1.1121130438.squirrel@localhost> (raw)
In-Reply-To: <20050711193454.GA2210@elf.ucw.cz>
On Mon, July 11, 2005 2:34 pm, Pavel Machek said:
> Hi!
>
> 2.6.12-rc5 (and newer) does not boot on sharp zaurus sl-5500. It
> blinks with green led, fast; what does it mean? I'd like to verify if
> it at least reaches .c code in setup.c. I inserted this code at
> begining of setup.c:674...
>
> #define locomo_writel(val,addr) ({ *(volatile u16 *)(addr) = (val); })
> #define LOCOMO_LPT_TOFH 0x80
> #define LOCOMO_LED 0xe8
> #define LOCOMO_LPT0 0x00
>
> locomo_writel(LOCOMO_LPT_TOFH, LOCOMO_LPT0 + LOCOMO_LED);
>
> ...but that does not seem to do a trick -- it only breaks the boot :-(
> (do I need to add some kind of IO_BASE?).
> Pavel
No, that won't work.
As Russell said, there are problems accessing memory before the io maps
have been set up correctly. You can see the patch
http://www.cs.wisc.edu/~lenz/zaurus/files/2.6.12-rc5/lenz-03-leds-2.6.12-rc5.patch
need scroll near the bottom in file locomo.c to see how the led gets set.
You won't actually be able to know where in memory that space is mapped
because we call ioremap, and won't be able to access the locomo stuff
until device_initcall.
WARNING: Horrible hack! Ugly, ugly, ugly! First read and understand the
warning at
http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2002-January/006730.html
Having said that, either before the MMU has been activated or before the
ioremap() has been called, it is sometimes possible to access the LEDs at
the physical addresses they are located at. This may or may not work,
might not always work, etc... but it can help as a last resort. On the
SL5500, the physical address of the start of the locomo chip is
0x40000000, and the leds are at an offset of 0xe8, so something like
volatile u16 *led = (volatile u16 *)0x400000e8;
*led = 0x80;
As the above email says, this is not guarenteed to work at all, will fail
at some point in the boot process, but is something you can try.
That said, I am aware that recent kernel versions have broken the boot on
collie, but haven't looked at the problem in detail (i.e. tried doing a
binary search between known working versions and broken ones to see the
patch that introduced the problem). I have been working on the SL5600
recently.
John
next prev parent reply other threads:[~2005-07-12 1:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-11 19:34 arm: how to operate leds on zaurus? Pavel Machek
2005-07-11 19:45 ` Russell King
2005-07-11 19:50 ` Pavel Machek
2005-07-12 7:16 ` Hamera Erik
2005-07-12 7:21 ` Russell King
2005-07-12 1:07 ` John Lenz [this message]
2005-07-19 18:06 ` Sharp Zaurus sl-5500 broken in 2.6.12 Pavel Machek
2005-07-19 19:21 ` Pavel Machek
2005-07-19 20:22 ` Richard Purdie
2005-07-20 17:57 ` Pavel Machek
2005-07-21 2:41 ` John Lenz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=33703.127.0.0.1.1121130438.squirrel@localhost \
--to=lenz@cs.wisc.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rmk+lkml@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox