Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] arm64: dts: hisi: hip06 SAS device tree fixes
From: John Garry @ 2016-11-07 16:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patchset resolves some hip06 SAS device tree issues.

John Garry (3):
  arm64: dts: hisi: fix hip06 sas am-max-trans quirk
  arm64: dts: hisi: disable sas0 and sas2 for d03
  arm64: dts: hisi: add refclk node to hip06 dts files for SAS

 arch/arm64/boot/dts/hisilicon/hip06-d03.dts |  8 --------
 arch/arm64/boot/dts/hisilicon/hip06.dtsi    | 11 ++++++++++-
 2 files changed, 10 insertions(+), 9 deletions(-)

-- 
1.9.1

^ permalink raw reply

* [PATCH v2] staging: vc04_services: setup DMA and coherent mask
From: Eric Anholt @ 2016-11-07 16:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161031210203.2089-1-mzoran@crowfest.net>

Michael Zoran <mzoran@crowfest.net> writes:

> VCHI messages between the CPU and firmware use 32-bit
> bus addresses. Explicitly set the DMA mask and coherent
> on all platforms.

Reviewed-by: Eric Anholt <eric@anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161107/14619b5d/attachment.sig>

^ permalink raw reply

* [PATCHv4 0/4] WX checking for arm64
From: Catalin Marinas @ 2016-11-07 16:31 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <07589590-7b7d-4ba1-67af-b39c40b16939@redhat.com>

On Mon, Nov 07, 2016 at 08:26:34AM -0800, Laura Abbott wrote:
> On 11/07/2016 07:38 AM, Mark Rutland wrote:
> >From 06fef1ad1138d0808eec770e64458a350941bd2d Mon Sep 17 00:00:00 2001
> >From: Mark Rutland <mark.rutland@arm.com>
> >Date: Mon, 7 Nov 2016 15:24:40 +0000
> >Subject: [PATCH] Fix KASAN splats with DEBUG_WX
[...]
> Acked-by: Laura Abbott <labbott@redhat.com>

Thanks. I'll queue the patch on top of the others.

-- 
Catalin

^ permalink raw reply

* [PATCH 3/3] arm64/fpsimd: Use ID_AA64PFR0_EL1_.* macros
From: Suzuki K Poulose @ 2016-11-07 16:31 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1441303979-9535-1-git-send-email-kuleshovmail@gmail.com>

On 03/09/15 19:12, Alexander Kuleshov wrote:
> The 26d75e67c commit (arm64/cpufeature.h: Add macros for a cpu features
> testing) provides set of macros for the testing processor's FP and advanced
> SIMD features.
>
> Let's use these macros instead of direct calculation.
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  arch/arm64/kernel/fpsimd.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
> index 44d6f75..12943a5 100644
> --- a/arch/arm64/kernel/fpsimd.c
> +++ b/arch/arm64/kernel/fpsimd.c
> @@ -27,6 +27,7 @@
>
>  #include <asm/fpsimd.h>
>  #include <asm/cputype.h>
> +#include <asm/cpufeature.h>
>
>  #define FPEXC_IOF	(1 << 0)
>  #define FPEXC_DZF	(1 << 1)
> @@ -333,13 +334,13 @@ static int __init fpsimd_init(void)
>  {
>  	u64 pfr = read_cpuid(ID_AA64PFR0_EL1);
>
> -	if (pfr & (0xf << 16)) {
> +	if (ID_AA64PFR0_EL1_FP(pfr)) {
>  		pr_notice("Floating-point is not implemented\n");
>  		return 0;
>  	}
>  	elf_hwcap |= HWCAP_FP;
>
> -	if (pfr & (0xf << 20))
> +	if (ID_AA64PFR0_EL1_ADV_SIMD(pfr))
>  		pr_notice("Advanced SIMD is not implemented\n");
>  	else
>  		elf_hwcap |= HWCAP_ASIMD;
>

Similar to the previous one, this won't apply anymore.

Suzuki

^ permalink raw reply

* [PATCH 2/3] arm64/setup: Use ID_AA64ISAR0_EL1_.* macros
From: Suzuki K Poulose @ 2016-11-07 16:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1441303972-9480-1-git-send-email-kuleshovmail@gmail.com>

On 03/09/15 19:12, Alexander Kuleshov wrote:
> The 26d75e67c commit (arm64/cpufeature.h: Add macros for a cpu features
> testing) provides set of macros for the testing processor's crypto features.
> Let's use these macros instead of direct calculation.
>



> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  arch/arm64/kernel/setup.c | 29 +++++++++--------------------
>  1 file changed, 9 insertions(+), 20 deletions(-)
>
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index 926ae8d..a3faf4f 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c

This patch doesn't apply on the current mainline tree. Where does this patch apply ?
The elf_hwcap calculation has been moved to a separate function setup_elf_hwcaps()
in arch/arm64/kernel/cpufeature.c,  which makes uses of a table of arm64_cpu_capabilities.

Suzuki

> @@ -250,33 +250,22 @@ static void __init setup_processor(void)
>
>  	/*
>  	 * ID_AA64ISAR0_EL1 contains 4-bit wide signed feature blocks.
> -	 * The blocks we test below represent incremental functionality
> -	 * for non-negative values. Negative values are reserved.
>  	 */
>  	features = read_cpuid(ID_AA64ISAR0_EL1);
> -	block = (features >> 4) & 0xf;
> -	if (!(block & 0x8)) {
> -		switch (block) {
> -		default:
> -		case 2:
> -			elf_hwcap |= HWCAP_PMULL;
> -		case 1:
> -			elf_hwcap |= HWCAP_AES;
> -		case 0:
> -			break;
> -		}
> -	}
>
> -	block = (features >> 8) & 0xf;
> -	if (block && !(block & 0x8))
> +	if (ID_AA64ISAR0_EL1_AES(features))
> +		elf_hwcap |= HWCAP_AES;
> +
> +	if (ID_AA64ISAR0_EL1_PMULL(features))
> +		elf_hwcap |= HWCAP_PMULL;
> +
> +	if (ID_AA64ISAR0_EL1_SHA1(features))
>  		elf_hwcap |= HWCAP_SHA1;
>
> -	block = (features >> 12) & 0xf;
> -	if (block && !(block & 0x8))
> +	if (ID_AA64ISAR0_EL1_SHA2(features))
>  		elf_hwcap |= HWCAP_SHA2;
>
> -	block = (features >> 16) & 0xf;
> -	if (block && !(block & 0x8))
> +	if (ID_AA64ISAR0_EL1_CRC32(features))
>  		elf_hwcap |= HWCAP_CRC32;

^ permalink raw reply

* [PATCH v2] staging: vc04_services: add vchiq_pagelist_info structure
From: Eric Anholt @ 2016-11-07 16:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161107140603.14125-1-mzoran@crowfest.net>

Michael Zoran <mzoran@crowfest.net> writes:

> The current dma_map_sg based implementation for bulk messages
> computes many offsets into a single allocation multiple times in
> both the create and free code paths.  This is inefficient,
> error prone and in fact still has a few lingering issues
> with arm64.
>
> This change replaces a small portion of that inplementation with
> new code that uses a new struct vchiq_pagelist_info to store the
> needed information rather then complex offset calculations.
>
> This improved implementation should be more efficient and easier
> to understand and maintain.
>
> Tests Run(Both Pass):
> vchiq_test -p 1
> vchiq_test -f 10

Looks good, and it's a nice cleanup.  Thanks!

Reviewed-by: Eric Anholt <eric@anholt.net>

I had one style note, which was that you're using an int and 0/1 for a
boolean value, but we like to use proper bools and true/false instead.
However, you're modifying code that was already using an int for related
booleans, so that can be a separate cleanup.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161107/cd4b1063/attachment.sig>

^ permalink raw reply

* [PATCH] convert orion5x ls-chl to device tree
From: Gregory CLEMENT @ 2016-11-07 16:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <636b2eb5-a23d-1e87-2bf6-5c1cc1f8332b@gmail.com>

Hi Ash,
 
 On dim., nov. 06 2016, Ash Hughes <sehguh.hsa@gmail.com> wrote:

> Sorry about that, formatting error with tabs being converted to spaces
> in email. This should now apply.

I applied it to mvebu/dt.

Next time could you send it in a separate email?

Also, for device tree the topic should start by "ARM: dts: orion5x:".

And last point in your second version you forgot the commit log, I took
care of it too by using the one from your first version.

Thanks,

Gregory

>
> Ash
> --- 
> From 398d2c6e5c834e6887a5e6b5e898455977d0c00b Mon Sep 17 00:00:00 2001
> From: Ashley Hughes <ashley.hughes@blueyonder.co.uk>
> Date: Sun, 9 Oct 2016 17:04:12 +0100
> Subject: [PATCH] convert ls-chl to FDT
>
> Signed-off-by: Ashley Hughes <ashley.hughes@blueyonder.co.uk>
> ---
>  arch/arm/boot/dts/Makefile           |   1 +
>  arch/arm/boot/dts/orion5x-lschl.dts  | 171 ++++++++++++++++++
>  arch/arm/mach-orion5x/Kconfig        |   4 +-
>  arch/arm/mach-orion5x/Makefile       |   1 -
>  arch/arm/mach-orion5x/ls-chl-setup.c | 331 -----------------------------------
>  5 files changed, 174 insertions(+), 334 deletions(-)
>  create mode 100644 arch/arm/boot/dts/orion5x-lschl.dts
>  delete mode 100644 arch/arm/mach-orion5x/ls-chl-setup.c
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index befcd26..4853049 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -597,6 +597,7 @@ dtb-$(CONFIG_ARCH_ORION5X) += \
>  	orion5x-lacie-ethernet-disk-mini-v2.dtb \
>  	orion5x-linkstation-lsgl.dtb \
>  	orion5x-linkstation-lswtgl.dtb \
> +	orion5x-lschl.dtb \
>  	orion5x-lswsgl.dtb \
>  	orion5x-maxtor-shared-storage-2.dtb \
>  	orion5x-netgear-wnr854t.dtb \
> diff --git a/arch/arm/boot/dts/orion5x-lschl.dts b/arch/arm/boot/dts/orion5x-lschl.dts
> new file mode 100644
> index 0000000..9474092
> --- /dev/null
> +++ b/arch/arm/boot/dts/orion5x-lschl.dts
> @@ -0,0 +1,171 @@
> +/*
> + * Device Tree file for Buffalo Linkstation LS-CHLv3
> + *
> + * Copyright (C) 2016 Ash Hughes <ashley.hughes@blueyonder.co.uk>
> + * Copyright (C) 2015, 2016
> + * Roger Shimizu <rogershimizu@gmail.com>
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This file is free software; you can redistribute it and/or
> + *     modify it under the terms of the GNU General Public License as
> + *     published by the Free Software Foundation; either version 2 of the
> + *     License, or (at your option) any later version.
> + *
> + *     This file is distributed in the hope that it will be useful
> + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *     GNU General Public License for more details.
> + *
> + * Or, alternatively
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + *     obtaining a copy of this software and associated documentation
> + *     files (the "Software"), to deal in the Software without
> + *     restriction, including without limitation the rights to use
> + *     copy, modify, merge, publish, distribute, sublicense, and/or
> + *     sell copies of the Software, and to permit persons to whom the
> + *     Software is furnished to do so, subject to the following
> + *     conditions:
> + *
> + *     The above copyright notice and this permission notice shall be
> + *     included in all copies or substantial portions of the Software.
> + *
> + *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + *     OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/dts-v1/;
> +
> +#include "orion5x-linkstation.dtsi"
> +#include "mvebu-linkstation-gpio-simple.dtsi"
> +#include "mvebu-linkstation-fan.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +
> +/ {
> +	model = "Buffalo Linkstation Live v3 (LS-CHL)";
> +	compatible = "buffalo,lschl", "marvell,orion5x-88f5182", "marvell,orion5x";
> +
> +	memory { /* 128 MB */
> +		device_type = "memory";
> +		reg = <0x00000000 0x8000000>;
> +	};
> +
> +	gpio_keys {
> +		func {
> +			label = "Function Button";
> +			linux,code = <KEY_OPTION>;
> +			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		power-on-switch {
> +			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		power-auto-switch {
> +			gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +
> +	gpio_leds {
> +		pinctrl-0 = <&pmx_led_power &pmx_led_alarm &pmx_led_info &pmx_led_func>;
> +		blue-power-led {
> +			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		red-alarm-led {
> +			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		amber-info-led {
> +			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		func {
> +			label = "lschl:func:blue:top";
> +			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +
> +	gpio_fan {
> +		gpios = <&gpio0 14 GPIO_ACTIVE_LOW
> +			 &gpio0 16 GPIO_ACTIVE_LOW>;
> +
> +		alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
> +	};
> +};
> +
> +&pinctrl {
> +	pmx_led_power: pmx-leds {
> +		marvell,pins = "mpp0";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_power_hdd: pmx-power-hdd {
> +		marvell,pins = "mpp1";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_led_alarm: pmx-leds {
> +		marvell,pins = "mpp2";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_led_info: pmx-leds {
> +		marvell,pins = "mpp3";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_fan_lock: pmx-fan-lock {
> +		marvell,pins = "mpp6";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_power_switch: pmx-power-switch {
> +		marvell,pins = "mpp8", "mpp10", "mpp15";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_power_usb: pmx-power-usb {
> +		marvell,pins = "mpp9";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_fan_high: pmx-fan-high {
> +		marvell,pins = "mpp14";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_fan_low: pmx-fan-low {
> +		marvell,pins = "mpp16";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_led_func: pmx-leds {
> +		marvell,pins = "mpp17";
> +		marvell,function = "gpio";
> +	};
> +
> +	pmx_sw_init: pmx-sw-init {
> +		marvell,pins = "mpp7";
> +		marvell,function = "gpio";
> +	};
> +};
> +
> +&hdd_power {
> +	gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
> +};
> +
> +&usb_power {
> +	gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
> +};
> +
> diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
> index 89bb0fc..793efa9 100644
> --- a/arch/arm/mach-orion5x/Kconfig
> +++ b/arch/arm/mach-orion5x/Kconfig
> @@ -85,8 +85,8 @@ config MACH_LINKSTATION_PRO
>  	  v2 devices are supported.
>  
>  config MACH_LINKSTATION_LSCHL
> -	bool "Buffalo Linkstation Live v3 (LS-CHL)"
> -	select I2C_BOARDINFO if I2C
> +	bool "Buffalo Linkstation Live v3 (LS-CHL) (Flattened Device Tree)"
> +	select ARCH_ORION5X_DT
>  	help
>  	  Say 'Y' here if you want your kernel to support the
>  	  Buffalo Linkstation Live v3 (LS-CHL) platform.
> diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
> index 4b2502b..ae91872 100644
> --- a/arch/arm/mach-orion5x/Makefile
> +++ b/arch/arm/mach-orion5x/Makefile
> @@ -18,7 +18,6 @@ obj-$(CONFIG_MACH_WNR854T)	+= wnr854t-setup.o
>  obj-$(CONFIG_MACH_RD88F5181L_GE)	+= rd88f5181l-ge-setup.o
>  obj-$(CONFIG_MACH_RD88F5181L_FXO)	+= rd88f5181l-fxo-setup.o
>  obj-$(CONFIG_MACH_RD88F6183AP_GE)	+= rd88f6183ap-ge-setup.o
> -obj-$(CONFIG_MACH_LINKSTATION_LSCHL)	+= ls-chl-setup.o
>  
>  obj-$(CONFIG_ARCH_ORION5X_DT)		+= board-dt.o
>  obj-$(CONFIG_MACH_D2NET_DT)	+= board-d2net.o
> diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
> deleted file mode 100644
> index dfdaa8a..0000000
> --- a/arch/arm/mach-orion5x/ls-chl-setup.c
> +++ /dev/null
> @@ -1,331 +0,0 @@
> -/*
> - * arch/arm/mach-orion5x/ls-chl-setup.c
> - *
> - * Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk>
> - *
> - * This file is licensed under the terms of the GNU General Public
> - * License version 2.  This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -#include <linux/mtd/physmap.h>
> -#include <linux/mv643xx_eth.h>
> -#include <linux/leds.h>
> -#include <linux/gpio_keys.h>
> -#include <linux/gpio-fan.h>
> -#include <linux/input.h>
> -#include <linux/i2c.h>
> -#include <linux/ata_platform.h>
> -#include <linux/gpio.h>
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
> -#include "common.h"
> -#include "mpp.h"
> -#include "orion5x.h"
> -
> -/*****************************************************************************
> - * Linkstation LS-CHL Info
> - ****************************************************************************/
> -
> -/*
> - * 256K NOR flash Device bus boot chip select
> - */
> -
> -#define LSCHL_NOR_BOOT_BASE	0xf4000000
> -#define LSCHL_NOR_BOOT_SIZE	SZ_256K
> -
> -/*****************************************************************************
> - * 256KB NOR Flash on BOOT Device
> - ****************************************************************************/
> -
> -static struct physmap_flash_data lschl_nor_flash_data = {
> -	.width = 1,
> -};
> -
> -static struct resource lschl_nor_flash_resource = {
> -	.flags	= IORESOURCE_MEM,
> -	.start	= LSCHL_NOR_BOOT_BASE,
> -	.end	= LSCHL_NOR_BOOT_BASE + LSCHL_NOR_BOOT_SIZE - 1,
> -};
> -
> -static struct platform_device lschl_nor_flash = {
> -	.name = "physmap-flash",
> -	.id = 0,
> -	.dev = {
> -		.platform_data	= &lschl_nor_flash_data,
> -	},
> -	.num_resources = 1,
> -	.resource = &lschl_nor_flash_resource,
> -};
> -
> -/*****************************************************************************
> - * Ethernet
> - ****************************************************************************/
> -
> -static struct mv643xx_eth_platform_data lschl_eth_data = {
> -	.phy_addr = MV643XX_ETH_PHY_ADDR(8),
> -};
> -
> -/*****************************************************************************
> - * RTC 5C372a on I2C bus
> - ****************************************************************************/
> -
> -static struct i2c_board_info __initdata lschl_i2c_rtc = {
> -	I2C_BOARD_INFO("rs5c372a", 0x32),
> -};
> -
> -/*****************************************************************************
> - * LEDs attached to GPIO
> - ****************************************************************************/
> -
> -#define LSCHL_GPIO_LED_ALARM	2
> -#define LSCHL_GPIO_LED_INFO	3
> -#define LSCHL_GPIO_LED_FUNC	17
> -#define LSCHL_GPIO_LED_PWR	0
> -
> -static struct gpio_led lschl_led_pins[] = {
> -	{
> -		.name = "alarm:red",
> -		.gpio = LSCHL_GPIO_LED_ALARM,
> -		.active_low = 1,
> -	}, {
> -		.name = "info:amber",
> -		.gpio = LSCHL_GPIO_LED_INFO,
> -		.active_low = 1,
> -	}, {
> -		.name = "func:blue:top",
> -		.gpio = LSCHL_GPIO_LED_FUNC,
> -		.active_low = 1,
> -	}, {
> -		.name = "power:blue:bottom",
> -		.gpio = LSCHL_GPIO_LED_PWR,
> -	},
> -};
> -
> -static struct gpio_led_platform_data lschl_led_data = {
> -	.leds = lschl_led_pins,
> -	.num_leds = ARRAY_SIZE(lschl_led_pins),
> -};
> -
> -static struct platform_device lschl_leds = {
> -	.name = "leds-gpio",
> -	.id = -1,
> -	.dev = {
> -		.platform_data = &lschl_led_data,
> -	},
> -};
> -
> -/*****************************************************************************
> - * SATA
> - ****************************************************************************/
> -static struct mv_sata_platform_data lschl_sata_data = {
> -	.n_ports = 2,
> -};
> -
> -/*****************************************************************************
> - * LS-CHL specific power off method: reboot
> - ****************************************************************************/
> -/*
> - * On the LS-CHL, the shutdown process is following:
> - * - Userland monitors key events until the power switch goes to off position
> - * - The board reboots
> - * - U-boot starts and goes into an idle mode waiting for the user
> - *   to move the switch to ON position
> - *
> - */
> -
> -static void lschl_power_off(void)
> -{
> -	orion5x_restart(REBOOT_HARD, NULL);
> -}
> -
> -/*****************************************************************************
> - * General Setup
> - ****************************************************************************/
> -#define LSCHL_GPIO_USB_POWER	9
> -#define LSCHL_GPIO_AUTO_POWER	17
> -#define LSCHL_GPIO_POWER	18
> -
> -/****************************************************************************
> - * GPIO Attached Keys
> - ****************************************************************************/
> -#define LSCHL_GPIO_KEY_FUNC		15
> -#define LSCHL_GPIO_KEY_POWER		8
> -#define LSCHL_GPIO_KEY_AUTOPOWER	10
> -#define LSCHL_SW_POWER		0x00
> -#define LSCHL_SW_AUTOPOWER	0x01
> -#define LSCHL_SW_FUNC		0x02
> -
> -static struct gpio_keys_button lschl_buttons[] = {
> -	{
> -		.type = EV_SW,
> -		.code = LSCHL_SW_POWER,
> -		.gpio = LSCHL_GPIO_KEY_POWER,
> -		.desc = "Power-on Switch",
> -		.active_low = 1,
> -	}, {
> -		.type = EV_SW,
> -		.code = LSCHL_SW_AUTOPOWER,
> -		.gpio = LSCHL_GPIO_KEY_AUTOPOWER,
> -		.desc = "Power-auto Switch",
> -		.active_low = 1,
> -	}, {
> -		.type = EV_SW,
> -		.code = LSCHL_SW_FUNC,
> -		.gpio = LSCHL_GPIO_KEY_FUNC,
> -		.desc = "Function Switch",
> -		.active_low = 1,
> -	},
> -};
> -
> -static struct gpio_keys_platform_data lschl_button_data = {
> -	.buttons = lschl_buttons,
> -	.nbuttons = ARRAY_SIZE(lschl_buttons),
> -};
> -
> -static struct platform_device lschl_button_device = {
> -	.name = "gpio-keys",
> -	.id = -1,
> -	.num_resources = 0,
> -	.dev = {
> -		.platform_data = &lschl_button_data,
> -	},
> -};
> -
> -#define LSCHL_GPIO_HDD_POWER	1
> -
> -/****************************************************************************
> - * GPIO Fan
> - ****************************************************************************/
> -
> -#define LSCHL_GPIO_FAN_LOW	16
> -#define LSCHL_GPIO_FAN_HIGH	14
> -#define LSCHL_GPIO_FAN_LOCK	6
> -
> -static struct gpio_fan_alarm lschl_alarm = {
> -	.gpio = LSCHL_GPIO_FAN_LOCK,
> -};
> -
> -static struct gpio_fan_speed lschl_speeds[] = {
> -	{
> -		.rpm = 0,
> -		.ctrl_val = 3,
> -	}, {
> -		.rpm = 1500,
> -		.ctrl_val = 2,
> -	}, {
> -		.rpm = 3250,
> -		.ctrl_val = 1,
> -	}, {
> -		.rpm = 5000,
> -		.ctrl_val = 0,
> -	},
> -};
> -
> -static int lschl_gpio_list[] = {
> -	LSCHL_GPIO_FAN_HIGH, LSCHL_GPIO_FAN_LOW,
> -};
> -
> -static struct gpio_fan_platform_data lschl_fan_data = {
> -	.num_ctrl = ARRAY_SIZE(lschl_gpio_list),
> -	.ctrl = lschl_gpio_list,
> -	.alarm = &lschl_alarm,
> -	.num_speed = ARRAY_SIZE(lschl_speeds),
> -	.speed = lschl_speeds,
> -};
> -
> -static struct platform_device lschl_fan_device = {
> -	.name = "gpio-fan",
> -	.id = -1,
> -	.num_resources = 0,
> -	.dev = {
> -		.platform_data = &lschl_fan_data,
> -	},
> -};
> -
> -/****************************************************************************
> - * GPIO Data
> - ****************************************************************************/
> -
> -static unsigned int lschl_mpp_modes[] __initdata = {
> -	MPP0_GPIO, /* LED POWER */
> -	MPP1_GPIO, /* HDD POWER */
> -	MPP2_GPIO, /* LED ALARM */
> -	MPP3_GPIO, /* LED INFO */
> -	MPP4_UNUSED,
> -	MPP5_UNUSED,
> -	MPP6_GPIO, /* FAN LOCK */
> -	MPP7_GPIO, /* SW INIT */
> -	MPP8_GPIO, /* SW POWER */
> -	MPP9_GPIO, /* USB POWER */
> -	MPP10_GPIO, /* SW AUTO POWER */
> -	MPP11_UNUSED,
> -	MPP12_UNUSED,
> -	MPP13_UNUSED,
> -	MPP14_GPIO, /* FAN HIGH */
> -	MPP15_GPIO, /* SW FUNC */
> -	MPP16_GPIO, /* FAN LOW */
> -	MPP17_GPIO, /* LED FUNC */
> -	MPP18_UNUSED,
> -	MPP19_UNUSED,
> -	0,
> -};
> -
> -static void __init lschl_init(void)
> -{
> -	/*
> -	 * Setup basic Orion functions. Needs to be called early.
> -	 */
> -	orion5x_init();
> -
> -	orion5x_mpp_conf(lschl_mpp_modes);
> -
> -	/*
> -	 * Configure peripherals.
> -	 */
> -	orion5x_ehci0_init();
> -	orion5x_ehci1_init();
> -	orion5x_eth_init(&lschl_eth_data);
> -	orion5x_i2c_init();
> -	orion5x_sata_init(&lschl_sata_data);
> -	orion5x_uart0_init();
> -	orion5x_xor_init();
> -
> -	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
> -				    ORION_MBUS_DEVBUS_BOOT_ATTR,
> -				    LSCHL_NOR_BOOT_BASE,
> -				    LSCHL_NOR_BOOT_SIZE);
> -	platform_device_register(&lschl_nor_flash);
> -
> -	platform_device_register(&lschl_leds);
> -
> -	platform_device_register(&lschl_button_device);
> -
> -	platform_device_register(&lschl_fan_device);
> -
> -	i2c_register_board_info(0, &lschl_i2c_rtc, 1);
> -
> -	/* usb power on */
> -	gpio_set_value(LSCHL_GPIO_USB_POWER, 1);
> -
> -	/* register power-off method */
> -	pm_power_off = lschl_power_off;
> -
> -	pr_info("%s: finished\n", __func__);
> -}
> -
> -MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
> -	/* Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk> */
> -	.atag_offset	= 0x100,
> -	.nr_irqs	= ORION5X_NR_IRQS,
> -	.init_machine	= lschl_init,
> -	.map_io		= orion5x_map_io,
> -	.init_early	= orion5x_init_early,
> -	.init_irq	= orion5x_init_irq,
> -	.init_time	= orion5x_timer_init,
> -	.fixup		= tag_fixup_mem32,
> -	.restart	= orion5x_restart,
> -MACHINE_END
> -- 
> 2.7.4
>
>
> On 04/11/16 12:44, Gregory CLEMENT wrote:
>> Hi Ash,
>>  
>>  On mar., oct. 25 2016, Ash Hughes <sehguh.hsa@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> This patch converts my orion5x ls-chl Linkstation device to device
>>> tree.
>> I was about to apply your patch but it does not apply on mvebu/dt or
>> even on v4.9-rc1.
>>
>> Could you rebase it?
>>
>> Thanks,
>>
>> Gregory
>>
>>> Signed-off-by: Ashley Hughes <ashley.hughes@blueyonder.co.uk>
>>> ---
>>>  arch/arm/boot/dts/Makefile           |   1 +
>>>  arch/arm/boot/dts/orion5x-lschl.dts  | 171 ++++++++++++++++++
>>>  arch/arm/mach-orion5x/Kconfig        |   4 +-
>>>  arch/arm/mach-orion5x/Makefile       |   1 -
>>>  arch/arm/mach-orion5x/ls-chl-setup.c | 331 -----------------------------------
>>>  5 files changed, 174 insertions(+), 334 deletions(-)
>>>  create mode 100644 arch/arm/boot/dts/orion5x-lschl.dts
>>>  delete mode 100644 arch/arm/mach-orion5x/ls-chl-setup.c
>>>
>>> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>>> index befcd26..4853049 100644
>>> --- a/arch/arm/boot/dts/Makefile
>>> +++ b/arch/arm/boot/dts/Makefile
>>> @@ -597,6 +597,7 @@ dtb-$(CONFIG_ARCH_ORION5X) += \
>>>      orion5x-lacie-ethernet-disk-mini-v2.dtb \
>>>      orion5x-linkstation-lsgl.dtb \
>>>      orion5x-linkstation-lswtgl.dtb \
>>> +    orion5x-lschl.dtb \
>>>      orion5x-lswsgl.dtb \
>>>      orion5x-maxtor-shared-storage-2.dtb \
>>>      orion5x-netgear-wnr854t.dtb \
>>> diff --git a/arch/arm/boot/dts/orion5x-lschl.dts b/arch/arm/boot/dts/orion5x-lschl.dts
>>> new file mode 100644
>>> index 0000000..9474092
>>> --- /dev/null
>>> +++ b/arch/arm/boot/dts/orion5x-lschl.dts
>>> @@ -0,0 +1,171 @@
>>> +/*
>>> + * Device Tree file for Buffalo Linkstation LS-CHLv3
>>> + *
>>> + * Copyright (C) 2016 Ash Hughes <ashley.hughes@blueyonder.co.uk>
>>> + * Copyright (C) 2015, 2016
>>> + * Roger Shimizu <rogershimizu@gmail.com>
>>> + *
>>> + * This file is dual-licensed: you can use it either under the terms
>>> + * of the GPL or the X11 license, at your option. Note that this dual
>>> + * licensing only applies to this file, and not this project as a
>>> + * whole.
>>> + *
>>> + *  a) This file is free software; you can redistribute it and/or
>>> + *     modify it under the terms of the GNU General Public License as
>>> + *     published by the Free Software Foundation; either version 2 of the
>>> + *     License, or (at your option) any later version.
>>> + *
>>> + *     This file is distributed in the hope that it will be useful
>>> + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>> + *     GNU General Public License for more details.
>>> + *
>>> + * Or, alternatively
>>> + *
>>> + *  b) Permission is hereby granted, free of charge, to any person
>>> + *     obtaining a copy of this software and associated documentation
>>> + *     files (the "Software"), to deal in the Software without
>>> + *     restriction, including without limitation the rights to use
>>> + *     copy, modify, merge, publish, distribute, sublicense, and/or
>>> + *     sell copies of the Software, and to permit persons to whom the
>>> + *     Software is furnished to do so, subject to the following
>>> + *     conditions:
>>> + *
>>> + *     The above copyright notice and this permission notice shall be
>>> + *     included in all copies or substantial portions of the Software.
>>> + *
>>> + *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
>>> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
>>> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>>> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>>> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
>>> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>>> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>>> + *     OTHER DEALINGS IN THE SOFTWARE.
>>> + */
>>> +
>>> +/dts-v1/;
>>> +
>>> +#include "orion5x-linkstation.dtsi"
>>> +#include "mvebu-linkstation-gpio-simple.dtsi"
>>> +#include "mvebu-linkstation-fan.dtsi"
>>> +#include <dt-bindings/gpio/gpio.h>
>>> +
>>> +/ {
>>> +    model = "Buffalo Linkstation Live v3 (LS-CHL)";
>>> +    compatible = "buffalo,lschl", "marvell,orion5x-88f5182", "marvell,orion5x";
>>> +
>>> +    memory { /* 128 MB */
>>> +        device_type = "memory";
>>> +        reg = <0x00000000 0x8000000>;
>>> +    };
>>> +
>>> +    gpio_keys {
>>> +        func {
>>> +            label = "Function Button";
>>> +            linux,code = <KEY_OPTION>;
>>> +            gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
>>> +        };
>>> +
>>> +        power-on-switch {
>>> +            gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
>>> +        };
>>> +
>>> +        power-auto-switch {
>>> +            gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
>>> +        };
>>> +    };
>>> +
>>> +    gpio_leds {
>>> +        pinctrl-0 = <&pmx_led_power &pmx_led_alarm &pmx_led_info &pmx_led_func>;
>>> +        blue-power-led {
>>> +            gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
>>> +        };
>>> +
>>> +        red-alarm-led {
>>> +            gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
>>> +        };
>>> +
>>> +        amber-info-led {
>>> +            gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
>>> +        };
>>> +
>>> +        func {
>>> +            label = "lschl:func:blue:top";
>>> +            gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
>>> +        };
>>> +    };
>>> +
>>> +    gpio_fan {
>>> +        gpios = <&gpio0 14 GPIO_ACTIVE_LOW
>>> +             &gpio0 16 GPIO_ACTIVE_LOW>;
>>> +
>>> +        alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
>>> +    };
>>> +};
>>> +
>>> +&pinctrl {
>>> +    pmx_led_power: pmx-leds {
>>> +        marvell,pins = "mpp0";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_power_hdd: pmx-power-hdd {
>>> +        marvell,pins = "mpp1";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_led_alarm: pmx-leds {
>>> +        marvell,pins = "mpp2";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_led_info: pmx-leds {
>>> +        marvell,pins = "mpp3";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_fan_lock: pmx-fan-lock {
>>> +        marvell,pins = "mpp6";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_power_switch: pmx-power-switch {
>>> +        marvell,pins = "mpp8", "mpp10", "mpp15";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_power_usb: pmx-power-usb {
>>> +        marvell,pins = "mpp9";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_fan_high: pmx-fan-high {
>>> +        marvell,pins = "mpp14";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_fan_low: pmx-fan-low {
>>> +        marvell,pins = "mpp16";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_led_func: pmx-leds {
>>> +        marvell,pins = "mpp17";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +
>>> +    pmx_sw_init: pmx-sw-init {
>>> +        marvell,pins = "mpp7";
>>> +        marvell,function = "gpio";
>>> +    };
>>> +};
>>> +
>>> +&hdd_power {
>>> +    gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
>>> +};
>>> +
>>> +&usb_power {
>>> +    gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
>>> +};
>>> +
>>> diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
>>> index 89bb0fc..793efa9 100644
>>> --- a/arch/arm/mach-orion5x/Kconfig
>>> +++ b/arch/arm/mach-orion5x/Kconfig
>>> @@ -85,8 +85,8 @@ config MACH_LINKSTATION_PRO
>>>        v2 devices are supported.
>>>  
>>>  config MACH_LINKSTATION_LSCHL
>>> -    bool "Buffalo Linkstation Live v3 (LS-CHL)"
>>> -    select I2C_BOARDINFO if I2C
>>> +    bool "Buffalo Linkstation Live v3 (LS-CHL) (Flattened Device Tree)"
>>> +    select ARCH_ORION5X_DT
>>>      help
>>>        Say 'Y' here if you want your kernel to support the
>>>        Buffalo Linkstation Live v3 (LS-CHL) platform.
>>> diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
>>> index 4b2502b..ae91872 100644
>>> --- a/arch/arm/mach-orion5x/Makefile
>>> +++ b/arch/arm/mach-orion5x/Makefile
>>> @@ -18,7 +18,6 @@ obj-$(CONFIG_MACH_WNR854T)    += wnr854t-setup.o
>>>  obj-$(CONFIG_MACH_RD88F5181L_GE)    += rd88f5181l-ge-setup.o
>>>  obj-$(CONFIG_MACH_RD88F5181L_FXO)    += rd88f5181l-fxo-setup.o
>>>  obj-$(CONFIG_MACH_RD88F6183AP_GE)    += rd88f6183ap-ge-setup.o
>>> -obj-$(CONFIG_MACH_LINKSTATION_LSCHL)    += ls-chl-setup.o
>>>  
>>>  obj-$(CONFIG_ARCH_ORION5X_DT)        += board-dt.o
>>>  obj-$(CONFIG_MACH_D2NET_DT)    += board-d2net.o
>>> diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
>>> deleted file mode 100644
>>> index dfdaa8a..0000000
>>> --- a/arch/arm/mach-orion5x/ls-chl-setup.c
>>> +++ /dev/null
>>> @@ -1,331 +0,0 @@
>>> -/*
>>> - * arch/arm/mach-orion5x/ls-chl-setup.c
>>> - *
>>> - * Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk>
>>> - *
>>> - * This file is licensed under the terms of the GNU General Public
>>> - * License version 2.  This program is licensed "as is" without any
>>> - * warranty of any kind, whether express or implied.
>>> - */
>>> -
>>> -#include <linux/kernel.h>
>>> -#include <linux/init.h>
>>> -#include <linux/platform_device.h>
>>> -#include <linux/mtd/physmap.h>
>>> -#include <linux/mv643xx_eth.h>
>>> -#include <linux/leds.h>
>>> -#include <linux/gpio_keys.h>
>>> -#include <linux/gpio-fan.h>
>>> -#include <linux/input.h>
>>> -#include <linux/i2c.h>
>>> -#include <linux/ata_platform.h>
>>> -#include <linux/gpio.h>
>>> -#include <asm/mach-types.h>
>>> -#include <asm/mach/arch.h>
>>> -#include "common.h"
>>> -#include "mpp.h"
>>> -#include "orion5x.h"
>>> -
>>> -/*****************************************************************************
>>> - * Linkstation LS-CHL Info
>>> - ****************************************************************************/
>>> -
>>> -/*
>>> - * 256K NOR flash Device bus boot chip select
>>> - */
>>> -
>>> -#define LSCHL_NOR_BOOT_BASE    0xf4000000
>>> -#define LSCHL_NOR_BOOT_SIZE    SZ_256K
>>> -
>>> -/*****************************************************************************
>>> - * 256KB NOR Flash on BOOT Device
>>> - ****************************************************************************/
>>> -
>>> -static struct physmap_flash_data lschl_nor_flash_data = {
>>> -    .width = 1,
>>> -};
>>> -
>>> -static struct resource lschl_nor_flash_resource = {
>>> -    .flags    = IORESOURCE_MEM,
>>> -    .start    = LSCHL_NOR_BOOT_BASE,
>>> -    .end    = LSCHL_NOR_BOOT_BASE + LSCHL_NOR_BOOT_SIZE - 1,
>>> -};
>>> -
>>> -static struct platform_device lschl_nor_flash = {
>>> -    .name = "physmap-flash",
>>> -    .id = 0,
>>> -    .dev = {
>>> -        .platform_data    = &lschl_nor_flash_data,
>>> -    },
>>> -    .num_resources = 1,
>>> -    .resource = &lschl_nor_flash_resource,
>>> -};
>>> -
>>> -/*****************************************************************************
>>> - * Ethernet
>>> - ****************************************************************************/
>>> -
>>> -static struct mv643xx_eth_platform_data lschl_eth_data = {
>>> -    .phy_addr = MV643XX_ETH_PHY_ADDR(8),
>>> -};
>>> -
>>> -/*****************************************************************************
>>> - * RTC 5C372a on I2C bus
>>> - ****************************************************************************/
>>> -
>>> -static struct i2c_board_info __initdata lschl_i2c_rtc = {
>>> -    I2C_BOARD_INFO("rs5c372a", 0x32),
>>> -};
>>> -
>>> -/*****************************************************************************
>>> - * LEDs attached to GPIO
>>> - ****************************************************************************/
>>> -
>>> -#define LSCHL_GPIO_LED_ALARM    2
>>> -#define LSCHL_GPIO_LED_INFO    3
>>> -#define LSCHL_GPIO_LED_FUNC    17
>>> -#define LSCHL_GPIO_LED_PWR    0
>>> -
>>> -static struct gpio_led lschl_led_pins[] = {
>>> -    {
>>> -        .name = "alarm:red",
>>> -        .gpio = LSCHL_GPIO_LED_ALARM,
>>> -        .active_low = 1,
>>> -    }, {
>>> -        .name = "info:amber",
>>> -        .gpio = LSCHL_GPIO_LED_INFO,
>>> -        .active_low = 1,
>>> -    }, {
>>> -        .name = "func:blue:top",
>>> -        .gpio = LSCHL_GPIO_LED_FUNC,
>>> -        .active_low = 1,
>>> -    }, {
>>> -        .name = "power:blue:bottom",
>>> -        .gpio = LSCHL_GPIO_LED_PWR,
>>> -    },
>>> -};
>>> -
>>> -static struct gpio_led_platform_data lschl_led_data = {
>>> -    .leds = lschl_led_pins,
>>> -    .num_leds = ARRAY_SIZE(lschl_led_pins),
>>> -};
>>> -
>>> -static struct platform_device lschl_leds = {
>>> -    .name = "leds-gpio",
>>> -    .id = -1,
>>> -    .dev = {
>>> -        .platform_data = &lschl_led_data,
>>> -    },
>>> -};
>>> -
>>> -/*****************************************************************************
>>> - * SATA
>>> - ****************************************************************************/
>>> -static struct mv_sata_platform_data lschl_sata_data = {
>>> -    .n_ports = 2,
>>> -};
>>> -
>>> -/*****************************************************************************
>>> - * LS-CHL specific power off method: reboot
>>> - ****************************************************************************/
>>> -/*
>>> - * On the LS-CHL, the shutdown process is following:
>>> - * - Userland monitors key events until the power switch goes to off position
>>> - * - The board reboots
>>> - * - U-boot starts and goes into an idle mode waiting for the user
>>> - *   to move the switch to ON position
>>> - *
>>> - */
>>> -
>>> -static void lschl_power_off(void)
>>> -{
>>> -    orion5x_restart(REBOOT_HARD, NULL);
>>> -}
>>> -
>>> -/*****************************************************************************
>>> - * General Setup
>>> - ****************************************************************************/
>>> -#define LSCHL_GPIO_USB_POWER    9
>>> -#define LSCHL_GPIO_AUTO_POWER    17
>>> -#define LSCHL_GPIO_POWER    18
>>> -
>>> -/****************************************************************************
>>> - * GPIO Attached Keys
>>> - ****************************************************************************/
>>> -#define LSCHL_GPIO_KEY_FUNC        15
>>> -#define LSCHL_GPIO_KEY_POWER        8
>>> -#define LSCHL_GPIO_KEY_AUTOPOWER    10
>>> -#define LSCHL_SW_POWER        0x00
>>> -#define LSCHL_SW_AUTOPOWER    0x01
>>> -#define LSCHL_SW_FUNC        0x02
>>> -
>>> -static struct gpio_keys_button lschl_buttons[] = {
>>> -    {
>>> -        .type = EV_SW,
>>> -        .code = LSCHL_SW_POWER,
>>> -        .gpio = LSCHL_GPIO_KEY_POWER,
>>> -        .desc = "Power-on Switch",
>>> -        .active_low = 1,
>>> -    }, {
>>> -        .type = EV_SW,
>>> -        .code = LSCHL_SW_AUTOPOWER,
>>> -        .gpio = LSCHL_GPIO_KEY_AUTOPOWER,
>>> -        .desc = "Power-auto Switch",
>>> -        .active_low = 1,
>>> -    }, {
>>> -        .type = EV_SW,
>>> -        .code = LSCHL_SW_FUNC,
>>> -        .gpio = LSCHL_GPIO_KEY_FUNC,
>>> -        .desc = "Function Switch",
>>> -        .active_low = 1,
>>> -    },
>>> -};
>>> -
>>> -static struct gpio_keys_platform_data lschl_button_data = {
>>> -    .buttons = lschl_buttons,
>>> -    .nbuttons = ARRAY_SIZE(lschl_buttons),
>>> -};
>>> -
>>> -static struct platform_device lschl_button_device = {
>>> -    .name = "gpio-keys",
>>> -    .id = -1,
>>> -    .num_resources = 0,
>>> -    .dev = {
>>> -        .platform_data = &lschl_button_data,
>>> -    },
>>> -};
>>> -
>>> -#define LSCHL_GPIO_HDD_POWER    1
>>> -
>>> -/****************************************************************************
>>> - * GPIO Fan
>>> - ****************************************************************************/
>>> -
>>> -#define LSCHL_GPIO_FAN_LOW    16
>>> -#define LSCHL_GPIO_FAN_HIGH    14
>>> -#define LSCHL_GPIO_FAN_LOCK    6
>>> -
>>> -static struct gpio_fan_alarm lschl_alarm = {
>>> -    .gpio = LSCHL_GPIO_FAN_LOCK,
>>> -};
>>> -
>>> -static struct gpio_fan_speed lschl_speeds[] = {
>>> -    {
>>> -        .rpm = 0,
>>> -        .ctrl_val = 3,
>>> -    }, {
>>> -        .rpm = 1500,
>>> -        .ctrl_val = 2,
>>> -    }, {
>>> -        .rpm = 3250,
>>> -        .ctrl_val = 1,
>>> -    }, {
>>> -        .rpm = 5000,
>>> -        .ctrl_val = 0,
>>> -    },
>>> -};
>>> -
>>> -static int lschl_gpio_list[] = {
>>> -    LSCHL_GPIO_FAN_HIGH, LSCHL_GPIO_FAN_LOW,
>>> -};
>>> -
>>> -static struct gpio_fan_platform_data lschl_fan_data = {
>>> -    .num_ctrl = ARRAY_SIZE(lschl_gpio_list),
>>> -    .ctrl = lschl_gpio_list,
>>> -    .alarm = &lschl_alarm,
>>> -    .num_speed = ARRAY_SIZE(lschl_speeds),
>>> -    .speed = lschl_speeds,
>>> -};
>>> -
>>> -static struct platform_device lschl_fan_device = {
>>> -    .name = "gpio-fan",
>>> -    .id = -1,
>>> -    .num_resources = 0,
>>> -    .dev = {
>>> -        .platform_data = &lschl_fan_data,
>>> -    },
>>> -};
>>> -
>>> -/****************************************************************************
>>> - * GPIO Data
>>> - ****************************************************************************/
>>> -
>>> -static unsigned int lschl_mpp_modes[] __initdata = {
>>> -    MPP0_GPIO, /* LED POWER */
>>> -    MPP1_GPIO, /* HDD POWER */
>>> -    MPP2_GPIO, /* LED ALARM */
>>> -    MPP3_GPIO, /* LED INFO */
>>> -    MPP4_UNUSED,
>>> -    MPP5_UNUSED,
>>> -    MPP6_GPIO, /* FAN LOCK */
>>> -    MPP7_GPIO, /* SW INIT */
>>> -    MPP8_GPIO, /* SW POWER */
>>> -    MPP9_GPIO, /* USB POWER */
>>> -    MPP10_GPIO, /* SW AUTO POWER */
>>> -    MPP11_UNUSED,
>>> -    MPP12_UNUSED,
>>> -    MPP13_UNUSED,
>>> -    MPP14_GPIO, /* FAN HIGH */
>>> -    MPP15_GPIO, /* SW FUNC */
>>> -    MPP16_GPIO, /* FAN LOW */
>>> -    MPP17_GPIO, /* LED FUNC */
>>> -    MPP18_UNUSED,
>>> -    MPP19_UNUSED,
>>> -    0,
>>> -};
>>> -
>>> -static void __init lschl_init(void)
>>> -{
>>> -    /*
>>> -     * Setup basic Orion functions. Needs to be called early.
>>> -     */
>>> -    orion5x_init();
>>> -
>>> -    orion5x_mpp_conf(lschl_mpp_modes);
>>> -
>>> -    /*
>>> -     * Configure peripherals.
>>> -     */
>>> -    orion5x_ehci0_init();
>>> -    orion5x_ehci1_init();
>>> -    orion5x_eth_init(&lschl_eth_data);
>>> -    orion5x_i2c_init();
>>> -    orion5x_sata_init(&lschl_sata_data);
>>> -    orion5x_uart0_init();
>>> -    orion5x_xor_init();
>>> -
>>> -    mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
>>> -                    ORION_MBUS_DEVBUS_BOOT_ATTR,
>>> -                    LSCHL_NOR_BOOT_BASE,
>>> -                    LSCHL_NOR_BOOT_SIZE);
>>> -    platform_device_register(&lschl_nor_flash);
>>> -
>>> -    platform_device_register(&lschl_leds);
>>> -
>>> -    platform_device_register(&lschl_button_device);
>>> -
>>> -    platform_device_register(&lschl_fan_device);
>>> -
>>> -    i2c_register_board_info(0, &lschl_i2c_rtc, 1);
>>> -
>>> -    /* usb power on */
>>> -    gpio_set_value(LSCHL_GPIO_USB_POWER, 1);
>>> -
>>> -    /* register power-off method */
>>> -    pm_power_off = lschl_power_off;
>>> -
>>> -    pr_info("%s: finished\n", __func__);
>>> -}
>>> -
>>> -MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
>>> -    /* Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk> */
>>> -    .atag_offset    = 0x100,
>>> -    .nr_irqs    = ORION5X_NR_IRQS,
>>> -    .init_machine    = lschl_init,
>>> -    .map_io        = orion5x_map_io,
>>> -    .init_early    = orion5x_init_early,
>>> -    .init_irq    = orion5x_init_irq,
>>> -    .init_time    = orion5x_timer_init,
>>> -    .fixup        = tag_fixup_mem32,
>>> -    .restart    = orion5x_restart,
>>> -MACHINE_END
>>> -- 2.7.4
>>>
>>>
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply

* [PATCHv4 0/4] WX checking for arm64
From: Laura Abbott @ 2016-11-07 16:26 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161107153802.GJ19796@leverpostej>

On 11/07/2016 07:38 AM, Mark Rutland wrote:
> On Sun, Oct 30, 2016 at 03:03:07PM +0000, Catalin Marinas wrote:
>> On Thu, Oct 27, 2016 at 09:27:30AM -0700, Laura Abbott wrote:
>>> Laura Abbott (4):
>>>   arm64: dump: Make ptdump debugfs a separate option
>>>   arm64: dump: Make the page table dumping seq_file optional
>>>   arm64: dump: Remove max_addr
>>>   arm64: dump: Add checking for writable and exectuable pages
>>
>> Queued for 4.10. Thanks.
>
> Catalin mentioned to me that he saw some KASAN splats when testing; it
> looks like need a fixup something like the below.
>
> Apologies for not having spotted this when testing!
>
> Thanks,
> Mark.
>
> ---->8----
> From 06fef1ad1138d0808eec770e64458a350941bd2d Mon Sep 17 00:00:00 2001
> From: Mark Rutland <mark.rutland@arm.com>
> Date: Mon, 7 Nov 2016 15:24:40 +0000
> Subject: [PATCH] Fix KASAN splats with DEBUG_WX
>
> Booting a kernel built with both CONFIG_KASAN and CONFIG_DEBUG_WX
> results in a stream of KASAN splats for stack-out-of-bounds accesses,
> e.g.
>
> ==================================================================
> BUG: KASAN: stack-out-of-bounds in note_page+0xd8/0x650 at addr ffff8009364ebdd0
> Read of size 8 by task swapper/0/1
> page:ffff7e0024d93ac0 count:0 mapcount:0 mapping:          (null) index:0x0
> flags: 0x4000000000000000()
> page dumped because: kasan: bad access detected
> CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.9.0-rc3-00004-g25f7267 #77
> Hardware name: ARM Juno development board (r1) (DT)
> Call trace:
> [<ffff20000808b2d8>] dump_backtrace+0x0/0x278
> [<ffff20000808b564>] show_stack+0x14/0x20
> [<ffff2000084e4e4c>] dump_stack+0xa4/0xc8
> [<ffff200008256ee0>] kasan_report_error+0x4a8/0x4d0
> [<ffff200008257330>] kasan_report+0x40/0x48
> [<ffff200008255894>] __asan_load8+0x84/0x98
> [<ffff2000080a0928>] note_page+0xd8/0x650
> [<ffff2000080a0fb4>] walk_pgd.isra.1+0x114/0x220
> [<ffff2000080a1248>] ptdump_check_wx+0xa8/0x118
> [<ffff20000809ed40>] mark_rodata_ro+0x90/0xd0
> [<ffff200008cafb88>] kernel_init+0x28/0x110
> [<ffff200008083680>] ret_from_fork+0x10/0x50
> Memory state around the buggy address:
>  ffff8009364ebc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>  ffff8009364ebd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> ffff8009364ebd80: 00 00 00 00 f1 f1 f1 f1 00 00 f4 f4 f2 f2 f2 f2
>                                                  ^
>  ffff8009364ebe00: 00 00 00 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00
>  ffff8009364ebe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> ==================================================================
>
> ... this happens because note_page assumes that the marker array has at
> least two elements (the latter of which may be the terminator), but the
> marker array for ptdump_check_wx only contains one element. Thus we
> dereference some garbage on the stack when looking at
> marker[1].start_address.
>
> Given we don't need the markers for the WX checks, we could modify
> note_page to allow for a NULL marker array, but for now it's simpler to
> add an entry to the ptdump_check_wx marker array, so let's do that. As
> it's somewhat confusing to have two identical entries, we add an initial
> entry with a start address of zero.
>
> Reported-by: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> ---
>  arch/arm64/mm/dump.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c
> index ef8aca8..ca74a2a 100644
> --- a/arch/arm64/mm/dump.c
> +++ b/arch/arm64/mm/dump.c
> @@ -383,6 +383,7 @@ void ptdump_check_wx(void)
>  	struct pg_state st = {
>  		.seq = NULL,
>  		.marker = (struct addr_marker[]) {
> +			{ 0, NULL},
>  			{ -1, NULL},
>  		},
>  		.check_wx = true,
>

Acked-by: Laura Abbott <labbott@redhat.com>

^ permalink raw reply

* [PATCH] ARM: cache-uniphier: include <linux/errno.h> instead of <linux/types.h>
From: Russell King - ARM Linux @ 2016-11-07 16:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478534334-15562-1-git-send-email-yamada.masahiro@socionext.com>

On Tue, Nov 08, 2016 at 12:58:54AM +0900, Masahiro Yamada wrote:
> Nothing in this header file depends on <linux/types.h>.
> Rather, <linux/errno.h> should be included for -ENODEV.

So how do we end up with a definition for u32?

I think you need both these include files.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply

* [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
From: Sylwester Nawrocki @ 2016-11-07 16:02 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201611050029.18984.arnd@arndb.de>

On 11/05/2016 12:29 AM, Arnd Bergmann wrote:
> On Friday 04 November 2016, Sylwester Nawrocki wrote:
>> > -       ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
>> > +       ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
>> >                                                  NULL, NULL);
>
> If we remove the filter argument from every caller here, maybe we should also
> change the prototype to not expect those three NULL arguments any more.

There is one occurrence where the third argument needs to be not NULL.
I'm planning to modify sound/sound/samsung/i2s.c so there is no need
to create another platform device just for the overlay DAI, afterwards
the above function could be simplified.

-- 
Thanks,
Sylwester

^ permalink raw reply

* [PATCH] ARM: cache-uniphier: include <linux/errno.h> instead of <linux/types.h>
From: Masahiro Yamada @ 2016-11-07 15:58 UTC (permalink / raw)
  To: linux-arm-kernel

Nothing in this header file depends on <linux/types.h>.
Rather, <linux/errno.h> should be included for -ENODEV.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

KernelVersion: 4.9-rc1


 arch/arm/include/asm/hardware/cache-uniphier.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/hardware/cache-uniphier.h b/arch/arm/include/asm/hardware/cache-uniphier.h
index eaa60da..0ef42ae 100644
--- a/arch/arm/include/asm/hardware/cache-uniphier.h
+++ b/arch/arm/include/asm/hardware/cache-uniphier.h
@@ -16,7 +16,7 @@
 #ifndef __CACHE_UNIPHIER_H
 #define __CACHE_UNIPHIER_H
 
-#include <linux/types.h>
+#include <linux/errno.h>
 
 #ifdef CONFIG_CACHE_UNIPHIER
 int uniphier_cache_init(void);
-- 
1.9.1

^ permalink raw reply related

* [PATCH v2 1/2] regulator: Add coupled regulator
From: Maxime Ripard @ 2016-11-07 15:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160205153258.GW4455@sirena.org.uk>

Hi Mark,

On Fri, Feb 05, 2016 at 03:32:58PM +0000, Mark Brown wrote:
> On Fri, Feb 05, 2016 at 03:33:28PM +0100, Maxime Ripard wrote:
> > On Thu, Jan 21, 2016 at 04:28:02PM +0000, Mark Brown wrote:
> > > On Thu, Jan 21, 2016 at 04:46:49PM +0100, Maxime Ripard wrote:
> 
> > > > Anyway, I'm fine with both approaches, just let me know what you
> > > > prefer.
> 
> > > Without seeing an implementation of the lists it's hard to say.
> 
> > Just to make sure we're on the same page: you want to keep the
> > regulator, but instead of giving the parent through vinX-supplies
> > properties, you want to have a single *-supply property, with a list
> > of regulators, right?
> 
> Either that or an explicit regulator describing the merge.  Rob wants
> the list I think but I really don't care.

So, I'm reviving this old thread after speaking to you about it at
ELCE and trying to code something up, and getting lost..

To put a bit of context, I'm still trying to tackle the issue of
devices that have two regulators powering them on the same pin for
example when each regulator cannot provide enough current alone to
power the device (all the setups like this one I've seen so far were
for WiFi chips, but it might be different).

I guess we already agreed on the fact that the DT binding should just
be to allow a *-supply property to take multiple regulators, and mark
them as "coupled" (or whatever name we see fit) in such a case.

Since regulator_get returns a struct regulator pointer, it felt
logical to try to add the list of parent regulators to it, especially
as this structure is per-consumer, and different consumers might have
different combinations of regulators.

However, this structure embeds a pointer to a struct regulator_dev,
which seems to model the regulator itself, but will also contain
pointer to the struct regulator, probably to model its parent? I guess
my first question would be do we care about nesting? or having a
regulator with multiple parents?

It also contains the constraints on each regulator, which might or
might not be different for each of the coupled regulators, but I'm
guessing the couple might have contraints of its own too I guess. Is
it something that might happen? Should we care about it?

And finally, my real question is, do we want to aggregate them in
struct regulator, at the consumer level, which might make the more
sense, or do we want to create an intermediate regulator internally?
What is your take on this?

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161107/133eabc8/attachment.sig>

^ permalink raw reply

* [PATCH] iommu/arm-smmu: Fix out-of-bounds dereference
From: Mark Rutland @ 2016-11-07 15:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <dea89ff1b2bd97b08d72f5c32fcf228bec767142.1478533142.git.robin.murphy@arm.com>

On Mon, Nov 07, 2016 at 03:39:02PM +0000, Robin Murphy wrote:
> When we iterate a master's config entries, what we generally care
> about is the entry's stream map index, rather than the entry index
> itself, so it's nice to have the iterator automatically assign the
> former from the latter. Unfortunately, booting with KASAN reveals
> the oversight that using a simple comma operator results in the
> entry index being dereferenced before being checked for validity,
> so we always access one element past the end of the fwspec array.
> 
> Flip things around so that the check always happens before the index
> may be dereferenced.
> 
> Fixes: adfec2e709d2 ("iommu/arm-smmu: Convert to iommu_fwspec")
> Reported-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

This patch fixes the KASAN splats as I saw (example below).

With this patch applied, my dmesg is free of errors.

So feel free to add:

Tested-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

==================================================================
BUG: KASAN: slab-out-of-bounds in arm_smmu_add_device+0x510/0x960 at addr ffff800935c6e72c
Read of size 2 by task swapper/0/1
CPU: 4 PID: 1 Comm: swapper/0 Not tainted 4.9.0-rc3-00005-g8cc374c #79
Hardware name: ARM Juno development board (r1) (DT)
Call trace:
[<ffff20000808b2d8>] dump_backtrace+0x0/0x278
[<ffff20000808b564>] show_stack+0x14/0x20
[<ffff2000084e4e4c>] dump_stack+0xa4/0xc8
[<ffff200008256984>] kasan_object_err+0x24/0x80
[<ffff200008256c40>] kasan_report_error+0x208/0x4d0
[<ffff200008257330>] kasan_report+0x40/0x48
[<ffff200008255624>] __asan_load2+0x84/0x98
[<ffff200008743e80>] arm_smmu_add_device+0x510/0x960
[<ffff20000873acf8>] iommu_bus_notifier+0x120/0x160
[<ffff2000081038e4>] notifier_call_chain+0x6c/0xb8
[<ffff200008103dfc>] __blocking_notifier_call_chain+0x5c/0xa0
[<ffff200008103e54>] blocking_notifier_call_chain+0x14/0x20
[<ffff20000874ef98>] device_add+0x5c8/0x840
[<ffff20000863d574>] amba_device_try_add+0x1cc/0x298
[<ffff20000863d7a8>] amba_device_add+0x20/0x148
[<ffff200008ad4344>] of_platform_bus_create+0x34c/0x428
[<ffff200008ad4554>] of_platform_populate+0x4c/0xb8
[<ffff200009389c9c>] of_platform_default_populate_init+0x78/0x8c
[<ffff200008083a28>] do_one_initcall+0x90/0x1c8
[<ffff200009331038>] kernel_init_freeable+0x280/0x324
[<ffff200008cb5d00>] kernel_init+0x10/0x110
[<ffff200008083680>] ret_from_fork+0x10/0x50
Object at ffff800935c6e700, in cache kmalloc-128 size: 128
Allocated:
PID = 1
 [<ffff20000808ac90>] save_stack_trace_tsk+0x0/0x180
 [<ffff20000808ae38>] save_stack_trace+0x28/0x38
 [<ffff200008255ebc>] kasan_kmalloc+0xdc/0x188
 [<ffff200008252780>] __kmalloc+0x148/0x238
 [<ffff200008743b38>] arm_smmu_add_device+0x1c8/0x960
 [<ffff20000873acf8>] iommu_bus_notifier+0x120/0x160
 [<ffff2000081038e4>] notifier_call_chain+0x6c/0xb8
 [<ffff200008103dfc>] __blocking_notifier_call_chain+0x5c/0xa0
 [<ffff200008103e54>] blocking_notifier_call_chain+0x14/0x20
 [<ffff20000874ef98>] device_add+0x5c8/0x840
 [<ffff20000863d574>] amba_device_try_add+0x1cc/0x298
 [<ffff20000863d7a8>] amba_device_add+0x20/0x148
 [<ffff200008ad4344>] of_platform_bus_create+0x34c/0x428
 [<ffff200008ad4554>] of_platform_populate+0x4c/0xb8
 [<ffff200009389c9c>] of_platform_default_populate_init+0x78/0x8c
 [<ffff200008083a28>] do_one_initcall+0x90/0x1c8
 [<ffff200009331038>] kernel_init_freeable+0x280/0x324
 [<ffff200008cb5d00>] kernel_init+0x10/0x110
 [<ffff200008083680>] ret_from_fork+0x10/0x50
Freed:
PID = 0
(stack is not available)
Memory state around the buggy address:
 ffff800935c6e600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff800935c6e680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff800935c6e700: 00 00 00 00 00 04 fc fc fc fc fc fc fc fc fc fc
                                  ^
 ffff800935c6e780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff800935c6e800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

^ permalink raw reply

* [PATCH 0/5] drm/sun4i: Handle TV overscan
From: Russell King - ARM Linux @ 2016-11-07 15:46 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161107150909.rcte56amjkmd6mhx@lukather>

On Mon, Nov 07, 2016 at 04:09:09PM +0100, Maxime Ripard wrote:
> Hi Russell,
> 
> On Thu, Nov 03, 2016 at 09:54:45AM +0000, Russell King - ARM Linux wrote:
> > > Yes. And that is an XBMC only solution, that doesn't work with the
> > > fbdev emulation and is probably doing an additional composition to
> > > scale down and center their frames through OpenGL.
> > 
> > Well, it will have to be doing a scaling step anyway.  If the video
> > frame is a different size to the active area, scaling is required
> > no matter what.  A 576p SD image needs to be scaled up, and a 1080p
> > image would need to be scaled down for a 1080p overscanned display
> > with a reduced active area to counter the overscanning - no matter
> > how you do it.
> 
> Yes, except that scaling is not always an option. In my particular
> example, there's no scaler after the CRTC, which essentially prevents
> it from being used in that use case. Which is also why I ended up
> reducing the mode reported to the user.

I think you completely missed my point.  Let me try again.

If you expose a reduced mode to the user, you are reporting that (eg)
the 1080p-timings mode does not have 1920 pixels horizontally, and
1080 lines.  You are instead reporting that it has (eg) 1800 pixels
horizontally and maybe 1000 lines.

So, when you play back a 1080 video, you are going to have to either:

1. crop the extra 120 pixels horizontally and 80 lines vertically
or
2. scale the image.

However, this is a completely independent issue to how we go about
setting a video mode that is 1800x1000 in the first place.

What you're suggesting is that we add code to the kernel to report that
your non-EDID, analogue output transforms the standard 1920x1080 timings
such that it has a 1800x1000 active area.

I'm suggesting instead that you can do the same thing in userspace by
specifically adding a mode which has the 1920x1080 standard timings,
but with the porches increased and the active area reduced - in exactly
the same way that you'd have to do within the kernel to report your
active-area-reduced 1800x1000 mode.

> > For graphics, userspace could add mode(s) with increased porches and
> > reduced active area itself to achieve an underscanned display on a
> > timing which the display device always overscans - there's no need to
> > do that in the kernel, all the APIs are there to be able to do it
> > already.
> > 
> > That means your framebuffer will be smaller, but that's the case
> > anyway.
> 
> Yes, that would be a good idea. But it's not always an option for
> applications that would rely on the fbdev emulation (like QT's eglfs),
> which would then have no way to change whatever default there is (and
> the only one able to know how bad it actually is is the user).

I guess this is the problem with DRM people wanting to deprecate fbdev...
too much stuff currently relies upon it, but DRM on x86 has always had
the reduced functionality.

I guess there's two solutions here:

1. Either DRMs fbdev gains increased functionality, or
2. The fbdev-only applications/libraries need to be ported over to
   support DRM natively.

This has been a bar for some time to moving over to DRM, and I've heard
very little desire on either side to find some sort of compromise on the
issue, so I guess things are rather stuck where they are.

> > So, I may want my graphics to appear on an overscanned display such
> > that I can see the borders, but I may want the overlaid video to use
> > the full active area (including overscan) to hide some of the broadcast
> > mess at the edges of the screen.
> > 
> > > > Yea, that's quite sad, "analog" has become a dirty word, but really
> > > > this has nothing to do with "analog" at all - there are LCD TVs (and
> > > > some monitors) out there which take HDMI signals but refuse to
> > > > disable overscan no matter what you do to them if you provide them
> > > > with a "broadcast"  mode - so the analog excuse is very poor.
> > > 
> > > I'd agree with you, but I was also told to not turn that into a
> > > generic code and deal with that in my driver.
> > 
> > I guess whoever told you that was wrong.  I used to have a cheap TV
> > here which took HDMI, and always overscans broadcast modes, and
> > underscans PC modes.  No amount of fiddling with various settings
> > (either in the TV or AVI frames) changes that.
> > 
> > I've run into that with a _monitor_ that Andrew Hutton has, which has
> > a HDMI input - exactly the same thing - 1080p, 720p etc are all
> > unconditionally overscanned, 1024x768 etc are all unconditionally
> > underscanned and there's nothing that can be done to change it.
> > 
> > The problem is that TVs are at liberty to have this behaviour, so
> > the overscaned problem is always going to be there, and each driver
> > should not be dealing with it in their own specific ways.
> 
> I agree with you, however, without any directions on how to do this,
> and willingness to merge this, I don't really see why we would work on
> such a generic implementation in the first place.

As I've already said - if you've been told that a generic implementation
is wrong, then I suspect that either those who told you that either
failed to understand the problem, or they failed to appreciate just what
a problem it is.

I guess if DRM folk want to keep throwing up blocks in the way to moving
forward, then we'll end up with lots of hacks in various random trees to
work around the various issues, and everything will end up in a total
mess.

This is _not_ a driver specific problem, it _is_ a _generic_ problem.

I guess DRM folk have nice expensive display devices which don't exhibit
the problem, so they just don't give a damn - which basically means
they're out of touch with the rest of the world.  This isn't a problem
that's going to go away just because DRM folk want it to, and it's not
limited to "obsolete analogue" either.

I'd go as far as to say that DRM people are totally wrong to tell you
that a solution to this should not be generic, period.  I think I've
made that point several times through the course of this discussion
already.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply

* [PATCH] coresight: Add support for ARM Coresight STM-500
From: Mathieu Poirier @ 2016-11-07 15:43 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478103591-7662-1-git-send-email-suzuki.poulose@arm.com>

On 2 November 2016 at 10:19, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
> Add the PIDs for STM-500 to the known STM devices list.
>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  drivers/hwtracing/coresight/coresight-stm.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c
> index 49e0f1b..3524452 100644
> --- a/drivers/hwtracing/coresight/coresight-stm.c
> +++ b/drivers/hwtracing/coresight/coresight-stm.c
> @@ -920,6 +920,11 @@ static struct amba_id stm_ids[] = {
>                 .mask   = 0x0003ffff,
>                 .data   = "STM32",
>         },
> +       {
> +               .id     = 0x0003b963,
> +               .mask   = 0x0003ffff,
> +               .data   = "STM500",
> +       },
>         { 0, 0},
>  };

Applied - thanks,
Mathieu

>
> --
> 2.7.4
>

^ permalink raw reply

* [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
From: Sylwester Nawrocki @ 2016-11-07 15:41 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201611050026.49560.arnd@arndb.de>

On 11/05/2016 12:26 AM, Arnd Bergmann wrote:
> On Friday 04 November 2016, Sylwester Nawrocki wrote:
>> +       } else {
>> +               pl08x->slave.filter.map = pl08x->pd->slave_map;
>> +               pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
>>         }
> 
> I think you miss the setup of the filter function here.

Oops, indeed, there was little chance it could work without that part.

> Filtering by string in this driver is a bit awkward, so I wonder if we
> might want to go one step further here and pass the actual data (i.e. 
> struct pl08x_channel_data) rather than the string here.

Yeah, it didn't look to me terribly elegant too. Then a change as below?

--------------8<-------------------
diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
index 8c88680..556ce74 100644
--- a/arch/arm/mach-s3c64xx/pl080.c
+++ b/arch/arm/mach-s3c64xx/pl080.c
@@ -118,22 +118,22 @@ static void pl08x_put_xfer_signal(const struct
pl08x_channel_data *cd, int ch)
 };

 static const struct dma_slave_map s3c64xx_dma0_slave_map[] = {
-       { "s3c6400-uart.0", "tx", (void *)"uart0_tx" },
-       { "s3c6400-uart.0", "rx", (void *)"uart0_rx" },
-       { "s3c6400-uart.1", "tx", (void *)"uart1_tx" },
-       { "s3c6400-uart.1", "rx", (void *)"uart1_rx" },
-       { "s3c6400-uart.2", "tx", (void *)"uart2_tx" },
-       { "s3c6400-uart.2", "rx", (void *)"uart2_rx" },
-       { "s3c6400-uart.3", "tx", (void *)"uart3_tx" },
-       { "s3c6400-uart.3", "rx", (void *)"uart3_rx" },
-       { "samsung-pcm.0", "tx", (void *)"pcm0_tx" },
-       { "samsung-pcm.0", "rx", (void *)"pcm0_rx" },
-       { "samsung-i2s.0", "tx", (void *)"i2s0_tx" },
-       { "samsung-i2s.0", "rx", (void *)"i2s0_rx" },
-       { "s3c6410-spi.0", "tx", (void *)"spi0_tx" },
-       { "s3c6410-spi.0", "rx", (void *)"spi0_rx" },
-       { "samsung-i2s.2", "tx", (void *)"i2s2_tx" },
-       { "samsung-i2s.2", "rx", (void *)"i2s2_rx" },
+       { "s3c6400-uart.0", "tx", (void *)&s3c64xx_dma0_info[0] },
+       { "s3c6400-uart.0", "rx", (void *)&s3c64xx_dma0_info[1] },
+       { "s3c6400-uart.1", "tx", (void *)&s3c64xx_dma0_info[2] },
+       { "s3c6400-uart.1", "rx", (void *)&s3c64xx_dma0_info[3] },
+       { "s3c6400-uart.2", "tx", (void *)&s3c64xx_dma0_info[4] },
+       { "s3c6400-uart.2", "rx", (void *)&s3c64xx_dma0_info[5] },
+       { "s3c6400-uart.3", "tx", (void *)&s3c64xx_dma0_info[6] },
+       { "s3c6400-uart.3", "rx", (void *)&s3c64xx_dma0_info[7] },
+       { "samsung-pcm.0", "tx", (void *)&s3c64xx_dma0_info[8] },
+       { "samsung-pcm.0", "rx", (void *)&s3c64xx_dma0_info[9] },
+       { "samsung-i2s.0", "tx", (void *)&s3c64xx_dma0_info[10] },
+       { "samsung-i2s.0", "rx", (void *)&s3c64xx_dma0_info[11] },
+       { "s3c6410-spi.0", "tx", (void *)&s3c64xx_dma0_info[12] },
+       { "s3c6410-spi.0", "rx", (void *)&s3c64xx_dma0_info[13] },
+       { "samsung-i2s.2", "tx", (void *)&s3c64xx_dma0_info[14] },
+       { "samsung-i2s.2", "rx", (void *)&s3c64xx_dma0_info[15] },
 };

@@ -229,12 +229,12 @@ static AMBA_AHB_DEVICE(s3c64xx_dma0, "dma-pl080s.0", 0,
 };

 static const struct dma_slave_map s3c64xx_dma1_slave_map[] = {
-       { "samsung-pcm.1", "tx", (void *)"pcm1_tx" },
-       { "samsung-pcm.1", "rx", (void *)"pcm1_rx" },
-       { "samsung-i2s.1", "tx", (void *)"i2s1_tx" },
-       { "samsung-i2s.1", "rx", (void *)"i2s1_rx" },
-       { "s3c6410-spi.1", "tx", (void *)"spi1_tx" },
-       { "s3c6410-spi.1", "rx", (void *)"spi1_rx" },
+       { "samsung-pcm.1", "tx", (void *)&s3c64xx_dma1_info[0] },
+       { "samsung-pcm.1", "rx", (void *)&s3c64xx_dma1_info[1] },
+       { "samsung-i2s.1", "tx", (void *)&s3c64xx_dma1_info[2] },
+       { "samsung-i2s.1", "rx", (void *)&s3c64xx_dma1_info[3] },
+       { "s3c6410-spi.1", "tx", (void *)&s3c64xx_dma1_info[4] },
+       { "s3c6410-spi.1", "rx", (void *)&s3c64xx_dma1_info[5] },
 };

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index d5c75c8..0d1eb2e 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -1793,6 +1793,23 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
 }
 EXPORT_SYMBOL_GPL(pl08x_filter_id);

+static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id)
+{
+       struct pl08x_dma_chan *plchan;
+
+       /* Reject channels for devices not bound to this driver */
+       if (chan->device->dev->driver != &pl08x_amba_driver.drv)
+               return false;
+
+       plchan = to_pl08x_chan(chan);
+
+       /* Check that the channel is not taken! */
+       if (plchan->cd == chan_id)
+               return true;
+
+       return false;
+}
+
 /*
  * Just check that the device is there and active
  * TODO: turn this bit on/off depending on the number of physical channels
@@ -2310,6 +2327,7 @@ static int pl08x_probe(struct amba_device *adev, const
struct amba_id *id)
        } else {
                pl08x->slave.filter.map = pl08x->pd->slave_map;
                pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
+               pl08x->slave.filter.fn = pl08x_filter_fn;
        }

        /* By default, AHB1 only.  If dualmaster, from platform */

-------------->8-------------------

-- 
Thanks,
Sylwester

^ permalink raw reply related

* [PATCH] staging: vc04_services: add vchiq_pagelist_info structure
From: Michael Zoran @ 2016-11-07 15:41 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161107100331.GA19666@kroah.com>

On Mon, 2016-11-07 at 11:03 +0100, Greg KH wrote:
> On Mon, Oct 31, 2016 at 01:10:35AM -0700, Michael Zoran wrote:
> > The current dma_map_sg based implementation for bulk messages
> > computes many offsets into a single allocation multiple times in
> > both the create and free code paths.??This is inefficient,
> > error prone and in fact still has a few lingering issues
> > with arm64.
> > 
> > This change replaces a small portion of that inplementation with
> > new code that uses a new struct vchiq_pagelist_info to store the
> > needed information rather then complex offset calculations.
> > 
> > This improved implementation should be more efficient and easier
> > to understand and maintain.
> > 
> > Tests Run(Both Pass):
> > vchiq_test -p 1
> > vchiq_test -f 10
> > 
> > Signed-off-by: Michael Zoran <mzoran@crowfest.net>
> > ---
> > ?.../interface/vchiq_arm/vchiq_2835_arm.c???????????| 223
> > +++++++++++----------
> > ?1 file changed, 113 insertions(+), 110 deletions(-)
> 
> This doesn't apply to the tree anymore because of your previous patch
> :(
> 
> Can you refresh it and resend?
> 
> thanks,
> 
> greg k-h

OK, I resubmitted it.

Once this patch gets applied 64-bit should be in decent shape.  I'm not
seeing any warnings or errors anymore and functional tests from a 64-
bit OS look good.

The only remaining issue that I know of is that it needs a 32-bit
compatibility layer for the ioctls when running a 32-bit OS(Raspbian)
on top of a 64-bit kernel.

^ permalink raw reply

* [PATCH] iommu/arm-smmu: Fix out-of-bounds dereference
From: Robin Murphy @ 2016-11-07 15:39 UTC (permalink / raw)
  To: linux-arm-kernel

When we iterate a master's config entries, what we generally care
about is the entry's stream map index, rather than the entry index
itself, so it's nice to have the iterator automatically assign the
former from the latter. Unfortunately, booting with KASAN reveals
the oversight that using a simple comma operator results in the
entry index being dereferenced before being checked for validity,
so we always access one element past the end of the fwspec array.

Flip things around so that the check always happens before the index
may be dereferenced.

Fixes: adfec2e709d2 ("iommu/arm-smmu: Convert to iommu_fwspec")
Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/iommu/arm-smmu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index f86683eec446..44ffe3a391d6 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -324,8 +324,10 @@ struct arm_smmu_master_cfg {
 #define INVALID_SMENDX			-1
 #define __fwspec_cfg(fw) ((struct arm_smmu_master_cfg *)fw->iommu_priv)
 #define fwspec_smmu(fw)  (__fwspec_cfg(fw)->smmu)
-#define for_each_cfg_sme(fw, i, idx) \
-	for (i = 0; idx = __fwspec_cfg(fw)->smendx[i], i < fw->num_ids; ++i)
+#define for_each_cfg_sme(fw, i, idx)					\
+	for (i = 0;							\
+	     i < fw->num_ids && (idx = __fwspec_cfg(fw)->smendx[i], true); \
+	     ++i)
 
 struct arm_smmu_device {
 	struct device			*dev;
-- 
2.10.2.dirty

^ permalink raw reply related

* [PATCHv4 0/4] WX checking for arm64
From: Mark Rutland @ 2016-11-07 15:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161030150307.33vc2m7y5y6wzbqc@localhost>

On Sun, Oct 30, 2016 at 03:03:07PM +0000, Catalin Marinas wrote:
> On Thu, Oct 27, 2016 at 09:27:30AM -0700, Laura Abbott wrote:
> > Laura Abbott (4):
> >   arm64: dump: Make ptdump debugfs a separate option
> >   arm64: dump: Make the page table dumping seq_file optional
> >   arm64: dump: Remove max_addr
> >   arm64: dump: Add checking for writable and exectuable pages
> 
> Queued for 4.10. Thanks.

Catalin mentioned to me that he saw some KASAN splats when testing; it
looks like need a fixup something like the below.

Apologies for not having spotted this when testing!

Thanks,
Mark.

---->8----
>From 06fef1ad1138d0808eec770e64458a350941bd2d Mon Sep 17 00:00:00 2001
From: Mark Rutland <mark.rutland@arm.com>
Date: Mon, 7 Nov 2016 15:24:40 +0000
Subject: [PATCH] Fix KASAN splats with DEBUG_WX

Booting a kernel built with both CONFIG_KASAN and CONFIG_DEBUG_WX
results in a stream of KASAN splats for stack-out-of-bounds accesses,
e.g.

==================================================================
BUG: KASAN: stack-out-of-bounds in note_page+0xd8/0x650 at addr ffff8009364ebdd0
Read of size 8 by task swapper/0/1
page:ffff7e0024d93ac0 count:0 mapcount:0 mapping:          (null) index:0x0
flags: 0x4000000000000000()
page dumped because: kasan: bad access detected
CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.9.0-rc3-00004-g25f7267 #77
Hardware name: ARM Juno development board (r1) (DT)
Call trace:
[<ffff20000808b2d8>] dump_backtrace+0x0/0x278
[<ffff20000808b564>] show_stack+0x14/0x20
[<ffff2000084e4e4c>] dump_stack+0xa4/0xc8
[<ffff200008256ee0>] kasan_report_error+0x4a8/0x4d0
[<ffff200008257330>] kasan_report+0x40/0x48
[<ffff200008255894>] __asan_load8+0x84/0x98
[<ffff2000080a0928>] note_page+0xd8/0x650
[<ffff2000080a0fb4>] walk_pgd.isra.1+0x114/0x220
[<ffff2000080a1248>] ptdump_check_wx+0xa8/0x118
[<ffff20000809ed40>] mark_rodata_ro+0x90/0xd0
[<ffff200008cafb88>] kernel_init+0x28/0x110
[<ffff200008083680>] ret_from_fork+0x10/0x50
Memory state around the buggy address:
 ffff8009364ebc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8009364ebd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8009364ebd80: 00 00 00 00 f1 f1 f1 f1 00 00 f4 f4 f2 f2 f2 f2
                                                 ^
 ffff8009364ebe00: 00 00 00 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00
 ffff8009364ebe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

... this happens because note_page assumes that the marker array has at
least two elements (the latter of which may be the terminator), but the
marker array for ptdump_check_wx only contains one element. Thus we
dereference some garbage on the stack when looking at
marker[1].start_address.

Given we don't need the markers for the WX checks, we could modify
note_page to allow for a NULL marker array, but for now it's simpler to
add an entry to the ptdump_check_wx marker array, so let's do that. As
it's somewhat confusing to have two identical entries, we add an initial
entry with a start address of zero.

Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
---
 arch/arm64/mm/dump.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c
index ef8aca8..ca74a2a 100644
--- a/arch/arm64/mm/dump.c
+++ b/arch/arm64/mm/dump.c
@@ -383,6 +383,7 @@ void ptdump_check_wx(void)
 	struct pg_state st = {
 		.seq = NULL,
 		.marker = (struct addr_marker[]) {
+			{ 0, NULL},
 			{ -1, NULL},
 		},
 		.check_wx = true,
-- 
1.9.1

^ permalink raw reply related

* [PATCH 2/2] mm: hugetlb: support gigantic surplus pages
From: Gerald Schaefer @ 2016-11-07 15:25 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478141499-13825-3-git-send-email-shijie.huang@arm.com>

On Thu, 3 Nov 2016 10:51:38 +0800
Huang Shijie <shijie.huang@arm.com> wrote:

> When testing the gigantic page whose order is too large for the buddy
> allocator, the libhugetlbfs test case "counter.sh" will fail.
> 
> The failure is caused by:
>  1) kernel fails to allocate a gigantic page for the surplus case.
>     And the gather_surplus_pages() will return NULL in the end.
> 
>  2) The condition checks for "over-commit" is wrong.
> 
> This patch adds code to allocate the gigantic page in the
> __alloc_huge_page(). After this patch, gather_surplus_pages()
> can return a gigantic page for the surplus case.
> 
> This patch also changes the condition checks for:
>      return_unused_surplus_pages()
>      nr_overcommit_hugepages_store()
> 
> After this patch, the counter.sh can pass for the gigantic page.
> 
> Acked-by: Steve Capper <steve.capper@arm.com>
> Signed-off-by: Huang Shijie <shijie.huang@arm.com>
> ---
>  mm/hugetlb.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 0bf4444..2b67aff 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1574,7 +1574,7 @@ static struct page *__alloc_huge_page(struct hstate *h,
>  	struct page *page;
>  	unsigned int r_nid;
> 
> -	if (hstate_is_gigantic(h))
> +	if (hstate_is_gigantic(h) && !gigantic_page_supported())
>  		return NULL;

Is it really possible to stumble over gigantic pages w/o having
gigantic_page_supported()?

Also, I've just tried this on s390 and counter.sh still fails after these
patches, and it should fail on all archs as long as you use the gigantic
hugepage size as default hugepage size. This is because you only changed
nr_overcommit_hugepages_store(), which handles nr_overcommit_hugepages
in sysfs, and missed hugetlb_overcommit_handler() which handles
/proc/sys/vm/nr_overcommit_hugepages for the default sized hugepages.

However, changing hugetlb_overcommit_handler() in a similar way
produces a lockdep warning, see below, and counters.sh now results in
FAIL	mmap failed: Cannot allocate memory
So I guess this needs more thinking (or just a proper annotation, as
suggested, didn't really look into it):

[  129.595054] INFO: trying to register non-static key.
[  129.595060] the code is fine but needs lockdep annotation.
[  129.595062] turning off the locking correctness validator.
[  129.595066] CPU: 4 PID: 1108 Comm: counters Not tainted 4.9.0-rc3-00261-g577f12c-dirty #12
[  129.595067] Hardware name: IBM              2964 N96              704              (LPAR)
[  129.595069] Stack:
[  129.595070]        00000003b4833688 00000003b4833718 0000000000000003 0000000000000000
[  129.595075]        00000003b48337b8 00000003b4833730 00000003b4833730 0000000000000020
[  129.595078]        0000000000000000 0000000000000020 000000000000000a 000000000000000a
[  129.595082]        000000000000000c 00000003b4833780 0000000000000000 00000003b4830000
[  129.595086]        0000000000000000 0000000000112d90 00000003b4833718 00000003b4833770
[  129.595089] Call Trace:
[  129.595095] ([<0000000000112c6a>] show_trace+0x8a/0xe0)
[  129.595098]  [<0000000000112d40>] show_stack+0x80/0xd8 
[  129.595103]  [<0000000000744eec>] dump_stack+0x9c/0xe0 
[  129.595106]  [<00000000001b0760>] register_lock_class+0x1a8/0x530 
[  129.595109]  [<00000000001b59fa>] __lock_acquire+0x10a/0x7f0 
[  129.595110]  [<00000000001b69b8>] lock_acquire+0x2e0/0x330 
[  129.595115]  [<0000000000a44920>] _raw_spin_lock_irqsave+0x70/0xb8 
[  129.595118]  [<000000000031cdce>] alloc_gigantic_page+0x8e/0x2c8 
[  129.595120]  [<000000000031e95a>] __alloc_huge_page+0xea/0x4d8 
[  129.595122]  [<000000000031f4c6>] hugetlb_acct_memory+0xa6/0x418 
[  129.595125]  [<0000000000323b32>] hugetlb_reserve_pages+0x132/0x240 
[  129.595152]  [<000000000048be62>] hugetlbfs_file_mmap+0xd2/0x130 
[  129.595155]  [<0000000000303918>] mmap_region+0x368/0x6e0 
[  129.595157]  [<0000000000303fb8>] do_mmap+0x328/0x400 
[  129.595160]  [<00000000002dc1aa>] vm_mmap_pgoff+0x9a/0xe8 
[  129.595162]  [<00000000003016dc>] SyS_mmap_pgoff+0x23c/0x288 
[  129.595164]  [<00000000003017b6>] SyS_old_mmap+0x8e/0xb0 
[  129.595166]  [<0000000000a45b06>] system_call+0xd6/0x270 
[  129.595167] INFO: lockdep is turned off.

^ permalink raw reply

* [PATCH v2] ARM: dts: imx6: Add support for Logic PD SOM and Baseboard
From: aford173 at gmail.com @ 2016-11-07 15:22 UTC (permalink / raw)
  To: linux-arm-kernel

From: Adam Ford <aford173@gmail.com>

The system on module (SOM) specific portions are in the .dtsi
while the baseboard specific portions are in the .dts file.

V2: Fix small bug and update style for 4.9 Kernel

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/boot/dts/imx6q-logicpd.dts b/arch/arm/boot/dts/imx6q-logicpd.dts
new file mode 100644
index 0000000..ab42a33
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-logicpd.dts
@@ -0,0 +1,439 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ * Copyright 2016 Logic PD
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License
+ *     version 2 as published by the Free Software Foundation.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "imx6qdl-logicpd.dtsi"
+
+/ {
+	model = "Logic PD Acuity SOM";
+	compatible = "fsl,imx6q";
+
+	aliases {
+		display = &lcd_display;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		gen_led0 {
+			label = "cpu0";
+			gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "cpu0";
+		};
+
+		gen_led1 {
+			label = "cpu1";
+			gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "cpu1";
+		};
+
+		gen_led2 {
+			label = "heartbeat";
+			gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
+		};
+
+		gen_led3 {
+			label = "Always On";
+			gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "default-on";
+		};
+	};
+
+	reg_usb_otg_vbus: regulator-otg-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb_otg_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio4 15 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	reg_usb_h1_vbus: regulator-h1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb_h1_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+		regulator-always-on;
+		gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
+	};
+
+	reg_3v3: regulator-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "reg_3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	reg_pcie: regulator-pcie {
+		compatible = "regulator-fixed";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_pcie_reg>;
+		regulator-name = "MPCIE_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_gpio_keys>;
+
+		power {
+			label = "Power Button";
+			gpios = <&gpio3 28 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+			linux,code = <KEY_POWER>;
+		};
+
+		volume-up {
+			label = "Volume Up";
+			gpios = <&gpio3 29 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+			linux,code = <KEY_VOLUMEUP>;
+		};
+
+		volume-down {
+			label = "Volume Down";
+			gpios = <&gpio3 30 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+			linux,code = <KEY_VOLUMEDOWN>;
+		};
+
+		recovery-button {
+			label = "Recover";
+			gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+			linux,code = <0x198>;
+		};
+	};
+
+	backlight_lcd: backlight-lcd {
+		compatible = "pwm-backlight";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_backlight>;
+		enable-gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
+		pwms = <&pwm3 0 5000000>;
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
+	};
+
+
+	lcd_display: display at di0 {
+		compatible = "fsl,imx-parallel-display";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		interface-pix-fmt = "rgb565";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_lcd>;
+		status = "okay";
+
+		display-timings {
+			native-mode = <&type15_timing>;
+			type15_timing: type_15 {
+				clock-frequency = <9000000>;
+				hactive = <480>;
+				vactive = <272>;
+				hfront-porch = <3>;
+				hback-porch = <2>;
+				hsync-len = <42>;
+				vback-porch = <3>;
+				vfront-porch = <2>;
+				vsync-len = <11>;
+				hsync-active = <1>;
+				vsync-active = <1>;
+				de-active = <1>;
+				pixelclk-active = <0>;
+			};
+		};
+
+		port at 0 {
+			reg = <0>;
+			display_in: endpoint {
+				remote-endpoint = <&ipu1_di0_disp0>;
+			};
+		};
+
+		port at 1 {
+			reg = <1>;
+			display_out: endpoint {
+				remote-endpoint = <&panel_in>;
+			};
+		};
+	};
+
+	panel: panel {
+		compatible = "innolux,at043tn24", "simple-panel";
+		enable-gpios = <&gpio4 17 GPIO_ACTIVE_HIGH>;
+		backlight = <&backlight_lcd>;
+		port {
+			panel_in: endpoint {
+				remote-endpoint = <&display_out>;
+			};
+		};
+	};
+};
+
+&ipu1_di0_disp0 {
+	remote-endpoint = <&display_in>;
+};
+
+&pwm3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm3>;
+	status = "okay";
+};
+
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart3>;
+	status = "okay";
+};
+
+&usbh1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbh1>;
+	vbus-supply = <&reg_usb_h1_vbus>;
+	status = "okay";
+};
+
+&usbh2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbh2>;
+	phy_type = "hsic";
+	disable-over-current;
+	status = "okay";
+};
+
+&usbotg {
+	vbus-supply = <&reg_usb_otg_vbus>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbotg>;
+	disable-over-current;
+	status = "okay";
+};
+
+&fec {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_enet>;
+	phy-mode = "rmii";
+	status = "okay";
+};
+
+&usdhc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc2>;
+	cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
+	no-1-8-v;
+	keep-power-in-suspend;
+	status = "okay";
+};
+
+&i2c3 {
+	touchscreen: tsc2004 at 48 {
+		compatible = "ti,tsc2004";
+		vio-supply = <&reg_3v3>;
+		reg = <0x48>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_touchscreen>;
+		reset-gpios = <&gpio4 10 GPIO_ACTIVE_HIGH>;
+		interrupts-extended = <&gpio1 6 IRQ_TYPE_EDGE_RISING>;
+		touchscreen-fuzz-x = <4>;
+		touchscreen-fuzz-y = <7>;
+		touchscreen-fuzz-pressure = <2>;
+		touchscreen-size-x = <4096>;
+		touchscreen-size-y = <4096>;
+		touchscreen-max-pressure = <2048>;
+		ti,x-plate-ohms = <280>;
+		ti,esd-recovery-timeout-ms = <8000>;
+	};
+};
+
+&pcie {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pcie>;
+	reset-gpio = <&gpio1 9 0>;
+	status = "okay";
+};
+
+&iomuxc {
+	pinctrl_uart3: uart3grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D23__UART3_CTS_B	0x1b0b1
+			MX6QDL_PAD_EIM_D24__UART3_TX_DATA	0x1b0b1
+			MX6QDL_PAD_EIM_D25__UART3_RX_DATA	0x1b0b1
+			MX6QDL_PAD_EIM_EB3__UART3_RTS_B	0x1b0b1
+		>;
+	};
+
+	pinctrl_usbotg: usbotggrp {
+		fsl,pins = <
+			MX6QDL_PAD_GPIO_1__USB_OTG_ID	0x17059
+			MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x130b0
+			>;
+	};
+
+	pinctrl_usbh1: usbh1grp {
+		fsl,pins = <
+			MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x1b0b0
+		>;
+	};
+
+	pinctrl_usbh2: usbh2grp {
+		fsl,pins = <
+			MX6QDL_PAD_RGMII_TXC__USB_H2_DATA      0x13030
+			MX6QDL_PAD_RGMII_TX_CTL__USB_H2_STROBE 0x17030
+		>;
+	};
+
+	pinctrl_usdhc2: usdhc2grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD2_CMD__SD2_CMD	0x17059
+			MX6QDL_PAD_SD2_CLK__SD2_CLK	0x10059
+			MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
+			MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
+			MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
+			MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
+		>;
+	};
+
+	pinctrl_enet: enetgrp {
+		fsl,pins = <
+			MX6QDL_PAD_ENET_MDIO__ENET_MDIO	0x1b0b0
+			MX6QDL_PAD_ENET_MDC__ENET_MDC	0x1b0b0
+			MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN	0x1b0b0
+			MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN	0x1b0b0
+			MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0	0x1b0b0
+			MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1	0x1b0b0
+			MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER	0x1b0b0
+			MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0	0x1b0b0
+			MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1	0x1b0b0
+			MX6QDL_PAD_GPIO_16__ENET_REF_CLK	0x4001b0a8
+			MX6QDL_PAD_KEY_ROW1__GPIO4_IO09	0x1b0b0
+		>;
+	};
+
+	pinctrl_gpio_leds: gpioledsgrp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D19__GPIO3_IO19	0x130b0
+			MX6QDL_PAD_EIM_D20__GPIO3_IO20	0x130b0
+			MX6QDL_PAD_EIM_D21__GPIO3_IO21	0x130b0
+			MX6QDL_PAD_EIM_D22__GPIO3_IO22	0x130b0
+		>;
+	};
+
+	pinctrl_gpio_keys: gpio_keysgrp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D28__GPIO3_IO28 0x1b0b0
+			MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x1b0b0
+			MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x1b0b0
+			MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x1b0b0
+		>;
+	};
+
+	pinctrl_touchscreen: touchscreengrp {
+		fsl,pins = <
+			MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x1b0b0
+			MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x1b0b0
+		>;
+	};
+
+	pinctrl_pcie_reg: pciereggrp {
+		fsl,pins = <
+			MX6QDL_PAD_GPIO_2__GPIO1_IO02	0x1b0b0
+		>;
+	};
+
+	pinctrl_pcie: pciegrp {
+		fsl,pins = <
+			MX6QDL_PAD_GPIO_7__GPIO1_IO07	0x1b0b0
+			MX6QDL_PAD_GPIO_8__GPIO1_IO08	0x1b0b0
+			MX6QDL_PAD_GPIO_9__GPIO1_IO09	0x1b0b0
+		>;
+	};
+
+	pinctrl_lcd: lcdgrp {
+		fsl,pins = <
+			MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK	0x10
+			MX6QDL_PAD_DI0_PIN15__GPIO4_IO17	0x100b0
+			MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02	0x10
+			MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03	0x10
+			MX6QDL_PAD_DI0_PIN4__IPU1_DI0_PIN04	0x10
+			MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01   0x10
+			MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02   0x10
+			MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03   0x10
+			MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04   0x10
+			MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05   0x10
+			MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06   0x10
+			MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07   0x10
+			MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08   0x10
+			MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09   0x10
+			MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10  0x10
+			MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11  0x10
+			MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12  0x10
+			MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13  0x10
+			MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14  0x10
+			MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15  0x10
+			MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16  0x10
+		>;
+	};
+
+	pinctrl_backlight: backlightgrp {
+		fsl,pins = <
+			MX6QDL_PAD_SD4_DAT2__GPIO2_IO10		0x100b0
+	    >;
+	};
+
+	pinctrl_pwm3: pwm3grp {
+	    fsl,pins = <
+		MX6QDL_PAD_SD4_DAT1__PWM3_OUT		0x1b0b1
+	    >;
+	};
+};
+
+
diff --git a/arch/arm/boot/dts/imx6qdl-logicpd.dtsi b/arch/arm/boot/dts/imx6qdl-logicpd.dtsi
new file mode 100644
index 0000000..18f98b12
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-logicpd.dtsi
@@ -0,0 +1,331 @@
+/*
+ * Copyright 2016 Logic PD
+ * This file is adapted from imx6qdl-sabresd.dtsi.
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include "imx6q.dtsi"
+
+/ {
+	chosen {
+		stdout-path = &uart1;
+	};
+
+	memory {
+		reg = <0x10000000 0x80000000>;
+	};
+
+
+};
+
+/* Reroute power feeding the CPU to come from the external PMIC */
+&cpu0 {
+	arm-supply = <&sw1a_reg>;
+	soc-supply = <&sw1c_reg>;
+};
+
+&reg_arm
+{
+	vin-supply = <&sw1a_reg>;
+};
+
+&reg_soc
+{
+	vin-supply = <&sw1c_reg>;
+};
+
+&clks {
+	assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
+			  <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
+	assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
+				 <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
+};
+
+&gpmi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_gpmi_nand>;
+	status = "okay";
+};
+
+&i2c3 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c3>;
+	status = "okay";
+
+	pmic: pfuze100 at 08 {
+		compatible = "fsl,pfuze100";
+		reg = <0x08>;
+
+		regulators {
+			sw1a_reg: sw1ab {
+				regulator-min-microvolt = <725000>;
+				regulator-max-microvolt = <1450000>;
+				regulator-name = "vddcore";
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-ramp-delay = <6250>;
+			};
+
+			sw1c_reg: sw1c {
+				regulator-min-microvolt = <725000>;
+				regulator-max-microvolt = <1450000>;
+				regulator-name = "vddsoc";
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-ramp-delay = <6250>;
+			};
+
+			sw2_reg: sw2 {
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "gen_3v3";
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw3a_reg: sw3a {
+				regulator-min-microvolt = <400000>;
+				regulator-max-microvolt = <1975000>;
+				regulator-name = "sw3a_vddr";
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw3b_reg: sw3b {
+				regulator-min-microvolt = <400000>;
+				regulator-max-microvolt = <1975000>;
+				regulator-name = "sw3b_vddr";
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw4_reg: sw4 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "gen_rgmii";
+			};
+
+			swbst_reg: swbst {
+				regulator-min-microvolt = <5000000>;
+				regulator-max-microvolt = <5150000>;
+				regulator-name = "gen_5v0";
+			};
+
+
+			snvs_reg: vsnvs {
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-name = "gen_vsns";
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			vref_reg: vrefddr {
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			vgen1_reg: vgen1 {
+				regulator-min-microvolt = <1500000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-name = "gen_1v5";
+			};
+
+			vgen2_reg: vgen2 {
+				regulator-name = "vgen2";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1550000>;
+			};
+
+			vgen3_reg: vgen3 {
+				regulator-name = "gen_vadj_0";
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+			};
+
+			vgen4_reg: vgen4 {
+				regulator-name = "gen_1v8";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			vgen5_reg: vgen5 {
+				regulator-name = "gen_adj_1";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			vgen6_reg: vgen6 {
+				regulator-name = "gen_2v5";
+				regulator-min-microvolt = <2500000>;
+				regulator-max-microvolt = <2500000>;
+				regulator-always-on;
+			};
+		};
+	};
+
+	temp_sense1: tmp102 at 49 {
+		compatible = "ti,tmp102";
+		reg = <0x49>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_tempsense>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
+		#thermal-sensor-cells = <1>;
+	};
+
+	temp_sense0: tmp102 at 4a {
+		compatible = "ti,tmp102";
+		reg = <0x4a>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
+		#thermal-sensor-cells = <1>;
+	};
+
+	user_eeprom: at24 at 52 {
+		compatible = "atmel,24c64";
+		pagesize = <32>;
+		reg = <0x52>;
+	};
+
+	mfg_eeprom: at24 at 51 {
+		compatible = "atmel,24c64";
+		pagesize = <32>;
+		read-only;
+		reg = <0x51>;
+	};
+};
+
+&iomuxc {
+	pinctrl_gpmi_nand: gpminandgrp {
+		fsl,pins = <
+			MX6QDL_PAD_NANDF_CLE__NAND_CLE		0x0b0b1
+			MX6QDL_PAD_NANDF_ALE__NAND_ALE		0x0b0b1
+			MX6QDL_PAD_NANDF_WP_B__NAND_WP_B	0x0b0b1
+			MX6QDL_PAD_NANDF_RB0__NAND_READY_B	0x0b000
+			MX6QDL_PAD_NANDF_CS0__NAND_CE0_B	0x0b0b1
+			MX6QDL_PAD_SD4_CMD__NAND_RE_B		0x0b0b1
+			MX6QDL_PAD_SD4_CLK__NAND_WE_B		0x0b0b1
+			MX6QDL_PAD_NANDF_D0__NAND_DATA00	0x0b0b1
+			MX6QDL_PAD_NANDF_D1__NAND_DATA01	0x0b0b1
+			MX6QDL_PAD_NANDF_D2__NAND_DATA02	0x0b0b1
+			MX6QDL_PAD_NANDF_D3__NAND_DATA03	0x0b0b1
+			MX6QDL_PAD_NANDF_D4__NAND_DATA04	0x0b0b1
+			MX6QDL_PAD_NANDF_D5__NAND_DATA05	0x0b0b1
+			MX6QDL_PAD_NANDF_D6__NAND_DATA06	0x0b0b1
+			MX6QDL_PAD_NANDF_D7__NAND_DATA07	0x0b0b1
+		>;
+	};
+
+	pinctrl_i2c3: i2c3grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D17__I2C3_SCL		0x4001b8b1
+			MX6QDL_PAD_EIM_D18__I2C3_SDA		0x4001b8b1
+		>;
+	};
+
+	pinctrl_uart1: uart1grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA	0x1b0b1
+			MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA	0x1b0b1
+		>;
+	};
+
+	pinctrl_uart2: uart2grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA	0x1b0b1
+			MX6QDL_PAD_SD4_DAT5__UART2_RTS_B	0x1b0b1
+			MX6QDL_PAD_SD4_DAT6__UART2_CTS_B	0x1b0b1
+			MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA	0x1b0b1
+		>;
+	};
+
+	pinctrl_usdhc1: usdhc1grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD1_CMD__SD1_CMD    0x17071
+			MX6QDL_PAD_SD1_CLK__SD1_CLK    0x10071
+			MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17071
+			MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17071
+			MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17071
+			MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17071
+		>;
+	};
+
+	pinctrl_usdhc3: usdhc3grp {
+		fsl,pins = <
+			MX6QDL_PAD_SD3_CMD__SD3_CMD		0x17059
+			MX6QDL_PAD_SD3_CLK__SD3_CLK		0x10059
+			MX6QDL_PAD_SD3_RST__GPIO7_IO08	0x1f0b0
+			MX6QDL_PAD_SD3_DAT0__SD3_DATA0	0x17059
+			MX6QDL_PAD_SD3_DAT1__SD3_DATA1	0x17059
+			MX6QDL_PAD_SD3_DAT2__SD3_DATA2	0x17059
+			MX6QDL_PAD_SD3_DAT3__SD3_DATA3	0x17059
+			MX6QDL_PAD_SD3_DAT4__GPIO7_IO01	0x1f0b0
+			MX6QDL_PAD_SD3_DAT5__GPIO7_IO00	0x1f0b0
+		>;
+	};
+
+	pinctrl_tempsense: tempsensegrp {
+		fsl,pins = <
+			MX6QDL_PAD_NANDF_CS2__GPIO6_IO15 0x1b0b0
+		>;
+	};
+};
+
+&snvs_poweroff {
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart1>;
+	status = "okay";
+};
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart2>;
+	status = "okay";
+};
+
+&usdhc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc1>;
+	cd-gpios = <&gpio6 16 GPIO_ACTIVE_HIGH>;
+	keep-power-in-suspend;
+	enable-sdio-wakeup;
+	status = "okay";
+};
+
+&usdhc3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usdhc3>;
+	non-removable;
+	keep-power-in-suspend;
+	enable-sdio-wakeup;
+	vmmc-supply = <&sw2_reg>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 0 {
+		  compatible = "ti,wl1837";
+		  reg = <2>;
+		  interrupt-parent = <&gpio7>;
+		  interrupts = <1 GPIO_ACTIVE_HIGH>;
+	};
+};
+
+
-- 
2.7.4

^ permalink raw reply related

* [PATCH 1/2] cpufreq: enable the DT cpufreq driver on the Integrators
From: Linus Walleij @ 2016-11-07 15:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1477380085-6929-1-git-send-email-linus.walleij@linaro.org>

On Tue, Oct 25, 2016 at 9:21 AM, Linus Walleij <linus.walleij@linaro.org> wrote:

> This enables the generic DT and OPP-based cpufreq driver on the
> ARM Integrator/AP and Integrator/CP.
>
> Cc: Rafael J. Wysocki <rafael@kernel.org>
> Cc: Russell King <linux@armlinux.org.uk>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Rafael could you merge these two patches so that I can merge the
corresponding DTS files into the ARM SoC tree?

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH] ARM: dts: imx6: Add support for Logic PD SOM and Baseboard
From: Adam Ford @ 2016-11-07 15:20 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOMZO5BVYchz8qrUn8mssn3L7AbD0pvFkKy0zp2CJmsG+hzVxA@mail.gmail.com>

On Mon, Nov 7, 2016 at 9:16 AM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Nov 7, 2016 at 1:11 PM, Fabio Estevam <festevam@gmail.com> wrote:
>
>> You can write the regulators without the container as follows:
>
> Or just look at arch/arm/boot/dts/imx6qdl-ts4900.dtsi for an example.

Thank you for the hint.  It was the reg = <0> causing the issue.  Once
I removed these, It all went away.
I appreciate the patience.  This is my first IMX6 board.  I'll push a
V2 Patch shortly.

adam

^ permalink raw reply

* [PATCH] ARM: dts: imx6: Add support for Logic PD SOM and Baseboard
From: Fabio Estevam @ 2016-11-07 15:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOMZO5DOjGAJytMruLT7mZg2BEbNB2FW-Fyo0Xx0tsr-sZ=6Rw@mail.gmail.com>

On Mon, Nov 7, 2016 at 1:11 PM, Fabio Estevam <festevam@gmail.com> wrote:

> You can write the regulators without the container as follows:

Or just look at arch/arm/boot/dts/imx6qdl-ts4900.dtsi for an example.

^ permalink raw reply

* [PATCH] ARM: dts: imx6: Add support for Logic PD SOM and Baseboard
From: Fabio Estevam @ 2016-11-07 15:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAHCN7xJ=KK-=5sVu0Or5bep-cdk3hq4+a3gFj-W0bCcVhQyWNw@mail.gmail.com>

Hi Adam,

On Mon, Nov 7, 2016 at 1:03 PM, Adam Ford <aford173@gmail.com> wrote:

> I rebased on the 4.9-rc4, and the pinmux errors go away, but the
> regulators appear to need their own container or I get the following
> error:

You can write the regulators without the container as follows:

reg_3p3v: regulator-3p3v {

reg_usb_otg_vbus: regulator-usbotgvbus {
         compatible = "regulator-fixed";
         regulator-name = "usb_otg_vbus";
         regulator-min-microvolt = <5000000>;
         regulator-max-microvolt = <5000000>;
         gpio = <&gpio4 15 GPIO_ACTIVE_HIGH>;
         enable-active-high;
};

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox