Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c5d87db authored by Oliver O'Halloran's avatar Oliver O'Halloran Committed by Michael Ellerman
Browse files

powerpc/pseries: PAPR persistent memory support



This patch implements support for discovering storage class memory
devices at boot and for handling hotplug of new regions via RTAS
hotplug events.

Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
[mpe: Fix CONFIG_MEMORY_HOTPLUG=n build]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 422123cc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@
#define FW_FEATURE_DRMEM_V2	ASM_CONST(0x0000000400000000)
#define FW_FEATURE_DRC_INFO	ASM_CONST(0x0000000800000000)
#define FW_FEATURE_BLOCK_REMOVE ASM_CONST(0x0000001000000000)
#define FW_FEATURE_PAPR_SCM 	ASM_CONST(0x0000002000000000)

#ifndef __ASSEMBLY__

@@ -70,7 +71,8 @@ enum {
		FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY |
		FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN |
		FW_FEATURE_HPT_RESIZE | FW_FEATURE_DRMEM_V2 |
		FW_FEATURE_DRC_INFO | FW_FEATURE_BLOCK_REMOVE,
		FW_FEATURE_DRC_INFO | FW_FEATURE_BLOCK_REMOVE |
		FW_FEATURE_PAPR_SCM,
	FW_FEATURE_PSERIES_ALWAYS = 0,
	FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL,
	FW_FEATURE_POWERNV_ALWAYS = 0,
+9 −1
Original line number Diff line number Diff line
@@ -296,7 +296,15 @@
#define H_INT_ESB               0x3C8
#define H_INT_SYNC              0x3CC
#define H_INT_RESET             0x3D0
#define MAX_HCALL_OPCODE	H_INT_RESET
#define H_SCM_READ_METADATA     0x3E4
#define H_SCM_WRITE_METADATA    0x3E8
#define H_SCM_BIND_MEM          0x3EC
#define H_SCM_UNBIND_MEM        0x3F0
#define H_SCM_QUERY_BLOCK_MEM_BINDING 0x3F4
#define H_SCM_QUERY_LOGICAL_MEM_BINDING 0x3F8
#define H_SCM_MEM_QUERY	        0x3FC
#define H_SCM_BLOCK_CLEAR       0x400
#define MAX_HCALL_OPCODE	H_SCM_BLOCK_CLEAR

/* H_VIOCTL functions */
#define H_GET_VIOA_DUMP_SIZE	0x01
+2 −0
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ struct rtas_suspend_me_data {
#define RTAS_TYPE_INFO			0xE2
#define RTAS_TYPE_DEALLOC		0xE3
#define RTAS_TYPE_DUMP			0xE4
#define RTAS_TYPE_HOTPLUG		0xE5
/* I don't add PowerMGM events right now, this is a different topic */ 
#define RTAS_TYPE_PMGM_POWER_SW_ON	0x60
#define RTAS_TYPE_PMGM_POWER_SW_OFF	0x61
@@ -329,6 +330,7 @@ struct pseries_hp_errorlog {
#define PSERIES_HP_ELOG_RESOURCE_MEM	2
#define PSERIES_HP_ELOG_RESOURCE_SLOT	3
#define PSERIES_HP_ELOG_RESOURCE_PHB	4
#define PSERIES_HP_ELOG_RESOURCE_PMEM   6

#define PSERIES_HP_ELOG_ACTION_ADD	1
#define PSERIES_HP_ELOG_ACTION_REMOVE	2
+2 −0
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@ static char *rtas_event_type(int type)
			return "Dump Notification Event";
		case RTAS_TYPE_PRRN:
			return "Platform Resource Reassignment Event";
		case RTAS_TYPE_HOTPLUG:
			return "Hotplug Event";
	}

	return rtas_type[0];
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ obj-$(CONFIG_KEXEC_CORE) += kexec.o
obj-$(CONFIG_PSERIES_ENERGY)	+= pseries_energy.o

obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug-cpu.o
obj-$(CONFIG_MEMORY_HOTPLUG)	+= hotplug-memory.o
obj-$(CONFIG_MEMORY_HOTPLUG)	+= hotplug-memory.o pmem.o

obj-$(CONFIG_HVC_CONSOLE)	+= hvconsole.o
obj-$(CONFIG_HVCS)		+= hvcserver.o
Loading