PREP Hardware goes IDE again
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.
+ diff -urN linux-2.1.129.org/include/asm-ppc/ide.h linux-2.1.129/include/asm-ppc/ide.h
include/asm-ppc/ide.h +4 -4
@@ -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
arch/ppc/kernel/prep_pci.c +15 -2
@@ -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
arch/ppc/kernel/irq.c +3 -1
@@ -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
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 [email protected] ]]
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Alois" == Alois Fertl <[email protected]> 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 [email protected] ]]
Quoted 7 lines · Alois Fertl
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.hso 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 [email protected] ]]
Quoted 9 lines · On Thu, 10 Dec 1998 11:00:27 +0100 (CET) VALETTE Eric <[email protected]>…
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Alois" == Alois Fertl <[email protected]> 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.
Quoted 9 lines
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.cAlois> 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.
Quoted 4 lines
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.
Quoted 9 lines
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.hso 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.
Quoted 7 lines
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__voidide_fix_driveid(structhd_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.
Quoted 5 lines
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 [email protected] ]]
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Alois" == Alois Fertl <[email protected]> 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: [email protected]
[[ 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 [email protected] ]]