feature.c (ccdb8ed3b3c739fe99a6f2f474f7ffad3203485d) | feature.c (804ece07e957298fa15695677c92631744d620af) |
---|---|
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. --- 144 unchanged lines hidden (view full) --- 153 else 154 MACIO_BIC(reg, mask); 155 (void)MACIO_IN32(reg); 156 UNLOCK(flags); 157 158 return 0; 159} 160 | 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. --- 144 unchanged lines hidden (view full) --- 153 else 154 MACIO_BIC(reg, mask); 155 (void)MACIO_IN32(reg); 156 UNLOCK(flags); 157 158 return 0; 159} 160 |
161#ifndef CONFIG_POWER4 | 161#ifndef CONFIG_PPC64 |
162 163static long ohare_htw_scc_enable(struct device_node *node, long param, 164 long value) 165{ 166 struct macio_chip* macio; 167 unsigned long chan_mask; 168 unsigned long fcr; 169 unsigned long flags; --- 1143 unchanged lines hidden (view full) --- 1313 else 1314 UN_BIC(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE); 1315 UNLOCK(flags); 1316 1317 return 0; 1318} 1319 1320 | 162 163static long ohare_htw_scc_enable(struct device_node *node, long param, 164 long value) 165{ 166 struct macio_chip* macio; 167 unsigned long chan_mask; 168 unsigned long fcr; 169 unsigned long flags; --- 1143 unchanged lines hidden (view full) --- 1313 else 1314 UN_BIC(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE); 1315 UNLOCK(flags); 1316 1317 return 0; 1318} 1319 1320 |
1321#endif /* CONFIG_POWER4 */ | 1321#endif /* CONFIG_PPC64 */ |
1322 1323static long 1324core99_read_gpio(struct device_node *node, long param, long value) 1325{ 1326 struct macio_chip *macio = &macio_chips[0]; 1327 1328 return MACIO_IN8(param); 1329} 1330 1331 1332static long 1333core99_write_gpio(struct device_node *node, long param, long value) 1334{ 1335 struct macio_chip *macio = &macio_chips[0]; 1336 1337 MACIO_OUT8(param, (u8)(value & 0xff)); 1338 return 0; 1339} 1340 | 1322 1323static long 1324core99_read_gpio(struct device_node *node, long param, long value) 1325{ 1326 struct macio_chip *macio = &macio_chips[0]; 1327 1328 return MACIO_IN8(param); 1329} 1330 1331 1332static long 1333core99_write_gpio(struct device_node *node, long param, long value) 1334{ 1335 struct macio_chip *macio = &macio_chips[0]; 1336 1337 MACIO_OUT8(param, (u8)(value & 0xff)); 1338 return 0; 1339} 1340 |
1341#ifdef CONFIG_POWER4 | 1341#ifdef CONFIG_PPC64 |
1342static long g5_gmac_enable(struct device_node *node, long param, long value) 1343{ 1344 struct macio_chip *macio = &macio_chips[0]; 1345 unsigned long flags; 1346 1347 if (node == NULL) 1348 return -ENODEV; 1349 --- 195 unchanged lines hidden (view full) --- 1545 * This takes the second CPU off the bus on dual CPU machines 1546 * running UP 1547 */ 1548void g5_phy_disable_cpu1(void) 1549{ 1550 if (uninorth_maj == 3) 1551 UN_OUT(U3_API_PHY_CONFIG_1, 0); 1552} | 1342static long g5_gmac_enable(struct device_node *node, long param, long value) 1343{ 1344 struct macio_chip *macio = &macio_chips[0]; 1345 unsigned long flags; 1346 1347 if (node == NULL) 1348 return -ENODEV; 1349 --- 195 unchanged lines hidden (view full) --- 1545 * This takes the second CPU off the bus on dual CPU machines 1546 * running UP 1547 */ 1548void g5_phy_disable_cpu1(void) 1549{ 1550 if (uninorth_maj == 3) 1551 UN_OUT(U3_API_PHY_CONFIG_1, 0); 1552} |
1553#endif /* CONFIG_POWER4 */ | 1553#endif /* CONFIG_PPC64 */ |
1554 | 1554 |
1555#ifndef CONFIG_POWER4 | 1555#ifndef CONFIG_PPC64 |
1556 1557 1558#ifdef CONFIG_PM 1559static u32 save_gpio_levels[2]; 1560static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT]; 1561static u8 save_gpio_normal[KEYLARGO_GPIO_CNT]; 1562static u32 save_unin_clock_ctl; 1563 --- 295 unchanged lines hidden (view full) --- 1859 return core99_sleep(); 1860 else if (value == 0) 1861 return core99_wake_up(); 1862 1863#endif /* CONFIG_PM */ 1864 return 0; 1865} 1866 | 1556 1557 1558#ifdef CONFIG_PM 1559static u32 save_gpio_levels[2]; 1560static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT]; 1561static u8 save_gpio_normal[KEYLARGO_GPIO_CNT]; 1562static u32 save_unin_clock_ctl; 1563 --- 295 unchanged lines hidden (view full) --- 1859 return core99_sleep(); 1860 else if (value == 0) 1861 return core99_wake_up(); 1862 1863#endif /* CONFIG_PM */ 1864 return 0; 1865} 1866 |
1867#endif /* CONFIG_POWER4 */ | 1867#endif /* CONFIG_PPC64 */ |
1868 1869static long 1870generic_dev_can_wake(struct device_node *node, long param, long value) 1871{ 1872 /* Todo: eventually check we are really dealing with on-board 1873 * video device ... 1874 */ 1875 --- 25 unchanged lines hidden (view full) --- 1901/* Used on any machine 1902 */ 1903static struct feature_table_entry any_features[] = { 1904 { PMAC_FTR_GET_MB_INFO, generic_get_mb_info }, 1905 { PMAC_FTR_DEVICE_CAN_WAKE, generic_dev_can_wake }, 1906 { 0, NULL } 1907}; 1908 | 1868 1869static long 1870generic_dev_can_wake(struct device_node *node, long param, long value) 1871{ 1872 /* Todo: eventually check we are really dealing with on-board 1873 * video device ... 1874 */ 1875 --- 25 unchanged lines hidden (view full) --- 1901/* Used on any machine 1902 */ 1903static struct feature_table_entry any_features[] = { 1904 { PMAC_FTR_GET_MB_INFO, generic_get_mb_info }, 1905 { PMAC_FTR_DEVICE_CAN_WAKE, generic_dev_can_wake }, 1906 { 0, NULL } 1907}; 1908 |
1909#ifndef CONFIG_POWER4 | 1909#ifndef CONFIG_PPC64 |
1910 1911/* OHare based motherboards. Currently, we only use these on the 1912 * 2400,3400 and 3500 series powerbooks. Some older desktops seem 1913 * to have issues with turning on/off those asic cells 1914 */ 1915static struct feature_table_entry ohare_features[] = { 1916 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable }, 1917 { PMAC_FTR_SWIM3_ENABLE, ohare_floppy_enable }, --- 133 unchanged lines hidden (view full) --- 2051 { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power }, 2052 { PMAC_FTR_SLEEP_STATE, core99_sleep_state }, 2053 { PMAC_FTR_READ_GPIO, core99_read_gpio }, 2054 { PMAC_FTR_WRITE_GPIO, core99_write_gpio }, 2055 { PMAC_FTR_AACK_DELAY_ENABLE, intrepid_aack_delay_enable }, 2056 { 0, NULL } 2057}; 2058 | 1910 1911/* OHare based motherboards. Currently, we only use these on the 1912 * 2400,3400 and 3500 series powerbooks. Some older desktops seem 1913 * to have issues with turning on/off those asic cells 1914 */ 1915static struct feature_table_entry ohare_features[] = { 1916 { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable }, 1917 { PMAC_FTR_SWIM3_ENABLE, ohare_floppy_enable }, --- 133 unchanged lines hidden (view full) --- 2051 { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power }, 2052 { PMAC_FTR_SLEEP_STATE, core99_sleep_state }, 2053 { PMAC_FTR_READ_GPIO, core99_read_gpio }, 2054 { PMAC_FTR_WRITE_GPIO, core99_write_gpio }, 2055 { PMAC_FTR_AACK_DELAY_ENABLE, intrepid_aack_delay_enable }, 2056 { 0, NULL } 2057}; 2058 |
2059#else /* CONFIG_POWER4 */ | 2059#else /* CONFIG_PPC64 */ |
2060 2061/* G5 features 2062 */ 2063static struct feature_table_entry g5_features[] = { 2064 { PMAC_FTR_GMAC_ENABLE, g5_gmac_enable }, 2065 { PMAC_FTR_1394_ENABLE, g5_fw_enable }, 2066 { PMAC_FTR_ENABLE_MPIC, g5_mpic_enable }, 2067 { PMAC_FTR_GMAC_PHY_RESET, g5_eth_phy_reset }, 2068 { PMAC_FTR_SOUND_CHIP_ENABLE, g5_i2s_enable }, 2069#ifdef CONFIG_SMP 2070 { PMAC_FTR_RESET_CPU, g5_reset_cpu }, 2071#endif /* CONFIG_SMP */ 2072 { PMAC_FTR_READ_GPIO, core99_read_gpio }, 2073 { PMAC_FTR_WRITE_GPIO, core99_write_gpio }, 2074 { 0, NULL } 2075}; 2076 | 2060 2061/* G5 features 2062 */ 2063static struct feature_table_entry g5_features[] = { 2064 { PMAC_FTR_GMAC_ENABLE, g5_gmac_enable }, 2065 { PMAC_FTR_1394_ENABLE, g5_fw_enable }, 2066 { PMAC_FTR_ENABLE_MPIC, g5_mpic_enable }, 2067 { PMAC_FTR_GMAC_PHY_RESET, g5_eth_phy_reset }, 2068 { PMAC_FTR_SOUND_CHIP_ENABLE, g5_i2s_enable }, 2069#ifdef CONFIG_SMP 2070 { PMAC_FTR_RESET_CPU, g5_reset_cpu }, 2071#endif /* CONFIG_SMP */ 2072 { PMAC_FTR_READ_GPIO, core99_read_gpio }, 2073 { PMAC_FTR_WRITE_GPIO, core99_write_gpio }, 2074 { 0, NULL } 2075}; 2076 |
2077#endif /* CONFIG_POWER4 */ | 2077#endif /* CONFIG_PPC64 */ |
2078 2079static struct pmac_mb_def pmac_mb_defs[] = { | 2078 2079static struct pmac_mb_def pmac_mb_defs[] = { |
2080#ifndef CONFIG_POWER4 | 2080#ifndef CONFIG_PPC64 |
2081 /* 2082 * Desktops 2083 */ 2084 2085 { "AAPL,8500", "PowerMac 8500/8600", 2086 PMAC_TYPE_PSURGE, NULL, 2087 0 2088 }, --- 248 unchanged lines hidden (view full) --- 2337 { "PowerBook6,7", "iBook G4", 2338 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, 2339 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, 2340 }, 2341 { "PowerBook6,8", "PowerBook G4 12\"", 2342 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, 2343 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, 2344 }, | 2081 /* 2082 * Desktops 2083 */ 2084 2085 { "AAPL,8500", "PowerMac 8500/8600", 2086 PMAC_TYPE_PSURGE, NULL, 2087 0 2088 }, --- 248 unchanged lines hidden (view full) --- 2337 { "PowerBook6,7", "iBook G4", 2338 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, 2339 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, 2340 }, 2341 { "PowerBook6,8", "PowerBook G4 12\"", 2342 PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, 2343 PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, 2344 }, |
2345#else /* CONFIG_POWER4 */ | 2345#else /* CONFIG_PPC64 */ |
2346 { "PowerMac7,2", "PowerMac G5", 2347 PMAC_TYPE_POWERMAC_G5, g5_features, 2348 0, 2349 }, 2350#ifdef CONFIG_PPC64 2351 { "PowerMac7,3", "PowerMac G5", 2352 PMAC_TYPE_POWERMAC_G5, g5_features, 2353 0, --- 14 unchanged lines hidden (view full) --- 2368 PMAC_TYPE_POWERMAC_G5_U3L, g5_features, 2369 0, 2370 }, 2371 { "RackMac3,1", "XServe G5", 2372 PMAC_TYPE_XSERVE_G5, g5_features, 2373 0, 2374 }, 2375#endif /* CONFIG_PPC64 */ | 2346 { "PowerMac7,2", "PowerMac G5", 2347 PMAC_TYPE_POWERMAC_G5, g5_features, 2348 0, 2349 }, 2350#ifdef CONFIG_PPC64 2351 { "PowerMac7,3", "PowerMac G5", 2352 PMAC_TYPE_POWERMAC_G5, g5_features, 2353 0, --- 14 unchanged lines hidden (view full) --- 2368 PMAC_TYPE_POWERMAC_G5_U3L, g5_features, 2369 0, 2370 }, 2371 { "RackMac3,1", "XServe G5", 2372 PMAC_TYPE_XSERVE_G5, g5_features, 2373 0, 2374 }, 2375#endif /* CONFIG_PPC64 */ |
2376#endif /* CONFIG_POWER4 */ | 2376#endif /* CONFIG_PPC64 */ |
2377}; 2378 2379/* 2380 * The toplevel feature_call callback 2381 */ 2382long pmac_do_feature_call(unsigned int selector, ...) 2383{ 2384 struct device_node *node; --- 51 unchanged lines hidden (view full) --- 2436 if (of_machine_is_compatible(pmac_mb_defs[i].model_string)) { 2437 pmac_mb = pmac_mb_defs[i]; 2438 goto found; 2439 } 2440 } 2441 2442 /* Fallback to selection depending on mac-io chip type */ 2443 switch(macio->type) { | 2377}; 2378 2379/* 2380 * The toplevel feature_call callback 2381 */ 2382long pmac_do_feature_call(unsigned int selector, ...) 2383{ 2384 struct device_node *node; --- 51 unchanged lines hidden (view full) --- 2436 if (of_machine_is_compatible(pmac_mb_defs[i].model_string)) { 2437 pmac_mb = pmac_mb_defs[i]; 2438 goto found; 2439 } 2440 } 2441 2442 /* Fallback to selection depending on mac-io chip type */ 2443 switch(macio->type) { |
2444#ifndef CONFIG_POWER4 | 2444#ifndef CONFIG_PPC64 |
2445 case macio_grand_central: 2446 pmac_mb.model_id = PMAC_TYPE_PSURGE; 2447 pmac_mb.model_name = "Unknown PowerSurge"; 2448 break; 2449 case macio_ohare: 2450 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_OHARE; 2451 pmac_mb.model_name = "Unknown OHare-based"; 2452 break; --- 17 unchanged lines hidden (view full) --- 2470 pmac_mb.model_name = "Unknown Pangea-based"; 2471 pmac_mb.features = pangea_features; 2472 break; 2473 case macio_intrepid: 2474 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_INTREPID; 2475 pmac_mb.model_name = "Unknown Intrepid-based"; 2476 pmac_mb.features = intrepid_features; 2477 break; | 2445 case macio_grand_central: 2446 pmac_mb.model_id = PMAC_TYPE_PSURGE; 2447 pmac_mb.model_name = "Unknown PowerSurge"; 2448 break; 2449 case macio_ohare: 2450 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_OHARE; 2451 pmac_mb.model_name = "Unknown OHare-based"; 2452 break; --- 17 unchanged lines hidden (view full) --- 2470 pmac_mb.model_name = "Unknown Pangea-based"; 2471 pmac_mb.features = pangea_features; 2472 break; 2473 case macio_intrepid: 2474 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_INTREPID; 2475 pmac_mb.model_name = "Unknown Intrepid-based"; 2476 pmac_mb.features = intrepid_features; 2477 break; |
2478#else /* CONFIG_POWER4 */ | 2478#else /* CONFIG_PPC64 */ |
2479 case macio_keylargo2: 2480 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_K2; 2481 pmac_mb.model_name = "Unknown K2-based"; 2482 pmac_mb.features = g5_features; 2483 break; 2484 case macio_shasta: 2485 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_SHASTA; 2486 pmac_mb.model_name = "Unknown Shasta-based"; 2487 pmac_mb.features = g5_features; 2488 break; | 2479 case macio_keylargo2: 2480 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_K2; 2481 pmac_mb.model_name = "Unknown K2-based"; 2482 pmac_mb.features = g5_features; 2483 break; 2484 case macio_shasta: 2485 pmac_mb.model_id = PMAC_TYPE_UNKNOWN_SHASTA; 2486 pmac_mb.model_name = "Unknown Shasta-based"; 2487 pmac_mb.features = g5_features; 2488 break; |
2489#endif /* CONFIG_POWER4 */ | 2489#endif /* CONFIG_PPC64 */ |
2490 default: 2491 ret = -ENODEV; 2492 goto done; 2493 } 2494found: | 2490 default: 2491 ret = -ENODEV; 2492 goto done; 2493 } 2494found: |
2495#ifndef CONFIG_POWER4 | 2495#ifndef CONFIG_PPC64 |
2496 /* Fixup Hooper vs. Comet */ 2497 if (pmac_mb.model_id == PMAC_TYPE_HOOPER) { 2498 u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4); 2499 if (!mach_id_ptr) { 2500 ret = -ENODEV; 2501 goto done; 2502 } 2503 /* Here, I used to disable the media-bay on comet. It --- 37 unchanged lines hidden (view full) --- 2541 break; 2542 } 2543 2544 /* On CPUs that support it (750FX), lowspeed by default during 2545 * NAP mode 2546 */ 2547 powersave_lowspeed = 1; 2548 | 2496 /* Fixup Hooper vs. Comet */ 2497 if (pmac_mb.model_id == PMAC_TYPE_HOOPER) { 2498 u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4); 2499 if (!mach_id_ptr) { 2500 ret = -ENODEV; 2501 goto done; 2502 } 2503 /* Here, I used to disable the media-bay on comet. It --- 37 unchanged lines hidden (view full) --- 2541 break; 2542 } 2543 2544 /* On CPUs that support it (750FX), lowspeed by default during 2545 * NAP mode 2546 */ 2547 powersave_lowspeed = 1; 2548 |
2549#else /* CONFIG_POWER4 */ | 2549#else /* CONFIG_PPC64 */ |
2550 powersave_nap = 1; | 2550 powersave_nap = 1; |
2551#endif /* CONFIG_POWER4 */ | 2551#endif /* CONFIG_PPC64 */ |
2552 2553 /* Check for "mobile" machine */ 2554 if (model && (strncmp(model, "PowerBook", 9) == 0 2555 || strncmp(model, "iBook", 5) == 0)) 2556 pmac_mb.board_flags |= PMAC_MB_MOBILE; 2557 2558 2559 printk(KERN_INFO "PowerMac motherboard: %s\n", pmac_mb.model_name); --- 221 unchanged lines hidden (view full) --- 2781 else 2782 MACIO_OUT32(OHARE_FCR, STARMAX_FEATURES); 2783 of_node_put(np); 2784 } else if (macio_chips[1].type == macio_ohare) { 2785 struct macio_chip *macio = &macio_chips[1]; 2786 MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE); 2787 } 2788 | 2552 2553 /* Check for "mobile" machine */ 2554 if (model && (strncmp(model, "PowerBook", 9) == 0 2555 || strncmp(model, "iBook", 5) == 0)) 2556 pmac_mb.board_flags |= PMAC_MB_MOBILE; 2557 2558 2559 printk(KERN_INFO "PowerMac motherboard: %s\n", pmac_mb.model_name); --- 221 unchanged lines hidden (view full) --- 2781 else 2782 MACIO_OUT32(OHARE_FCR, STARMAX_FEATURES); 2783 of_node_put(np); 2784 } else if (macio_chips[1].type == macio_ohare) { 2785 struct macio_chip *macio = &macio_chips[1]; 2786 MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE); 2787 } 2788 |
2789#ifdef CONFIG_POWER4 | 2789#ifdef CONFIG_PPC64 |
2790 if (macio_chips[0].type == macio_keylargo2 || 2791 macio_chips[0].type == macio_shasta) { 2792#ifndef CONFIG_SMP 2793 /* On SMP machines running UP, we have the second CPU eating 2794 * bus cycles. We need to take it off the bus. This is done 2795 * from pmac_smp for SMP kernels running on one CPU 2796 */ 2797 np = of_find_node_by_type(NULL, "cpu"); 2798 if (np != NULL) 2799 np = of_find_node_by_type(np, "cpu"); 2800 if (np != NULL) { 2801 g5_phy_disable_cpu1(); 2802 of_node_put(np); 2803 } 2804#endif /* CONFIG_SMP */ 2805 /* Enable GMAC for now for PCI probing. It will be disabled 2806 * later on after PCI probe 2807 */ | 2790 if (macio_chips[0].type == macio_keylargo2 || 2791 macio_chips[0].type == macio_shasta) { 2792#ifndef CONFIG_SMP 2793 /* On SMP machines running UP, we have the second CPU eating 2794 * bus cycles. We need to take it off the bus. This is done 2795 * from pmac_smp for SMP kernels running on one CPU 2796 */ 2797 np = of_find_node_by_type(NULL, "cpu"); 2798 if (np != NULL) 2799 np = of_find_node_by_type(np, "cpu"); 2800 if (np != NULL) { 2801 g5_phy_disable_cpu1(); 2802 of_node_put(np); 2803 } 2804#endif /* CONFIG_SMP */ 2805 /* Enable GMAC for now for PCI probing. It will be disabled 2806 * later on after PCI probe 2807 */ |
2808 for_each_node_by_name(np, "ethernet") | 2808 np = of_find_node_by_name(NULL, "ethernet"); 2809 while(np) { |
2809 if (of_device_is_compatible(np, "K2-GMAC")) 2810 g5_gmac_enable(np, 0, 1); | 2810 if (of_device_is_compatible(np, "K2-GMAC")) 2811 g5_gmac_enable(np, 0, 1); |
2812 np = of_find_node_by_name(np, "ethernet"); 2813 } |
|
2811 2812 /* Enable FW before PCI probe. Will be disabled later on 2813 * Note: We should have a batter way to check that we are 2814 * dealing with uninorth internal cell and not a PCI cell 2815 * on the external PCI. The code below works though. 2816 */ | 2814 2815 /* Enable FW before PCI probe. Will be disabled later on 2816 * Note: We should have a batter way to check that we are 2817 * dealing with uninorth internal cell and not a PCI cell 2818 * on the external PCI. The code below works though. 2819 */ |
2817 for_each_node_by_name(np, "firewire") { | 2820 np = of_find_node_by_name(NULL, "firewire"); 2821 while(np) { |
2818 if (of_device_is_compatible(np, "pci106b,5811")) { 2819 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2820 g5_fw_enable(np, 0, 1); 2821 } | 2822 if (of_device_is_compatible(np, "pci106b,5811")) { 2823 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2824 g5_fw_enable(np, 0, 1); 2825 } |
2826 np = of_find_node_by_name(np, "firewire"); |
|
2822 } 2823 } | 2827 } 2828 } |
2824#else /* CONFIG_POWER4 */ | 2829#else /* CONFIG_PPC64 */ |
2825 2826 if (macio_chips[0].type == macio_keylargo || 2827 macio_chips[0].type == macio_pangea || 2828 macio_chips[0].type == macio_intrepid) { 2829 /* Enable GMAC for now for PCI probing. It will be disabled 2830 * later on after PCI probe 2831 */ | 2830 2831 if (macio_chips[0].type == macio_keylargo || 2832 macio_chips[0].type == macio_pangea || 2833 macio_chips[0].type == macio_intrepid) { 2834 /* Enable GMAC for now for PCI probing. It will be disabled 2835 * later on after PCI probe 2836 */ |
2832 for_each_node_by_name(np, "ethernet") { | 2837 np = of_find_node_by_name(NULL, "ethernet"); 2838 while(np) { |
2833 if (np->parent 2834 && of_device_is_compatible(np->parent, "uni-north") 2835 && of_device_is_compatible(np, "gmac")) 2836 core99_gmac_enable(np, 0, 1); | 2839 if (np->parent 2840 && of_device_is_compatible(np->parent, "uni-north") 2841 && of_device_is_compatible(np, "gmac")) 2842 core99_gmac_enable(np, 0, 1); |
2843 np = of_find_node_by_name(np, "ethernet"); |
|
2837 } 2838 2839 /* Enable FW before PCI probe. Will be disabled later on 2840 * Note: We should have a batter way to check that we are 2841 * dealing with uninorth internal cell and not a PCI cell 2842 * on the external PCI. The code below works though. 2843 */ | 2844 } 2845 2846 /* Enable FW before PCI probe. Will be disabled later on 2847 * Note: We should have a batter way to check that we are 2848 * dealing with uninorth internal cell and not a PCI cell 2849 * on the external PCI. The code below works though. 2850 */ |
2844 for_each_node_by_name(np, "firewire") { | 2851 np = of_find_node_by_name(NULL, "firewire"); 2852 while(np) { |
2845 if (np->parent 2846 && of_device_is_compatible(np->parent, "uni-north") 2847 && (of_device_is_compatible(np, "pci106b,18") || 2848 of_device_is_compatible(np, "pci106b,30") || 2849 of_device_is_compatible(np, "pci11c1,5811"))) { 2850 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2851 core99_firewire_enable(np, 0, 1); 2852 } | 2853 if (np->parent 2854 && of_device_is_compatible(np->parent, "uni-north") 2855 && (of_device_is_compatible(np, "pci106b,18") || 2856 of_device_is_compatible(np, "pci106b,30") || 2857 of_device_is_compatible(np, "pci11c1,5811"))) { 2858 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2859 core99_firewire_enable(np, 0, 1); 2860 } |
2861 np = of_find_node_by_name(np, "firewire"); |
|
2853 } 2854 2855 /* Enable ATA-100 before PCI probe. */ 2856 np = of_find_node_by_name(NULL, "ata-6"); | 2862 } 2863 2864 /* Enable ATA-100 before PCI probe. */ 2865 np = of_find_node_by_name(NULL, "ata-6"); |
2857 for_each_node_by_name(np, "ata-6") { | 2866 while(np) { |
2858 if (np->parent 2859 && of_device_is_compatible(np->parent, "uni-north") 2860 && of_device_is_compatible(np, "kauai-ata")) { 2861 core99_ata100_enable(np, 1); 2862 } | 2867 if (np->parent 2868 && of_device_is_compatible(np->parent, "uni-north") 2869 && of_device_is_compatible(np, "kauai-ata")) { 2870 core99_ata100_enable(np, 1); 2871 } |
2872 np = of_find_node_by_name(np, "ata-6"); |
|
2863 } 2864 2865 /* Switch airport off */ 2866 for_each_node_by_name(np, "radio") { 2867 if (np->parent == macio_chips[0].of_node) { 2868 macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON; 2869 core99_airport_enable(np, 0, 0); 2870 } --- 9 unchanged lines hidden (view full) --- 2880 if (macio_chips[0].of_node && macio_chips[0].type == macio_heathrow 2881 && (pmac_mb.model_id == PMAC_TYPE_GOSSAMER || 2882 pmac_mb.model_id == PMAC_TYPE_SILK)) { 2883 struct macio_chip *macio = &macio_chips[0]; 2884 MACIO_BIS(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE); 2885 MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N); 2886 } 2887 | 2873 } 2874 2875 /* Switch airport off */ 2876 for_each_node_by_name(np, "radio") { 2877 if (np->parent == macio_chips[0].of_node) { 2878 macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON; 2879 core99_airport_enable(np, 0, 0); 2880 } --- 9 unchanged lines hidden (view full) --- 2890 if (macio_chips[0].of_node && macio_chips[0].type == macio_heathrow 2891 && (pmac_mb.model_id == PMAC_TYPE_GOSSAMER || 2892 pmac_mb.model_id == PMAC_TYPE_SILK)) { 2893 struct macio_chip *macio = &macio_chips[0]; 2894 MACIO_BIS(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE); 2895 MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N); 2896 } 2897 |
2888#endif /* CONFIG_POWER4 */ | 2898#endif /* CONFIG_PPC64 */ |
2889 2890 /* On all machines, switch modem & serial ports off */ 2891 for_each_node_by_name(np, "ch-a") 2892 initial_serial_shutdown(np); 2893 of_node_put(np); 2894 for_each_node_by_name(np, "ch-b") 2895 initial_serial_shutdown(np); 2896 of_node_put(np); --- 147 unchanged lines hidden --- | 2899 2900 /* On all machines, switch modem & serial ports off */ 2901 for_each_node_by_name(np, "ch-a") 2902 initial_serial_shutdown(np); 2903 of_node_put(np); 2904 for_each_node_by_name(np, "ch-b") 2905 initial_serial_shutdown(np); 2906 of_node_put(np); --- 147 unchanged lines hidden --- |