arch/arm/src/armv7-a: Replicate the same fix was previously commited for the armv7-r.
This commit is contained in:
parent
0f18e8cc32
commit
b823fd83bd
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-a/cp15_flush_dcache.S
|
* arch/arm/src/armv7-a/cp15_flush_dcache.S
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* References:
|
* References:
|
||||||
@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
cp15_flush_dcache:
|
cp15_flush_dcache:
|
||||||
|
|
||||||
mrc CP15_CTR(r3) /* Read the Cache Type Register */
|
mrc CP15_CTR(r3) /* Read the Cache Type Register */
|
||||||
lsr r3, r3, #16 /* Isolate the DMinLine field */
|
lsr r3, r3, #16 /* Isolate the DMinLine field */
|
||||||
and r3, r3, #0xf
|
and r3, r3, #0xf
|
||||||
mov r2, #4
|
mov r2, #4
|
||||||
@ -104,7 +104,7 @@ cp15_flush_dcache:
|
|||||||
/* Loop, cleaning and invaliding each D cache line in the address range */
|
/* Loop, cleaning and invaliding each D cache line in the address range */
|
||||||
|
|
||||||
1:
|
1:
|
||||||
mcrne CP15_DCCIMVAC(r0) /* Clean and invalidate data cache line by VA to PoC */
|
mcr CP15_DCCIMVAC(r0) /* Clean and invalidate data cache line by VA to PoC */
|
||||||
add r0, r0, r2 /* R12=Next cache line */
|
add r0, r0, r2 /* R12=Next cache line */
|
||||||
cmp r0, r1 /* Loop until all cache lines have been cleaned */
|
cmp r0, r1 /* Loop until all cache lines have been cleaned */
|
||||||
blo 1b
|
blo 1b
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-r/cp15_flush_dcache.S
|
* arch/arm/src/armv7-r/cp15_flush_dcache.S
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* References:
|
* References:
|
||||||
@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
cp15_flush_dcache:
|
cp15_flush_dcache:
|
||||||
|
|
||||||
mrc CP15_CTR(r3) /* Read the Cache Type Register */
|
mrc CP15_CTR(r3) /* Read the Cache Type Register */
|
||||||
lsr r3, r3, #16 /* Isolate the DMinLine field */
|
lsr r3, r3, #16 /* Isolate the DMinLine field */
|
||||||
and r3, r3, #0xf
|
and r3, r3, #0xf
|
||||||
mov r2, #4
|
mov r2, #4
|
||||||
@ -104,7 +104,7 @@ cp15_flush_dcache:
|
|||||||
/* Loop, cleaning and invaliding each D cache line in the address range */
|
/* Loop, cleaning and invaliding each D cache line in the address range */
|
||||||
|
|
||||||
1:
|
1:
|
||||||
mcr CP15_DCCIMVAC(r0) /* Clean and invalidate data cache line by VA to PoC */
|
mcr CP15_DCCIMVAC(r0) /* Clean and invalidate data cache line by VA to PoC */
|
||||||
add r0, r0, r2 /* R12=Next cache line */
|
add r0, r0, r2 /* R12=Next cache line */
|
||||||
cmp r0, r1 /* Loop until all cache lines have been cleaned */
|
cmp r0, r1 /* Loop until all cache lines have been cleaned */
|
||||||
blo 1b
|
blo 1b
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* drivers/mtd/mtd_progmem.c
|
* drivers/mtd/mtd_progmem.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -225,8 +225,9 @@ static ssize_t progmem_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
|
|||||||
FAR struct progmem_dev_s *priv = (FAR struct progmem_dev_s *)dev;
|
FAR struct progmem_dev_s *priv = (FAR struct progmem_dev_s *)dev;
|
||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* Write the specified blocks from the provided user buffer and return status
|
/* Write the specified blocks from the provided user buffer and return
|
||||||
* (The positive, number of blocks actually written or a negated errno)
|
* status (The positive, number of blocks actually written or a negated
|
||||||
|
* errno)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
result = up_progmem_write(up_progmem_getaddress(startblock), buffer,
|
result = up_progmem_write(up_progmem_getaddress(startblock), buffer,
|
||||||
@ -256,7 +257,7 @@ static ssize_t progmem_read(FAR struct mtd_dev_s *dev, off_t offset,
|
|||||||
|
|
||||||
startblock = offset >> priv->blkshift;
|
startblock = offset >> priv->blkshift;
|
||||||
src = (FAR const uint8_t *)up_progmem_getaddress(startblock) +
|
src = (FAR const uint8_t *)up_progmem_getaddress(startblock) +
|
||||||
(offset & ((1 << priv->blkshift) - 1));
|
(offset & ((1 << priv->blkshift) - 1));
|
||||||
memcpy(buffer, src, nbytes);
|
memcpy(buffer, src, nbytes);
|
||||||
return nbytes;
|
return nbytes;
|
||||||
}
|
}
|
||||||
@ -284,7 +285,7 @@ static ssize_t progmem_write(FAR struct mtd_dev_s *dev, off_t offset,
|
|||||||
|
|
||||||
startblock = offset >> priv->blkshift;
|
startblock = offset >> priv->blkshift;
|
||||||
result = up_progmem_write(up_progmem_getaddress(startblock) +
|
result = up_progmem_write(up_progmem_getaddress(startblock) +
|
||||||
(offset & ((1 << priv->blkshift) - 1)), buffer, nbytes);
|
(offset & ((1 << priv->blkshift) - 1)), buffer, nbytes);
|
||||||
return result < 0 ? result : nbytes;
|
return result < 0 ? result : nbytes;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -314,9 +315,9 @@ static int progmem_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||||||
* appear so.
|
* appear so.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
geo->blocksize = (1 << priv->blkshift); /* Size of one read/write block */
|
geo->blocksize = (1 << priv->blkshift); /* Size of one read/write block */
|
||||||
geo->erasesize = (1 << priv->ersshift); /* Size of one erase block */
|
geo->erasesize = (1 << priv->ersshift); /* Size of one erase block */
|
||||||
geo->neraseblocks = up_progmem_neraseblocks(); /* Number of erase blocks */
|
geo->neraseblocks = up_progmem_neraseblocks(); /* Number of erase blocks */
|
||||||
ret = OK;
|
ret = OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user