Make TF UUID RFC 4122 compliant

RFC4122 defines that fields are stored in network order (big endian),
but TF-A stores them in machine order (little endian by default in TF-A).
We cannot change the future UUIDs that are already generated, but we can store
all the bytes using arrays and modify fiptool to generate the UUIDs with
the correct byte order.

Change-Id: I97be2d3168d91f4dee7ccfafc533ea55ff33e46f
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
diff --git a/plat/arm/common/arm_sip_svc.c b/plat/arm/common/arm_sip_svc.c
index 7fe6101..bb5b5c6 100644
--- a/plat/arm/common/arm_sip_svc.c
+++ b/plat/arm/common/arm_sip_svc.c
@@ -14,9 +14,9 @@
 
 
 /* ARM SiP Service UUID */
-DEFINE_SVC_UUID(arm_sip_svc_uid,
-		0xe2756d55, 0x3360, 0x4bb5, 0xbf, 0xf3,
-		0x62, 0x79, 0xfd, 0x11, 0x37, 0xff);
+DEFINE_SVC_UUID2(arm_sip_svc_uid,
+	0x556d75e2, 0x6033, 0xb54b, 0xb5, 0x75,
+	0x62, 0x79, 0xfd, 0x11, 0x37, 0xff);
 
 static int arm_sip_setup(void)
 {
diff --git a/plat/hisilicon/hikey/hisi_sip_svc.c b/plat/hisilicon/hikey/hisi_sip_svc.c
index b3109d6..ffa4903 100644
--- a/plat/hisilicon/hikey/hisi_sip_svc.c
+++ b/plat/hisilicon/hikey/hisi_sip_svc.c
@@ -13,9 +13,9 @@
 
 
 /* Hisi SiP Service UUID */
-DEFINE_SVC_UUID(hisi_sip_svc_uid,
-		0xe599df74, 0x7682, 0x40aa, 0x9f, 0xf8,
-		0xc0, 0x85, 0x52, 0xbc, 0x39, 0x3f);
+DEFINE_SVC_UUID2(hisi_sip_svc_uid,
+	0x74df99e5, 0x8276, 0xaa40, 0x9f, 0xf8,
+	0xc0, 0x85, 0x52, 0xbc, 0x39, 0x3f);
 
 static int hisi_sip_setup(void)
 {
diff --git a/plat/mediatek/common/custom/oem_svc.c b/plat/mediatek/common/custom/oem_svc.c
index c396e2d..18bda51 100644
--- a/plat/mediatek/common/custom/oem_svc.c
+++ b/plat/mediatek/common/custom/oem_svc.c
@@ -14,10 +14,9 @@
 #include <uuid.h>
 
 /* OEM Service UUID */
-DEFINE_SVC_UUID(oem_svc_uid,
-		0xb943add0, 0x069d, 0x11e4, 0x91, 0x91,
-		0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66);
-
+DEFINE_SVC_UUID2(oem_svc_uid,
+	0xd0ad43b9, 0x9b06, 0xe411, 0x91, 0x91,
+	0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66);
 
 /* Setup OEM Services */
 static int32_t oem_svc_setup(void)
diff --git a/plat/mediatek/common/mtk_sip_svc.c b/plat/mediatek/common/mtk_sip_svc.c
index ea8cea0..71eddca 100644
--- a/plat/mediatek/common/mtk_sip_svc.c
+++ b/plat/mediatek/common/mtk_sip_svc.c
@@ -14,9 +14,9 @@
 #include <uuid.h>
 
 /* Mediatek SiP Service UUID */
-DEFINE_SVC_UUID(mtk_sip_svc_uid,
-		0xf7582ba4, 0x4262, 0x4d7d, 0x80, 0xe5,
-		0x8f, 0x95, 0x05, 0x00, 0x0f, 0x3d);
+DEFINE_SVC_UUID2(mtk_sip_svc_uid,
+	0xa42b58f7, 0x6242, 0x7d4d, 0x80, 0xe5,
+	0x8f, 0x95, 0x05, 0x00, 0x0f, 0x3d);
 
 #pragma weak mediatek_plat_sip_handler
 uintptr_t mediatek_plat_sip_handler(uint32_t smc_fid,
diff --git a/plat/rockchip/common/rockchip_sip_svc.c b/plat/rockchip/common/rockchip_sip_svc.c
index 2480599..d690e92 100644
--- a/plat/rockchip/common/rockchip_sip_svc.c
+++ b/plat/rockchip/common/rockchip_sip_svc.c
@@ -13,9 +13,9 @@
 #include <uuid.h>
 
 /* Rockchip SiP Service UUID */
-DEFINE_SVC_UUID(rk_sip_svc_uid,
-		0xe86fc7e2, 0x313e, 0x11e6, 0xb7, 0x0d,
-		0x8f, 0x88, 0xee, 0x74, 0x7b, 0x72);
+DEFINE_SVC_UUID2(rk_sip_svc_uid,
+	0xe2c76fe8, 0x3e31, 0xe611, 0xb7, 0x0d,
+	0x8f, 0x88, 0xee, 0x74, 0x7b, 0x72);
 
 #pragma weak rockchip_plat_sip_handler
 uintptr_t rockchip_plat_sip_handler(uint32_t smc_fid,
diff --git a/plat/xilinx/zynqmp/sip_svc_setup.c b/plat/xilinx/zynqmp/sip_svc_setup.c
index c7996ce..9fe709d 100644
--- a/plat/xilinx/zynqmp/sip_svc_setup.c
+++ b/plat/xilinx/zynqmp/sip_svc_setup.c
@@ -29,9 +29,9 @@
 #define is_ipi_fid(_fid) (((_fid) & PM_FID_MASK) == IPI_FID_VALUE)
 
 /* SiP Service UUID */
-DEFINE_SVC_UUID(zynqmp_sip_uuid,
-		0x2a1d9b5c, 0x8605, 0x4023, 0xa6, 0x1b,
-		0xb9, 0x25, 0x82, 0x2d, 0xe3, 0xa5);
+DEFINE_SVC_UUID2(zynqmp_sip_uuid,
+	0x5c9b1b2a, 0x0586, 0x2340, 0xa6, 0x1b,
+	0xb9, 0x25, 0x82, 0x2d, 0xe3, 0xa5);
 
 /**
  * sip_svc_setup() - Setup SiP Service