diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-20 20:35:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-20 20:35:25 -0400 |
commit | c2e68052429fdf87702fccd272951282bef1c60a (patch) | |
tree | b9f3bf3918526af068ed264190a85fb18dd3d8b0 /drivers | |
parent | d6f410bdbcb435c744c4f8259d6659ae2c6e447a (diff) | |
parent | 1256efd5519a8eca2dfa6039ce5cf58f44d1626d (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: fix section mismatch warning in mdesc.c
[SPARC64]: fix section mismatch warning in pci_sunv4
[SPARC64]: Stop using drivers/char/rtc.c
[SPARC64]: Convert parport to of_platform_driver.
[SPARC]: Implement fb_is_primary_device().
[SPARC64]: Fix virq decomposition.
[SPARC64]: Use KERN_ERR in IRQ manipulation error printks.
[SPARC64]: Do not flood log with failed DS messages.
[SPARC64]: Add proper multicast support to VNET driver.
[SPARC64]: Handle multiple domain-services-port nodes properly.
[SPARC64]: Improve VIO device naming further.
[SPARC]: Make sure dev_archdata is filled in for all devices.
[SPARC]: Define minimal struct dev_archdata, similarly to sparc64.
[SPARC]: Fix serial console device detection.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/rtc.c | 30 | ||||
-rw-r--r-- | drivers/net/sunvnet.c | 137 | ||||
-rw-r--r-- | drivers/net/sunvnet.h | 11 | ||||
-rw-r--r-- | drivers/sbus/sbus.c | 5 | ||||
-rw-r--r-- | drivers/serial/suncore.c | 123 | ||||
-rw-r--r-- | drivers/serial/suncore.h | 2 | ||||
-rw-r--r-- | drivers/serial/sunhv.c | 13 | ||||
-rw-r--r-- | drivers/serial/sunsab.c | 22 | ||||
-rw-r--r-- | drivers/serial/sunsu.c | 23 | ||||
-rw-r--r-- | drivers/serial/sunzilog.c | 24 | ||||
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 4 | ||||
-rw-r--r-- | drivers/video/igafb.c | 4 |
13 files changed, 223 insertions, 177 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 4373d7cdc5d2..c8dfd18bea44 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -726,7 +726,7 @@ config NVRAM | |||
726 | 726 | ||
727 | config RTC | 727 | config RTC |
728 | tristate "Enhanced Real Time Clock Support" | 728 | tristate "Enhanced Real Time Clock Support" |
729 | depends on !PPC && !PARISC && !IA64 && !M68K && (!SPARC || PCI) && !FRV && !ARM && !SUPERH && !S390 | 729 | depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC64 && (!SPARC32 || PCI) && !FRV && !ARM && !SUPERH && !S390 |
730 | ---help--- | 730 | ---help--- |
731 | If you say Y here and create a character special file /dev/rtc with | 731 | If you say Y here and create a character special file /dev/rtc with |
732 | major number 10 and minor number 135 using mknod ("man mknod"), you | 732 | major number 10 and minor number 135 using mknod ("man mknod"), you |
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 22cf7aa56cc4..30c3f54c7666 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -86,12 +86,9 @@ | |||
86 | #include <asm/hpet.h> | 86 | #include <asm/hpet.h> |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | #ifdef __sparc__ | 89 | #ifdef CONFIG_SPARC32 |
90 | #include <linux/pci.h> | 90 | #include <linux/pci.h> |
91 | #include <asm/ebus.h> | 91 | #include <asm/ebus.h> |
92 | #ifdef __sparc_v9__ | ||
93 | #include <asm/isa.h> | ||
94 | #endif | ||
95 | 92 | ||
96 | static unsigned long rtc_port; | 93 | static unsigned long rtc_port; |
97 | static int rtc_irq = PCI_IRQ_NONE; | 94 | static int rtc_irq = PCI_IRQ_NONE; |
@@ -930,13 +927,9 @@ static int __init rtc_init(void) | |||
930 | unsigned int year, ctrl; | 927 | unsigned int year, ctrl; |
931 | char *guess = NULL; | 928 | char *guess = NULL; |
932 | #endif | 929 | #endif |
933 | #ifdef __sparc__ | 930 | #ifdef CONFIG_SPARC32 |
934 | struct linux_ebus *ebus; | 931 | struct linux_ebus *ebus; |
935 | struct linux_ebus_device *edev; | 932 | struct linux_ebus_device *edev; |
936 | #ifdef __sparc_v9__ | ||
937 | struct sparc_isa_bridge *isa_br; | ||
938 | struct sparc_isa_device *isa_dev; | ||
939 | #endif | ||
940 | #else | 933 | #else |
941 | void *r; | 934 | void *r; |
942 | #ifdef RTC_IRQ | 935 | #ifdef RTC_IRQ |
@@ -944,7 +937,7 @@ static int __init rtc_init(void) | |||
944 | #endif | 937 | #endif |
945 | #endif | 938 | #endif |
946 | 939 | ||
947 | #ifdef __sparc__ | 940 | #ifdef CONFIG_SPARC32 |
948 | for_each_ebus(ebus) { | 941 | for_each_ebus(ebus) { |
949 | for_each_ebusdev(edev, ebus) { | 942 | for_each_ebusdev(edev, ebus) { |
950 | if(strcmp(edev->prom_node->name, "rtc") == 0) { | 943 | if(strcmp(edev->prom_node->name, "rtc") == 0) { |
@@ -954,17 +947,6 @@ static int __init rtc_init(void) | |||
954 | } | 947 | } |
955 | } | 948 | } |
956 | } | 949 | } |
957 | #ifdef __sparc_v9__ | ||
958 | for_each_isa(isa_br) { | ||
959 | for_each_isadev(isa_dev, isa_br) { | ||
960 | if (strcmp(isa_dev->prom_node->name, "rtc") == 0) { | ||
961 | rtc_port = isa_dev->resource.start; | ||
962 | rtc_irq = isa_dev->irq; | ||
963 | goto found; | ||
964 | } | ||
965 | } | ||
966 | } | ||
967 | #endif | ||
968 | rtc_has_irq = 0; | 950 | rtc_has_irq = 0; |
969 | printk(KERN_ERR "rtc_init: no PC rtc found\n"); | 951 | printk(KERN_ERR "rtc_init: no PC rtc found\n"); |
970 | return -EIO; | 952 | return -EIO; |
@@ -1020,7 +1002,7 @@ no_irq: | |||
1020 | 1002 | ||
1021 | #endif | 1003 | #endif |
1022 | 1004 | ||
1023 | #endif /* __sparc__ vs. others */ | 1005 | #endif /* CONFIG_SPARC32 vs. others */ |
1024 | 1006 | ||
1025 | if (misc_register(&rtc_dev)) { | 1007 | if (misc_register(&rtc_dev)) { |
1026 | #ifdef RTC_IRQ | 1008 | #ifdef RTC_IRQ |
@@ -1105,7 +1087,7 @@ static void __exit rtc_exit (void) | |||
1105 | remove_proc_entry ("driver/rtc", NULL); | 1087 | remove_proc_entry ("driver/rtc", NULL); |
1106 | misc_deregister(&rtc_dev); | 1088 | misc_deregister(&rtc_dev); |
1107 | 1089 | ||
1108 | #ifdef __sparc__ | 1090 | #ifdef CONFIG_SPARC32 |
1109 | if (rtc_has_irq) | 1091 | if (rtc_has_irq) |
1110 | free_irq (rtc_irq, &rtc_port); | 1092 | free_irq (rtc_irq, &rtc_port); |
1111 | #else | 1093 | #else |
@@ -1117,7 +1099,7 @@ static void __exit rtc_exit (void) | |||
1117 | if (rtc_has_irq) | 1099 | if (rtc_has_irq) |
1118 | free_irq (RTC_IRQ, NULL); | 1100 | free_irq (RTC_IRQ, NULL); |
1119 | #endif | 1101 | #endif |
1120 | #endif /* __sparc__ */ | 1102 | #endif /* CONFIG_SPARC32 */ |
1121 | } | 1103 | } |
1122 | 1104 | ||
1123 | module_init(rtc_init); | 1105 | module_init(rtc_init); |
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c index ef0066bab2cf..61f98251feab 100644 --- a/drivers/net/sunvnet.c +++ b/drivers/net/sunvnet.c | |||
@@ -459,6 +459,22 @@ static int vnet_nack(struct vnet_port *port, void *msgbuf) | |||
459 | return 0; | 459 | return 0; |
460 | } | 460 | } |
461 | 461 | ||
462 | static int handle_mcast(struct vnet_port *port, void *msgbuf) | ||
463 | { | ||
464 | struct vio_net_mcast_info *pkt = msgbuf; | ||
465 | |||
466 | if (pkt->tag.stype != VIO_SUBTYPE_ACK) | ||
467 | printk(KERN_ERR PFX "%s: Got unexpected MCAST reply " | ||
468 | "[%02x:%02x:%04x:%08x]\n", | ||
469 | port->vp->dev->name, | ||
470 | pkt->tag.type, | ||
471 | pkt->tag.stype, | ||
472 | pkt->tag.stype_env, | ||
473 | pkt->tag.sid); | ||
474 | |||
475 | return 0; | ||
476 | } | ||
477 | |||
462 | static void maybe_tx_wakeup(struct vnet *vp) | 478 | static void maybe_tx_wakeup(struct vnet *vp) |
463 | { | 479 | { |
464 | struct net_device *dev = vp->dev; | 480 | struct net_device *dev = vp->dev; |
@@ -544,7 +560,10 @@ static void vnet_event(void *arg, int event) | |||
544 | err = vnet_nack(port, &msgbuf); | 560 | err = vnet_nack(port, &msgbuf); |
545 | } | 561 | } |
546 | } else if (msgbuf.tag.type == VIO_TYPE_CTRL) { | 562 | } else if (msgbuf.tag.type == VIO_TYPE_CTRL) { |
547 | err = vio_control_pkt_engine(vio, &msgbuf); | 563 | if (msgbuf.tag.stype_env == VNET_MCAST_INFO) |
564 | err = handle_mcast(port, &msgbuf); | ||
565 | else | ||
566 | err = vio_control_pkt_engine(vio, &msgbuf); | ||
548 | if (err) | 567 | if (err) |
549 | break; | 568 | break; |
550 | } else { | 569 | } else { |
@@ -731,9 +750,122 @@ static int vnet_close(struct net_device *dev) | |||
731 | return 0; | 750 | return 0; |
732 | } | 751 | } |
733 | 752 | ||
753 | static struct vnet_mcast_entry *__vnet_mc_find(struct vnet *vp, u8 *addr) | ||
754 | { | ||
755 | struct vnet_mcast_entry *m; | ||
756 | |||
757 | for (m = vp->mcast_list; m; m = m->next) { | ||
758 | if (!memcmp(m->addr, addr, ETH_ALEN)) | ||
759 | return m; | ||
760 | } | ||
761 | return NULL; | ||
762 | } | ||
763 | |||
764 | static void __update_mc_list(struct vnet *vp, struct net_device *dev) | ||
765 | { | ||
766 | struct dev_addr_list *p; | ||
767 | |||
768 | for (p = dev->mc_list; p; p = p->next) { | ||
769 | struct vnet_mcast_entry *m; | ||
770 | |||
771 | m = __vnet_mc_find(vp, p->dmi_addr); | ||
772 | if (m) { | ||
773 | m->hit = 1; | ||
774 | continue; | ||
775 | } | ||
776 | |||
777 | if (!m) { | ||
778 | m = kzalloc(sizeof(*m), GFP_ATOMIC); | ||
779 | if (!m) | ||
780 | continue; | ||
781 | memcpy(m->addr, p->dmi_addr, ETH_ALEN); | ||
782 | m->hit = 1; | ||
783 | |||
784 | m->next = vp->mcast_list; | ||
785 | vp->mcast_list = m; | ||
786 | } | ||
787 | } | ||
788 | } | ||
789 | |||
790 | static void __send_mc_list(struct vnet *vp, struct vnet_port *port) | ||
791 | { | ||
792 | struct vio_net_mcast_info info; | ||
793 | struct vnet_mcast_entry *m, **pp; | ||
794 | int n_addrs; | ||
795 | |||
796 | memset(&info, 0, sizeof(info)); | ||
797 | |||
798 | info.tag.type = VIO_TYPE_CTRL; | ||
799 | info.tag.stype = VIO_SUBTYPE_INFO; | ||
800 | info.tag.stype_env = VNET_MCAST_INFO; | ||
801 | info.tag.sid = vio_send_sid(&port->vio); | ||
802 | info.set = 1; | ||
803 | |||
804 | n_addrs = 0; | ||
805 | for (m = vp->mcast_list; m; m = m->next) { | ||
806 | if (m->sent) | ||
807 | continue; | ||
808 | m->sent = 1; | ||
809 | memcpy(&info.mcast_addr[n_addrs * ETH_ALEN], | ||
810 | m->addr, ETH_ALEN); | ||
811 | if (++n_addrs == VNET_NUM_MCAST) { | ||
812 | info.count = n_addrs; | ||
813 | |||
814 | (void) vio_ldc_send(&port->vio, &info, | ||
815 | sizeof(info)); | ||
816 | n_addrs = 0; | ||
817 | } | ||
818 | } | ||
819 | if (n_addrs) { | ||
820 | info.count = n_addrs; | ||
821 | (void) vio_ldc_send(&port->vio, &info, sizeof(info)); | ||
822 | } | ||
823 | |||
824 | info.set = 0; | ||
825 | |||
826 | n_addrs = 0; | ||
827 | pp = &vp->mcast_list; | ||
828 | while ((m = *pp) != NULL) { | ||
829 | if (m->hit) { | ||
830 | m->hit = 0; | ||
831 | pp = &m->next; | ||
832 | continue; | ||
833 | } | ||
834 | |||
835 | memcpy(&info.mcast_addr[n_addrs * ETH_ALEN], | ||
836 | m->addr, ETH_ALEN); | ||
837 | if (++n_addrs == VNET_NUM_MCAST) { | ||
838 | info.count = n_addrs; | ||
839 | (void) vio_ldc_send(&port->vio, &info, | ||
840 | sizeof(info)); | ||
841 | n_addrs = 0; | ||
842 | } | ||
843 | |||
844 | *pp = m->next; | ||
845 | kfree(m); | ||
846 | } | ||
847 | if (n_addrs) { | ||
848 | info.count = n_addrs; | ||
849 | (void) vio_ldc_send(&port->vio, &info, sizeof(info)); | ||
850 | } | ||
851 | } | ||
852 | |||
734 | static void vnet_set_rx_mode(struct net_device *dev) | 853 | static void vnet_set_rx_mode(struct net_device *dev) |
735 | { | 854 | { |
736 | /* XXX Implement multicast support XXX */ | 855 | struct vnet *vp = netdev_priv(dev); |
856 | struct vnet_port *port; | ||
857 | unsigned long flags; | ||
858 | |||
859 | spin_lock_irqsave(&vp->lock, flags); | ||
860 | if (!list_empty(&vp->port_list)) { | ||
861 | port = list_entry(vp->port_list.next, struct vnet_port, list); | ||
862 | |||
863 | if (port->switch_port) { | ||
864 | __update_mc_list(vp, dev); | ||
865 | __send_mc_list(vp, port); | ||
866 | } | ||
867 | } | ||
868 | spin_unlock_irqrestore(&vp->lock, flags); | ||
737 | } | 869 | } |
738 | 870 | ||
739 | static int vnet_change_mtu(struct net_device *dev, int new_mtu) | 871 | static int vnet_change_mtu(struct net_device *dev, int new_mtu) |
@@ -1070,6 +1202,7 @@ static int __devinit vnet_port_probe(struct vio_dev *vdev, | |||
1070 | switch_port = 0; | 1202 | switch_port = 0; |
1071 | if (mdesc_get_property(hp, vdev->mp, "switch-port", NULL) != NULL) | 1203 | if (mdesc_get_property(hp, vdev->mp, "switch-port", NULL) != NULL) |
1072 | switch_port = 1; | 1204 | switch_port = 1; |
1205 | port->switch_port = switch_port; | ||
1073 | 1206 | ||
1074 | spin_lock_irqsave(&vp->lock, flags); | 1207 | spin_lock_irqsave(&vp->lock, flags); |
1075 | if (switch_port) | 1208 | if (switch_port) |
diff --git a/drivers/net/sunvnet.h b/drivers/net/sunvnet.h index 7d3a0cac727b..d347a5bf24b0 100644 --- a/drivers/net/sunvnet.h +++ b/drivers/net/sunvnet.h | |||
@@ -30,6 +30,8 @@ struct vnet_port { | |||
30 | 30 | ||
31 | struct hlist_node hash; | 31 | struct hlist_node hash; |
32 | u8 raddr[ETH_ALEN]; | 32 | u8 raddr[ETH_ALEN]; |
33 | u8 switch_port; | ||
34 | u8 __pad; | ||
33 | 35 | ||
34 | struct vnet *vp; | 36 | struct vnet *vp; |
35 | 37 | ||
@@ -53,6 +55,13 @@ static inline unsigned int vnet_hashfn(u8 *mac) | |||
53 | return val & (VNET_PORT_HASH_MASK); | 55 | return val & (VNET_PORT_HASH_MASK); |
54 | } | 56 | } |
55 | 57 | ||
58 | struct vnet_mcast_entry { | ||
59 | u8 addr[ETH_ALEN]; | ||
60 | u8 sent; | ||
61 | u8 hit; | ||
62 | struct vnet_mcast_entry *next; | ||
63 | }; | ||
64 | |||
56 | struct vnet { | 65 | struct vnet { |
57 | /* Protects port_list and port_hash. */ | 66 | /* Protects port_list and port_hash. */ |
58 | spinlock_t lock; | 67 | spinlock_t lock; |
@@ -65,6 +74,8 @@ struct vnet { | |||
65 | 74 | ||
66 | struct hlist_head port_hash[VNET_PORT_HASH_SIZE]; | 75 | struct hlist_head port_hash[VNET_PORT_HASH_SIZE]; |
67 | 76 | ||
77 | struct vnet_mcast_entry *mcast_list; | ||
78 | |||
68 | struct list_head list; | 79 | struct list_head list; |
69 | u64 local_mac; | 80 | u64 local_mac; |
70 | }; | 81 | }; |
diff --git a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c index 002643392d42..2553629ec15d 100644 --- a/drivers/sbus/sbus.c +++ b/drivers/sbus/sbus.c | |||
@@ -33,6 +33,7 @@ struct sbus_bus *sbus_root; | |||
33 | 33 | ||
34 | static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev) | 34 | static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev) |
35 | { | 35 | { |
36 | struct dev_archdata *sd; | ||
36 | unsigned long base; | 37 | unsigned long base; |
37 | const void *pval; | 38 | const void *pval; |
38 | int len, err; | 39 | int len, err; |
@@ -67,6 +68,10 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde | |||
67 | 68 | ||
68 | sbus_fill_device_irq(sdev); | 69 | sbus_fill_device_irq(sdev); |
69 | 70 | ||
71 | sd = &sdev->ofdev.dev.archdata; | ||
72 | sd->prom_node = dp; | ||
73 | sd->op = &sdev->ofdev; | ||
74 | |||
70 | sdev->ofdev.node = dp; | 75 | sdev->ofdev.node = dp; |
71 | if (sdev->parent) | 76 | if (sdev->parent) |
72 | sdev->ofdev.dev.parent = &sdev->parent->ofdev.dev; | 77 | sdev->ofdev.dev.parent = &sdev->parent->ofdev.dev; |
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c index b45ba5392dd3..70a09a3d5af0 100644 --- a/drivers/serial/suncore.c +++ b/drivers/serial/suncore.c | |||
@@ -16,9 +16,10 @@ | |||
16 | #include <linux/tty.h> | 16 | #include <linux/tty.h> |
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
19 | #include <linux/serial_core.h> | ||
19 | #include <linux/init.h> | 20 | #include <linux/init.h> |
20 | 21 | ||
21 | #include <asm/oplib.h> | 22 | #include <asm/prom.h> |
22 | 23 | ||
23 | #include "suncore.h" | 24 | #include "suncore.h" |
24 | 25 | ||
@@ -26,92 +27,60 @@ int sunserial_current_minor = 64; | |||
26 | 27 | ||
27 | EXPORT_SYMBOL(sunserial_current_minor); | 28 | EXPORT_SYMBOL(sunserial_current_minor); |
28 | 29 | ||
29 | void | 30 | int sunserial_console_match(struct console *con, struct device_node *dp, |
30 | sunserial_console_termios(struct console *con) | 31 | struct uart_driver *drv, int line) |
31 | { | 32 | { |
32 | char mode[16], buf[16], *s; | 33 | int off; |
33 | char mode_prop[] = "ttyX-mode"; | ||
34 | char cd_prop[] = "ttyX-ignore-cd"; | ||
35 | char dtr_prop[] = "ttyX-rts-dtr-off"; | ||
36 | char *ssp_console_modes_prop = "ssp-console-modes"; | ||
37 | int baud, bits, stop, cflag; | ||
38 | char parity; | ||
39 | int carrier = 0; | ||
40 | int rtsdtr = 1; | ||
41 | int topnd, nd; | ||
42 | |||
43 | if (!serial_console) | ||
44 | return; | ||
45 | |||
46 | switch (serial_console) { | ||
47 | case PROMDEV_OTTYA: | ||
48 | mode_prop[3] = 'a'; | ||
49 | cd_prop[3] = 'a'; | ||
50 | dtr_prop[3] = 'a'; | ||
51 | break; | ||
52 | |||
53 | case PROMDEV_OTTYB: | ||
54 | mode_prop[3] = 'b'; | ||
55 | cd_prop[3] = 'b'; | ||
56 | dtr_prop[3] = 'b'; | ||
57 | break; | ||
58 | |||
59 | case PROMDEV_ORSC: | ||
60 | |||
61 | nd = prom_pathtoinode("rsc"); | ||
62 | if (!nd) { | ||
63 | strcpy(mode, "115200,8,n,1,-"); | ||
64 | goto no_options; | ||
65 | } | ||
66 | 34 | ||
67 | if (!prom_node_has_property(nd, ssp_console_modes_prop)) { | 35 | if (!con || of_console_device != dp) |
68 | strcpy(mode, "115200,8,n,1,-"); | 36 | return 0; |
69 | goto no_options; | ||
70 | } | ||
71 | 37 | ||
72 | memset(mode, 0, sizeof(mode)); | 38 | off = 0; |
73 | prom_getstring(nd, ssp_console_modes_prop, mode, sizeof(mode)); | 39 | if (of_console_options && |
74 | goto no_options; | 40 | *of_console_options == 'b') |
41 | off = 1; | ||
75 | 42 | ||
76 | default: | 43 | if ((line & 1) != off) |
77 | strcpy(mode, "9600,8,n,1,-"); | 44 | return 0; |
78 | goto no_options; | ||
79 | } | ||
80 | 45 | ||
81 | topnd = prom_getchild(prom_root_node); | 46 | con->index = line; |
82 | nd = prom_searchsiblings(topnd, "options"); | 47 | drv->cons = con; |
83 | if (!nd) { | 48 | add_preferred_console(con->name, line, NULL); |
84 | strcpy(mode, "9600,8,n,1,-"); | ||
85 | goto no_options; | ||
86 | } | ||
87 | |||
88 | if (!prom_node_has_property(nd, mode_prop)) { | ||
89 | strcpy(mode, "9600,8,n,1,-"); | ||
90 | goto no_options; | ||
91 | } | ||
92 | 49 | ||
93 | memset(mode, 0, sizeof(mode)); | 50 | return 1; |
94 | prom_getstring(nd, mode_prop, mode, sizeof(mode)); | 51 | } |
95 | 52 | EXPORT_SYMBOL(sunserial_console_match); | |
96 | if (prom_node_has_property(nd, cd_prop)) { | ||
97 | memset(buf, 0, sizeof(buf)); | ||
98 | prom_getstring(nd, cd_prop, buf, sizeof(buf)); | ||
99 | if (!strcmp(buf, "false")) | ||
100 | carrier = 1; | ||
101 | |||
102 | /* XXX: this is unused below. */ | ||
103 | } | ||
104 | 53 | ||
105 | if (prom_node_has_property(nd, dtr_prop)) { | 54 | void |
106 | memset(buf, 0, sizeof(buf)); | 55 | sunserial_console_termios(struct console *con) |
107 | prom_getstring(nd, dtr_prop, buf, sizeof(buf)); | 56 | { |
108 | if (!strcmp(buf, "false")) | 57 | struct device_node *dp; |
109 | rtsdtr = 0; | 58 | const char *od, *mode, *s; |
59 | char mode_prop[] = "ttyX-mode"; | ||
60 | int baud, bits, stop, cflag; | ||
61 | char parity; | ||
110 | 62 | ||
111 | /* XXX: this is unused below. */ | 63 | dp = of_find_node_by_path("/options"); |
64 | od = of_get_property(dp, "output-device", NULL); | ||
65 | if (!strcmp(od, "rsc")) { | ||
66 | mode = of_get_property(of_console_device, | ||
67 | "ssp-console-modes", NULL); | ||
68 | if (!mode) | ||
69 | mode = "115200,8,n,1,-"; | ||
70 | } else { | ||
71 | char c; | ||
72 | |||
73 | c = 'a'; | ||
74 | if (of_console_options) | ||
75 | c = *of_console_options; | ||
76 | |||
77 | mode_prop[3] = c; | ||
78 | |||
79 | mode = of_get_property(dp, mode_prop, NULL); | ||
80 | if (!mode) | ||
81 | mode = "9600,8,n,1,-"; | ||
112 | } | 82 | } |
113 | 83 | ||
114 | no_options: | ||
115 | cflag = CREAD | HUPCL | CLOCAL; | 84 | cflag = CREAD | HUPCL | CLOCAL; |
116 | 85 | ||
117 | s = mode; | 86 | s = mode; |
diff --git a/drivers/serial/suncore.h b/drivers/serial/suncore.h index 513916a8ce37..829d7d65d6db 100644 --- a/drivers/serial/suncore.h +++ b/drivers/serial/suncore.h | |||
@@ -24,6 +24,8 @@ extern int suncore_mouse_baud_detection(unsigned char, int); | |||
24 | 24 | ||
25 | extern int sunserial_current_minor; | 25 | extern int sunserial_current_minor; |
26 | 26 | ||
27 | extern int sunserial_console_match(struct console *, struct device_node *, | ||
28 | struct uart_driver *, int); | ||
27 | extern void sunserial_console_termios(struct console *); | 29 | extern void sunserial_console_termios(struct console *); |
28 | 30 | ||
29 | #endif /* !(_SERIAL_SUN_H) */ | 31 | #endif /* !(_SERIAL_SUN_H) */ |
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c index d82be42ff29a..8ff900b09811 100644 --- a/drivers/serial/sunhv.c +++ b/drivers/serial/sunhv.c | |||
@@ -520,16 +520,6 @@ static struct console sunhv_console = { | |||
520 | .data = &sunhv_reg, | 520 | .data = &sunhv_reg, |
521 | }; | 521 | }; |
522 | 522 | ||
523 | static inline struct console *SUNHV_CONSOLE(void) | ||
524 | { | ||
525 | if (con_is_present()) | ||
526 | return NULL; | ||
527 | |||
528 | sunhv_console.index = 0; | ||
529 | |||
530 | return &sunhv_console; | ||
531 | } | ||
532 | |||
533 | static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) | 523 | static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) |
534 | { | 524 | { |
535 | struct uart_port *port; | 525 | struct uart_port *port; |
@@ -582,7 +572,8 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m | |||
582 | sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; | 572 | sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; |
583 | sunserial_current_minor += 1; | 573 | sunserial_current_minor += 1; |
584 | 574 | ||
585 | sunhv_reg.cons = SUNHV_CONSOLE(); | 575 | sunserial_console_match(&sunhv_console, op->node, |
576 | &sunhv_reg, port->line); | ||
586 | 577 | ||
587 | err = uart_add_one_port(&sunhv_reg, port); | 578 | err = uart_add_one_port(&sunhv_reg, port); |
588 | if (err) | 579 | if (err) |
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 8a0f9e4408d4..bca57bb94939 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c | |||
@@ -968,22 +968,6 @@ static struct console sunsab_console = { | |||
968 | 968 | ||
969 | static inline struct console *SUNSAB_CONSOLE(void) | 969 | static inline struct console *SUNSAB_CONSOLE(void) |
970 | { | 970 | { |
971 | int i; | ||
972 | |||
973 | if (con_is_present()) | ||
974 | return NULL; | ||
975 | |||
976 | for (i = 0; i < num_channels; i++) { | ||
977 | int this_minor = sunsab_reg.minor + i; | ||
978 | |||
979 | if ((this_minor - 64) == (serial_console - 1)) | ||
980 | break; | ||
981 | } | ||
982 | if (i == num_channels) | ||
983 | return NULL; | ||
984 | |||
985 | sunsab_console.index = i; | ||
986 | |||
987 | return &sunsab_console; | 971 | return &sunsab_console; |
988 | } | 972 | } |
989 | #else | 973 | #else |
@@ -1080,7 +1064,12 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * | |||
1080 | return err; | 1064 | return err; |
1081 | } | 1065 | } |
1082 | 1066 | ||
1067 | sunserial_console_match(SUNSAB_CONSOLE(), op->node, | ||
1068 | &sunsab_reg, up[0].port.line); | ||
1083 | uart_add_one_port(&sunsab_reg, &up[0].port); | 1069 | uart_add_one_port(&sunsab_reg, &up[0].port); |
1070 | |||
1071 | sunserial_console_match(SUNSAB_CONSOLE(), op->node, | ||
1072 | &sunsab_reg, up[1].port.line); | ||
1084 | uart_add_one_port(&sunsab_reg, &up[1].port); | 1073 | uart_add_one_port(&sunsab_reg, &up[1].port); |
1085 | 1074 | ||
1086 | dev_set_drvdata(&op->dev, &up[0]); | 1075 | dev_set_drvdata(&op->dev, &up[0]); |
@@ -1164,7 +1153,6 @@ static int __init sunsab_init(void) | |||
1164 | } | 1153 | } |
1165 | 1154 | ||
1166 | sunsab_reg.tty_driver->name_base = sunsab_reg.minor - 64; | 1155 | sunsab_reg.tty_driver->name_base = sunsab_reg.minor - 64; |
1167 | sunsab_reg.cons = SUNSAB_CONSOLE(); | ||
1168 | sunserial_current_minor += num_channels; | 1156 | sunserial_current_minor += num_channels; |
1169 | } | 1157 | } |
1170 | 1158 | ||
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 26d720baf88c..79b13685bdfa 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -1371,28 +1371,12 @@ static struct console sunsu_console = { | |||
1371 | * Register console. | 1371 | * Register console. |
1372 | */ | 1372 | */ |
1373 | 1373 | ||
1374 | static inline struct console *SUNSU_CONSOLE(int num_uart) | 1374 | static inline struct console *SUNSU_CONSOLE(void) |
1375 | { | 1375 | { |
1376 | int i; | ||
1377 | |||
1378 | if (con_is_present()) | ||
1379 | return NULL; | ||
1380 | |||
1381 | for (i = 0; i < num_uart; i++) { | ||
1382 | int this_minor = sunsu_reg.minor + i; | ||
1383 | |||
1384 | if ((this_minor - 64) == (serial_console - 1)) | ||
1385 | break; | ||
1386 | } | ||
1387 | if (i == num_uart) | ||
1388 | return NULL; | ||
1389 | |||
1390 | sunsu_console.index = i; | ||
1391 | |||
1392 | return &sunsu_console; | 1376 | return &sunsu_console; |
1393 | } | 1377 | } |
1394 | #else | 1378 | #else |
1395 | #define SUNSU_CONSOLE(num_uart) (NULL) | 1379 | #define SUNSU_CONSOLE() (NULL) |
1396 | #define sunsu_serial_console_init() do { } while (0) | 1380 | #define sunsu_serial_console_init() do { } while (0) |
1397 | #endif | 1381 | #endif |
1398 | 1382 | ||
@@ -1482,6 +1466,8 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m | |||
1482 | 1466 | ||
1483 | up->port.ops = &sunsu_pops; | 1467 | up->port.ops = &sunsu_pops; |
1484 | 1468 | ||
1469 | sunserial_console_match(SUNSU_CONSOLE(), dp, | ||
1470 | &sunsu_reg, up->port.line); | ||
1485 | err = uart_add_one_port(&sunsu_reg, &up->port); | 1471 | err = uart_add_one_port(&sunsu_reg, &up->port); |
1486 | if (err) | 1472 | if (err) |
1487 | goto out_unmap; | 1473 | goto out_unmap; |
@@ -1572,7 +1558,6 @@ static int __init sunsu_init(void) | |||
1572 | return err; | 1558 | return err; |
1573 | sunsu_reg.tty_driver->name_base = sunsu_reg.minor - 64; | 1559 | sunsu_reg.tty_driver->name_base = sunsu_reg.minor - 64; |
1574 | sunserial_current_minor += num_uart; | 1560 | sunserial_current_minor += num_uart; |
1575 | sunsu_reg.cons = SUNSU_CONSOLE(num_uart); | ||
1576 | } | 1561 | } |
1577 | 1562 | ||
1578 | err = of_register_driver(&su_driver, &of_bus_type); | 1563 | err = of_register_driver(&su_driver, &of_bus_type); |
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 0a3e10a4a35d..1d262c0c613f 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c | |||
@@ -1226,23 +1226,6 @@ static struct console sunzilog_console_ops = { | |||
1226 | 1226 | ||
1227 | static inline struct console *SUNZILOG_CONSOLE(void) | 1227 | static inline struct console *SUNZILOG_CONSOLE(void) |
1228 | { | 1228 | { |
1229 | int i; | ||
1230 | |||
1231 | if (con_is_present()) | ||
1232 | return NULL; | ||
1233 | |||
1234 | for (i = 0; i < NUM_CHANNELS; i++) { | ||
1235 | int this_minor = sunzilog_reg.minor + i; | ||
1236 | |||
1237 | if ((this_minor - 64) == (serial_console - 1)) | ||
1238 | break; | ||
1239 | } | ||
1240 | if (i == NUM_CHANNELS) | ||
1241 | return NULL; | ||
1242 | |||
1243 | sunzilog_console_ops.index = i; | ||
1244 | sunzilog_port_table[i].flags |= SUNZILOG_FLAG_IS_CONS; | ||
1245 | |||
1246 | return &sunzilog_console_ops; | 1229 | return &sunzilog_console_ops; |
1247 | } | 1230 | } |
1248 | 1231 | ||
@@ -1428,12 +1411,18 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m | |||
1428 | sunzilog_init_hw(&up[1]); | 1411 | sunzilog_init_hw(&up[1]); |
1429 | 1412 | ||
1430 | if (!keyboard_mouse) { | 1413 | if (!keyboard_mouse) { |
1414 | if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, | ||
1415 | &sunzilog_reg, up[0].port.line)) | ||
1416 | up->flags |= SUNZILOG_FLAG_IS_CONS; | ||
1431 | err = uart_add_one_port(&sunzilog_reg, &up[0].port); | 1417 | err = uart_add_one_port(&sunzilog_reg, &up[0].port); |
1432 | if (err) { | 1418 | if (err) { |
1433 | of_iounmap(&op->resource[0], | 1419 | of_iounmap(&op->resource[0], |
1434 | rp, sizeof(struct zilog_layout)); | 1420 | rp, sizeof(struct zilog_layout)); |
1435 | return err; | 1421 | return err; |
1436 | } | 1422 | } |
1423 | if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, | ||
1424 | &sunzilog_reg, up[1].port.line)) | ||
1425 | up->flags |= SUNZILOG_FLAG_IS_CONS; | ||
1437 | err = uart_add_one_port(&sunzilog_reg, &up[1].port); | 1426 | err = uart_add_one_port(&sunzilog_reg, &up[1].port); |
1438 | if (err) { | 1427 | if (err) { |
1439 | uart_remove_one_port(&sunzilog_reg, &up[0].port); | 1428 | uart_remove_one_port(&sunzilog_reg, &up[0].port); |
@@ -1531,7 +1520,6 @@ static int __init sunzilog_init(void) | |||
1531 | goto out_free_tables; | 1520 | goto out_free_tables; |
1532 | 1521 | ||
1533 | sunzilog_reg.tty_driver->name_base = sunzilog_reg.minor - 64; | 1522 | sunzilog_reg.tty_driver->name_base = sunzilog_reg.minor - 64; |
1534 | sunzilog_reg.cons = SUNZILOG_CONSOLE(); | ||
1535 | 1523 | ||
1536 | sunserial_current_minor += uart_count; | 1524 | sunserial_current_minor += uart_count; |
1537 | } | 1525 | } |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 0c7bf75732ea..13990697b5c1 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -2913,10 +2913,6 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev, | |||
2913 | int node, len, i, j, ret; | 2913 | int node, len, i, j, ret; |
2914 | u32 mem, chip_id; | 2914 | u32 mem, chip_id; |
2915 | 2915 | ||
2916 | /* Do not attach when we have a serial console. */ | ||
2917 | if (!con_is_present()) | ||
2918 | return -ENXIO; | ||
2919 | |||
2920 | /* | 2916 | /* |
2921 | * Map memory-mapped registers. | 2917 | * Map memory-mapped registers. |
2922 | */ | 2918 | */ |
diff --git a/drivers/video/igafb.c b/drivers/video/igafb.c index eb1a4812ad1d..b87ea21d3d78 100644 --- a/drivers/video/igafb.c +++ b/drivers/video/igafb.c | |||
@@ -379,10 +379,6 @@ int __init igafb_init(void) | |||
379 | if (fb_get_options("igafb", NULL)) | 379 | if (fb_get_options("igafb", NULL)) |
380 | return -ENODEV; | 380 | return -ENODEV; |
381 | 381 | ||
382 | /* Do not attach when we have a serial console. */ | ||
383 | if (!con_is_present()) | ||
384 | return -ENXIO; | ||
385 | |||
386 | pdev = pci_get_device(PCI_VENDOR_ID_INTERG, | 382 | pdev = pci_get_device(PCI_VENDOR_ID_INTERG, |
387 | PCI_DEVICE_ID_INTERG_1682, 0); | 383 | PCI_DEVICE_ID_INTERG_1682, 0); |
388 | if (pdev == NULL) { | 384 | if (pdev == NULL) { |