tree: https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git topic/rcar2-cpg-mssr head: bd948f4b8c455dfdbc8175b5c2bc29c91b048971 commit: 2cf8d523ad52acbc77845a2634c229a55e849762 [11/32] [RFC] soc: renesas: Rework Kconfig and Makefile logic config: m32r-allyesconfig (attached as .config) compiler: m32r-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 2cf8d523ad52acbc77845a2634c229a55e849762 # save the attached .config to linux build tree make.cross ARCH=m32r All warnings (new ones prefixed by >>): In file included from include/linux/kernel.h:13:0, from include/linux/delay.h:21, from drivers/soc/renesas/rcar-sysc.c:13: drivers/soc/renesas/rcar-sysc.c: In function 'rcar_sysc_power': >> drivers/soc/renesas/rcar-sysc.c:141:11: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'long unsigned int' [-Wformat=] pr_debug("sysc power %s domain %d: %08x -> %d\n", on ? "on" : "off", ^ include/linux/printk.h:285:21: note: in definition of macro 'pr_fmt' #define pr_fmt(fmt) fmt ^~~ include/linux/printk.h:333:2: note: in expansion of macro 'dynamic_pr_debug' dynamic_pr_debug(fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~ >> drivers/soc/renesas/rcar-sysc.c:141:2: note: in expansion of macro 'pr_debug' pr_debug("sysc power %s domain %d: %08x -> %d\n", on ? "on" : "off", ^~~~~~~~ vim +141 drivers/soc/renesas/rcar-sysc.c a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 7 * This file is subject to the terms and conditions of the GNU General Public a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 8 * License. See the file "COPYING" in the main directory of this archive a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 9 * for more details. a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 10 */ a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 11 1c8c77f5 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 12 #include <linux/clk/renesas.h> a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 @13 #include <linux/delay.h> a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 14 #include <linux/err.h> a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 15 #include <linux/mm.h> dcc09fd1 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 16 #include <linux/of_address.h> dcc09fd1 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 17 #include <linux/pm_domain.h> dcc09fd1 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 18 #include <linux/slab.h> a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 19 #include <linux/spinlock.h> 2584cf83 arch/arm/mach-shmobile/pm-rcar.c Dan Williams 2015-08-10 20 #include <linux/io.h> be32bcbb drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 21 #include <linux/soc/renesas/rcar-sysc.h> a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 22 dcc09fd1 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 23 #include "rcar-sysc.h" dcc09fd1 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 24 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 25 /* SYSC Common */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 26 #define SYSCSR 0x00 /* SYSC Status Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 27 #define SYSCISR 0x04 /* Interrupt Status Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 28 #define SYSCISCR 0x08 /* Interrupt Status Clear Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 29 #define SYSCIER 0x0c /* Interrupt Enable Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 30 #define SYSCIMR 0x10 /* Interrupt Mask Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 31 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 32 /* SYSC Status Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 33 #define SYSCSR_PONENB 1 /* Ready for power resume requests */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 34 #define SYSCSR_POFFENB 0 /* Ready for power shutoff requests */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 35 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 36 /* 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 37 * Power Control Register Offsets inside the register block for each domain 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 38 * Note: The "CR" registers for ARM cores exist on H1 only 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 39 * Use WFI to power off, CPG/APMU to resume ARM cores on R-Car Gen2 dcc09fd1 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 40 * Use PSCI on R-Car Gen3 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 41 */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 42 #define PWRSR_OFFS 0x00 /* Power Status Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 43 #define PWROFFCR_OFFS 0x04 /* Power Shutoff Control Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 44 #define PWROFFSR_OFFS 0x08 /* Power Shutoff Status Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 45 #define PWRONCR_OFFS 0x0c /* Power Resume Control Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 46 #define PWRONSR_OFFS 0x10 /* Power Resume Status Register */ 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 47 #define PWRER_OFFS 0x14 /* Power Shutoff/Resume Error */ a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 48 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 49 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 50 #define SYSCSR_RETRIES 100 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 51 #define SYSCSR_DELAY_US 1 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 52 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 53 #define PWRER_RETRIES 100 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 54 #define PWRER_DELAY_US 1 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 55 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 56 #define SYSCISR_RETRIES 1000 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 57 #define SYSCISR_DELAY_US 1 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 58 dcc09fd1 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 59 #define RCAR_PD_ALWAYS_ON 32 /* Always-on power area */ dcc09fd1 drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 60 c4ca5d80 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-02-24 61 static void __iomem *rcar_sysc_base; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 62 static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */ a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 63 bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 64 static int rcar_sysc_pwr_on_off(const struct rcar_sysc_ch *sysc_ch, bool on) a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 65 { bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 66 unsigned int sr_bit, reg_offs; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 67 int k; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 68 bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 69 if (on) { bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 70 sr_bit = SYSCSR_PONENB; bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 71 reg_offs = PWRONCR_OFFS; bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 72 } else { bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 73 sr_bit = SYSCSR_POFFENB; bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 74 reg_offs = PWROFFCR_OFFS; bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 75 } bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 76 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 77 /* Wait until SYSC is ready to accept a power request */ a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 78 for (k = 0; k < SYSCSR_RETRIES; k++) { 21437c53 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 79 if (ioread32(rcar_sysc_base + SYSCSR) & BIT(sr_bit)) a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 80 break; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 81 udelay(SYSCSR_DELAY_US); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 82 } a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 83 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 84 if (k == SYSCSR_RETRIES) a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 85 return -EAGAIN; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 86 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 87 /* Submit power shutoff or power resume request */ 21437c53 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 88 iowrite32(BIT(sysc_ch->chan_bit), a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 89 rcar_sysc_base + sysc_ch->chan_offs + reg_offs); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 90 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 91 return 0; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 92 } a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 93 bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 94 static int rcar_sysc_power(const struct rcar_sysc_ch *sysc_ch, bool on) a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 95 { 21437c53 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 96 unsigned int isr_mask = BIT(sysc_ch->isr_bit); 21437c53 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 97 unsigned int chan_mask = BIT(sysc_ch->chan_bit); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 98 unsigned int status; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 99 unsigned long flags; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 100 int ret = 0; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 101 int k; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 102 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 103 spin_lock_irqsave(&rcar_sysc_lock, flags); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 104 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 105 iowrite32(isr_mask, rcar_sysc_base + SYSCISCR); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 106 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 107 /* Submit power shutoff or resume request until it was accepted */ 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 108 for (k = 0; k < PWRER_RETRIES; k++) { bcb82437 arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 109 ret = rcar_sysc_pwr_on_off(sysc_ch, on); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 110 if (ret) a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 111 goto out; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 112 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 113 status = ioread32(rcar_sysc_base + a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 114 sysc_ch->chan_offs + PWRER_OFFS); 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 115 if (!(status & chan_mask)) 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 116 break; 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 117 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 118 udelay(PWRER_DELAY_US); 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 119 } 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 120 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 121 if (k == PWRER_RETRIES) { 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 122 ret = -EIO; 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 123 goto out; 2f575fcf arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 124 } a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 125 577d104d arch/arm/mach-shmobile/pm-rcar.c Geert Uytterhoeven 2015-06-04 126 /* Wait until the power shutoff or resume request has completed * */ a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 127 for (k = 0; k < SYSCISR_RETRIES; k++) { a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 128 if (ioread32(rcar_sysc_base + SYSCISR) & isr_mask) a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 129 break; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 130 udelay(SYSCISR_DELAY_US); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 131 } a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 132 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 133 if (k == SYSCISR_RETRIES) a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 134 ret = -EIO; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 135 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 136 iowrite32(isr_mask, rcar_sysc_base + SYSCISCR); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 137 a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 138 out: a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 139 spin_unlock_irqrestore(&rcar_sysc_lock, flags); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 140 68667ceb drivers/soc/renesas/rcar-sysc.c Geert Uytterhoeven 2016-04-20 @141 pr_debug("sysc power %s domain %d: %08x -> %d\n", on ? "on" : "off", a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 142 sysc_ch->isr_bit, ioread32(rcar_sysc_base + SYSCISR), ret); a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 143 return ret; a6557eb7 arch/arm/mach-shmobile/pm-rcar.c Magnus Damm 2014-01-15 144 } :::::: The code at line 141 was first introduced by commit :::::: 68667cebfc0d27d2153d7a6b489f3231b533d9bc soc: renesas: rcar-sysc: Improve rcar_sysc_power() debug info :::::: TO: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> :::::: CC: Simon Horman <horms+renesas@xxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip