This is an automated email from Gerrit.

Ivo Manca (pin...@gmail.com) just uploaded a new patch set to Gerrit, which you 
can find at http://openocd.zylin.com/3508

-- gerrit

commit 3ffda372f986b5af414cc0b7bff3b5ab3170fc44
Author: Ivo Manca <pin...@gmail.com>
Date:   Mon May 23 13:56:44 2016 +0200

    nand/orion: Add read_block_data support
    
    Use already available facilities to allow block reading for the
    Marvell Orion/Kirkwood SoCs.
    
    Change-Id: I6c7a5b3e8ed961f4e29a38d6b85b0e9dfa114ecf
    Signed-off-by: Ivo Manca <pin...@gmail.com>

diff --git a/src/flash/nand/orion.c b/src/flash/nand/orion.c
index 71f847b..7b8b6c6 100644
--- a/src/flash/nand/orion.c
+++ b/src/flash/nand/orion.c
@@ -76,6 +76,28 @@ static int orion_nand_read(struct nand_device *nand, void 
*data)
        return ERROR_OK;
 }
 
+static int orion_nand_read_block_data(struct nand_device *nand,
+               uint8_t *data, int data_size)
+{
+       struct orion_nand_controller *hw = nand->controller_priv;
+       struct target *target = nand->target;
+       int result;
+
+       CHECK_HALTED;
+       hw->io.chunk_size = nand->page_size;
+
+       /* try the fast way first */
+       result = arm_nandread(&hw->io, data, data_size);
+       if (result != ERROR_NAND_NO_BUFFER)
+               return result;
+
+       /* else do it slowly */
+       while (data_size--)
+               orion_nand_read(nand, data++);
+
+       return ERROR_OK;
+}
+
 static int orion_nand_write(struct nand_device *nand, uint16_t data)
 {
        struct orion_nand_controller *hw = nand->controller_priv;
@@ -157,6 +179,7 @@ struct nand_flash_controller orion_nand_controller = {
        .read_data = orion_nand_read,
        .write_data = orion_nand_write,
        .write_block_data = orion_nand_fast_block_write,
+       .read_block_data = orion_nand_read_block_data,
        .reset = orion_nand_reset,
        .nand_device_command = orion_nand_device_command,
        .init = orion_nand_init,

-- 

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to