chestnut.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. /*
  2. * Board setup routines for IBM Chestnut
  3. *
  4. * Author: <source@mvista.com>
  5. *
  6. * <2004> (c) MontaVista Software, Inc. This file is licensed under
  7. * the terms of the GNU General Public License version 2. This program
  8. * is licensed "as is" without any warranty of any kind, whether express
  9. * or implied.
  10. */
  11. #include <linux/stddef.h>
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/errno.h>
  15. #include <linux/reboot.h>
  16. #include <linux/kdev_t.h>
  17. #include <linux/major.h>
  18. #include <linux/blkdev.h>
  19. #include <linux/console.h>
  20. #include <linux/root_dev.h>
  21. #include <linux/initrd.h>
  22. #include <linux/delay.h>
  23. #include <linux/seq_file.h>
  24. #include <linux/serial.h>
  25. #include <linux/serial_core.h>
  26. #include <linux/serial_8250.h>
  27. #include <linux/mtd/physmap.h>
  28. #include <asm/system.h>
  29. #include <asm/pgtable.h>
  30. #include <asm/page.h>
  31. #include <asm/time.h>
  32. #include <asm/dma.h>
  33. #include <asm/io.h>
  34. #include <asm/hw_irq.h>
  35. #include <asm/machdep.h>
  36. #include <asm/kgdb.h>
  37. #include <asm/bootinfo.h>
  38. #include <asm/mv64x60.h>
  39. #include <platforms/chestnut.h>
  40. static void __iomem *sram_base; /* Virtual addr of Internal SRAM */
  41. static void __iomem *cpld_base; /* Virtual addr of CPLD Regs */
  42. static mv64x60_handle_t bh;
  43. extern void gen550_progress(char *, unsigned short);
  44. extern void gen550_init(int, struct uart_port *);
  45. extern void mv64360_pcibios_fixup(mv64x60_handle_t *bh);
  46. #define CHESTNUT_PRESERVE_MASK (BIT(MV64x60_CPU2DEV_0_WIN) | \
  47. BIT(MV64x60_CPU2DEV_1_WIN) | \
  48. BIT(MV64x60_CPU2DEV_2_WIN) | \
  49. BIT(MV64x60_CPU2DEV_3_WIN) | \
  50. BIT(MV64x60_CPU2BOOT_WIN))
  51. /**************************************************************************
  52. * FUNCTION: chestnut_calibrate_decr
  53. *
  54. * DESCRIPTION: initialize decrementer interrupt frequency (used as system
  55. * timer)
  56. *
  57. ****/
  58. static void __init
  59. chestnut_calibrate_decr(void)
  60. {
  61. ulong freq;
  62. freq = CHESTNUT_BUS_SPEED / 4;
  63. printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
  64. freq/1000000, freq%1000000);
  65. tb_ticks_per_jiffy = freq / HZ;
  66. tb_to_us = mulhwu_scale_factor(freq, 1000000);
  67. }
  68. static int
  69. chestnut_show_cpuinfo(struct seq_file *m)
  70. {
  71. seq_printf(m, "vendor\t\t: IBM\n");
  72. seq_printf(m, "machine\t\t: 750FX/GX Eval Board (Chestnut/Buckeye)\n");
  73. return 0;
  74. }
  75. /**************************************************************************
  76. * FUNCTION: chestnut_find_end_of_memory
  77. *
  78. * DESCRIPTION: ppc_md memory size callback
  79. *
  80. ****/
  81. unsigned long __init
  82. chestnut_find_end_of_memory(void)
  83. {
  84. static int mem_size = 0;
  85. if (mem_size == 0) {
  86. mem_size = mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE,
  87. MV64x60_TYPE_MV64460);
  88. }
  89. return mem_size;
  90. }
  91. #if defined(CONFIG_SERIAL_8250)
  92. static void __init
  93. chestnut_early_serial_map(void)
  94. {
  95. struct uart_port port;
  96. /* Setup serial port access */
  97. memset(&port, 0, sizeof(port));
  98. port.uartclk = BASE_BAUD * 16;
  99. port.irq = UART0_INT;
  100. port.flags = STD_COM_FLAGS | UPF_IOREMAP;
  101. port.iotype = UPIO_MEM;
  102. port.mapbase = CHESTNUT_UART0_IO_BASE;
  103. port.regshift = 0;
  104. if (early_serial_setup(&port) != 0)
  105. printk("Early serial init of port 0 failed\n");
  106. /* Assume early_serial_setup() doesn't modify serial_req */
  107. port.line = 1;
  108. port.irq = UART1_INT;
  109. port.mapbase = CHESTNUT_UART1_IO_BASE;
  110. if (early_serial_setup(&port) != 0)
  111. printk("Early serial init of port 1 failed\n");
  112. }
  113. #endif
  114. /**************************************************************************
  115. * FUNCTION: chestnut_map_irq
  116. *
  117. * DESCRIPTION: 0 return since PCI IRQs not needed
  118. *
  119. ****/
  120. static int __init
  121. chestnut_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
  122. {
  123. static char pci_irq_table[][4] = {
  124. {CHESTNUT_PCI_SLOT0_IRQ, CHESTNUT_PCI_SLOT0_IRQ,
  125. CHESTNUT_PCI_SLOT0_IRQ, CHESTNUT_PCI_SLOT0_IRQ},
  126. {CHESTNUT_PCI_SLOT1_IRQ, CHESTNUT_PCI_SLOT1_IRQ,
  127. CHESTNUT_PCI_SLOT1_IRQ, CHESTNUT_PCI_SLOT1_IRQ},
  128. {CHESTNUT_PCI_SLOT2_IRQ, CHESTNUT_PCI_SLOT2_IRQ,
  129. CHESTNUT_PCI_SLOT2_IRQ, CHESTNUT_PCI_SLOT2_IRQ},
  130. {CHESTNUT_PCI_SLOT3_IRQ, CHESTNUT_PCI_SLOT3_IRQ,
  131. CHESTNUT_PCI_SLOT3_IRQ, CHESTNUT_PCI_SLOT3_IRQ},
  132. };
  133. const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
  134. return PCI_IRQ_TABLE_LOOKUP;
  135. }
  136. /**************************************************************************
  137. * FUNCTION: chestnut_setup_bridge
  138. *
  139. * DESCRIPTION: initalize board-specific settings on the MV64360
  140. *
  141. ****/
  142. static void __init
  143. chestnut_setup_bridge(void)
  144. {
  145. struct mv64x60_setup_info si;
  146. int i;
  147. if ( ppc_md.progress )
  148. ppc_md.progress("chestnut_setup_bridge: enter", 0);
  149. memset(&si, 0, sizeof(si));
  150. si.phys_reg_base = CONFIG_MV64X60_NEW_BASE;
  151. /* setup only PCI bus 0 (bus 1 not used) */
  152. si.pci_0.enable_bus = 1;
  153. si.pci_0.pci_io.cpu_base = CHESTNUT_PCI0_IO_PROC_ADDR;
  154. si.pci_0.pci_io.pci_base_hi = 0;
  155. si.pci_0.pci_io.pci_base_lo = CHESTNUT_PCI0_IO_PCI_ADDR;
  156. si.pci_0.pci_io.size = CHESTNUT_PCI0_IO_SIZE;
  157. si.pci_0.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE; /* no swapping */
  158. si.pci_0.pci_mem[0].cpu_base = CHESTNUT_PCI0_MEM_PROC_ADDR;
  159. si.pci_0.pci_mem[0].pci_base_hi = CHESTNUT_PCI0_MEM_PCI_HI_ADDR;
  160. si.pci_0.pci_mem[0].pci_base_lo = CHESTNUT_PCI0_MEM_PCI_LO_ADDR;
  161. si.pci_0.pci_mem[0].size = CHESTNUT_PCI0_MEM_SIZE;
  162. si.pci_0.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE; /* no swapping */
  163. si.pci_0.pci_cmd_bits = 0;
  164. si.pci_0.latency_timer = 0x80;
  165. for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++) {
  166. #if defined(CONFIG_NOT_COHERENT_CACHE)
  167. si.cpu_prot_options[i] = 0;
  168. si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE;
  169. si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE;
  170. si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
  171. si.pci_1.acc_cntl_options[i] =
  172. MV64360_PCI_ACC_CNTL_SNOOP_NONE |
  173. MV64360_PCI_ACC_CNTL_SWAP_NONE |
  174. MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
  175. MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
  176. #else
  177. si.cpu_prot_options[i] = 0;
  178. si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE; /* errata */
  179. si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE; /* errata */
  180. si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE; /* errata */
  181. si.pci_1.acc_cntl_options[i] =
  182. MV64360_PCI_ACC_CNTL_SNOOP_WB |
  183. MV64360_PCI_ACC_CNTL_SWAP_NONE |
  184. MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
  185. MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES;
  186. #endif
  187. }
  188. /* Lookup host bridge - on CPU 0 - no SMP support */
  189. if (mv64x60_init(&bh, &si)) {
  190. printk("\n\nPCI Bridge initialization failed!\n");
  191. }
  192. pci_dram_offset = 0;
  193. ppc_md.pci_swizzle = common_swizzle;
  194. ppc_md.pci_map_irq = chestnut_map_irq;
  195. ppc_md.pci_exclude_device = mv64x60_pci_exclude_device;
  196. mv64x60_set_bus(&bh, 0, 0);
  197. bh.hose_a->first_busno = 0;
  198. bh.hose_a->last_busno = 0xff;
  199. bh.hose_a->last_busno = pciauto_bus_scan(bh.hose_a, 0);
  200. }
  201. void __init
  202. chestnut_setup_peripherals(void)
  203. {
  204. mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
  205. CHESTNUT_BOOT_8BIT_BASE, CHESTNUT_BOOT_8BIT_SIZE, 0);
  206. bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
  207. mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN,
  208. CHESTNUT_32BIT_BASE, CHESTNUT_32BIT_SIZE, 0);
  209. bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN);
  210. mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN,
  211. CHESTNUT_CPLD_BASE, CHESTNUT_CPLD_SIZE, 0);
  212. bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
  213. cpld_base = ioremap(CHESTNUT_CPLD_BASE, CHESTNUT_CPLD_SIZE);
  214. mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN,
  215. CHESTNUT_UART_BASE, CHESTNUT_UART_SIZE, 0);
  216. bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN);
  217. mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_3_WIN,
  218. CHESTNUT_FRAM_BASE, CHESTNUT_FRAM_SIZE, 0);
  219. bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_3_WIN);
  220. mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
  221. CHESTNUT_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0);
  222. bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
  223. #ifdef CONFIG_NOT_COHERENT_CACHE
  224. mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b0);
  225. #else
  226. mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b2);
  227. #endif
  228. sram_base = ioremap(CHESTNUT_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE);
  229. memset(sram_base, 0, MV64360_SRAM_SIZE);
  230. /*
  231. * Configure MPP pins for PCI DMA
  232. *
  233. * PCI Slot GNT pin REQ pin
  234. * 0 MPP16 MPP17
  235. * 1 MPP18 MPP19
  236. * 2 MPP20 MPP21
  237. * 3 MPP22 MPP23
  238. */
  239. mv64x60_write(&bh, MV64x60_MPP_CNTL_2,
  240. (0x1 << 0) | /* MPPSel16 PCI0_GNT[0] */
  241. (0x1 << 4) | /* MPPSel17 PCI0_REQ[0] */
  242. (0x1 << 8) | /* MPPSel18 PCI0_GNT[1] */
  243. (0x1 << 12) | /* MPPSel19 PCI0_REQ[1] */
  244. (0x1 << 16) | /* MPPSel20 PCI0_GNT[2] */
  245. (0x1 << 20) | /* MPPSel21 PCI0_REQ[2] */
  246. (0x1 << 24) | /* MPPSel22 PCI0_GNT[3] */
  247. (0x1 << 28)); /* MPPSel23 PCI0_REQ[3] */
  248. /*
  249. * Set unused MPP pins for output, as per schematic note
  250. *
  251. * Unused Pins: MPP01, MPP02, MPP04, MPP05, MPP06
  252. * MPP09, MPP10, MPP13, MPP14, MPP15
  253. */
  254. mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_0,
  255. (0xf << 4) | /* MPPSel01 GPIO[1] */
  256. (0xf << 8) | /* MPPSel02 GPIO[2] */
  257. (0xf << 16) | /* MPPSel04 GPIO[4] */
  258. (0xf << 20) | /* MPPSel05 GPIO[5] */
  259. (0xf << 24)); /* MPPSel06 GPIO[6] */
  260. mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1,
  261. (0xf << 4) | /* MPPSel09 GPIO[9] */
  262. (0xf << 8) | /* MPPSel10 GPIO[10] */
  263. (0xf << 20) | /* MPPSel13 GPIO[13] */
  264. (0xf << 24) | /* MPPSel14 GPIO[14] */
  265. (0xf << 28)); /* MPPSel15 GPIO[15] */
  266. mv64x60_set_bits(&bh, MV64x60_GPP_IO_CNTL, /* Output */
  267. BIT(1) | BIT(2) | BIT(4) | BIT(5) | BIT(6) |
  268. BIT(9) | BIT(10) | BIT(13) | BIT(14) | BIT(15));
  269. /*
  270. * Configure the following MPP pins to indicate a level
  271. * triggered interrupt
  272. *
  273. * MPP24 - Board Reset (just map the MPP & GPP for chestnut_reset)
  274. * MPP25 - UART A (high)
  275. * MPP26 - UART B (high)
  276. * MPP28 - PCI Slot 3 (low)
  277. * MPP29 - PCI Slot 2 (low)
  278. * MPP30 - PCI Slot 1 (low)
  279. * MPP31 - PCI Slot 0 (low)
  280. */
  281. mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_3,
  282. BIT(3) | BIT(2) | BIT(1) | BIT(0) | /* MPP 24 */
  283. BIT(7) | BIT(6) | BIT(5) | BIT(4) | /* MPP 25 */
  284. BIT(11) | BIT(10) | BIT(9) | BIT(8) | /* MPP 26 */
  285. BIT(19) | BIT(18) | BIT(17) | BIT(16) | /* MPP 28 */
  286. BIT(23) | BIT(22) | BIT(21) | BIT(20) | /* MPP 29 */
  287. BIT(27) | BIT(26) | BIT(25) | BIT(24) | /* MPP 30 */
  288. BIT(31) | BIT(30) | BIT(29) | BIT(28)); /* MPP 31 */
  289. /*
  290. * Define GPP 25 (high), 26 (high), 28 (low), 29 (low), 30 (low),
  291. * 31 (low) interrupt polarity input signal and level triggered
  292. */
  293. mv64x60_clr_bits(&bh, MV64x60_GPP_LEVEL_CNTL, BIT(25) | BIT(26));
  294. mv64x60_set_bits(&bh, MV64x60_GPP_LEVEL_CNTL,
  295. BIT(28) | BIT(29) | BIT(30) | BIT(31));
  296. mv64x60_clr_bits(&bh, MV64x60_GPP_IO_CNTL,
  297. BIT(25) | BIT(26) | BIT(28) | BIT(29) | BIT(30) |
  298. BIT(31));
  299. /* Config GPP interrupt controller to respond to level trigger */
  300. mv64x60_set_bits(&bh, MV64360_COMM_ARBITER_CNTL, BIT(10));
  301. /*
  302. * Dismiss and then enable interrupt on GPP interrupt cause for CPU #0
  303. */
  304. mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE,
  305. ~(BIT(25) | BIT(26) | BIT(28) | BIT(29) | BIT(30) |
  306. BIT(31)));
  307. mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK,
  308. BIT(25) | BIT(26) | BIT(28) | BIT(29) | BIT(30) |
  309. BIT(31));
  310. /*
  311. * Dismiss and then enable interrupt on CPU #0 high cause register
  312. * BIT27 summarizes GPP interrupts 24-31
  313. */
  314. mv64x60_set_bits(&bh, MV64360_IC_CPU0_INTR_MASK_HI, BIT(27));
  315. if (ppc_md.progress)
  316. ppc_md.progress("chestnut_setup_bridge: exit", 0);
  317. }
  318. /**************************************************************************
  319. * FUNCTION: chestnut_setup_arch
  320. *
  321. * DESCRIPTION: ppc_md machine configuration callback
  322. *
  323. ****/
  324. static void __init
  325. chestnut_setup_arch(void)
  326. {
  327. if (ppc_md.progress)
  328. ppc_md.progress("chestnut_setup_arch: enter", 0);
  329. /* init to some ~sane value until calibrate_delay() runs */
  330. loops_per_jiffy = 50000000 / HZ;
  331. /* if the time base value is greater than bus freq/4 (the TB and
  332. * decrementer tick rate) + signed integer rollover value, we
  333. * can spend a fair amount of time waiting for the rollover to
  334. * happen. To get around this, initialize the time base register
  335. * to a "safe" value.
  336. */
  337. set_tb(0, 0);
  338. #ifdef CONFIG_BLK_DEV_INITRD
  339. if (initrd_start)
  340. ROOT_DEV = Root_RAM0;
  341. else
  342. #endif
  343. #ifdef CONFIG_ROOT_NFS
  344. ROOT_DEV = Root_NFS;
  345. #else
  346. ROOT_DEV = Root_SDA2;
  347. #endif
  348. /*
  349. * Set up the L2CR register.
  350. */
  351. _set_L2CR(_get_L2CR() | L2CR_L2E);
  352. chestnut_setup_bridge();
  353. chestnut_setup_peripherals();
  354. #ifdef CONFIG_DUMMY_CONSOLE
  355. conswitchp = &dummy_con;
  356. #endif
  357. #if defined(CONFIG_SERIAL_8250)
  358. chestnut_early_serial_map();
  359. #endif
  360. /* Identify the system */
  361. printk(KERN_INFO "System Identification: IBM 750FX/GX Eval Board\n");
  362. printk(KERN_INFO "IBM 750FX/GX port (C) 2004 MontaVista Software, Inc."
  363. " (source@mvista.com)\n");
  364. if (ppc_md.progress)
  365. ppc_md.progress("chestnut_setup_arch: exit", 0);
  366. }
  367. #ifdef CONFIG_MTD_PHYSMAP
  368. static struct mtd_partition ptbl;
  369. static int __init
  370. chestnut_setup_mtd(void)
  371. {
  372. memset(&ptbl, 0, sizeof(ptbl));
  373. ptbl.name = "User FS";
  374. ptbl.size = CHESTNUT_32BIT_SIZE;
  375. physmap_map.size = CHESTNUT_32BIT_SIZE;
  376. physmap_set_partitions(&ptbl, 1);
  377. return 0;
  378. }
  379. arch_initcall(chestnut_setup_mtd);
  380. #endif
  381. /**************************************************************************
  382. * FUNCTION: chestnut_restart
  383. *
  384. * DESCRIPTION: ppc_md machine reset callback
  385. * reset the board via the CPLD command register
  386. *
  387. ****/
  388. static void
  389. chestnut_restart(char *cmd)
  390. {
  391. volatile ulong i = 10000000;
  392. local_irq_disable();
  393. /*
  394. * Set CPLD Reg 3 bit 0 to 1 to allow MPP signals on reset to work
  395. *
  396. * MPP24 - board reset
  397. */
  398. writeb(0x1, cpld_base + 3);
  399. /* GPP pin tied to MPP earlier */
  400. mv64x60_set_bits(&bh, MV64x60_GPP_VALUE_SET, BIT(24));
  401. while (i-- > 0);
  402. panic("restart failed\n");
  403. }
  404. static void
  405. chestnut_halt(void)
  406. {
  407. local_irq_disable();
  408. for (;;);
  409. /* NOTREACHED */
  410. }
  411. static void
  412. chestnut_power_off(void)
  413. {
  414. chestnut_halt();
  415. /* NOTREACHED */
  416. }
  417. /**************************************************************************
  418. * FUNCTION: chestnut_map_io
  419. *
  420. * DESCRIPTION: configure fixed memory-mapped IO
  421. *
  422. ****/
  423. static void __init
  424. chestnut_map_io(void)
  425. {
  426. #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
  427. io_block_mapping(CHESTNUT_UART_BASE, CHESTNUT_UART_BASE, 0x100000,
  428. _PAGE_IO);
  429. #endif
  430. }
  431. /**************************************************************************
  432. * FUNCTION: chestnut_set_bat
  433. *
  434. * DESCRIPTION: configures a (temporary) bat mapping for early access to
  435. * device I/O
  436. *
  437. ****/
  438. static __inline__ void
  439. chestnut_set_bat(void)
  440. {
  441. mb();
  442. mtspr(SPRN_DBAT3U, 0xf0001ffe);
  443. mtspr(SPRN_DBAT3L, 0xf000002a);
  444. mb();
  445. }
  446. /**************************************************************************
  447. * FUNCTION: platform_init
  448. *
  449. * DESCRIPTION: main entry point for configuring board-specific machine
  450. * callbacks
  451. *
  452. ****/
  453. void __init
  454. platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  455. unsigned long r6, unsigned long r7)
  456. {
  457. parse_bootinfo(find_bootinfo());
  458. /* Copy the kernel command line arguments to a safe place. */
  459. if (r6) {
  460. *(char *) (r7 + KERNELBASE) = 0;
  461. strcpy(cmd_line, (char *) (r6 + KERNELBASE));
  462. }
  463. isa_mem_base = 0;
  464. ppc_md.setup_arch = chestnut_setup_arch;
  465. ppc_md.show_cpuinfo = chestnut_show_cpuinfo;
  466. ppc_md.init_IRQ = mv64360_init_irq;
  467. ppc_md.get_irq = mv64360_get_irq;
  468. ppc_md.init = NULL;
  469. ppc_md.find_end_of_memory = chestnut_find_end_of_memory;
  470. ppc_md.setup_io_mappings = chestnut_map_io;
  471. ppc_md.restart = chestnut_restart;
  472. ppc_md.power_off = chestnut_power_off;
  473. ppc_md.halt = chestnut_halt;
  474. ppc_md.time_init = NULL;
  475. ppc_md.set_rtc_time = NULL;
  476. ppc_md.get_rtc_time = NULL;
  477. ppc_md.calibrate_decr = chestnut_calibrate_decr;
  478. ppc_md.nvram_read_val = NULL;
  479. ppc_md.nvram_write_val = NULL;
  480. ppc_md.heartbeat = NULL;
  481. bh.p_base = CONFIG_MV64X60_NEW_BASE;
  482. chestnut_set_bat();
  483. #if defined(CONFIG_SERIAL_TEXT_DEBUG)
  484. ppc_md.progress = gen550_progress;
  485. #endif
  486. #if defined(CONFIG_KGDB)
  487. ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
  488. #endif
  489. if (ppc_md.progress)
  490. ppc_md.progress("chestnut_init(): exit", 0);
  491. }