]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Minor fixes in Fls
authortojo <devnull@localhost>
Tue, 14 Dec 2010 16:44:04 +0000 (17:44 +0100)
committertojo <devnull@localhost>
Tue, 14 Dec 2010 16:44:04 +0000 (17:44 +0100)
arch/ppc/mpc55xx/drivers/Fls.c
arch/ppc/mpc55xx/drivers/Fls_H7F.c

index 7713bef34008dcf9aa68271b4921f24de93306eb..72858426f4da2903ad6512285ec55e1f3af01a31 100644 (file)
@@ -86,6 +86,8 @@
 #define SHADOW_ROW_SIZE                0x00008000\r
 #define FLASH_PAGE_SIZE    H7FB_PAGE_SIZE\r
 \r
+#define FLASH_TOTAL_BLOCKS ( 20 )\r
+\r
 #if 0\r
 #define VFLAGS_ADDR_SECT               (1<<0)\r
 #define VFLAGS_ADDR_PAGE               (1<<1)\r
@@ -263,7 +265,7 @@ static inline int Fls_Validate( uint32 addr,uint32 length, uint32 api,uint32 rv
   }\r
 \r
 #define FLS_VALIDATE_PARAM_DATA_W_RV(_ptr,_api, _rv) \\r
-  if( (_ptr)==((void *)0)) { \\r
+  if(( (uint32)(_ptr)%FLS_READ_PAGE_SIZE != 0 ) || ( (_ptr)==((void *)0))) { \
     Det_ReportError(MODULE_ID_FLS,0,_api,FLS_E_PARAM_DATA); \\r
     return _rv; \\r
   }\r
@@ -480,7 +482,7 @@ static void address_to_erase_blocks( Fls_EraseBlockType *eraseBlocks, uint32 add
   endBlock = address_to_block( addr + size - 1,&rem );\r
 \r
   // Check so our implementation holds..\r
-  assert( endBlock<=32 );\r
+  assert( endBlock <= FLASH_TOTAL_BLOCKS );\r
 \r
 #define BLOCK_MASK 0x0003ffffUL\r
 \r
index d4da25743222623c9681cee75951877b71d13fcb..4f8375ac5713aea9f6895e0f1ef6f199b7505512 100644 (file)
@@ -375,6 +375,7 @@ UINT32 Fls_H7F_Program ( PSSD_CONFIG pSSDConfig, Fls_ProgInfoType *pInfo )
       returnCode = Fls_H7F_ProgramStatus(pSSDConfig,pInfo);\r
       break;\r
     default:\r
+      returnCode = 0;\r
       assert(0);\r
       break;\r
     }\r