aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/platforms/katana.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc/platforms/katana.c')
-rw-r--r--arch/ppc/platforms/katana.c253
1 files changed, 193 insertions, 60 deletions
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c
index 169dbf6534b9..2b53afae0e9c 100644
--- a/arch/ppc/platforms/katana.c
+++ b/arch/ppc/platforms/katana.c
@@ -33,6 +33,7 @@
33#include <linux/bootimg.h> 33#include <linux/bootimg.h>
34#endif 34#endif
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/unistd.h>
36#include <asm/page.h> 37#include <asm/page.h>
37#include <asm/time.h> 38#include <asm/time.h>
38#include <asm/smp.h> 39#include <asm/smp.h>
@@ -42,15 +43,14 @@
42#include <asm/mv64x60.h> 43#include <asm/mv64x60.h>
43#include <platforms/katana.h> 44#include <platforms/katana.h>
44 45
45static struct mv64x60_handle bh; 46static struct mv64x60_handle bh;
46static katana_id_t katana_id; 47static katana_id_t katana_id;
47static void __iomem *cpld_base; 48static void __iomem *cpld_base;
48static void __iomem *sram_base; 49static void __iomem *sram_base;
49 50static u32 katana_flash_size_0;
50static u32 katana_flash_size_0; 51static u32 katana_flash_size_1;
51static u32 katana_flash_size_1; 52static u32 katana_bus_frequency;
52 53static struct pci_controller katana_hose_a;
53static u32 katana_bus_frequency;
54 54
55unsigned char __res[sizeof(bd_t)]; 55unsigned char __res[sizeof(bd_t)];
56 56
@@ -71,8 +71,12 @@ katana_irq_lookup_750i(unsigned char idsel, unsigned char pin)
71 KATANA_PCI_INTA_IRQ_750i, KATANA_PCI_INTB_IRQ_750i }, 71 KATANA_PCI_INTA_IRQ_750i, KATANA_PCI_INTB_IRQ_750i },
72 /* IDSEL 6 (T8110) */ 72 /* IDSEL 6 (T8110) */
73 {KATANA_PCI_INTD_IRQ_750i, 0, 0, 0 }, 73 {KATANA_PCI_INTD_IRQ_750i, 0, 0, 0 },
74 /* IDSEL 7 (unused) */
75 {0, 0, 0, 0 },
76 /* IDSEL 8 (Intel 82544) (752i only but doesn't harm 750i) */
77 {KATANA_PCI_INTD_IRQ_750i, 0, 0, 0 },
74 }; 78 };
75 const long min_idsel = 4, max_idsel = 6, irqs_per_slot = 4; 79 const long min_idsel = 4, max_idsel = 8, irqs_per_slot = 4;
76 80
77 return PCI_IRQ_TABLE_LOOKUP; 81 return PCI_IRQ_TABLE_LOOKUP;
78} 82}
@@ -148,7 +152,7 @@ katana_get_proc_num(void)
148 save_exclude = mv64x60_pci_exclude_bridge; 152 save_exclude = mv64x60_pci_exclude_bridge;
149 mv64x60_pci_exclude_bridge = 0; 153 mv64x60_pci_exclude_bridge = 0;
150 154
151 early_read_config_word(bh.hose_a, 0, 155 early_read_config_word(bh.hose_b, 0,
152 PCI_DEVFN(0,0), PCI_DEVICE_ID, &val); 156 PCI_DEVFN(0,0), PCI_DEVICE_ID, &val);
153 157
154 mv64x60_pci_exclude_bridge = save_exclude; 158 mv64x60_pci_exclude_bridge = save_exclude;
@@ -191,7 +195,8 @@ katana_setup_bridge(void)
191 struct mv64x60_setup_info si; 195 struct mv64x60_setup_info si;
192 void __iomem *vaddr; 196 void __iomem *vaddr;
193 int i; 197 int i;
194 u16 val; 198 u32 v;
199 u16 val, type;
195 u8 save_exclude; 200 u8 save_exclude;
196 201
197 /* 202 /*
@@ -222,6 +227,20 @@ katana_setup_bridge(void)
222 PCI_DEVICE_ID, val); 227 PCI_DEVICE_ID, val);
223 } 228 }
224 229
230 /*
231 * While we're in here, set the hotswap register correctly.
232 * Turn off blue LED; mask ENUM#, clear insertion & extraction bits.
233 */
234 early_read_config_dword(&hose, 0, PCI_DEVFN(0, 0),
235 MV64360_PCICFG_CPCI_HOTSWAP, &v);
236 v &= ~(1<<19);
237 v |= ((1<<17) | (1<<22) | (1<<23));
238 early_write_config_dword(&hose, 0, PCI_DEVFN(0, 0),
239 MV64360_PCICFG_CPCI_HOTSWAP, v);
240
241 /* While we're at it, grab the bridge type for later */
242 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_DEVICE_ID, &type);
243
225 mv64x60_pci_exclude_bridge = save_exclude; 244 mv64x60_pci_exclude_bridge = save_exclude;
226 iounmap(vaddr); 245 iounmap(vaddr);
227 246
@@ -251,21 +270,23 @@ katana_setup_bridge(void)
251 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE; 270 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
252 271
253 si.pci_1.acc_cntl_options[i] = 272 si.pci_1.acc_cntl_options[i] =
254 MV64360_PCI_ACC_CNTL_SNOOP_NONE | 273 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
255 MV64360_PCI_ACC_CNTL_SWAP_NONE | 274 MV64360_PCI_ACC_CNTL_SWAP_NONE |
256 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES | 275 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
257 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES; 276 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
258#else 277#else
259 si.cpu_prot_options[i] = 0; 278 si.cpu_prot_options[i] = 0;
260 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE; /* errata */ 279 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_WB;
261 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE; /* errata */ 280 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_WB;
262 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE; /* errata */ 281 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_WB;
263 282
264 si.pci_1.acc_cntl_options[i] = 283 si.pci_1.acc_cntl_options[i] =
265 MV64360_PCI_ACC_CNTL_SNOOP_WB | 284 MV64360_PCI_ACC_CNTL_SNOOP_WB |
266 MV64360_PCI_ACC_CNTL_SWAP_NONE | 285 MV64360_PCI_ACC_CNTL_SWAP_NONE |
267 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES | 286 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
268 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES; 287 ((type == PCI_DEVICE_ID_MARVELL_MV64360) ?
288 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES :
289 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES);
269#endif 290#endif
270 } 291 }
271 292
@@ -281,12 +302,26 @@ katana_setup_bridge(void)
281 mv64x60_set_bus(&bh, 1, 0); 302 mv64x60_set_bus(&bh, 1, 0);
282 bh.hose_b->first_busno = 0; 303 bh.hose_b->first_busno = 0;
283 bh.hose_b->last_busno = 0xff; 304 bh.hose_b->last_busno = 0xff;
305
306 /*
307 * Need to access hotswap reg which is in the pci config area of the
308 * bridge's hose 0. Note that pcibios_alloc_controller() can't be used
309 * to alloc hose_a b/c that would make hose 0 known to the generic
310 * pci code which we don't want.
311 */
312 bh.hose_a = &katana_hose_a;
313 setup_indirect_pci_nomap(bh.hose_a,
314 bh.v_base + MV64x60_PCI0_CONFIG_ADDR,
315 bh.v_base + MV64x60_PCI0_CONFIG_DATA);
284} 316}
285 317
286/* Bridge & platform setup routines */ 318/* Bridge & platform setup routines */
287void __init 319void __init
288katana_intr_setup(void) 320katana_intr_setup(void)
289{ 321{
322 if (bh.type == MV64x60_TYPE_MV64460) /* As per instns from Marvell */
323 mv64x60_clr_bits(&bh, MV64x60_CPU_MASTER_CNTL, 1 << 15);
324
290 /* MPP 8, 9, and 10 */ 325 /* MPP 8, 9, and 10 */
291 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1, 0xfff); 326 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1, 0xfff);
292 327
@@ -309,9 +344,16 @@ katana_intr_setup(void)
309 /* Config GPP intr ctlr to respond to level trigger */ 344 /* Config GPP intr ctlr to respond to level trigger */
310 mv64x60_set_bits(&bh, MV64x60_COMM_ARBITER_CNTL, (1<<10)); 345 mv64x60_set_bits(&bh, MV64x60_COMM_ARBITER_CNTL, (1<<10));
311 346
312 /* Erranum FEr PCI-#8 */ 347 if (bh.type == MV64x60_TYPE_MV64360) {
313 mv64x60_clr_bits(&bh, MV64x60_PCI0_CMD, (1<<5) | (1<<9)); 348 /* Erratum FEr PCI-#9 */
314 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD, (1<<5) | (1<<9)); 349 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD,
350 (1<<4) | (1<<5) | (1<<6) | (1<<7));
351 mv64x60_set_bits(&bh, MV64x60_PCI1_CMD, (1<<8) | (1<<9));
352 } else {
353 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD, (1<<6) | (1<<7));
354 mv64x60_set_bits(&bh, MV64x60_PCI1_CMD,
355 (1<<4) | (1<<5) | (1<<8) | (1<<9));
356 }
315 357
316 /* 358 /*
317 * Dismiss and then enable interrupt on GPP interrupt cause 359 * Dismiss and then enable interrupt on GPP interrupt cause
@@ -473,17 +515,46 @@ katana_setup_arch(void)
473 ppc_md.progress("katana_setup_arch: exit", 0); 515 ppc_md.progress("katana_setup_arch: exit", 0);
474} 516}
475 517
518void
519katana_fixup_resources(struct pci_dev *dev)
520{
521 u16 v16;
522
523 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, L1_CACHE_LINE_SIZE>>2);
524
525 pci_read_config_word(dev, PCI_COMMAND, &v16);
526 v16 |= PCI_COMMAND_INVALIDATE | PCI_COMMAND_FAST_BACK;
527 pci_write_config_word(dev, PCI_COMMAND, v16);
528}
529
530static const unsigned int cpu_750xx[32] = { /* 750FX & 750GX */
531 0, 0, 2, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,/* 0-15*/
532 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0 /*16-31*/
533};
534
535static int
536katana_get_cpu_freq(void)
537{
538 unsigned long pll_cfg;
539
540 pll_cfg = (mfspr(SPRN_HID1) & 0xf8000000) >> 27;
541 return katana_bus_frequency * cpu_750xx[pll_cfg]/2;
542}
543
476/* Platform device data fixup routines. */ 544/* Platform device data fixup routines. */
477#if defined(CONFIG_SERIAL_MPSC) 545#if defined(CONFIG_SERIAL_MPSC)
478static void __init 546static void __init
479katana_fixup_mpsc_pdata(struct platform_device *pdev) 547katana_fixup_mpsc_pdata(struct platform_device *pdev)
480{ 548{
481 struct mpsc_pdata *pdata; 549 struct mpsc_pdata *pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
550 bd_t *bdp = (bd_t *)__res;
482 551
483 pdata = (struct mpsc_pdata *)pdev->dev.platform_data; 552 if (bdp->bi_baudrate)
553 pdata->default_baud = bdp->bi_baudrate;
554 else
555 pdata->default_baud = KATANA_DEFAULT_BAUD;
484 556
485 pdata->max_idle = 40; 557 pdata->max_idle = 40;
486 pdata->default_baud = KATANA_DEFAULT_BAUD;
487 pdata->brg_clk_src = KATANA_MPSC_CLK_SRC; 558 pdata->brg_clk_src = KATANA_MPSC_CLK_SRC;
488 /* 559 /*
489 * TCLK (not SysCLk) is routed to BRG, then to the MPSC. On most parts, 560 * TCLK (not SysCLk) is routed to BRG, then to the MPSC. On most parts,
@@ -513,6 +584,18 @@ katana_fixup_eth_pdata(struct platform_device *pdev)
513} 584}
514#endif 585#endif
515 586
587#if defined(CONFIG_SYSFS)
588static void __init
589katana_fixup_mv64xxx_pdata(struct platform_device *pdev)
590{
591 struct mv64xxx_pdata *pdata = (struct mv64xxx_pdata *)
592 pdev->dev.platform_data;
593
594 /* Katana supports the mv64xxx hotswap register */
595 pdata->hs_reg_valid = 1;
596}
597#endif
598
516static int __init 599static int __init
517katana_platform_notify(struct device *dev) 600katana_platform_notify(struct device *dev)
518{ 601{
@@ -529,6 +612,9 @@ katana_platform_notify(struct device *dev)
529 { MV643XX_ETH_NAME ".1", katana_fixup_eth_pdata }, 612 { MV643XX_ETH_NAME ".1", katana_fixup_eth_pdata },
530 { MV643XX_ETH_NAME ".2", katana_fixup_eth_pdata }, 613 { MV643XX_ETH_NAME ".2", katana_fixup_eth_pdata },
531#endif 614#endif
615#if defined(CONFIG_SYSFS)
616 { MV64XXX_DEV_NAME ".0", katana_fixup_mv64xxx_pdata },
617#endif
532 }; 618 };
533 struct platform_device *pdev; 619 struct platform_device *pdev;
534 int i; 620 int i;
@@ -536,8 +622,7 @@ katana_platform_notify(struct device *dev)
536 if (dev && dev->bus_id) 622 if (dev && dev->bus_id)
537 for (i=0; i<ARRAY_SIZE(dev_map); i++) 623 for (i=0; i<ARRAY_SIZE(dev_map); i++)
538 if (!strncmp(dev->bus_id, dev_map[i].bus_id, 624 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
539 BUS_ID_SIZE)) { 625 BUS_ID_SIZE)) {
540
541 pdev = container_of(dev, 626 pdev = container_of(dev,
542 struct platform_device, dev); 627 struct platform_device, dev);
543 dev_map[i].rtn(pdev); 628 dev_map[i].rtn(pdev);
@@ -578,8 +663,7 @@ katana_setup_mtd(void)
578 ptbl_entries = (size >= (64*MB)) ? 6 : 4; 663 ptbl_entries = (size >= (64*MB)) ? 6 : 4;
579 664
580 if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition), 665 if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition),
581 GFP_KERNEL)) == NULL) { 666 GFP_KERNEL)) == NULL) {
582
583 printk(KERN_WARNING "Can't alloc MTD partition table\n"); 667 printk(KERN_WARNING "Can't alloc MTD partition table\n");
584 return -ENOMEM; 668 return -ENOMEM;
585 } 669 }
@@ -611,7 +695,6 @@ katana_setup_mtd(void)
611 physmap_set_partitions(ptbl, ptbl_entries); 695 physmap_set_partitions(ptbl, ptbl_entries);
612 return 0; 696 return 0;
613} 697}
614
615arch_initcall(katana_setup_mtd); 698arch_initcall(katana_setup_mtd);
616#endif 699#endif
617 700
@@ -632,7 +715,22 @@ katana_halt(void)
632{ 715{
633 u8 v; 716 u8 v;
634 717
635 if (katana_id == KATANA_ID_752I) { 718 /* Turn on blue LED to indicate its okay to remove */
719 if (katana_id == KATANA_ID_750I) {
720 u32 v;
721 u8 save_exclude;
722
723 /* Set LOO bit in cPCI HotSwap reg of hose 0 to turn on LED. */
724 save_exclude = mv64x60_pci_exclude_bridge;
725 mv64x60_pci_exclude_bridge = 0;
726 early_read_config_dword(bh.hose_a, 0, PCI_DEVFN(0, 0),
727 MV64360_PCICFG_CPCI_HOTSWAP, &v);
728 v &= 0xff;
729 v |= (1 << 19);
730 early_write_config_dword(bh.hose_a, 0, PCI_DEVFN(0, 0),
731 MV64360_PCICFG_CPCI_HOTSWAP, v);
732 mv64x60_pci_exclude_bridge = save_exclude;
733 } else if (katana_id == KATANA_ID_752I) {
636 v = in_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF); 734 v = in_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF);
637 v |= HSL_PLD_HOT_SWAP_LED_BIT; 735 v |= HSL_PLD_HOT_SWAP_LED_BIT;
638 out_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF, v); 736 out_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF, v);
@@ -652,37 +750,65 @@ katana_power_off(void)
652static int 750static int
653katana_show_cpuinfo(struct seq_file *m) 751katana_show_cpuinfo(struct seq_file *m)
654{ 752{
753 char *s;
754
755 seq_printf(m, "cpu freq\t: %dMHz\n",
756 (katana_get_cpu_freq() + 500000) / 1000000);
757 seq_printf(m, "bus freq\t: %ldMHz\n",
758 ((long)katana_bus_frequency + 500000) / 1000000);
655 seq_printf(m, "vendor\t\t: Artesyn Communication Products, LLC\n"); 759 seq_printf(m, "vendor\t\t: Artesyn Communication Products, LLC\n");
656 760
657 seq_printf(m, "board\t\t: "); 761 seq_printf(m, "board\t\t: ");
658
659 switch (katana_id) { 762 switch (katana_id) {
660 case KATANA_ID_3750: 763 case KATANA_ID_3750:
661 seq_printf(m, "Katana 3750\n"); 764 seq_printf(m, "Katana 3750");
662 break; 765 break;
663 766
664 case KATANA_ID_750I: 767 case KATANA_ID_750I:
665 seq_printf(m, "Katana 750i\n"); 768 seq_printf(m, "Katana 750i");
666 break; 769 break;
667 770
668 case KATANA_ID_752I: 771 case KATANA_ID_752I:
669 seq_printf(m, "Katana 752i\n"); 772 seq_printf(m, "Katana 752i");
670 break; 773 break;
671 774
672 default: 775 default:
673 seq_printf(m, "Unknown\n"); 776 seq_printf(m, "Unknown");
674 break; 777 break;
675 } 778 }
676 779 seq_printf(m, " (product id: 0x%x)\n",
677 seq_printf(m, "product ID\t: 0x%x\n",
678 in_8(cpld_base + KATANA_CPLD_PRODUCT_ID)); 780 in_8(cpld_base + KATANA_CPLD_PRODUCT_ID));
781
782 seq_printf(m, "pci mode\t: %sMonarch\n",
783 katana_is_monarch()? "" : "Non-");
679 seq_printf(m, "hardware rev\t: 0x%x\n", 784 seq_printf(m, "hardware rev\t: 0x%x\n",
680 in_8(cpld_base+KATANA_CPLD_HARDWARE_VER)); 785 in_8(cpld_base+KATANA_CPLD_HARDWARE_VER));
681 seq_printf(m, "PLD rev\t\t: 0x%x\n", 786 seq_printf(m, "pld rev\t\t: 0x%x\n",
682 in_8(cpld_base + KATANA_CPLD_PLD_VER)); 787 in_8(cpld_base + KATANA_CPLD_PLD_VER));
683 seq_printf(m, "PLB freq\t: %ldMhz\n", 788
684 (long)katana_bus_frequency / 1000000); 789 switch(bh.type) {
685 seq_printf(m, "PCI\t\t: %sMonarch\n", katana_is_monarch()? "" : "Non-"); 790 case MV64x60_TYPE_GT64260A:
791 s = "gt64260a";
792 break;
793 case MV64x60_TYPE_GT64260B:
794 s = "gt64260b";
795 break;
796 case MV64x60_TYPE_MV64360:
797 s = "mv64360";
798 break;
799 case MV64x60_TYPE_MV64460:
800 s = "mv64460";
801 break;
802 default:
803 s = "Unknown";
804 }
805 seq_printf(m, "bridge type\t: %s\n", s);
806 seq_printf(m, "bridge rev\t: 0x%x\n", bh.rev);
807#if defined(CONFIG_NOT_COHERENT_CACHE)
808 seq_printf(m, "coherency\t: %s\n", "off");
809#else
810 seq_printf(m, "coherency\t: %s\n", "on");
811#endif
686 812
687 return 0; 813 return 0;
688} 814}
@@ -701,11 +827,20 @@ katana_calibrate_decr(void)
701 tb_to_us = mulhwu_scale_factor(freq, 1000000); 827 tb_to_us = mulhwu_scale_factor(freq, 1000000);
702} 828}
703 829
830/*
831 * The katana supports both uImage and zImage. If uImage, get the mem size
832 * from the bd info. If zImage, the bootwrapper adds a BI_MEMSIZE entry in
833 * the bi_rec data which is sucked out and put into boot_mem_size by
834 * parse_bootinfo(). MMU_init() will then use the boot_mem_size for the mem
835 * size and not call this routine. The only way this will fail is when a uImage
836 * is used but the fw doesn't pass in a valid bi_memsize. This should never
837 * happen, though.
838 */
704unsigned long __init 839unsigned long __init
705katana_find_end_of_memory(void) 840katana_find_end_of_memory(void)
706{ 841{
707 return mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE, 842 bd_t *bdp = (bd_t *)__res;
708 MV64x60_TYPE_MV64360); 843 return bdp->bi_memsize;
709} 844}
710 845
711#if defined(CONFIG_I2C_MV64XXX) && defined(CONFIG_SENSORS_M41T00) 846#if defined(CONFIG_I2C_MV64XXX) && defined(CONFIG_SENSORS_M41T00)
@@ -729,15 +864,6 @@ katana_rtc_hookup(void)
729late_initcall(katana_rtc_hookup); 864late_initcall(katana_rtc_hookup);
730#endif 865#endif
731 866
732static inline void
733katana_set_bat(void)
734{
735 mb();
736 mtspr(SPRN_DBAT2U, 0xf0001ffe);
737 mtspr(SPRN_DBAT2L, 0xf000002a);
738 mb();
739}
740
741#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE) 867#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
742static void __init 868static void __init
743katana_map_io(void) 869katana_map_io(void)
@@ -763,15 +889,24 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
763 */ 889 */
764 if (r3 && r6) { 890 if (r3 && r6) {
765 /* copy board info structure */ 891 /* copy board info structure */
766 memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) ); 892 memcpy((void *)__res, (void *)(r3+KERNELBASE), sizeof(bd_t));
767 /* copy command line */ 893 /* copy command line */
768 *(char *)(r7+KERNELBASE) = 0; 894 *(char *)(r7+KERNELBASE) = 0;
769 strcpy(cmd_line, (char *)(r6+KERNELBASE)); 895 strcpy(cmd_line, (char *)(r6+KERNELBASE));
770 } 896 }
771 897
898#ifdef CONFIG_BLK_DEV_INITRD
899 /* take care of initrd if we have one */
900 if (r4) {
901 initrd_start = r4 + KERNELBASE;
902 initrd_end = r5 + KERNELBASE;
903 }
904#endif /* CONFIG_BLK_DEV_INITRD */
905
772 isa_mem_base = 0; 906 isa_mem_base = 0;
773 907
774 ppc_md.setup_arch = katana_setup_arch; 908 ppc_md.setup_arch = katana_setup_arch;
909 ppc_md.pcibios_fixup_resources = katana_fixup_resources;
775 ppc_md.show_cpuinfo = katana_show_cpuinfo; 910 ppc_md.show_cpuinfo = katana_show_cpuinfo;
776 ppc_md.init_IRQ = mv64360_init_irq; 911 ppc_md.init_IRQ = mv64360_init_irq;
777 ppc_md.get_irq = mv64360_get_irq; 912 ppc_md.get_irq = mv64360_get_irq;
@@ -790,6 +925,4 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
790#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH) 925#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH)
791 platform_notify = katana_platform_notify; 926 platform_notify = katana_platform_notify;
792#endif 927#endif
793
794 katana_set_bat(); /* Need for katana_find_end_of_memory and progress */
795} 928}