diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2017-05-19 04:35:10 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2017-06-12 05:31:07 -0400 |
commit | 8be381a131c29c4737aed44e7e5f90cb77bb4a7e (patch) | |
tree | 60853ecd9165ff9166a77d0a876e267074c09808 | |
parent | 7b4ccb3c466f62bbf2f4dd5d6a143d945a6f3051 (diff) |
soc: renesas: Rework Kconfig and Makefile logic
The goals are to:
- Allow precise control over and automatic selection of which
(sub)drivers are used for which SoC,
- Allow adding support for new SoCs easily,
- Allow compile-testing of all (sub)drivers,
- Keep driver selection logic in the subsystem-specific Kconfig,
independent from the architecture-specific Kconfig (i.e. no "select"
from arch/arm64/Kconfig.platforms), to avoid dependencies.
This is implemented by:
- Introducing Kconfig symbols for all drivers and sub-drivers,
- Introducing the Kconfig symbol SOC_RENESAS, which is enabled
automatically when building for a Renesas ARM platform, and which
enables all required drivers without interaction of the user, based
on SoC-specific ARCH_* symbols,
- Allowing the user to enable any Kconfig symbol manually if
COMPILE_TEST is enabled,
- Using the new Kconfig symbols instead of the ARCH_* symbols to
control compilation in the Makefile,
- Always entering drivers/soc/renesas/ during the build.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | drivers/soc/Kconfig | 1 | ||||
-rw-r--r-- | drivers/soc/Makefile | 2 | ||||
-rw-r--r-- | drivers/soc/renesas/Kconfig | 63 | ||||
-rw-r--r-- | drivers/soc/renesas/Makefile | 31 | ||||
-rw-r--r-- | drivers/soc/renesas/rcar-sysc.c | 24 | ||||
-rw-r--r-- | include/linux/soc/renesas/rcar-rst.h | 3 |
6 files changed, 92 insertions, 32 deletions
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index f09023f7ab11..de4fcdbae2a8 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig | |||
@@ -4,6 +4,7 @@ source "drivers/soc/bcm/Kconfig" | |||
4 | source "drivers/soc/fsl/Kconfig" | 4 | source "drivers/soc/fsl/Kconfig" |
5 | source "drivers/soc/mediatek/Kconfig" | 5 | source "drivers/soc/mediatek/Kconfig" |
6 | source "drivers/soc/qcom/Kconfig" | 6 | source "drivers/soc/qcom/Kconfig" |
7 | source "drivers/soc/renesas/Kconfig" | ||
7 | source "drivers/soc/rockchip/Kconfig" | 8 | source "drivers/soc/rockchip/Kconfig" |
8 | source "drivers/soc/samsung/Kconfig" | 9 | source "drivers/soc/samsung/Kconfig" |
9 | source "drivers/soc/sunxi/Kconfig" | 10 | source "drivers/soc/sunxi/Kconfig" |
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index 05eae52a30b4..59d8c937f4a8 100644 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile | |||
@@ -8,7 +8,7 @@ obj-$(CONFIG_MACH_DOVE) += dove/ | |||
8 | obj-y += fsl/ | 8 | obj-y += fsl/ |
9 | obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/ | 9 | obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/ |
10 | obj-$(CONFIG_ARCH_QCOM) += qcom/ | 10 | obj-$(CONFIG_ARCH_QCOM) += qcom/ |
11 | obj-$(CONFIG_ARCH_RENESAS) += renesas/ | 11 | obj-y += renesas/ |
12 | obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ | 12 | obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ |
13 | obj-$(CONFIG_SOC_SAMSUNG) += samsung/ | 13 | obj-$(CONFIG_SOC_SAMSUNG) += samsung/ |
14 | obj-$(CONFIG_ARCH_SUNXI) += sunxi/ | 14 | obj-$(CONFIG_ARCH_SUNXI) += sunxi/ |
diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig new file mode 100644 index 000000000000..87a4be46bd98 --- /dev/null +++ b/drivers/soc/renesas/Kconfig | |||
@@ -0,0 +1,63 @@ | |||
1 | config SOC_RENESAS | ||
2 | bool "Renesas SoC driver support" if COMPILE_TEST && !ARCH_RENESAS | ||
3 | default y if ARCH_RENESAS | ||
4 | select SOC_BUS | ||
5 | select RST_RCAR if ARCH_RCAR_GEN1 || ARCH_RCAR_GEN2 || \ | ||
6 | ARCH_R8A7795 || ARCH_R8A7796 | ||
7 | select SYSC_R8A7743 if ARCH_R8A7743 | ||
8 | select SYSC_R8A7745 if ARCH_R8A7745 | ||
9 | select SYSC_R8A7779 if ARCH_R8A7779 | ||
10 | select SYSC_R8A7790 if ARCH_R8A7790 | ||
11 | select SYSC_R8A7791 if ARCH_R8A7791 || ARCH_R8A7793 | ||
12 | select SYSC_R8A7792 if ARCH_R8A7792 | ||
13 | select SYSC_R8A7794 if ARCH_R8A7794 | ||
14 | select SYSC_R8A7795 if ARCH_R8A7795 | ||
15 | select SYSC_R8A7796 if ARCH_R8A7796 | ||
16 | |||
17 | if SOC_RENESAS | ||
18 | |||
19 | # SoC | ||
20 | config SYSC_R8A7743 | ||
21 | bool "RZ/G1M System Controller support" if COMPILE_TEST | ||
22 | select SYSC_RCAR | ||
23 | |||
24 | config SYSC_R8A7745 | ||
25 | bool "RZ/G1E System Controller support" if COMPILE_TEST | ||
26 | select SYSC_RCAR | ||
27 | |||
28 | config SYSC_R8A7779 | ||
29 | bool "R-Car H1 System Controller support" if COMPILE_TEST | ||
30 | select SYSC_RCAR | ||
31 | |||
32 | config SYSC_R8A7790 | ||
33 | bool "R-Car H2 System Controller support" if COMPILE_TEST | ||
34 | select SYSC_RCAR | ||
35 | |||
36 | config SYSC_R8A7791 | ||
37 | bool "R-Car M2-W/N System Controller support" if COMPILE_TEST | ||
38 | select SYSC_RCAR | ||
39 | |||
40 | config SYSC_R8A7792 | ||
41 | bool "R-Car V2H System Controller support" if COMPILE_TEST | ||
42 | select SYSC_RCAR | ||
43 | |||
44 | config SYSC_R8A7794 | ||
45 | bool "R-Car E2 System Controller support" if COMPILE_TEST | ||
46 | select SYSC_RCAR | ||
47 | |||
48 | config SYSC_R8A7795 | ||
49 | bool "R-Car H3 System Controller support" if COMPILE_TEST | ||
50 | select SYSC_RCAR | ||
51 | |||
52 | config SYSC_R8A7796 | ||
53 | bool "R-Car M3-W System Controller support" if COMPILE_TEST | ||
54 | select SYSC_RCAR | ||
55 | |||
56 | # Family | ||
57 | config RST_RCAR | ||
58 | bool "R-Car Reset Controller support" if COMPILE_TEST | ||
59 | |||
60 | config SYSC_RCAR | ||
61 | bool "R-Car System Controller support" if COMPILE_TEST | ||
62 | |||
63 | endif # SOC_RENESAS | ||
diff --git a/drivers/soc/renesas/Makefile b/drivers/soc/renesas/Makefile index d9115cb5ed9d..1a1a297b26a7 100644 --- a/drivers/soc/renesas/Makefile +++ b/drivers/soc/renesas/Makefile | |||
@@ -1,18 +1,17 @@ | |||
1 | obj-$(CONFIG_SOC_BUS) += renesas-soc.o | 1 | # Generic, must be first because of soc_device_register() |
2 | obj-$(CONFIG_SOC_RENESAS) += renesas-soc.o | ||
2 | 3 | ||
3 | obj-$(CONFIG_ARCH_RCAR_GEN1) += rcar-rst.o | 4 | # SoC |
4 | obj-$(CONFIG_ARCH_RCAR_GEN2) += rcar-rst.o | 5 | obj-$(CONFIG_SYSC_R8A7743) += r8a7743-sysc.o |
5 | obj-$(CONFIG_ARCH_R8A7795) += rcar-rst.o | 6 | obj-$(CONFIG_SYSC_R8A7745) += r8a7745-sysc.o |
6 | obj-$(CONFIG_ARCH_R8A7796) += rcar-rst.o | 7 | obj-$(CONFIG_SYSC_R8A7779) += r8a7779-sysc.o |
8 | obj-$(CONFIG_SYSC_R8A7790) += r8a7790-sysc.o | ||
9 | obj-$(CONFIG_SYSC_R8A7791) += r8a7791-sysc.o | ||
10 | obj-$(CONFIG_SYSC_R8A7792) += r8a7792-sysc.o | ||
11 | obj-$(CONFIG_SYSC_R8A7794) += r8a7794-sysc.o | ||
12 | obj-$(CONFIG_SYSC_R8A7795) += r8a7795-sysc.o | ||
13 | obj-$(CONFIG_SYSC_R8A7796) += r8a7796-sysc.o | ||
7 | 14 | ||
8 | obj-$(CONFIG_ARCH_R8A7743) += rcar-sysc.o r8a7743-sysc.o | 15 | # Family |
9 | obj-$(CONFIG_ARCH_R8A7745) += rcar-sysc.o r8a7745-sysc.o | 16 | obj-$(CONFIG_RST_RCAR) += rcar-rst.o |
10 | obj-$(CONFIG_ARCH_R8A7779) += rcar-sysc.o r8a7779-sysc.o | 17 | obj-$(CONFIG_SYSC_RCAR) += rcar-sysc.o |
11 | obj-$(CONFIG_ARCH_R8A7790) += rcar-sysc.o r8a7790-sysc.o | ||
12 | obj-$(CONFIG_ARCH_R8A7791) += rcar-sysc.o r8a7791-sysc.o | ||
13 | obj-$(CONFIG_ARCH_R8A7792) += rcar-sysc.o r8a7792-sysc.o | ||
14 | # R-Car M2-N is identical to R-Car M2-W w.r.t. power domains. | ||
15 | obj-$(CONFIG_ARCH_R8A7793) += rcar-sysc.o r8a7791-sysc.o | ||
16 | obj-$(CONFIG_ARCH_R8A7794) += rcar-sysc.o r8a7794-sysc.o | ||
17 | obj-$(CONFIG_ARCH_R8A7795) += rcar-sysc.o r8a7795-sysc.o | ||
18 | obj-$(CONFIG_ARCH_R8A7796) += rcar-sysc.o r8a7796-sysc.o | ||
diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c index 225c35c79d9a..4d0125dff787 100644 --- a/drivers/soc/renesas/rcar-sysc.c +++ b/drivers/soc/renesas/rcar-sysc.c | |||
@@ -275,35 +275,33 @@ finalize: | |||
275 | } | 275 | } |
276 | 276 | ||
277 | static const struct of_device_id rcar_sysc_matches[] = { | 277 | static const struct of_device_id rcar_sysc_matches[] = { |
278 | #ifdef CONFIG_ARCH_R8A7743 | 278 | #ifdef CONFIG_SYSC_R8A7743 |
279 | { .compatible = "renesas,r8a7743-sysc", .data = &r8a7743_sysc_info }, | 279 | { .compatible = "renesas,r8a7743-sysc", .data = &r8a7743_sysc_info }, |
280 | #endif | 280 | #endif |
281 | #ifdef CONFIG_ARCH_R8A7745 | 281 | #ifdef CONFIG_SYSC_R8A7745 |
282 | { .compatible = "renesas,r8a7745-sysc", .data = &r8a7745_sysc_info }, | 282 | { .compatible = "renesas,r8a7745-sysc", .data = &r8a7745_sysc_info }, |
283 | #endif | 283 | #endif |
284 | #ifdef CONFIG_ARCH_R8A7779 | 284 | #ifdef CONFIG_SYSC_R8A7779 |
285 | { .compatible = "renesas,r8a7779-sysc", .data = &r8a7779_sysc_info }, | 285 | { .compatible = "renesas,r8a7779-sysc", .data = &r8a7779_sysc_info }, |
286 | #endif | 286 | #endif |
287 | #ifdef CONFIG_ARCH_R8A7790 | 287 | #ifdef CONFIG_SYSC_R8A7790 |
288 | { .compatible = "renesas,r8a7790-sysc", .data = &r8a7790_sysc_info }, | 288 | { .compatible = "renesas,r8a7790-sysc", .data = &r8a7790_sysc_info }, |
289 | #endif | 289 | #endif |
290 | #ifdef CONFIG_ARCH_R8A7791 | 290 | #ifdef CONFIG_SYSC_R8A7791 |
291 | { .compatible = "renesas,r8a7791-sysc", .data = &r8a7791_sysc_info }, | 291 | { .compatible = "renesas,r8a7791-sysc", .data = &r8a7791_sysc_info }, |
292 | #endif | ||
293 | #ifdef CONFIG_ARCH_R8A7792 | ||
294 | { .compatible = "renesas,r8a7792-sysc", .data = &r8a7792_sysc_info }, | ||
295 | #endif | ||
296 | #ifdef CONFIG_ARCH_R8A7793 | ||
297 | /* R-Car M2-N is identical to R-Car M2-W w.r.t. power domains. */ | 292 | /* R-Car M2-N is identical to R-Car M2-W w.r.t. power domains. */ |
298 | { .compatible = "renesas,r8a7793-sysc", .data = &r8a7791_sysc_info }, | 293 | { .compatible = "renesas,r8a7793-sysc", .data = &r8a7791_sysc_info }, |
299 | #endif | 294 | #endif |
300 | #ifdef CONFIG_ARCH_R8A7794 | 295 | #ifdef CONFIG_SYSC_R8A7792 |
296 | { .compatible = "renesas,r8a7792-sysc", .data = &r8a7792_sysc_info }, | ||
297 | #endif | ||
298 | #ifdef CONFIG_SYSC_R8A7794 | ||
301 | { .compatible = "renesas,r8a7794-sysc", .data = &r8a7794_sysc_info }, | 299 | { .compatible = "renesas,r8a7794-sysc", .data = &r8a7794_sysc_info }, |
302 | #endif | 300 | #endif |
303 | #ifdef CONFIG_ARCH_R8A7795 | 301 | #ifdef CONFIG_SYSC_R8A7795 |
304 | { .compatible = "renesas,r8a7795-sysc", .data = &r8a7795_sysc_info }, | 302 | { .compatible = "renesas,r8a7795-sysc", .data = &r8a7795_sysc_info }, |
305 | #endif | 303 | #endif |
306 | #ifdef CONFIG_ARCH_R8A7796 | 304 | #ifdef CONFIG_SYSC_R8A7796 |
307 | { .compatible = "renesas,r8a7796-sysc", .data = &r8a7796_sysc_info }, | 305 | { .compatible = "renesas,r8a7796-sysc", .data = &r8a7796_sysc_info }, |
308 | #endif | 306 | #endif |
309 | { /* sentinel */ } | 307 | { /* sentinel */ } |
diff --git a/include/linux/soc/renesas/rcar-rst.h b/include/linux/soc/renesas/rcar-rst.h index 787e7ad53d45..2c231f2280a6 100644 --- a/include/linux/soc/renesas/rcar-rst.h +++ b/include/linux/soc/renesas/rcar-rst.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef __LINUX_SOC_RENESAS_RCAR_RST_H__ | 1 | #ifndef __LINUX_SOC_RENESAS_RCAR_RST_H__ |
2 | #define __LINUX_SOC_RENESAS_RCAR_RST_H__ | 2 | #define __LINUX_SOC_RENESAS_RCAR_RST_H__ |
3 | 3 | ||
4 | #if defined(CONFIG_ARCH_RCAR_GEN1) || defined(CONFIG_ARCH_RCAR_GEN2) || \ | 4 | #ifdef CONFIG_RST_RCAR |
5 | defined(CONFIG_ARCH_R8A7795) || defined(CONFIG_ARCH_R8A7796) | ||
6 | int rcar_rst_read_mode_pins(u32 *mode); | 5 | int rcar_rst_read_mode_pins(u32 *mode); |
7 | #else | 6 | #else |
8 | static inline int rcar_rst_read_mode_pins(u32 *mode) { return -ENODEV; } | 7 | static inline int rcar_rst_read_mode_pins(u32 *mode) { return -ENODEV; } |