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

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
- a short branch of OMAP fixes that we didn't merge before the window
opened.
- a small cleanup that sorts the rk3288 dts entries properly
- a build fix due to a reference to a removed DT node on exynos

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
ARM: dts: exynos5420: remove disp_pd
ARM: EXYNOS: Fix suspend/resume sequences
ARM: dts: Fix the sort ordering of EHCI and HSIC in rk3288.dtsi
ARM: OMAP3: Fix coding style problems in arch/arm/mach-omap2/control.c
ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case.
ARM: OMAP2+: clock: allow omap2_dpll_round_rate() to round to next-lowest rate

+135 -141
-1
arch/arm/boot/dts/exynos5420.dtsi
··· 525 525 compatible = "samsung,exynos5410-mipi-dsi"; 526 526 reg = <0x14500000 0x10000>; 527 527 interrupts = <0 82 0>; 528 - samsung,power-domain = <&disp_pd>; 529 528 phys = <&mipi_phy 1>; 530 529 phy-names = "dsim"; 531 530 clocks = <&clock CLK_DSIM1>, <&clock CLK_SCLK_MIPI1>;
+20 -20
arch/arm/boot/dts/rk3288.dtsi
··· 195 195 status = "disabled"; 196 196 }; 197 197 198 + usb_host0_ehci: usb@ff500000 { 199 + compatible = "generic-ehci"; 200 + reg = <0xff500000 0x100>; 201 + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; 202 + clocks = <&cru HCLK_USBHOST0>; 203 + clock-names = "usbhost"; 204 + status = "disabled"; 205 + }; 206 + 207 + /* NOTE: ohci@ff520000 doesn't actually work on hardware */ 208 + 209 + usb_hsic: usb@ff5c0000 { 210 + compatible = "generic-ehci"; 211 + reg = <0xff5c0000 0x100>; 212 + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; 213 + clocks = <&cru HCLK_HSIC>; 214 + clock-names = "usbhost"; 215 + status = "disabled"; 216 + }; 217 + 198 218 i2c0: i2c@ff650000 { 199 219 compatible = "rockchip,rk3288-i2c"; 200 220 reg = <0xff650000 0x1000>; ··· 268 248 compatible = "rockchip,rk3288-wdt", "snps,dw-wdt"; 269 249 reg = <0xff800000 0x100>; 270 250 interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>; 271 - status = "disabled"; 272 - }; 273 - 274 - usb_host0_ehci: usb@ff500000 { 275 - compatible = "generic-ehci"; 276 - reg = <0xff500000 0x100>; 277 - interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; 278 - clocks = <&cru HCLK_USBHOST0>; 279 - clock-names = "usbhost"; 280 - status = "disabled"; 281 - }; 282 - 283 - /* NOTE: ohci@ff520000 doesn't actually work on hardware */ 284 - 285 - usb_hsic: usb@ff5c0000 { 286 - compatible = "generic-ehci"; 287 - reg = <0xff5c0000 0x100>; 288 - interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; 289 - clocks = <&cru HCLK_HSIC>; 290 - clock-names = "usbhost"; 291 251 status = "disabled"; 292 252 }; 293 253
+76 -87
arch/arm/mach-exynos/pm.c
··· 114 114 #define S5P_CHECK_AFTR 0xFCBA0D10 115 115 #define S5P_CHECK_SLEEP 0x00000BAD 116 116 117 - /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */ 118 - static void exynos_set_wakeupmask(long mask) 119 - { 120 - pmu_raw_writel(mask, S5P_WAKEUP_MASK); 121 - } 122 - 123 - static void exynos_cpu_set_boot_vector(long flags) 124 - { 125 - __raw_writel(virt_to_phys(exynos_cpu_resume), EXYNOS_BOOT_VECTOR_ADDR); 126 - __raw_writel(flags, EXYNOS_BOOT_VECTOR_FLAG); 127 - } 128 - 129 - void exynos_enter_aftr(void) 130 - { 131 - exynos_set_wakeupmask(0x0000ff3e); 132 - exynos_cpu_set_boot_vector(S5P_CHECK_AFTR); 133 - /* Set value of power down register for aftr mode */ 134 - exynos_sys_powerdown_conf(SYS_AFTR); 135 - } 136 - 137 117 /* For Cortex-A9 Diagnostic and Power control register */ 138 118 static unsigned int save_arm_register[2]; 139 119 ··· 151 171 asm volatile ("mcr p15, 0, %0, c15, c0, 1" 152 172 : : "r" (tmp) 153 173 : "cc"); 174 + } 175 + 176 + static void exynos_pm_central_suspend(void) 177 + { 178 + unsigned long tmp; 179 + 180 + /* Setting Central Sequence Register for power down mode */ 181 + tmp = pmu_raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION); 182 + tmp &= ~S5P_CENTRAL_LOWPWR_CFG; 183 + pmu_raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION); 184 + } 185 + 186 + static int exynos_pm_central_resume(void) 187 + { 188 + unsigned long tmp; 189 + 190 + /* 191 + * If PMU failed while entering sleep mode, WFI will be 192 + * ignored by PMU and then exiting cpu_do_idle(). 193 + * S5P_CENTRAL_LOWPWR_CFG bit will not be set automatically 194 + * in this situation. 195 + */ 196 + tmp = pmu_raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION); 197 + if (!(tmp & S5P_CENTRAL_LOWPWR_CFG)) { 198 + tmp |= S5P_CENTRAL_LOWPWR_CFG; 199 + pmu_raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION); 200 + /* clear the wakeup state register */ 201 + pmu_raw_writel(0x0, S5P_WAKEUP_STAT); 202 + /* No need to perform below restore code */ 203 + return -1; 204 + } 205 + 206 + return 0; 207 + } 208 + 209 + /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */ 210 + static void exynos_set_wakeupmask(long mask) 211 + { 212 + pmu_raw_writel(mask, S5P_WAKEUP_MASK); 213 + } 214 + 215 + static void exynos_cpu_set_boot_vector(long flags) 216 + { 217 + __raw_writel(virt_to_phys(exynos_cpu_resume), EXYNOS_BOOT_VECTOR_ADDR); 218 + __raw_writel(flags, EXYNOS_BOOT_VECTOR_FLAG); 219 + } 220 + 221 + static int exynos_aftr_finisher(unsigned long flags) 222 + { 223 + exynos_set_wakeupmask(0x0000ff3e); 224 + exynos_cpu_set_boot_vector(S5P_CHECK_AFTR); 225 + /* Set value of power down register for aftr mode */ 226 + exynos_sys_powerdown_conf(SYS_AFTR); 227 + cpu_do_idle(); 228 + 229 + return 1; 230 + } 231 + 232 + void exynos_enter_aftr(void) 233 + { 234 + cpu_pm_enter(); 235 + 236 + exynos_pm_central_suspend(); 237 + if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) 238 + exynos_cpu_save_register(); 239 + 240 + cpu_suspend(0, exynos_aftr_finisher); 241 + 242 + if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) { 243 + scu_enable(S5P_VA_SCU); 244 + exynos_cpu_restore_register(); 245 + } 246 + 247 + exynos_pm_central_resume(); 248 + 249 + cpu_pm_exit(); 154 250 } 155 251 156 252 static int exynos_cpu_suspend(unsigned long arg) ··· 273 217 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0); 274 218 } 275 219 276 - static void exynos_pm_central_suspend(void) 277 - { 278 - unsigned long tmp; 279 - 280 - /* Setting Central Sequence Register for power down mode */ 281 - tmp = pmu_raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION); 282 - tmp &= ~S5P_CENTRAL_LOWPWR_CFG; 283 - pmu_raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION); 284 - } 285 - 286 220 static int exynos_pm_suspend(void) 287 221 { 288 222 unsigned long tmp; ··· 286 240 287 241 if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) 288 242 exynos_cpu_save_register(); 289 - 290 - return 0; 291 - } 292 - 293 - static int exynos_pm_central_resume(void) 294 - { 295 - unsigned long tmp; 296 - 297 - /* 298 - * If PMU failed while entering sleep mode, WFI will be 299 - * ignored by PMU and then exiting cpu_do_idle(). 300 - * S5P_CENTRAL_LOWPWR_CFG bit will not be set automatically 301 - * in this situation. 302 - */ 303 - tmp = pmu_raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION); 304 - if (!(tmp & S5P_CENTRAL_LOWPWR_CFG)) { 305 - tmp |= S5P_CENTRAL_LOWPWR_CFG; 306 - pmu_raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION); 307 - /* clear the wakeup state register */ 308 - pmu_raw_writel(0x0, S5P_WAKEUP_STAT); 309 - /* No need to perform below restore code */ 310 - return -1; 311 - } 312 243 313 244 return 0; 314 245 } ··· 392 369 .valid = suspend_valid_only_mem, 393 370 }; 394 371 395 - static int exynos_cpu_pm_notifier(struct notifier_block *self, 396 - unsigned long cmd, void *v) 397 - { 398 - int cpu = smp_processor_id(); 399 - 400 - switch (cmd) { 401 - case CPU_PM_ENTER: 402 - if (cpu == 0) { 403 - exynos_pm_central_suspend(); 404 - if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) 405 - exynos_cpu_save_register(); 406 - } 407 - break; 408 - 409 - case CPU_PM_EXIT: 410 - if (cpu == 0) { 411 - if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) { 412 - scu_enable(S5P_VA_SCU); 413 - exynos_cpu_restore_register(); 414 - } 415 - exynos_pm_central_resume(); 416 - } 417 - break; 418 - } 419 - 420 - return NOTIFY_OK; 421 - } 422 - 423 - static struct notifier_block exynos_cpu_pm_notifier_block = { 424 - .notifier_call = exynos_cpu_pm_notifier, 425 - }; 426 - 427 372 void __init exynos_pm_init(void) 428 373 { 429 374 u32 tmp; 430 - 431 - cpu_pm_register_notifier(&exynos_cpu_pm_notifier_block); 432 375 433 376 /* Platform-specific GIC callback */ 434 377 gic_arch_extn.irq_set_wake = exynos_irq_set_wake;
+21 -7
arch/arm/mach-omap2/clkt_dpll.c
··· 285 285 { 286 286 struct clk_hw_omap *clk = to_clk_hw_omap(hw); 287 287 int m, n, r, scaled_max_m; 288 + int min_delta_m = INT_MAX, min_delta_n = INT_MAX; 288 289 unsigned long scaled_rt_rp; 289 290 unsigned long new_rate = 0; 290 291 struct dpll_data *dd; 291 292 unsigned long ref_rate; 293 + long delta; 294 + long prev_min_delta = LONG_MAX; 292 295 const char *clk_name; 293 296 294 297 if (!clk || !clk->dpll_data) ··· 337 334 if (r == DPLL_MULT_UNDERFLOW) 338 335 continue; 339 336 337 + /* skip rates above our target rate */ 338 + delta = target_rate - new_rate; 339 + if (delta < 0) 340 + continue; 341 + 342 + if (delta < prev_min_delta) { 343 + prev_min_delta = delta; 344 + min_delta_m = m; 345 + min_delta_n = n; 346 + } 347 + 340 348 pr_debug("clock: %s: m = %d: n = %d: new_rate = %lu\n", 341 349 clk_name, m, n, new_rate); 342 350 343 - if (target_rate == new_rate) { 344 - dd->last_rounded_m = m; 345 - dd->last_rounded_n = n; 346 - dd->last_rounded_rate = target_rate; 351 + if (delta == 0) 347 352 break; 348 - } 349 353 } 350 354 351 - if (target_rate != new_rate) { 355 + if (prev_min_delta == LONG_MAX) { 352 356 pr_debug("clock: %s: cannot round to rate %lu\n", 353 357 clk_name, target_rate); 354 358 return ~0; 355 359 } 356 360 357 - return target_rate; 361 + dd->last_rounded_m = min_delta_m; 362 + dd->last_rounded_n = min_delta_n; 363 + dd->last_rounded_rate = target_rate - prev_min_delta; 364 + 365 + return dd->last_rounded_rate; 358 366 } 359 367
+3 -3
arch/arm/mach-omap2/control.c
··· 280 280 u32 max_offset = OMAP343X_SCRATCHPAD_ROM_OFFSET; 281 281 void __iomem *v_addr; 282 282 u32 offset = 0; 283 + 283 284 v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM); 284 285 if (omap3xxx_prm_clear_global_cold_reset()) { 285 286 for ( ; offset <= max_offset; offset += 0x4) ··· 310 309 scratchpad_contents.public_restore_ptr = 311 310 virt_to_phys(omap3_restore_3630); 312 311 else if (omap_rev() != OMAP3430_REV_ES3_0 && 313 - omap_rev() != OMAP3430_REV_ES3_1) 312 + omap_rev() != OMAP3430_REV_ES3_1 && 313 + omap_rev() != OMAP3430_REV_ES3_1_2) 314 314 scratchpad_contents.public_restore_ptr = 315 315 virt_to_phys(omap3_restore); 316 316 else ··· 465 463 control_context.csi = omap_ctrl_readl(OMAP343X_CONTROL_CSI); 466 464 control_context.padconf_sys_nirq = 467 465 omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ); 468 - return; 469 466 } 470 467 471 468 void omap3_control_restore_context(void) ··· 522 521 omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI); 523 522 omap_ctrl_writel(control_context.padconf_sys_nirq, 524 523 OMAP343X_CONTROL_PADCONF_SYSNIRQ); 525 - return; 526 524 } 527 525 528 526 void omap3630_ctrl_disable_rta(void)
+11 -2
arch/arm/mach-omap2/dpll3xxx.c
··· 475 475 { 476 476 struct clk_hw_omap *clk = to_clk_hw_omap(hw); 477 477 struct clk *new_parent = NULL; 478 + unsigned long rrate; 478 479 u16 freqsel = 0; 479 480 struct dpll_data *dd; 480 481 int ret; ··· 503 502 __clk_prepare(dd->clk_ref); 504 503 clk_enable(dd->clk_ref); 505 504 506 - if (dd->last_rounded_rate != rate) 507 - rate = __clk_round_rate(hw->clk, rate); 505 + /* XXX this check is probably pointless in the CCF context */ 506 + if (dd->last_rounded_rate != rate) { 507 + rrate = __clk_round_rate(hw->clk, rate); 508 + if (rrate != rate) { 509 + pr_warn("%s: %s: final rate %lu does not match desired rate %lu\n", 510 + __func__, __clk_get_name(hw->clk), 511 + rrate, rate); 512 + rate = rrate; 513 + } 514 + } 508 515 509 516 if (dd->last_rounded_rate == 0) 510 517 return -EINVAL;
+4 -21
drivers/cpuidle/cpuidle-exynos.c
··· 20 20 21 21 static void (*exynos_enter_aftr)(void); 22 22 23 - static int idle_finisher(unsigned long flags) 24 - { 25 - exynos_enter_aftr(); 26 - cpu_do_idle(); 27 - 28 - return 1; 29 - } 30 - 31 - static int exynos_enter_core0_aftr(struct cpuidle_device *dev, 32 - struct cpuidle_driver *drv, 33 - int index) 34 - { 35 - cpu_pm_enter(); 36 - cpu_suspend(0, idle_finisher); 37 - cpu_pm_exit(); 38 - 39 - return index; 40 - } 41 - 42 23 static int exynos_enter_lowpower(struct cpuidle_device *dev, 43 24 struct cpuidle_driver *drv, 44 25 int index) ··· 32 51 33 52 if (new_index == 0) 34 53 return arm_cpuidle_simple_enter(dev, drv, new_index); 35 - else 36 - return exynos_enter_core0_aftr(dev, drv, new_index); 54 + 55 + exynos_enter_aftr(); 56 + 57 + return new_index; 37 58 } 38 59 39 60 static struct cpuidle_driver exynos_idle_driver = {