linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
@ 2016-03-02  2:34 Andreas Färber
  2016-03-02  2:34 ` [PATCH v2 1/6] ARM64: Enable Amlogic Meson GXBaby platform Andreas Färber
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Andreas Färber @ 2016-03-02  2:34 UTC (permalink / raw)
  To: linux-meson
  Cc: Carlo Caione, linux-arm-kernel, Matthias Brugger, Nicolas Saenz,
	Andreas Färber, André Przywara, Sudeep Holla,
	devicetree, Catalin Marinas, Will Deacon, open list

Hello,

This series adds initial support for the Amlogic S905 based
Tronsmart Vega S95 Pro, Meta and Telos TV boxes.

v2:
* Pick up previously acked "tronsmart" patch instead (Matthias)
* Drop ARM_GIC selection (Sudeep)
* Change some compatible strings (Sudeep, André)
* Squash some node changes/additions

Note: On the Vega S95 I need to change TEXT_OFFSET as follows,
in order to avoid the vendor U-Boot overwriting itself (fwiu);
for the Mini Mx that's reportedly not necessary.

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 354d75402ace..b7cebdb8b1ce 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -62,7 +62,7 @@ head-y                := arch/arm64/kernel/head.o
 ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
 TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}')
 else
-TEXT_OFFSET := 0x00080000
+TEXT_OFFSET := 0x01080000
 endif
 
 # KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)

This in turn runs into an apparent regression introduced with the
text offset randomization:

diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 6ebd204da16a..afdec27c8871 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -48,7 +48,7 @@
 #elif (PAGE_OFFSET & 0x1fffff) != 0
 #error PAGE_OFFSET must be at least 2MB aligned
 #elif TEXT_OFFSET > 0x1fffff
-#error TEXT_OFFSET must be less than 2MB
+//#error TEXT_OFFSET must be less than 2MB
 #endif
 
 #define KERNEL_START   _text

https://en.opensuse.org/HCL:VegaS95

https://github.com/afaerber/linux/commits/vegas95-next

Regards,
Andreas

Cc: André Przywara <andre.przywara@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: devicetree@vger.kernel.org

Andreas Färber (5):
  ARM64: Enable Amlogic Meson GXBaby platform
  Documentation: devicetree: amlogic: Document Meson GXBaby
  ARM64: dts: Prepare configs for Amlogic Meson GXBaby
  Documentation: devicetree: amlogic: Document Tronsmart Vega S95 boards
  ARM64: dts: amlogic: Add Tronsmart Vega S95 configs

Matthias Brugger (1):
  devicetree: bindings: Add vendor prefix for Tronsmart

 Documentation/devicetree/bindings/arm/amlogic.txt  |   7 +
 .../devicetree/bindings/vendor-prefixes.txt        |   1 +
 arch/arm64/Kconfig.platforms                       |   5 +
 arch/arm64/boot/dts/Makefile                       |   1 +
 arch/arm64/boot/dts/amlogic/Makefile               |   7 +
 .../boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts  |  55 +++++++
 .../boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts   |  55 +++++++
 .../boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts |  55 +++++++
 .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi      |  55 +++++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        | 183 +++++++++++++++++++++
 10 files changed, 424 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/Makefile
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi

-- 
2.6.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 1/6] ARM64: Enable Amlogic Meson GXBaby platform
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
@ 2016-03-02  2:34 ` Andreas Färber
  2016-03-02  2:34 ` [PATCH v2 2/6] devicetree: bindings: Add vendor prefix for Tronsmart Andreas Färber
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Andreas Färber @ 2016-03-02  2:34 UTC (permalink / raw)
  To: linux-meson
  Cc: Carlo Caione, linux-arm-kernel, Matthias Brugger, Nicolas Saenz,
	Andreas Färber, Catalin Marinas, Will Deacon, open list

Provide the ARCH_MESON Kconfig symbol to allow enabling existing serial
and i2c drivers.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v1 -> v2:
 * Dropped ARM_GIC selection (Sudeep)
 
 arch/arm64/Kconfig.platforms | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index a0a69589e46c..a14e024b63a9 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -56,6 +56,11 @@ config ARCH_MEDIATEK
 	help
 	  Support for Mediatek MT65xx & MT81xx ARMv8 SoCs
 
+config ARCH_MESON
+	bool "Amlogic Platforms"
+	help
+	  This enables support for the Amlogic S905 SoCs.
+
 config ARCH_MVEBU
 	bool "Marvell EBU SoC Family"
 	select ARMADA_AP806_CORE_CLK
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 2/6] devicetree: bindings: Add vendor prefix for Tronsmart
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
  2016-03-02  2:34 ` [PATCH v2 1/6] ARM64: Enable Amlogic Meson GXBaby platform Andreas Färber
@ 2016-03-02  2:34 ` Andreas Färber
  2016-03-02  2:34 ` [PATCH v2 3/6] Documentation: devicetree: amlogic: Document Meson GXBaby Andreas Färber
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Andreas Färber @ 2016-03-02  2:34 UTC (permalink / raw)
  To: linux-meson
  Cc: Carlo Caione, linux-arm-kernel, Matthias Brugger, Nicolas Saenz,
	Matthias Brugger, Andreas Färber, Rob Herring, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

From: Matthias Brugger <matthias.bgg@gmail.com>

Tronsmart is a China based company building consumer electronic
devices.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v1 -> v2:
 * Replaced with older identical patch (Matthias)
 
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index f871e8e7e98f..662edc7bce04 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -243,6 +243,7 @@ toshiba	Toshiba Corporation
 toumaz	Toumaz
 tplink	TP-LINK Technologies Co., Ltd.
 tronfy	Tronfy
+tronsmart	Tronsmart
 truly	Truly Semiconductors Limited
 upisemi	uPI Semiconductor Corp.
 urt	United Radiant Technology Corporation
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 3/6] Documentation: devicetree: amlogic: Document Meson GXBaby
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
  2016-03-02  2:34 ` [PATCH v2 1/6] ARM64: Enable Amlogic Meson GXBaby platform Andreas Färber
  2016-03-02  2:34 ` [PATCH v2 2/6] devicetree: bindings: Add vendor prefix for Tronsmart Andreas Färber
@ 2016-03-02  2:34 ` Andreas Färber
  2016-03-05  4:27   ` Rob Herring
  2016-03-02  2:34 ` [PATCH v2 4/6] ARM64: dts: Prepare configs for Amlogic " Andreas Färber
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Andreas Färber @ 2016-03-02  2:34 UTC (permalink / raw)
  To: linux-meson
  Cc: Carlo Caione, linux-arm-kernel, Matthias Brugger, Nicolas Saenz,
	Andreas Färber, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

Use "amlogic,meson-gxbb" compatible string.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v1 -> v2: unchanged
 
 Documentation/devicetree/bindings/arm/amlogic.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/amlogic.txt b/Documentation/devicetree/bindings/arm/amlogic.txt
index 1dfee20eee74..776f08ca215f 100644
--- a/Documentation/devicetree/bindings/arm/amlogic.txt
+++ b/Documentation/devicetree/bindings/arm/amlogic.txt
@@ -13,6 +13,10 @@ Boards with the Amlogic Meson8b SoC shall have the following properties:
   Required root node property:
     compatible: "amlogic,meson8b";
 
+Boards with the Amlogic Meson GXBaby SoC shall have the following properties:
+  Required root node property:
+    compatible: "amlogic,meson-gxbb";
+
 Board compatible values:
   - "geniatech,atv1200" (Meson6)
   - "minix,neo-x8" (Meson8)
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 4/6] ARM64: dts: Prepare configs for Amlogic Meson GXBaby
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
                   ` (2 preceding siblings ...)
  2016-03-02  2:34 ` [PATCH v2 3/6] Documentation: devicetree: amlogic: Document Meson GXBaby Andreas Färber
@ 2016-03-02  2:34 ` Andreas Färber
  2016-03-02  2:35 ` [PATCH v2 5/6] Documentation: devicetree: amlogic: Document Tronsmart Vega S95 boards Andreas Färber
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Andreas Färber @ 2016-03-02  2:34 UTC (permalink / raw)
  To: linux-meson
  Cc: Carlo Caione, linux-arm-kernel, Matthias Brugger, Nicolas Saenz,
	Andreas Färber, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Catalin Marinas, Will Deacon,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v1 -> v2:
 * Adopted "arm,cortex-a53-pmu" compatible string (Sudeep)
 * Adopted "arm,gic-400" compatible string (André, Sudeep)
 * Adopted "arm,psci-0.2" compatible string and dropped functions (Sudeep)
 * Squashed GIC reg extension patch, enlarged one (André)
 * Squashed arch timer patch
 * Added uart nodes and aliases (from Vega S95 .dtsi)
 * Modeled cbus, aobus and apb
 
 arch/arm64/boot/dts/Makefile                |   1 +
 arch/arm64/boot/dts/amlogic/Makefile        |   3 +
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 183 ++++++++++++++++++++++++++++
 3 files changed, 187 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/Makefile
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi

diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
index fd80617a9c6f..330fae966cf3 100644
--- a/arch/arm64/boot/dts/Makefile
+++ b/arch/arm64/boot/dts/Makefile
@@ -1,6 +1,7 @@
 dts-dirs += al
 dts-dirs += altera
 dts-dirs += amd
+dts-dirs += amlogic
 dts-dirs += apm
 dts-dirs += arm
 dts-dirs += broadcom
diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
new file mode 100644
index 000000000000..1b06c28c67eb
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -0,0 +1,3 @@
+always		:= $(dtb-y)
+subdir-y	:= $(dts-dirs)
+clean-files	:= *.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
new file mode 100644
index 000000000000..eaa0a4553734
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2016 Andreas Färber
+ *
+ * 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 library 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 library 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 "AS IS", 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.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	compatible = "amlogic,meson-gxbb";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		serial0 = &uart_AO;
+		serial1 = &uart_A;
+	};
+
+	cpus {
+		#address-cells = <0x2>;
+		#size-cells = <0x0>;
+
+		cpu0: cpu@0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53", "arm,armv8";
+			reg = <0x0 0x0>;
+			enable-method = "psci";
+		};
+
+		cpu1: cpu@1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53", "arm,armv8";
+			reg = <0x0 0x1>;
+			enable-method = "psci";
+		};
+
+		cpu2: cpu@2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53", "arm,armv8";
+			reg = <0x0 0x2>;
+			enable-method = "psci";
+		};
+
+		cpu3: cpu@3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53", "arm,armv8";
+			reg = <0x0 0x3>;
+			enable-method = "psci";
+		};
+	};
+
+	arm-pmu {
+		compatible = "arm,cortex-a53-pmu";
+		interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
+	};
+
+	psci {
+		compatible = "arm,psci-0.2";
+		method = "smc";
+	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13
+			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
+			     <GIC_PPI 14
+			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
+			     <GIC_PPI 11
+			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
+			     <GIC_PPI 10
+			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>;
+	};
+
+	xtal: xtal-clk {
+		compatible = "fixed-clock";
+		clock-frequency = <24000000>;
+		clock-output-names = "xtal";
+		#clock-cells = <0>;
+	};
+
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		cbus: cbus@c1100000 {
+			compatible = "simple-bus";
+			reg = <0x0 0xc1100000 0x0 0x100000>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges = <0x0 0x0 0x0 0xc1100000 0x0 0x100000>;
+
+			uart_A: serial@84c0 {
+				compatible = "amlogic,meson-uart";
+				reg = <0x0 0x084c0 0x0 0x14>;
+				interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&xtal>;
+				status = "disabled";
+			};
+		};
+
+		gic: interrupt-controller@c4301000 {
+			compatible = "arm,gic-400";
+			reg = <0x0 0xc4301000 0 0x1000>,
+			      <0x0 0xc4302000 0 0x2000>,
+			      <0x0 0xc4304000 0 0x2000>,
+			      <0x0 0xc4306000 0 0x2000>;
+			interrupt-controller;
+			interrupts = <GIC_PPI 9
+				(GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
+			#interrupt-cells = <3>;
+			#address-cells = <0>;
+		};
+
+		aobus: aobus@c8100000 {
+			compatible = "simple-bus";
+			reg = <0x0 0xc8100000 0x0 0x100000>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges = <0x0 0x0 0x0 0xc8100000 0x0 0x100000>;
+
+			uart_AO: serial@4c0 {
+				compatible = "amlogic,meson-uart";
+				reg = <0x0 0x004c0 0x0 0x14>;
+				interrupts = <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&xtal>;
+				status = "disabled";
+			};
+		};
+
+		apb: apb@d0000000 {
+			compatible = "simple-bus";
+			reg = <0x0 0xd0000000 0x0 0x200000>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges = <0x0 0x0 0x0 0xd0000000 0x0 0x200000>;
+		};
+	};
+};
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 5/6] Documentation: devicetree: amlogic: Document Tronsmart Vega S95 boards
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
                   ` (3 preceding siblings ...)
  2016-03-02  2:34 ` [PATCH v2 4/6] ARM64: dts: Prepare configs for Amlogic " Andreas Färber
@ 2016-03-02  2:35 ` Andreas Färber
  2016-03-05  4:27   ` Rob Herring
  2016-03-02  2:35 ` [PATCH v2 6/6] ARM64: dts: amlogic: Add Tronsmart Vega S95 configs Andreas Färber
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Andreas Färber @ 2016-03-02  2:35 UTC (permalink / raw)
  To: linux-meson
  Cc: Carlo Caione, linux-arm-kernel, Matthias Brugger, Nicolas Saenz,
	Andreas Färber, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

Use "tronsmart,vega-s95" as well as
    "tronsmart,vega-s95-pro",
    "tronsmart,vega-s95-meta" and
    "tronsmart,vega-s95-telos" compatible strings.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v1 -> v2: unchanged
 
 Documentation/devicetree/bindings/arm/amlogic.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/amlogic.txt b/Documentation/devicetree/bindings/arm/amlogic.txt
index 776f08ca215f..8a5122ab19b0 100644
--- a/Documentation/devicetree/bindings/arm/amlogic.txt
+++ b/Documentation/devicetree/bindings/arm/amlogic.txt
@@ -22,3 +22,6 @@ Board compatible values:
   - "minix,neo-x8" (Meson8)
   - "tronfy,mxq" (Meson8b)
   - "hardkernel,odroid-c1" (Meson8b)
+  - "tronsmart,vega-s95-pro", "tronsmart,vega-s95" (Meson gxbb)
+  - "tronsmart,vega-s95-meta", "tronsmart,vega-s95" (Meson gxbb)
+  - "tronsmart,vega-s95-telos", "tronsmart,vega-s95" (Meson gxbb)
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 6/6] ARM64: dts: amlogic: Add Tronsmart Vega S95 configs
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
                   ` (4 preceding siblings ...)
  2016-03-02  2:35 ` [PATCH v2 5/6] Documentation: devicetree: amlogic: Document Tronsmart Vega S95 boards Andreas Färber
@ 2016-03-02  2:35 ` Andreas Färber
  2016-03-02 13:52 ` [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Mark Rutland
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Andreas Färber @ 2016-03-02  2:35 UTC (permalink / raw)
  To: linux-meson
  Cc: Carlo Caione, linux-arm-kernel, Matthias Brugger, Nicolas Saenz,
	Andreas Färber, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Catalin Marinas, Will Deacon,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

Add Device Trees for Tronsmart Vega S95 Pro, Meta and Telos TV boxes.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v1 -> v2:
 * Dropped aliases (moved to Meson gxbb .dtsi)
 * Override only status of uart node (moved to Meson gxbb .dtsi)
 
 arch/arm64/boot/dts/amlogic/Makefile               |  4 ++
 .../boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts  | 55 ++++++++++++++++++++++
 .../boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts   | 55 ++++++++++++++++++++++
 .../boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts | 55 ++++++++++++++++++++++
 .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi      | 55 ++++++++++++++++++++++
 5 files changed, 224 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi

diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
index 1b06c28c67eb..eb672f38f89e 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -1,3 +1,7 @@
+dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-pro.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-meta.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-telos.dtb
+
 always		:= $(dtb-y)
 subdir-y	:= $(dts-dirs)
 clean-files	:= *.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts
new file mode 100644
index 000000000000..399aff9e7975
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2016 Andreas Färber
+ *
+ * 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 library 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 library 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 "AS IS", 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 "meson-gxbb-vega-s95.dtsi"
+
+/ {
+	compatible = "tronsmart,vega-s95-meta", "tronsmart,vega-s95", "amlogic,meson-gxbb";
+	model = "Tronsmart Vega S95 Meta";
+
+	memory {
+		device_type = "memory";
+		reg = <0x0 0x0 0x0 0x80000000>;
+	};
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts
new file mode 100644
index 000000000000..ac5a241b5ec2
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2016 Andreas Färber
+ *
+ * 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 library 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 library 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 "AS IS", 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 "meson-gxbb-vega-s95.dtsi"
+
+/ {
+	compatible = "tronsmart,vega-s95-pro", "tronsmart,vega-s95", "amlogic,meson-gxbb";
+	model = "Tronsmart Vega S95 Pro";
+
+	memory {
+		device_type = "memory";
+		reg = <0x0 0x0 0x0 0x40000000>;
+	};
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts
new file mode 100644
index 000000000000..fff7bfa2aa39
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2016 Andreas Färber
+ *
+ * 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 library 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 library 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 "AS IS", 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 "meson-gxbb-vega-s95.dtsi"
+
+/ {
+	compatible = "tronsmart,vega-s95-telos", "tronsmart,vega-s95", "amlogic,meson-gxbb";
+	model = "Tronsmart Vega S95 Telos";
+
+	memory {
+		device_type = "memory";
+		reg = <0x0 0x0 0x0 0x80000000>;
+	};
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
new file mode 100644
index 000000000000..c1fa2667ec5c
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2016 Andreas Färber
+ *
+ * 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 library 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 library 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 "AS IS", 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.
+ */
+
+#include "meson-gxbb.dtsi"
+
+/ {
+	compatible = "tronsmart,vega-s95", "amlogic,meson-gxbb";
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&uart_AO {
+	status = "okay";
+};
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
                   ` (5 preceding siblings ...)
  2016-03-02  2:35 ` [PATCH v2 6/6] ARM64: dts: amlogic: Add Tronsmart Vega S95 configs Andreas Färber
@ 2016-03-02 13:52 ` Mark Rutland
  2016-03-02 14:31   ` Andreas Färber
  2016-03-07  8:20 ` Carlo Caione
  2016-03-21 22:36 ` Kevin Hilman
  8 siblings, 1 reply; 17+ messages in thread
From: Mark Rutland @ 2016-03-02 13:52 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, André Przywara, Sudeep Holla, devicetree,
	Catalin Marinas, Will Deacon, open list

On Wed, Mar 02, 2016 at 03:34:55AM +0100, Andreas Färber wrote:
> Hello,
> 
> This series adds initial support for the Amlogic S905 based
> Tronsmart Vega S95 Pro, Meta and Telos TV boxes.
> 
> v2:
> * Pick up previously acked "tronsmart" patch instead (Matthias)
> * Drop ARM_GIC selection (Sudeep)
> * Change some compatible strings (Sudeep, André)
> * Squash some node changes/additions
> 
> Note: On the Vega S95 I need to change TEXT_OFFSET as follows,
> in order to avoid the vendor U-Boot overwriting itself (fwiu);
> for the Mini Mx that's reportedly not necessary.
> 
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 354d75402ace..b7cebdb8b1ce 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -62,7 +62,7 @@ head-y                := arch/arm64/kernel/head.o
>  ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
>  TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}')
>  else
> -TEXT_OFFSET := 0x00080000
> +TEXT_OFFSET := 0x01080000
>  endif
>  
>  # KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)

Absolute NAK to this. TEXT_OFFSET is not open for platform-specific
modification.

Why can you not just load the Image 2MB higher regardless? Does the
U-Boot on this platform actually read TEXT_OFFSET and take it into
account?

> This in turn runs into an apparent regression introduced with the
> text offset randomization:
> 
> diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
> index 6ebd204da16a..afdec27c8871 100644
> --- a/arch/arm64/kernel/head.S
> +++ b/arch/arm64/kernel/head.S
> @@ -48,7 +48,7 @@
>  #elif (PAGE_OFFSET & 0x1fffff) != 0
>  #error PAGE_OFFSET must be at least 2MB aligned
>  #elif TEXT_OFFSET > 0x1fffff
> -#error TEXT_OFFSET must be less than 2MB
> +//#error TEXT_OFFSET must be less than 2MB
>  #endif
>  
>  #define KERNEL_START   _text

This is not a regression. As above, TEXT_OFFSET is not supposed to be
modified in a platform-specific manner.

Mark.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
  2016-03-02 13:52 ` [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Mark Rutland
@ 2016-03-02 14:31   ` Andreas Färber
  2016-03-02 15:17     ` Mark Rutland
  0 siblings, 1 reply; 17+ messages in thread
From: Andreas Färber @ 2016-03-02 14:31 UTC (permalink / raw)
  To: Mark Rutland
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, André Przywara, Sudeep Holla, devicetree,
	Catalin Marinas, Will Deacon, LKML

Am 02.03.2016 um 14:52 schrieb Mark Rutland:
> On Wed, Mar 02, 2016 at 03:34:55AM +0100, Andreas Färber wrote:
>> Note: On the Vega S95 I need to change TEXT_OFFSET as follows,
>> in order to avoid the vendor U-Boot overwriting itself (fwiu);
>> for the Mini Mx that's reportedly not necessary.
>>
>> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
>> index 354d75402ace..b7cebdb8b1ce 100644
>> --- a/arch/arm64/Makefile
>> +++ b/arch/arm64/Makefile
>> @@ -62,7 +62,7 @@ head-y                := arch/arm64/kernel/head.o
>>  ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
>>  TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}')
>>  else
>> -TEXT_OFFSET := 0x00080000
>> +TEXT_OFFSET := 0x01080000
>>  endif
>>  
>>  # KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)
> 
> Absolute NAK to this. TEXT_OFFSET is not open for platform-specific
> modification.

Please read again. There is nothing to NAK here, it's a workaround for
testing my patches on my device! Even my own git queue has it clearly
labeled as "HACK:".

Nothing you say here indicates that this is breaking any particular
kernel feature or damaging the device, so unless you propose a different
way to solve the problem I see no way around it for now.

> Why can you not just load the Image 2MB higher regardless? Does the
> U-Boot on this platform actually read TEXT_OFFSET and take it into
> account?

Yes, U-Boot checks the ELF(?) header and tries to copy the image to the
indicated offset if it isn't loaded there already. The vendor's kernel
has the adjusted offset and works; if I use unmodified mainline kernels
then I get weird exceptions from before entering the kernel, my
assumption being that U-Boot code gets overwritten.

http://openlinux.amlogic.com:8000/download/ARM/u-boot/

This problem might go away if we had a proper upstream-based U-Boot; I'm
not familiar enough with U-Boot to fix that myself and would hate to
mess with U-Boot on eMMC, for lack of JTAG pins on this device.

The Odroid-C2 (which I do not have access to yet) has instructions how
to place U-Boot on an SD card, making it safer to experiment with.
http://odroid.com/dokuwiki/doku.php?id=en:c2_partition_table

>> This in turn runs into an apparent regression introduced with the
>> text offset randomization:
>>
>> diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
>> index 6ebd204da16a..afdec27c8871 100644
>> --- a/arch/arm64/kernel/head.S
>> +++ b/arch/arm64/kernel/head.S
>> @@ -48,7 +48,7 @@
>>  #elif (PAGE_OFFSET & 0x1fffff) != 0
>>  #error PAGE_OFFSET must be at least 2MB aligned
>>  #elif TEXT_OFFSET > 0x1fffff
>> -#error TEXT_OFFSET must be less than 2MB
>> +//#error TEXT_OFFSET must be less than 2MB
>>  #endif
>>  
>>  #define KERNEL_START   _text
> 
> This is not a regression. As above, TEXT_OFFSET is not supposed to be
> modified in a platform-specific manner.

It is in fact an unexplained behavioral change in
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=da57a369d3bc5cd61db90f7e9555840381db9b09

diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 3ba0fc0..69dafe9 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -37,8 +37,12 @@

 #define KERNEL_RAM_VADDR	(PAGE_OFFSET + TEXT_OFFSET)

-#if (KERNEL_RAM_VADDR & 0xfffff) != 0x80000
-#error KERNEL_RAM_VADDR must start at 0xXXX80000
+#if (TEXT_OFFSET & 0xf) != 0
+#error TEXT_OFFSET must be at least 16B aligned
+#elif (PAGE_OFFSET & 0xfffff) != 0
+#error PAGE_OFFSET must be at least 2MB aligned
+#elif TEXT_OFFSET > 0xfffff
+#error TEXT_OFFSET must be less than 2MB
 #endif

 	.macro	pgtbl, ttb0, ttb1, virt_to_phys

As you can see, previously 0x1080000 was a valid value, and this
regressed with the new randomization feature. It obviously works with
the larger offset for me, so the "must be" seems questionable.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
  2016-03-02 14:31   ` Andreas Färber
@ 2016-03-02 15:17     ` Mark Rutland
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Rutland @ 2016-03-02 15:17 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, André Przywara, Sudeep Holla, devicetree,
	Catalin Marinas, Will Deacon, LKML

On Wed, Mar 02, 2016 at 03:31:52PM +0100, Andreas Färber wrote:
> Am 02.03.2016 um 14:52 schrieb Mark Rutland:
> > On Wed, Mar 02, 2016 at 03:34:55AM +0100, Andreas Färber wrote:
> >> Note: On the Vega S95 I need to change TEXT_OFFSET as follows,
> >> in order to avoid the vendor U-Boot overwriting itself (fwiu);
> >> for the Mini Mx that's reportedly not necessary.
> >>
> >> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> >> index 354d75402ace..b7cebdb8b1ce 100644
> >> --- a/arch/arm64/Makefile
> >> +++ b/arch/arm64/Makefile
> >> @@ -62,7 +62,7 @@ head-y                := arch/arm64/kernel/head.o
> >>  ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
> >>  TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}')
> >>  else
> >> -TEXT_OFFSET := 0x00080000
> >> +TEXT_OFFSET := 0x01080000
> >>  endif
> >>  
> >>  # KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)
> > 
> > Absolute NAK to this. TEXT_OFFSET is not open for platform-specific
> > modification.
> 
> Please read again. There is nothing to NAK here, it's a workaround for
> testing my patches on my device! Even my own git queue has it clearly
> labeled as "HACK:".

Sure; I appreciate you need a workaround for the broken bootloader
currently on the device.

I'm simply heading off any attempts to upstream such changes.

> Nothing you say here indicates that this is breaking any particular
> kernel feature or damaging the device, so unless you propose a different
> way to solve the problem I see no way around it for now.

As far as I am aware, this should not result in damage to your device.

However, it runs directly counter to single-image, and other parts of
the kernel _may_ rely on the existing limits on TEXT_OFFSET. So it's not
suitable for upstream, and you _may_ encounter issues as a result.

> > Why can you not just load the Image 2MB higher regardless? Does the
> > U-Boot on this platform actually read TEXT_OFFSET and take it into
> > account?
> 
> Yes, U-Boot checks the ELF(?) header and tries to copy the image to the
> indicated offset if it isn't loaded there already. The vendor's kernel
> has the adjusted offset and works;

So the vendor deliberately changed the kernel Image in an unsupported
fashion, resulting in a divergent boot protocol.

This is incredibly unfortunate.

> if I use unmodified mainline kernels then I get weird exceptions from
> before entering the kernel, my assumption being that U-Boot code gets
> overwritten.
> 
> http://openlinux.amlogic.com:8000/download/ARM/u-boot/
> 
> This problem might go away if we had a proper upstream-based U-Boot; I'm
> not familiar enough with U-Boot to fix that myself and would hate to
> mess with U-Boot on eMMC, for lack of JTAG pins on this device.
 
> The Odroid-C2 (which I do not have access to yet) has instructions how
> to place U-Boot on an SD card, making it safer to experiment with.
> http://odroid.com/dokuwiki/doku.php?id=en:c2_partition_table

This is probably the right path to a solution.

> >> This in turn runs into an apparent regression introduced with the
> >> text offset randomization:
> >>
> >> diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
> >> index 6ebd204da16a..afdec27c8871 100644
> >> --- a/arch/arm64/kernel/head.S
> >> +++ b/arch/arm64/kernel/head.S
> >> @@ -48,7 +48,7 @@
> >>  #elif (PAGE_OFFSET & 0x1fffff) != 0
> >>  #error PAGE_OFFSET must be at least 2MB aligned
> >>  #elif TEXT_OFFSET > 0x1fffff
> >> -#error TEXT_OFFSET must be less than 2MB
> >> +//#error TEXT_OFFSET must be less than 2MB
> >>  #endif
> >>  
> >>  #define KERNEL_START   _text
> > 
> > This is not a regression. As above, TEXT_OFFSET is not supposed to be
> > modified in a platform-specific manner.
> 
> It is in fact an unexplained behavioral change in
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=da57a369d3bc5cd61db90f7e9555840381db9b09

Yes, strictly speaking it is a change.

No, it is not a regression, since TEXT_OFFSET was _never_ open to such
platform-specific modification.

Thanks,
Mark.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/6] Documentation: devicetree: amlogic: Document Meson GXBaby
  2016-03-02  2:34 ` [PATCH v2 3/6] Documentation: devicetree: amlogic: Document Meson GXBaby Andreas Färber
@ 2016-03-05  4:27   ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2016-03-05  4:27 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

On Wed, Mar 02, 2016 at 03:34:58AM +0100, Andreas Färber wrote:
> Use "amlogic,meson-gxbb" compatible string.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  v1 -> v2: unchanged
>  
>  Documentation/devicetree/bindings/arm/amlogic.txt | 4 ++++
>  1 file changed, 4 insertions(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 5/6] Documentation: devicetree: amlogic: Document Tronsmart Vega S95 boards
  2016-03-02  2:35 ` [PATCH v2 5/6] Documentation: devicetree: amlogic: Document Tronsmart Vega S95 boards Andreas Färber
@ 2016-03-05  4:27   ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2016-03-05  4:27 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

On Wed, Mar 02, 2016 at 03:35:00AM +0100, Andreas Färber wrote:
> Use "tronsmart,vega-s95" as well as
>     "tronsmart,vega-s95-pro",
>     "tronsmart,vega-s95-meta" and
>     "tronsmart,vega-s95-telos" compatible strings.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  v1 -> v2: unchanged
>  
>  Documentation/devicetree/bindings/arm/amlogic.txt | 3 +++
>  1 file changed, 3 insertions(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
                   ` (6 preceding siblings ...)
  2016-03-02 13:52 ` [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Mark Rutland
@ 2016-03-07  8:20 ` Carlo Caione
  2016-03-21 22:36 ` Kevin Hilman
  8 siblings, 0 replies; 17+ messages in thread
From: Carlo Caione @ 2016-03-07  8:20 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, André Przywara, Sudeep Holla, devicetree,
	Catalin Marinas, Will Deacon, open list

On Wed, Mar 2, 2016 at 3:34 AM, Andreas Färber <afaerber@suse.de> wrote:
> Hello,
>
> This series adds initial support for the Amlogic S905 based
> Tronsmart Vega S95 Pro, Meta and Telos TV boxes.

Thank you for working on this. If there will be no more comments in
the few next days I'll pick the whole series up.

Cheers,

-- 
Carlo Caione

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
  2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
                   ` (7 preceding siblings ...)
  2016-03-07  8:20 ` Carlo Caione
@ 2016-03-21 22:36 ` Kevin Hilman
  2016-03-22 20:29   ` Andreas Färber
  8 siblings, 1 reply; 17+ messages in thread
From: Kevin Hilman @ 2016-03-21 22:36 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, André Przywara, Sudeep Holla, devicetree,
	Catalin Marinas, Will Deacon, open list

On Tue, Mar 1, 2016 at 6:34 PM, Andreas Färber <afaerber@suse.de> wrote:

> This series adds initial support for the Amlogic S905 based
> Tronsmart Vega S95 Pro, Meta and Telos TV boxes.
>
> v2:
> * Pick up previously acked "tronsmart" patch instead (Matthias)
> * Drop ARM_GIC selection (Sudeep)
> * Change some compatible strings (Sudeep, André)
> * Squash some node changes/additions
>
> Note: On the Vega S95 I need to change TEXT_OFFSET as follows,
> in order to avoid the vendor U-Boot overwriting itself (fwiu);
> for the Mini Mx that's reportedly not necessary.

FYI, the Amlogic P200 dev board also needs this hack with the factory u-boot.

Kevin

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
  2016-03-21 22:36 ` Kevin Hilman
@ 2016-03-22 20:29   ` Andreas Färber
  2016-03-23  8:06     ` Carlo Caione
  2016-03-23 18:10     ` Kevin Hilman
  0 siblings, 2 replies; 17+ messages in thread
From: Andreas Färber @ 2016-03-22 20:29 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, André Przywara, Sudeep Holla, devicetree,
	Catalin Marinas, Will Deacon, LKML, Mark Rutland

Am 21.03.2016 um 23:36 schrieb Kevin Hilman:
> On Tue, Mar 1, 2016 at 6:34 PM, Andreas Färber <afaerber@suse.de> wrote:
> 
>> Note: On the Vega S95 I need to change TEXT_OFFSET as follows,
>> in order to avoid the vendor U-Boot overwriting itself (fwiu);
>> for the Mini Mx that's reportedly not necessary.
> 
> FYI, the Amlogic P200 dev board also needs this hack with the factory u-boot.

I have meanwhile found that

mkimage -A arm64 -O linux -T kernel -C none -a 0x1080000 -e 0x1080000 \
-n linux-next -d arch/arm64/boot/Image ../uImage

and then using bootm instead of booti works even without the above hack
on the Vega S95. Not a satisfactory solution yet, but better than
patching the kernel in a distro-incompatible way.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
  2016-03-22 20:29   ` Andreas Färber
@ 2016-03-23  8:06     ` Carlo Caione
  2016-03-23 18:10     ` Kevin Hilman
  1 sibling, 0 replies; 17+ messages in thread
From: Carlo Caione @ 2016-03-23  8:06 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Kevin Hilman, linux-meson, Carlo Caione, linux-arm-kernel,
	Matthias Brugger, Nicolas Saenz, André Przywara,
	Sudeep Holla, devicetree, Catalin Marinas, Will Deacon, LKML,
	Mark Rutland

On Tue, Mar 22, 2016 at 9:29 PM, Andreas Färber <afaerber@suse.de> wrote:
> Am 21.03.2016 um 23:36 schrieb Kevin Hilman:
>> On Tue, Mar 1, 2016 at 6:34 PM, Andreas Färber <afaerber@suse.de> wrote:
>>
>>> Note: On the Vega S95 I need to change TEXT_OFFSET as follows,
>>> in order to avoid the vendor U-Boot overwriting itself (fwiu);
>>> for the Mini Mx that's reportedly not necessary.
>>
>> FYI, the Amlogic P200 dev board also needs this hack with the factory u-boot.
>
> I have meanwhile found that
>
> mkimage -A arm64 -O linux -T kernel -C none -a 0x1080000 -e 0x1080000 \
> -n linux-next -d arch/arm64/boot/Image ../uImage
>
> and then using bootm instead of booti works even without the above hack
> on the Vega S95. Not a satisfactory solution yet, but better than
> patching the kernel in a distro-incompatible way.

I wonder if we can add this kind of information in Documentation/arm/meson/.
Probably it could be handy until we have a proper u-boot porting.

-- 
Carlo Caione

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement
  2016-03-22 20:29   ` Andreas Färber
  2016-03-23  8:06     ` Carlo Caione
@ 2016-03-23 18:10     ` Kevin Hilman
  1 sibling, 0 replies; 17+ messages in thread
From: Kevin Hilman @ 2016-03-23 18:10 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-meson, Carlo Caione, linux-arm-kernel, Matthias Brugger,
	Nicolas Saenz, André Przywara, Sudeep Holla, devicetree,
	Catalin Marinas, Will Deacon, LKML, Mark Rutland

Andreas Färber <afaerber@suse.de> writes:

> Am 21.03.2016 um 23:36 schrieb Kevin Hilman:
>> On Tue, Mar 1, 2016 at 6:34 PM, Andreas Färber <afaerber@suse.de> wrote:
>> 
>>> Note: On the Vega S95 I need to change TEXT_OFFSET as follows,
>>> in order to avoid the vendor U-Boot overwriting itself (fwiu);
>>> for the Mini Mx that's reportedly not necessary.
>> 
>> FYI, the Amlogic P200 dev board also needs this hack with the factory u-boot.
>
> I have meanwhile found that
>
> mkimage -A arm64 -O linux -T kernel -C none -a 0x1080000 -e 0x1080000 \
> -n linux-next -d arch/arm64/boot/Image ../uImage
>
> and then using bootm instead of booti works even without the above hack
> on the Vega S95. Not a satisfactory solution yet, but better than
> patching the kernel in a distro-incompatible way.

Thanks for sharing.  I can confirm this is working for me too.

Kevin

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-03-23 18:10 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-02  2:34 [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Andreas Färber
2016-03-02  2:34 ` [PATCH v2 1/6] ARM64: Enable Amlogic Meson GXBaby platform Andreas Färber
2016-03-02  2:34 ` [PATCH v2 2/6] devicetree: bindings: Add vendor prefix for Tronsmart Andreas Färber
2016-03-02  2:34 ` [PATCH v2 3/6] Documentation: devicetree: amlogic: Document Meson GXBaby Andreas Färber
2016-03-05  4:27   ` Rob Herring
2016-03-02  2:34 ` [PATCH v2 4/6] ARM64: dts: Prepare configs for Amlogic " Andreas Färber
2016-03-02  2:35 ` [PATCH v2 5/6] Documentation: devicetree: amlogic: Document Tronsmart Vega S95 boards Andreas Färber
2016-03-05  4:27   ` Rob Herring
2016-03-02  2:35 ` [PATCH v2 6/6] ARM64: dts: amlogic: Add Tronsmart Vega S95 configs Andreas Färber
2016-03-02 13:52 ` [PATCH v2 0/6] ARM64: meson: GXBaby (S905) and Vega S95 enablement Mark Rutland
2016-03-02 14:31   ` Andreas Färber
2016-03-02 15:17     ` Mark Rutland
2016-03-07  8:20 ` Carlo Caione
2016-03-21 22:36 ` Kevin Hilman
2016-03-22 20:29   ` Andreas Färber
2016-03-23  8:06     ` Carlo Caione
2016-03-23 18:10     ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).