pci.c (3d5134ee8341bffc4f539049abb9e90d469b448d) pci.c (09b55f76c9e41ed88f445f64f00ed39b48ed137d)
1/*
2 * Support for PCI bridges found on Power Macintoshes.
3 *
4 * Copyright (C) 2003-2005 Benjamin Herrenschmuidt (benh@kernel.crashing.org)
5 * Copyright (C) 1997 Paul Mackerras (paulus@samba.org)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 21 unchanged lines hidden (view full) ---

30#undef DEBUG
31
32#ifdef DEBUG
33#define DBG(x...) printk(x)
34#else
35#define DBG(x...)
36#endif
37
1/*
2 * Support for PCI bridges found on Power Macintoshes.
3 *
4 * Copyright (C) 2003-2005 Benjamin Herrenschmuidt (benh@kernel.crashing.org)
5 * Copyright (C) 1997 Paul Mackerras (paulus@samba.org)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 21 unchanged lines hidden (view full) ---

30#undef DEBUG
31
32#ifdef DEBUG
33#define DBG(x...) printk(x)
34#else
35#define DBG(x...)
36#endif
37
38static int add_bridge(struct device_node *dev);
39
40/* XXX Could be per-controller, but I don't think we risk anything by
41 * assuming we won't have both UniNorth and Bandit */
42static int has_uninorth;
43#ifdef CONFIG_PPC64
44static struct pci_controller *u3_agp;
45static struct pci_controller *u4_pcie;
46static struct pci_controller *u3_ht;
47#else

--- 844 unchanged lines hidden (view full) ---

892}
893#endif /* CONFIG_PPC64 */
894
895/*
896 * We assume that if we have a G3 powermac, we have one bridge called
897 * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise,
898 * if we have one or more bandit or chaos bridges, we don't have a MPC106.
899 */
38/* XXX Could be per-controller, but I don't think we risk anything by
39 * assuming we won't have both UniNorth and Bandit */
40static int has_uninorth;
41#ifdef CONFIG_PPC64
42static struct pci_controller *u3_agp;
43static struct pci_controller *u4_pcie;
44static struct pci_controller *u3_ht;
45#else

--- 844 unchanged lines hidden (view full) ---

890}
891#endif /* CONFIG_PPC64 */
892
893/*
894 * We assume that if we have a G3 powermac, we have one bridge called
895 * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise,
896 * if we have one or more bandit or chaos bridges, we don't have a MPC106.
897 */
900static int __init add_bridge(struct device_node *dev)
898static int __init pmac_add_bridge(struct device_node *dev)
901{
902 int len;
903 struct pci_controller *hose;
904 struct resource rsrc;
905 char *disp_name;
906 const int *bus_range;
907 int primary = 1, has_address = 0;
908

--- 109 unchanged lines hidden (view full) ---

1018 return;
1019 }
1020 for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
1021 if (np->name == NULL)
1022 continue;
1023 if (strcmp(np->name, "bandit") == 0
1024 || strcmp(np->name, "chaos") == 0
1025 || strcmp(np->name, "pci") == 0) {
899{
900 int len;
901 struct pci_controller *hose;
902 struct resource rsrc;
903 char *disp_name;
904 const int *bus_range;
905 int primary = 1, has_address = 0;
906

--- 109 unchanged lines hidden (view full) ---

1016 return;
1017 }
1018 for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
1019 if (np->name == NULL)
1020 continue;
1021 if (strcmp(np->name, "bandit") == 0
1022 || strcmp(np->name, "chaos") == 0
1023 || strcmp(np->name, "pci") == 0) {
1026 if (add_bridge(np) == 0)
1024 if (pmac_add_bridge(np) == 0)
1027 of_node_get(np);
1028 }
1029 if (strcmp(np->name, "ht") == 0) {
1030 of_node_get(np);
1031 ht = np;
1032 }
1033 }
1034 of_node_put(root);
1035
1036#ifdef CONFIG_PPC64
1037 /* Probe HT last as it relies on the agp resources to be already
1038 * setup
1039 */
1025 of_node_get(np);
1026 }
1027 if (strcmp(np->name, "ht") == 0) {
1028 of_node_get(np);
1029 ht = np;
1030 }
1031 }
1032 of_node_put(root);
1033
1034#ifdef CONFIG_PPC64
1035 /* Probe HT last as it relies on the agp resources to be already
1036 * setup
1037 */
1040 if (ht && add_bridge(ht) != 0)
1038 if (ht && pmac_add_bridge(ht) != 0)
1041 of_node_put(ht);
1042
1043 /* Setup the linkage between OF nodes and PHBs */
1044 pci_devs_phb_init();
1045
1046 /* Fixup the PCI<->OF mapping for U3 AGP due to bus renumbering. We
1047 * assume there is no P2P bridge on the AGP bus, which should be a
1048 * safe assumptions for now. We should do something better in the

--- 258 unchanged lines hidden ---
1039 of_node_put(ht);
1040
1041 /* Setup the linkage between OF nodes and PHBs */
1042 pci_devs_phb_init();
1043
1044 /* Fixup the PCI<->OF mapping for U3 AGP due to bus renumbering. We
1045 * assume there is no P2P bridge on the AGP bus, which should be a
1046 * safe assumptions for now. We should do something better in the

--- 258 unchanged lines hidden ---