feature.c (48a7afe314bfc4d7f50e1608632f503dbba7e013) | feature.c (55b61fec22caa3e7872caea6c4100fc75cb8f49b) |
---|---|
1/* 2 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au) 3 * Ben. Herrenschmidt (benh@kernel.crashing.org) 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 8 * 2 of the License, or (at your option) any later version. --- 1404 unchanged lines hidden (view full) --- 1413 1414 /* 1415 * We must not reset the combo PHYs, only the BCM5221 found in 1416 * the iMac G5. 1417 */ 1418 phy = of_get_next_child(node, NULL); 1419 if (!phy) 1420 return -ENODEV; | 1/* 2 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au) 3 * Ben. Herrenschmidt (benh@kernel.crashing.org) 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 8 * 2 of the License, or (at your option) any later version. --- 1404 unchanged lines hidden (view full) --- 1413 1414 /* 1415 * We must not reset the combo PHYs, only the BCM5221 found in 1416 * the iMac G5. 1417 */ 1418 phy = of_get_next_child(node, NULL); 1419 if (!phy) 1420 return -ENODEV; |
1421 need_reset = device_is_compatible(phy, "B5221"); | 1421 need_reset = of_device_is_compatible(phy, "B5221"); |
1422 of_node_put(phy); 1423 if (!need_reset) 1424 return 0; 1425 1426 /* PHY reset is GPIO 29, not in device-tree unfortunately */ 1427 MACIO_OUT8(K2_GPIO_EXTINT_0 + 29, 1428 KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA); 1429 /* Thankfully, this is now always called at a time when we can --- 1189 unchanged lines hidden (view full) --- 2619 volatile u32 __iomem *base; 2620 const u32 *addrp, *revp; 2621 phys_addr_t addr; 2622 u64 size; 2623 2624 for (node = NULL; (node = of_find_node_by_name(node, name)) != NULL;) { 2625 if (!compat) 2626 break; | 1422 of_node_put(phy); 1423 if (!need_reset) 1424 return 0; 1425 1426 /* PHY reset is GPIO 29, not in device-tree unfortunately */ 1427 MACIO_OUT8(K2_GPIO_EXTINT_0 + 29, 1428 KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA); 1429 /* Thankfully, this is now always called at a time when we can --- 1189 unchanged lines hidden (view full) --- 2619 volatile u32 __iomem *base; 2620 const u32 *addrp, *revp; 2621 phys_addr_t addr; 2622 u64 size; 2623 2624 for (node = NULL; (node = of_find_node_by_name(node, name)) != NULL;) { 2625 if (!compat) 2626 break; |
2627 if (device_is_compatible(node, compat)) | 2627 if (of_device_is_compatible(node, compat)) |
2628 break; 2629 } 2630 if (!node) 2631 return; 2632 for(i=0; i<MAX_MACIO_CHIPS; i++) { 2633 if (!macio_chips[i].of_node) 2634 break; 2635 if (macio_chips[i].of_node == node) --- 87 unchanged lines hidden (view full) --- 2723 const char *conn; 2724 int port_type = PMAC_SCC_ASYNC; 2725 int modem = 0; 2726 2727 slots = of_get_property(np, "slot-names", &len); 2728 conn = of_get_property(np, "AAPL,connector", &len); 2729 if (conn && (strcmp(conn, "infrared") == 0)) 2730 port_type = PMAC_SCC_IRDA; | 2628 break; 2629 } 2630 if (!node) 2631 return; 2632 for(i=0; i<MAX_MACIO_CHIPS; i++) { 2633 if (!macio_chips[i].of_node) 2634 break; 2635 if (macio_chips[i].of_node == node) --- 87 unchanged lines hidden (view full) --- 2723 const char *conn; 2724 int port_type = PMAC_SCC_ASYNC; 2725 int modem = 0; 2726 2727 slots = of_get_property(np, "slot-names", &len); 2728 conn = of_get_property(np, "AAPL,connector", &len); 2729 if (conn && (strcmp(conn, "infrared") == 0)) 2730 port_type = PMAC_SCC_IRDA; |
2731 else if (device_is_compatible(np, "cobalt")) | 2731 else if (of_device_is_compatible(np, "cobalt")) |
2732 modem = 1; 2733 else if (slots && slots->count > 0) { 2734 if (strcmp(slots->name, "IrDA") == 0) 2735 port_type = PMAC_SCC_IRDA; 2736 else if (strcmp(slots->name, "Modem") == 0) 2737 modem = 1; 2738 } 2739 if (modem) --- 42 unchanged lines hidden (view full) --- 2782 of_node_put(np); 2783 } 2784#endif /* CONFIG_SMP */ 2785 /* Enable GMAC for now for PCI probing. It will be disabled 2786 * later on after PCI probe 2787 */ 2788 np = of_find_node_by_name(NULL, "ethernet"); 2789 while(np) { | 2732 modem = 1; 2733 else if (slots && slots->count > 0) { 2734 if (strcmp(slots->name, "IrDA") == 0) 2735 port_type = PMAC_SCC_IRDA; 2736 else if (strcmp(slots->name, "Modem") == 0) 2737 modem = 1; 2738 } 2739 if (modem) --- 42 unchanged lines hidden (view full) --- 2782 of_node_put(np); 2783 } 2784#endif /* CONFIG_SMP */ 2785 /* Enable GMAC for now for PCI probing. It will be disabled 2786 * later on after PCI probe 2787 */ 2788 np = of_find_node_by_name(NULL, "ethernet"); 2789 while(np) { |
2790 if (device_is_compatible(np, "K2-GMAC")) | 2790 if (of_device_is_compatible(np, "K2-GMAC")) |
2791 g5_gmac_enable(np, 0, 1); 2792 np = of_find_node_by_name(np, "ethernet"); 2793 } 2794 2795 /* Enable FW before PCI probe. Will be disabled later on 2796 * Note: We should have a batter way to check that we are 2797 * dealing with uninorth internal cell and not a PCI cell 2798 * on the external PCI. The code below works though. 2799 */ 2800 np = of_find_node_by_name(NULL, "firewire"); 2801 while(np) { | 2791 g5_gmac_enable(np, 0, 1); 2792 np = of_find_node_by_name(np, "ethernet"); 2793 } 2794 2795 /* Enable FW before PCI probe. Will be disabled later on 2796 * Note: We should have a batter way to check that we are 2797 * dealing with uninorth internal cell and not a PCI cell 2798 * on the external PCI. The code below works though. 2799 */ 2800 np = of_find_node_by_name(NULL, "firewire"); 2801 while(np) { |
2802 if (device_is_compatible(np, "pci106b,5811")) { | 2802 if (of_device_is_compatible(np, "pci106b,5811")) { |
2803 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2804 g5_fw_enable(np, 0, 1); 2805 } 2806 np = of_find_node_by_name(np, "firewire"); 2807 } 2808 } 2809#else /* CONFIG_POWER4 */ 2810 2811 if (macio_chips[0].type == macio_keylargo || 2812 macio_chips[0].type == macio_pangea || 2813 macio_chips[0].type == macio_intrepid) { 2814 /* Enable GMAC for now for PCI probing. It will be disabled 2815 * later on after PCI probe 2816 */ 2817 np = of_find_node_by_name(NULL, "ethernet"); 2818 while(np) { 2819 if (np->parent | 2803 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2804 g5_fw_enable(np, 0, 1); 2805 } 2806 np = of_find_node_by_name(np, "firewire"); 2807 } 2808 } 2809#else /* CONFIG_POWER4 */ 2810 2811 if (macio_chips[0].type == macio_keylargo || 2812 macio_chips[0].type == macio_pangea || 2813 macio_chips[0].type == macio_intrepid) { 2814 /* Enable GMAC for now for PCI probing. It will be disabled 2815 * later on after PCI probe 2816 */ 2817 np = of_find_node_by_name(NULL, "ethernet"); 2818 while(np) { 2819 if (np->parent |
2820 && device_is_compatible(np->parent, "uni-north") 2821 && device_is_compatible(np, "gmac")) | 2820 && of_device_is_compatible(np->parent, "uni-north") 2821 && of_device_is_compatible(np, "gmac")) |
2822 core99_gmac_enable(np, 0, 1); 2823 np = of_find_node_by_name(np, "ethernet"); 2824 } 2825 2826 /* Enable FW before PCI probe. Will be disabled later on 2827 * Note: We should have a batter way to check that we are 2828 * dealing with uninorth internal cell and not a PCI cell 2829 * on the external PCI. The code below works though. 2830 */ 2831 np = of_find_node_by_name(NULL, "firewire"); 2832 while(np) { 2833 if (np->parent | 2822 core99_gmac_enable(np, 0, 1); 2823 np = of_find_node_by_name(np, "ethernet"); 2824 } 2825 2826 /* Enable FW before PCI probe. Will be disabled later on 2827 * Note: We should have a batter way to check that we are 2828 * dealing with uninorth internal cell and not a PCI cell 2829 * on the external PCI. The code below works though. 2830 */ 2831 np = of_find_node_by_name(NULL, "firewire"); 2832 while(np) { 2833 if (np->parent |
2834 && device_is_compatible(np->parent, "uni-north") 2835 && (device_is_compatible(np, "pci106b,18") || 2836 device_is_compatible(np, "pci106b,30") || 2837 device_is_compatible(np, "pci11c1,5811"))) { | 2834 && of_device_is_compatible(np->parent, "uni-north") 2835 && (of_device_is_compatible(np, "pci106b,18") || 2836 of_device_is_compatible(np, "pci106b,30") || 2837 of_device_is_compatible(np, "pci11c1,5811"))) { |
2838 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2839 core99_firewire_enable(np, 0, 1); 2840 } 2841 np = of_find_node_by_name(np, "firewire"); 2842 } 2843 2844 /* Enable ATA-100 before PCI probe. */ 2845 np = of_find_node_by_name(NULL, "ata-6"); 2846 while(np) { 2847 if (np->parent | 2838 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2839 core99_firewire_enable(np, 0, 1); 2840 } 2841 np = of_find_node_by_name(np, "firewire"); 2842 } 2843 2844 /* Enable ATA-100 before PCI probe. */ 2845 np = of_find_node_by_name(NULL, "ata-6"); 2846 while(np) { 2847 if (np->parent |
2848 && device_is_compatible(np->parent, "uni-north") 2849 && device_is_compatible(np, "kauai-ata")) { | 2848 && of_device_is_compatible(np->parent, "uni-north") 2849 && of_device_is_compatible(np, "kauai-ata")) { |
2850 core99_ata100_enable(np, 1); 2851 } 2852 np = of_find_node_by_name(np, "ata-6"); 2853 } 2854 2855 /* Switch airport off */ 2856 for_each_node_by_name(np, "radio") { 2857 if (np && np->parent == macio_chips[0].of_node) { --- 172 unchanged lines hidden --- | 2850 core99_ata100_enable(np, 1); 2851 } 2852 np = of_find_node_by_name(np, "ata-6"); 2853 } 2854 2855 /* Switch airport off */ 2856 for_each_node_by_name(np, "radio") { 2857 if (np && np->parent == macio_chips[0].of_node) { --- 172 unchanged lines hidden --- |