Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 18 additions & 3 deletions arch/arm/src/samv7/sam_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

#include "arm_internal.h"
#include "sam_gpio.h"
#include "sam_periphclks.h"
#include "hardware/sam_pio.h"
#include "hardware/sam_matrix.h"

Expand Down Expand Up @@ -471,18 +472,32 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin,
*
****************************************************************************/

#if !defined(CONFIG_SAMV7_ERASE_ENABLE) || \
!defined(CONFIG_SAMV7_JTAG_FULL_ENABLE)
void sam_gpioinit(void)
{
#if !defined(CONFIG_SAMV7_ERASE_ENABLE) || \
!defined(CONFIG_SAMV7_JTAG_FULL_ENABLE)
uint32_t regval;

regval = getreg32(SAM_MATRIX_CCFG_SYSIO);
regval |= (SYSIO_ERASE_BIT | SYSIO_BITS);
putreg32(regval, SAM_MATRIX_CCFG_SYSIO);
}
#endif

sam_pioa_enableclk();
#if SAMV7_NPIO > 1
sam_piob_enableclk();
#endif
#if SAMV7_NPIO > 2
sam_pioc_enableclk();
#endif
#if SAMV7_NPIO > 3
sam_piod_enableclk();
#endif
#if SAMV7_NPIO > 4
sam_pioe_enableclk();
#endif
}

/****************************************************************************
* Name: sam_configgpio
*
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/src/samv7/sam_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,7 @@ static inline int sam_gpio_pinmask(gpio_pinset_t cfgset)
*
****************************************************************************/

#if !defined(CONFIG_SAMV7_ERASE_ENABLE) || \
!defined(CONFIG_SAMV7_JTAG_FULL_ENABLE)
void sam_gpioinit(void);
#else
# define sam_gpioinit()
#endif

/****************************************************************************
* Name: sam_gpioirqinitialize
Expand Down
21 changes: 0 additions & 21 deletions arch/arm/src/samv7/sam_gpioirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#include "arm_internal.h"
#include "sam_gpio.h"
#include "sam_periphclks.h"
#include "hardware/sam_pmc.h"
#include "hardware/sam_pio.h"

Expand Down Expand Up @@ -235,10 +234,6 @@ void sam_gpioirqinitialize(void)
/* Configure GPIOA interrupts */

#ifdef CONFIG_SAMV7_GPIOA_IRQ
/* Enable GPIOA clocking */

sam_pioa_enableclk();

/* Clear and disable all GPIOA interrupts */

getreg32(SAM_PIOA_ISR);
Expand All @@ -253,10 +248,6 @@ void sam_gpioirqinitialize(void)
/* Configure GPIOB interrupts */

#ifdef CONFIG_SAMV7_GPIOB_IRQ
/* Enable GPIOB clocking */

sam_piob_enableclk();

/* Clear and disable all GPIOB interrupts */

getreg32(SAM_PIOB_ISR);
Expand All @@ -271,10 +262,6 @@ void sam_gpioirqinitialize(void)
/* Configure GPIOC interrupts */

#ifdef CONFIG_SAMV7_GPIOC_IRQ
/* Enable GPIOC clocking */

sam_pioc_enableclk();

/* Clear and disable all GPIOC interrupts */

getreg32(SAM_PIOC_ISR);
Expand All @@ -289,10 +276,6 @@ void sam_gpioirqinitialize(void)
/* Configure GPIOD interrupts */

#ifdef CONFIG_SAMV7_GPIOD_IRQ
/* Enable GPIOD clocking */

sam_piod_enableclk();

/* Clear and disable all GPIOD interrupts */

getreg32(SAM_PIOD_ISR);
Expand All @@ -307,10 +290,6 @@ void sam_gpioirqinitialize(void)
/* Configure GPIOE interrupts */

#ifdef CONFIG_SAMV7_GPIOE_IRQ
/* Enable GPIOE clocking */

sam_pioe_enableclk();

/* Clear and disable all GPIOE interrupts */

getreg32(SAM_PIOE_ISR);
Expand Down
Loading