[PATCH 1/1] dt-bindings: power: supply: add missing semi-colon in example

2019-03-28 Thread Sebastien Bourdelin
Fix the example documentation which is missing a semi-colon.

Signed-off-by: Sebastien Bourdelin 
---
 Documentation/devicetree/bindings/power/supply/gpio-charger.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/power/supply/gpio-charger.txt 
b/Documentation/devicetree/bindings/power/supply/gpio-charger.txt
index adbb5dc5b6e9..ddf7b7b971e1 100644
--- a/Documentation/devicetree/bindings/power/supply/gpio-charger.txt
+++ b/Documentation/devicetree/bindings/power/supply/gpio-charger.txt
@@ -20,7 +20,7 @@ Example:
compatible = "gpio-charger";
charger-type = "usb-sdp";
gpios = < 2 0 0 0>;
-   }
+   };
 
battery {
power-supplies = <_charger>;
-- 
2.20.1



Re: [PATCH v2 2/2] dt-bindings: iio: chemical: Add bindings for bme680

2019-01-21 Thread sebastien bourdelin



On 1/19/19 11:57 AM, Jonathan Cameron wrote:

On Mon, 14 Jan 2019 15:17:10 -0500
sebastien bourdelin  wrote:


On 1/12/19 1:28 PM, Jonathan Cameron wrote:

On Fri, 11 Jan 2019 15:53:59 -0500
Sebastien Bourdelin  wrote:
  

BME680 is a pressure/temperature/humidity/voc sensor.

Signed-off-by: Sebastien Bourdelin 

Hmm. We could add the VDD and VDIO regulators perhaps.
Driver assumes they are on currently but we'll get a board where control
is needed sooner or later.  I'm not that fussed about this though.

If that's fine with you, i prefer to leave it as it is right now as i
don't feel

confident enough to correctly explain it in the Documentation.

But if you have more input, you are more then welcome!

Given we aren't planning to do more than turn them on and that'll work
fine with stub regulators (so they can effectively be optional for ever),
there is no particular need to put them in now if you prefer not to.

Jonathan

Ok Thanks Jonathan!

Jonathan
  

---
   .../devicetree/bindings/iio/chemical/bme680.txt   | 11 +++
   1 file changed, 11 insertions(+)
   create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt

diff --git a/Documentation/devicetree/bindings/iio/chemical/bme680.txt 
b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
new file mode 100644
index ..885a1b918340
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
@@ -0,0 +1,11 @@
+Bosch Sensortec BME680 pressure/temperature/humidity/voc sensors
+
+Required properties:
+- compatible: must be "bosch,bme680"
+
+Example:
+
+bme680@77 {
+  compatible = "bosch,bme680";
+  reg = <0x77>;
+};


Re: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support

2019-01-16 Thread Sebastien Bourdelin

Hi Himanshu,

On 1/15/19 1:41 PM, Himanshu Jha wrote:

...
himanshu@himanshu-Vostro-3559:~/linux-next$ sudo make 
drivers/iio/chemical/bme680_spi.o
scripts/kconfig/conf  --syncconfig Kconfig
make[1]: Nothing to be done for 'all'.
HOSTCC  scripts/dtc/dtc.o
HOSTCC  scripts/dtc/flattree.o
HOSTCC  scripts/dtc/fstree.o
HOSTCC  scripts/dtc/data.o
HOSTCC  scripts/dtc/livetree.o
HOSTCC  scripts/dtc/treesource.o
HOSTCC  scripts/dtc/srcpos.o
HOSTCC  scripts/dtc/checks.o
HOSTCC  scripts/dtc/util.o
LEX scripts/dtc/dtc-lexer.lex.c
YACCscripts/dtc/dtc-parser.tab.h
HOSTCC  scripts/dtc/dtc-lexer.lex.o
YACCscripts/dtc/dtc-parser.tab.c
HOSTCC  scripts/dtc/dtc-parser.tab.o
HOSTLD  scripts/dtc/dtc
CC  scripts/mod/empty.o
MKELF   scripts/mod/elfconfig.h
HOSTCC  scripts/mod/modpost.o
CC  scripts/mod/devicetable-offsets.s
HOSTCC  scripts/mod/file2alias.o
HOSTCC  scripts/mod/sumversion.o
HOSTLD  scripts/mod/modpost
CC  kernel/bounds.s
CC  arch/x86/kernel/asm-offsets.s
CALLscripts/checksyscalls.sh
DESCEND  objtool
CC  drivers/iio/chemical/bme680_spi.o

Compiles without any issues.

Hum, weird it compiles actually :s

I think this behavior is observed due to:

include/linux/module.h +212

#ifdef MODULE
  /* Creates an alias so file2alias.c can find device table. */
  #define MODULE_DEVICE_TABLE(type, name) \
  extern typeof(name) __mod_##type##__##name##_device_table   \
__attribute__ ((unused, alias(__stringify(name
  #else  /* !MODULE */
  #define MODULE_DEVICE_TABLE(type, name)
  #endif

So, when we build the driver as a module[M] then macro expansion
takes place giving us the compiler warning.

OTOH, if the driver is built as builtin[*] then marco expands
to nothing or simply goes away. And `;' completes the struct
declaration while silencing the warning.

  static const struct of_device_id bme680_of_spi_match[] = {
  { .compatible = "bosch,bme680", },
  {},
  }
  MODULE_DEVICE_TABLE(of, bme680_of_spi_match);

converts to:

  static const struct of_device_id bme680_of_spi_match[] = {
  { .compatible = "bosch,bme680", },
  {},
  }
 ;
^^^ 

Amazing!
Correct me if I'm wrong somewhere, took me 2 hours to figure
that out :D


Ahah, nice!

Thanks a lot for the explanation!


Also, I some additional interesting observations:

When buitin[*] ->  no symbol tables in the RO segment of object file

himanshu@himanshu-Vostro-3559:~/linux-next$ nm drivers/iio/chemical/bme680_spi.o
 d __addressable_bme680_spi_driver_init130
01a0 r bme680_acpi_match
  U bme680_core_probe
 r bme680_of_spi_match
00a0 d bme680_regmap_bus
  U bme680_regmap_config
 t bme680_regmap_spi_read
0010 t bme680_regmap_spi_write
 d bme680_spi_driver
 t bme680_spi_driver_exit
 t bme680_spi_driver_init
01e0 r bme680_spi_id
0070 t bme680_spi_probe
  U _dev_err
  U __devm_regmap_init
  U driver_unregister
 d __exitcall_bme680_spi_driver_exit
 t __initcall_bme680_spi_driver_init6
  U regmap_read
  U regmap_update_bits_base
  U regmap_write
  U spi_get_device_id
  U __spi_register_driver
  U spi_setup
  U spi_write_then_read
  U __stack_chk_fail


While when [M] -> we can see the symbol tables in the RO segment

himanshu@himanshu-Vostro-3559:~/linux-next$ nm drivers/iio/chemical/bme680_spi.o
01a0 r bme680_acpi_match
  U bme680_core_probe
 r bme680_of_spi_match
00a0 d bme680_regmap_bus
  U bme680_regmap_config
 t bme680_regmap_spi_read
0010 t bme680_regmap_spi_write
 d bme680_spi_driver
 t bme680_spi_driver_exit
 t bme680_spi_driver_init
01e0 r bme680_spi_id
0070 t bme680_spi_probe
 T cleanup_module
  U _dev_err
  U __devm_regmap_init
  U driver_unregister
 T init_module
01a0 R __mod_acpi__bme680_acpi_match_device_table   <---
 R __mod_of__bme680_of_spi_match_device_table   <---
01e0 R __mod_spi__bme680_spi_id_device_table<---
  U regmap_read
  U regmap_update_bits_base
  U regmap_write
  U spi_get_device_id
  U __spi_register_driver
  U spi_setup
  U spi_write_then_read
  

[PATCH v3 1/2] iio: chemical: bme680: Add device-tree support

2019-01-14 Thread Sebastien Bourdelin
This commit allow the driver to work with device-tree.

Signed-off-by: Sebastien Bourdelin 
---
v2 -> v3:
  - remove of_match_ptr: Suggested by Jonathan Cameron 
  - minor style fixup
  - rebase on master
v1 -> v2:
  - add missing of.h header in bme680_spi.c
---
 drivers/iio/chemical/bme680_i2c.c | 7 +++
 drivers/iio/chemical/bme680_spi.c | 8 
 2 files changed, 15 insertions(+)

diff --git a/drivers/iio/chemical/bme680_i2c.c 
b/drivers/iio/chemical/bme680_i2c.c
index 06d4be539d2e..b2f805b6b36a 100644
--- a/drivers/iio/chemical/bme680_i2c.c
+++ b/drivers/iio/chemical/bme680_i2c.c
@@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
 
+static const struct of_device_id bme680_of_i2c_match[] = {
+   { .compatible = "bosch,bme680", },
+   {},
+};
+MODULE_DEVICE_TABLE(of, bme680_of_i2c_match);
+
 static struct i2c_driver bme680_i2c_driver = {
.driver = {
.name   = "bme680_i2c",
.acpi_match_table   = ACPI_PTR(bme680_acpi_match),
+   .of_match_table = bme680_of_i2c_match,
},
.probe = bme680_i2c_probe,
.id_table = bme680_i2c_id,
diff --git a/drivers/iio/chemical/bme680_spi.c 
b/drivers/iio/chemical/bme680_spi.c
index c9fb05e8d0b9..d0b7bdd3f066 100644
--- a/drivers/iio/chemical/bme680_spi.c
+++ b/drivers/iio/chemical/bme680_spi.c
@@ -6,6 +6,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -110,10 +111,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
 
+static const struct of_device_id bme680_of_spi_match[] = {
+   { .compatible = "bosch,bme680", },
+   {},
+};
+MODULE_DEVICE_TABLE(of, bme680_of_spi_match);
+
 static struct spi_driver bme680_spi_driver = {
.driver = {
.name   = "bme680_spi",
.acpi_match_table   = ACPI_PTR(bme680_acpi_match),
+   .of_match_table = bme680_of_spi_match,
},
.probe = bme680_spi_probe,
.id_table = bme680_spi_id,
-- 
2.20.1



[PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680

2019-01-14 Thread Sebastien Bourdelin
BME680 is a pressure/temperature/humidity/voc sensor.

Signed-off-by: Sebastien Bourdelin 
---
v2 -> v3:
  - change i2c address to 0x76 as it seems more reliable: Suggested by Himanshu 
Jha 
  - rebase on master
---
 .../devicetree/bindings/iio/chemical/bme680.txt   | 11 +++
 1 file changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt

diff --git a/Documentation/devicetree/bindings/iio/chemical/bme680.txt 
b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
new file mode 100644
index ..7f3827cfb2ff
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
@@ -0,0 +1,11 @@
+Bosch Sensortec BME680 pressure/temperature/humidity/voc sensors
+
+Required properties:
+- compatible: must be "bosch,bme680"
+
+Example:
+
+bme680@76 {
+  compatible = "bosch,bme680";
+  reg = <0x76>;
+};
-- 
2.20.1



Re: [PATCH v2 2/2] dt-bindings: iio: chemical: Add bindings for bme680

2019-01-14 Thread sebastien bourdelin



On 1/12/19 1:28 PM, Jonathan Cameron wrote:

On Fri, 11 Jan 2019 15:53:59 -0500
Sebastien Bourdelin  wrote:


BME680 is a pressure/temperature/humidity/voc sensor.

Signed-off-by: Sebastien Bourdelin 

Hmm. We could add the VDD and VDIO regulators perhaps.
Driver assumes they are on currently but we'll get a board where control
is needed sooner or later.  I'm not that fussed about this though.


If that's fine with you, i prefer to leave it as it is right now as i 
don't feel


confident enough to correctly explain it in the Documentation.

But if you have more input, you are more then welcome!


Jonathan


---
  .../devicetree/bindings/iio/chemical/bme680.txt   | 11 +++
  1 file changed, 11 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt

diff --git a/Documentation/devicetree/bindings/iio/chemical/bme680.txt 
b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
new file mode 100644
index ..885a1b918340
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
@@ -0,0 +1,11 @@
+Bosch Sensortec BME680 pressure/temperature/humidity/voc sensors
+
+Required properties:
+- compatible: must be "bosch,bme680"
+
+Example:
+
+bme680@77 {
+  compatible = "bosch,bme680";
+  reg = <0x77>;
+};


Re: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support

2019-01-14 Thread sebastien bourdelin

Hi,

On 1/12/19 1:22 PM, Jonathan Cameron wrote:

On Fri, 11 Jan 2019 15:53:58 -0500
Sebastien Bourdelin  wrote:


This commit allow the driver to work with device-tree.

Signed-off-by: Sebastien Bourdelin 

Minor stuff inline.

J

---
v1 -> v2:
   - add missing of.h header in bme680_spi.c
---
  drivers/iio/chemical/bme680_i2c.c | 7 +++
  drivers/iio/chemical/bme680_spi.c | 9 +
  2 files changed, 16 insertions(+)

diff --git a/drivers/iio/chemical/bme680_i2c.c 
b/drivers/iio/chemical/bme680_i2c.c
index 06d4be539d2e..94a36ebdf0b2 100644
--- a/drivers/iio/chemical/bme680_i2c.c
+++ b/drivers/iio/chemical/bme680_i2c.c
@@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
  };
  MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
  
+static const struct of_device_id bme680_of_i2c_match[] = {

+   { .compatible = "bosch,bme680", },
+   {},
+}
+MODULE_DEVICE_TABLE(of, bme680_of_i2c_match);
+
  static struct i2c_driver bme680_i2c_driver = {
.driver = {
.name   = "bme680_i2c",
.acpi_match_table   = ACPI_PTR(bme680_acpi_match),
+   .of_match_table = of_match_ptr(bme680_of_i2c_match),

As below. just = bme680...

Got it, thanks!



},
.probe = bme680_i2c_probe,
.id_table = bme680_i2c_id,
diff --git a/drivers/iio/chemical/bme680_spi.c 
b/drivers/iio/chemical/bme680_spi.c
index c9fb05e8d0b9..caa57287a911 100644
--- a/drivers/iio/chemical/bme680_spi.c
+++ b/drivers/iio/chemical/bme680_spi.c
@@ -6,9 +6,11 @@
   */
  #include 
  #include 
+#include 
  #include 
  #include 
  
+

This white space change should not be here.

My bad.

  #include "bme680.h"
  
  static int bme680_regmap_spi_write(void *context, const void *data,

@@ -110,10 +112,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
  };
  MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
  
+static const struct of_device_id bme680_of_spi_match[] = {

+   { .compatible = "bosch,bme680", },
+   {},
+}
+MODULE_DEVICE_TABLE(of, bme680_of_spi_match);
+
  static struct spi_driver bme680_spi_driver = {
.driver = {
.name   = "bme680_spi",
.acpi_match_table   = ACPI_PTR(bme680_acpi_match),
+   .of_match_table = of_match_ptr(bme680_of_spi_match),

Please don't use of_match_ptr.  We actually want this entry to be there even
if devicetree is not in use.  This is because there is a magic ACPI hid
that can use this table even from ACPI.


Sure.

},
.probe = bme680_spi_probe,
.id_table = bme680_spi_id,


Re: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support

2019-01-14 Thread sebastien bourdelin

Hi,

On 1/12/19 4:42 AM, Himanshu Jha wrote:

On Fri, Jan 11, 2019 at 03:53:58PM -0500, Sebastien Bourdelin wrote:

This commit allow the driver to work with device-tree.

Signed-off-by: Sebastien Bourdelin 
---

I get the following compilation failure:

Below I have `allyesconfig` except 'BME680' configure as [M]
in case you wish to reproduce.

himanshu@himanshu-Vostro-3559:~/linux-next$ grep -i -w 
'CONFIG_BME680\|CONFIG_ACPI\|CONFIG_OF' .config
CONFIG_ACPI=y
CONFIG_OF=y
CONFIG_BME680=m
himanshu@himanshu-Vostro-3559:~/linux-next$ sudo make 
drivers/iio/chemical/bme680_spi.o
make[1]: Nothing to be done for 'all'.
   CALLscripts/checksyscalls.sh
   DESCEND  objtool
   CC [M]  drivers/iio/chemical/bme680_spi.o
In file included from ./include/linux/acpi.h:41:0,
  from drivers/iio/chemical/bme680_spi.c:7:
./include/linux/module.h:213:1: error: expected ‘,’ or ‘;’ before ‘extern’
  extern typeof(name) __mod_##type##__##name##_device_table  \
  ^
drivers/iio/chemical/bme680_spi.c:119:1: note: in expansion of macro 
‘MODULE_DEVICE_TABLE’
  MODULE_DEVICE_TABLE(of, bme680_of_spi_match);
  ^~~
scripts/Makefile.build:291: recipe for target 
'drivers/iio/chemical/bme680_spi.o' failed
make[1]: *** [drivers/iio/chemical/bme680_spi.o] Error 1
Makefile:1741: recipe for target 'drivers/iio/chemical/bme680_spi.o' failed
make: *** [drivers/iio/chemical/bme680_spi.o] Error 2

Thanks for the test, this is bad, i will fix that!

BUT if:

himanshu@himanshu-Vostro-3559:~/linux-next$ make allyesconfig
scripts/kconfig/conf  --allyesconfig Kconfig
#
# configuration written to .config
#

himanshu@himanshu-Vostro-3559:~/linux-next$ sudo make 
drivers/iio/chemical/bme680_spi.o
scripts/kconfig/conf  --syncconfig Kconfig
make[1]: Nothing to be done for 'all'.
   HOSTCC  scripts/dtc/dtc.o
   HOSTCC  scripts/dtc/flattree.o
   HOSTCC  scripts/dtc/fstree.o
   HOSTCC  scripts/dtc/data.o
   HOSTCC  scripts/dtc/livetree.o
   HOSTCC  scripts/dtc/treesource.o
   HOSTCC  scripts/dtc/srcpos.o
   HOSTCC  scripts/dtc/checks.o
   HOSTCC  scripts/dtc/util.o
   LEX scripts/dtc/dtc-lexer.lex.c
   YACCscripts/dtc/dtc-parser.tab.h
   HOSTCC  scripts/dtc/dtc-lexer.lex.o
   YACCscripts/dtc/dtc-parser.tab.c
   HOSTCC  scripts/dtc/dtc-parser.tab.o
   HOSTLD  scripts/dtc/dtc
   CC  scripts/mod/empty.o
   MKELF   scripts/mod/elfconfig.h
   HOSTCC  scripts/mod/modpost.o
   CC  scripts/mod/devicetable-offsets.s
   HOSTCC  scripts/mod/file2alias.o
   HOSTCC  scripts/mod/sumversion.o
   HOSTLD  scripts/mod/modpost
   CC  kernel/bounds.s
   CC  arch/x86/kernel/asm-offsets.s
   CALLscripts/checksyscalls.sh
   DESCEND  objtool
   CC  drivers/iio/chemical/bme680_spi.o

Compiles without any issues.

Hum, weird it compiles actually :s

Also, wondering when is 0x77 i2c address used, since I tested
this on 3 different boards with 0x76(when SDO is connected to GND)

And why do I connect SDO to ground everytime ?
It is because if SDO pin is left floating then I2C address will be
undefined as said in datasheet + I have observed this while testing.


Ah, thanks for the reminder, actually i have only tested with a floating

SDO, but i will probably use the GND instead even if i didn't had any

problem right now.


Actallly, I don't understand what "VDIDO" is, as explained in the
datasheet.


Anyway, if the above compilation issue is not a problem, then

Acked-by: Himanshu Jha 


Thanks


[PATCH v2 1/2] iio: chemical: bme680: Add device-tree support

2019-01-11 Thread Sebastien Bourdelin
This commit allow the driver to work with device-tree.

Signed-off-by: Sebastien Bourdelin 
---
v1 -> v2:
  - add missing of.h header in bme680_spi.c
---
 drivers/iio/chemical/bme680_i2c.c | 7 +++
 drivers/iio/chemical/bme680_spi.c | 9 +
 2 files changed, 16 insertions(+)

diff --git a/drivers/iio/chemical/bme680_i2c.c 
b/drivers/iio/chemical/bme680_i2c.c
index 06d4be539d2e..94a36ebdf0b2 100644
--- a/drivers/iio/chemical/bme680_i2c.c
+++ b/drivers/iio/chemical/bme680_i2c.c
@@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
 
+static const struct of_device_id bme680_of_i2c_match[] = {
+   { .compatible = "bosch,bme680", },
+   {},
+}
+MODULE_DEVICE_TABLE(of, bme680_of_i2c_match);
+
 static struct i2c_driver bme680_i2c_driver = {
.driver = {
.name   = "bme680_i2c",
.acpi_match_table   = ACPI_PTR(bme680_acpi_match),
+   .of_match_table = of_match_ptr(bme680_of_i2c_match),
},
.probe = bme680_i2c_probe,
.id_table = bme680_i2c_id,
diff --git a/drivers/iio/chemical/bme680_spi.c 
b/drivers/iio/chemical/bme680_spi.c
index c9fb05e8d0b9..caa57287a911 100644
--- a/drivers/iio/chemical/bme680_spi.c
+++ b/drivers/iio/chemical/bme680_spi.c
@@ -6,9 +6,11 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 
+
 #include "bme680.h"
 
 static int bme680_regmap_spi_write(void *context, const void *data,
@@ -110,10 +112,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
 
+static const struct of_device_id bme680_of_spi_match[] = {
+   { .compatible = "bosch,bme680", },
+   {},
+}
+MODULE_DEVICE_TABLE(of, bme680_of_spi_match);
+
 static struct spi_driver bme680_spi_driver = {
.driver = {
.name   = "bme680_spi",
.acpi_match_table   = ACPI_PTR(bme680_acpi_match),
+   .of_match_table = of_match_ptr(bme680_of_spi_match),
},
.probe = bme680_spi_probe,
.id_table = bme680_spi_id,
-- 
2.20.1



[PATCH v2 2/2] dt-bindings: iio: chemical: Add bindings for bme680

2019-01-11 Thread Sebastien Bourdelin
BME680 is a pressure/temperature/humidity/voc sensor.

Signed-off-by: Sebastien Bourdelin 
---
 .../devicetree/bindings/iio/chemical/bme680.txt   | 11 +++
 1 file changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt

diff --git a/Documentation/devicetree/bindings/iio/chemical/bme680.txt 
b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
new file mode 100644
index ..885a1b918340
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
@@ -0,0 +1,11 @@
+Bosch Sensortec BME680 pressure/temperature/humidity/voc sensors
+
+Required properties:
+- compatible: must be "bosch,bme680"
+
+Example:
+
+bme680@77 {
+  compatible = "bosch,bme680";
+  reg = <0x77>;
+};
-- 
2.20.1



[PATCH 1/2] iio: chemical: bme680: Add device-tree support

2019-01-11 Thread Sebastien Bourdelin
This commit allow the driver to work with device-tree.

Signed-off-by: Sebastien Bourdelin 
---
 drivers/iio/chemical/bme680_i2c.c | 7 +++
 drivers/iio/chemical/bme680_spi.c | 7 +++
 2 files changed, 14 insertions(+)

diff --git a/drivers/iio/chemical/bme680_i2c.c 
b/drivers/iio/chemical/bme680_i2c.c
index 06d4be539d2e..94a36ebdf0b2 100644
--- a/drivers/iio/chemical/bme680_i2c.c
+++ b/drivers/iio/chemical/bme680_i2c.c
@@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
 
+static const struct of_device_id bme680_of_i2c_match[] = {
+   { .compatible = "bosch,bme680", },
+   {},
+}
+MODULE_DEVICE_TABLE(of, bme680_of_i2c_match);
+
 static struct i2c_driver bme680_i2c_driver = {
.driver = {
.name   = "bme680_i2c",
.acpi_match_table   = ACPI_PTR(bme680_acpi_match),
+   .of_match_table = of_match_ptr(bme680_of_i2c_match),
},
.probe = bme680_i2c_probe,
.id_table = bme680_i2c_id,
diff --git a/drivers/iio/chemical/bme680_spi.c 
b/drivers/iio/chemical/bme680_spi.c
index c9fb05e8d0b9..45bd4e93a891 100644
--- a/drivers/iio/chemical/bme680_spi.c
+++ b/drivers/iio/chemical/bme680_spi.c
@@ -110,10 +110,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
 
+static const struct of_device_id bme680_of_spi_match[] = {
+   { .compatible = "bosch,bme680", },
+   {},
+}
+MODULE_DEVICE_TABLE(of, bme680_of_spi_match);
+
 static struct spi_driver bme680_spi_driver = {
.driver = {
.name   = "bme680_spi",
.acpi_match_table   = ACPI_PTR(bme680_acpi_match),
+   .of_match_table = of_match_ptr(bme680_of_spi_match),
},
.probe = bme680_spi_probe,
.id_table = bme680_spi_id,
-- 
2.20.1



[PATCH 2/2] dt-bindings: iio: chemical: Add bindings for bme680

2019-01-11 Thread Sebastien Bourdelin
BME680 is a pressure/temperature/humidity/voc sensor.

Signed-off-by: Sebastien Bourdelin 
---
 .../devicetree/bindings/iio/chemical/bme680.txt   | 11 +++
 1 file changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt

diff --git a/Documentation/devicetree/bindings/iio/chemical/bme680.txt 
b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
new file mode 100644
index ..885a1b918340
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
@@ -0,0 +1,11 @@
+Bosch Sensortec BME680 pressure/temperature/humidity/voc sensors
+
+Required properties:
+- compatible: must be "bosch,bme680"
+
+Example:
+
+bme680@77 {
+  compatible = "bosch,bme680";
+  reg = <0x77>;
+};
-- 
2.20.1



[PATCH v9 2/2] ARM: dts: TS-4600: add basic device tree

2017-12-07 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v8 -> v9:
  - rebase on master
  - fix gpio active direction (suggested by Fabio Estevam)

Changes v7 -> v8:
  - rebase on master
  - merge the rev A and B into one device tree based on the last rev B
  because only the memory size change between the two rev currently
  (suggested by Shawn Guo)

Changes v6 -> v7:
  - rebase on master
  - remove unneeded pinctrl-name (suggested by Shawn Guo)
  - add reg to the node en-sd-pwr (suggested by Shawn Guo)
  - use define for gpio polarity (suggested by Shawn Guo)
  - remove the fake bus container for regulator (suggested by Shawn Guo)

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  1 +
 arch/arm/boot/dts/imx28-ts4600.dts | 79 ++
 2 files changed, 80 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..678373d299d8 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -558,6 +558,7 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600.dts 
b/arch/arm/boot/dts/imx28-ts4600.dts
new file mode 100644
index ..1e391c9f1b7a
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600.dts
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   model = "Technologic Systems i.MX28 TS-4600";
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   memory {
+   reg = <0x4000 0x1000>;   /* 256MB */
+   };
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+
+   en_sd_pwr: en-sd-pwr@0 {
+   reg = <0>;
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   reg_vddio_sd0: regulator-vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 GPIO_ACTIVE_LOW>;
+   };
+
+};
-- 
2.15.0



[PATCH v9 2/2] ARM: dts: TS-4600: add basic device tree

2017-12-07 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin 
---
Changes v8 -> v9:
  - rebase on master
  - fix gpio active direction (suggested by Fabio Estevam)

Changes v7 -> v8:
  - rebase on master
  - merge the rev A and B into one device tree based on the last rev B
  because only the memory size change between the two rev currently
  (suggested by Shawn Guo)

Changes v6 -> v7:
  - rebase on master
  - remove unneeded pinctrl-name (suggested by Shawn Guo)
  - add reg to the node en-sd-pwr (suggested by Shawn Guo)
  - use define for gpio polarity (suggested by Shawn Guo)
  - remove the fake bus container for regulator (suggested by Shawn Guo)

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  1 +
 arch/arm/boot/dts/imx28-ts4600.dts | 79 ++
 2 files changed, 80 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..678373d299d8 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -558,6 +558,7 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600.dts 
b/arch/arm/boot/dts/imx28-ts4600.dts
new file mode 100644
index ..1e391c9f1b7a
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600.dts
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   model = "Technologic Systems i.MX28 TS-4600";
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   memory {
+   reg = <0x4000 0x1000>;   /* 256MB */
+   };
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+
+   en_sd_pwr: en-sd-pwr@0 {
+   reg = <0>;
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   reg_vddio_sd0: regulator-vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 GPIO_ACTIVE_LOW>;
+   };
+
+};
-- 
2.15.0



[PATCH v9 1/2] of: documentation: add bindings documentation for TS-4600

2017-12-07 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
Acked-by: Rob Herring <r...@kernel.org>
---
Changes v8 -> v9:
  - rebase on master

Changes v7 -> v8:
  - rebase on master

Changes v6 -> v7:
  - rebase on master

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring <r...@kernel.org>
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.15.0



[PATCH v9 1/2] of: documentation: add bindings documentation for TS-4600

2017-12-07 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
Acked-by: Rob Herring 
---
Changes v8 -> v9:
  - rebase on master

Changes v7 -> v8:
  - rebase on master

Changes v6 -> v7:
  - rebase on master

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring 
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.15.0



Re: [PATCH v8 2/2] ARM: dts: TS-4600: add basic device tree

2017-12-07 Thread Sebastien Bourdelin
Hi Fabio

On 11/26/2017 02:39 PM, Fabio Estevam wrote:
> Hi Sebastien,
> 
> On Thu, Nov 23, 2017 at 7:04 PM, Sebastien Bourdelin
> <sebastien.bourde...@savoirfairelinux.com> wrote:
> 
>> +   reg_vddio_sd0: regulator-vddio-sd0 {
>> +   compatible = "regulator-fixed";
>> +   regulator-name = "vddio-sd0";
>> +   regulator-min-microvolt = <330>;
>> +   regulator-max-microvolt = <330>;
>> +   regulator-boot-on;
>> +   gpio = < 28 GPIO_ACTIVE_HIGH>;
> 
> It seems this should be GPIO_ACTIVE_LOW instead, as you don't pass
> 'enable-active-high' here.
> 

Yes! you are right, thanks for the catch!

Regards,
Sebastien.


Re: [PATCH v8 2/2] ARM: dts: TS-4600: add basic device tree

2017-12-07 Thread Sebastien Bourdelin
Hi Fabio

On 11/26/2017 02:39 PM, Fabio Estevam wrote:
> Hi Sebastien,
> 
> On Thu, Nov 23, 2017 at 7:04 PM, Sebastien Bourdelin
>  wrote:
> 
>> +   reg_vddio_sd0: regulator-vddio-sd0 {
>> +   compatible = "regulator-fixed";
>> +   regulator-name = "vddio-sd0";
>> +   regulator-min-microvolt = <330>;
>> +   regulator-max-microvolt = <330>;
>> +   regulator-boot-on;
>> +   gpio = < 28 GPIO_ACTIVE_HIGH>;
> 
> It seems this should be GPIO_ACTIVE_LOW instead, as you don't pass
> 'enable-active-high' here.
> 

Yes! you are right, thanks for the catch!

Regards,
Sebastien.


[PATCH v4 2/2] ARM: dts: TS-7970: add basic device tree

2017-12-07 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v3 -> v4:
  - rebase on master
  - comestic changes (suggested by Shawn Guo)

Changes v2 -> v3:
  - fix typo in imx6q-ts7970.dts (suggested by Fabio Estevam)
  - add enable-active-high on regulator (suggested by Fabio Estevam)
  - rework the interrupts-extended option in fec and add the
  fsl,err006687 workaround (suggested by Fabio Estevam)
  - remove the reset-gpio option in the pcie node as i can't confirm the
  value right now

Changes v1 -> v2:
  - rebase on master
  - remove spidev devices (suggested by Fabio Estevam)
  - remove inexistant sata node on imx6dl-ts7970.dts
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  50 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 594 ++
 4 files changed, 700 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..d104daf305d9
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..f19e18995e68
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 fi

[PATCH v4 2/2] ARM: dts: TS-7970: add basic device tree

2017-12-07 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin 
---
Changes v3 -> v4:
  - rebase on master
  - comestic changes (suggested by Shawn Guo)

Changes v2 -> v3:
  - fix typo in imx6q-ts7970.dts (suggested by Fabio Estevam)
  - add enable-active-high on regulator (suggested by Fabio Estevam)
  - rework the interrupts-extended option in fec and add the
  fsl,err006687 workaround (suggested by Fabio Estevam)
  - remove the reset-gpio option in the pcie node as i can't confirm the
  value right now

Changes v1 -> v2:
  - rebase on master
  - remove spidev devices (suggested by Fabio Estevam)
  - remove inexistant sata node on imx6dl-ts7970.dts
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  50 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 594 ++
 4 files changed, 700 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..d104daf305d9
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..f19e18995e68
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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
+ * 

[PATCH v4 1/2] of: documentation: add bindings documentation for TS-7970

2017-12-07 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v3 -> v4:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



[PATCH v4 1/2] of: documentation: add bindings documentation for TS-7970

2017-12-07 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
---
Changes v3 -> v4:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



[PATCH v4 2/2] ARM: dts: TS-7970: add basic device tree

2017-12-07 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v3 -> v4:
  - rebase on master
  - comestic changes (suggested by Shawn Guo)

Changes v2 -> v3:
  - fix typo in imx6q-ts7970.dts (suggested by Fabio Estevam)
  - add enable-active-high on regulator (suggested by Fabio Estevam)
  - rework the interrupts-extended option in fec and add the
  fsl,err006687 workaround (suggested by Fabio Estevam)
  - remove the reset-gpio option in the pcie node as i can't confirm the
  value right now

Changes v1 -> v2:
  - rebase on master
  - remove spidev devices (suggested by Fabio Estevam)
  - remove inexistant sata node on imx6dl-ts7970.dts
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  50 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 594 ++
 4 files changed, 700 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..d104daf305d9
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..f19e18995e68
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 fi

[PATCH v4 2/2] ARM: dts: TS-7970: add basic device tree

2017-12-07 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin 
---
Changes v3 -> v4:
  - rebase on master
  - comestic changes (suggested by Shawn Guo)

Changes v2 -> v3:
  - fix typo in imx6q-ts7970.dts (suggested by Fabio Estevam)
  - add enable-active-high on regulator (suggested by Fabio Estevam)
  - rework the interrupts-extended option in fec and add the
  fsl,err006687 workaround (suggested by Fabio Estevam)
  - remove the reset-gpio option in the pcie node as i can't confirm the
  value right now

Changes v1 -> v2:
  - rebase on master
  - remove spidev devices (suggested by Fabio Estevam)
  - remove inexistant sata node on imx6dl-ts7970.dts
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  50 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 594 ++
 4 files changed, 700 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..d104daf305d9
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..f19e18995e68
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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
+ * 

[PATCH v4 1/2] of: documentation: add bindings documentation for TS-7970

2017-12-07 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v3 -> v4:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



[PATCH v4 1/2] of: documentation: add bindings documentation for TS-7970

2017-12-07 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
---
Changes v3 -> v4:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



[PATCH v8 2/2] ARM: dts: TS-4600: add basic device tree

2017-11-23 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v7 -> v8:
  - rebase on master
  - merge the rev A and B into one device tree based on the last rev B
  because only the memory size change between the two rev currently
  (suggested by Shawn Guo)

Changes v6 -> v7:
  - rebase on master
  - remove unneeded pinctrl-name (suggested by Shawn Guo)
  - add reg to the node en-sd-pwr (suggested by Shawn Guo)
  - use define for gpio polarity (suggested by Shawn Guo)
  - remove the fake bus container for regulator (suggested by Shawn Guo)

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  1 +
 arch/arm/boot/dts/imx28-ts4600.dts | 79 ++
 2 files changed, 80 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..678373d299d8 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -558,6 +558,7 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600.dts 
b/arch/arm/boot/dts/imx28-ts4600.dts
new file mode 100644
index ..f37d81381620
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600.dts
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   model = "Technologic Systems i.MX28 TS-4600";
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   memory {
+   reg = <0x4000 0x1000>;   /* 256MB */
+   };
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+
+   en_sd_pwr: en-sd-pwr@0 {
+   reg = <0>;
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   reg_vddio_sd0: regulator-vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 GPIO_ACTIVE_HIGH>;
+   };
+
+};
-- 
2.15.0



[PATCH v8 2/2] ARM: dts: TS-4600: add basic device tree

2017-11-23 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin 
---
Changes v7 -> v8:
  - rebase on master
  - merge the rev A and B into one device tree based on the last rev B
  because only the memory size change between the two rev currently
  (suggested by Shawn Guo)

Changes v6 -> v7:
  - rebase on master
  - remove unneeded pinctrl-name (suggested by Shawn Guo)
  - add reg to the node en-sd-pwr (suggested by Shawn Guo)
  - use define for gpio polarity (suggested by Shawn Guo)
  - remove the fake bus container for regulator (suggested by Shawn Guo)

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  1 +
 arch/arm/boot/dts/imx28-ts4600.dts | 79 ++
 2 files changed, 80 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..678373d299d8 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -558,6 +558,7 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600.dts 
b/arch/arm/boot/dts/imx28-ts4600.dts
new file mode 100644
index ..f37d81381620
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600.dts
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   model = "Technologic Systems i.MX28 TS-4600";
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   memory {
+   reg = <0x4000 0x1000>;   /* 256MB */
+   };
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+
+   en_sd_pwr: en-sd-pwr@0 {
+   reg = <0>;
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   reg_vddio_sd0: regulator-vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 GPIO_ACTIVE_HIGH>;
+   };
+
+};
-- 
2.15.0



[PATCH v8 1/2] of: documentation: add bindings documentation for TS-4600

2017-11-23 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
Acked-by: Rob Herring <r...@kernel.org>
---
Changes v7 -> v8:
  - rebase on master

Changes v6 -> v7:
  - rebase on master

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring <r...@kernel.org>
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.15.0



[PATCH v8 1/2] of: documentation: add bindings documentation for TS-4600

2017-11-23 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
Acked-by: Rob Herring 
---
Changes v7 -> v8:
  - rebase on master

Changes v6 -> v7:
  - rebase on master

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring 
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.15.0



[PATCH v3 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-23 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v2 -> v3:
  - fix typo in imx6q-ts7970.dts (suggested by Fabio Estevam)
  - add enable-active-high on regulator (suggested by Fabio Estevam)
  - rework the interrupts-extended option in fec and add the
  fsl,err006687 workaround (suggested by Fabio Estevam)
  - remove the reset-gpio option in the pcie node as i can't confirm the
  value right now

Changes v1 -> v2:
  - rebase on master
  - remove spidev devices (suggested by Fabio Estevam)
  - remove inexistant sata node on imx6dl-ts7970.dts
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  50 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 594 ++
 4 files changed, 700 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..d104daf305d9
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..f19e18995e68
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 

[PATCH v3 1/2] of: documentation: add bindings documentation for TS-7970

2017-11-23 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v1 -> v2:
  - rebase on master
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



[PATCH v3 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-23 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin 
---
Changes v2 -> v3:
  - fix typo in imx6q-ts7970.dts (suggested by Fabio Estevam)
  - add enable-active-high on regulator (suggested by Fabio Estevam)
  - rework the interrupts-extended option in fec and add the
  fsl,err006687 workaround (suggested by Fabio Estevam)
  - remove the reset-gpio option in the pcie node as i can't confirm the
  value right now

Changes v1 -> v2:
  - rebase on master
  - remove spidev devices (suggested by Fabio Estevam)
  - remove inexistant sata node on imx6dl-ts7970.dts
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  50 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 594 ++
 4 files changed, 700 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..d104daf305d9
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..f19e18995e68
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 pub

[PATCH v3 1/2] of: documentation: add bindings documentation for TS-7970

2017-11-23 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
---
Changes v1 -> v2:
  - rebase on master
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



Re: [PATCH v2 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-23 Thread Sebastien Bourdelin
Hi Fabio,

On 11/22/2017 03:48 PM, Fabio Estevam wrote:
> On Wed, Nov 22, 2017 at 6:32 PM, Sebastien Bourdelin
> <sebastien.bourde...@savoirfairelinux.com> wrote:
> 
>> +/dts-v1/;
>> +#include "imx6q.dtsi"
>> +#include "imx6qdl-ts7970.dtsi"
>> +
>> +/ {
>> +   model = "Technologic Systems i.MX6 Quad TS-7970 (Default Devuice 
>> Tree)";
> 
> Typo: Devuice--> Device
Thanks!
> 
>> +   reg_can1_3v3: reg_can1_3v3 {
>> +   compatible = "regulator-fixed";
>> +   regulator-name = "reg_can1_3v3";
>> +   regulator-min-microvolt = <330>;
>> +   regulator-max-microvolt = <330>;
>> +   gpio = < 21 GPIO_ACTIVE_HIGH>;
> 
> Are you sure this is GPIO_ACTIVE_HIGH?
> 
> If so, then it would need the 'enable-active-high' property.
Ok
> 
> 
>> +   };
>> +
>> +   reg_can2_3v3: en-reg_can2_3v3 {
>> +   compatible = "regulator-fixed";
>> +   regulator-name = "reg_can2_3v3";
>> +   regulator-min-microvolt = <330>;
>> +   regulator-max-microvolt = <330>;
>> +   gpio = < 31 GPIO_ACTIVE_HIGH>;
> 
> Same here.
Ok
> 
>> +
>> + {
>> +   pinctrl-names = "default";
>> +   pinctrl-0 = <_enet>;
>> +   interrupts-extended = < 6 0x04>, < 0 119 0x04>;
> 
> I think you meant to say:
> 
> interrupts-extended = < 6 IRQ_TYPE_LEVEL_HIGH>,
>   < 0 119 IRQ_TYPE_LEVEL_HIGH>;
> fsl,err006687-workaround-present;
Nice for the workaround, thanks!

> 
>> + {
>> +   reset-gpio = < 21 GPIO_ACTIVE_HIGH>;
> 
> Are you sure it is GPIO_ACTIVE_HIGH? if so, it would need a
> reset-gpio-active-high property.
> 
> Most likely this should be:
> 
> reset-gpio = < 21 GPIO_ACTIVE_LOW>;
> 
I have difficulties to verify this information, i will remove it unless
Mark Featherston can confirm it.

Thanks for your review Fabio!


Re: [PATCH v2 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-23 Thread Sebastien Bourdelin
Hi Fabio,

On 11/22/2017 03:48 PM, Fabio Estevam wrote:
> On Wed, Nov 22, 2017 at 6:32 PM, Sebastien Bourdelin
>  wrote:
> 
>> +/dts-v1/;
>> +#include "imx6q.dtsi"
>> +#include "imx6qdl-ts7970.dtsi"
>> +
>> +/ {
>> +   model = "Technologic Systems i.MX6 Quad TS-7970 (Default Devuice 
>> Tree)";
> 
> Typo: Devuice--> Device
Thanks!
> 
>> +   reg_can1_3v3: reg_can1_3v3 {
>> +   compatible = "regulator-fixed";
>> +   regulator-name = "reg_can1_3v3";
>> +   regulator-min-microvolt = <330>;
>> +   regulator-max-microvolt = <330>;
>> +   gpio = < 21 GPIO_ACTIVE_HIGH>;
> 
> Are you sure this is GPIO_ACTIVE_HIGH?
> 
> If so, then it would need the 'enable-active-high' property.
Ok
> 
> 
>> +   };
>> +
>> +   reg_can2_3v3: en-reg_can2_3v3 {
>> +   compatible = "regulator-fixed";
>> +   regulator-name = "reg_can2_3v3";
>> +   regulator-min-microvolt = <330>;
>> +   regulator-max-microvolt = <330>;
>> +   gpio = < 31 GPIO_ACTIVE_HIGH>;
> 
> Same here.
Ok
> 
>> +
>> + {
>> +   pinctrl-names = "default";
>> +   pinctrl-0 = <_enet>;
>> +   interrupts-extended = < 6 0x04>, < 0 119 0x04>;
> 
> I think you meant to say:
> 
> interrupts-extended = < 6 IRQ_TYPE_LEVEL_HIGH>,
>   < 0 119 IRQ_TYPE_LEVEL_HIGH>;
> fsl,err006687-workaround-present;
Nice for the workaround, thanks!

> 
>> + {
>> +   reset-gpio = < 21 GPIO_ACTIVE_HIGH>;
> 
> Are you sure it is GPIO_ACTIVE_HIGH? if so, it would need a
> reset-gpio-active-high property.
> 
> Most likely this should be:
> 
> reset-gpio = < 21 GPIO_ACTIVE_LOW>;
> 
I have difficulties to verify this information, i will remove it unless
Mark Featherston can confirm it.

Thanks for your review Fabio!


[PATCH v2 1/2] of: documentation: add bindings documentation for TS-7970

2017-11-22 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v1 -> v2:
  - rebase on master
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



[PATCH v2 1/2] of: documentation: add bindings documentation for TS-7970

2017-11-22 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
---
Changes v1 -> v2:
  - rebase on master
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



[PATCH v2 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-22 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v1 -> v2:
  - rebase on master
  - remove spidev devices (suggested by Fabio Estevam)
  - remove inexistant sata node on imx6dl-ts7970.dts
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  50 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 591 ++
 4 files changed, 697 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..d104daf305d9
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..afa74cecc1ec
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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.
+ *

[PATCH v2 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-22 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin 
---
Changes v1 -> v2:
  - rebase on master
  - remove spidev devices (suggested by Fabio Estevam)
  - remove inexistant sata node on imx6dl-ts7970.dts
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  50 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 591 ++
 4 files changed, 697 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..d104daf305d9
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..afa74cecc1ec
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 

Re: [PATCH 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-21 Thread Sebastien Bourdelin
Hi Fabio,

On 11/20/2017 06:37 PM, Fabio Estevam wrote:
> Hi Sebastien,
> 
> On Mon, Nov 20, 2017 at 7:15 PM, Sebastien Bourdelin
> <sebastien.bourde...@savoirfairelinux.com> wrote:
> 
>> + {
>> +   cs-gpios = <
>> +31 GPIO_ACTIVE_HIGH
>> +12 GPIO_ACTIVE_HIGH
>> +18 GPIO_ACTIVE_HIGH
>> +   >;
>> +   pinctrl-names = "default";
>> +   pinctrl-0 = <_ecspi2>;
>> +   status = "okay";
>> +
>> +   spidevfpga: spi@1 {
>> +   compatible = "spidev";
>> +   reg = <1>;
>> +   spi-max-frequency = <100>;
> 
> According to drivers/spi/spidev.c:
> 
> /*
> * spidev should never be referenced in DT without a specific
> * compatible string, it is a Linux implementation thing
> * rather than a description of the hardware.
> */
> 

Thanks, you are right!
Just to point it, this warning has been introduced in
956b200a846e324322f6211034c734c65a38e550 in date of march 2015, and it
seems some devices trees whom had been introduced after still use the
"spidev" string only.


Re: [PATCH 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-21 Thread Sebastien Bourdelin
Hi Fabio,

On 11/20/2017 06:37 PM, Fabio Estevam wrote:
> Hi Sebastien,
> 
> On Mon, Nov 20, 2017 at 7:15 PM, Sebastien Bourdelin
>  wrote:
> 
>> + {
>> +   cs-gpios = <
>> +31 GPIO_ACTIVE_HIGH
>> +12 GPIO_ACTIVE_HIGH
>> +18 GPIO_ACTIVE_HIGH
>> +   >;
>> +   pinctrl-names = "default";
>> +   pinctrl-0 = <_ecspi2>;
>> +   status = "okay";
>> +
>> +   spidevfpga: spi@1 {
>> +   compatible = "spidev";
>> +   reg = <1>;
>> +   spi-max-frequency = <100>;
> 
> According to drivers/spi/spidev.c:
> 
> /*
> * spidev should never be referenced in DT without a specific
> * compatible string, it is a Linux implementation thing
> * rather than a description of the hardware.
> */
> 

Thanks, you are right!
Just to point it, this warning has been introduced in
956b200a846e324322f6211034c734c65a38e550 in date of march 2015, and it
seems some devices trees whom had been introduced after still use the
"spidev" string only.


[PATCH 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-20 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  54 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 +++
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 603 ++
 4 files changed, 713 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..23f9caad2915
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..afa74cecc1ec
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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
+ * obtai

[PATCH 2/2] ARM: dts: TS-7970: add basic device tree

2017-11-20 Thread Sebastien Bourdelin
These device trees add support for TS-7970 by Technologic Systems.

More details here:
   https://wiki.embeddedarm.com/wiki/TS-7970

Signed-off-by: Sebastien Bourdelin 
---
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-ts7970.dts   |  54 +++
 arch/arm/boot/dts/imx6q-ts7970.dts|  54 +++
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 603 ++
 4 files changed, 713 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6q-ts7970.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ts7970.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d0381e9caf21..06d7724d5f70 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -396,6 +396,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-sabresd.dtb \
imx6dl-savageboard.dtb \
imx6dl-ts4900.dtb \
+   imx6dl-ts7970.dtb \
imx6dl-tx6dl-comtft.dtb \
imx6dl-tx6s-8034.dtb \
imx6dl-tx6s-8034-mb7.dtb \
@@ -459,6 +460,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-ts4900.dtb \
+   imx6q-ts7970.dtb \
imx6q-tx6q-1010.dtb \
imx6q-tx6q-1010-comtft.dtb \
imx6q-tx6q-1020.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts 
b/arch/arm/boot/dts/imx6dl-ts7970.dts
new file mode 100644
index ..23f9caad2915
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 "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 "imx6dl.dtsi"
+#include "imx6qdl-ts7970.dtsi"
+
+/ {
+   model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default 
Device Tree)";
+   compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
+};
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts 
b/arch/arm/boot/dts/imx6q-ts7970.dts
new file mode 100644
index ..afa74cecc1ec
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Technologic Systems
+ * Copyright 2017 Savoir-faire Linux
+ *
+ * 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 associat

[PATCH 1/2] of: documentation: add bindings documentation for TS-7970

2017-11-20 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



[PATCH 1/2] of: documentation: add bindings documentation for TS-7970

2017-11-20 Thread Sebastien Bourdelin
This adds the documentation for the TS-7970 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
---
 Documentation/devicetree/bindings/arm/technologic.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..187830bd4f51 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -10,3 +10,9 @@ It can be mounted on a carrier board providing additional 
peripheral connectors.
 Required root node properties:
- compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"
- compatible = "technologic,imx6q-ts4900", "fsl,imx6q"
+
+TS-7970 is a System-on-Module based on the Freescale i.MX6 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"
+   - compatible = "technologic,imx6q-ts7970", "fsl,imx6q"
-- 
2.15.0



Re: [PATCH v7 2/2] bus: add driver for the Technologic Systems NBUS

2017-11-02 Thread Sebastien Bourdelin

On 11/02/2017 11:57 AM, Linus Walleij wrote:
> On Thu, Nov 2, 2017 at 3:37 PM, Sebastien Bourdelin
> <sebastien.bourde...@savoirfairelinux.com> wrote:
> 
>>> BTW do you have a way upstream for this patch? ARM SoC?
>>
>> Honestly i have no idea, do you have a recommandation for this kind of
>> bus driver? should i re-submit just this patch to a specific tree?
> 
> If this is for an ARM system I would suggest that you just sent
> the patches to a...@kernel.org with CC to the linux-arm-kernel
> mailing list and ask the ARM SoC maintainers to apply them directly
> for the upstream kernel.
> 
Ok, i will, thanks again!

> Yours,
> Linus Walleij
> 

Best Regards,
Sebastien Bourdelin.


Re: [PATCH v7 2/2] bus: add driver for the Technologic Systems NBUS

2017-11-02 Thread Sebastien Bourdelin

On 11/02/2017 11:57 AM, Linus Walleij wrote:
> On Thu, Nov 2, 2017 at 3:37 PM, Sebastien Bourdelin
>  wrote:
> 
>>> BTW do you have a way upstream for this patch? ARM SoC?
>>
>> Honestly i have no idea, do you have a recommandation for this kind of
>> bus driver? should i re-submit just this patch to a specific tree?
> 
> If this is for an ARM system I would suggest that you just sent
> the patches to a...@kernel.org with CC to the linux-arm-kernel
> mailing list and ask the ARM SoC maintainers to apply them directly
> for the upstream kernel.
> 
Ok, i will, thanks again!

> Yours,
> Linus Walleij
> 

Best Regards,
Sebastien Bourdelin.


Re: [PATCH v7 2/2] bus: add driver for the Technologic Systems NBUS

2017-11-02 Thread Sebastien Bourdelin
Hi Linus,

On 11/02/2017 10:22 AM, Linus Walleij wrote:
> On Wed, Nov 1, 2017 at 6:14 PM, Sebastien Bourdelin
> <sebastien.bourde...@savoirfairelinux.com> wrote:
> 
>> This driver implements a GPIOs bit-banged bus, called the NBUS by
>> Technologic Systems. It is used to communicate with the peripherals in
>> the FPGA on the TS-4600 SoM.
>>
>> Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
>> Acked-by: Linus Walleij <linus.wall...@linaro.org>
> 
> This is still a very nice driver.

Thanks that's very kind and greatly appreciate.
> 
> If you are working on supplemental patches: from the next merge window
> we will have:
> 
> + int gpiod_get_array_value_cansleep(unsigned int array_size,
> +  struct gpio_desc **desc_array,
> +  int *value_array);
> 
> See:
> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/?h=devel=eec1d566cdf94b57e8f5ba9fe60eea214929bcfc
> 
> If your GPIO controller also has .get_multiple() implemented it just
> becomes one register read if you're lucky.
> 
Ok, i guess i will not if this is fine like that, i'll see if someone
suggested some changes.

> BTW do you have a way upstream for this patch? ARM SoC?
Honestly i have no idea, do you have a recommandation for this kind of
bus driver? should i re-submit just this patch to a specific tree?

> 
> Yours,
> Linus Walleij
> 

Thanks again for your inputs.

Best regards,
Sebastien Bourdelin.


Re: [PATCH v7 2/2] bus: add driver for the Technologic Systems NBUS

2017-11-02 Thread Sebastien Bourdelin
Hi Linus,

On 11/02/2017 10:22 AM, Linus Walleij wrote:
> On Wed, Nov 1, 2017 at 6:14 PM, Sebastien Bourdelin
>  wrote:
> 
>> This driver implements a GPIOs bit-banged bus, called the NBUS by
>> Technologic Systems. It is used to communicate with the peripherals in
>> the FPGA on the TS-4600 SoM.
>>
>> Signed-off-by: Sebastien Bourdelin 
>> Acked-by: Linus Walleij 
> 
> This is still a very nice driver.

Thanks that's very kind and greatly appreciate.
> 
> If you are working on supplemental patches: from the next merge window
> we will have:
> 
> + int gpiod_get_array_value_cansleep(unsigned int array_size,
> +  struct gpio_desc **desc_array,
> +  int *value_array);
> 
> See:
> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/?h=devel=eec1d566cdf94b57e8f5ba9fe60eea214929bcfc
> 
> If your GPIO controller also has .get_multiple() implemented it just
> becomes one register read if you're lucky.
> 
Ok, i guess i will not if this is fine like that, i'll see if someone
suggested some changes.

> BTW do you have a way upstream for this patch? ARM SoC?
Honestly i have no idea, do you have a recommandation for this kind of
bus driver? should i re-submit just this patch to a specific tree?

> 
> Yours,
> Linus Walleij
> 

Thanks again for your inputs.

Best regards,
Sebastien Bourdelin.


[PATCH v7 2/2] bus: add driver for the Technologic Systems NBUS

2017-11-01 Thread Sebastien Bourdelin
This driver implements a GPIOs bit-banged bus, called the NBUS by
Technologic Systems. It is used to communicate with the peripherals in
the FPGA on the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
Acked-by: Linus Walleij <linus.wall...@linaro.org>
---
Changes v6 -> v7:
  - rebase on master

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem
  - add ack by Linux Walleij

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - remove all call to the "inline" keyword in functions to let the
  compiler decide when required (suggested by Linus Walleij)
  - move the struct ts_nbus to the driver code instead of its header
  file (suggested by Linus Walleij)
  - use the bitops header and the BIT macro (suggested by Linus Walleij)
  - move the mutex to the struct ts_nbus instead to have it statically
  declared in the driver code (suggested by Linus Walleij)
  - remove the ts_nbus_set_mode function to simplify the logic
  (suggested by Linus Walleij)
  - the nbus will always need 8 data lines, remove the use of the
  ndescs when dealing with the data gpios and hardcode the value for
  simplicity instead (suggested by Linus Walleij)
  - add more comments (suggested by Linus Walleij)
  - rework all the ts_nbus_read_... functions to propagate the
  gpiod_get_value_... errno code (suggested by Linus Walleij)
  - few typos and code reformating for lisibility

Changes v1 -> v2:
  - rebase on master
  - the driver now populate its child nodes
  - remove the 'default y' option from the Kconfig
  - rework the driver to not use singleton anymore (suggested by Linus
  Walleij)
  - replace the use of the legacy GPIO API with gpiod (suggested by
  Linus Walleij)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 drivers/bus/Kconfig |   8 ++
 drivers/bus/Makefile|   1 +
 drivers/bus/ts-nbus.c   | 375 
 include/linux/ts-nbus.h |  18 +++
 4 files changed, 402 insertions(+)
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 include/linux/ts-nbus.h

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index ae3d8f3444b9..854348e646b3 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -157,6 +157,14 @@ config TEGRA_GMI
  Driver for the Tegra Generic Memory Interface bus which can be used
  to attach devices such as NOR, UART, FPGA and more.
 
+config TS_NBUS
+   tristate "Technologic Systems NBUS Driver"
+   depends on SOC_IMX28
+   depends on OF_GPIO && PWM
+   help
+ Driver for the Technologic Systems NBUS which is used to interface
+ with the peripherals in the FPGA of the TS-4600 SoM.
+
 config UNIPHIER_SYSTEM_BUS
tristate "UniPhier System Bus driver"
depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index cc6364bec054..72377f77651c 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SUNXI_RSB)   += sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)   += tegra-aconnect.o
 obj-$(CONFIG_TEGRA_GMI)+= tegra-gmi.o
+obj-$(CONFIG_TS_NBUS)  += ts-nbus.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS)  += uniphier-system-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)  += vexpress-config.o
 
diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
new file mode 100644
index ..073fd9011154
--- /dev/null
+++ b/drivers/bus/ts-nbus.c
@@ -0,0 +1,375 @@
+/*
+ * NBUS driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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.
+ *
+ * This driver implements a GPIOs bit-banged bus, called the NBUS by 
Technologic
+ * Systems. It is used to communicate with the peripherals in the FPGA on the
+ * TS-4600 SoM.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TS_NBUS_DIRECTION_IN  0
+#define TS_NBUS_DIRECTION_OUT 1
+#define TS_NBUS_WRITE_ADR 0
+#define TS_NBUS_WRITE_VAL 1
+
+struct ts_nbus {
+   struct pwm_device *pwm;
+   struct gpio_descs *data;
+   struct gpio_desc *csn;
+   struct gpio_desc *txrx;
+   struct gpio_desc *strobe;
+   struct gpio_desc *ale;
+   struct gpio_desc *rdy;
+   struct mutex lock;
+};
+
+/*
+ * request all gpios required by the bus.
+ */
+static int ts_nbus_init_pdata(str

[PATCH v7 2/2] bus: add driver for the Technologic Systems NBUS

2017-11-01 Thread Sebastien Bourdelin
This driver implements a GPIOs bit-banged bus, called the NBUS by
Technologic Systems. It is used to communicate with the peripherals in
the FPGA on the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin 
Acked-by: Linus Walleij 
---
Changes v6 -> v7:
  - rebase on master

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem
  - add ack by Linux Walleij

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - remove all call to the "inline" keyword in functions to let the
  compiler decide when required (suggested by Linus Walleij)
  - move the struct ts_nbus to the driver code instead of its header
  file (suggested by Linus Walleij)
  - use the bitops header and the BIT macro (suggested by Linus Walleij)
  - move the mutex to the struct ts_nbus instead to have it statically
  declared in the driver code (suggested by Linus Walleij)
  - remove the ts_nbus_set_mode function to simplify the logic
  (suggested by Linus Walleij)
  - the nbus will always need 8 data lines, remove the use of the
  ndescs when dealing with the data gpios and hardcode the value for
  simplicity instead (suggested by Linus Walleij)
  - add more comments (suggested by Linus Walleij)
  - rework all the ts_nbus_read_... functions to propagate the
  gpiod_get_value_... errno code (suggested by Linus Walleij)
  - few typos and code reformating for lisibility

Changes v1 -> v2:
  - rebase on master
  - the driver now populate its child nodes
  - remove the 'default y' option from the Kconfig
  - rework the driver to not use singleton anymore (suggested by Linus
  Walleij)
  - replace the use of the legacy GPIO API with gpiod (suggested by
  Linus Walleij)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 drivers/bus/Kconfig |   8 ++
 drivers/bus/Makefile|   1 +
 drivers/bus/ts-nbus.c   | 375 
 include/linux/ts-nbus.h |  18 +++
 4 files changed, 402 insertions(+)
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 include/linux/ts-nbus.h

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index ae3d8f3444b9..854348e646b3 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -157,6 +157,14 @@ config TEGRA_GMI
  Driver for the Tegra Generic Memory Interface bus which can be used
  to attach devices such as NOR, UART, FPGA and more.
 
+config TS_NBUS
+   tristate "Technologic Systems NBUS Driver"
+   depends on SOC_IMX28
+   depends on OF_GPIO && PWM
+   help
+ Driver for the Technologic Systems NBUS which is used to interface
+ with the peripherals in the FPGA of the TS-4600 SoM.
+
 config UNIPHIER_SYSTEM_BUS
tristate "UniPhier System Bus driver"
depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index cc6364bec054..72377f77651c 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SUNXI_RSB)   += sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)   += tegra-aconnect.o
 obj-$(CONFIG_TEGRA_GMI)+= tegra-gmi.o
+obj-$(CONFIG_TS_NBUS)  += ts-nbus.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS)  += uniphier-system-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)  += vexpress-config.o
 
diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
new file mode 100644
index ..073fd9011154
--- /dev/null
+++ b/drivers/bus/ts-nbus.c
@@ -0,0 +1,375 @@
+/*
+ * NBUS driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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.
+ *
+ * This driver implements a GPIOs bit-banged bus, called the NBUS by 
Technologic
+ * Systems. It is used to communicate with the peripherals in the FPGA on the
+ * TS-4600 SoM.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TS_NBUS_DIRECTION_IN  0
+#define TS_NBUS_DIRECTION_OUT 1
+#define TS_NBUS_WRITE_ADR 0
+#define TS_NBUS_WRITE_VAL 1
+
+struct ts_nbus {
+   struct pwm_device *pwm;
+   struct gpio_descs *data;
+   struct gpio_desc *csn;
+   struct gpio_desc *txrx;
+   struct gpio_desc *strobe;
+   struct gpio_desc *ale;
+   struct gpio_desc *rdy;
+   struct mutex lock;
+};
+
+/*
+ * request all gpios required by the bus.
+ */
+static int ts_nbus_init_pdata(struct platform_device *pdev, struct ts_nbus
+   *ts_nbus)
+{
+   ts_nbus->data = devm_gpiod_get_array(>dev, &quo

[PATCH v7 1/2] dt-bindings: bus: Add documentation for the Technologic Systems NBUS

2017-11-01 Thread Sebastien Bourdelin
Add binding documentation for the Technologic Systems NBUS that is used
to interface with peripherals in the FPGA of the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
Acked-by: Linus Walleij <linus.wall...@linaro.org>
Acked-by: Rob Herring <r...@kernel.org>
---
Changes v6 -> v7:
  - rebase on master
  - add missing ack from Rob Herring on v4 (no changes done since)

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem
  - add ack by Linus Walleij

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - fix typo (suggested by Rob Herring)

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate child nodes (suggested by Rob Herring)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 Documentation/devicetree/bindings/bus/ts-nbus.txt | 50 +++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt

diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt 
b/Documentation/devicetree/bindings/bus/ts-nbus.txt
new file mode 100644
index ..2a10d065b9fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/ts-nbus.txt
@@ -0,0 +1,50 @@
+Technologic Systems NBUS
+
+The NBUS is a bus used to interface with peripherals in the Technologic
+Systems FPGA on the TS-4600 SoM.
+
+Required properties :
+ - compatible  : "technologic,ts-nbus"
+ - #address-cells  : must be 1
+ - #size-cells : must be 0
+ - pwms: The PWM bound to the FPGA
+ - ts,data-gpios   : The 8 GPIO pins connected to the data lines on the 
FPGA
+ - ts,csn-gpios: The GPIO pin connected to the csn line on the 
FPGA
+ - ts,txrx-gpios   : The GPIO pin connected to the txrx line on the FPGA
+ - ts,strobe-gpios : The GPIO pin connected to the stobe line on the FPGA
+ - ts,ale-gpios: The GPIO pin connected to the ale line on the 
FPGA
+ - ts,rdy-gpios: The GPIO pin connected to the rdy line on the 
FPGA
+
+Child nodes:
+
+The NBUS node can contain zero or more child nodes representing peripherals
+on the bus.
+
+Example:
+
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "...";
+
+   /* ... */
+   };
+   };
-- 
2.13.4



[PATCH v7 1/2] dt-bindings: bus: Add documentation for the Technologic Systems NBUS

2017-11-01 Thread Sebastien Bourdelin
Add binding documentation for the Technologic Systems NBUS that is used
to interface with peripherals in the FPGA of the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin 
Acked-by: Linus Walleij 
Acked-by: Rob Herring 
---
Changes v6 -> v7:
  - rebase on master
  - add missing ack from Rob Herring on v4 (no changes done since)

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem
  - add ack by Linus Walleij

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - fix typo (suggested by Rob Herring)

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate child nodes (suggested by Rob Herring)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 Documentation/devicetree/bindings/bus/ts-nbus.txt | 50 +++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt

diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt 
b/Documentation/devicetree/bindings/bus/ts-nbus.txt
new file mode 100644
index ..2a10d065b9fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/ts-nbus.txt
@@ -0,0 +1,50 @@
+Technologic Systems NBUS
+
+The NBUS is a bus used to interface with peripherals in the Technologic
+Systems FPGA on the TS-4600 SoM.
+
+Required properties :
+ - compatible  : "technologic,ts-nbus"
+ - #address-cells  : must be 1
+ - #size-cells : must be 0
+ - pwms: The PWM bound to the FPGA
+ - ts,data-gpios   : The 8 GPIO pins connected to the data lines on the 
FPGA
+ - ts,csn-gpios: The GPIO pin connected to the csn line on the 
FPGA
+ - ts,txrx-gpios   : The GPIO pin connected to the txrx line on the FPGA
+ - ts,strobe-gpios : The GPIO pin connected to the stobe line on the FPGA
+ - ts,ale-gpios: The GPIO pin connected to the ale line on the 
FPGA
+ - ts,rdy-gpios: The GPIO pin connected to the rdy line on the 
FPGA
+
+Child nodes:
+
+The NBUS node can contain zero or more child nodes representing peripherals
+on the bus.
+
+Example:
+
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "...";
+
+   /* ... */
+   };
+   };
-- 
2.13.4



[PATCH v7 2/2] ARM: dts: TS-4600: add basic device tree

2017-11-01 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v6 -> v7:
  - rebase on master
  - remove unneeded pinctrl-name (suggested by Shawn Guo)
  - add reg to the node en-sd-pwr (suggested by Shawn Guo)
  - use define for gpio polarity (suggested by Shawn Guo)
  - remove the fake bus container for regulator (suggested by Shawn Guo)

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 74 ++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   | 22 +
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   | 22 +
 4 files changed, 120 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index faf46abaa4a2..430fe7f1e644 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -532,6 +532,8 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600-rev-a.dtb \
+   imx28-ts4600-rev-b.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
new file mode 100644
index ..c5f6bef87fd5
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+
+   en_sd_pwr: en-sd-pwr@0 {
+   reg = <0>;
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   reg_vddio_sd0: regulator-vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 GPIO_ACTIVE_HIGH>;
+   };
+
+};
diff --git a/arch/arm/boot/dts/imx28-ts4600-rev-a.dts 
b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
new file mode 100644
index ..e8cb72988fcf
--- /dev/null
+++ 

[PATCH v7 2/2] ARM: dts: TS-4600: add basic device tree

2017-11-01 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin 
---
Changes v6 -> v7:
  - rebase on master
  - remove unneeded pinctrl-name (suggested by Shawn Guo)
  - add reg to the node en-sd-pwr (suggested by Shawn Guo)
  - use define for gpio polarity (suggested by Shawn Guo)
  - remove the fake bus container for regulator (suggested by Shawn Guo)

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 74 ++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   | 22 +
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   | 22 +
 4 files changed, 120 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index faf46abaa4a2..430fe7f1e644 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -532,6 +532,8 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600-rev-a.dtb \
+   imx28-ts4600-rev-b.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
new file mode 100644
index ..c5f6bef87fd5
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+
+   en_sd_pwr: en-sd-pwr@0 {
+   reg = <0>;
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   reg_vddio_sd0: regulator-vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 GPIO_ACTIVE_HIGH>;
+   };
+
+};
diff --git a/arch/arm/boot/dts/imx28-ts4600-rev-a.dts 
b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
new file mode 100644
index ..e8cb72988fcf
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 Savo

[PATCH v7 1/2] of: documentation: add bindings documentation for TS-4600

2017-11-01 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
Acked-by: Rob Herring <r...@kernel.org>
---
Changes v6 -> v7:
  - rebase on master

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring <r...@kernel.org>
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.13.4



[PATCH v7 1/2] of: documentation: add bindings documentation for TS-4600

2017-11-01 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
Acked-by: Rob Herring 
---
Changes v6 -> v7:
  - rebase on master

Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring 
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.13.4



[PATCH v6 1/2] of: documentation: add bindings documentation for TS-4600

2017-08-03 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
Acked-by: Rob Herring <r...@kernel.org>
---
Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring <r...@kernel.org>
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.13.4



[PATCH v6 1/2] of: documentation: add bindings documentation for TS-4600

2017-08-03 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Signed-off-by: Sebastien Bourdelin 
Acked-by: Rob Herring 
---
Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring 
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.13.4



[PATCH v6 2/2] ARM: dts: TS-4600: add basic device tree

2017-08-03 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 78 ++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   | 22 +
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   | 22 +
 4 files changed, 124 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4b17f35dc9a7..a3c8b7af192b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -525,6 +525,8 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600-rev-a.dtb \
+   imx28-ts4600-rev-b.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
new file mode 100644
index ..04bd5a5c0cb4
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+   pinctrl-names = "default";
+
+   en_sd_pwr: en_sd_pwr {
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   regulators {
+   compatible = "simple-bus";
+
+   reg_vddio_sd0: vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 0>;
+   };
+   };
+
+};
diff --git a/arch/arm/boot/dts/imx28-ts4600-rev-a.dts 
b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
new file mode 100644
index ..e8cb72988fcf
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien

[PATCH v6 2/2] ARM: dts: TS-4600: add basic device tree

2017-08-03 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin 
---
Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 78 ++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   | 22 +
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   | 22 +
 4 files changed, 124 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4b17f35dc9a7..a3c8b7af192b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -525,6 +525,8 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600-rev-a.dtb \
+   imx28-ts4600-rev-b.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
new file mode 100644
index ..04bd5a5c0cb4
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+   pinctrl-names = "default";
+
+   en_sd_pwr: en_sd_pwr {
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   regulators {
+   compatible = "simple-bus";
+
+   reg_vddio_sd0: vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 0>;
+   };
+   };
+
+};
diff --git a/arch/arm/boot/dts/imx28-ts4600-rev-a.dts 
b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
new file mode 100644
index ..e8cb72988fcf
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of 

Re: [PATCH v5 0/8] Add board support for TS-4600

2017-08-03 Thread Sebastien Bourdelin


On 08/02/2017 09:26 PM, Shawn Guo wrote:
> On Fri, Jul 14, 2017 at 04:32:10PM -0400, Sebastien Bourdelin wrote:
>> This patch serie adds support for the TS-4600 boards rev A and B. These
>> boards, manufactured by Technologic Systems, are based on an i.MX28.
>>
>> This serie include the support for the watchdog which could be enable
>> at Linux boot time depending on the bootloader.
>>
>> The watchdog and few peripherals are implemented in a FPGA, and can
>> only be access using a custom GPIOs bit-banged bus which is called the
>> NBUS by Technologic Systems.
>> A driver for this bus is also included and used by the watchdog.
>>
>> Sebastien Bourdelin (8):
>>   of: documentation: add bindings documentation for TS-4600
>>   ARM: dts: TS-4600: add basic device tree
>>   dt-bindings: bus: Add documentation for the Technologic Systems NBUS
>>   bus: add driver for the Technologic Systems NBUS
>>   ARM: dts: TS-4600: add NBUS support
>>   dt-bindings: watchdog: add documentation for TS4600 watchdog
>> controller
>>   watchdog: TS-4600: add driver for TS-4600 watchdog controller
>>   ARM: dts: TS-4600: add watchdog support
> 
> You are mixing changes on 3 subsystem in a single patch series.  It
> makes the merge process unnecessarily hard.  I suggest you split the
> series as following:
> 
>  - nbus dt-bindings and driver
>  - watchdog dt-bindings and driver
>  - ts-4600 board bindings and dts
> 
> You should get the first two into mainline through corresponding
> subsystem tree, and then submit the last one to me.  In that case, NBUS
> and watchdog dts changes do not have to be separate patches.
> 
> Shawn
> 

Hi Shawn,

Thanks i understand, however if it's ok, i would like to process in the
same time with the TS4600 board bindings and initial dts without the
part related to the nbus and watchdog.
There is no dependencies here and we can accellerate the process.

Regards,
Sebastien.


Re: [PATCH v5 0/8] Add board support for TS-4600

2017-08-03 Thread Sebastien Bourdelin


On 08/02/2017 09:26 PM, Shawn Guo wrote:
> On Fri, Jul 14, 2017 at 04:32:10PM -0400, Sebastien Bourdelin wrote:
>> This patch serie adds support for the TS-4600 boards rev A and B. These
>> boards, manufactured by Technologic Systems, are based on an i.MX28.
>>
>> This serie include the support for the watchdog which could be enable
>> at Linux boot time depending on the bootloader.
>>
>> The watchdog and few peripherals are implemented in a FPGA, and can
>> only be access using a custom GPIOs bit-banged bus which is called the
>> NBUS by Technologic Systems.
>> A driver for this bus is also included and used by the watchdog.
>>
>> Sebastien Bourdelin (8):
>>   of: documentation: add bindings documentation for TS-4600
>>   ARM: dts: TS-4600: add basic device tree
>>   dt-bindings: bus: Add documentation for the Technologic Systems NBUS
>>   bus: add driver for the Technologic Systems NBUS
>>   ARM: dts: TS-4600: add NBUS support
>>   dt-bindings: watchdog: add documentation for TS4600 watchdog
>> controller
>>   watchdog: TS-4600: add driver for TS-4600 watchdog controller
>>   ARM: dts: TS-4600: add watchdog support
> 
> You are mixing changes on 3 subsystem in a single patch series.  It
> makes the merge process unnecessarily hard.  I suggest you split the
> series as following:
> 
>  - nbus dt-bindings and driver
>  - watchdog dt-bindings and driver
>  - ts-4600 board bindings and dts
> 
> You should get the first two into mainline through corresponding
> subsystem tree, and then submit the last one to me.  In that case, NBUS
> and watchdog dts changes do not have to be separate patches.
> 
> Shawn
> 

Hi Shawn,

Thanks i understand, however if it's ok, i would like to process in the
same time with the TS4600 board bindings and initial dts without the
part related to the nbus and watchdog.
There is no dependencies here and we can accellerate the process.

Regards,
Sebastien.


[PATCH v6 1/2] dt-bindings: bus: Add documentation for the Technologic Systems NBUS

2017-08-03 Thread Sebastien Bourdelin
Add binding documentation for the Technologic Systems NBUS that is used
to interface with peripherals in the FPGA of the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
Acked-by: Linus Walleij <linus.wall...@linaro.org>
---
Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem
  - add ack by Linus Walleij

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - fix typo (suggested by Rob Herring)

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate child nodes (suggested by Rob Herring)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 Documentation/devicetree/bindings/bus/ts-nbus.txt | 50 +++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt

diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt 
b/Documentation/devicetree/bindings/bus/ts-nbus.txt
new file mode 100644
index ..2a10d065b9fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/ts-nbus.txt
@@ -0,0 +1,50 @@
+Technologic Systems NBUS
+
+The NBUS is a bus used to interface with peripherals in the Technologic
+Systems FPGA on the TS-4600 SoM.
+
+Required properties :
+ - compatible  : "technologic,ts-nbus"
+ - #address-cells  : must be 1
+ - #size-cells : must be 0
+ - pwms: The PWM bound to the FPGA
+ - ts,data-gpios   : The 8 GPIO pins connected to the data lines on the 
FPGA
+ - ts,csn-gpios: The GPIO pin connected to the csn line on the 
FPGA
+ - ts,txrx-gpios   : The GPIO pin connected to the txrx line on the FPGA
+ - ts,strobe-gpios : The GPIO pin connected to the stobe line on the FPGA
+ - ts,ale-gpios: The GPIO pin connected to the ale line on the 
FPGA
+ - ts,rdy-gpios: The GPIO pin connected to the rdy line on the 
FPGA
+
+Child nodes:
+
+The NBUS node can contain zero or more child nodes representing peripherals
+on the bus.
+
+Example:
+
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "...";
+
+   /* ... */
+   };
+   };
-- 
2.13.4



[PATCH v6 1/2] dt-bindings: bus: Add documentation for the Technologic Systems NBUS

2017-08-03 Thread Sebastien Bourdelin
Add binding documentation for the Technologic Systems NBUS that is used
to interface with peripherals in the FPGA of the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin 
Acked-by: Linus Walleij 
---
Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem
  - add ack by Linus Walleij

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - fix typo (suggested by Rob Herring)

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate child nodes (suggested by Rob Herring)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 Documentation/devicetree/bindings/bus/ts-nbus.txt | 50 +++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt

diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt 
b/Documentation/devicetree/bindings/bus/ts-nbus.txt
new file mode 100644
index ..2a10d065b9fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/ts-nbus.txt
@@ -0,0 +1,50 @@
+Technologic Systems NBUS
+
+The NBUS is a bus used to interface with peripherals in the Technologic
+Systems FPGA on the TS-4600 SoM.
+
+Required properties :
+ - compatible  : "technologic,ts-nbus"
+ - #address-cells  : must be 1
+ - #size-cells : must be 0
+ - pwms: The PWM bound to the FPGA
+ - ts,data-gpios   : The 8 GPIO pins connected to the data lines on the 
FPGA
+ - ts,csn-gpios: The GPIO pin connected to the csn line on the 
FPGA
+ - ts,txrx-gpios   : The GPIO pin connected to the txrx line on the FPGA
+ - ts,strobe-gpios : The GPIO pin connected to the stobe line on the FPGA
+ - ts,ale-gpios: The GPIO pin connected to the ale line on the 
FPGA
+ - ts,rdy-gpios: The GPIO pin connected to the rdy line on the 
FPGA
+
+Child nodes:
+
+The NBUS node can contain zero or more child nodes representing peripherals
+on the bus.
+
+Example:
+
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "...";
+
+   /* ... */
+   };
+   };
-- 
2.13.4



[PATCH v6 2/2] bus: add driver for the Technologic Systems NBUS

2017-08-03 Thread Sebastien Bourdelin
This driver implements a GPIOs bit-banged bus, called the NBUS by
Technologic Systems. It is used to communicate with the peripherals in
the FPGA on the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
Acked-by: Linus Walleij <linus.wall...@linaro.org>
---
Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem
  - add ack by Linux Walleij

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - remove all call to the "inline" keyword in functions to let the
  compiler decide when required (suggested by Linus Walleij)
  - move the struct ts_nbus to the driver code instead of its header
  file (suggested by Linus Walleij)
  - use the bitops header and the BIT macro (suggested by Linus Walleij)
  - move the mutex to the struct ts_nbus instead to have it statically
  declared in the driver code (suggested by Linus Walleij)
  - remove the ts_nbus_set_mode function to simplify the logic
  (suggested by Linus Walleij)
  - the nbus will always need 8 data lines, remove the use of the
  ndescs when dealing with the data gpios and hardcode the value for
  simplicity instead (suggested by Linus Walleij)
  - add more comments (suggested by Linus Walleij)
  - rework all the ts_nbus_read_... functions to propagate the
  gpiod_get_value_... errno code (suggested by Linus Walleij)
  - few typos and code reformating for lisibility

Changes v1 -> v2:
  - rebase on master
  - the driver now populate its child nodes
  - remove the 'default y' option from the Kconfig
  - rework the driver to not use singleton anymore (suggested by Linus
  Walleij)
  - replace the use of the legacy GPIO API with gpiod (suggested by
  Linus Walleij)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 drivers/bus/Kconfig |   8 ++
 drivers/bus/Makefile|   1 +
 drivers/bus/ts-nbus.c   | 375 
 include/linux/ts-nbus.h |  18 +++
 4 files changed, 402 insertions(+)
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 include/linux/ts-nbus.h

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 2408ea38a39c..3465e0decac5 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -157,6 +157,14 @@ config TEGRA_GMI
  Driver for the Tegra Generic Memory Interface bus which can be used
  to attach devices such as NOR, UART, FPGA and more.
 
+config TS_NBUS
+   tristate "Technologic Systems NBUS Driver"
+   depends on SOC_IMX28
+   depends on OF_GPIO && PWM
+   help
+ Driver for the Technologic Systems NBUS which is used to interface
+ with the peripherals in the FPGA of the TS-4600 SoM.
+
 config UNIPHIER_SYSTEM_BUS
tristate "UniPhier System Bus driver"
depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index cc6364bec054..72377f77651c 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SUNXI_RSB)   += sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)   += tegra-aconnect.o
 obj-$(CONFIG_TEGRA_GMI)+= tegra-gmi.o
+obj-$(CONFIG_TS_NBUS)  += ts-nbus.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS)  += uniphier-system-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)  += vexpress-config.o
 
diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
new file mode 100644
index ..073fd9011154
--- /dev/null
+++ b/drivers/bus/ts-nbus.c
@@ -0,0 +1,375 @@
+/*
+ * NBUS driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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.
+ *
+ * This driver implements a GPIOs bit-banged bus, called the NBUS by 
Technologic
+ * Systems. It is used to communicate with the peripherals in the FPGA on the
+ * TS-4600 SoM.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TS_NBUS_DIRECTION_IN  0
+#define TS_NBUS_DIRECTION_OUT 1
+#define TS_NBUS_WRITE_ADR 0
+#define TS_NBUS_WRITE_VAL 1
+
+struct ts_nbus {
+   struct pwm_device *pwm;
+   struct gpio_descs *data;
+   struct gpio_desc *csn;
+   struct gpio_desc *txrx;
+   struct gpio_desc *strobe;
+   struct gpio_desc *ale;
+   struct gpio_desc *rdy;
+   struct mutex lock;
+};
+
+/*
+ * request all gpios required by the bus.
+ */
+static int ts_nbus_init_pdata(struct platform_device *pdev, struct ts_nbus

[PATCH v6 2/2] bus: add driver for the Technologic Systems NBUS

2017-08-03 Thread Sebastien Bourdelin
This driver implements a GPIOs bit-banged bus, called the NBUS by
Technologic Systems. It is used to communicate with the peripherals in
the FPGA on the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin 
Acked-by: Linus Walleij 
---
Changes v5 -> v6:
  - rebase on master
  - split the previous patch series into series by subsystem
  - add ack by Linux Walleij

Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - remove all call to the "inline" keyword in functions to let the
  compiler decide when required (suggested by Linus Walleij)
  - move the struct ts_nbus to the driver code instead of its header
  file (suggested by Linus Walleij)
  - use the bitops header and the BIT macro (suggested by Linus Walleij)
  - move the mutex to the struct ts_nbus instead to have it statically
  declared in the driver code (suggested by Linus Walleij)
  - remove the ts_nbus_set_mode function to simplify the logic
  (suggested by Linus Walleij)
  - the nbus will always need 8 data lines, remove the use of the
  ndescs when dealing with the data gpios and hardcode the value for
  simplicity instead (suggested by Linus Walleij)
  - add more comments (suggested by Linus Walleij)
  - rework all the ts_nbus_read_... functions to propagate the
  gpiod_get_value_... errno code (suggested by Linus Walleij)
  - few typos and code reformating for lisibility

Changes v1 -> v2:
  - rebase on master
  - the driver now populate its child nodes
  - remove the 'default y' option from the Kconfig
  - rework the driver to not use singleton anymore (suggested by Linus
  Walleij)
  - replace the use of the legacy GPIO API with gpiod (suggested by
  Linus Walleij)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 drivers/bus/Kconfig |   8 ++
 drivers/bus/Makefile|   1 +
 drivers/bus/ts-nbus.c   | 375 
 include/linux/ts-nbus.h |  18 +++
 4 files changed, 402 insertions(+)
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 include/linux/ts-nbus.h

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 2408ea38a39c..3465e0decac5 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -157,6 +157,14 @@ config TEGRA_GMI
  Driver for the Tegra Generic Memory Interface bus which can be used
  to attach devices such as NOR, UART, FPGA and more.
 
+config TS_NBUS
+   tristate "Technologic Systems NBUS Driver"
+   depends on SOC_IMX28
+   depends on OF_GPIO && PWM
+   help
+ Driver for the Technologic Systems NBUS which is used to interface
+ with the peripherals in the FPGA of the TS-4600 SoM.
+
 config UNIPHIER_SYSTEM_BUS
tristate "UniPhier System Bus driver"
depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index cc6364bec054..72377f77651c 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SUNXI_RSB)   += sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)   += tegra-aconnect.o
 obj-$(CONFIG_TEGRA_GMI)+= tegra-gmi.o
+obj-$(CONFIG_TS_NBUS)  += ts-nbus.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS)  += uniphier-system-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)  += vexpress-config.o
 
diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
new file mode 100644
index ..073fd9011154
--- /dev/null
+++ b/drivers/bus/ts-nbus.c
@@ -0,0 +1,375 @@
+/*
+ * NBUS driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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.
+ *
+ * This driver implements a GPIOs bit-banged bus, called the NBUS by 
Technologic
+ * Systems. It is used to communicate with the peripherals in the FPGA on the
+ * TS-4600 SoM.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TS_NBUS_DIRECTION_IN  0
+#define TS_NBUS_DIRECTION_OUT 1
+#define TS_NBUS_WRITE_ADR 0
+#define TS_NBUS_WRITE_VAL 1
+
+struct ts_nbus {
+   struct pwm_device *pwm;
+   struct gpio_descs *data;
+   struct gpio_desc *csn;
+   struct gpio_desc *txrx;
+   struct gpio_desc *strobe;
+   struct gpio_desc *ale;
+   struct gpio_desc *rdy;
+   struct mutex lock;
+};
+
+/*
+ * request all gpios required by the bus.
+ */
+static int ts_nbus_init_pdata(struct platform_device *pdev, struct ts_nbus
+   *ts_nbus)
+{
+   ts_nbus->data = devm_gpiod_get_array(>dev, "ts,data",
+  

[PATCH v5 5/8] ARM: dts: TS-4600: add NBUS support

2017-07-14 Thread Sebastien Bourdelin
This commit enables the NBUS on the TS-4600, using the ts-nbus driver.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate the child nodes (suggested by Rob Herring)
  - add the vendor prefix to all gpio (suggested by Rob Herring)
---
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 43 ++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
index 04bd5a5c0cb4..a90bd934e4a3 100644
--- a/arch/arm/boot/dts/imx28-ts4600-common.dtsi
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -44,6 +44,28 @@
fsl,pull-up = ;
};
 
+   nbus_pins: nbus_pins {
+   fsl,pinmux-ids = <
+   MX28_PAD_GPMI_D00__GPIO_0_0
+   MX28_PAD_GPMI_D01__GPIO_0_1
+   MX28_PAD_GPMI_D02__GPIO_0_2
+   MX28_PAD_GPMI_D03__GPIO_0_3
+   MX28_PAD_GPMI_D04__GPIO_0_4
+   MX28_PAD_GPMI_D05__GPIO_0_5
+   MX28_PAD_GPMI_D06__GPIO_0_6
+   MX28_PAD_GPMI_D07__GPIO_0_7
+   MX28_PAD_GPMI_CE0N__GPIO_0_16
+   MX28_PAD_GPMI_RDY1__GPIO_0_21
+   MX28_PAD_GPMI_RDN__GPIO_0_24
+   MX28_PAD_GPMI_WRN__GPIO_0_25
+   MX28_PAD_GPMI_ALE__GPIO_0_26
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+
+   };
+
};
};
 
@@ -75,4 +97,25 @@
};
};
 
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+   };
+
 };
-- 
2.13.0



[PATCH v5 5/8] ARM: dts: TS-4600: add NBUS support

2017-07-14 Thread Sebastien Bourdelin
This commit enables the NBUS on the TS-4600, using the ts-nbus driver.

Signed-off-by: Sebastien Bourdelin 
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate the child nodes (suggested by Rob Herring)
  - add the vendor prefix to all gpio (suggested by Rob Herring)
---
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 43 ++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
index 04bd5a5c0cb4..a90bd934e4a3 100644
--- a/arch/arm/boot/dts/imx28-ts4600-common.dtsi
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -44,6 +44,28 @@
fsl,pull-up = ;
};
 
+   nbus_pins: nbus_pins {
+   fsl,pinmux-ids = <
+   MX28_PAD_GPMI_D00__GPIO_0_0
+   MX28_PAD_GPMI_D01__GPIO_0_1
+   MX28_PAD_GPMI_D02__GPIO_0_2
+   MX28_PAD_GPMI_D03__GPIO_0_3
+   MX28_PAD_GPMI_D04__GPIO_0_4
+   MX28_PAD_GPMI_D05__GPIO_0_5
+   MX28_PAD_GPMI_D06__GPIO_0_6
+   MX28_PAD_GPMI_D07__GPIO_0_7
+   MX28_PAD_GPMI_CE0N__GPIO_0_16
+   MX28_PAD_GPMI_RDY1__GPIO_0_21
+   MX28_PAD_GPMI_RDN__GPIO_0_24
+   MX28_PAD_GPMI_WRN__GPIO_0_25
+   MX28_PAD_GPMI_ALE__GPIO_0_26
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+
+   };
+
};
};
 
@@ -75,4 +97,25 @@
};
};
 
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+   };
+
 };
-- 
2.13.0



[PATCH v5 2/8] ARM: dts: TS-4600: add basic device tree

2017-07-14 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 78 ++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   | 22 +
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   | 22 +
 4 files changed, 124 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4b17f35dc9a7..a3c8b7af192b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -525,6 +525,8 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600-rev-a.dtb \
+   imx28-ts4600-rev-b.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
new file mode 100644
index ..04bd5a5c0cb4
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+   pinctrl-names = "default";
+
+   en_sd_pwr: en_sd_pwr {
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   regulators {
+   compatible = "simple-bus";
+
+   reg_vddio_sd0: vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 0>;
+   };
+   };
+
+};
diff --git a/arch/arm/boot/dts/imx28-ts4600-rev-a.dts 
b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
new file mode 100644
index ..e8cb72988fcf
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * The code contained herein is licensed under the GNU General Publ

[PATCH v5 2/8] ARM: dts: TS-4600: add basic device tree

2017-07-14 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

Signed-off-by: Sebastien Bourdelin 
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
---
 arch/arm/boot/dts/Makefile |  2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 78 ++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   | 22 +
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   | 22 +
 4 files changed, 124 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4b17f35dc9a7..a3c8b7af192b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -525,6 +525,8 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600-rev-a.dtb \
+   imx28-ts4600-rev-b.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
new file mode 100644
index ..04bd5a5c0cb4
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+   pinctrl-names = "default";
+
+   en_sd_pwr: en_sd_pwr {
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   regulators {
+   compatible = "simple-bus";
+
+   reg_vddio_sd0: vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 0>;
+   };
+   };
+
+};
diff --git a/arch/arm/boot/dts/imx28-ts4600-rev-a.dts 
b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
new file mode 100644
index ..e8cb72988fcf
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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:
+ *
+ 

[PATCH v5 8/8] ARM: dts: TS-4600: add watchdog support

2017-07-14 Thread Sebastien Bourdelin
This enables support for the watchdog located in the FPGA.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v4 -> v5:
  - fix missing signed off
---
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
index a90bd934e4a3..9e177d33ba9c 100644
--- a/arch/arm/boot/dts/imx28-ts4600-common.dtsi
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -116,6 +116,11 @@
ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "technologic,ts4600-wdt";
+   reg = <0x2a>;
+   };
};
 
 };
-- 
2.13.0



[PATCH v5 8/8] ARM: dts: TS-4600: add watchdog support

2017-07-14 Thread Sebastien Bourdelin
This enables support for the watchdog located in the FPGA.

Signed-off-by: Sebastien Bourdelin 
---
Changes v4 -> v5:
  - fix missing signed off
---
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
index a90bd934e4a3..9e177d33ba9c 100644
--- a/arch/arm/boot/dts/imx28-ts4600-common.dtsi
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -116,6 +116,11 @@
ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "technologic,ts4600-wdt";
+   reg = <0x2a>;
+   };
};
 
 };
-- 
2.13.0



[PATCH v5 4/8] bus: add driver for the Technologic Systems NBUS

2017-07-14 Thread Sebastien Bourdelin
This driver implements a GPIOs bit-banged bus, called the NBUS by
Technologic Systems. It is used to communicate with the peripherals in
the FPGA on the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - remove all call to the "inline" keyword in functions to let the
  compiler decide when required (suggested by Linus Walleij)
  - move the struct ts_nbus to the driver code instead of its header
  file (suggested by Linus Walleij)
  - use the bitops header and the BIT macro (suggested by Linus Walleij)
  - move the mutex to the struct ts_nbus instead to have it statically
  declared in the driver code (suggested by Linus Walleij)
  - remove the ts_nbus_set_mode function to simplify the logic
  (suggested by Linus Walleij)
  - the nbus will always need 8 data lines, remove the use of the
  ndescs when dealing with the data gpios and hardcode the value for
  simplicity instead (suggested by Linus Walleij)
  - add more comments (suggested by Linus Walleij)
  - rework all the ts_nbus_read_... functions to propagate the
  gpiod_get_value_... errno code (suggested by Linus Walleij)
  - few typos and code reformating for lisibility

Changes v1 -> v2:
  - rebase on master
  - the driver now populate its child nodes
  - remove the 'default y' option from the Kconfig
  - rework the driver to not use singleton anymore (suggested by Linus
  Walleij)
  - replace the use of the legacy GPIO API with gpiod (suggested by
  Linus Walleij)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 drivers/bus/Kconfig |   8 ++
 drivers/bus/Makefile|   1 +
 drivers/bus/ts-nbus.c   | 375 
 include/linux/ts-nbus.h |  18 +++
 4 files changed, 402 insertions(+)
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 include/linux/ts-nbus.h

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 2408ea38a39c..3465e0decac5 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -157,6 +157,14 @@ config TEGRA_GMI
  Driver for the Tegra Generic Memory Interface bus which can be used
  to attach devices such as NOR, UART, FPGA and more.
 
+config TS_NBUS
+   tristate "Technologic Systems NBUS Driver"
+   depends on SOC_IMX28
+   depends on OF_GPIO && PWM
+   help
+ Driver for the Technologic Systems NBUS which is used to interface
+ with the peripherals in the FPGA of the TS-4600 SoM.
+
 config UNIPHIER_SYSTEM_BUS
tristate "UniPhier System Bus driver"
depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index cc6364bec054..72377f77651c 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SUNXI_RSB)   += sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)   += tegra-aconnect.o
 obj-$(CONFIG_TEGRA_GMI)+= tegra-gmi.o
+obj-$(CONFIG_TS_NBUS)  += ts-nbus.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS)  += uniphier-system-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)  += vexpress-config.o
 
diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
new file mode 100644
index ..073fd9011154
--- /dev/null
+++ b/drivers/bus/ts-nbus.c
@@ -0,0 +1,375 @@
+/*
+ * NBUS driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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.
+ *
+ * This driver implements a GPIOs bit-banged bus, called the NBUS by 
Technologic
+ * Systems. It is used to communicate with the peripherals in the FPGA on the
+ * TS-4600 SoM.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TS_NBUS_DIRECTION_IN  0
+#define TS_NBUS_DIRECTION_OUT 1
+#define TS_NBUS_WRITE_ADR 0
+#define TS_NBUS_WRITE_VAL 1
+
+struct ts_nbus {
+   struct pwm_device *pwm;
+   struct gpio_descs *data;
+   struct gpio_desc *csn;
+   struct gpio_desc *txrx;
+   struct gpio_desc *strobe;
+   struct gpio_desc *ale;
+   struct gpio_desc *rdy;
+   struct mutex lock;
+};
+
+/*
+ * request all gpios required by the bus.
+ */
+static int ts_nbus_init_pdata(struct platform_device *pdev, struct ts_nbus
+   *ts_nbus)
+{
+   ts_nbus->data = devm_gpiod_get_array(>dev, "ts,data",
+   GPIOD_OUT_HIGH);
+   if (IS_ERR(ts_nbus->data)) {
+

[PATCH v5 4/8] bus: add driver for the Technologic Systems NBUS

2017-07-14 Thread Sebastien Bourdelin
This driver implements a GPIOs bit-banged bus, called the NBUS by
Technologic Systems. It is used to communicate with the peripherals in
the FPGA on the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin 
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - remove all call to the "inline" keyword in functions to let the
  compiler decide when required (suggested by Linus Walleij)
  - move the struct ts_nbus to the driver code instead of its header
  file (suggested by Linus Walleij)
  - use the bitops header and the BIT macro (suggested by Linus Walleij)
  - move the mutex to the struct ts_nbus instead to have it statically
  declared in the driver code (suggested by Linus Walleij)
  - remove the ts_nbus_set_mode function to simplify the logic
  (suggested by Linus Walleij)
  - the nbus will always need 8 data lines, remove the use of the
  ndescs when dealing with the data gpios and hardcode the value for
  simplicity instead (suggested by Linus Walleij)
  - add more comments (suggested by Linus Walleij)
  - rework all the ts_nbus_read_... functions to propagate the
  gpiod_get_value_... errno code (suggested by Linus Walleij)
  - few typos and code reformating for lisibility

Changes v1 -> v2:
  - rebase on master
  - the driver now populate its child nodes
  - remove the 'default y' option from the Kconfig
  - rework the driver to not use singleton anymore (suggested by Linus
  Walleij)
  - replace the use of the legacy GPIO API with gpiod (suggested by
  Linus Walleij)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 drivers/bus/Kconfig |   8 ++
 drivers/bus/Makefile|   1 +
 drivers/bus/ts-nbus.c   | 375 
 include/linux/ts-nbus.h |  18 +++
 4 files changed, 402 insertions(+)
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 include/linux/ts-nbus.h

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 2408ea38a39c..3465e0decac5 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -157,6 +157,14 @@ config TEGRA_GMI
  Driver for the Tegra Generic Memory Interface bus which can be used
  to attach devices such as NOR, UART, FPGA and more.
 
+config TS_NBUS
+   tristate "Technologic Systems NBUS Driver"
+   depends on SOC_IMX28
+   depends on OF_GPIO && PWM
+   help
+ Driver for the Technologic Systems NBUS which is used to interface
+ with the peripherals in the FPGA of the TS-4600 SoM.
+
 config UNIPHIER_SYSTEM_BUS
tristate "UniPhier System Bus driver"
depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index cc6364bec054..72377f77651c 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SUNXI_RSB)   += sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)   += tegra-aconnect.o
 obj-$(CONFIG_TEGRA_GMI)+= tegra-gmi.o
+obj-$(CONFIG_TS_NBUS)  += ts-nbus.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS)  += uniphier-system-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)  += vexpress-config.o
 
diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
new file mode 100644
index ..073fd9011154
--- /dev/null
+++ b/drivers/bus/ts-nbus.c
@@ -0,0 +1,375 @@
+/*
+ * NBUS driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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.
+ *
+ * This driver implements a GPIOs bit-banged bus, called the NBUS by 
Technologic
+ * Systems. It is used to communicate with the peripherals in the FPGA on the
+ * TS-4600 SoM.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TS_NBUS_DIRECTION_IN  0
+#define TS_NBUS_DIRECTION_OUT 1
+#define TS_NBUS_WRITE_ADR 0
+#define TS_NBUS_WRITE_VAL 1
+
+struct ts_nbus {
+   struct pwm_device *pwm;
+   struct gpio_descs *data;
+   struct gpio_desc *csn;
+   struct gpio_desc *txrx;
+   struct gpio_desc *strobe;
+   struct gpio_desc *ale;
+   struct gpio_desc *rdy;
+   struct mutex lock;
+};
+
+/*
+ * request all gpios required by the bus.
+ */
+static int ts_nbus_init_pdata(struct platform_device *pdev, struct ts_nbus
+   *ts_nbus)
+{
+   ts_nbus->data = devm_gpiod_get_array(>dev, "ts,data",
+   GPIOD_OUT_HIGH);
+   if (IS_ERR(ts_nbus->data)) {
+   dev_err(>dev, "failed to retrieve ts,data-gpio from 
dts\n");
+ 

[PATCH v5 6/8] dt-bindings: watchdog: add documentation for TS4600 watchdog controller

2017-07-14 Thread Sebastien Bourdelin
This patch adds dt-binding documentation for TS4600 watchdog controller.

Acked-by: Rob Herring <r...@kernel.org>
Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v4 -> v5:
  - fix missing signed off

v4:
  - this documentation was previously merged with the watchdog driver
  and had been acked by Rob Herring, no changes have been done since.
---
 .../devicetree/bindings/watchdog/ts4600-wdt.txt  | 16 
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt

diff --git a/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
new file mode 100644
index ..7de00ceae341
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
@@ -0,0 +1,16 @@
+TS-4600 Technologic Systems Watchdog
+
+Required properties:
+- compatible: must be "technologic,ts4600-wdt"
+- reg: offset to the FPGA's watchdog register
+
+Optional property:
+- timeout-sec: contains the watchdog timeout in seconds.
+
+Example:
+
+watchdog {
+   compatible = "technologic,ts4600-wdt";
+   reg = <0x2a>;
+   timeout-sec = <10>;
+};
-- 
2.13.0



[PATCH v5 6/8] dt-bindings: watchdog: add documentation for TS4600 watchdog controller

2017-07-14 Thread Sebastien Bourdelin
This patch adds dt-binding documentation for TS4600 watchdog controller.

Acked-by: Rob Herring 
Signed-off-by: Sebastien Bourdelin 
---
Changes v4 -> v5:
  - fix missing signed off

v4:
  - this documentation was previously merged with the watchdog driver
  and had been acked by Rob Herring, no changes have been done since.
---
 .../devicetree/bindings/watchdog/ts4600-wdt.txt  | 16 
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt

diff --git a/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
new file mode 100644
index ..7de00ceae341
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
@@ -0,0 +1,16 @@
+TS-4600 Technologic Systems Watchdog
+
+Required properties:
+- compatible: must be "technologic,ts4600-wdt"
+- reg: offset to the FPGA's watchdog register
+
+Optional property:
+- timeout-sec: contains the watchdog timeout in seconds.
+
+Example:
+
+watchdog {
+   compatible = "technologic,ts4600-wdt";
+   reg = <0x2a>;
+   timeout-sec = <10>;
+};
-- 
2.13.0



[PATCH v5 7/8] watchdog: TS-4600: add driver for TS-4600 watchdog controller

2017-07-14 Thread Sebastien Bourdelin
This watchdog is instantiated in a FPGA and can only be access using a
GPIOs bit-banged bus, called the NBUS by Technologic Systems.
The watchdog is made of only one register, called the feed register.
Writing to this register will re-arm the watchdog for a given time (and
enable it if it was disable). It can be disabled by writing a special
value into it.

Reviewed-by: Guenter Roeck <li...@roeck-us.net>
Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - remove the dts and the documentation associated from the driver
  commit (suggested by Shawn Guo)
  - the driver in v3 was acked by Guenter Roeck and no changes on the
  driver have been done.

Changes v2 -> v3:
  - rebase on master
  - remove the timeout table to simplify the logic (suggested by
  Guenter Roeck)
  - fix the set_timeout function (suggested by Guenter Roeck)
  - hardcode the max_hw_heartbeat_ms value based on the ts4600 max
  timeout value supported (suggested by Guenter Roeck)
  - remove the max_timeout usage and set a default timeout value
(suggested by Guenter Roeck)
  - use the devm_watchdog_register_device function instead of
  watchdog_register_device (suggested by Guenter Roeck)
  - v2 was acked by Rob Herring

Changes v1 -> v2:
  - rebase on master
  - retrieve the ts_nbus instantiated by the parent node (suggested by
  Linus Walleij)
  - rename the wdt by watchdog in the device tree and in the
  documentation (suggested by Rob Herring)
  - add a dependency to the TS_NBUS driver in the Kconfig (suggested by
  Guenter Roeck)
  - simplify the set_timeout function (suggested by Guenter Roeck)
  - use the max_hw_heartbeat_ms callback instead of the max_timeout
  callback (suggested by Guenter Roeck)
---
 drivers/watchdog/Kconfig  |  11 +++
 drivers/watchdog/Makefile |   1 +
 drivers/watchdog/ts4600_wdt.c | 185 ++
 3 files changed, 197 insertions(+)
 create mode 100644 drivers/watchdog/ts4600_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c722cbfdc7e6..d50fbc232d9e 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -531,6 +531,17 @@ config NUC900_WATCHDOG
  To compile this driver as a module, choose M here: the
  module will be called nuc900_wdt.
 
+config TS4600_WATCHDOG
+   tristate "TS-4600 Watchdog"
+   depends on TS_NBUS
+   depends on HAS_IOMEM && OF
+   depends on SOC_IMX28 || COMPILE_TEST
+   select WATCHDOG_CORE
+   help
+ Technologic Systems TS-4600 has watchdog timer implemented in
+ an external FPGA. Say Y here if you want to support for the
+ watchdog timer on TS-4600 board.
+
 config TS4800_WATCHDOG
tristate "TS-4800 Watchdog"
depends on HAS_IOMEM && OF
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 56adf9fa67d0..a95aa4a13b39 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
 obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
 obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
 obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
+obj-$(CONFIG_TS4600_WATCHDOG) += ts4600_wdt.o
 obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
 obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
 obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
diff --git a/drivers/watchdog/ts4600_wdt.c b/drivers/watchdog/ts4600_wdt.c
new file mode 100644
index ..ed530dd2f800
--- /dev/null
+++ b/drivers/watchdog/ts4600_wdt.c
@@ -0,0 +1,185 @@
+/*
+ * Watchdog driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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.
+ *
+ * The watchdog on the TS-4600 based boards is in an FPGA and can only be
+ * accessed using a GPIO bit-banged bus called the NBUS by Technologic Systems.
+ * The logic for the watchdog is the same then for the TS-4800 SoM, only the 
way
+ * to access it change, therefore this driver is heavely based on the 
ts4800_wdt
+ * driver from Damien Riegel <damien.rie...@savoirfairelinux.com>.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout,
+   "Watchdog cannot be stopped once started (default="
+   __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * TS-4600 supports the following timeout values:
+ *
+ *   value desc
+ *   -
+ * 0feed for 338ms
+ * 1feed for 2.706s
+ * 2feed for 10.824s

[PATCH v5 7/8] watchdog: TS-4600: add driver for TS-4600 watchdog controller

2017-07-14 Thread Sebastien Bourdelin
This watchdog is instantiated in a FPGA and can only be access using a
GPIOs bit-banged bus, called the NBUS by Technologic Systems.
The watchdog is made of only one register, called the feed register.
Writing to this register will re-arm the watchdog for a given time (and
enable it if it was disable). It can be disabled by writing a special
value into it.

Reviewed-by: Guenter Roeck 
Signed-off-by: Sebastien Bourdelin 
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - remove the dts and the documentation associated from the driver
  commit (suggested by Shawn Guo)
  - the driver in v3 was acked by Guenter Roeck and no changes on the
  driver have been done.

Changes v2 -> v3:
  - rebase on master
  - remove the timeout table to simplify the logic (suggested by
  Guenter Roeck)
  - fix the set_timeout function (suggested by Guenter Roeck)
  - hardcode the max_hw_heartbeat_ms value based on the ts4600 max
  timeout value supported (suggested by Guenter Roeck)
  - remove the max_timeout usage and set a default timeout value
(suggested by Guenter Roeck)
  - use the devm_watchdog_register_device function instead of
  watchdog_register_device (suggested by Guenter Roeck)
  - v2 was acked by Rob Herring

Changes v1 -> v2:
  - rebase on master
  - retrieve the ts_nbus instantiated by the parent node (suggested by
  Linus Walleij)
  - rename the wdt by watchdog in the device tree and in the
  documentation (suggested by Rob Herring)
  - add a dependency to the TS_NBUS driver in the Kconfig (suggested by
  Guenter Roeck)
  - simplify the set_timeout function (suggested by Guenter Roeck)
  - use the max_hw_heartbeat_ms callback instead of the max_timeout
  callback (suggested by Guenter Roeck)
---
 drivers/watchdog/Kconfig  |  11 +++
 drivers/watchdog/Makefile |   1 +
 drivers/watchdog/ts4600_wdt.c | 185 ++
 3 files changed, 197 insertions(+)
 create mode 100644 drivers/watchdog/ts4600_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c722cbfdc7e6..d50fbc232d9e 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -531,6 +531,17 @@ config NUC900_WATCHDOG
  To compile this driver as a module, choose M here: the
  module will be called nuc900_wdt.
 
+config TS4600_WATCHDOG
+   tristate "TS-4600 Watchdog"
+   depends on TS_NBUS
+   depends on HAS_IOMEM && OF
+   depends on SOC_IMX28 || COMPILE_TEST
+   select WATCHDOG_CORE
+   help
+ Technologic Systems TS-4600 has watchdog timer implemented in
+ an external FPGA. Say Y here if you want to support for the
+ watchdog timer on TS-4600 board.
+
 config TS4800_WATCHDOG
tristate "TS-4800 Watchdog"
depends on HAS_IOMEM && OF
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 56adf9fa67d0..a95aa4a13b39 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
 obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
 obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
 obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
+obj-$(CONFIG_TS4600_WATCHDOG) += ts4600_wdt.o
 obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
 obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
 obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
diff --git a/drivers/watchdog/ts4600_wdt.c b/drivers/watchdog/ts4600_wdt.c
new file mode 100644
index ..ed530dd2f800
--- /dev/null
+++ b/drivers/watchdog/ts4600_wdt.c
@@ -0,0 +1,185 @@
+/*
+ * Watchdog driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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.
+ *
+ * The watchdog on the TS-4600 based boards is in an FPGA and can only be
+ * accessed using a GPIO bit-banged bus called the NBUS by Technologic Systems.
+ * The logic for the watchdog is the same then for the TS-4800 SoM, only the 
way
+ * to access it change, therefore this driver is heavely based on the 
ts4800_wdt
+ * driver from Damien Riegel .
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout,
+   "Watchdog cannot be stopped once started (default="
+   __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * TS-4600 supports the following timeout values:
+ *
+ *   value desc
+ *   -
+ * 0feed for 338ms
+ * 1feed for 2.706s
+ * 2feed for 10.824s
+ * 3disable watchdog
+ */
+#define TS4600_WDT_FEED_2S   0x1
+#define TS4600_WDT_FEED_10S  0x2
+#define TS4600_WDT_DISABLE   0x3
+
+s

[PATCH v5 1/8] of: documentation: add bindings documentation for TS-4600

2017-07-14 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Acked-by: Rob Herring <r...@kernel.org>
Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring <r...@kernel.org>
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.13.0



[PATCH v5 3/8] dt-bindings: bus: Add documentation for the Technologic Systems NBUS

2017-07-14 Thread Sebastien Bourdelin
Add binding documentation for the Technologic Systems NBUS that is used
to interface with peripherals in the FPGA of the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - fix typo (suggested by Rob Herring)

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate child nodes (suggested by Rob Herring)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 Documentation/devicetree/bindings/bus/ts-nbus.txt | 50 +++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt

diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt 
b/Documentation/devicetree/bindings/bus/ts-nbus.txt
new file mode 100644
index ..2a10d065b9fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/ts-nbus.txt
@@ -0,0 +1,50 @@
+Technologic Systems NBUS
+
+The NBUS is a bus used to interface with peripherals in the Technologic
+Systems FPGA on the TS-4600 SoM.
+
+Required properties :
+ - compatible  : "technologic,ts-nbus"
+ - #address-cells  : must be 1
+ - #size-cells : must be 0
+ - pwms: The PWM bound to the FPGA
+ - ts,data-gpios   : The 8 GPIO pins connected to the data lines on the 
FPGA
+ - ts,csn-gpios: The GPIO pin connected to the csn line on the 
FPGA
+ - ts,txrx-gpios   : The GPIO pin connected to the txrx line on the FPGA
+ - ts,strobe-gpios : The GPIO pin connected to the stobe line on the FPGA
+ - ts,ale-gpios: The GPIO pin connected to the ale line on the 
FPGA
+ - ts,rdy-gpios: The GPIO pin connected to the rdy line on the 
FPGA
+
+Child nodes:
+
+The NBUS node can contain zero or more child nodes representing peripherals
+on the bus.
+
+Example:
+
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "...";
+
+   /* ... */
+   };
+   };
-- 
2.13.0



[PATCH v5 0/8] Add board support for TS-4600

2017-07-14 Thread Sebastien Bourdelin
This patch serie adds support for the TS-4600 boards rev A and B. These
boards, manufactured by Technologic Systems, are based on an i.MX28.

This serie include the support for the watchdog which could be enable
at Linux boot time depending on the bootloader.

The watchdog and few peripherals are implemented in a FPGA, and can
only be access using a custom GPIOs bit-banged bus which is called the
NBUS by Technologic Systems.
A driver for this bus is also included and used by the watchdog.

Sebastien Bourdelin (8):
  of: documentation: add bindings documentation for TS-4600
  ARM: dts: TS-4600: add basic device tree
  dt-bindings: bus: Add documentation for the Technologic Systems NBUS
  bus: add driver for the Technologic Systems NBUS
  ARM: dts: TS-4600: add NBUS support
  dt-bindings: watchdog: add documentation for TS4600 watchdog
controller
  watchdog: TS-4600: add driver for TS-4600 watchdog controller
  ARM: dts: TS-4600: add watchdog support

 .../devicetree/bindings/arm/technologic.txt|   5 +
 Documentation/devicetree/bindings/bus/ts-nbus.txt  |  50 +++
 .../devicetree/bindings/watchdog/ts4600-wdt.txt|  16 +
 arch/arm/boot/dts/Makefile |   2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 126 +++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   |  22 ++
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   |  22 ++
 drivers/bus/Kconfig|   8 +
 drivers/bus/Makefile   |   1 +
 drivers/bus/ts-nbus.c  | 375 +
 drivers/watchdog/Kconfig   |  11 +
 drivers/watchdog/Makefile  |   1 +
 drivers/watchdog/ts4600_wdt.c  | 185 ++
 include/linux/ts-nbus.h|  18 +
 14 files changed, 842 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 drivers/watchdog/ts4600_wdt.c
 create mode 100644 include/linux/ts-nbus.h

-- 
2.13.0



[PATCH v5 3/8] dt-bindings: bus: Add documentation for the Technologic Systems NBUS

2017-07-14 Thread Sebastien Bourdelin
Add binding documentation for the Technologic Systems NBUS that is used
to interface with peripherals in the FPGA of the TS-4600 SoM.

Signed-off-by: Sebastien Bourdelin 
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - fix typo (suggested by Rob Herring)

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate child nodes (suggested by Rob Herring)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)
---
 Documentation/devicetree/bindings/bus/ts-nbus.txt | 50 +++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt

diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt 
b/Documentation/devicetree/bindings/bus/ts-nbus.txt
new file mode 100644
index ..2a10d065b9fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/ts-nbus.txt
@@ -0,0 +1,50 @@
+Technologic Systems NBUS
+
+The NBUS is a bus used to interface with peripherals in the Technologic
+Systems FPGA on the TS-4600 SoM.
+
+Required properties :
+ - compatible  : "technologic,ts-nbus"
+ - #address-cells  : must be 1
+ - #size-cells : must be 0
+ - pwms: The PWM bound to the FPGA
+ - ts,data-gpios   : The 8 GPIO pins connected to the data lines on the 
FPGA
+ - ts,csn-gpios: The GPIO pin connected to the csn line on the 
FPGA
+ - ts,txrx-gpios   : The GPIO pin connected to the txrx line on the FPGA
+ - ts,strobe-gpios : The GPIO pin connected to the stobe line on the FPGA
+ - ts,ale-gpios: The GPIO pin connected to the ale line on the 
FPGA
+ - ts,rdy-gpios: The GPIO pin connected to the rdy line on the 
FPGA
+
+Child nodes:
+
+The NBUS node can contain zero or more child nodes representing peripherals
+on the bus.
+
+Example:
+
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "...";
+
+   /* ... */
+   };
+   };
-- 
2.13.0



[PATCH v5 0/8] Add board support for TS-4600

2017-07-14 Thread Sebastien Bourdelin
This patch serie adds support for the TS-4600 boards rev A and B. These
boards, manufactured by Technologic Systems, are based on an i.MX28.

This serie include the support for the watchdog which could be enable
at Linux boot time depending on the bootloader.

The watchdog and few peripherals are implemented in a FPGA, and can
only be access using a custom GPIOs bit-banged bus which is called the
NBUS by Technologic Systems.
A driver for this bus is also included and used by the watchdog.

Sebastien Bourdelin (8):
  of: documentation: add bindings documentation for TS-4600
  ARM: dts: TS-4600: add basic device tree
  dt-bindings: bus: Add documentation for the Technologic Systems NBUS
  bus: add driver for the Technologic Systems NBUS
  ARM: dts: TS-4600: add NBUS support
  dt-bindings: watchdog: add documentation for TS4600 watchdog
controller
  watchdog: TS-4600: add driver for TS-4600 watchdog controller
  ARM: dts: TS-4600: add watchdog support

 .../devicetree/bindings/arm/technologic.txt|   5 +
 Documentation/devicetree/bindings/bus/ts-nbus.txt  |  50 +++
 .../devicetree/bindings/watchdog/ts4600-wdt.txt|  16 +
 arch/arm/boot/dts/Makefile |   2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 126 +++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   |  22 ++
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   |  22 ++
 drivers/bus/Kconfig|   8 +
 drivers/bus/Makefile   |   1 +
 drivers/bus/ts-nbus.c  | 375 +
 drivers/watchdog/Kconfig   |  11 +
 drivers/watchdog/Makefile  |   1 +
 drivers/watchdog/ts4600_wdt.c  | 185 ++
 include/linux/ts-nbus.h|  18 +
 14 files changed, 842 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 drivers/watchdog/ts4600_wdt.c
 create mode 100644 include/linux/ts-nbus.h

-- 
2.13.0



[PATCH v5 1/8] of: documentation: add bindings documentation for TS-4600

2017-07-14 Thread Sebastien Bourdelin
This adds the documentation for the TS-4600 by Technologic Systems.

Acked-by: Rob Herring 
Signed-off-by: Sebastien Bourdelin 
---
Changes v4 -> v5:
  - fix missing signed off

Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - add ack by Rob Herring 
---
 Documentation/devicetree/bindings/arm/technologic.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/technologic.txt 
b/Documentation/devicetree/bindings/arm/technologic.txt
index 33797acad846..e9d6d6575566 100644
--- a/Documentation/devicetree/bindings/arm/technologic.txt
+++ b/Documentation/devicetree/bindings/arm/technologic.txt
@@ -1,6 +1,11 @@
 Technologic Systems Platforms Device Tree Bindings
 --
 
+TS-4600 is a System-on-Module based on the Freescale i.MX28 System-on-Chip.
+It can be mounted on a carrier board providing additional peripheral 
connectors.
+Required root node properties:
+   - compatible = "technologic,imx28-ts4600", "fsl,imx28"
+
 TS-4800 board
 Required root node properties:
- compatible = "technologic,imx51-ts4800", "fsl,imx51";
-- 
2.13.0



[PATCH v4 5/8] ARM: dts: TS-4600: add NBUS support

2017-07-14 Thread Sebastien Bourdelin
This commit enables the NBUS on the TS-4600, using the ts-nbus driver.

---
Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate the child nodes (suggested by Rob Herring)
  - add the vendor prefix to all gpio (suggested by Rob Herring)

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 43 ++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
index 04bd5a5c0cb4..a90bd934e4a3 100644
--- a/arch/arm/boot/dts/imx28-ts4600-common.dtsi
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -44,6 +44,28 @@
fsl,pull-up = ;
};
 
+   nbus_pins: nbus_pins {
+   fsl,pinmux-ids = <
+   MX28_PAD_GPMI_D00__GPIO_0_0
+   MX28_PAD_GPMI_D01__GPIO_0_1
+   MX28_PAD_GPMI_D02__GPIO_0_2
+   MX28_PAD_GPMI_D03__GPIO_0_3
+   MX28_PAD_GPMI_D04__GPIO_0_4
+   MX28_PAD_GPMI_D05__GPIO_0_5
+   MX28_PAD_GPMI_D06__GPIO_0_6
+   MX28_PAD_GPMI_D07__GPIO_0_7
+   MX28_PAD_GPMI_CE0N__GPIO_0_16
+   MX28_PAD_GPMI_RDY1__GPIO_0_21
+   MX28_PAD_GPMI_RDN__GPIO_0_24
+   MX28_PAD_GPMI_WRN__GPIO_0_25
+   MX28_PAD_GPMI_ALE__GPIO_0_26
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+
+   };
+
};
};
 
@@ -75,4 +97,25 @@
};
};
 
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+   };
+
 };
-- 
2.13.0



[PATCH v4 6/8] dt-bindings: watchdog: add documentation for TS4600 watchdog controller

2017-07-14 Thread Sebastien Bourdelin
This patch adds dt-binding documentation for TS4600 watchdog controller.

Acked-by: Rob Herring <r...@kernel.org>
---
v4:
  - this documentation was previously merged with the watchdog driver
  and had been acked by Rob Herring, no changes have been done since.
Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 .../devicetree/bindings/watchdog/ts4600-wdt.txt  | 16 
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt

diff --git a/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
new file mode 100644
index ..7de00ceae341
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
@@ -0,0 +1,16 @@
+TS-4600 Technologic Systems Watchdog
+
+Required properties:
+- compatible: must be "technologic,ts4600-wdt"
+- reg: offset to the FPGA's watchdog register
+
+Optional property:
+- timeout-sec: contains the watchdog timeout in seconds.
+
+Example:
+
+watchdog {
+   compatible = "technologic,ts4600-wdt";
+   reg = <0x2a>;
+   timeout-sec = <10>;
+};
-- 
2.13.0



[PATCH v4 5/8] ARM: dts: TS-4600: add NBUS support

2017-07-14 Thread Sebastien Bourdelin
This commit enables the NBUS on the TS-4600, using the ts-nbus driver.

---
Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate the child nodes (suggested by Rob Herring)
  - add the vendor prefix to all gpio (suggested by Rob Herring)

Signed-off-by: Sebastien Bourdelin 
---
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 43 ++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
index 04bd5a5c0cb4..a90bd934e4a3 100644
--- a/arch/arm/boot/dts/imx28-ts4600-common.dtsi
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -44,6 +44,28 @@
fsl,pull-up = ;
};
 
+   nbus_pins: nbus_pins {
+   fsl,pinmux-ids = <
+   MX28_PAD_GPMI_D00__GPIO_0_0
+   MX28_PAD_GPMI_D01__GPIO_0_1
+   MX28_PAD_GPMI_D02__GPIO_0_2
+   MX28_PAD_GPMI_D03__GPIO_0_3
+   MX28_PAD_GPMI_D04__GPIO_0_4
+   MX28_PAD_GPMI_D05__GPIO_0_5
+   MX28_PAD_GPMI_D06__GPIO_0_6
+   MX28_PAD_GPMI_D07__GPIO_0_7
+   MX28_PAD_GPMI_CE0N__GPIO_0_16
+   MX28_PAD_GPMI_RDY1__GPIO_0_21
+   MX28_PAD_GPMI_RDN__GPIO_0_24
+   MX28_PAD_GPMI_WRN__GPIO_0_25
+   MX28_PAD_GPMI_ALE__GPIO_0_26
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+
+   };
+
};
};
 
@@ -75,4 +97,25 @@
};
};
 
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+   };
+
 };
-- 
2.13.0



[PATCH v4 6/8] dt-bindings: watchdog: add documentation for TS4600 watchdog controller

2017-07-14 Thread Sebastien Bourdelin
This patch adds dt-binding documentation for TS4600 watchdog controller.

Acked-by: Rob Herring 
---
v4:
  - this documentation was previously merged with the watchdog driver
  and had been acked by Rob Herring, no changes have been done since.
Signed-off-by: Sebastien Bourdelin 
---
 .../devicetree/bindings/watchdog/ts4600-wdt.txt  | 16 
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt

diff --git a/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
new file mode 100644
index ..7de00ceae341
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
@@ -0,0 +1,16 @@
+TS-4600 Technologic Systems Watchdog
+
+Required properties:
+- compatible: must be "technologic,ts4600-wdt"
+- reg: offset to the FPGA's watchdog register
+
+Optional property:
+- timeout-sec: contains the watchdog timeout in seconds.
+
+Example:
+
+watchdog {
+   compatible = "technologic,ts4600-wdt";
+   reg = <0x2a>;
+   timeout-sec = <10>;
+};
-- 
2.13.0



[PATCH v4 2/8] ARM: dts: TS-4600: add basic device tree

2017-07-14 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

---
Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 arch/arm/boot/dts/Makefile |  2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 78 ++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   | 22 +
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   | 22 +
 4 files changed, 124 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4b17f35dc9a7..a3c8b7af192b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -525,6 +525,8 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600-rev-a.dtb \
+   imx28-ts4600-rev-b.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
new file mode 100644
index ..04bd5a5c0cb4
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+   pinctrl-names = "default";
+
+   en_sd_pwr: en_sd_pwr {
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   regulators {
+   compatible = "simple-bus";
+
+   reg_vddio_sd0: vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 0>;
+   };
+   };
+
+};
diff --git a/arch/arm/boot/dts/imx28-ts4600-rev-a.dts 
b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
new file mode 100644
index ..e8cb72988fcf
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtai

[PATCH v4 2/8] ARM: dts: TS-4600: add basic device tree

2017-07-14 Thread Sebastien Bourdelin
These device trees add support for the TS-4600 by Technologic Systems.

More details here:
  http://wiki.embeddedarm.com/wiki/TS-4600

---
Changes v3 -> v4:
  - rebase on master

Changes v2 -> v3:
  - rebase on master

Changes v1 -> v2:
  - rebase on master

Signed-off-by: Sebastien Bourdelin 
---
 arch/arm/boot/dts/Makefile |  2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 78 ++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   | 22 +
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   | 22 +
 4 files changed, 124 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4b17f35dc9a7..a3c8b7af192b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -525,6 +525,8 @@ dtb-$(CONFIG_ARCH_MXS) += \
imx28-m28cu3.dtb \
imx28-m28evk.dtb \
imx28-sps1.dtb \
+   imx28-ts4600-rev-a.dtb \
+   imx28-ts4600-rev-b.dtb \
imx28-tx28.dtb
 dtb-$(CONFIG_ARCH_NOMADIK) += \
ste-nomadik-s8815.dtb \
diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
new file mode 100644
index ..04bd5a5c0cb4
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx28.dtsi"
+#include "dt-bindings/gpio/gpio.h"
+
+/ {
+
+   compatible = "technologic,imx28-ts4600", "fsl,imx28";
+
+   apb@8000 {
+   apbh@8000 {
+   ssp0: ssp@8001 {
+   compatible = "fsl,imx28-mmc";
+   pinctrl-names = "default";
+   pinctrl-0 = <_4bit_pins_a
+_sck_cfg
+_sd_pwr>;
+   broken-cd = <1>;
+   bus-width = <4>;
+   vmmc-supply = <_vddio_sd0>;
+   status = "okay";
+   };
+
+   pinctrl@80018000 {
+   pinctrl-names = "default";
+
+   en_sd_pwr: en_sd_pwr {
+   fsl,pinmux-ids = <
+   MX28_PAD_PWM3__GPIO_3_28
+   >;
+   fsl,drive-strength = ;
+   fsl,voltage = ;
+   fsl,pull-up = ;
+   };
+
+   };
+   };
+
+   apbx@8004 {
+   pwm: pwm@80064000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+
+   duart: serial@80074000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+   };
+   };
+   };
+
+   regulators {
+   compatible = "simple-bus";
+
+   reg_vddio_sd0: vddio-sd0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio-sd0";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   gpio = < 28 0>;
+   };
+   };
+
+};
diff --git a/arch/arm/boot/dts/imx28-ts4600-rev-a.dts 
b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
new file mode 100644
index ..e8cb72988fcf
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-ts4600-rev-a.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 Savoir-Faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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:

[PATCH v4 7/8] watchdog: TS-4600: add driver for TS-4600 watchdog controller

2017-07-14 Thread Sebastien Bourdelin
This watchdog is instantiated in a FPGA and can only be access using a
GPIOs bit-banged bus, called the NBUS by Technologic Systems.
The watchdog is made of only one register, called the feed register.
Writing to this register will re-arm the watchdog for a given time (and
enable it if it was disable). It can be disabled by writing a special
value into it.

Reviewed-by: Guenter Roeck <li...@roeck-us.net>
---
Changes v3 -> v4:
  - rebase on master
  - remove the dts and the documentation associated from the driver
  commit (suggested by Shawn Guo)
  - the driver in v3 was acked by Guenter Roeck and no changes on the
  driver have been done.

Changes v2 -> v3:
  - rebase on master
  - remove the timeout table to simplify the logic (suggested by
  Guenter Roeck)
  - fix the set_timeout function (suggested by Guenter Roeck)
  - hardcode the max_hw_heartbeat_ms value based on the ts4600 max
  timeout value supported (suggested by Guenter Roeck)
  - remove the max_timeout usage and set a default timeout value
(suggested by Guenter Roeck)
  - use the devm_watchdog_register_device function instead of
  watchdog_register_device (suggested by Guenter Roeck)
  - v2 was acked by Rob Herring

Changes v1 -> v2:
  - rebase on master
  - retrieve the ts_nbus instantiated by the parent node (suggested by
  Linus Walleij)
  - rename the wdt by watchdog in the device tree and in the
  documentation (suggested by Rob Herring)
  - add a dependency to the TS_NBUS driver in the Kconfig (suggested by
  Guenter Roeck)
  - simplify the set_timeout function (suggested by Guenter Roeck)
  - use the max_hw_heartbeat_ms callback instead of the max_timeout
  callback (suggested by Guenter Roeck)
Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 drivers/watchdog/Kconfig  |  11 +++
 drivers/watchdog/Makefile |   1 +
 drivers/watchdog/ts4600_wdt.c | 185 ++
 3 files changed, 197 insertions(+)
 create mode 100644 drivers/watchdog/ts4600_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c722cbfdc7e6..d50fbc232d9e 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -531,6 +531,17 @@ config NUC900_WATCHDOG
  To compile this driver as a module, choose M here: the
  module will be called nuc900_wdt.
 
+config TS4600_WATCHDOG
+   tristate "TS-4600 Watchdog"
+   depends on TS_NBUS
+   depends on HAS_IOMEM && OF
+   depends on SOC_IMX28 || COMPILE_TEST
+   select WATCHDOG_CORE
+   help
+ Technologic Systems TS-4600 has watchdog timer implemented in
+ an external FPGA. Say Y here if you want to support for the
+ watchdog timer on TS-4600 board.
+
 config TS4800_WATCHDOG
tristate "TS-4800 Watchdog"
depends on HAS_IOMEM && OF
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 56adf9fa67d0..a95aa4a13b39 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
 obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
 obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
 obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
+obj-$(CONFIG_TS4600_WATCHDOG) += ts4600_wdt.o
 obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
 obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
 obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
diff --git a/drivers/watchdog/ts4600_wdt.c b/drivers/watchdog/ts4600_wdt.c
new file mode 100644
index ..ed530dd2f800
--- /dev/null
+++ b/drivers/watchdog/ts4600_wdt.c
@@ -0,0 +1,185 @@
+/*
+ * Watchdog driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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.
+ *
+ * The watchdog on the TS-4600 based boards is in an FPGA and can only be
+ * accessed using a GPIO bit-banged bus called the NBUS by Technologic Systems.
+ * The logic for the watchdog is the same then for the TS-4800 SoM, only the 
way
+ * to access it change, therefore this driver is heavely based on the 
ts4800_wdt
+ * driver from Damien Riegel <damien.rie...@savoirfairelinux.com>.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout,
+   "Watchdog cannot be stopped once started (default="
+   __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * TS-4600 supports the following timeout values:
+ *
+ *   value desc
+ *   -
+ * 0feed for 338ms
+ * 1feed for 2.706s
+ * 2feed for 10.824s
+ * 3disable watchdog
+ */
+#define TS460

[PATCH v4 7/8] watchdog: TS-4600: add driver for TS-4600 watchdog controller

2017-07-14 Thread Sebastien Bourdelin
This watchdog is instantiated in a FPGA and can only be access using a
GPIOs bit-banged bus, called the NBUS by Technologic Systems.
The watchdog is made of only one register, called the feed register.
Writing to this register will re-arm the watchdog for a given time (and
enable it if it was disable). It can be disabled by writing a special
value into it.

Reviewed-by: Guenter Roeck 
---
Changes v3 -> v4:
  - rebase on master
  - remove the dts and the documentation associated from the driver
  commit (suggested by Shawn Guo)
  - the driver in v3 was acked by Guenter Roeck and no changes on the
  driver have been done.

Changes v2 -> v3:
  - rebase on master
  - remove the timeout table to simplify the logic (suggested by
  Guenter Roeck)
  - fix the set_timeout function (suggested by Guenter Roeck)
  - hardcode the max_hw_heartbeat_ms value based on the ts4600 max
  timeout value supported (suggested by Guenter Roeck)
  - remove the max_timeout usage and set a default timeout value
(suggested by Guenter Roeck)
  - use the devm_watchdog_register_device function instead of
  watchdog_register_device (suggested by Guenter Roeck)
  - v2 was acked by Rob Herring

Changes v1 -> v2:
  - rebase on master
  - retrieve the ts_nbus instantiated by the parent node (suggested by
  Linus Walleij)
  - rename the wdt by watchdog in the device tree and in the
  documentation (suggested by Rob Herring)
  - add a dependency to the TS_NBUS driver in the Kconfig (suggested by
  Guenter Roeck)
  - simplify the set_timeout function (suggested by Guenter Roeck)
  - use the max_hw_heartbeat_ms callback instead of the max_timeout
  callback (suggested by Guenter Roeck)
Signed-off-by: Sebastien Bourdelin 
---
 drivers/watchdog/Kconfig  |  11 +++
 drivers/watchdog/Makefile |   1 +
 drivers/watchdog/ts4600_wdt.c | 185 ++
 3 files changed, 197 insertions(+)
 create mode 100644 drivers/watchdog/ts4600_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c722cbfdc7e6..d50fbc232d9e 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -531,6 +531,17 @@ config NUC900_WATCHDOG
  To compile this driver as a module, choose M here: the
  module will be called nuc900_wdt.
 
+config TS4600_WATCHDOG
+   tristate "TS-4600 Watchdog"
+   depends on TS_NBUS
+   depends on HAS_IOMEM && OF
+   depends on SOC_IMX28 || COMPILE_TEST
+   select WATCHDOG_CORE
+   help
+ Technologic Systems TS-4600 has watchdog timer implemented in
+ an external FPGA. Say Y here if you want to support for the
+ watchdog timer on TS-4600 board.
+
 config TS4800_WATCHDOG
tristate "TS-4800 Watchdog"
depends on HAS_IOMEM && OF
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 56adf9fa67d0..a95aa4a13b39 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
 obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
 obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
 obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
+obj-$(CONFIG_TS4600_WATCHDOG) += ts4600_wdt.o
 obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
 obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
 obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
diff --git a/drivers/watchdog/ts4600_wdt.c b/drivers/watchdog/ts4600_wdt.c
new file mode 100644
index ..ed530dd2f800
--- /dev/null
+++ b/drivers/watchdog/ts4600_wdt.c
@@ -0,0 +1,185 @@
+/*
+ * Watchdog driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin 
+ *
+ * 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.
+ *
+ * The watchdog on the TS-4600 based boards is in an FPGA and can only be
+ * accessed using a GPIO bit-banged bus called the NBUS by Technologic Systems.
+ * The logic for the watchdog is the same then for the TS-4800 SoM, only the 
way
+ * to access it change, therefore this driver is heavely based on the 
ts4800_wdt
+ * driver from Damien Riegel .
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout,
+   "Watchdog cannot be stopped once started (default="
+   __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * TS-4600 supports the following timeout values:
+ *
+ *   value desc
+ *   -
+ * 0feed for 338ms
+ * 1feed for 2.706s
+ * 2feed for 10.824s
+ * 3disable watchdog
+ */
+#define TS4600_WDT_FEED_2S   0x1
+#define TS4600_WDT_FEED_10S  0x2
+#define TS4600_WDT_DISABLE   0x3
+
+struct ts4600_wdt {
+   struct 

[PATCH v4 8/8] ARM: dts: TS-4600: add watchdog support

2017-07-14 Thread Sebastien Bourdelin
This enables support for the watchdog located in the FPGA.

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
index a90bd934e4a3..9e177d33ba9c 100644
--- a/arch/arm/boot/dts/imx28-ts4600-common.dtsi
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -116,6 +116,11 @@
ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "technologic,ts4600-wdt";
+   reg = <0x2a>;
+   };
};
 
 };
-- 
2.13.0



[PATCH v4 8/8] ARM: dts: TS-4600: add watchdog support

2017-07-14 Thread Sebastien Bourdelin
This enables support for the watchdog located in the FPGA.

Signed-off-by: Sebastien Bourdelin 
---
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-ts4600-common.dtsi 
b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
index a90bd934e4a3..9e177d33ba9c 100644
--- a/arch/arm/boot/dts/imx28-ts4600-common.dtsi
+++ b/arch/arm/boot/dts/imx28-ts4600-common.dtsi
@@ -116,6 +116,11 @@
ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "technologic,ts4600-wdt";
+   reg = <0x2a>;
+   };
};
 
 };
-- 
2.13.0



[PATCH v4 0/8] Add board support for TS-4600

2017-07-14 Thread Sebastien Bourdelin
This patch serie adds support for the TS-4600 boards rev A and B. These
boards, manufactured by Technologic Systems, are based on an i.MX28.

This serie include the support for the watchdog which could be enable
at Linux boot time depending on the bootloader.

The watchdog and few peripherals are implemented in a FPGA, and can
only be access using a custom GPIOs bit-banged bus which is called the
NBUS by Technologic Systems.
A driver for this bus is also included and used by the watchdog.

Sebastien Bourdelin (8):
  of: documentation: add bindings documentation for TS-4600
  ARM: dts: TS-4600: add basic device tree
  dt-bindings: bus: Add documentation for the Technologic Systems NBUS
  bus: add driver for the Technologic Systems NBUS
  ARM: dts: TS-4600: add NBUS support
  dt-bindings: watchdog: add documentation for TS4600 watchdog
controller
  watchdog: TS-4600: add driver for TS-4600 watchdog controller
  ARM: dts: TS-4600: add watchdog support

 .../devicetree/bindings/arm/technologic.txt|   5 +
 Documentation/devicetree/bindings/bus/ts-nbus.txt  |  50 +++
 .../devicetree/bindings/watchdog/ts4600-wdt.txt|  16 +
 arch/arm/boot/dts/Makefile |   2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 126 +++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   |  22 ++
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   |  22 ++
 drivers/bus/Kconfig|   8 +
 drivers/bus/Makefile   |   1 +
 drivers/bus/ts-nbus.c  | 375 +
 drivers/watchdog/Kconfig   |  11 +
 drivers/watchdog/Makefile  |   1 +
 drivers/watchdog/ts4600_wdt.c  | 185 ++
 include/linux/ts-nbus.h|  18 +
 14 files changed, 842 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 drivers/watchdog/ts4600_wdt.c
 create mode 100644 include/linux/ts-nbus.h

-- 
2.13.0



[PATCH v4 0/8] Add board support for TS-4600

2017-07-14 Thread Sebastien Bourdelin
This patch serie adds support for the TS-4600 boards rev A and B. These
boards, manufactured by Technologic Systems, are based on an i.MX28.

This serie include the support for the watchdog which could be enable
at Linux boot time depending on the bootloader.

The watchdog and few peripherals are implemented in a FPGA, and can
only be access using a custom GPIOs bit-banged bus which is called the
NBUS by Technologic Systems.
A driver for this bus is also included and used by the watchdog.

Sebastien Bourdelin (8):
  of: documentation: add bindings documentation for TS-4600
  ARM: dts: TS-4600: add basic device tree
  dt-bindings: bus: Add documentation for the Technologic Systems NBUS
  bus: add driver for the Technologic Systems NBUS
  ARM: dts: TS-4600: add NBUS support
  dt-bindings: watchdog: add documentation for TS4600 watchdog
controller
  watchdog: TS-4600: add driver for TS-4600 watchdog controller
  ARM: dts: TS-4600: add watchdog support

 .../devicetree/bindings/arm/technologic.txt|   5 +
 Documentation/devicetree/bindings/bus/ts-nbus.txt  |  50 +++
 .../devicetree/bindings/watchdog/ts4600-wdt.txt|  16 +
 arch/arm/boot/dts/Makefile |   2 +
 arch/arm/boot/dts/imx28-ts4600-common.dtsi | 126 +++
 arch/arm/boot/dts/imx28-ts4600-rev-a.dts   |  22 ++
 arch/arm/boot/dts/imx28-ts4600-rev-b.dts   |  22 ++
 drivers/bus/Kconfig|   8 +
 drivers/bus/Makefile   |   1 +
 drivers/bus/ts-nbus.c  | 375 +
 drivers/watchdog/Kconfig   |  11 +
 drivers/watchdog/Makefile  |   1 +
 drivers/watchdog/ts4600_wdt.c  | 185 ++
 include/linux/ts-nbus.h|  18 +
 14 files changed, 842 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-common.dtsi
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-a.dts
 create mode 100644 arch/arm/boot/dts/imx28-ts4600-rev-b.dts
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 drivers/watchdog/ts4600_wdt.c
 create mode 100644 include/linux/ts-nbus.h

-- 
2.13.0



[PATCH v4 4/8] bus: add driver for the Technologic Systems NBUS

2017-07-14 Thread Sebastien Bourdelin
This driver implements a GPIOs bit-banged bus, called the NBUS by
Technologic Systems. It is used to communicate with the peripherals in
the FPGA on the TS-4600 SoM.

---
Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - remove all call to the "inline" keyword in functions to let the
  compiler decide when required (suggested by Linus Walleij)
  - move the struct ts_nbus to the driver code instead of its header
  file (suggested by Linus Walleij)
  - use the bitops header and the BIT macro (suggested by Linus Walleij)
  - move the mutex to the struct ts_nbus instead to have it statically
  declared in the driver code (suggested by Linus Walleij)
  - remove the ts_nbus_set_mode function to simplify the logic
  (suggested by Linus Walleij)
  - the nbus will always need 8 data lines, remove the use of the
  ndescs when dealing with the data gpios and hardcode the value for
  simplicity instead (suggested by Linus Walleij)
  - add more comments (suggested by Linus Walleij)
  - rework all the ts_nbus_read_... functions to propagate the
  gpiod_get_value_... errno code (suggested by Linus Walleij)
  - few typos and code reformating for lisibility

Changes v1 -> v2:
  - rebase on master
  - the driver now populate its child nodes
  - remove the 'default y' option from the Kconfig
  - rework the driver to not use singleton anymore (suggested by Linus
  Walleij)
  - replace the use of the legacy GPIO API with gpiod (suggested by
  Linus Walleij)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 drivers/bus/Kconfig |   8 ++
 drivers/bus/Makefile|   1 +
 drivers/bus/ts-nbus.c   | 375 
 include/linux/ts-nbus.h |  18 +++
 4 files changed, 402 insertions(+)
 create mode 100644 drivers/bus/ts-nbus.c
 create mode 100644 include/linux/ts-nbus.h

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 2408ea38a39c..3465e0decac5 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -157,6 +157,14 @@ config TEGRA_GMI
  Driver for the Tegra Generic Memory Interface bus which can be used
  to attach devices such as NOR, UART, FPGA and more.
 
+config TS_NBUS
+   tristate "Technologic Systems NBUS Driver"
+   depends on SOC_IMX28
+   depends on OF_GPIO && PWM
+   help
+ Driver for the Technologic Systems NBUS which is used to interface
+ with the peripherals in the FPGA of the TS-4600 SoM.
+
 config UNIPHIER_SYSTEM_BUS
tristate "UniPhier System Bus driver"
depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index cc6364bec054..72377f77651c 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SUNXI_RSB)   += sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)   += tegra-aconnect.o
 obj-$(CONFIG_TEGRA_GMI)+= tegra-gmi.o
+obj-$(CONFIG_TS_NBUS)  += ts-nbus.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS)  += uniphier-system-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)  += vexpress-config.o
 
diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
new file mode 100644
index ..073fd9011154
--- /dev/null
+++ b/drivers/bus/ts-nbus.c
@@ -0,0 +1,375 @@
+/*
+ * NBUS driver for TS-4600 based boards
+ *
+ * Copyright (c) 2016 - Savoir-faire Linux
+ * Author: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
+ *
+ * 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.
+ *
+ * This driver implements a GPIOs bit-banged bus, called the NBUS by 
Technologic
+ * Systems. It is used to communicate with the peripherals in the FPGA on the
+ * TS-4600 SoM.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TS_NBUS_DIRECTION_IN  0
+#define TS_NBUS_DIRECTION_OUT 1
+#define TS_NBUS_WRITE_ADR 0
+#define TS_NBUS_WRITE_VAL 1
+
+struct ts_nbus {
+   struct pwm_device *pwm;
+   struct gpio_descs *data;
+   struct gpio_desc *csn;
+   struct gpio_desc *txrx;
+   struct gpio_desc *strobe;
+   struct gpio_desc *ale;
+   struct gpio_desc *rdy;
+   struct mutex lock;
+};
+
+/*
+ * request all gpios required by the bus.
+ */
+static int ts_nbus_init_pdata(struct platform_device *pdev, struct ts_nbus
+   *ts_nbus)
+{
+   ts_nbus->data = devm_gpiod_get_array(>dev, "ts,data",
+   GPIOD_OUT_HIGH);
+   if (IS_ERR(ts_nbus->data)) {
+   dev_err(>dev, "failed to retriev

[PATCH v4 3/8] dt-bindings: bus: Add documentation for the Technologic Systems NBUS

2017-07-14 Thread Sebastien Bourdelin
Add binding documentation for the Technologic Systems NBUS that is used
to interface with peripherals in the FPGA of the TS-4600 SoM.

---
Changes v3 -> v4:
  - rebase on master
  - fix vendor prefixes for dts properties (suggested by Rob Herring)
  - v3 was acked by Linus Walleij

Changes v2 -> v3:
  - rebase on master
  - fix typo (suggested by Rob Herring)

Changes v1 -> v2:
  - rebase on master
  - remove the simple-bus compatibility as the root node will now
  populate child nodes (suggested by Rob Herring)
  - use the ts vendor prefix for gpios (suggested by Rob Herring)

Signed-off-by: Sebastien Bourdelin <sebastien.bourde...@savoirfairelinux.com>
---
 Documentation/devicetree/bindings/bus/ts-nbus.txt | 50 +++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt

diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt 
b/Documentation/devicetree/bindings/bus/ts-nbus.txt
new file mode 100644
index ..2a10d065b9fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/ts-nbus.txt
@@ -0,0 +1,50 @@
+Technologic Systems NBUS
+
+The NBUS is a bus used to interface with peripherals in the Technologic
+Systems FPGA on the TS-4600 SoM.
+
+Required properties :
+ - compatible  : "technologic,ts-nbus"
+ - #address-cells  : must be 1
+ - #size-cells : must be 0
+ - pwms: The PWM bound to the FPGA
+ - ts,data-gpios   : The 8 GPIO pins connected to the data lines on the 
FPGA
+ - ts,csn-gpios: The GPIO pin connected to the csn line on the 
FPGA
+ - ts,txrx-gpios   : The GPIO pin connected to the txrx line on the FPGA
+ - ts,strobe-gpios : The GPIO pin connected to the stobe line on the FPGA
+ - ts,ale-gpios: The GPIO pin connected to the ale line on the 
FPGA
+ - ts,rdy-gpios: The GPIO pin connected to the rdy line on the 
FPGA
+
+Child nodes:
+
+The NBUS node can contain zero or more child nodes representing peripherals
+on the bus.
+
+Example:
+
+   nbus {
+   compatible = "technologic,ts-nbus";
+   pinctrl-0 = <_pins>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pwms = < 2 83>;
+   ts,data-gpios   = < 0 GPIO_ACTIVE_HIGH
+   1 GPIO_ACTIVE_HIGH
+   2 GPIO_ACTIVE_HIGH
+   3 GPIO_ACTIVE_HIGH
+   4 GPIO_ACTIVE_HIGH
+   5 GPIO_ACTIVE_HIGH
+   6 GPIO_ACTIVE_HIGH
+   7 GPIO_ACTIVE_HIGH>;
+   ts,csn-gpios= < 16 GPIO_ACTIVE_HIGH>;
+   ts,txrx-gpios   = < 24 GPIO_ACTIVE_HIGH>;
+   ts,strobe-gpios = < 25 GPIO_ACTIVE_HIGH>;
+   ts,ale-gpios= < 26 GPIO_ACTIVE_HIGH>;
+   ts,rdy-gpios= < 21 GPIO_ACTIVE_HIGH>;
+
+   watchdog@2a {
+   compatible = "...";
+
+   /* ... */
+   };
+   };
-- 
2.13.0



  1   2   >