Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
80b730c
[BACKPORT] Fix compilation of arm protected build
Sep 6, 2021
18be33a
[BACKPORT] stm32f7:USB otgdev Ensure proper EP state
davids5 Sep 9, 2021
01a6c9c
[BACKPORT] stm32h7:USB otgdev Ensure proper EP state
davids5 Sep 9, 2021
37bfdfe
[BACKPORT] stm32f4:USB otgdev Ensure proper EP state
davids5 Sep 9, 2021
561dc8a
[BACKPORT] arch/arm/stm32h7: dma and serial: add TRBUFF flag. It is o…
AlexanderVasiljev Aug 12, 2021
1363393
[BACKPORT] stm32h7:DMA_TRBUFF is DMA_SCR_TRBUFF
davids5 Sep 22, 2021
e234c47
[BACKPORT] stm32:Etablish device before enabling outputs
davids5 Sep 16, 2021
010a6dc
[BACKPORT] stm32F7:Etablish device before enabling outputs
davids5 Sep 17, 2021
23d9199
[BACKPORT] stm32H7:Etablish device before enabling outputs
davids5 Sep 17, 2021
ca1938f
[BACKPORT] stm32xx:sdmmc/sdio remove redundant GPIO config
davids5 Sep 21, 2021
05972ec
[BACKPORT] drivers/can: Fix can_poll() POLLOUT calculation
dagar Oct 21, 2021
2cdb10b
[BACKPORT] imxrt:syslog is dependant on arm_lowputc
davids5 Oct 21, 2021
fcab5de
[BACKPORT] armv7-m,armv7-r,armv8-m:MPU Add mpu_reset and ARM_MPU_EARL…
davids5 Sep 22, 2021
be0c480
[BACKPORT] stm32:Support CONFIG_MPU_RESET and CONFIG_ARM_MPU_EARLY_RESET
davids5 Sep 22, 2021
947ea10
[BACKPORT] stm32f7:Support CONFIG_MPU_RESET and CONFIG_ARM_MPU_EARLY_…
davids5 Sep 22, 2021
769bc6a
[BACKPORT] stm32h7:Support CONFIG_MPU_RESET and CONFIG_ARM_MPU_EARLY_…
davids5 Sep 22, 2021
f05dc8d
[BACKPORT] imxrt:mpu init handle dcache setting in MPU config
davids5 Oct 27, 2021
aa63cd1
[BACKPORT] imxrt mpuinit:Remove duplicate entry for ITCM (0x0)
davids5 Oct 27, 2021
7428f30
[BACKPORT] imxrt mpuinit:Set Data and Code Type to Normal
davids5 Oct 27, 2021
a28c1c9
[BACKPORT] imxrt:usdhc add proper support for dcache (wb)
davids5 Oct 28, 2021
f9378c5
[BACKPORT] imxrt:usbdev formatting cleanup
davids5 Nov 4, 2021
8cb7ad0
[BACKPORT] imxrt:usbdev Clean up cache maintainence
davids5 Oct 28, 2021
3749138
[BACKPORT] imxrt:usb DMA cache aligned Buffers for Endpoints
davids5 Nov 4, 2021
ec8f6f5
[BACKPORT] imxrt:usb Fix EP type allocation
davids5 Nov 4, 2021
d995b93
[BACKPORT] Move timespec calculations from sched into libc/sched
Nov 4, 2021
d5bc6c8
[BACKPORT] libs/libc/wqueue/work_usrthread.c: Correct time calculatio…
Nov 3, 2021
f702883
[BACKPORT] drivers/mmcsd: Pass the right buffer size to SDIO_DMAPREFL…
xiaoxiang781216 Sep 6, 2021
1f1da4d
[BACKPORT] stm32f7:sdmmc defer invalidate until after DMA completion
davids5 Nov 19, 2021
3b8e8ef
[BACKPORT] mtd/ramtron.c: Reassert CS between commands
ken-voly Jul 31, 2021
c150f15
[BACKPORT] bch/bchlib_cache.c: Fix error handling
ken-voly Aug 7, 2021
d300ac6
[BACKPORT] drivers/bch: Handle return value of bchlib_readsector()
ken-voly Aug 4, 2021
d4c06e9
[BACKPORT] ramtron:Remove errant code and definitions
davids5 Nov 25, 2021
378032a
[BACKPORT] stm32f7:sdmmc invalidate before DMA to avoid eviction over…
davids5 Dec 15, 2021
0a5f0d0
[BACKPORT] bch/ioctl: support FLUSH cache by cmd: BIOC_FLUSH
Donny9 Nov 30, 2021
451b1a9
[BACKPORT] stm32:Add OTG ID GPIO disable
davids5 Jan 21, 2022
017aa15
[BACKPORT] cdcacm:support returning c_cflag & speed via termios
davids5 Jan 27, 2022
78c6770
[NA UPSTREAM] serial_dma:Fix build when RXDMA is off
davids5 Feb 9, 2022
8c4598c
[BACKPORT] stm32h7:Fix build for all config {R|T}XDMA states
davids5 Feb 9, 2022
04789a7
[BACKPORT] stm32h7:flash Fix lock violations
davids5 Feb 11, 2022
c5c7d2b
[BACKPORT] stm32h7:flash can not use usleep
davids5 Feb 11, 2022
24fe171
[DIVERGED] sem_holder:Bug fix:Not restoring base priority
davids5 May 17, 2022
91bece5
[BACKPORT] libc/pthread:pthread_barrierinit sem use pri_none #5170
davids5 May 23, 2022
85bd35b
[BACKPORT] stm32f7: fix cache invalidation issue in Ethernet RX
pkarashchenko Aug 10, 2022
6bafcb2
[BACKPORT] stm32h7:SDMMC fix unaligned access fir buffers not on 32 b…
davids5 Sep 23, 2022
79cda5c
[BACKPORT] stm32f7:dma Remove CPU lock on HW fail
davids5 Feb 10, 2023
6a1d98a
[BACKPORT] stm32h7:dma Remove CPU lock on HW fail
davids5 Feb 16, 2023
4bab46d
[BACKPORT] stm32:dma v2 Remove CPU lock on HW fail
davids5 Feb 16, 2023
99e10d3
[BACKPORT] mmcsd_sdio:Release CPU during wait for Write Completion
davids5 Feb 10, 2023
eb66af0
[BACKPORT] mmcsd_sdio:Insure a error exiting via mmcsd_removed will n…
davids5 Feb 9, 2023
4a1dd86
[BACKPORT] sem_holder: IDLE thread will not boost up when IDLE hold sem
GUIDINGLI Jan 18, 2022
3dd7ed8
feat: QSPI 超时机制与 W25Q 驱动优化
TheMIrddddddddd Jul 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,34 @@ config ARM_MPU_NREGIONS
---help---
This is the number of protection regions supported by the MPU.

config ARM_MPU_RESET
bool "MPU Reset before MPU initialization"
default n
depends on ARM_MPU
---help---
Configures the MPU initialization sequence to disable the MPU
before configuring it.

This may be needed in a system with a bootloader that has
configured the MPU prior to running NuttX. This may be all that is
needed to allow booting if the previous MPU configuration allow
the system to execute the MPU initialization code. If not use
ARM_MPU_EARLY_RESET.

config ARM_MPU_EARLY_RESET
bool "MPU Early Reset"
default n
depends on ARCH_HAVE_MPU
---help---
Configures the early system initialization sequence to disable the MPU.

This may be needed in a system with a bootloader that has
configured the MPU prior to running NuttX. This is useful if the system
faults during bbs, or data initialization or before the
stm32_mpuinitialize can be called.

Note: This can be used without MPU Support enabled.

config ARCH_HAVE_LOWVECTORS
bool

Expand Down
57 changes: 57 additions & 0 deletions arch/arm/src/armv7-m/arm_mpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,33 @@ static inline uint32_t mpu_subregion_ls(size_t offset, uint8_t l2size)
return g_ls_regionmask[nsrs];
}

/****************************************************************************
* Name: mpu_reset_internal
*
* Description:
* Resets the MPU to disabled.
*
****************************************************************************/

#if defined(CONFIG_MPU_RESET) || defined(CONFIG_ARM_MPU_EARLY_RESET)
static void mpu_reset_internal()
{
int region;
int regions;
regions = (getreg32(MPU_TYPE) & MPU_TYPE_DREGION_MASK)
>> MPU_TYPE_DREGION_SHIFT;

for (region = 0; region < regions; region++)
{
putreg32(region, MPU_RNR);
putreg32(0, MPU_RASR);
putreg32(0, MPU_RBAR);
}

putreg32(0, MPU_CTRL);
}
#endif

/****************************************************************************
* Public Functions
****************************************************************************/
Expand Down Expand Up @@ -387,3 +414,33 @@ void mpu_configure_region(uintptr_t base, size_t size,
flags;
putreg32(regval, MPU_RASR);
}

/****************************************************************************
* Name: mpu_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled during
* MPU initialization.
*
****************************************************************************/
#if defined(CONFIG_MPU_RESET)
void mpu_reset()
{
mpu_reset_internal();
}
#endif

/****************************************************************************
* Name: mpu_early_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled immediately
* after reset.
*
****************************************************************************/
#if defined(CONFIG_ARM_MPU_EARLY_RESET)
void mpu_early_reset()
{
mpu_reset_internal();
}
#endif
30 changes: 30 additions & 0 deletions arch/arm/src/armv7-m/mpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,36 @@
# define MPU_RASR_AP_RORO (6 << MPU_RASR_AP_SHIFT) /* P:RO U:RO */
# define MPU_RASR_XN (1 << 28) /* Bit 28: Instruction access disable */

/****************************************************************************
* Name: mpu_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled during
* MPU initialization.
*
****************************************************************************/

#if defined(CONFIG_MPU_RESET)
void mpu_reset(void);
#else
# define mpu_reset() do { } while (0)
#endif

/****************************************************************************
* Name: mpu_early_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled immediately
* after reset.
*
****************************************************************************/

#if defined(CONFIG_ARM_MPU_EARLY_RESET)
void mpu_early_reset(void);
#else
# define mpu_early_reset() do { } while (0)
#endif

#ifdef CONFIG_ARM_MPU

/****************************************************************************
Expand Down
57 changes: 57 additions & 0 deletions arch/arm/src/armv7-r/arm_mpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,33 @@ static inline uint32_t mpu_subregion_ls(size_t offset, uint8_t l2size)
return g_ls_regionmask[nsrs];
}

/****************************************************************************
* Name: mpu_reset_internal
*
* Description:
* Resets the MPU to disabled.
*
****************************************************************************/

#if defined(CONFIG_MPU_RESET) || defined(CONFIG_ARM_MPU_EARLY_RESET)
static void mpu_reset_internal()
{
int region;
int regions;
regions = (getreg32(MPU_TYPE) & MPU_TYPE_DREGION_MASK)
>> MPU_TYPE_DREGION_SHIFT;

for (region = 0; region < regions; region++)
{
putreg32(region, MPU_RNR);
putreg32(0, MPU_RASR);
putreg32(0, MPU_RBAR);
}

putreg32(0, MPU_CTRL);
}
#endif

/****************************************************************************
* Public Functions
****************************************************************************/
Expand Down Expand Up @@ -300,3 +327,33 @@ uint32_t mpu_subregion(uintptr_t base, size_t size, uint8_t l2size)
ret |= mpu_subregion_ls(offset, l2size);
return ret;
}

/****************************************************************************
* Name: mpu_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled during
* MPU initialization.
*
****************************************************************************/
#if defined(CONFIG_MPU_RESET)
void mpu_reset()
{
mpu_reset_internal();
}
#endif

/****************************************************************************
* Name: mpu_early_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled immediately
* after reset.
*
****************************************************************************/
#if defined(CONFIG_ARM_MPU_EARLY_RESET)
void mpu_early_reset()
{
mpu_reset_internal();
}
#endif
30 changes: 30 additions & 0 deletions arch/arm/src/armv7-r/mpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,36 @@ extern "C"
#define EXTERN extern
#endif

/****************************************************************************
* Name: mpu_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled during
* MPU initialization.
*
****************************************************************************/

#if defined(CONFIG_MPU_RESET)
void mpu_reset(void);
#else
# define mpu_reset() do { } while (0)
#endif

/****************************************************************************
* Name: mpu_early_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled immediately
* after reset.
*
****************************************************************************/

#if defined(CONFIG_ARM_MPU_EARLY_RESET)
void mpu_early_reset(void);
#else
# define mpu_early_reset() do { } while (0)
#endif

/****************************************************************************
* Name: mpu_allocregion
*
Expand Down
57 changes: 57 additions & 0 deletions arch/arm/src/armv8-m/arm_mpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,33 @@ static inline uint32_t mpu_subregion_ls(size_t offset, uint8_t l2size)
return g_ls_regionmask[nsrs];
}

/****************************************************************************
* Name: mpu_reset_internal
*
* Description:
* Resets the MPU to disabled.
*
****************************************************************************/

#if defined(CONFIG_MPU_RESET) || defined(CONFIG_ARM_MPU_EARLY_RESET)
static void mpu_reset_internal()
{
int region;
int regions;
regions = (getreg32(MPU_TYPE) & MPU_TYPE_DREGION_MASK)
>> MPU_TYPE_DREGION_SHIFT;

for (region = 0; region < regions; region++)
{
putreg32(region, MPU_RNR);
putreg32(0, MPU_RASR);
putreg32(0, MPU_RBAR);
}

putreg32(0, MPU_CTRL);
}
#endif

/****************************************************************************
* Public Functions
****************************************************************************/
Expand Down Expand Up @@ -387,3 +414,33 @@ void mpu_configure_region(uintptr_t base, size_t size,
flags;
putreg32(regval, MPU_RASR);
}

/****************************************************************************
* Name: mpu_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled during
* MPU initialization.
*
****************************************************************************/
#if defined(CONFIG_MPU_RESET)
void mpu_reset()
{
mpu_reset_internal();
}
#endif

/****************************************************************************
* Name: mpu_early_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled immediately
* after reset.
*
****************************************************************************/
#if defined(CONFIG_ARM_MPU_EARLY_RESET)
void mpu_early_reset()
{
mpu_reset_internal();
}
#endif
30 changes: 30 additions & 0 deletions arch/arm/src/armv8-m/mpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,36 @@
# define MPU_RASR_AP_RORO (6 << MPU_RASR_AP_SHIFT) /* P:RO U:RO */
# define MPU_RASR_XN (1 << 28) /* Bit 28: Instruction access disable */

/****************************************************************************
* Name: mpu_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled during
* MPU initialization.
*
****************************************************************************/

#if defined(CONFIG_MPU_RESET)
void mpu_reset(void);
#else
# define mpu_reset() do { } while (0)
#endif

/****************************************************************************
* Name: mpu_early_reset
*
* Description:
* Conditional public interface that resets the MPU to disabled immediately
* after reset.
*
****************************************************************************/

#if defined(CONFIG_ARM_MPU_EARLY_RESET)
void mpu_early_reset(void);
#else
# define mpu_early_reset() do { } while (0)
#endif

#ifdef CONFIG_ARM_MPU

/****************************************************************************
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/src/common/arm_pthread_exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ void up_pthread_exit(pthread_exitroutine_t exit, FAR void *exit_value)
/* Let sys_call2() do all of the work */

sys_call2(SYS_pthread_exit, (uintptr_t)exit, (uintptr_t)exit_value);

/* Suppress "'noreturn' function does return" warning */

while (1);
}

#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ && !CONFIG_DISABLE_PTHREAD */
4 changes: 3 additions & 1 deletion arch/arm/src/imxrt/imxrt_lowputc.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,10 @@ int imxrt_lpuart_configure(uint32_t base,
*
****************************************************************************/

#if defined(HAVE_LPUART_DEVICE) && defined(CONFIG_DEBUG_FEATURES)
#if defined(HAVE_LPUART_DEVICE)
void imxrt_lowputc(int ch)
{
#ifdef HAVE_LPUART_CONSOLE
while ((getreg32(IMXRT_CONSOLE_BASE + IMXRT_LPUART_STAT_OFFSET) &
LPUART_STAT_TDRE) == 0)
{
Expand Down Expand Up @@ -599,5 +600,6 @@ void imxrt_lowputc(int ch)
/* Send the character by writing it into the UART_TXD register. */

putreg32((uint32_t)ch, IMXRT_CONSOLE_BASE + IMXRT_LPUART_DATA_OFFSET);
#endif
}
#endif
2 changes: 1 addition & 1 deletion arch/arm/src/imxrt/imxrt_lowputc.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int imxrt_lpuart_configure(uint32_t base,
*
****************************************************************************/

#if defined(HAVE_LPUART_DEVICE) && defined(CONFIG_DEBUG_FEATURES)
#if defined(HAVE_LPUART_DEVICE)
void imxrt_lowputc(int ch);
#else
# define imxrt_lowputc(ch)
Expand Down
Loading