mpc8272_ads.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. /*
  2. * MPC8272_ads setup and early boot code plus other random bits.
  3. *
  4. * Author: Vitaly Bordug <vbordug@ru.mvista.com>
  5. * m82xx_restart fix by Wade Farnsworth <wfarnsworth@mvista.com>
  6. *
  7. * Copyright (c) 2006 MontaVista Software, Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. */
  14. #include <linux/stddef.h>
  15. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <linux/errno.h>
  18. #include <linux/reboot.h>
  19. #include <linux/pci.h>
  20. #include <linux/interrupt.h>
  21. #include <linux/kdev_t.h>
  22. #include <linux/major.h>
  23. #include <linux/console.h>
  24. #include <linux/delay.h>
  25. #include <linux/seq_file.h>
  26. #include <linux/root_dev.h>
  27. #include <linux/initrd.h>
  28. #include <linux/module.h>
  29. #include <linux/fsl_devices.h>
  30. #include <linux/fs_uart_pd.h>
  31. #include <asm/system.h>
  32. #include <asm/pgtable.h>
  33. #include <asm/page.h>
  34. #include <asm/atomic.h>
  35. #include <asm/time.h>
  36. #include <asm/io.h>
  37. #include <asm/machdep.h>
  38. #include <asm/pci-bridge.h>
  39. #include <asm/mpc8260.h>
  40. #include <asm/irq.h>
  41. #include <mm/mmu_decl.h>
  42. #include <asm/prom.h>
  43. #include <asm/cpm2.h>
  44. #include <asm/udbg.h>
  45. #include <asm/i8259.h>
  46. #include <linux/fs_enet_pd.h>
  47. #include <sysdev/fsl_soc.h>
  48. #include <sysdev/cpm2_pic.h>
  49. #include "pq2ads.h"
  50. #ifdef CONFIG_PCI
  51. static uint pci_clk_frq;
  52. static struct {
  53. unsigned long *pci_int_stat_reg;
  54. unsigned long *pci_int_mask_reg;
  55. } pci_regs;
  56. static unsigned long pci_int_base;
  57. static struct irq_host *pci_pic_host;
  58. #endif
  59. static void __init mpc8272_ads_pic_init(void)
  60. {
  61. struct device_node *np = of_find_compatible_node(NULL, "cpm-pic", "CPM2");
  62. struct resource r;
  63. cpm2_map_t *cpm_reg;
  64. if (np == NULL) {
  65. printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
  66. return;
  67. }
  68. if (of_address_to_resource(np, 0, &r)) {
  69. printk(KERN_ERR "PIC init: invalid resource\n");
  70. of_node_put(np);
  71. return;
  72. }
  73. cpm2_pic_init(np);
  74. of_node_put(np);
  75. /* Initialize the default interrupt mapping priorities,
  76. * in case the boot rom changed something on us.
  77. */
  78. cpm_reg = (cpm2_map_t *) ioremap(get_immrbase(), sizeof(cpm2_map_t));
  79. cpm_reg->im_intctl.ic_siprr = 0x05309770;
  80. iounmap(cpm_reg);
  81. #ifdef CONFIG_PCI
  82. /* Initialize stuff for the 82xx CPLD IC and install demux */
  83. m82xx_pci_init_irq();
  84. #endif
  85. }
  86. static void init_fcc1_ioports(struct fs_platform_info *fpi)
  87. {
  88. struct io_port *io;
  89. u32 tempval;
  90. cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
  91. struct device_node *np;
  92. struct resource r;
  93. u32 *bcsr;
  94. np = of_find_node_by_type(NULL, "memory");
  95. if (!np) {
  96. printk(KERN_INFO "No memory node in device tree\n");
  97. return;
  98. }
  99. if (of_address_to_resource(np, 1, &r)) {
  100. printk(KERN_INFO "No memory reg property [1] in devicetree\n");
  101. return;
  102. }
  103. of_node_put(np);
  104. bcsr = ioremap(r.start + 4, sizeof(u32));
  105. io = &immap->im_ioport;
  106. /* Enable the PHY */
  107. clrbits32(bcsr, BCSR1_FETHIEN);
  108. setbits32(bcsr, BCSR1_FETH_RST);
  109. /* FCC1 pins are on port A/C. */
  110. /* Configure port A and C pins for FCC1 Ethernet. */
  111. tempval = in_be32(&io->iop_pdira);
  112. tempval &= ~PA1_DIRA0;
  113. tempval |= PA1_DIRA1;
  114. out_be32(&io->iop_pdira, tempval);
  115. tempval = in_be32(&io->iop_psora);
  116. tempval &= ~PA1_PSORA0;
  117. tempval |= PA1_PSORA1;
  118. out_be32(&io->iop_psora, tempval);
  119. setbits32(&io->iop_ppara, PA1_DIRA0 | PA1_DIRA1);
  120. /* Alter clocks */
  121. tempval = PC_CLK(fpi->clk_tx - 8) | PC_CLK(fpi->clk_rx - 8);
  122. clrbits32(&io->iop_psorc, tempval);
  123. clrbits32(&io->iop_pdirc, tempval);
  124. setbits32(&io->iop_pparc, tempval);
  125. cpm2_clk_setup(CPM_CLK_FCC1, fpi->clk_rx, CPM_CLK_RX);
  126. cpm2_clk_setup(CPM_CLK_FCC1, fpi->clk_tx, CPM_CLK_TX);
  127. iounmap(bcsr);
  128. iounmap(immap);
  129. }
  130. static void init_fcc2_ioports(struct fs_platform_info *fpi)
  131. {
  132. cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
  133. struct device_node *np;
  134. struct resource r;
  135. u32 *bcsr;
  136. struct io_port *io;
  137. u32 tempval;
  138. np = of_find_node_by_type(NULL, "memory");
  139. if (!np) {
  140. printk(KERN_INFO "No memory node in device tree\n");
  141. return;
  142. }
  143. if (of_address_to_resource(np, 1, &r)) {
  144. printk(KERN_INFO "No memory reg property [1] in devicetree\n");
  145. return;
  146. }
  147. of_node_put(np);
  148. io = &immap->im_ioport;
  149. bcsr = ioremap(r.start + 12, sizeof(u32));
  150. /* Enable the PHY */
  151. clrbits32(bcsr, BCSR3_FETHIEN2);
  152. setbits32(bcsr, BCSR3_FETH2_RST);
  153. /* FCC2 are port B/C. */
  154. /* Configure port A and C pins for FCC2 Ethernet. */
  155. tempval = in_be32(&io->iop_pdirb);
  156. tempval &= ~PB2_DIRB0;
  157. tempval |= PB2_DIRB1;
  158. out_be32(&io->iop_pdirb, tempval);
  159. tempval = in_be32(&io->iop_psorb);
  160. tempval &= ~PB2_PSORB0;
  161. tempval |= PB2_PSORB1;
  162. out_be32(&io->iop_psorb, tempval);
  163. setbits32(&io->iop_pparb, PB2_DIRB0 | PB2_DIRB1);
  164. tempval = PC_CLK(fpi->clk_tx - 8) | PC_CLK(fpi->clk_rx - 8);
  165. /* Alter clocks */
  166. clrbits32(&io->iop_psorc, tempval);
  167. clrbits32(&io->iop_pdirc, tempval);
  168. setbits32(&io->iop_pparc, tempval);
  169. cpm2_clk_setup(CPM_CLK_FCC2, fpi->clk_rx, CPM_CLK_RX);
  170. cpm2_clk_setup(CPM_CLK_FCC2, fpi->clk_tx, CPM_CLK_TX);
  171. iounmap(bcsr);
  172. iounmap(immap);
  173. }
  174. void init_fcc_ioports(struct fs_platform_info *fpi)
  175. {
  176. int fcc_no = fs_get_fcc_index(fpi->fs_no);
  177. switch (fcc_no) {
  178. case 0:
  179. init_fcc1_ioports(fpi);
  180. break;
  181. case 1:
  182. init_fcc2_ioports(fpi);
  183. break;
  184. default:
  185. printk(KERN_ERR "init_fcc_ioports: invalid FCC number\n");
  186. return;
  187. }
  188. }
  189. static void init_scc1_uart_ioports(struct fs_uart_platform_info *data)
  190. {
  191. cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
  192. /* SCC1 is only on port D */
  193. setbits32(&immap->im_ioport.iop_ppard, 0x00000003);
  194. clrbits32(&immap->im_ioport.iop_psord, 0x00000001);
  195. setbits32(&immap->im_ioport.iop_psord, 0x00000002);
  196. clrbits32(&immap->im_ioport.iop_pdird, 0x00000001);
  197. setbits32(&immap->im_ioport.iop_pdird, 0x00000002);
  198. clrbits32(&immap->im_cpmux.cmx_scr, (0x00000007 << (4 - data->clk_tx)));
  199. clrbits32(&immap->im_cpmux.cmx_scr, (0x00000038 << (4 - data->clk_rx)));
  200. setbits32(&immap->im_cpmux.cmx_scr,
  201. ((data->clk_tx - 1) << (4 - data->clk_tx)));
  202. setbits32(&immap->im_cpmux.cmx_scr,
  203. ((data->clk_rx - 1) << (4 - data->clk_rx)));
  204. iounmap(immap);
  205. }
  206. static void init_scc4_uart_ioports(struct fs_uart_platform_info *data)
  207. {
  208. cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
  209. setbits32(&immap->im_ioport.iop_ppard, 0x00000600);
  210. clrbits32(&immap->im_ioport.iop_psord, 0x00000600);
  211. clrbits32(&immap->im_ioport.iop_pdird, 0x00000200);
  212. setbits32(&immap->im_ioport.iop_pdird, 0x00000400);
  213. clrbits32(&immap->im_cpmux.cmx_scr, (0x00000007 << (4 - data->clk_tx)));
  214. clrbits32(&immap->im_cpmux.cmx_scr, (0x00000038 << (4 - data->clk_rx)));
  215. setbits32(&immap->im_cpmux.cmx_scr,
  216. ((data->clk_tx - 1) << (4 - data->clk_tx)));
  217. setbits32(&immap->im_cpmux.cmx_scr,
  218. ((data->clk_rx - 1) << (4 - data->clk_rx)));
  219. iounmap(immap);
  220. }
  221. void init_scc_ioports(struct fs_uart_platform_info *data)
  222. {
  223. int scc_no = fs_get_scc_index(data->fs_no);
  224. switch (scc_no) {
  225. case 0:
  226. init_scc1_uart_ioports(data);
  227. data->brg = data->clk_rx;
  228. break;
  229. case 3:
  230. init_scc4_uart_ioports(data);
  231. data->brg = data->clk_rx;
  232. break;
  233. default:
  234. printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
  235. return;
  236. }
  237. }
  238. void __init m82xx_board_setup(void)
  239. {
  240. cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
  241. struct device_node *np;
  242. struct resource r;
  243. u32 *bcsr;
  244. np = of_find_node_by_type(NULL, "memory");
  245. if (!np) {
  246. printk(KERN_INFO "No memory node in device tree\n");
  247. return;
  248. }
  249. if (of_address_to_resource(np, 1, &r)) {
  250. printk(KERN_INFO "No memory reg property [1] in devicetree\n");
  251. return;
  252. }
  253. of_node_put(np);
  254. bcsr = ioremap(r.start + 4, sizeof(u32));
  255. /* Enable the 2nd UART port */
  256. clrbits32(bcsr, BCSR1_RS232_EN2);
  257. #ifdef CONFIG_SERIAL_CPM_SCC1
  258. clrbits32((u32 *) & immap->im_scc[0].scc_sccm,
  259. UART_SCCM_TX | UART_SCCM_RX);
  260. clrbits32((u32 *) & immap->im_scc[0].scc_gsmrl,
  261. SCC_GSMRL_ENR | SCC_GSMRL_ENT);
  262. #endif
  263. #ifdef CONFIG_SERIAL_CPM_SCC2
  264. clrbits32((u32 *) & immap->im_scc[1].scc_sccm,
  265. UART_SCCM_TX | UART_SCCM_RX);
  266. clrbits32((u32 *) & immap->im_scc[1].scc_gsmrl,
  267. SCC_GSMRL_ENR | SCC_GSMRL_ENT);
  268. #endif
  269. #ifdef CONFIG_SERIAL_CPM_SCC3
  270. clrbits32((u32 *) & immap->im_scc[2].scc_sccm,
  271. UART_SCCM_TX | UART_SCCM_RX);
  272. clrbits32((u32 *) & immap->im_scc[2].scc_gsmrl,
  273. SCC_GSMRL_ENR | SCC_GSMRL_ENT);
  274. #endif
  275. #ifdef CONFIG_SERIAL_CPM_SCC4
  276. clrbits32((u32 *) & immap->im_scc[3].scc_sccm,
  277. UART_SCCM_TX | UART_SCCM_RX);
  278. clrbits32((u32 *) & immap->im_scc[3].scc_gsmrl,
  279. SCC_GSMRL_ENR | SCC_GSMRL_ENT);
  280. #endif
  281. iounmap(bcsr);
  282. iounmap(immap);
  283. }
  284. #ifdef CONFIG_PCI
  285. static void m82xx_pci_mask_irq(unsigned int irq)
  286. {
  287. int bit = irq - pci_int_base;
  288. *pci_regs.pci_int_mask_reg |= (1 << (31 - bit));
  289. return;
  290. }
  291. static void m82xx_pci_unmask_irq(unsigned int irq)
  292. {
  293. int bit = irq - pci_int_base;
  294. *pci_regs.pci_int_mask_reg &= ~(1 << (31 - bit));
  295. return;
  296. }
  297. static void m82xx_pci_mask_and_ack(unsigned int irq)
  298. {
  299. int bit = irq - pci_int_base;
  300. *pci_regs.pci_int_mask_reg |= (1 << (31 - bit));
  301. return;
  302. }
  303. static void m82xx_pci_end_irq(unsigned int irq)
  304. {
  305. int bit = irq - pci_int_base;
  306. *pci_regs.pci_int_mask_reg &= ~(1 << (31 - bit));
  307. return;
  308. }
  309. struct hw_interrupt_type m82xx_pci_ic = {
  310. .typename = "MPC82xx ADS PCI",
  311. .name = "MPC82xx ADS PCI",
  312. .enable = m82xx_pci_unmask_irq,
  313. .disable = m82xx_pci_mask_irq,
  314. .ack = m82xx_pci_mask_and_ack,
  315. .end = m82xx_pci_end_irq,
  316. .mask = m82xx_pci_mask_irq,
  317. .mask_ack = m82xx_pci_mask_and_ack,
  318. .unmask = m82xx_pci_unmask_irq,
  319. .eoi = m82xx_pci_end_irq,
  320. };
  321. static void
  322. m82xx_pci_irq_demux(unsigned int irq, struct irq_desc *desc)
  323. {
  324. unsigned long stat, mask, pend;
  325. int bit;
  326. for (;;) {
  327. stat = *pci_regs.pci_int_stat_reg;
  328. mask = *pci_regs.pci_int_mask_reg;
  329. pend = stat & ~mask & 0xf0000000;
  330. if (!pend)
  331. break;
  332. for (bit = 0; pend != 0; ++bit, pend <<= 1) {
  333. if (pend & 0x80000000)
  334. __do_IRQ(pci_int_base + bit);
  335. }
  336. }
  337. }
  338. static int pci_pic_host_map(struct irq_host *h, unsigned int virq,
  339. irq_hw_number_t hw)
  340. {
  341. get_irq_desc(virq)->status |= IRQ_LEVEL;
  342. set_irq_chip(virq, &m82xx_pci_ic);
  343. return 0;
  344. }
  345. static void pci_host_unmap(struct irq_host *h, unsigned int virq)
  346. {
  347. /* remove chip and handler */
  348. set_irq_chip(virq, NULL);
  349. }
  350. static struct irq_host_ops pci_pic_host_ops = {
  351. .map = pci_pic_host_map,
  352. .unmap = pci_host_unmap,
  353. };
  354. void m82xx_pci_init_irq(void)
  355. {
  356. int irq;
  357. cpm2_map_t *immap;
  358. struct device_node *np;
  359. struct resource r;
  360. const u32 *regs;
  361. unsigned int size;
  362. const u32 *irq_map;
  363. int i;
  364. unsigned int irq_max, irq_min;
  365. if ((np = of_find_node_by_type(NULL, "soc")) == NULL) {
  366. printk(KERN_INFO "No SOC node in device tree\n");
  367. return;
  368. }
  369. memset(&r, 0, sizeof(r));
  370. if (of_address_to_resource(np, 0, &r)) {
  371. printk(KERN_INFO "No SOC reg property in device tree\n");
  372. return;
  373. }
  374. immap = ioremap(r.start, sizeof(*immap));
  375. of_node_put(np);
  376. /* install the demultiplexer for the PCI cascade interrupt */
  377. np = of_find_node_by_type(NULL, "pci");
  378. if (!np) {
  379. printk(KERN_INFO "No pci node on device tree\n");
  380. iounmap(immap);
  381. return;
  382. }
  383. irq_map = of_get_property(np, "interrupt-map", &size);
  384. if ((!irq_map) || (size <= 7)) {
  385. printk(KERN_INFO "No interrupt-map property of pci node\n");
  386. iounmap(immap);
  387. return;
  388. }
  389. size /= sizeof(irq_map[0]);
  390. for (i = 0, irq_max = 0, irq_min = 512; i < size; i += 7, irq_map += 7) {
  391. if (irq_map[5] < irq_min)
  392. irq_min = irq_map[5];
  393. if (irq_map[5] > irq_max)
  394. irq_max = irq_map[5];
  395. }
  396. pci_int_base = irq_min;
  397. irq = irq_of_parse_and_map(np, 0);
  398. set_irq_chained_handler(irq, m82xx_pci_irq_demux);
  399. of_node_put(np);
  400. np = of_find_node_by_type(NULL, "pci-pic");
  401. if (!np) {
  402. printk(KERN_INFO "No pci pic node on device tree\n");
  403. iounmap(immap);
  404. return;
  405. }
  406. /* PCI interrupt controller registers: status and mask */
  407. regs = of_get_property(np, "reg", &size);
  408. if ((!regs) || (size <= 2)) {
  409. printk(KERN_INFO "No reg property in pci pic node\n");
  410. iounmap(immap);
  411. return;
  412. }
  413. pci_regs.pci_int_stat_reg =
  414. ioremap(regs[0], sizeof(*pci_regs.pci_int_stat_reg));
  415. pci_regs.pci_int_mask_reg =
  416. ioremap(regs[1], sizeof(*pci_regs.pci_int_mask_reg));
  417. /* configure chip select for PCI interrupt controller */
  418. immap->im_memctl.memc_br3 = regs[0] | 0x00001801;
  419. immap->im_memctl.memc_or3 = 0xffff8010;
  420. /* make PCI IRQ level sensitive */
  421. immap->im_intctl.ic_siexr &= ~(1 << (14 - (irq - SIU_INT_IRQ1)));
  422. /* mask all PCI interrupts */
  423. *pci_regs.pci_int_mask_reg |= 0xfff00000;
  424. iounmap(immap);
  425. pci_pic_host =
  426. irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, irq_max - irq_min + 1,
  427. &pci_pic_host_ops, irq_max + 1);
  428. return;
  429. }
  430. static int m82xx_pci_exclude_device(struct pci_controller *hose,
  431. u_char bus, u_char devfn)
  432. {
  433. if (bus == 0 && PCI_SLOT(devfn) == 0)
  434. return PCIBIOS_DEVICE_NOT_FOUND;
  435. else
  436. return PCIBIOS_SUCCESSFUL;
  437. }
  438. static void __init mpc82xx_add_bridge(struct device_node *np)
  439. {
  440. int len;
  441. struct pci_controller *hose;
  442. struct resource r;
  443. const int *bus_range;
  444. const uint *ptr;
  445. memset(&r, 0, sizeof(r));
  446. if (of_address_to_resource(np, 0, &r)) {
  447. printk(KERN_INFO "No PCI reg property in device tree\n");
  448. return;
  449. }
  450. if (!(ptr = of_get_property(np, "clock-frequency", NULL))) {
  451. printk(KERN_INFO "No clock-frequency property in PCI node");
  452. return;
  453. }
  454. pci_clk_frq = *ptr;
  455. of_node_put(np);
  456. bus_range = of_get_property(np, "bus-range", &len);
  457. if (bus_range == NULL || len < 2 * sizeof(int)) {
  458. printk(KERN_WARNING "Can't get bus-range for %s, assume"
  459. " bus 0\n", np->full_name);
  460. }
  461. pci_assign_all_buses = 1;
  462. hose = pcibios_alloc_controller(np);
  463. if (!hose)
  464. return;
  465. hose->first_busno = bus_range ? bus_range[0] : 0;
  466. hose->last_busno = bus_range ? bus_range[1] : 0xff;
  467. setup_indirect_pci(hose,
  468. r.start + offsetof(pci_cpm2_t, pci_cfg_addr),
  469. r.start + offsetof(pci_cpm2_t, pci_cfg_data),
  470. 0);
  471. pci_process_bridge_OF_ranges(hose, np, 1);
  472. }
  473. #endif
  474. /*
  475. * Setup the architecture
  476. */
  477. static void __init mpc8272_ads_setup_arch(void)
  478. {
  479. #ifdef CONFIG_PCI
  480. struct device_node *np;
  481. #endif
  482. if (ppc_md.progress)
  483. ppc_md.progress("mpc8272_ads_setup_arch()", 0);
  484. cpm2_reset();
  485. /* Map I/O region to a 256MB BAT */
  486. m82xx_board_setup();
  487. #ifdef CONFIG_PCI
  488. ppc_md.pci_exclude_device = m82xx_pci_exclude_device;
  489. for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
  490. mpc82xx_add_bridge(np);
  491. of_node_put(np);
  492. #endif
  493. #ifdef CONFIG_ROOT_NFS
  494. ROOT_DEV = Root_NFS;
  495. #else
  496. ROOT_DEV = Root_HDA1;
  497. #endif
  498. if (ppc_md.progress)
  499. ppc_md.progress("mpc8272_ads_setup_arch(), finish", 0);
  500. }
  501. /*
  502. * Called very early, device-tree isn't unflattened
  503. */
  504. static int __init mpc8272_ads_probe(void)
  505. {
  506. /* We always match for now, eventually we should look at
  507. * the flat dev tree to ensure this is the board we are
  508. * supposed to run on
  509. */
  510. return 1;
  511. }
  512. #define RMR_CSRE 0x00000001
  513. static void m82xx_restart(char *cmd)
  514. {
  515. __volatile__ unsigned char dummy;
  516. local_irq_disable();
  517. ((cpm2_map_t *) cpm2_immr)->im_clkrst.car_rmr |= RMR_CSRE;
  518. /* Clear the ME,EE,IR & DR bits in MSR to cause checkstop */
  519. mtmsr(mfmsr() & ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR));
  520. dummy = ((cpm2_map_t *) cpm2_immr)->im_clkrst.res[0];
  521. printk("Restart failed\n");
  522. while (1) ;
  523. }
  524. define_machine(mpc8272_ads)
  525. {
  526. .name = "MPC8272 ADS",
  527. .probe = mpc8272_ads_probe,
  528. .setup_arch = mpc8272_ads_setup_arch,
  529. .init_IRQ = mpc8272_ads_pic_init,
  530. .get_irq = cpm2_get_irq,
  531. .calibrate_decr = generic_calibrate_decr,
  532. .restart = m82xx_restart,
  533. };