From: Robert Staven <robertst@tihlde.org>
To: linuxppc-embedded@ozlabs.org
Subject: Getting the LED light up... (A&M Rattler 8250PCI linux 2.6.13-AM)
Date: Sun, 04 Mar 2007 12:50:07 +0100 [thread overview]
Message-ID: <45EAB26F.1060001@tihlde.org> (raw)
Got an Analogue & Micro Rattler 8250PCI board running Linux 2.6.13-AM
I'm trying to get the debug LEDs work (LED0-2 connected to PA0-2) but
havent had any success yet (How #¤@"$! hard can it be to get a LED light
up...? :)
Port D bit 24 is accessible on the boards expansion connector, and I
successfully tested my code to use it as gen purpose I/O (both input and
output).
But when I try to write (change) port A (bit 0-2), nothing changes in
the register (nor do the LED light up). And my Ethernet FCC1 freezes
up!! (fs mounted by NFS so I notice)
FCC1 is using a big part of port A, but I'm quite sure I don't touch any
of those bits (see code below)
I'm a Linux newbie, but I'm starting to wonder if theres any 'lock' or
something by the kernel on port A?
Any ideas/tips/anything welcome!
br
Robert
PS, I have a hard time find an immap for the 8250, but since the kernel
and fs compile fine on my toolchain i assume it there somewhere?
---
snips of relevant parts of my code:
(it's written and compiled as a module)
typedef struct io_port {
ulong iop_padir;
ulong iop_papar;
ulong iop_pasor;
ulong iop_paodr;
ulong iop_padat;
char res1[12];
ulong iop_pbdir;
ulong iop_pbpar;
ulong iop_pbsor;
ulong iop_pbodr;
ulong iop_pbdat;
char res2[12];
ulong iop_pcdir;
ulong iop_pcpar;
ulong iop_pcsor;
ulong iop_pcodr;
ulong iop_pcdat;
char res3[12];
ulong iop_pddir;
ulong iop_pdpar;
ulong iop_pdsor;
ulong iop_pdodr;
ulong iop_pddat;
//char res4[12];
} iop8250_t;
#define IOPORT_BASE_ADDR 0x10D00 // Address to first reg in iop8250
volatile iop8250_t *iommap;
#define P0 0x8000 // P0 bit in registers
#define P1 0x4000 // P1 bit in registers
#define P2 0x2000 // P2 bit in registers
#define LED0 P2
#define LED1 P1
#define LED2 P0
iommap = (iop8250_t *)(CPM_MAP_ADDR+IOPORT_BASE_ADDR);
printk("PDIRA (0x%08X) = 0x%08X\n", &(iommap->iop_padir),
iommap->iop_padir);
printk("PPARA (0x%08X) = 0x%08X\n", &(iommap->iop_papar),
iommap->iop_papar);
printk("PSORA (0x%08X) = 0x%08X\n", &(iommap->iop_pasor),
iommap->iop_pasor);
printk("PDATA (0x%08X) = 0x%08X\n", &(iommap->iop_padat),
iommap->iop_padat);
iommap->iop_papar &= ~LED0; // set PA2 to general I/O
iommap->iop_padir |= LED0; // set PA2 as output
iommap->iop_padat &= ~LED0; // Clear PA2 / LED0 on
printk("PDATA (0x%08X) = 0x%08X\n", &(iommap->iop_padat),
iommap->iop_padat);
next reply other threads:[~2007-03-04 12:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-04 11:50 Robert Staven [this message]
2007-03-05 8:27 ` Getting the LED light up... (A&M Rattler 8250PCI linux 2.6.13-AM) Laurent Pinchart
2007-03-05 11:21 ` Robert Staven
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=45EAB26F.1060001@tihlde.org \
--to=robertst@tihlde.org \
--cc=linuxppc-embedded@ozlabs.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.