aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rio/rioboot.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-03-24 06:18:32 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:29 -0500
commit554b7c801e379e8c0072533b4da89a3a003cbfac (patch)
tree86f2da1549e37648948fe3d091ecc76c18714597 /drivers/char/rio/rioboot.c
parent57c2d60e1e3db506cdcecbf60f939593125db7f8 (diff)
[PATCH] Yet more rio cleaning (2 of 2)
- Remove more unused headers - Remove various typedefs - Correct type of PaddrP (physical addresses should be ulong) - Kill use of bcopy - More printk cleanups - Kill true/false - Clean up direct access to pci BARs Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/rio/rioboot.c')
-rw-r--r--drivers/char/rio/rioboot.c78
1 files changed, 37 insertions, 41 deletions
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c
index e1542e8dfb43..acda9326c2ef 100644
--- a/drivers/char/rio/rioboot.c
+++ b/drivers/char/rio/rioboot.c
@@ -47,15 +47,12 @@
47 47
48#include "linux_compat.h" 48#include "linux_compat.h"
49#include "rio_linux.h" 49#include "rio_linux.h"
50#include "typdef.h"
51#include "pkt.h" 50#include "pkt.h"
52#include "daemon.h" 51#include "daemon.h"
53#include "rio.h" 52#include "rio.h"
54#include "riospace.h" 53#include "riospace.h"
55#include "top.h"
56#include "cmdpkt.h" 54#include "cmdpkt.h"
57#include "map.h" 55#include "map.h"
58#include "riotypes.h"
59#include "rup.h" 56#include "rup.h"
60#include "port.h" 57#include "port.h"
61#include "riodrvr.h" 58#include "riodrvr.h"
@@ -68,7 +65,6 @@
68#include "unixrup.h" 65#include "unixrup.h"
69#include "board.h" 66#include "board.h"
70#include "host.h" 67#include "host.h"
71#include "error.h"
72#include "phb.h" 68#include "phb.h"
73#include "link.h" 69#include "link.h"
74#include "cmdblk.h" 70#include "cmdblk.h"
@@ -386,7 +382,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
386 */ 382 */
387 offset = (p->RIOConf.HostLoadBase - 2) - 0x7FFC; 383 offset = (p->RIOConf.HostLoadBase - 2) - 0x7FFC;
388 384
389 writeb(NFIX(((ushort) (~offset) >> (ushort) 12) & 0xF), DestP); 385 writeb(NFIX(((unsigned short) (~offset) >> (unsigned short) 12) & 0xF), DestP);
390 writeb(PFIX((offset >> 8) & 0xF), DestP + 1); 386 writeb(PFIX((offset >> 8) & 0xF), DestP + 1);
391 writeb(PFIX((offset >> 4) & 0xF), DestP + 2); 387 writeb(PFIX((offset >> 4) & 0xF), DestP + 2);
392 writeb(JUMP(offset & 0xF), DestP + 3); 388 writeb(JUMP(offset & 0xF), DestP + 3);
@@ -515,10 +511,10 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
515 ** 32 bit pointers for the driver in ioremap space. 511 ** 32 bit pointers for the driver in ioremap space.
516 */ 512 */
517 HostP->ParmMapP = ParmMapP; 513 HostP->ParmMapP = ParmMapP;
518 HostP->PhbP = (PHB *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr)); 514 HostP->PhbP = (struct PHB *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr));
519 HostP->RupP = (RUP *) RIO_PTR(Cad, readw(&ParmMapP->rups)); 515 HostP->RupP = (struct RUP *) RIO_PTR(Cad, readw(&ParmMapP->rups));
520 HostP->PhbNumP = (ushort *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr)); 516 HostP->PhbNumP = (unsigned short *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr));
521 HostP->LinkStrP = (LPB *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr)); 517 HostP->LinkStrP = (struct LPB *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr));
522 518
523 /* 519 /*
524 ** point the UnixRups at the real Rups 520 ** point the UnixRups at the real Rups
@@ -639,7 +635,7 @@ int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
639 /* 635 /*
640 ** Fill in the default info on the command block 636 ** Fill in the default info on the command block
641 */ 637 */
642 CmdBlkP->Packet.dest_unit = Rup < (ushort) MAX_RUP ? Rup : 0; 638 CmdBlkP->Packet.dest_unit = Rup < (unsigned short) MAX_RUP ? Rup : 0;
643 CmdBlkP->Packet.dest_port = BOOT_RUP; 639 CmdBlkP->Packet.dest_port = BOOT_RUP;
644 CmdBlkP->Packet.src_unit = 0; 640 CmdBlkP->Packet.src_unit = 0;
645 CmdBlkP->Packet.src_port = BOOT_RUP; 641 CmdBlkP->Packet.src_port = BOOT_RUP;
@@ -748,7 +744,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
748 */ 744 */
749 745
750 RtaType = GetUnitType(RtaUniq); 746 RtaType = GetUnitType(RtaUniq);
751 if (Rup >= (ushort) MAX_RUP) 747 if (Rup >= (unsigned short) MAX_RUP)
752 rio_dprintk(RIO_DEBUG_BOOT, "RIO: Host %s has booted an RTA(%d) on link %c\n", HostP->Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A'); 748 rio_dprintk(RIO_DEBUG_BOOT, "RIO: Host %s has booted an RTA(%d) on link %c\n", HostP->Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A');
753 else 749 else
754 rio_dprintk(RIO_DEBUG_BOOT, "RIO: RTA %s has booted an RTA(%d) on link %c\n", HostP->Mapping[Rup].Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A'); 750 rio_dprintk(RIO_DEBUG_BOOT, "RIO: RTA %s has booted an RTA(%d) on link %c\n", HostP->Mapping[Rup].Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A');
@@ -757,7 +753,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
757 753
758 if (RtaUniq == 0x00000000 || RtaUniq == 0xffffffff) { 754 if (RtaUniq == 0x00000000 || RtaUniq == 0xffffffff) {
759 rio_dprintk(RIO_DEBUG_BOOT, "Illegal RTA Uniq Number\n"); 755 rio_dprintk(RIO_DEBUG_BOOT, "Illegal RTA Uniq Number\n");
760 return TRUE; 756 return 1;
761 } 757 }
762 758
763 /* 759 /*
@@ -785,7 +781,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
785 */ 781 */
786 writew(30, &HostP->LinkStrP[MyLink].WaitNoBoot); 782 writew(30, &HostP->LinkStrP[MyLink].WaitNoBoot);
787 rio_dprintk(RIO_DEBUG_BOOT, "RTA %x not owned - suspend booting down link %c on unit %x\n", RtaUniq, 'A' + MyLink, HostP->Mapping[Rup].RtaUniqueNum); 783 rio_dprintk(RIO_DEBUG_BOOT, "RTA %x not owned - suspend booting down link %c on unit %x\n", RtaUniq, 'A' + MyLink, HostP->Mapping[Rup].RtaUniqueNum);
788 return TRUE; 784 return 1;
789 } 785 }
790 786
791 /* 787 /*
@@ -826,7 +822,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
826 rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given IDs %d+%d\n", entry + 1, entry2 + 1); 822 rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given IDs %d+%d\n", entry + 1, entry2 + 1);
827 else 823 else
828 rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given ID %d\n", entry + 1); 824 rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given ID %d\n", entry + 1);
829 return TRUE; 825 return 1;
830 } 826 }
831 } 827 }
832 828
@@ -868,7 +864,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
868 rio_dprintk(RIO_DEBUG_BOOT, "Found previous tentative slot (%d)\n", entry); 864 rio_dprintk(RIO_DEBUG_BOOT, "Found previous tentative slot (%d)\n", entry);
869 if (!p->RIONoMessage) 865 if (!p->RIONoMessage)
870 printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A'); 866 printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A');
871 return TRUE; 867 return 1;
872 } 868 }
873 } 869 }
874 870
@@ -961,13 +957,13 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
961 if (RtaType == TYPE_RTA16) { 957 if (RtaType == TYPE_RTA16) {
962 if (RIOFindFreeID(p, HostP, &entry, &entry2) == 0) { 958 if (RIOFindFreeID(p, HostP, &entry, &entry2) == 0) {
963 RIODefaultName(p, HostP, entry); 959 RIODefaultName(p, HostP, entry);
964 FillSlot(entry, entry2, RtaUniq, HostP); 960 rio_fill_host_slot(entry, entry2, RtaUniq, HostP);
965 EmptySlot = 0; 961 EmptySlot = 0;
966 } 962 }
967 } else { 963 } else {
968 if (RIOFindFreeID(p, HostP, &entry, NULL) == 0) { 964 if (RIOFindFreeID(p, HostP, &entry, NULL) == 0) {
969 RIODefaultName(p, HostP, entry); 965 RIODefaultName(p, HostP, entry);
970 FillSlot(entry, 0, RtaUniq, HostP); 966 rio_fill_host_slot(entry, 0, RtaUniq, HostP);
971 EmptySlot = 0; 967 EmptySlot = 0;
972 } 968 }
973 } 969 }
@@ -1023,7 +1019,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
1023 } else if (!p->RIONoMessage) 1019 } else if (!p->RIONoMessage)
1024 printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A'); 1020 printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A');
1025 RIOSetChange(p); 1021 RIOSetChange(p);
1026 return TRUE; 1022 return 1;
1027 } 1023 }
1028 1024
1029 /* 1025 /*
@@ -1038,7 +1034,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
1038 /* 1034 /*
1039 ** already got it! 1035 ** already got it!
1040 */ 1036 */
1041 return TRUE; 1037 return 1;
1042 } 1038 }
1043 } 1039 }
1044 /* 1040 /*
@@ -1046,13 +1042,13 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
1046 */ 1042 */
1047 if (HostP->NumExtraBooted < MAX_EXTRA_UNITS) 1043 if (HostP->NumExtraBooted < MAX_EXTRA_UNITS)
1048 HostP->ExtraUnits[HostP->NumExtraBooted++] = RtaUniq; 1044 HostP->ExtraUnits[HostP->NumExtraBooted++] = RtaUniq;
1049 return TRUE; 1045 return 1;
1050} 1046}
1051 1047
1052 1048
1053/* 1049/*
1054** If the RTA or its host appears in the RIOBindTab[] structure then 1050** If the RTA or its host appears in the RIOBindTab[] structure then
1055** we mustn't boot the RTA and should return FALSE. 1051** we mustn't boot the RTA and should return 0.
1056** This operation is slightly different from the other drivers for RIO 1052** This operation is slightly different from the other drivers for RIO
1057** in that this is designed to work with the new utilities 1053** in that this is designed to work with the new utilities
1058** not config.rio and is FAR SIMPLER. 1054** not config.rio and is FAR SIMPLER.
@@ -1080,38 +1076,38 @@ int RIOBootOk(struct rio_info *p, struct Host *HostP, unsigned long RtaUniq)
1080** slots tentative, and the second one RTA_SECOND_SLOT as well. 1076** slots tentative, and the second one RTA_SECOND_SLOT as well.
1081*/ 1077*/
1082 1078
1083void FillSlot(int entry, int entry2, unsigned int RtaUniq, struct Host *HostP) 1079void rio_fill_host_slot(int entry, int entry2, unsigned int rta_uniq, struct Host *host)
1084{ 1080{
1085 int link; 1081 int link;
1086 1082
1087 rio_dprintk(RIO_DEBUG_BOOT, "FillSlot(%d, %d, 0x%x...)\n", entry, entry2, RtaUniq); 1083 rio_dprintk(RIO_DEBUG_BOOT, "rio_fill_host_slot(%d, %d, 0x%x...)\n", entry, entry2, rta_uniq);
1088 1084
1089 HostP->Mapping[entry].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE); 1085 host->Mapping[entry].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE);
1090 HostP->Mapping[entry].SysPort = NO_PORT; 1086 host->Mapping[entry].SysPort = NO_PORT;
1091 HostP->Mapping[entry].RtaUniqueNum = RtaUniq; 1087 host->Mapping[entry].RtaUniqueNum = rta_uniq;
1092 HostP->Mapping[entry].HostUniqueNum = HostP->UniqueNum; 1088 host->Mapping[entry].HostUniqueNum = host->UniqueNum;
1093 HostP->Mapping[entry].ID = entry + 1; 1089 host->Mapping[entry].ID = entry + 1;
1094 HostP->Mapping[entry].ID2 = 0; 1090 host->Mapping[entry].ID2 = 0;
1095 if (entry2) { 1091 if (entry2) {
1096 HostP->Mapping[entry2].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE | RTA16_SECOND_SLOT); 1092 host->Mapping[entry2].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE | RTA16_SECOND_SLOT);
1097 HostP->Mapping[entry2].SysPort = NO_PORT; 1093 host->Mapping[entry2].SysPort = NO_PORT;
1098 HostP->Mapping[entry2].RtaUniqueNum = RtaUniq; 1094 host->Mapping[entry2].RtaUniqueNum = rta_uniq;
1099 HostP->Mapping[entry2].HostUniqueNum = HostP->UniqueNum; 1095 host->Mapping[entry2].HostUniqueNum = host->UniqueNum;
1100 HostP->Mapping[entry2].Name[0] = '\0'; 1096 host->Mapping[entry2].Name[0] = '\0';
1101 HostP->Mapping[entry2].ID = entry2 + 1; 1097 host->Mapping[entry2].ID = entry2 + 1;
1102 HostP->Mapping[entry2].ID2 = entry + 1; 1098 host->Mapping[entry2].ID2 = entry + 1;
1103 HostP->Mapping[entry].ID2 = entry2 + 1; 1099 host->Mapping[entry].ID2 = entry2 + 1;
1104 } 1100 }
1105 /* 1101 /*
1106 ** Must set these up, so that utilities show 1102 ** Must set these up, so that utilities show
1107 ** topology of 16 port RTAs correctly 1103 ** topology of 16 port RTAs correctly
1108 */ 1104 */
1109 for (link = 0; link < LINKS_PER_UNIT; link++) { 1105 for (link = 0; link < LINKS_PER_UNIT; link++) {
1110 HostP->Mapping[entry].Topology[link].Unit = ROUTE_DISCONNECT; 1106 host->Mapping[entry].Topology[link].Unit = ROUTE_DISCONNECT;
1111 HostP->Mapping[entry].Topology[link].Link = NO_LINK; 1107 host->Mapping[entry].Topology[link].Link = NO_LINK;
1112 if (entry2) { 1108 if (entry2) {
1113 HostP->Mapping[entry2].Topology[link].Unit = ROUTE_DISCONNECT; 1109 host->Mapping[entry2].Topology[link].Unit = ROUTE_DISCONNECT;
1114 HostP->Mapping[entry2].Topology[link].Link = NO_LINK; 1110 host->Mapping[entry2].Topology[link].Link = NO_LINK;
1115 } 1111 }
1116 } 1112 }
1117} 1113}