aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/iseries/setup.c')
-rw-r--r--arch/powerpc/platforms/iseries/setup.c72
1 files changed, 32 insertions, 40 deletions
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 3ecc4a652d82..fa4550611c11 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -50,6 +50,7 @@
50#include <asm/iseries/hv_call_xm.h> 50#include <asm/iseries/hv_call_xm.h>
51#include <asm/iseries/it_lp_queue.h> 51#include <asm/iseries/it_lp_queue.h>
52#include <asm/iseries/mf.h> 52#include <asm/iseries/mf.h>
53#include <asm/iseries/it_exp_vpd_panel.h>
53#include <asm/iseries/hv_lp_event.h> 54#include <asm/iseries/hv_lp_event.h>
54#include <asm/iseries/lpar_map.h> 55#include <asm/iseries/lpar_map.h>
55#include <asm/udbg.h> 56#include <asm/udbg.h>
@@ -89,8 +90,6 @@ extern unsigned long embedded_sysmap_end;
89extern unsigned long iSeries_recal_tb; 90extern unsigned long iSeries_recal_tb;
90extern unsigned long iSeries_recal_titan; 91extern unsigned long iSeries_recal_titan;
91 92
92static int mf_initialized;
93
94static unsigned long cmd_mem_limit; 93static unsigned long cmd_mem_limit;
95 94
96struct MemoryBlock { 95struct MemoryBlock {
@@ -303,8 +302,6 @@ static void __init iSeries_init_early(void)
303{ 302{
304 DBG(" -> iSeries_init_early()\n"); 303 DBG(" -> iSeries_init_early()\n");
305 304
306 ppc64_firmware_features = FW_FEATURE_ISERIES;
307
308 ppc64_interrupt_controller = IC_ISERIES; 305 ppc64_interrupt_controller = IC_ISERIES;
309 306
310#if defined(CONFIG_BLK_DEV_INITRD) 307#if defined(CONFIG_BLK_DEV_INITRD)
@@ -349,8 +346,6 @@ static void __init iSeries_init_early(void)
349 HvCallEvent_setLpEventQueueInterruptProc(0, 0); 346 HvCallEvent_setLpEventQueueInterruptProc(0, 0);
350 347
351 mf_init(); 348 mf_init();
352 mf_initialized = 1;
353 mb();
354 349
355 /* If we were passed an initrd, set the ROOT_DEV properly if the values 350 /* If we were passed an initrd, set the ROOT_DEV properly if the values
356 * look sensible. If not, clear initrd reference. 351 * look sensible. If not, clear initrd reference.
@@ -560,39 +555,10 @@ static void iSeries_show_cpuinfo(struct seq_file *m)
560 seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n"); 555 seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n");
561} 556}
562 557
563/*
564 * Document me.
565 */
566static void iSeries_restart(char *cmd)
567{
568 mf_reboot();
569}
570
571/*
572 * Document me.
573 */
574static void iSeries_power_off(void)
575{
576 mf_power_off();
577}
578
579/*
580 * Document me.
581 */
582static void iSeries_halt(void)
583{
584 mf_power_off();
585}
586
587static void __init iSeries_progress(char * st, unsigned short code) 558static void __init iSeries_progress(char * st, unsigned short code)
588{ 559{
589 printk("Progress: [%04x] - %s\n", (unsigned)code, st); 560 printk("Progress: [%04x] - %s\n", (unsigned)code, st);
590 if (!piranha_simulator && mf_initialized) { 561 mf_display_progress(code);
591 if (code != 0xffff)
592 mf_display_progress(code);
593 else
594 mf_clear_src();
595 }
596} 562}
597 563
598static void __init iSeries_fixup_klimit(void) 564static void __init iSeries_fixup_klimit(void)
@@ -711,7 +677,13 @@ void __init iSeries_init_IRQ(void) { }
711 677
712static int __init iseries_probe(int platform) 678static int __init iseries_probe(int platform)
713{ 679{
714 return PLATFORM_ISERIES_LPAR == platform; 680 if (PLATFORM_ISERIES_LPAR != platform)
681 return 0;
682
683 ppc64_firmware_features |= FW_FEATURE_ISERIES;
684 ppc64_firmware_features |= FW_FEATURE_LPAR;
685
686 return 1;
715} 687}
716 688
717struct machdep_calls __initdata iseries_md = { 689struct machdep_calls __initdata iseries_md = {
@@ -721,9 +693,9 @@ struct machdep_calls __initdata iseries_md = {
721 .get_irq = iSeries_get_irq, 693 .get_irq = iSeries_get_irq,
722 .init_early = iSeries_init_early, 694 .init_early = iSeries_init_early,
723 .pcibios_fixup = iSeries_pci_final_fixup, 695 .pcibios_fixup = iSeries_pci_final_fixup,
724 .restart = iSeries_restart, 696 .restart = mf_reboot,
725 .power_off = iSeries_power_off, 697 .power_off = mf_power_off,
726 .halt = iSeries_halt, 698 .halt = mf_power_off,
727 .get_boot_time = iSeries_get_boot_time, 699 .get_boot_time = iSeries_get_boot_time,
728 .set_rtc_time = iSeries_set_rtc_time, 700 .set_rtc_time = iSeries_set_rtc_time,
729 .get_rtc_time = iSeries_get_rtc_time, 701 .get_rtc_time = iSeries_get_rtc_time,
@@ -917,6 +889,24 @@ void dt_cpus(struct iseries_flat_dt *dt)
917 dt_end_node(dt); 889 dt_end_node(dt);
918} 890}
919 891
892void dt_model(struct iseries_flat_dt *dt)
893{
894 char buf[16] = "IBM,";
895
896 /* "IBM," + mfgId[2:3] + systemSerial[1:5] */
897 strne2a(buf + 4, xItExtVpdPanel.mfgID + 2, 2);
898 strne2a(buf + 6, xItExtVpdPanel.systemSerial + 1, 5);
899 buf[11] = '\0';
900 dt_prop_str(dt, "system-id", buf);
901
902 /* "IBM," + machineType[0:4] */
903 strne2a(buf + 4, xItExtVpdPanel.machineType, 4);
904 buf[8] = '\0';
905 dt_prop_str(dt, "model", buf);
906
907 dt_prop_str(dt, "compatible", "IBM,iSeries");
908}
909
920void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size) 910void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
921{ 911{
922 u64 tmp[2]; 912 u64 tmp[2];
@@ -927,6 +917,7 @@ void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
927 917
928 dt_prop_u32(dt, "#address-cells", 2); 918 dt_prop_u32(dt, "#address-cells", 2);
929 dt_prop_u32(dt, "#size-cells", 2); 919 dt_prop_u32(dt, "#size-cells", 2);
920 dt_model(dt);
930 921
931 /* /memory */ 922 /* /memory */
932 dt_start_node(dt, "memory@0"); 923 dt_start_node(dt, "memory@0");
@@ -940,6 +931,7 @@ void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
940 /* /chosen */ 931 /* /chosen */
941 dt_start_node(dt, "chosen"); 932 dt_start_node(dt, "chosen");
942 dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); 933 dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR);
934 dt_prop_str(dt, "bootargs", cmd_line);
943 if (cmd_mem_limit) 935 if (cmd_mem_limit)
944 dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); 936 dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit);
945 dt_end_node(dt); 937 dt_end_node(dt);