chestnut.c 16 KB

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