setup.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. /*
  2. * Powermac setup and early boot code plus other random bits.
  3. *
  4. * PowerPC version
  5. * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
  6. *
  7. * Adapted for Power Macintosh by Paul Mackerras
  8. * Copyright (C) 1996 Paul Mackerras (paulus@samba.org)
  9. *
  10. * Derived from "arch/alpha/kernel/setup.c"
  11. * Copyright (C) 1995 Linus Torvalds
  12. *
  13. * Maintained by Benjamin Herrenschmidt (benh@kernel.crashing.org)
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License
  17. * as published by the Free Software Foundation; either version
  18. * 2 of the License, or (at your option) any later version.
  19. *
  20. */
  21. /*
  22. * bootup setup stuff..
  23. */
  24. #include <linux/init.h>
  25. #include <linux/errno.h>
  26. #include <linux/sched.h>
  27. #include <linux/kernel.h>
  28. #include <linux/mm.h>
  29. #include <linux/stddef.h>
  30. #include <linux/unistd.h>
  31. #include <linux/ptrace.h>
  32. #include <linux/slab.h>
  33. #include <linux/user.h>
  34. #include <linux/tty.h>
  35. #include <linux/string.h>
  36. #include <linux/delay.h>
  37. #include <linux/ioport.h>
  38. #include <linux/major.h>
  39. #include <linux/initrd.h>
  40. #include <linux/vt_kern.h>
  41. #include <linux/console.h>
  42. #include <linux/pci.h>
  43. #include <linux/adb.h>
  44. #include <linux/cuda.h>
  45. #include <linux/pmu.h>
  46. #include <linux/irq.h>
  47. #include <linux/seq_file.h>
  48. #include <linux/root_dev.h>
  49. #include <linux/bitops.h>
  50. #include <linux/suspend.h>
  51. #include <linux/of_device.h>
  52. #include <linux/of_platform.h>
  53. #include <linux/lmb.h>
  54. #include <asm/reg.h>
  55. #include <asm/sections.h>
  56. #include <asm/prom.h>
  57. #include <asm/system.h>
  58. #include <asm/pgtable.h>
  59. #include <asm/io.h>
  60. #include <asm/pci-bridge.h>
  61. #include <asm/ohare.h>
  62. #include <asm/mediabay.h>
  63. #include <asm/machdep.h>
  64. #include <asm/dma.h>
  65. #include <asm/cputable.h>
  66. #include <asm/btext.h>
  67. #include <asm/pmac_feature.h>
  68. #include <asm/time.h>
  69. #include <asm/mmu_context.h>
  70. #include <asm/iommu.h>
  71. #include <asm/smu.h>
  72. #include <asm/pmc.h>
  73. #include <asm/udbg.h>
  74. #include "pmac.h"
  75. #undef SHOW_GATWICK_IRQS
  76. int ppc_override_l2cr = 0;
  77. int ppc_override_l2cr_value;
  78. int has_l2cache = 0;
  79. int pmac_newworld;
  80. static int current_root_goodness = -1;
  81. extern struct machdep_calls pmac_md;
  82. #define DEFAULT_ROOT_DEVICE Root_SDA1 /* sda1 - slightly silly choice */
  83. #ifdef CONFIG_PPC64
  84. int sccdbg;
  85. #endif
  86. sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN;
  87. EXPORT_SYMBOL(sys_ctrler);
  88. #ifdef CONFIG_PMAC_SMU
  89. unsigned long smu_cmdbuf_abs;
  90. EXPORT_SYMBOL(smu_cmdbuf_abs);
  91. #endif
  92. static void pmac_show_cpuinfo(struct seq_file *m)
  93. {
  94. struct device_node *np;
  95. const char *pp;
  96. int plen;
  97. int mbmodel;
  98. unsigned int mbflags;
  99. char* mbname;
  100. mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
  101. PMAC_MB_INFO_MODEL, 0);
  102. mbflags = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
  103. PMAC_MB_INFO_FLAGS, 0);
  104. if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME,
  105. (long) &mbname) != 0)
  106. mbname = "Unknown";
  107. /* find motherboard type */
  108. seq_printf(m, "machine\t\t: ");
  109. np = of_find_node_by_path("/");
  110. if (np != NULL) {
  111. pp = of_get_property(np, "model", NULL);
  112. if (pp != NULL)
  113. seq_printf(m, "%s\n", pp);
  114. else
  115. seq_printf(m, "PowerMac\n");
  116. pp = of_get_property(np, "compatible", &plen);
  117. if (pp != NULL) {
  118. seq_printf(m, "motherboard\t:");
  119. while (plen > 0) {
  120. int l = strlen(pp) + 1;
  121. seq_printf(m, " %s", pp);
  122. plen -= l;
  123. pp += l;
  124. }
  125. seq_printf(m, "\n");
  126. }
  127. of_node_put(np);
  128. } else
  129. seq_printf(m, "PowerMac\n");
  130. /* print parsed model */
  131. seq_printf(m, "detected as\t: %d (%s)\n", mbmodel, mbname);
  132. seq_printf(m, "pmac flags\t: %08x\n", mbflags);
  133. /* find l2 cache info */
  134. np = of_find_node_by_name(NULL, "l2-cache");
  135. if (np == NULL)
  136. np = of_find_node_by_type(NULL, "cache");
  137. if (np != NULL) {
  138. const unsigned int *ic =
  139. of_get_property(np, "i-cache-size", NULL);
  140. const unsigned int *dc =
  141. of_get_property(np, "d-cache-size", NULL);
  142. seq_printf(m, "L2 cache\t:");
  143. has_l2cache = 1;
  144. if (of_get_property(np, "cache-unified", NULL) != 0 && dc) {
  145. seq_printf(m, " %dK unified", *dc / 1024);
  146. } else {
  147. if (ic)
  148. seq_printf(m, " %dK instruction", *ic / 1024);
  149. if (dc)
  150. seq_printf(m, "%s %dK data",
  151. (ic? " +": ""), *dc / 1024);
  152. }
  153. pp = of_get_property(np, "ram-type", NULL);
  154. if (pp)
  155. seq_printf(m, " %s", pp);
  156. seq_printf(m, "\n");
  157. of_node_put(np);
  158. }
  159. /* Indicate newworld/oldworld */
  160. seq_printf(m, "pmac-generation\t: %s\n",
  161. pmac_newworld ? "NewWorld" : "OldWorld");
  162. }
  163. #ifndef CONFIG_ADB_CUDA
  164. int find_via_cuda(void)
  165. {
  166. struct device_node *dn = of_find_node_by_name(NULL, "via-cuda");
  167. if (!dn)
  168. return 0;
  169. of_node_put(dn);
  170. printk("WARNING ! Your machine is CUDA-based but your kernel\n");
  171. printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n");
  172. return 0;
  173. }
  174. #endif
  175. #ifndef CONFIG_ADB_PMU
  176. int find_via_pmu(void)
  177. {
  178. struct device_node *dn = of_find_node_by_name(NULL, "via-pmu");
  179. if (!dn)
  180. return 0;
  181. of_node_put(dn);
  182. printk("WARNING ! Your machine is PMU-based but your kernel\n");
  183. printk(" wasn't compiled with CONFIG_ADB_PMU option !\n");
  184. return 0;
  185. }
  186. #endif
  187. #ifndef CONFIG_PMAC_SMU
  188. int smu_init(void)
  189. {
  190. /* should check and warn if SMU is present */
  191. return 0;
  192. }
  193. #endif
  194. #ifdef CONFIG_PPC32
  195. static volatile u32 *sysctrl_regs;
  196. static void __init ohare_init(void)
  197. {
  198. struct device_node *dn;
  199. /* this area has the CPU identification register
  200. and some registers used by smp boards */
  201. sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
  202. /*
  203. * Turn on the L2 cache.
  204. * We assume that we have a PSX memory controller iff
  205. * we have an ohare I/O controller.
  206. */
  207. dn = of_find_node_by_name(NULL, "ohare");
  208. if (dn) {
  209. of_node_put(dn);
  210. if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) {
  211. if (sysctrl_regs[4] & 0x10)
  212. sysctrl_regs[4] |= 0x04000020;
  213. else
  214. sysctrl_regs[4] |= 0x04000000;
  215. if(has_l2cache)
  216. printk(KERN_INFO "Level 2 cache enabled\n");
  217. }
  218. }
  219. }
  220. static void __init l2cr_init(void)
  221. {
  222. /* Checks "l2cr-value" property in the registry */
  223. if (cpu_has_feature(CPU_FTR_L2CR)) {
  224. struct device_node *np = of_find_node_by_name(NULL, "cpus");
  225. if (np == 0)
  226. np = of_find_node_by_type(NULL, "cpu");
  227. if (np != 0) {
  228. const unsigned int *l2cr =
  229. of_get_property(np, "l2cr-value", NULL);
  230. if (l2cr != 0) {
  231. ppc_override_l2cr = 1;
  232. ppc_override_l2cr_value = *l2cr;
  233. _set_L2CR(0);
  234. _set_L2CR(ppc_override_l2cr_value);
  235. }
  236. of_node_put(np);
  237. }
  238. }
  239. if (ppc_override_l2cr)
  240. printk(KERN_INFO "L2CR overridden (0x%x), "
  241. "backside cache is %s\n",
  242. ppc_override_l2cr_value,
  243. (ppc_override_l2cr_value & 0x80000000)
  244. ? "enabled" : "disabled");
  245. }
  246. #endif
  247. static void __init pmac_setup_arch(void)
  248. {
  249. struct device_node *cpu, *ic;
  250. const int *fp;
  251. unsigned long pvr;
  252. pvr = PVR_VER(mfspr(SPRN_PVR));
  253. /* Set loops_per_jiffy to a half-way reasonable value,
  254. for use until calibrate_delay gets called. */
  255. loops_per_jiffy = 50000000 / HZ;
  256. cpu = of_find_node_by_type(NULL, "cpu");
  257. if (cpu != NULL) {
  258. fp = of_get_property(cpu, "clock-frequency", NULL);
  259. if (fp != NULL) {
  260. if (pvr >= 0x30 && pvr < 0x80)
  261. /* PPC970 etc. */
  262. loops_per_jiffy = *fp / (3 * HZ);
  263. else if (pvr == 4 || pvr >= 8)
  264. /* 604, G3, G4 etc. */
  265. loops_per_jiffy = *fp / HZ;
  266. else
  267. /* 601, 603, etc. */
  268. loops_per_jiffy = *fp / (2 * HZ);
  269. }
  270. of_node_put(cpu);
  271. }
  272. /* See if newworld or oldworld */
  273. ic = of_find_node_with_property(NULL, "interrupt-controller");
  274. if (ic) {
  275. pmac_newworld = 1;
  276. of_node_put(ic);
  277. }
  278. /* Lookup PCI hosts */
  279. pmac_pci_init();
  280. #ifdef CONFIG_PPC32
  281. ohare_init();
  282. l2cr_init();
  283. #endif /* CONFIG_PPC32 */
  284. find_via_cuda();
  285. find_via_pmu();
  286. smu_init();
  287. #if defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) || \
  288. defined(CONFIG_PPC64)
  289. pmac_nvram_init();
  290. #endif
  291. #ifdef CONFIG_PPC32
  292. #ifdef CONFIG_BLK_DEV_INITRD
  293. if (initrd_start)
  294. ROOT_DEV = Root_RAM0;
  295. else
  296. #endif
  297. ROOT_DEV = DEFAULT_ROOT_DEVICE;
  298. #endif
  299. #ifdef CONFIG_ADB
  300. if (strstr(cmd_line, "adb_sync")) {
  301. extern int __adb_probe_sync;
  302. __adb_probe_sync = 1;
  303. }
  304. #endif /* CONFIG_ADB */
  305. }
  306. #ifdef CONFIG_SCSI
  307. void note_scsi_host(struct device_node *node, void *host)
  308. {
  309. }
  310. EXPORT_SYMBOL(note_scsi_host);
  311. #endif
  312. static int initializing = 1;
  313. static int pmac_late_init(void)
  314. {
  315. initializing = 0;
  316. /* this is udbg (which is __init) and we can later use it during
  317. * cpu hotplug (in smp_core99_kick_cpu) */
  318. ppc_md.progress = NULL;
  319. return 0;
  320. }
  321. machine_late_initcall(powermac, pmac_late_init);
  322. /*
  323. * This is __init_refok because we check for "initializing" before
  324. * touching any of the __init sensitive things and "initializing"
  325. * will be false after __init time. This can't be __init because it
  326. * can be called whenever a disk is first accessed.
  327. */
  328. void __init_refok note_bootable_part(dev_t dev, int part, int goodness)
  329. {
  330. char *p;
  331. if (!initializing)
  332. return;
  333. if ((goodness <= current_root_goodness) &&
  334. ROOT_DEV != DEFAULT_ROOT_DEVICE)
  335. return;
  336. p = strstr(boot_command_line, "root=");
  337. if (p != NULL && (p == boot_command_line || p[-1] == ' '))
  338. return;
  339. ROOT_DEV = dev + part;
  340. current_root_goodness = goodness;
  341. }
  342. #ifdef CONFIG_ADB_CUDA
  343. static void cuda_restart(void)
  344. {
  345. struct adb_request req;
  346. cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_RESET_SYSTEM);
  347. for (;;)
  348. cuda_poll();
  349. }
  350. static void cuda_shutdown(void)
  351. {
  352. struct adb_request req;
  353. cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_POWERDOWN);
  354. for (;;)
  355. cuda_poll();
  356. }
  357. #else
  358. #define cuda_restart()
  359. #define cuda_shutdown()
  360. #endif
  361. #ifndef CONFIG_ADB_PMU
  362. #define pmu_restart()
  363. #define pmu_shutdown()
  364. #endif
  365. #ifndef CONFIG_PMAC_SMU
  366. #define smu_restart()
  367. #define smu_shutdown()
  368. #endif
  369. static void pmac_restart(char *cmd)
  370. {
  371. switch (sys_ctrler) {
  372. case SYS_CTRLER_CUDA:
  373. cuda_restart();
  374. break;
  375. case SYS_CTRLER_PMU:
  376. pmu_restart();
  377. break;
  378. case SYS_CTRLER_SMU:
  379. smu_restart();
  380. break;
  381. default: ;
  382. }
  383. }
  384. static void pmac_power_off(void)
  385. {
  386. switch (sys_ctrler) {
  387. case SYS_CTRLER_CUDA:
  388. cuda_shutdown();
  389. break;
  390. case SYS_CTRLER_PMU:
  391. pmu_shutdown();
  392. break;
  393. case SYS_CTRLER_SMU:
  394. smu_shutdown();
  395. break;
  396. default: ;
  397. }
  398. }
  399. static void
  400. pmac_halt(void)
  401. {
  402. pmac_power_off();
  403. }
  404. /*
  405. * Early initialization.
  406. */
  407. static void __init pmac_init_early(void)
  408. {
  409. /* Enable early btext debug if requested */
  410. if (strstr(cmd_line, "btextdbg")) {
  411. udbg_adb_init_early();
  412. register_early_udbg_console();
  413. }
  414. /* Probe motherboard chipset */
  415. pmac_feature_init();
  416. /* Initialize debug stuff */
  417. udbg_scc_init(!!strstr(cmd_line, "sccdbg"));
  418. udbg_adb_init(!!strstr(cmd_line, "btextdbg"));
  419. #ifdef CONFIG_PPC64
  420. iommu_init_early_dart();
  421. #endif
  422. /* SMP Init has to be done early as we need to patch up
  423. * cpu_possible_map before interrupt stacks are allocated
  424. * or kaboom...
  425. */
  426. #ifdef CONFIG_SMP
  427. pmac_setup_smp();
  428. #endif
  429. }
  430. static int __init pmac_declare_of_platform_devices(void)
  431. {
  432. struct device_node *np;
  433. if (machine_is(chrp))
  434. return -1;
  435. np = of_find_node_by_name(NULL, "valkyrie");
  436. if (np)
  437. of_platform_device_create(np, "valkyrie", NULL);
  438. np = of_find_node_by_name(NULL, "platinum");
  439. if (np)
  440. of_platform_device_create(np, "platinum", NULL);
  441. np = of_find_node_by_type(NULL, "smu");
  442. if (np) {
  443. of_platform_device_create(np, "smu", NULL);
  444. of_node_put(np);
  445. }
  446. return 0;
  447. }
  448. machine_device_initcall(powermac, pmac_declare_of_platform_devices);
  449. #ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE
  450. /*
  451. * This is called very early, as part of console_init() (typically just after
  452. * time_init()). This function is respondible for trying to find a good
  453. * default console on serial ports. It tries to match the open firmware
  454. * default output with one of the available serial console drivers.
  455. */
  456. static int __init check_pmac_serial_console(void)
  457. {
  458. struct device_node *prom_stdout = NULL;
  459. int offset = 0;
  460. const char *name;
  461. #ifdef CONFIG_SERIAL_PMACZILOG_TTYS
  462. char *devname = "ttyS";
  463. #else
  464. char *devname = "ttyPZ";
  465. #endif
  466. pr_debug(" -> check_pmac_serial_console()\n");
  467. /* The user has requested a console so this is already set up. */
  468. if (strstr(boot_command_line, "console=")) {
  469. pr_debug(" console was specified !\n");
  470. return -EBUSY;
  471. }
  472. if (!of_chosen) {
  473. pr_debug(" of_chosen is NULL !\n");
  474. return -ENODEV;
  475. }
  476. /* We are getting a weird phandle from OF ... */
  477. /* ... So use the full path instead */
  478. name = of_get_property(of_chosen, "linux,stdout-path", NULL);
  479. if (name == NULL) {
  480. pr_debug(" no linux,stdout-path !\n");
  481. return -ENODEV;
  482. }
  483. prom_stdout = of_find_node_by_path(name);
  484. if (!prom_stdout) {
  485. pr_debug(" can't find stdout package %s !\n", name);
  486. return -ENODEV;
  487. }
  488. pr_debug("stdout is %s\n", prom_stdout->full_name);
  489. name = of_get_property(prom_stdout, "name", NULL);
  490. if (!name) {
  491. pr_debug(" stdout package has no name !\n");
  492. goto not_found;
  493. }
  494. if (strcmp(name, "ch-a") == 0)
  495. offset = 0;
  496. else if (strcmp(name, "ch-b") == 0)
  497. offset = 1;
  498. else
  499. goto not_found;
  500. of_node_put(prom_stdout);
  501. pr_debug("Found serial console at %s%d\n", devname, offset);
  502. return add_preferred_console(devname, offset, NULL);
  503. not_found:
  504. pr_debug("No preferred console found !\n");
  505. of_node_put(prom_stdout);
  506. return -ENODEV;
  507. }
  508. console_initcall(check_pmac_serial_console);
  509. #endif /* CONFIG_SERIAL_PMACZILOG_CONSOLE */
  510. /*
  511. * Called very early, MMU is off, device-tree isn't unflattened
  512. */
  513. static int __init pmac_probe(void)
  514. {
  515. unsigned long root = of_get_flat_dt_root();
  516. if (!of_flat_dt_is_compatible(root, "Power Macintosh") &&
  517. !of_flat_dt_is_compatible(root, "MacRISC"))
  518. return 0;
  519. #ifdef CONFIG_PPC64
  520. /*
  521. * On U3, the DART (iommu) must be allocated now since it
  522. * has an impact on htab_initialize (due to the large page it
  523. * occupies having to be broken up so the DART itself is not
  524. * part of the cacheable linar mapping
  525. */
  526. alloc_dart_table();
  527. hpte_init_native();
  528. #endif
  529. #ifdef CONFIG_PPC32
  530. /* isa_io_base gets set in pmac_pci_init */
  531. ISA_DMA_THRESHOLD = ~0L;
  532. DMA_MODE_READ = 1;
  533. DMA_MODE_WRITE = 2;
  534. #endif /* CONFIG_PPC32 */
  535. #ifdef CONFIG_PMAC_SMU
  536. /*
  537. * SMU based G5s need some memory below 2Gb, at least the current
  538. * driver needs that. We have to allocate it now. We allocate 4k
  539. * (1 small page) for now.
  540. */
  541. smu_cmdbuf_abs = lmb_alloc_base(4096, 4096, 0x80000000UL);
  542. #endif /* CONFIG_PMAC_SMU */
  543. return 1;
  544. }
  545. #ifdef CONFIG_PPC64
  546. /* Move that to pci.c */
  547. static int pmac_pci_probe_mode(struct pci_bus *bus)
  548. {
  549. struct device_node *node = pci_bus_to_OF_node(bus);
  550. /* We need to use normal PCI probing for the AGP bus,
  551. * since the device for the AGP bridge isn't in the tree.
  552. * Same for the PCIe host on U4 and the HT host bridge.
  553. */
  554. if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
  555. of_device_is_compatible(node, "u4-pcie") ||
  556. of_device_is_compatible(node, "u3-ht")))
  557. return PCI_PROBE_NORMAL;
  558. return PCI_PROBE_DEVTREE;
  559. }
  560. #ifdef CONFIG_HOTPLUG_CPU
  561. /* access per cpu vars from generic smp.c */
  562. DECLARE_PER_CPU(int, cpu_state);
  563. static void pmac_cpu_die(void)
  564. {
  565. /*
  566. * turn off as much as possible, we'll be
  567. * kicked out as this will only be invoked
  568. * on core99 platforms for now ...
  569. */
  570. printk(KERN_INFO "CPU#%d offline\n", smp_processor_id());
  571. __get_cpu_var(cpu_state) = CPU_DEAD;
  572. smp_wmb();
  573. /*
  574. * during the path that leads here preemption is disabled,
  575. * reenable it now so that when coming up preempt count is
  576. * zero correctly
  577. */
  578. preempt_enable();
  579. /*
  580. * hard-disable interrupts for the non-NAP case, the NAP code
  581. * needs to re-enable interrupts (but soft-disables them)
  582. */
  583. hard_irq_disable();
  584. while (1) {
  585. /* let's not take timer interrupts too often ... */
  586. set_dec(0x7fffffff);
  587. /* should always be true at this point */
  588. if (cpu_has_feature(CPU_FTR_CAN_NAP))
  589. power4_cpu_offline_powersave();
  590. else {
  591. HMT_low();
  592. HMT_very_low();
  593. }
  594. }
  595. }
  596. #endif /* CONFIG_HOTPLUG_CPU */
  597. #endif /* CONFIG_PPC64 */
  598. define_machine(powermac) {
  599. .name = "PowerMac",
  600. .probe = pmac_probe,
  601. .setup_arch = pmac_setup_arch,
  602. .init_early = pmac_init_early,
  603. .show_cpuinfo = pmac_show_cpuinfo,
  604. .init_IRQ = pmac_pic_init,
  605. .get_irq = NULL, /* changed later */
  606. .pci_irq_fixup = pmac_pci_irq_fixup,
  607. .restart = pmac_restart,
  608. .power_off = pmac_power_off,
  609. .halt = pmac_halt,
  610. .time_init = pmac_time_init,
  611. .get_boot_time = pmac_get_boot_time,
  612. .set_rtc_time = pmac_set_rtc_time,
  613. .get_rtc_time = pmac_get_rtc_time,
  614. .calibrate_decr = pmac_calibrate_decr,
  615. .feature_call = pmac_do_feature_call,
  616. .progress = udbg_progress,
  617. #ifdef CONFIG_PPC64
  618. .pci_probe_mode = pmac_pci_probe_mode,
  619. .power_save = power4_idle,
  620. .enable_pmcs = power4_enable_pmcs,
  621. #endif /* CONFIG_PPC64 */
  622. #ifdef CONFIG_PPC32
  623. .pcibios_enable_device_hook = pmac_pci_enable_device_hook,
  624. .pcibios_after_init = pmac_pcibios_after_init,
  625. .phys_mem_access_prot = pci_phys_mem_access_prot,
  626. #endif
  627. #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
  628. .cpu_die = pmac_cpu_die,
  629. #endif
  630. #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)
  631. .cpu_die = generic_mach_cpu_die,
  632. #endif
  633. };