Skip to content
Permalink
Browse files

soc: same70: add support for revision B

This patch adds support for the revision B of the SAM E70 SoC. It adds
all the rev B part numbers, and when users pick-up one of those part
numbers, the revision B HAL is used instead.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
  • Loading branch information...
aurel32 authored and nashif committed Feb 7, 2019
1 parent 26512cb commit 997ab93595aaa5d7aadd7773e6e3e53837b0342d
@@ -1 +1,5 @@
zephyr_include_directories(${CONFIG_SOC_SERIES})
if(CONFIG_SOC_ATMEL_SAME70_REVB)
zephyr_include_directories(same70b)
else()
zephyr_include_directories(${CONFIG_SOC_SERIES})
endif()
@@ -12,7 +12,7 @@
#include <misc/__assert.h>
#include <misc/util.h>

#if ID_PERIPH_COUNT > 64
#if ID_PERIPH_COUNT > 74
#error "Unsupported SoC, update soc_pmc.c functions"
#endif

@@ -23,8 +23,12 @@ void soc_pmc_peripheral_enable(u32_t id)
if (id < 32) {
PMC->PMC_PCER0 = BIT(id);
#if ID_PERIPH_COUNT > 32
} else {
} else if (id < 64) {
PMC->PMC_PCER1 = BIT(id & 0x1F);
#endif
#if ID_PERIPH_COUNT > 64
} else {
/* Nothing to do, thes peripherals can't be enabled */
#endif
}
}
@@ -36,8 +40,12 @@ void soc_pmc_peripheral_disable(u32_t id)
if (id < 32) {
PMC->PMC_PCDR0 = BIT(id);
#if ID_PERIPH_COUNT > 32
} else {
} else if (id < 64) {
PMC->PMC_PCDR1 = BIT(id & 0x1F);
#endif
#if ID_PERIPH_COUNT > 64
} else {
/* Nothing to do, these peripherals can't be disabled */
#endif
}
}
@@ -49,8 +57,14 @@ u32_t soc_pmc_peripheral_is_enabled(u32_t id)
if (id < 32) {
return (PMC->PMC_PCSR0 & BIT(id)) != 0;
#if ID_PERIPH_COUNT > 32
} else {
} else if (id < 64) {
return (PMC->PMC_PCSR1 & BIT(id & 0x1F)) != 0;
#endif
#if ID_PERIPH_COUNT > 64
} else {
/* These peripherals are always enabled */
return 1;
#endif
}
return 0;
}
@@ -21,13 +21,24 @@ config SOC_PART_NUMBER
default "same70j21" if SOC_PART_NUMBER_SAME70J21
default "same70j20" if SOC_PART_NUMBER_SAME70J20
default "same70j19" if SOC_PART_NUMBER_SAME70J19
default "same70q21b" if SOC_PART_NUMBER_SAME70Q21B
default "same70q20b" if SOC_PART_NUMBER_SAME70Q20B
default "same70q19b" if SOC_PART_NUMBER_SAME70Q19B
default "same70n21b" if SOC_PART_NUMBER_SAME70N21B
default "same70n20b" if SOC_PART_NUMBER_SAME70N20B
default "same70n19b" if SOC_PART_NUMBER_SAME70N19B
default "same70j21b" if SOC_PART_NUMBER_SAME70J21B
default "same70j20b" if SOC_PART_NUMBER_SAME70J20B
default "same70j19b" if SOC_PART_NUMBER_SAME70J19B

#
# SAM E70 family has in total 71 peripherals capable of generating interrupts
# (not all Peripheral Identifiers are used).
# for the revision A and 74 for the revision B (not all Peripheral Identifiers
# are used).
#
config NUM_IRQS
int
default 74 if SOC_ATMEL_SAME70_REVB
default 71

config SYS_CLOCK_HW_CYCLES_PER_SEC
@@ -17,4 +17,6 @@ config SOC_SERIES_SAME70
help
Enable support for Atmel SAM E70 ARM Cortex-M7 Microcontrollers.
Part No.: SAME70J19, SAME70J20, SAME70J21, SAME70N19, SAME70N20,
SAME70N21, SAME70Q19, SAME70Q20, SAME70Q21
SAME70N21, SAME70Q19, SAME70Q20, SAME70Q21, SAME70J19B, SAME70J20B,
SAME70J21B, SAME70N19B, SAME70N20B, SAME70N21B, SAME70Q19B,
SAME70Q20B, SAME70Q21B
@@ -34,10 +34,49 @@ choice

config SOC_PART_NUMBER_SAME70J19
bool "SAME70J19"

config SOC_PART_NUMBER_SAME70Q21B
bool "SAME70Q21B"
select SOC_ATMEL_SAME70_REVB

config SOC_PART_NUMBER_SAME70Q20B
bool "SAME70Q20B"
select SOC_ATMEL_SAME70_REVB

config SOC_PART_NUMBER_SAME70Q19B
bool "SAME70Q19B"
select SOC_ATMEL_SAME70_REVB

config SOC_PART_NUMBER_SAME70N21B
bool "SAME70N21B"
select SOC_ATMEL_SAME70_REVB

config SOC_PART_NUMBER_SAME70N20B
bool "SAME70N20B"
select SOC_ATMEL_SAME70_REVB

config SOC_PART_NUMBER_SAME70N19B
bool "SAME70N19B"
select SOC_ATMEL_SAME70_REVB

config SOC_PART_NUMBER_SAME70J21B
bool "SAME70J21B"
select SOC_ATMEL_SAME70_REVB

config SOC_PART_NUMBER_SAME70J20B
bool "SAME70J20B"
select SOC_ATMEL_SAME70_REVB

config SOC_PART_NUMBER_SAME70J19B
bool "SAME70J19B"
select SOC_ATMEL_SAME70_REVB
endchoice

if SOC_SERIES_SAME70

config SOC_ATMEL_SAME70_REVB
bool

config SOC_ATMEL_SAME70_EXT_SLCK
bool "Use external crystal oscillator for slow clock"
help
@@ -37,6 +37,24 @@
#include <same70q20.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70Q21
#include <same70q21.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70J19B
#include <same70j19b.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70J20B
#include <same70j20b.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70J21B
#include <same70j21b.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70N19B
#include <same70n19b.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70N20B
#include <same70n20b.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70N21B
#include <same70n21b.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70Q19B
#include <same70q19b.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70Q20B
#include <same70q20b.h>
#elif defined CONFIG_SOC_PART_NUMBER_SAME70Q21B
#include <same70q21b.h>
#else
#error Library does not support the specified device.
#endif

0 comments on commit 997ab93

Please sign in to comment.
You can’t perform that action at this time.