From: Alois Fertl <alois_fertl@TalkNet.de>
To: Cort Dougan <cort@persephone.cs.nmt.edu>
Cc: "linuxppc-dev@lists.linuxppc.org"
<linuxppc-dev@lists.linuxppc.org>,
Matt Porter <mmporter@home.com>,
VALETTE Eric <valette@crf.canon.fr>
Subject: PREP Hardware goes IDE again
Date: Wed, 09 Dec 1998 21:30:45 +0000 [thread overview]
Message-ID: <366EEC05.E01F2088@talknet.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]
Here are some small patches (ralative to 2.1.129) which make IDE
working on PREP Hardware especially the RiscPC (probably also needed
for MPC750).
The first problem I had was related to interrups on the RiscPC.
It always assigned IRQ13 to the IDE port. However actually the
port is connected to IRQ14. The next problem was that prep_pci.c
assigned IRQ14 to PCI. The Patch now assigns 14 to IDE and uses
9,11 and 15 for PCI. In addition to this it sets the edge/level
control according to PCI preconfiguration. In addition it adds
3 more entries to the Blackhawk table.
The second problem was that the partition table of a DOS IDE drive
was not recognized unless I specified hda=swapdata at the boot prompt.
IDE CD-Rom drives were not recognized at all. All the required coding
to operate IDE devices correctly is already there but it is not used
for PREP hardware. I changed ide.h so that PREP is handled the same
way as CHRP. This makes IDE disks and CD-roms work without the need
to specify boot options.
[-- Attachment #2: linux.diff2 --]
[-- Type: text/plain, Size: 3613 bytes --]
+ diff -urN linux-2.1.129.org/include/asm-ppc/ide.h linux-2.1.129/include/asm-ppc/ide.h
--- linux-2.1.129.org/include/asm-ppc/ide.h Tue Dec 1 09:40:36 1998
+++ linux-2.1.129/include/asm-ppc/ide.h Wed Dec 9 23:02:45 1998
@@ -88,7 +88,7 @@
return chrp_ide_irq;
}
switch (base) {
- case 0x1f0: return 13;
+ case 0x1f0: return 14;
case 0x170: return 13;
case 0x1e8: return 11;
case 0x168: return 10;
@@ -146,7 +146,7 @@
(Despite what it says in drivers/block/ide.h, they come up as little endian...)
Changes to linux/hdreg.h may require changes here. */
static __inline__ void ide_fix_driveid (struct hd_driveid *id) {
- if (( _machine == _MACH_Pmac ) || (_machine == _MACH_chrp)|| (_machine == _MACH_mbx) ) {
+ if (( _machine == _MACH_Pmac ) || (_machine == _MACH_chrp)|| (_machine == _MACH_mbx) || (_machine == _MACH_prep) ) {
int i;
unsigned short *stringcast;
id->config = __le16_to_cpu(id->config);
@@ -215,7 +215,7 @@
#undef insw
#define insw(port, buf, ns) do { \
- if ( _machine == _MACH_chrp) {\
+ if ( (_machine == _MACH_chrp) || (_machine == _MACH_prep) ) {\
ide_insw((port)+_IO_BASE, (buf), (ns)); \
}\
else if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) ) \
@@ -227,7 +227,7 @@
#undef outsw
/* printk("port: %x buf: %p ns: %d\n",port,buf,ns); \ */
#define outsw(port, buf, ns) do { \
- if ( _machine == _MACH_chrp) {\
+ if ( (_machine == _MACH_chrp) || (_machine == _MACH_prep) ) {\
ide_outsw((port)+_IO_BASE, (buf), (ns)); \
}\
else if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) ) \
+ diff -urN linux-2.1.129.org/arch/ppc/kernel/prep_pci.c linux-2.1.129/arch/ppc/kernel/prep_pci.c
--- linux-2.1.129.org/arch/ppc/kernel/prep_pci.c Sun Nov 1 11:40:26 1998
+++ linux-2.1.129/arch/ppc/kernel/prep_pci.c Wed Dec 9 23:14:19 1998
@@ -107,7 +107,7 @@
};
/* Motorola PowerStack */
-static char Blackhawk_pci_IRQ_map[16] __prepdata =
+static char Blackhawk_pci_IRQ_map[19] __prepdata =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -125,6 +125,9 @@
0, /* Slot 13 - unused */
1, /* Slot 14 - Ethernet */
0, /* Slot 15 - unused */
+ 1, /* Slot P7 */
+ 2, /* Slot P6 */
+ 3, /* Slot P5 */
};
static char Blackhawk_pci_IRQ_routes[] __prepdata =
@@ -132,7 +135,7 @@
0, /* Line 0 - Unused */
9, /* Line 1 */
11, /* Line 2 */
- 14, /* Line 3 */
+ 15, /* Line 3 */
15 /* Line 4 */
};
@@ -440,6 +443,8 @@
if ( _prep_type == _PREP_Motorola)
{
+ unsigned short irq_mode;
+
switch (inb(0x800) & 0xF0)
{
case 0x10: /* MVME16xx */
@@ -474,6 +479,14 @@
Motherboard_routes = Blackhawk_pci_IRQ_routes;
break;
}
+ /* AJF adjust level/edge control according to routes */
+ irq_mode = 0;
+ for (i = 1; i <= 4; i++)
+ {
+ irq_mode |= ( 1 << Motherboard_routes[i] );
+ }
+ outb( irq_mode & 0xff, 0x4d0 );
+ outb( (irq_mode >> 8) & 0xff, 0x4d1 );
} else if ( _prep_type == _PREP_IBM )
{
unsigned char pl_id;
+ diff -urN linux-2.1.129.org/arch/ppc/kernel/irq.c linux-2.1.129/arch/ppc/kernel/irq.c
--- linux-2.1.129.org/arch/ppc/kernel/irq.c Tue Nov 24 18:48:32 1998
+++ linux-2.1.129/arch/ppc/kernel/irq.c Wed Dec 9 23:06:45 1998
@@ -1099,6 +1099,8 @@
/*
* Sound on the Powerstack reportedly needs to be edge triggered
*/
+/* AJF Moved to prep_pci.c */
+#if 0
if ( _prep_type == _PREP_Motorola )
{
irq_mode2 &= ~0x04L;
@@ -1106,7 +1108,7 @@
outb( irq_mode1 , 0x4d0 );
outb( irq_mode2 , 0x4d1 );
}
-
+#endif
}
break;
#ifdef CONFIG_APUS
next reply other threads:[~1998-12-09 21:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-09 21:30 Alois Fertl [this message]
1998-12-09 22:56 ` PREP Hardware goes IDE again Cort Dougan
1998-12-10 10:00 ` VALETTE Eric
1998-12-11 9:57 ` Alois Fertl
1998-12-11 11:26 ` VALETTE Eric
1998-12-10 11:55 ` Gabriel Paubert
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=366EEC05.E01F2088@talknet.de \
--to=alois_fertl@talknet.de \
--cc=cort@persephone.cs.nmt.edu \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=mmporter@home.com \
--cc=valette@crf.canon.fr \
/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.