chestnut.c 16 KB

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