* PREP Hardware goes IDE again
@ 1998-12-09 21:30 Alois Fertl
1998-12-09 22:56 ` Cort Dougan
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alois Fertl @ 1998-12-09 21:30 UTC (permalink / raw)
To: Cort Dougan; +Cc: linuxppc-dev@lists.linuxppc.org, Matt Porter, VALETTE Eric
[-- 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
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: PREP Hardware goes IDE again
1998-12-09 21:30 PREP Hardware goes IDE again Alois Fertl
@ 1998-12-09 22:56 ` Cort Dougan
1998-12-10 10:00 ` VALETTE Eric
1998-12-10 11:55 ` Gabriel Paubert
2 siblings, 0 replies; 6+ messages in thread
From: Cort Dougan @ 1998-12-09 22:56 UTC (permalink / raw)
To: Alois Fertl; +Cc: linuxppc-dev@lists.linuxppc.org, Matt Porter, VALETTE Eric
I'll check these out today. Can someone with a mcp750 try them out as
well?
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PREP Hardware goes IDE again
1998-12-09 21:30 PREP Hardware goes IDE again Alois Fertl
1998-12-09 22:56 ` Cort Dougan
@ 1998-12-10 10:00 ` VALETTE Eric
1998-12-11 9:57 ` Alois Fertl
1998-12-10 11:55 ` Gabriel Paubert
2 siblings, 1 reply; 6+ messages in thread
From: VALETTE Eric @ 1998-12-10 10:00 UTC (permalink / raw)
To: alois_fertl; +Cc: cort, linuxppc-dev, mmporter
>>>>> "Alois" == Alois Fertl <alois_fertl@TalkNet.de> writes:
Alois> Here are some small patches (ralative to 2.1.129) which make IDE
Alois> working on PREP Hardware especially the RiscPC (probably also needed
Alois> for MPC750).
Unfortunately, nearly all the change you have proposed are either
irrelevant for MCP750 or worse will cause it to not function.
Alois> The first problem I had was related to interrups on the RiscPC.
Alois> It always assigned IRQ13 to the IDE port. However actually the
Alois> port is connected to IRQ14. The next problem was that prep_pci.c
Alois> assigned IRQ14 to PCI. The Patch now assigns 14 to IDE and uses
Alois> 9,11 and 15 for PCI. In addition to this it sets the edge/level
Alois> control according to PCI preconfiguration. In addition it adds
Alois> 3 more entries to the Blackhawk table.
This is true only if you do not try to use the "full native PCI mode".
In that case you should not look at IDE assigned value in the PCB
but at the PCI interrupt line. This is what happens on MCP750 as
the code automatically switch the driver to "full native PCI mode".
Alois> The second problem was that the partition table of a DOS IDE drive
Alois> was not recognized unless I specified hda=swapdata at the boot prompt.
Alois> IDE CD-Rom drives were not recognized at all. All the required coding
Alois> to operate IDE devices correctly is already there but it is not used
Alois> for PREP hardware. I changed ide.h so that PREP is handled the same
Alois> way as CHRP. This makes IDE disks and CD-roms work without the need
Alois> to specify boot options.
This breaks the MCP750. I tried the patch below, and was not detecting the disk
correctly : everything was incorrectly swapped (including the name of the disk).
My mcp750 system will run correctly *only* if this patch is not included...
Alois> static __inline__ void ide_fix_driveid (struct hd_driveid *id) {
Alois> - if (( _machine == _MACH_Pmac ) || (_machine == _MACH_chrp)|| (_machine == _MACH_mbx) ) {
Alois> + if (( _machine == _MACH_Pmac ) || (_machine == _MACH_chrp)|| (_machine == _MACH_mbx) || (_machine == _MACH_prep) ) {
Since you and mark are motorola felow I will ask you a favor as I did not find
anything on the public docs. In the MCP750A/PG1 manual, page 4-5, I would like
to know how to program PCB and more specifically the PIRQ control route.
I do not find anything in the doc.
-- eric
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: PREP Hardware goes IDE again
1998-12-10 10:00 ` VALETTE Eric
@ 1998-12-11 9:57 ` Alois Fertl
1998-12-11 11:26 ` VALETTE Eric
0 siblings, 1 reply; 6+ messages in thread
From: Alois Fertl @ 1998-12-11 9:57 UTC (permalink / raw)
To: VALETTE Eric; +Cc: cort, linuxppc-dev, mmporter, alois_fertl
On Thu, 10 Dec 1998 11:00:27 +0100 (CET) VALETTE Eric
<valette@crf.canon.fr> wrote:
>
> >>>>> "Alois" == Alois Fertl <alois_fertl@TalkNet.de> writes:
>
> Alois> Here are some small patches (ralative to 2.1.129) which make IDE
> Alois> working on PREP Hardware especially the RiscPC (probably also needed
> Alois> for MPC750).
>
> Unfortunately, nearly all the change you have proposed are either
> irrelevant for MCP750 or worse will cause it to not function.
OK may be it helps others which have to fiddle around with older
systems.
>
> Alois> The first problem I had was related to interrups on the RiscPC.
> Alois> It always assigned IRQ13 to the IDE port. However actually the
> Alois> port is connected to IRQ14. The next problem was that prep_pci.c
> Alois> assigned IRQ14 to PCI. The Patch now assigns 14 to IDE and uses
> Alois> 9,11 and 15 for PCI. In addition to this it sets the edge/level
> Alois> control according to PCI preconfiguration. In addition it adds
> Alois> 3 more entries to the Blackhawk table.
>
> This is true only if you do not try to use the "full native PCI mode".
> In that case you should not look at IDE assigned value in the PCB
> but at the PCI interrupt line. This is what happens on MCP750 as
> the code automatically switch the driver to "full native PCI mode".
I agree. The same is true for the WINBOND chip which is handled as
sl82c105 by linux.
>
> Alois> The second problem was that the partition table of a DOS IDE drive
> Alois> was not recognized unless I specified hda=swapdata at the boot prompt.
> Alois> IDE CD-Rom drives were not recognized at all. All the required coding
> Alois> to operate IDE devices correctly is already there but it is not used
> Alois> for PREP hardware. I changed ide.h so that PREP is handled the same
> Alois> way as CHRP. This makes IDE disks and CD-roms work without the need
> Alois> to specify boot options.
>
> This breaks the MCP750. I tried the patch below, and was not detecting the disk
> correctly : everything was incorrectly swapped (including the name of the disk).
> My mcp750 system will run correctly *only* if this patch is not included...
>
> Alois> static __inline__ void ide_fix_driveid (struct hd_driveid *id) {
> Alois> - if (( _machine == _MACH_Pmac ) || (_machine == _MACH_chrp)|| (_machine == _MACH_mbx) ) {
> Alois> + if (( _machine == _MACH_Pmac ) || (_machine == _MACH_chrp)|| (_machine == _MACH_mbx) || (_machine == _MACH_prep) ) {
Sorry for that. But at least good to know. The seems to be something
different between the VIA chip or driver and the NS PC87303 resp. the
SL82C105 which work fine for me.
>
> Since you and mark are motorola felow I will ask you a favor as I did not find
> anything on the public docs. In the MCP750A/PG1 manual, page 4-5, I would like
> to know how to program PCB and more specifically the PIRQ control route.
> I do not find anything in the doc.
This is typically done via the PCI to ISA bridge. I guess you find the
answer in the data sheet for the VIA chip. You can find it on
http://www.via.com.tw/support/datasheets.htm
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: PREP Hardware goes IDE again
1998-12-11 9:57 ` Alois Fertl
@ 1998-12-11 11:26 ` VALETTE Eric
0 siblings, 0 replies; 6+ messages in thread
From: VALETTE Eric @ 1998-12-11 11:26 UTC (permalink / raw)
To: alois_fertl; +Cc: cort, linuxppc-dev, mmporter, alois_fertl
>>>>> "Alois" == Alois Fertl <alois_fertl@muenchen.europe.mcd.mot.com> writes:
eric> Unfortunately, nearly all the change you have proposed are either
eric> irrelevant for MCP750 or worse will cause it to not function.
Alois> OK may be it helps others which have to fiddle around with older
Alois> systems.
I hope you did not misunderstood what I said : it great to have patch
that makes other machines work. Just wanted to say to it will break
the MCP750 with explanation and maybe other machines with the raven
(as it is capable of byte swapping things that come directly from
PCI bus)...
eric> This is true only if you do not try to use the "full native PCI mode".
eric> In that case you should not look at IDE assigned value in the PCB
eric> but at the PCI interrupt line. This is what happens on MCP750 as
eric> the code automatically switch the driver to "full native PCI mode".
Alois> I agree. The same is true for the WINBOND chip which is handled as
Alois> sl82c105 by linux.
Is the patch for byte swapping also needed when you use the full
"native PCI mode"?
Alois> The second problem was that the partition table of a DOS IDE drive
Alois> was not recognized unless I specified hda=swapdata at the boot prompt.
I understand that you created the dos partition table on another machine.
I used cfdisk directly on linux to partition the drive. This may makes the
difference.
Alois> IDE CD-Rom drives were not recognized at all. All the required coding
Alois> to operate IDE devices correctly is already there but it is not used
Alois> for PREP hardware. I changed ide.h so that PREP is handled the same
Alois> way as CHRP. This makes IDE disks and CD-roms work without the need
Alois> to specify boot options.
eric> This breaks the MCP750. I tried the patch below, and was not detecting the disk
eric> correctly : everything was incorrectly swapped (including the name of the disk).
eric> My mcp750 system will run correctly *only* if this patch is not included...
eric>
Alois> static __inline__ void ide_fix_driveid (struct hd_driveid *id) {
Alois> - if (( _machine == _MACH_Pmac ) || (_machine == _MACH_chrp)|| (_machine == _MACH_mbx) ) {
Alois> + if (( _machine == _MACH_Pmac ) || (_machine == _MACH_chrp)|| (_machine == _MACH_mbx) || (_machine == _MACH_prep) ) {
Alois> Sorry for that. But at least good to know. The seems to be something
Alois> different between the VIA chip or driver and the NS PC87303 resp. the
Alois> SL82C105 which work fine for me.
I'm not agains integration of your patch anyway :) I would rather prefer
to have something that works in both case and at leat to understand why we
do not require the same byte swapping options as we are both running in the
same endian mode. This may be related to raven capability of byte swapping
informations that comes from the PCI bus automatically.
eric> I do not find anything in the doc.
Alois> This is typically done via the PCI to ISA bridge. I guess you find the
Alois> answer in the data sheet for the VIA chip. You can find it on
Alois> http://www.via.com.tw/support/datasheets.htm
Thanks. In fact I found the info since the request IN THE VIA CHIPSET DOC
as you mentionned. It may help other...
Have a nice day,
--
__
/ ` Eric Valette
/-- __ o _. Canon CRF
(___, / (_(_(__ Rue de la touche lambert
35517 Cesson-Sevigne Cedex
FRANCE
Tel: +33 (0)2 99 87 68 91 Fax: +33 (0)2 99 84 11 30
E-mail: valette@crf.canon.fr
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PREP Hardware goes IDE again
1998-12-09 21:30 PREP Hardware goes IDE again Alois Fertl
1998-12-09 22:56 ` Cort Dougan
1998-12-10 10:00 ` VALETTE Eric
@ 1998-12-10 11:55 ` Gabriel Paubert
2 siblings, 0 replies; 6+ messages in thread
From: Gabriel Paubert @ 1998-12-10 11:55 UTC (permalink / raw)
To: Alois Fertl
Cc: Cort Dougan, linuxppc-dev@lists.linuxppc.org, Matt Porter,
VALETTE Eric
On Wed, 9 Dec 1998, Alois Fertl wrote:
> 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.
Indeed, I always wondered why this was this way. But not having any IDE
interface...
Gabriel.
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1998-12-11 11:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-12-09 21:30 PREP Hardware goes IDE again Alois Fertl
1998-12-09 22:56 ` 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
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).