Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'renesas-rcar-sysc2-for-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/drivers

Second Round of Renesas ARM Based SoC R-Car SYSC Updates for v4.8

* Prepare for handling SYSC interrupt configuration purely
from DT in the rcar-sysc driver for new SoCs, while preserving
backward compatibility with old DTBs for R-Car H1, H2, and M2-W
* Add R8A7792 support

* tag 'renesas-rcar-sysc2-for-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
soc: renesas: rcar-sysc: Improve SYSC interrupt config in legacy wrapper
soc: renesas: rcar-sysc: Move SYSC interrupt config to rcar-sysc driver
soc: renesas: rcar-sysc: Make rcar_sysc_init() init the PM domains
soc: renesas: rcar-sysc: Fix uninitialized error code in rcar_sysc_pd_init()
soc: renesas: rcar-sysc: add R8A7792 support

Signed-off-by: Olof Johansson <olof@lixom.net>

+71 -21
+1 -5
arch/arm/mach-shmobile/pm-r8a7779.c
··· 23 23 24 24 static void __init r8a7779_sysc_init(void) 25 25 { 26 - void __iomem *base = rcar_sysc_init(0xffd85000); 27 - 28 - /* enable all interrupt sources, but do not use interrupt handler */ 29 - iowrite32(0x0131000e, base + SYSCIER); 30 - iowrite32(0, base + SYSCIMR); 26 + rcar_sysc_init(0xffd85000, 0x0131000e); 31 27 } 32 28 33 29 #else /* CONFIG_PM || CONFIG_SMP */
+1 -5
arch/arm/mach-shmobile/pm-rcar-gen2.c
··· 37 37 38 38 static void __init rcar_gen2_sysc_init(u32 syscier) 39 39 { 40 - void __iomem *base = rcar_sysc_init(0xe6180000); 41 - 42 - /* enable all interrupt sources, but do not use interrupt handler */ 43 - iowrite32(syscier, base + SYSCIER); 44 - iowrite32(0, base + SYSCIMR); 40 + rcar_sysc_init(0xe6180000, syscier); 45 41 } 46 42 47 43 #else /* CONFIG_SMP */
+1
drivers/soc/renesas/Makefile
··· 1 1 obj-$(CONFIG_ARCH_R8A7779) += rcar-sysc.o r8a7779-sysc.o 2 2 obj-$(CONFIG_ARCH_R8A7790) += rcar-sysc.o r8a7790-sysc.o 3 3 obj-$(CONFIG_ARCH_R8A7791) += rcar-sysc.o r8a7791-sysc.o 4 + obj-$(CONFIG_ARCH_R8A7792) += rcar-sysc.o r8a7792-sysc.o 4 5 # R-Car M2-N is identical to R-Car M2-W w.r.t. power domains. 5 6 obj-$(CONFIG_ARCH_R8A7793) += rcar-sysc.o r8a7791-sysc.o 6 7 obj-$(CONFIG_ARCH_R8A7794) += rcar-sysc.o r8a7794-sysc.o
+34
drivers/soc/renesas/r8a7792-sysc.c
··· 1 + /* 2 + * Renesas R-Car V2H (R8A7792) System Controller 3 + * 4 + * Copyright (C) 2016 Cogent Embedded Inc. 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; version 2 of the License. 9 + */ 10 + 11 + #include <linux/bug.h> 12 + #include <linux/init.h> 13 + #include <linux/kernel.h> 14 + 15 + #include <dt-bindings/power/r8a7792-sysc.h> 16 + 17 + #include "rcar-sysc.h" 18 + 19 + static const struct rcar_sysc_area r8a7792_areas[] __initconst = { 20 + { "always-on", 0, 0, R8A7792_PD_ALWAYS_ON, -1, PD_ALWAYS_ON }, 21 + { "ca15-scu", 0x180, 0, R8A7792_PD_CA15_SCU, R8A7792_PD_ALWAYS_ON, 22 + PD_SCU }, 23 + { "ca15-cpu0", 0x40, 0, R8A7792_PD_CA15_CPU0, R8A7792_PD_CA15_SCU, 24 + PD_CPU_NOCR }, 25 + { "ca15-cpu1", 0x40, 1, R8A7792_PD_CA15_CPU1, R8A7792_PD_CA15_SCU, 26 + PD_CPU_NOCR }, 27 + { "sgx", 0xc0, 0, R8A7792_PD_SGX, R8A7792_PD_ALWAYS_ON }, 28 + { "imp", 0x140, 0, R8A7792_PD_IMP, R8A7792_PD_ALWAYS_ON }, 29 + }; 30 + 31 + const struct rcar_sysc_info r8a7792_sysc_info __initconst = { 32 + .areas = r8a7792_areas, 33 + .num_areas = ARRAY_SIZE(r8a7792_areas), 34 + };
+32 -10
drivers/soc/renesas/rcar-sysc.c
··· 164 164 return false; 165 165 } 166 166 167 - void __iomem *rcar_sysc_init(phys_addr_t base) 168 - { 169 - rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE); 170 - if (!rcar_sysc_base) 171 - panic("unable to ioremap R-Car SYSC hardware block\n"); 172 - 173 - return rcar_sysc_base; 174 - } 175 - 176 167 struct rcar_sysc_pd { 177 168 struct generic_pm_domain genpd; 178 169 struct rcar_sysc_ch ch; ··· 284 293 #ifdef CONFIG_ARCH_R8A7791 285 294 { .compatible = "renesas,r8a7791-sysc", .data = &r8a7791_sysc_info }, 286 295 #endif 296 + #ifdef CONFIG_ARCH_R8A7792 297 + { .compatible = "renesas,r8a7792-sysc", .data = &r8a7792_sysc_info }, 298 + #endif 287 299 #ifdef CONFIG_ARCH_R8A7793 288 300 /* R-Car M2-N is identical to R-Car M2-W w.r.t. power domains. */ 289 301 { .compatible = "renesas,r8a7793-sysc", .data = &r8a7791_sysc_info }, ··· 318 324 void __iomem *base; 319 325 unsigned int i; 320 326 int error; 327 + 328 + if (rcar_sysc_base) 329 + return 0; 321 330 322 331 np = of_find_matching_node_and_match(NULL, rcar_sysc_matches, &match); 323 332 if (!np) ··· 392 395 domains->domains[area->isr_bit] = &pd->genpd; 393 396 } 394 397 395 - of_genpd_add_provider_onecell(np, &domains->onecell_data); 398 + error = of_genpd_add_provider_onecell(np, &domains->onecell_data); 396 399 397 400 out_put: 398 401 of_node_put(np); 399 402 return error; 400 403 } 401 404 early_initcall(rcar_sysc_pd_init); 405 + 406 + void __init rcar_sysc_init(phys_addr_t base, u32 syscier) 407 + { 408 + u32 syscimr; 409 + 410 + if (!rcar_sysc_pd_init()) 411 + return; 412 + 413 + rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE); 414 + 415 + /* 416 + * Mask all interrupt sources to prevent the CPU from receiving them. 417 + * Make sure not to clear reserved bits that were set before. 418 + */ 419 + syscimr = ioread32(rcar_sysc_base + SYSCIMR); 420 + syscimr |= syscier; 421 + pr_debug("%s: syscimr = 0x%08x\n", __func__, syscimr); 422 + iowrite32(syscimr, rcar_sysc_base + SYSCIMR); 423 + 424 + /* 425 + * SYSC needs all interrupt sources enabled to control power. 426 + */ 427 + pr_debug("%s: syscier = 0x%08x\n", __func__, syscier); 428 + iowrite32(syscier, rcar_sysc_base + SYSCIER); 429 + }
+1
drivers/soc/renesas/rcar-sysc.h
··· 53 53 extern const struct rcar_sysc_info r8a7779_sysc_info; 54 54 extern const struct rcar_sysc_info r8a7790_sysc_info; 55 55 extern const struct rcar_sysc_info r8a7791_sysc_info; 56 + extern const struct rcar_sysc_info r8a7792_sysc_info; 56 57 extern const struct rcar_sysc_info r8a7794_sysc_info; 57 58 extern const struct rcar_sysc_info r8a7795_sysc_info; 58 59 extern const struct rcar_sysc_info r8a7796_sysc_info;
+1 -1
include/linux/soc/renesas/rcar-sysc.h
··· 11 11 12 12 int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch); 13 13 int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch); 14 - void __iomem *rcar_sysc_init(phys_addr_t base); 14 + void rcar_sysc_init(phys_addr_t base, u32 syscier); 15 15 16 16 #endif /* __LINUX_SOC_RENESAS_RCAR_SYSC_H__ */