io: Allow image load to address zero
authorKonstantin Porotchkin <[email protected]>
Mon, 7 May 2018 09:52:48 +0000 (12:52 +0300)
committerKonstantin Porotchkin <[email protected]>
Wed, 18 Jul 2018 15:48:30 +0000 (18:48 +0300)
Remove assert on buffer address equal zero.
Marvell uses address 0x0 for loading BL33,
so this check is irrelevant and breaks the
debug builds on Marvell platforms.

Change-Id: Ie56a51138e2e4ddd8986dd7036797dc2d8b10125
Signed-off-by: Haim Boot <[email protected]>
Signed-off-by: Konstantin Porotchkin <[email protected]>
Reviewed-on: http://vgitil04.il.marvell.com:8080/54589

drivers/io/io_fip.c
drivers/io/io_memmap.c
drivers/io/io_semihosting.c
drivers/io/io_storage.c

index 1754339062919878ad7cf9e72a8d779dc26f708f..c5ee6a4df59af7058c73a4e337ee35659e901e16 100644 (file)
@@ -272,7 +272,6 @@ static int fip_file_read(io_entity_t *entity, uintptr_t buffer, size_t length,
        uintptr_t backend_handle;
 
        assert(entity != NULL);
-       assert(buffer != (uintptr_t)NULL);
        assert(length_read != NULL);
        assert(entity->info != (uintptr_t)NULL);
 
index bf59d6a5c742cdcf93afb5ff1ac3e00ac9e4030e..5595e60a424909a8a7b295b0bbbdaa17c98ddcc4 100644 (file)
@@ -9,6 +9,7 @@
 #include <io_driver.h>
 #include <io_memmap.h>
 #include <io_storage.h>
+#include <platform_def.h>
 #include <string.h>
 #include <utils.h>
 
@@ -169,7 +170,6 @@ static int memmap_block_read(io_entity_t *entity, uintptr_t buffer,
        size_t pos_after;
 
        assert(entity != NULL);
-       assert(buffer != (uintptr_t)NULL);
        assert(length_read != NULL);
 
        fp = (file_state_t *) entity->info;
@@ -197,7 +197,6 @@ static int memmap_block_write(io_entity_t *entity, const uintptr_t buffer,
        size_t pos_after;
 
        assert(entity != NULL);
-       assert(buffer != (uintptr_t)NULL);
        assert(length_written != NULL);
 
        fp = (file_state_t *) entity->info;
index 4abf44f7d2e21b0b4c4a62f5227dd6b033883695..9ca0a9dc9c2262dd3e0db38ef603f453045fc12f 100644 (file)
@@ -8,6 +8,7 @@
 #include <io_driver.h>
 #include <io_semihosting.h>
 #include <io_storage.h>
+#include <platform_def.h>
 #include <semihosting.h>
 
 
@@ -133,7 +134,6 @@ static int sh_file_read(io_entity_t *entity, uintptr_t buffer, size_t length,
        long file_handle;
 
        assert(entity != NULL);
-       assert(buffer != (uintptr_t)NULL);
        assert(length_read != NULL);
 
        file_handle = (long)entity->info;
@@ -158,7 +158,6 @@ static int sh_file_write(io_entity_t *entity, const uintptr_t buffer,
        size_t bytes = length;
 
        assert(entity != NULL);
-       assert(buffer != (uintptr_t)NULL);
        assert(length_written != NULL);
 
        file_handle = (long)entity->info;
index 0918de0a23daefb7ddb14c902e84818d266b1dc4..948f84813768d8c2204d4496cacd7adf9c1dbe4c 100644 (file)
@@ -279,7 +279,7 @@ int io_read(uintptr_t handle,
                size_t *length_read)
 {
        int result = -ENODEV;
-       assert(is_valid_entity(handle) && (buffer != (uintptr_t)NULL));
+       assert(is_valid_entity(handle));
 
        io_entity_t *entity = (io_entity_t *)handle;
 
@@ -299,7 +299,7 @@ int io_write(uintptr_t handle,
                size_t *length_written)
 {
        int result = -ENODEV;
-       assert(is_valid_entity(handle) && (buffer != (uintptr_t)NULL));
+       assert(is_valid_entity(handle));
 
        io_entity_t *entity = (io_entity_t *)handle;