Lines Matching +full:100 +full:base +full:- +full:fx
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au)
8 * - Replace mdelay with some schedule loop if possible
9 * - Shorten some obfuscated delays on some routines (like modem
11 * - Refcount some clocks (see darwin)
12 * - Split split split...
37 #include <asm/pci-bridge.h>
79 child = child->parent; in macio_find()
143 return -ENODEV; in simple_feature_tweak()
169 return -ENODEV; in ohare_htw_scc_enable()
170 if (of_node_name_eq(node, "ch-a")) in ohare_htw_scc_enable()
172 else if (of_node_name_eq(node, "ch-b")) in ohare_htw_scc_enable()
175 return -ENODEV; in ohare_htw_scc_enable()
177 htw = (macio->type == macio_heathrow || macio->type == macio_paddington in ohare_htw_scc_enable()
178 || macio->type == macio_gatwick); in ohare_htw_scc_enable()
219 macio->flags |= chan_mask; in ohare_htw_scc_enable()
222 macio->flags |= MACIO_FLAG_SCC_LOCKED; in ohare_htw_scc_enable()
224 if (macio->flags & MACIO_FLAG_SCC_LOCKED) in ohare_htw_scc_enable()
225 return -EPERM; in ohare_htw_scc_enable()
239 macio->flags &= ~(chan_mask); in ohare_htw_scc_enable()
268 * doesn't stick. I'm still investigating... --BenH. in ohare_ide_enable()
279 return -ENODEV; in ohare_ide_enable()
293 return -ENODEV; in ohare_ide_reset()
302 return -EPERM; in ohare_sleep_state()
321 return -ENODEV; in heathrow_modem_enable()
373 return -ENODEV; in heathrow_mesh_enable()
405 return -ENODEV; in heathrow_ide_enable()
420 return -ENODEV; in heathrow_ide_reset()
432 return -ENODEV; in heathrow_bmac_enable()
468 return -ENODEV; in heathrow_sound_enable()
496 (macio->base + ((0x8000+i*0x100)>>2)); in dbdma_save()
497 save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi); in dbdma_save()
498 save[i].cmdptr = in_le32(&chan->cmdptr); in dbdma_save()
499 save[i].intr_sel = in_le32(&chan->intr_sel); in dbdma_save()
500 save[i].br_sel = in_le32(&chan->br_sel); in dbdma_save()
501 save[i].wait_sel = in_le32(&chan->wait_sel); in dbdma_save()
512 (macio->base + ((0x8000+i*0x100)>>2)); in dbdma_restore()
513 out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16); in dbdma_restore()
514 while (in_le32(&chan->status) & ACTIVE) in dbdma_restore()
516 out_le32(&chan->cmdptr_hi, save[i].cmdptr_hi); in dbdma_restore()
517 out_le32(&chan->cmdptr, save[i].cmdptr); in dbdma_restore()
518 out_le32(&chan->intr_sel, save[i].intr_sel); in dbdma_restore()
519 out_le32(&chan->br_sel, save[i].br_sel); in dbdma_restore()
520 out_le32(&chan->wait_sel, save[i].wait_sel); in dbdma_restore()
584 return -EPERM; in heathrow_sleep_state()
606 return -ENODEV; in core99_scc_enable()
607 if (of_node_name_eq(node, "ch-a")) in core99_scc_enable()
609 else if (of_node_name_eq(node, "ch-b")) in core99_scc_enable()
612 return -ENODEV; in core99_scc_enable()
648 macio->flags |= chan_mask; in core99_scc_enable()
667 macio->flags |= MACIO_FLAG_SCC_LOCKED; in core99_scc_enable()
669 if (macio->flags & MACIO_FLAG_SCC_LOCKED) in core99_scc_enable()
670 return -EPERM; in core99_scc_enable()
690 macio->flags &= ~(chan_mask); in core99_scc_enable()
707 return -ENODEV; in core99_modem_enable()
712 return -ENODEV; in core99_modem_enable()
760 return -ENODEV; in pangea_modem_enable()
765 return -ENODEV; in pangea_modem_enable()
813 return -ENODEV; in core99_ata100_enable()
843 * based ata-100 in core99_ide_enable()
858 return -ENODEV; in core99_ide_enable()
876 return -ENODEV; in core99_ide_reset()
904 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_gmac_phy_reset()
905 macio->type != macio_intrepid) in core99_gmac_phy_reset()
906 return -ENODEV; in core99_gmac_phy_reset()
930 return -ENODEV; in core99_sound_chip_enable()
961 return -ENODEV; in core99_airport_enable()
966 if (node != macio->of_node && in core99_airport_enable()
967 (!node->parent || node->parent != macio->of_node)) in core99_airport_enable()
968 return -ENODEV; in core99_airport_enable()
969 state = (macio->flags & MACIO_FLAG_AIRPORT_ON) != 0; in core99_airport_enable()
973 /* This code is a reproduction of OF enable-cardslot in core99_airport_enable()
974 * and init-wireless methods, slightly hacked until in core99_airport_enable()
1018 mdelay(100); in core99_airport_enable()
1020 macio->flags |= MACIO_FLAG_AIRPORT_ON; in core99_airport_enable()
1033 macio->flags &= ~MACIO_FLAG_AIRPORT_ON; in core99_airport_enable()
1052 if (macio->type != macio_keylargo) in core99_reset_cpu()
1053 return -ENODEV; in core99_reset_cpu()
1057 const u32 *rst = of_get_property(np, "soft-reset", NULL); in core99_reset_cpu()
1090 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_usb_enable()
1091 macio->type != macio_intrepid) in core99_usb_enable()
1092 return -ENODEV; in core99_usb_enable()
1094 prop = of_get_property(node, "AAPL,clock-id", NULL); in core99_usb_enable()
1096 return -ENODEV; in core99_usb_enable()
1104 return -ENODEV; in core99_usb_enable()
1106 /* Sorry for the brute-force locking, but this is only used during in core99_usb_enable()
1153 if (macio->type == macio_intrepid) { in core99_usb_enable()
1175 if (--timeout <= 0) { in core99_usb_enable()
1208 if (macio->type != macio_intrepid) in core99_usb_enable()
1215 if (macio->type != macio_intrepid) in core99_usb_enable()
1240 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_firewire_enable()
1241 macio->type != macio_intrepid) in core99_firewire_enable()
1242 return -ENODEV; in core99_firewire_enable()
1243 if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED)) in core99_firewire_enable()
1244 return -ENODEV; in core99_firewire_enable()
1268 return -ENODEV; in core99_firewire_cable_power()
1270 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_firewire_cable_power()
1271 macio->type != macio_intrepid) in core99_firewire_cable_power()
1272 return -ENODEV; in core99_firewire_cable_power()
1273 if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED)) in core99_firewire_cable_power()
1274 return -ENODEV; in core99_firewire_cable_power()
1297 return -ENODEV; in intrepid_aack_delay_enable()
1337 return -ENODEV; in g5_gmac_enable()
1362 return -ENODEV; in g5_fw_enable()
1413 return -ENODEV; in g5_eth_phy_reset()
1419 /* PHY reset is GPIO 29, not in device-tree unfortunately */ in g5_eth_phy_reset()
1455 if (macio->type != macio_keylargo2 && macio->type != macio_shasta) in g5_i2s_enable()
1456 return -ENODEV; in g5_i2s_enable()
1457 if (strncmp(node->name, "i2s-", 4)) in g5_i2s_enable()
1458 return -ENODEV; in g5_i2s_enable()
1459 cell = node->name[4] - 'a'; in g5_i2s_enable()
1465 if (macio->type == macio_shasta) in g5_i2s_enable()
1469 return -ENODEV; in g5_i2s_enable()
1498 if (macio->type != macio_keylargo2 && macio->type != macio_shasta) in g5_reset_cpu()
1499 return -ENODEV; in g5_reset_cpu()
1503 const u32 *rst = of_get_property(np, "soft-reset", NULL); in g5_reset_cpu()
1512 return -ENODEV; in g5_reset_cpu()
1581 if (macio->rev >= 2) { in keylargo_shutdown()
1669 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_sleep()
1670 macio->type != macio_intrepid) in core99_sleep()
1671 return -ENODEV; in core99_sleep()
1676 if (macio->flags & MACIO_FLAG_AIRPORT_ON) in core99_sleep()
1677 core99_airport_enable(macio->of_node, 0, 0); in core99_sleep()
1680 if (macio->flags & MACIO_FLAG_FW_SUPPORTED) { in core99_sleep()
1686 if (macio->type == macio_keylargo) in core99_sleep()
1687 core99_modem_enable(macio->of_node, 0, 0); in core99_sleep()
1689 pangea_modem_enable(macio->of_node, 0, 0); in core99_sleep()
1692 core99_sound_chip_enable(macio->of_node, 0, 0); in core99_sleep()
1707 if (macio->type == macio_keylargo) in core99_sleep()
1714 if (macio->type == macio_pangea || macio->type == macio_intrepid) in core99_sleep()
1723 if (macio->type == macio_pangea) in core99_sleep()
1725 else if (macio->type == macio_intrepid) in core99_sleep()
1727 else if (macio->type == macio_keylargo) in core99_sleep()
1740 udelay(100); in core99_sleep()
1762 if (macio->type != macio_keylargo && macio->type != macio_pangea && in core99_wake_up()
1763 macio->type != macio_intrepid) in core99_wake_up()
1764 return -ENODEV; in core99_wake_up()
1778 if (macio->type == macio_keylargo) { in core99_wake_up()
1792 if (macio->type == macio_pangea || macio->type == macio_intrepid) { in core99_wake_up()
1813 udelay(100); in core99_wake_up()
1839 return -EPERM; in core99_sleep_state()
1856 /* Todo: eventually check we are really dealing with on-board in generic_dev_can_wake()
1877 return -EINVAL; in generic_get_mb_info()
2387 return -ENODEV; in pmac_do_feature_call()
2406 /* Lookup known motherboard type in device-tree. First try an in probe_motherboard()
2410 dt = of_find_node_by_name(NULL, "device-tree"); in probe_motherboard()
2426 /* Fallback to selection depending on mac-io chip type */ in probe_motherboard()
2427 switch(macio->type) { in probe_motherboard()
2435 pmac_mb.model_name = "Unknown OHare-based"; in probe_motherboard()
2439 pmac_mb.model_name = "Unknown Heathrow-based"; in probe_motherboard()
2444 pmac_mb.model_name = "Unknown Paddington-based"; in probe_motherboard()
2449 pmac_mb.model_name = "Unknown Keylargo-based"; in probe_motherboard()
2454 pmac_mb.model_name = "Unknown Pangea-based"; in probe_motherboard()
2459 pmac_mb.model_name = "Unknown Intrepid-based"; in probe_motherboard()
2465 pmac_mb.model_name = "Unknown K2-based"; in probe_motherboard()
2470 pmac_mb.model_name = "Unknown Shasta-based"; in probe_motherboard()
2475 ret = -ENODEV; in probe_motherboard()
2484 ret = -ENODEV; in probe_motherboard()
2487 /* Here, I used to disable the media-bay on comet. It in probe_motherboard()
2489 * a kind of media-bay and works with the current driver. in probe_motherboard()
2498 * enable it on those. In theory, the flush-on-lock property is in probe_motherboard()
2509 if (of_get_property(np, "flush-on-lock", NULL) || in probe_motherboard()
2523 /* On CPUs that support it (750FX), lowspeed by default during in probe_motherboard()
2552 /* Locate core99 Uni-N */ in probe_uninorth()
2553 uninorth_node = of_find_node_by_name(NULL, "uni-n"); in probe_uninorth()
2618 volatile u32 __iomem *base; in probe_one_macio() local
2645 printk(KERN_ERR "pmac_feature: %pOF: can't find base !\n", in probe_one_macio()
2651 printk(KERN_ERR "pmac_feature: %pOF, can't translate base !\n", in probe_one_macio()
2655 base = ioremap(addr, (unsigned long)size); in probe_one_macio()
2656 if (!base) { in probe_one_macio()
2657 printk(KERN_ERR "pmac_feature: %pOF, can't map mac-io chip !\n", in probe_one_macio()
2662 const u32 *did = of_get_property(node, "device-id", NULL); in probe_one_macio()
2672 macio_chips[i].base = base; in probe_one_macio()
2675 revp = of_get_property(node, "revision-id", NULL); in probe_one_macio()
2678 printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", in probe_one_macio()
2679 macio_names[type], macio_chips[i].rev, macio_chips[i].base); in probe_one_macio()
2694 probe_one_macio("mac-io", "keylargo", macio_keylargo); in probe_macios()
2695 probe_one_macio("mac-io", "paddington", macio_paddington); in probe_macios()
2696 probe_one_macio("mac-io", "gatwick", macio_gatwick); in probe_macios()
2697 probe_one_macio("mac-io", "heathrow", macio_heathrow); in probe_macios()
2698 probe_one_macio("mac-io", "K2-Keylargo", macio_keylargo2); in probe_macios()
2716 return (macio_chips[0].of_node == NULL) ? -ENODEV : 0; in probe_macios()
2731 slots = of_get_property(np, "slot-names", &len); in initial_serial_shutdown()
2737 else if (slots && slots->count > 0) { in initial_serial_shutdown()
2738 if (strcmp(slots->name, "IrDA") == 0) in initial_serial_shutdown()
2740 else if (strcmp(slots->name, "Modem") == 0) in initial_serial_shutdown()
2754 * but I'm not too sure it was audited for side-effects on other in set_initial_features()
2762 np = of_find_node_by_name(NULL, "via-pmu"); in set_initial_features()
2793 if (of_device_is_compatible(np, "K2-GMAC")) in set_initial_features()
2817 if (np->parent in set_initial_features()
2818 && of_device_is_compatible(np->parent, "uni-north") in set_initial_features()
2829 if (np->parent in set_initial_features()
2830 && of_device_is_compatible(np->parent, "uni-north") in set_initial_features()
2839 /* Enable ATA-100 before PCI probe. */ in set_initial_features()
2840 for_each_node_by_name(np, "ata-6") { in set_initial_features()
2841 if (np->parent in set_initial_features()
2842 && of_device_is_compatible(np->parent, "uni-north") in set_initial_features()
2843 && of_device_is_compatible(np, "kauai-ata")) { in set_initial_features()
2850 if (np->parent == macio_chips[0].of_node) { in set_initial_features()
2874 for_each_node_by_name(np, "ch-a") in set_initial_features()
2876 for_each_node_by_name(np, "ch-b") in set_initial_features()
2886 /* Probe mac-io controllers */ in pmac_feature_init()
2888 printk(KERN_WARNING "No mac-io chip found\n"); in pmac_feature_init()
2929 pcix_node = of_find_compatible_node(NULL, "pci", "pci-x");
2931 printk("No PCI-X bridge found\n");
2935 printk("PCI-X bridge found but not matched to pci\n");
2940 printk("PCI-X bridge found but not matched to host\n");
2945 dump_HT_speeds("PCI-X HT Uplink", cfg, freq);
2948 dump_HT_speeds("PCI-X HT Downlink", cfg, freq);
3005 if (pmac_agp_bridge->bus != dev->bus) in pmac_suspend_agp_for_card()
3015 if (pmac_agp_bridge->bus != dev->bus) in pmac_resume_agp_for_card()