From: leigh@solinno.co.uk (Leigh Brown)
To: paulus@samba.org
Cc: trini@kernel.crashing.org, linuxppc-dev@lists.linuxppc.org,
barbieri@gmail.com
Subject: [5/9] Support for old IBM PReP boxes
Date: Thu, 29 Jul 2004 22:34:38 +0100 [thread overview]
Message-ID: <20040729213438.GA5900@george.solinno.co.uk> (raw)
This adds a function to use the residual data to determine the
address to pass to i8259_init().
diff -urNX /home/leigh/.diffex linux-2.6.8-rc2-bk8.prev/arch/ppc/platforms/prep_setup.c linux-2.6.8-rc2-bk8/arch/ppc/platforms/prep_setup.c
--- linux-2.6.8-rc2-bk8.prev/arch/ppc/platforms/prep_setup.c 2004-07-29 20:42:14.000000000 +0100
+++ linux-2.6.8-rc2-bk8/arch/ppc/platforms/prep_setup.c 2004-07-29 20:43:53.000000000 +0100
@@ -980,6 +980,12 @@
}
for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ )
irq_desc[i].handler = &i8259_pic;
+
+ if (have_residual_data()) {
+ i8259_init(residual_isapic_addr());
+ return;
+ }
+
/* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory
* controller, we poll (as they have a different int-ack address). */
early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &pci_viddid);
diff -urNX /home/leigh/.diffex linux-2.6.8-rc2-bk8.prev/arch/ppc/platforms/residual.c linux-2.6.8-rc2-bk8/arch/ppc/platforms/residual.c
--- linux-2.6.8-rc2-bk8.prev/arch/ppc/platforms/residual.c 2004-07-29 20:42:14.000000000 +0100
+++ linux-2.6.8-rc2-bk8/arch/ppc/platforms/residual.c 2004-07-29 20:43:53.000000000 +0100
@@ -917,6 +917,39 @@
*irq_edge_mask_hi = irq_mask >> 8;
}
+unsigned int __init residual_isapic_addr(void)
+{
+ PPC_DEVICE *isapic;
+ PnP_TAG_PACKET *pkt;
+ unsigned int addr;
+
+ isapic = residual_find_device(~0, NULL, SystemPeripheral,
+ ProgrammableInterruptController,
+ ISA_PIC, 0);
+ if (!isapic)
+ goto unknown;
+
+ pkt = PnP_find_large_vendor_packet(res->DevicePnPHeap +
+ isapic->AllocatedOffset, 9, 0);
+ if (!pkt)
+ goto unknown;
+
+#define p pkt->L4_Pack.L4_Data.L4_PPCPack
+ /* Must be 32-bit memory address */
+ if (!((p.PPCData[0] == 2) && (p.PPCData[1] == 32)))
+ goto unknown;
+
+ /* It doesn't seem to work where length != 1 (what can I say? :-/ ) */
+ if (ld_le32((unsigned int *)(p.PPCData + 12)) != 1)
+ goto unknown;
+
+ addr = ld_le32((unsigned int *) (p.PPCData + 4));
+#undef p
+ return addr;
+unknown:
+ return 0;
+}
+
PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
unsigned packet_tag,
int n)
diff -urNX /home/leigh/.diffex linux-2.6.8-rc2-bk8.prev/include/asm-ppc/residual.h linux-2.6.8-rc2-bk8/include/asm-ppc/residual.h
--- linux-2.6.8-rc2-bk8.prev/include/asm-ppc/residual.h 2004-07-29 20:42:14.000000000 +0100
+++ linux-2.6.8-rc2-bk8/include/asm-ppc/residual.h 2004-07-29 20:43:53.000000000 +0100
@@ -328,6 +328,7 @@
int SubType, int Interface, int n);
extern int residual_pcidev_irq(struct pci_dev *dev);
extern void residual_irq_mask(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
+extern unsigned int residual_isapic_addr(void);
extern PnP_TAG_PACKET *PnP_find_packet(unsigned char *p, unsigned packet_tag,
int n);
extern PnP_TAG_PACKET *PnP_find_small_vendor_packet(unsigned char *p,
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
reply other threads:[~2004-07-29 21:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040729213438.GA5900@george.solinno.co.uk \
--to=leigh@solinno.co.uk \
--cc=barbieri@gmail.com \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=paulus@samba.org \
--cc=trini@kernel.crashing.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).