via-pmu.c (0ad3a96f8ad910ecf87a25ec69ed360b284dee2e) via-pmu.c (21fe3301f11a93c4f18e8480ed08522559bf0a50)
1/*
2 * Device driver for the via-pmu on Apple Powermacs.
3 *
4 * The VIA (versatile interface adapter) interfaces to the PMU,
5 * a 6805 microprocessor core whose primary function is to control
6 * battery charging and system power on the PowerBook 3400 and 2400.
7 * The PMU also controls the ADB (Apple Desktop Bus) which connects
8 * to the keyboard and mouse, as well as the non-volatile RAM

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

2662 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,1);
2663
2664 /* displacement-flush the L2 cache - necessary? */
2665 for (p = KERNELBASE; p < KERNELBASE + 0x100000; p += 0x1000)
2666 i = *(volatile int *)p;
2667 asleep = 1;
2668
2669 /* Put the CPU into sleep mode */
1/*
2 * Device driver for the via-pmu on Apple Powermacs.
3 *
4 * The VIA (versatile interface adapter) interfaces to the PMU,
5 * a 6805 microprocessor core whose primary function is to control
6 * battery charging and system power on the PowerBook 3400 and 2400.
7 * The PMU also controls the ADB (Apple Desktop Bus) which connects
8 * to the keyboard and mouse, as well as the non-volatile RAM

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

2662 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,1);
2663
2664 /* displacement-flush the L2 cache - necessary? */
2665 for (p = KERNELBASE; p < KERNELBASE + 0x100000; p += 0x1000)
2666 i = *(volatile int *)p;
2667 asleep = 1;
2668
2669 /* Put the CPU into sleep mode */
2670 asm volatile("mfspr %0,1008" : "=r" (hid0) :);
2670 hid0 = mfspr(SPRN_HID0);
2671 hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP;
2671 hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP;
2672 asm volatile("mtspr 1008,%0" : : "r" (hid0));
2673 _nmask_and_or_msr(0, MSR_POW | MSR_EE);
2672 mtspr(SPRN_HID0, hid0);
2673 mtmsr(mfmsr() | MSR_POW | MSR_EE);
2674 udelay(10);
2675
2676 /* OK, we're awake again, start restoring things */
2677 out_be32(mem_ctrl_sleep, 0x3f);
2678 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0);
2679 pbook_pci_restore();
2680 pmu_unlock();
2681

--- 468 unchanged lines hidden ---
2674 udelay(10);
2675
2676 /* OK, we're awake again, start restoring things */
2677 out_be32(mem_ctrl_sleep, 0x3f);
2678 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0);
2679 pbook_pci_restore();
2680 pmu_unlock();
2681

--- 468 unchanged lines hidden ---