From b6fce51e31703ea95bf8dede4d9dc1f2dcd56639 Mon Sep 17 00:00:00 2001 From: Vasant Hegde Date: Tue, 28 May 2019 11:17:21 +0530 Subject: opal-msg: Enhance opal-get-msg API Linux uses opal_get_msg (OPAL_GET_MSG) API to get OPAL messages. This interface supports upto 8 params (64 bytes). We have a requirement to send bigger data to Linux. This patch enhances OPAL to send bigger data to Linux. - Linux will use "opal-msg-size" device tree property to allocate memory for OPAL messages (previous patch increased "opal-msg-size" to 64K). - Replaced `reserved` field in "struct opal_msg" with `size`. So that Linux side opal_get_msg user can detect actual data size. - If buffer size < actual message size, then opal_get_msg will copy partial data and return OPAL_PARTIAL to Linux. - Add new variable "extended" to "opal_msg_entry" structure to keep track of messages that has more than 64byte data. We will allocate separate memory for these messages and once kernel consumes message we will release that memory. Cc: Jeremy Kerr Cc: Mahesh Salgaonkar Cc: Oliver O'Halloran Signed-off-by: Vasant Hegde Acked-by: Jeremy Kerr Signed-off-by: Stewart Smith --- doc/opal-api/opal-messages.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'doc/opal-api/opal-messages.rst') diff --git a/doc/opal-api/opal-messages.rst b/doc/opal-api/opal-messages.rst index 7843b69..c7b2e5c 100644 --- a/doc/opal-api/opal-messages.rst +++ b/doc/opal-api/opal-messages.rst @@ -11,7 +11,7 @@ An opal_msg is: :: struct opal_msg { __be32 msg_type; - __be32 reserved; + __be32 size; __be64 params[8]; }; @@ -21,8 +21,9 @@ define all eight parameters, the value in the undefined parameters is undefined, although can safely be memcpy()d or otherwise moved. In the device tree, there's an opal-msg-size property of the OPAL node that -says the size of a struct opal-msg. In the future, OPAL may support larger -messages. See ``OPAL_GET_MESSAGE`` documentation for details. +says the size of a struct opal-msg. Kernel will use this property to allocate +memory for opal_msg structure. See ``OPAL_GET_MESSAGE`` documentation for +details. :: ibm,opal { -- cgit v1.1