Skip to content

Commit

Permalink
ARN: at91: introduce SOC_AT91xxx define to allow to compile SoC core …
Browse files Browse the repository at this point in the history
…support

We can now compile all SoC core support together and DT boards.
We still can not compile together the non DT board.
So We keep the ARCH_AT91xxx for the non DT board and for backward defconfig
compatibility. This will enable the plaform_device ressources.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
  • Loading branch information
Jean-Christophe PLAGNIOL-VILLARD authored and Nicolas Ferre committed Apr 17, 2012
1 parent 1441bd3 commit 1e3ce2b
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 62 deletions.
1 change: 1 addition & 0 deletions arch/arm/configs/at91rm9200_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_IOSCHED_CFQ is not set
CONFIG_ARCH_AT91=y
CONFIG_ARCH_AT91RM9200=y
CONFIG_MACH_ONEARM=y
CONFIG_ARCH_AT91RM9200DK=y
CONFIG_MACH_AT91RM9200EK=y
Expand Down
91 changes: 64 additions & 27 deletions arch/arm/mach-at91/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,77 +24,114 @@ config SOC_AT91SAM9

menu "Atmel AT91 System-on-Chip"

choice
prompt "Atmel AT91 Processor"
comment "Atmel AT91 Processor"

config ARCH_AT91RM9200
config SOC_AT91SAM9
bool
select CPU_ARM926T
select AT91_SAM9_TIME
select AT91_SAM9_SMC

config SOC_AT91RM9200
bool "AT91RM9200"
select CPU_ARM920T
select GENERIC_CLOCKEVENTS
select HAVE_AT91_DBGU0

config ARCH_AT91SAM9260
bool "AT91SAM9260 or AT91SAM9XE"
config SOC_AT91SAM9260
bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
select SOC_AT91SAM9
select HAVE_AT91_DBGU0
select HAVE_NET_MACB
help
Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
or AT91SAM9G20 SoC.

config ARCH_AT91SAM9261
bool "AT91SAM9261"
select SOC_AT91SAM9
select HAVE_FB_ATMEL
select HAVE_AT91_DBGU0

config ARCH_AT91SAM9G10
bool "AT91SAM9G10"
config SOC_AT91SAM9261
bool "AT91SAM9261 or AT91SAM9G10"
select SOC_AT91SAM9
select HAVE_AT91_DBGU0
select HAVE_FB_ATMEL
help
Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.

config ARCH_AT91SAM9263
config SOC_AT91SAM9263
bool "AT91SAM9263"
select SOC_AT91SAM9
select HAVE_AT91_DBGU1
select HAVE_FB_ATMEL
select HAVE_NET_MACB
select HAVE_AT91_DBGU1

config ARCH_AT91SAM9RL
config SOC_AT91SAM9RL
bool "AT91SAM9RL"
select SOC_AT91SAM9
select HAVE_FB_ATMEL
select HAVE_AT91_DBGU0
select HAVE_FB_ATMEL

config ARCH_AT91SAM9G20
bool "AT91SAM9G20"
select SOC_AT91SAM9
select HAVE_AT91_DBGU0
select HAVE_NET_MACB

config ARCH_AT91SAM9G45
config SOC_AT91SAM9G45
bool "AT91SAM9G45 or AT91SAM9M10 families"
select SOC_AT91SAM9
select HAVE_AT91_DBGU1
select HAVE_FB_ATMEL
select HAVE_NET_MACB
select HAVE_AT91_DBGU1
help
Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.

config ARCH_AT91SAM9X5
config SOC_AT91SAM9X5
bool "AT91SAM9x5 family"
select SOC_AT91SAM9
select HAVE_AT91_DBGU0
select HAVE_FB_ATMEL
select HAVE_NET_MACB
select HAVE_AT91_DBGU0
help
Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
This means that your SAM9 name finishes with a '5' (except if it is
AT91SAM9G45!).
This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35
and AT91SAM9X35.

choice
prompt "Atmel AT91 Processor Devices for non DT boards"

config ARCH_AT91_NONE
bool "None"

config ARCH_AT91RM9200
bool "AT91RM9200"
select SOC_AT91RM9200

config ARCH_AT91SAM9260
bool "AT91SAM9260 or AT91SAM9XE"
select SOC_AT91SAM9260

config ARCH_AT91SAM9261
bool "AT91SAM9261"
select SOC_AT91SAM9261

config ARCH_AT91SAM9G10
bool "AT91SAM9G10"
select SOC_AT91SAM9261

config ARCH_AT91SAM9263
bool "AT91SAM9263"
select SOC_AT91SAM9263

config ARCH_AT91SAM9RL
bool "AT91SAM9RL"
select SOC_AT91SAM9RL

config ARCH_AT91SAM9G20
bool "AT91SAM9G20"
select SOC_AT91SAM9260

config ARCH_AT91SAM9G45
bool "AT91SAM9G45"
select SOC_AT91SAM9G45

config ARCH_AT91X40
bool "AT91x40"
depends on !MMU
select ARCH_USES_GETTIMEOFFSET

endchoice
Expand Down
25 changes: 16 additions & 9 deletions arch/arm/mach-at91/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@ obj-$(CONFIG_AT91_SAM9G45_RESET) += at91sam9g45_reset.o
obj-$(CONFIG_SOC_AT91SAM9) += at91sam926x_time.o sam9_smc.o

# CPU-specific support
obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam9260_devices.o
obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam9261_devices.o
obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam9261_devices.o
obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam9263_devices.o
obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam9rl_devices.o
obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam9260_devices.o
obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam9g45_devices.o
obj-$(CONFIG_ARCH_AT91SAM9X5) += at91sam9x5.o
obj-$(CONFIG_SOC_AT91RM9200) += at91rm9200.o at91rm9200_time.o
obj-$(CONFIG_SOC_AT91SAM9260) += at91sam9260.o
obj-$(CONFIG_SOC_AT91SAM9261) += at91sam9261.o
obj-$(CONFIG_SOC_AT91SAM9263) += at91sam9263.o
obj-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45.o
obj-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5.o
obj-$(CONFIG_SOC_AT91SAM9RL) += at91sam9rl.o

obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200_devices.o
obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260_devices.o
obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261_devices.o
obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261_devices.o
obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263_devices.o
obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl_devices.o
obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260_devices.o
obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45_devices.o
obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o

# AT91RM9200 board-specific support
Expand Down
28 changes: 11 additions & 17 deletions arch/arm/mach-at91/include/mach/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define ARCH_REVISON_9200_BGA (0 << 0)
#define ARCH_REVISON_9200_PQFP (1 << 0)

#ifndef __ASSEMBLY__
enum at91_soc_type {
/* 920T */
AT91_SOC_RM9200,
Expand Down Expand Up @@ -106,7 +107,7 @@ static inline int at91_soc_is_detected(void)
return at91_soc_initdata.type != AT91_SOC_NONE;
}

#ifdef CONFIG_ARCH_AT91RM9200
#ifdef CONFIG_SOC_AT91RM9200
#define cpu_is_at91rm9200() (at91_soc_initdata.type == AT91_SOC_RM9200)
#define cpu_is_at91rm9200_bga() (at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA)
#define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP)
Expand All @@ -116,45 +117,37 @@ static inline int at91_soc_is_detected(void)
#define cpu_is_at91rm9200_pqfp() (0)
#endif

#ifdef CONFIG_ARCH_AT91SAM9260
#ifdef CONFIG_SOC_AT91SAM9260
#define cpu_is_at91sam9xe() (at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
#define cpu_is_at91sam9260() (at91_soc_initdata.type == AT91_SOC_SAM9260)
#define cpu_is_at91sam9g20() (at91_soc_initdata.type == AT91_SOC_SAM9G20)
#else
#define cpu_is_at91sam9xe() (0)
#define cpu_is_at91sam9260() (0)
#endif

#ifdef CONFIG_ARCH_AT91SAM9G20
#define cpu_is_at91sam9g20() (at91_soc_initdata.type == AT91_SOC_SAM9G20)
#else
#define cpu_is_at91sam9g20() (0)
#endif

#ifdef CONFIG_ARCH_AT91SAM9261
#ifdef CONFIG_SOC_AT91SAM9261
#define cpu_is_at91sam9261() (at91_soc_initdata.type == AT91_SOC_SAM9261)
#else
#define cpu_is_at91sam9261() (0)
#endif

#ifdef CONFIG_ARCH_AT91SAM9G10
#define cpu_is_at91sam9g10() (at91_soc_initdata.type == AT91_SOC_SAM9G10)
#else
#define cpu_is_at91sam9261() (0)
#define cpu_is_at91sam9g10() (0)
#endif

#ifdef CONFIG_ARCH_AT91SAM9263
#ifdef CONFIG_SOC_AT91SAM9263
#define cpu_is_at91sam9263() (at91_soc_initdata.type == AT91_SOC_SAM9263)
#else
#define cpu_is_at91sam9263() (0)
#endif

#ifdef CONFIG_ARCH_AT91SAM9RL
#ifdef CONFIG_SOC_AT91SAM9RL
#define cpu_is_at91sam9rl() (at91_soc_initdata.type == AT91_SOC_SAM9RL)
#else
#define cpu_is_at91sam9rl() (0)
#endif

#ifdef CONFIG_ARCH_AT91SAM9G45
#ifdef CONFIG_SOC_AT91SAM9G45
#define cpu_is_at91sam9g45() (at91_soc_initdata.type == AT91_SOC_SAM9G45)
#define cpu_is_at91sam9g45es() (at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
#define cpu_is_at91sam9m10() (at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
Expand All @@ -168,7 +161,7 @@ static inline int at91_soc_is_detected(void)
#define cpu_is_at91sam9m11() (0)
#endif

#ifdef CONFIG_ARCH_AT91SAM9X5
#ifdef CONFIG_SOC_AT91SAM9X5
#define cpu_is_at91sam9x5() (at91_soc_initdata.type == AT91_SOC_SAM9X5)
#define cpu_is_at91sam9g15() (at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
#define cpu_is_at91sam9g35() (at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
Expand All @@ -189,5 +182,6 @@ static inline int at91_soc_is_detected(void)
* definitions may reduce clutter in common drivers.
*/
#define cpu_is_at32ap7000() (0)
#endif /* __ASSEMBLY__ */

#endif /* __MACH_CPU_H__ */
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static inline void at91sam9g45_standby(void)
at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1);
}

#ifdef CONFIG_ARCH_AT91SAM9263
#ifdef CONFIG_SOC_AT91SAM9263
/*
* FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
* handle those cases both here and in the Suspend-To-RAM support.
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/pm_slowclock.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <mach/at91_ramc.h>


#ifdef CONFIG_ARCH_AT91SAM9263
#ifdef CONFIG_SOC_AT91SAM9263
/*
* FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
* handle those cases both here and in the Suspend-To-RAM support.
Expand Down
14 changes: 7 additions & 7 deletions arch/arm/mach-at91/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ static inline int at91_soc_is_enabled(void)
return at91_boot_soc.init != NULL;
}

#if !defined(CONFIG_ARCH_AT91RM9200)
#if !defined(CONFIG_SOC_AT91RM9200)
#define at91rm9200_soc at91_boot_soc
#endif

#if !(defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20))
#if !defined(CONFIG_SOC_AT91SAM9260)
#define at91sam9260_soc at91_boot_soc
#endif

#if !(defined(CONFIG_ARCH_AT91SAM9261) || defined(CONFIG_ARCH_AT91SAM9G10))
#if !defined(CONFIG_SOC_AT91SAM9261)
#define at91sam9261_soc at91_boot_soc
#endif

#if !defined(CONFIG_ARCH_AT91SAM9263)
#if !defined(CONFIG_SOC_AT91SAM9263)
#define at91sam9263_soc at91_boot_soc
#endif

#if !defined(CONFIG_ARCH_AT91SAM9G45)
#if !defined(CONFIG_SOC_AT91SAM9G45)
#define at91sam9g45_soc at91_boot_soc
#endif

#if !defined(CONFIG_ARCH_AT91SAM9RL)
#if !defined(CONFIG_SOC_AT91SAM9RL)
#define at91sam9rl_soc at91_boot_soc
#endif

#if !defined(CONFIG_ARCH_AT91SAM9X5)
#if !defined(CONFIG_SOC_AT91SAM9X5)
#define at91sam9x5_soc at91_boot_soc
#endif

0 comments on commit 1e3ce2b

Please sign in to comment.