Commit 94cd65dd authored by Sumit.Saxena@lsi.com's avatar Sumit.Saxena@lsi.com Committed by James Bottomley

[SCSI] megaraid_sas: addded support for big endian architecture

This patch will add big endian architecture support to megaraid_sas
driver. The support added is for LSI MegaRAID all generation controllers-
(3Gb/s, 6Gb/s and 12 Gb/s controllers).

We have done basic sanity test @ppc64 arch and @x86_64. Additional
testing/observations are welcome.

[jejb: fix up rejections]
Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: default avatarSumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 6f8f8e4d
...@@ -492,21 +492,39 @@ struct megasas_ctrl_prop { ...@@ -492,21 +492,39 @@ struct megasas_ctrl_prop {
* a bit in the following structure. * a bit in the following structure.
*/ */
struct { struct {
u32 copyBackDisabled : 1; #if defined(__BIG_ENDIAN_BITFIELD)
u32 SMARTerEnabled : 1; u32 reserved:18;
u32 prCorrectUnconfiguredAreas : 1; u32 enableJBOD:1;
u32 useFdeOnly : 1; u32 disableSpinDownHS:1;
u32 disableNCQ : 1; u32 allowBootWithPinnedCache:1;
u32 SSDSMARTerEnabled : 1; u32 disableOnlineCtrlReset:1;
u32 SSDPatrolReadEnabled : 1; u32 enableSecretKeyControl:1;
u32 enableSpinDownUnconfigured : 1; u32 autoEnhancedImport:1;
u32 autoEnhancedImport : 1; u32 enableSpinDownUnconfigured:1;
u32 enableSecretKeyControl : 1; u32 SSDPatrolReadEnabled:1;
u32 disableOnlineCtrlReset : 1; u32 SSDSMARTerEnabled:1;
u32 allowBootWithPinnedCache : 1; u32 disableNCQ:1;
u32 disableSpinDownHS : 1; u32 useFdeOnly:1;
u32 enableJBOD : 1; u32 prCorrectUnconfiguredAreas:1;
u32 reserved :18; u32 SMARTerEnabled:1;
u32 copyBackDisabled:1;
#else
u32 copyBackDisabled:1;
u32 SMARTerEnabled:1;
u32 prCorrectUnconfiguredAreas:1;
u32 useFdeOnly:1;
u32 disableNCQ:1;
u32 SSDSMARTerEnabled:1;
u32 SSDPatrolReadEnabled:1;
u32 enableSpinDownUnconfigured:1;
u32 autoEnhancedImport:1;
u32 enableSecretKeyControl:1;
u32 disableOnlineCtrlReset:1;
u32 allowBootWithPinnedCache:1;
u32 disableSpinDownHS:1;
u32 enableJBOD:1;
u32 reserved:18;
#endif
} OnOffProperties; } OnOffProperties;
u8 autoSnapVDSpace; u8 autoSnapVDSpace;
u8 viewSpace; u8 viewSpace;
...@@ -820,6 +838,30 @@ struct megasas_ctrl_info { ...@@ -820,6 +838,30 @@ struct megasas_ctrl_info {
u16 cacheMemorySize; /*7A2h */ u16 cacheMemorySize; /*7A2h */
struct { /*7A4h */ struct { /*7A4h */
#if defined(__BIG_ENDIAN_BITFIELD)
u32 reserved:11;
u32 supportUnevenSpans:1;
u32 dedicatedHotSparesLimited:1;
u32 headlessMode:1;
u32 supportEmulatedDrives:1;
u32 supportResetNow:1;
u32 realTimeScheduler:1;
u32 supportSSDPatrolRead:1;
u32 supportPerfTuning:1;
u32 disableOnlinePFKChange:1;
u32 supportJBOD:1;
u32 supportBootTimePFKChange:1;
u32 supportSetLinkSpeed:1;
u32 supportEmergencySpares:1;
u32 supportSuspendResumeBGops:1;
u32 blockSSDWriteCacheChange:1;
u32 supportShieldState:1;
u32 supportLdBBMInfo:1;
u32 supportLdPIType3:1;
u32 supportLdPIType2:1;
u32 supportLdPIType1:1;
u32 supportPIcontroller:1;
#else
u32 supportPIcontroller:1; u32 supportPIcontroller:1;
u32 supportLdPIType1:1; u32 supportLdPIType1:1;
u32 supportLdPIType2:1; u32 supportLdPIType2:1;
...@@ -845,6 +887,7 @@ struct megasas_ctrl_info { ...@@ -845,6 +887,7 @@ struct megasas_ctrl_info {
u32 supportUnevenSpans:1; u32 supportUnevenSpans:1;
u32 reserved:11; u32 reserved:11;
#endif
} adapterOperations2; } adapterOperations2;
u8 driverVersion[32]; /*7A8h */ u8 driverVersion[32]; /*7A8h */
...@@ -1069,9 +1112,15 @@ union megasas_sgl_frame { ...@@ -1069,9 +1112,15 @@ union megasas_sgl_frame {
typedef union _MFI_CAPABILITIES { typedef union _MFI_CAPABILITIES {
struct { struct {
#if defined(__BIG_ENDIAN_BITFIELD)
u32 reserved:30;
u32 support_additional_msix:1;
u32 support_fp_remote_lun:1;
#else
u32 support_fp_remote_lun:1; u32 support_fp_remote_lun:1;
u32 support_additional_msix:1; u32 support_additional_msix:1;
u32 reserved:30; u32 reserved:30;
#endif
} mfi_capabilities; } mfi_capabilities;
u32 reg; u32 reg;
} MFI_CAPABILITIES; } MFI_CAPABILITIES;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -93,8 +93,13 @@ enum MR_RAID_FLAGS_IO_SUB_TYPE { ...@@ -93,8 +93,13 @@ enum MR_RAID_FLAGS_IO_SUB_TYPE {
*/ */
struct RAID_CONTEXT { struct RAID_CONTEXT {
#if defined(__BIG_ENDIAN_BITFIELD)
u8 nseg:4;
u8 Type:4;
#else
u8 Type:4; u8 Type:4;
u8 nseg:4; u8 nseg:4;
#endif
u8 resvd0; u8 resvd0;
u16 timeoutValue; u16 timeoutValue;
u8 regLockFlags; u8 regLockFlags;
...@@ -298,8 +303,13 @@ struct MPI2_RAID_SCSI_IO_REQUEST { ...@@ -298,8 +303,13 @@ struct MPI2_RAID_SCSI_IO_REQUEST {
* MPT RAID MFA IO Descriptor. * MPT RAID MFA IO Descriptor.
*/ */
struct MEGASAS_RAID_MFA_IO_REQUEST_DESCRIPTOR { struct MEGASAS_RAID_MFA_IO_REQUEST_DESCRIPTOR {
#if defined(__BIG_ENDIAN_BITFIELD)
u32 MessageAddress1:24; /* bits 31:8*/
u32 RequestFlags:8;
#else
u32 RequestFlags:8; u32 RequestFlags:8;
u32 MessageAddress1:24; /* bits 31:8*/ u32 MessageAddress1:24; /* bits 31:8*/
#endif
u32 MessageAddress2; /* bits 61:32 */ u32 MessageAddress2; /* bits 61:32 */
}; };
...@@ -518,6 +528,19 @@ struct MR_SPAN_BLOCK_INFO { ...@@ -518,6 +528,19 @@ struct MR_SPAN_BLOCK_INFO {
struct MR_LD_RAID { struct MR_LD_RAID {
struct { struct {
#if defined(__BIG_ENDIAN_BITFIELD)
u32 reserved4:7;
u32 fpNonRWCapable:1;
u32 fpReadAcrossStripe:1;
u32 fpWriteAcrossStripe:1;
u32 fpReadCapable:1;
u32 fpWriteCapable:1;
u32 encryptionType:8;
u32 pdPiMode:4;
u32 ldPiMode:4;
u32 reserved5:3;
u32 fpCapable:1;
#else
u32 fpCapable:1; u32 fpCapable:1;
u32 reserved5:3; u32 reserved5:3;
u32 ldPiMode:4; u32 ldPiMode:4;
...@@ -529,6 +552,7 @@ struct MR_LD_RAID { ...@@ -529,6 +552,7 @@ struct MR_LD_RAID {
u32 fpReadAcrossStripe:1; u32 fpReadAcrossStripe:1;
u32 fpNonRWCapable:1; u32 fpNonRWCapable:1;
u32 reserved4:7; u32 reserved4:7;
#endif
} capability; } capability;
u32 reserved6; u32 reserved6;
u64 size; u64 size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment