* [PATCH 1/9] ARM: pxa: define clock registers as __iomem [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> @ 2016-01-29 14:06 ` Arnd Bergmann 2016-01-29 18:31 ` Stephen Boyd 2016-01-29 14:06 ` [PATCH 2/9] ARM: pxa: mark spitz_card_pwr_ctrl as __maybe_unused Arnd Bergmann ` (7 subsequent siblings) 8 siblings, 1 reply; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, Michael Turquette, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, linux-kernel, linux-clk, linux-pm We should not dereference registers as pointers, so use readl/writel instead for these registers. The clock registers are accessed in multiple files, so we have to change them all at once. I stumbled over these registers while looking at something unrelated. There are in fact other registers with the same problem, but I did not try to address those at this point. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-pxa/gumstix.c | 6 ++--- arch/arm/mach-pxa/include/mach/pxa2xx-regs.h | 8 +++---- arch/arm/mach-pxa/include/mach/pxa3xx-regs.h | 2 +- arch/arm/mach-pxa/zeus.c | 2 +- drivers/clk/pxa/clk-pxa25x.c | 12 +++++----- drivers/clk/pxa/clk-pxa27x.c | 34 ++++++++++++++-------------- drivers/clk/pxa/clk-pxa3xx.c | 3 +-- drivers/cpufreq/pxa2xx-cpufreq.c | 2 +- 8 files changed, 34 insertions(+), 35 deletions(-) diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c index 6815a9357774..9c5b2fb054f9 100644 --- a/arch/arm/mach-pxa/gumstix.c +++ b/arch/arm/mach-pxa/gumstix.c @@ -139,14 +139,14 @@ static void gumstix_setup_bt_clock(void) { int timeout = 500; - if (!(OSCC & OSCC_OOK)) + if (!(readl(OSCC) & OSCC_OOK)) pr_warn("32kHz clock was not on. Bootloader may need to be updated\n"); else return; - OSCC |= OSCC_OON; + writel(readl(OSCC) | OSCC_OON, OSCC); do { - if (OSCC & OSCC_OOK) + if (readl(OSCC) & OSCC_OOK) break; udelay(1); } while (--timeout); diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h index f1dd62946b36..5537d5601d70 100644 --- a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h +++ b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h @@ -134,10 +134,10 @@ /* * PXA2xx specific Core clock definitions */ -#define CCCR __REG(0x41300000) /* Core Clock Configuration Register */ -#define CCSR __REG(0x4130000C) /* Core Clock Status Register */ -#define CKEN __REG(0x41300004) /* Clock Enable Register */ -#define OSCC __REG(0x41300008) /* Oscillator Configuration Register */ +#define CCCR io_p2v(0x41300000) /* Core Clock Configuration Register */ +#define CCSR io_p2v(0x4130000C) /* Core Clock Status Register */ +#define CKEN io_p2v(0x41300004) /* Clock Enable Register */ +#define OSCC io_p2v(0x41300008) /* Oscillator Configuration Register */ #define CCCR_N_MASK 0x0380 /* Run Mode Frequency to Turbo Mode Frequency Multiplier */ #define CCCR_M_MASK 0x0060 /* Memory Frequency to Run Mode Frequency Multiplier */ diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h index f4d48d20754e..888bf7ade15a 100644 --- a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h +++ b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h @@ -18,7 +18,7 @@ /* * Oscillator Configuration Register (OSCC) */ -#define OSCC __REG(0x41350000) /* Oscillator Configuration Register */ +#define OSCC io_p2v(0x41350000) /* Oscillator Configuration Register */ #define OSCC_PEN (1 << 11) /* 13MHz POUT */ diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index 515b7ddda8aa..3b94ecfb9426 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c @@ -910,7 +910,7 @@ static void __init zeus_map_io(void) PMCR = PSPR = 0; /* enable internal 32.768Khz oscillator (ignore OSCC_OOK) */ - OSCC |= OSCC_OON; + writel(readl(OSCC) | OSCC_OON, OSCC); /* Some clock cycles later (from OSCC_ON), programme PCFR (OPDE...). * float chip selects and PCMCIA */ diff --git a/drivers/clk/pxa/clk-pxa25x.c b/drivers/clk/pxa/clk-pxa25x.c index b7747229db9a..a9353cd4ce17 100644 --- a/drivers/clk/pxa/clk-pxa25x.c +++ b/drivers/clk/pxa/clk-pxa25x.c @@ -84,7 +84,7 @@ unsigned int pxa25x_get_clk_frequency_khz(int info) static unsigned long clk_pxa25x_memory_get_rate(struct clk_hw *hw, unsigned long parent_rate) { - unsigned long cccr = CCCR; + unsigned long cccr = readl(CCCR); unsigned int m = M_clk_mult[(cccr >> 5) & 0x03]; return parent_rate / m; @@ -99,7 +99,7 @@ PARENTS(pxa25x_osc3) = { "osc_3_6864mhz", "osc_3_6864mhz" }; #define PXA25X_CKEN(dev_id, con_id, parents, mult, div, \ bit, is_lp, flags) \ PXA_CKEN(dev_id, con_id, bit, parents, mult, div, mult, div, \ - is_lp, &CKEN, CKEN_ ## bit, flags) + is_lp, CKEN, CKEN_ ## bit, flags) #define PXA25X_PBUS95_CKEN(dev_id, con_id, bit, mult_hp, div_hp, delay) \ PXA25X_CKEN(dev_id, con_id, pxa25x_pbus95_parents, mult_hp, \ div_hp, bit, NULL, 0) @@ -112,10 +112,10 @@ PARENTS(pxa25x_osc3) = { "osc_3_6864mhz", "osc_3_6864mhz" }; #define PXA25X_CKEN_1RATE(dev_id, con_id, bit, parents, delay) \ PXA_CKEN_1RATE(dev_id, con_id, bit, parents, \ - &CKEN, CKEN_ ## bit, 0) + CKEN, CKEN_ ## bit, 0) #define PXA25X_CKEN_1RATE_AO(dev_id, con_id, bit, parents, delay) \ PXA_CKEN_1RATE(dev_id, con_id, bit, parents, \ - &CKEN, CKEN_ ## bit, CLK_IGNORE_UNUSED) + CKEN, CKEN_ ## bit, CLK_IGNORE_UNUSED) static struct desc_clk_cken pxa25x_clocks[] __initdata = { PXA25X_PBUS95_CKEN("pxa2xx-mci.0", NULL, MMC, 1, 5, 0), @@ -162,7 +162,7 @@ MUX_RO_RATE_RO_OPS(clk_pxa25x_core, "core"); static unsigned long clk_pxa25x_run_get_rate(struct clk_hw *hw, unsigned long parent_rate) { - unsigned long cccr = CCCR; + unsigned long cccr = readl(CCCR); unsigned int n2 = N2_clk_mult[(cccr >> 7) & 0x07]; return (parent_rate / n2) * 2; @@ -173,7 +173,7 @@ RATE_RO_OPS(clk_pxa25x_run, "run"); static unsigned long clk_pxa25x_cpll_get_rate(struct clk_hw *hw, unsigned long parent_rate) { - unsigned long clkcfg, cccr = CCCR; + unsigned long clkcfg, cccr = readl(CCCR); unsigned int l, m, n2, t; asm("mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg)); diff --git a/drivers/clk/pxa/clk-pxa27x.c b/drivers/clk/pxa/clk-pxa27x.c index 5b82d30baf9f..fc2abf97edd7 100644 --- a/drivers/clk/pxa/clk-pxa27x.c +++ b/drivers/clk/pxa/clk-pxa27x.c @@ -85,7 +85,7 @@ unsigned int pxa27x_get_clk_frequency_khz(int info) bool pxa27x_is_ppll_disabled(void) { - unsigned long ccsr = CCSR; + unsigned long ccsr = readl(CCSR); return ccsr & (1 << CCCR_PPDIS_BIT); } @@ -93,7 +93,7 @@ bool pxa27x_is_ppll_disabled(void) #define PXA27X_CKEN(dev_id, con_id, parents, mult_hp, div_hp, \ bit, is_lp, flags) \ PXA_CKEN(dev_id, con_id, bit, parents, 1, 1, mult_hp, div_hp, \ - is_lp, &CKEN, CKEN_ ## bit, flags) + is_lp, CKEN, CKEN_ ## bit, flags) #define PXA27X_PBUS_CKEN(dev_id, con_id, bit, mult_hp, div_hp, delay) \ PXA27X_CKEN(dev_id, con_id, pxa27x_pbus_parents, mult_hp, \ div_hp, bit, pxa27x_is_ppll_disabled, 0) @@ -106,10 +106,10 @@ PARENTS(pxa27x_membus) = { "lcd_base", "lcd_base" }; #define PXA27X_CKEN_1RATE(dev_id, con_id, bit, parents, delay) \ PXA_CKEN_1RATE(dev_id, con_id, bit, parents, \ - &CKEN, CKEN_ ## bit, 0) + CKEN, CKEN_ ## bit, 0) #define PXA27X_CKEN_1RATE_AO(dev_id, con_id, bit, parents, delay) \ PXA_CKEN_1RATE(dev_id, con_id, bit, parents, \ - &CKEN, CKEN_ ## bit, CLK_IGNORE_UNUSED) + CKEN, CKEN_ ## bit, CLK_IGNORE_UNUSED) static struct desc_clk_cken pxa27x_clocks[] __initdata = { PXA27X_PBUS_CKEN("pxa2xx-uart.0", NULL, FFUART, 2, 42, 1), @@ -151,7 +151,7 @@ static unsigned long clk_pxa27x_cpll_get_rate(struct clk_hw *hw, unsigned long clkcfg; unsigned int t, ht; unsigned int l, L, n2, N; - unsigned long ccsr = CCSR; + unsigned long ccsr = readl(CCSR); asm("mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg)); t = clkcfg & (1 << 0); @@ -171,8 +171,8 @@ static unsigned long clk_pxa27x_lcd_base_get_rate(struct clk_hw *hw, unsigned long parent_rate) { unsigned int l, osc_forced; - unsigned long ccsr = CCSR; - unsigned long cccr = CCCR; + unsigned long ccsr = readl(CCSR); + unsigned long cccr = readl(CCCR); l = ccsr & CCSR_L_MASK; osc_forced = ccsr & (1 << CCCR_CPDIS_BIT); @@ -193,7 +193,7 @@ static unsigned long clk_pxa27x_lcd_base_get_rate(struct clk_hw *hw, static u8 clk_pxa27x_lcd_base_get_parent(struct clk_hw *hw) { unsigned int osc_forced; - unsigned long ccsr = CCSR; + unsigned long ccsr = readl(CCSR); osc_forced = ccsr & (1 << CCCR_CPDIS_BIT); if (osc_forced) @@ -222,7 +222,7 @@ static unsigned long clk_pxa27x_core_get_rate(struct clk_hw *hw, { unsigned long clkcfg; unsigned int t, ht, b, osc_forced; - unsigned long ccsr = CCSR; + unsigned long ccsr = readl(CCSR); osc_forced = ccsr & (1 << CCCR_CPDIS_BIT); asm("mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg)); @@ -242,7 +242,7 @@ static u8 clk_pxa27x_core_get_parent(struct clk_hw *hw) { unsigned long clkcfg; unsigned int t, ht, b, osc_forced; - unsigned long ccsr = CCSR; + unsigned long ccsr = readl(CCSR); osc_forced = ccsr & (1 << CCCR_CPDIS_BIT); if (osc_forced) @@ -263,7 +263,7 @@ MUX_RO_RATE_RO_OPS(clk_pxa27x_core, "core"); static unsigned long clk_pxa27x_run_get_rate(struct clk_hw *hw, unsigned long parent_rate) { - unsigned long ccsr = CCSR; + unsigned long ccsr = readl(CCSR); unsigned int n2 = (ccsr & CCSR_N2_MASK) >> CCSR_N2_SHIFT; return (parent_rate / n2) * 2; @@ -285,7 +285,7 @@ static unsigned long clk_pxa27x_system_bus_get_rate(struct clk_hw *hw, { unsigned long clkcfg; unsigned int b, osc_forced; - unsigned long ccsr = CCSR; + unsigned long ccsr = readl(CCSR); osc_forced = ccsr & (1 << CCCR_CPDIS_BIT); asm("mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg)); @@ -302,7 +302,7 @@ static unsigned long clk_pxa27x_system_bus_get_rate(struct clk_hw *hw, static u8 clk_pxa27x_system_bus_get_parent(struct clk_hw *hw) { unsigned int osc_forced; - unsigned long ccsr = CCSR; + unsigned long ccsr = readl(CCSR); osc_forced = ccsr & (1 << CCCR_CPDIS_BIT); if (osc_forced) @@ -318,8 +318,8 @@ static unsigned long clk_pxa27x_memory_get_rate(struct clk_hw *hw, unsigned long parent_rate) { unsigned int a, l, osc_forced; - unsigned long cccr = CCCR; - unsigned long ccsr = CCSR; + unsigned long cccr = readl(CCCR); + unsigned long ccsr = readl(CCSR); osc_forced = ccsr & (1 << CCCR_CPDIS_BIT); a = cccr & (1 << CCCR_A_BIT); @@ -337,8 +337,8 @@ static unsigned long clk_pxa27x_memory_get_rate(struct clk_hw *hw, static u8 clk_pxa27x_memory_get_parent(struct clk_hw *hw) { unsigned int osc_forced, a; - unsigned long cccr = CCCR; - unsigned long ccsr = CCSR; + unsigned long cccr = readl(CCCR); + unsigned long ccsr = readl(CCSR); osc_forced = ccsr & (1 << CCCR_CPDIS_BIT); a = cccr & (1 << CCCR_A_BIT); diff --git a/drivers/clk/pxa/clk-pxa3xx.c b/drivers/clk/pxa/clk-pxa3xx.c index 4af4eed5f89f..ea679718601c 100644 --- a/drivers/clk/pxa/clk-pxa3xx.c +++ b/drivers/clk/pxa/clk-pxa3xx.c @@ -334,8 +334,7 @@ static void __init pxa3xx_base_clocks_init(void) clk_register_clk_pxa3xx_system_bus(); clk_register_clk_pxa3xx_ac97(); clk_register_clk_pxa3xx_smemc(); - clk_register_gate(NULL, "CLK_POUT", "osc_13mhz", 0, - (void __iomem *)&OSCC, 11, 0, NULL); + clk_register_gate(NULL, "CLK_POUT", "osc_13mhz", 0, OSCC, 11, 0, NULL); clkdev_pxa_register(CLK_OSTIMER, "OSTIMER0", NULL, clk_register_fixed_factor(NULL, "os-timer0", "osc_13mhz", 0, 1, 4)); diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index 096377232747..46fee1539cc8 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c @@ -319,7 +319,7 @@ static int pxa_set_target(struct cpufreq_policy *policy, unsigned int idx) local_irq_save(flags); /* Set new the CCCR and prepare CCLKCFG */ - CCCR = pxa_freq_settings[idx].cccr; + writel(pxa_freq_settings[idx].cccr, CCCR); cclkcfg = pxa_freq_settings[idx].cclkcfg; asm volatile(" \n\ -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/9] ARM: pxa: define clock registers as __iomem 2016-01-29 14:06 ` [PATCH 1/9] ARM: pxa: define clock registers as __iomem Arnd Bergmann @ 2016-01-29 18:31 ` Stephen Boyd 0 siblings, 0 replies; 11+ messages in thread From: Stephen Boyd @ 2016-01-29 18:31 UTC (permalink / raw) To: Arnd Bergmann Cc: Robert Jarzmik, linux-arm-kernel, Haojian Zhuang, Daniel Mack, Michael Turquette, Rafael J. Wysocki, Viresh Kumar, linux-kernel, linux-clk, linux-pm On 01/29, Arnd Bergmann wrote: > We should not dereference registers as pointers, so use readl/writel > instead for these registers. > > The clock registers are accessed in multiple files, so we have to > change them all at once. > > I stumbled over these registers while looking at something unrelated. > There are in fact other registers with the same problem, but I did > not try to address those at this point. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- Acked-by: Stephen Boyd <sboyd@codeaurora.org> -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/9] ARM: pxa: mark spitz_card_pwr_ctrl as __maybe_unused [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> 2016-01-29 14:06 ` [PATCH 1/9] ARM: pxa: define clock registers as __iomem Arnd Bergmann @ 2016-01-29 14:06 ` Arnd Bergmann 2016-01-29 14:06 ` [PATCH 3/9] ARM: pxa: mark unused eseries code " Arnd Bergmann ` (6 subsequent siblings) 8 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, linux-kernel This function is only used when CONFIG_PCMCIA is enabled, otherwise we get a harmless warning: arch/arm/mach-pxa/spitz.c:204:13: warning: 'spitz_card_pwr_ctrl' defined but not used [-Wunused-function] Marking it as __maybe_unused keeps the logic simple and avoids the warning on randconfig builds. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-pxa/spitz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 825f903ab77e..d9578bc49fdc 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -201,7 +201,7 @@ static void __init spitz_scoop_init(void) } /* Power control is shared with between one of the CF slots and SD */ -static void spitz_card_pwr_ctrl(uint8_t enable, uint8_t new_cpr) +static void __maybe_unused spitz_card_pwr_ctrl(uint8_t enable, uint8_t new_cpr) { unsigned short cpr; unsigned long flags; -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/9] ARM: pxa: mark unused eseries code as __maybe_unused [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> 2016-01-29 14:06 ` [PATCH 1/9] ARM: pxa: define clock registers as __iomem Arnd Bergmann 2016-01-29 14:06 ` [PATCH 2/9] ARM: pxa: mark spitz_card_pwr_ctrl as __maybe_unused Arnd Bergmann @ 2016-01-29 14:06 ` Arnd Bergmann 2016-01-29 14:06 ` [PATCH 4/9] ARM: pxa: don't select GPIO_SYSFS for MIOA701 Arnd Bergmann ` (5 subsequent siblings) 8 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, linux-kernel Two variables in eseries.c are used on multiple platforms, but are not referenced when those are all disabled: eseries.c:60:31: warning: 'e7xx_gpio_vbus' defined but not used [-Wunused-variable] eseries.c:129:20: warning: 'eseries_register_clks' defined but not used [-Wunused-function] Marking them __maybe_unused is the nicest way to ensure that we never get the warning or end up with missing symbols if we get it wrong. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-pxa/eseries.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index 0b00b226f54b..e838b11fb8c7 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c @@ -57,7 +57,7 @@ struct gpio_vbus_mach_info e7xx_udc_info = { .gpio_pullup_inverted = 1 }; -static struct platform_device e7xx_gpio_vbus = { +static struct platform_device e7xx_gpio_vbus __maybe_unused = { .name = "gpio-vbus", .id = -1, .dev = { @@ -126,7 +126,7 @@ struct resource eseries_tmio_resources[] = { }; /* Some e-series hardware cannot control the 32K clock */ -static void __init eseries_register_clks(void) +static void __init __maybe_unused eseries_register_clks(void) { clk_register_fixed_rate(NULL, "CLK_CK32K", NULL, CLK_IS_ROOT, 32768); } -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/9] ARM: pxa: don't select GPIO_SYSFS for MIOA701 [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> ` (2 preceding siblings ...) 2016-01-29 14:06 ` [PATCH 3/9] ARM: pxa: mark unused eseries code " Arnd Bergmann @ 2016-01-29 14:06 ` Arnd Bergmann 2016-01-29 14:06 ` [PATCH 5/9] ARM: pxa: always select one of the two CPU types Arnd Bergmann ` (4 subsequent siblings) 8 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, linux-kernel GPIO_SYSFS is a common kernel functionality, not something that a board specific Kconfig should have to worry about. In MIOA701, we get a warning about the select when CONFIG_SYSFS is disabled: warning: (MACH_MIOA701) selects GPIO_SYSFS which has unmet direct dependencies (GPIOLIB && SYSFS) This just removes the select and instead enables the symbol in the defconfig file. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/configs/pxa_defconfig | 1 + arch/arm/mach-pxa/Kconfig | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs/pxa_defconfig index 0cb724b5c639..dc5517eaf09f 100644 --- a/arch/arm/configs/pxa_defconfig +++ b/arch/arm/configs/pxa_defconfig @@ -378,6 +378,7 @@ CONFIG_GPIO_PALMAS=y CONFIG_GPIO_TPS6586X=y CONFIG_GPIO_TPS65910=y CONFIG_GPIO_MAX7301=m +CONFIG_GPIO_SYSFS=y CONFIG_POWER_SUPPLY_DEBUG=y CONFIG_PDA_POWER=m CONFIG_BATTERY_SBS=m diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index f09683687963..01066cff16e4 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -297,7 +297,6 @@ config MACH_MAGICIAN config MACH_MIOA701 bool "Mitac Mio A701 Support" - select GPIO_SYSFS select IWMMXT select PXA27x help -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/9] ARM: pxa: always select one of the two CPU types [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> ` (3 preceding siblings ...) 2016-01-29 14:06 ` [PATCH 4/9] ARM: pxa: don't select GPIO_SYSFS for MIOA701 Arnd Bergmann @ 2016-01-29 14:06 ` Arnd Bergmann 2016-01-29 14:06 ` [PATCH 6/9] ARM: pxa: move extern declarations to pm.h Arnd Bergmann ` (3 subsequent siblings) 8 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, linux-kernel When all boards are disabled on PXA, we cannot build a kernel because no CPU gets selected: arch/arm/include/uapi/asm/swab.h:26:29: error: "__LINUX_ARM_ARCH__" is not defined [-Werror=undef] This is a bit annoying for compile-testing, so I'm adding a line that ensures that at all times, at least one of CPU_XSCALE or CPU_XSC3 is set and we can at least continue building. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7e1aac8bdf84..1d2b5e6cab14 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -564,6 +564,7 @@ config ARCH_PXA select CLKSRC_PXA select CLKSRC_MMIO select CLKSRC_OF + select CPU_XSCALE if !CPU_XSC3 select GENERIC_CLOCKEVENTS select GPIO_PXA select HAVE_IDE -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/9] ARM: pxa: move extern declarations to pm.h [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> ` (4 preceding siblings ...) 2016-01-29 14:06 ` [PATCH 5/9] ARM: pxa: always select one of the two CPU types Arnd Bergmann @ 2016-01-29 14:06 ` Arnd Bergmann 2016-01-29 14:06 ` [PATCH 7/9] ARM: pxa: fix building without IWMMXT Arnd Bergmann ` (2 subsequent siblings) 8 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, linux-kernel When CONFIG_IWMMXT is disabled, we get a warning in pxa3xx.c: arch/arm/mach-pxa/pxa3xx.c: In function 'pxa3xx_cpu_pm_suspend': arch/arm/mach-pxa/pxa3xx.c:109:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] It turns out that there is an 'extern' declaration in the middle of a function. For consistency, this moves the declaration and two others from the same file into pm.h. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-pxa/pm.h | 3 +++ arch/arm/mach-pxa/pxa3xx.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-pxa/pm.h b/arch/arm/mach-pxa/pm.h index 51558bcee999..3aab90d8d2b7 100644 --- a/arch/arm/mach-pxa/pm.h +++ b/arch/arm/mach-pxa/pm.h @@ -29,6 +29,9 @@ extern int pxa_pm_enter(suspend_state_t state); extern int pxa_pm_prepare(void); extern void pxa_pm_finish(void); +extern const char pm_enter_standby_start[], pm_enter_standby_end[]; +extern int pxa3xx_finish_suspend(unsigned long); + /* NOTE: this is for PM debugging on Lubbock, it's really a big * ugly, but let's keep the crap minimum here, instead of direct * accessing the LUBBOCK CPLD registers in arch/arm/mach-pxa/pm.c diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index a1c4c888f246..1ba62be65f7c 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c @@ -68,7 +68,6 @@ static unsigned long wakeup_src; */ static void pxa3xx_cpu_standby(unsigned int pwrmode) { - extern const char pm_enter_standby_start[], pm_enter_standby_end[]; void (*fn)(unsigned int) = (void __force *)(sram + 0x8000); memcpy_toio(sram + 0x8000, pm_enter_standby_start, @@ -106,8 +105,6 @@ static void pxa3xx_cpu_pm_suspend(void) asm volatile("mra %Q0, %R0, acc0" : "=r" (acc0)); #endif - extern int pxa3xx_finish_suspend(unsigned long); - /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */ CKENA |= (1 << CKEN_BOOT) | (1 << CKEN_TPM); CKENB |= 1 << (CKEN_HSIO2 & 0x1f); -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/9] ARM: pxa: fix building without IWMMXT [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> ` (5 preceding siblings ...) 2016-01-29 14:06 ` [PATCH 6/9] ARM: pxa: move extern declarations to pm.h Arnd Bergmann @ 2016-01-29 14:06 ` Arnd Bergmann 2016-01-29 14:06 ` [PATCH 8/9] ARM: pxa: don't select RFKILL if CONFIG_NET is disabled Arnd Bergmann 2016-01-29 14:06 ` [PATCH 9/9] ARM: mmp: mark usb_dma_mask as __maybe_unused Arnd Bergmann 8 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, linux-kernel When CONFIG_IWMMXT, the pxa3xx and pxa27x suspend/resume code emits some xscale specific instructions, which are rejected by the assembler, because gcc is built with -march=armv5 -mtune=xscale and passes that option to the assembler: /tmp/cciHumzr.s:553: Error: selected processor does not support ARM mode `mra r2,r3,acc0' /tmp/cciHumzr.s:605: Error: selected processor does not support ARM mode `mar acc0,r2,r3' make[3]: *** [arch/arm/mach-pxa/pxa3xx.o] Error 1 /tmp/cci5MUNu.s:326: Error: selected processor does not support ARM mode `mra r2,r3,acc0' /tmp/cci5MUNu.s:367: Error: selected processor does not support ARM mode `mar acc0,r2,r3' make[3]: *** [arch/arm/mach-pxa/pxa27x.o] Error 1 Overriding with -Wa,-march=xscale no longer works, so instead I'm adding an explict ".arch_extension" directive in all four inline assembly statements, which should work even if they end up in a different order in the assembly output. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-pxa/pxa27x.c | 6 ++++-- arch/arm/mach-pxa/pxa3xx.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 8dfd1755c659..49c735962148 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -132,7 +132,8 @@ void pxa27x_cpu_pm_enter(suspend_state_t state) #ifndef CONFIG_IWMMXT u64 acc0; - asm volatile("mra %Q0, %R0, acc0" : "=r" (acc0)); + asm volatile(".arch_extension xscale\n\t" + "mra %Q0, %R0, acc0" : "=r" (acc0)); #endif /* ensure voltage-change sequencer not initiated, which hangs */ @@ -151,7 +152,8 @@ void pxa27x_cpu_pm_enter(suspend_state_t state) case PM_SUSPEND_MEM: cpu_suspend(pwrmode, pxa27x_finish_suspend); #ifndef CONFIG_IWMMXT - asm volatile("mar acc0, %Q0, %R0" : "=r" (acc0)); + asm volatile(".arch_extension xscale\n\t" + "mar acc0, %Q0, %R0" : "=r" (acc0)); #endif break; } diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 1ba62be65f7c..126c265691f5 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c @@ -102,7 +102,8 @@ static void pxa3xx_cpu_pm_suspend(void) #ifndef CONFIG_IWMMXT u64 acc0; - asm volatile("mra %Q0, %R0, acc0" : "=r" (acc0)); + asm volatile(".arch_extension xscale\n\t" + "mra %Q0, %R0, acc0" : "=r" (acc0)); #endif /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */ @@ -130,7 +131,8 @@ static void pxa3xx_cpu_pm_suspend(void) AD3ER = 0; #ifndef CONFIG_IWMMXT - asm volatile("mar acc0, %Q0, %R0" : "=r" (acc0)); + asm volatile(".arch_extension xscale\n\t" + "mar acc0, %Q0, %R0" : "=r" (acc0)); #endif } -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 8/9] ARM: pxa: don't select RFKILL if CONFIG_NET is disabled [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> ` (6 preceding siblings ...) 2016-01-29 14:06 ` [PATCH 7/9] ARM: pxa: fix building without IWMMXT Arnd Bergmann @ 2016-01-29 14:06 ` Arnd Bergmann 2016-01-29 14:06 ` [PATCH 9/9] ARM: mmp: mark usb_dma_mask as __maybe_unused Arnd Bergmann 8 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, linux-kernel Bluetooth is only supported when network support is part of the kernel, so it is a bit pointless to build the tosa-bt support without networking. If we try anyway, we get a Kconfig warning: warning: (TOSA_BT && H1940BT) selects RFKILL which has unmet direct dependencies (NET) This adds a dependency on CONFIG_NET to avoid that case. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-pxa/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 01066cff16e4..7ee4652b4c61 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -528,7 +528,7 @@ config MACH_TOSA config TOSA_BT tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" - depends on MACH_TOSA + depends on MACH_TOSA && NET select RFKILL help This is a simple driver that is able to control -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 9/9] ARM: mmp: mark usb_dma_mask as __maybe_unused [not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de> ` (7 preceding siblings ...) 2016-01-29 14:06 ` [PATCH 8/9] ARM: pxa: don't select RFKILL if CONFIG_NET is disabled Arnd Bergmann @ 2016-01-29 14:06 ` Arnd Bergmann 2016-02-22 22:38 ` Robert Jarzmik 8 siblings, 1 reply; 11+ messages in thread From: Arnd Bergmann @ 2016-01-29 14:06 UTC (permalink / raw) To: Robert Jarzmik Cc: linux-arm-kernel, Arnd Bergmann, Haojian Zhuang, Daniel Mack, Eric Miao, linux-kernel This variable may be used by some devices that each have their on Kconfig symbol, or by none of them, and that causes a build warning: arch/arm/mach-mmp/devices.c:241:12: error: 'usb_dma_mask' defined but not used [-Werror=unused-variable] Marking it __maybe_unused avoids the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-mmp/devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-mmp/devices.c b/arch/arm/mach-mmp/devices.c index 3330ac7cfbef..671c7a09ab3d 100644 --- a/arch/arm/mach-mmp/devices.c +++ b/arch/arm/mach-mmp/devices.c @@ -238,7 +238,7 @@ void pxa_usb_phy_deinit(void __iomem *phy_reg) #endif #if IS_ENABLED(CONFIG_USB_SUPPORT) -static u64 usb_dma_mask = ~(u32)0; +static u64 __maybe_unused usb_dma_mask = ~(u32)0; #if IS_ENABLED(CONFIG_USB_MV_UDC) struct resource pxa168_u2o_resources[] = { -- 2.7.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 9/9] ARM: mmp: mark usb_dma_mask as __maybe_unused 2016-01-29 14:06 ` [PATCH 9/9] ARM: mmp: mark usb_dma_mask as __maybe_unused Arnd Bergmann @ 2016-02-22 22:38 ` Robert Jarzmik 0 siblings, 0 replies; 11+ messages in thread From: Robert Jarzmik @ 2016-02-22 22:38 UTC (permalink / raw) To: Haojian Zhuang, Arnd Bergmann Cc: linux-arm-kernel, Daniel Mack, Eric Miao, linux-kernel Arnd Bergmann <arnd@arndb.de> writes: > This variable may be used by some devices that each have their > on Kconfig symbol, or by none of them, and that causes a build > warning: > > arch/arm/mach-mmp/devices.c:241:12: error: 'usb_dma_mask' defined but not used [-Werror=unused-variable] > > Marking it __maybe_unused avoids the warning. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > arch/arm/mach-mmp/devices.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Hi Haojian, I still didn't get an ack on this one, do you want to carry it through your tree, or let Arnd carry it or let me carry it ? Cheers. -- Robert [1] The patch > diff --git a/arch/arm/mach-mmp/devices.c b/arch/arm/mach-mmp/devices.c > index 3330ac7cfbef..671c7a09ab3d 100644 > --- a/arch/arm/mach-mmp/devices.c > +++ b/arch/arm/mach-mmp/devices.c > @@ -238,7 +238,7 @@ void pxa_usb_phy_deinit(void __iomem *phy_reg) > #endif > > #if IS_ENABLED(CONFIG_USB_SUPPORT) > -static u64 usb_dma_mask = ~(u32)0; > +static u64 __maybe_unused usb_dma_mask = ~(u32)0; > > #if IS_ENABLED(CONFIG_USB_MV_UDC) > struct resource pxa168_u2o_resources[] = { -- Robert ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-02-22 22:39 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1454076396-3563101-1-git-send-email-arnd@arndb.de>
2016-01-29 14:06 ` [PATCH 1/9] ARM: pxa: define clock registers as __iomem Arnd Bergmann
2016-01-29 18:31 ` Stephen Boyd
2016-01-29 14:06 ` [PATCH 2/9] ARM: pxa: mark spitz_card_pwr_ctrl as __maybe_unused Arnd Bergmann
2016-01-29 14:06 ` [PATCH 3/9] ARM: pxa: mark unused eseries code " Arnd Bergmann
2016-01-29 14:06 ` [PATCH 4/9] ARM: pxa: don't select GPIO_SYSFS for MIOA701 Arnd Bergmann
2016-01-29 14:06 ` [PATCH 5/9] ARM: pxa: always select one of the two CPU types Arnd Bergmann
2016-01-29 14:06 ` [PATCH 6/9] ARM: pxa: move extern declarations to pm.h Arnd Bergmann
2016-01-29 14:06 ` [PATCH 7/9] ARM: pxa: fix building without IWMMXT Arnd Bergmann
2016-01-29 14:06 ` [PATCH 8/9] ARM: pxa: don't select RFKILL if CONFIG_NET is disabled Arnd Bergmann
2016-01-29 14:06 ` [PATCH 9/9] ARM: mmp: mark usb_dma_mask as __maybe_unused Arnd Bergmann
2016-02-22 22:38 ` Robert Jarzmik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).