Apalis T30 Mainline Kernel 4.14.0 1-Wire Device

Dear Toradex Support Team,
I have compiled the latest stable kernel 4.14.0 for Apalis T30 and it is working fine except the 1-wire seems that is not working.
I have enabled the 1-wire bus master and thermal slave in Kernel and have connected the data wire of DS18B20 Temperature Sensor to GPIO6 along with GND and +3.3v but the 1w bus cannot see the device.

Can you please advise if the 1-Wire is enabled in mainline kernel 4.14.0?
If not, is there anyway I can have a patch to add it to this kernel?

Thanks,

As there is no Tegra specific 1-Wire driver available in mainline you may revert to using the bit-banging GPIO 1-Wire driver. It’s device tree binding would be explained here.

First, you will have to make sure the pin muxing is proper. As can be seen from the Apalis T30 datasheet, table 3-1, page 13, GPIO6 is special in a sense that two SoC balls route to that MXM3 pin 13. The reason for that is that NVIDIA missed assigning a GPIO controller to the OWR pin. The proper muxing for your case would look as follows:

diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi b/arch/arm/boot/dts/tegra30-apalis.dtsi
index d1d21ec2a844..66faeffcaec1 100644
--- a/arch/arm/boot/dts/tegra30-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
@@ -152,6 +152,29 @@
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
 
+                       /* Apalis GPIO */
+                       kb_col0_pq0 {
+                               nvidia,pins = "kb_col0_pq0",
+                                             "kb_col1_pq1",
+                                             "kb_row10_ps2",
+                                             "kb_row11_ps3",
+                                             "kb_row12_ps4",
+                                             "kb_row13_ps5",
+                                             "kb_row14_ps6",
+                                             "kb_row15_ps7";
+                               nvidia,function = "kbc";
+                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
+                               nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+                       };
+                       owr {
+                               nvidia,pins = "owr";
+                               nvidia,function = "owr";
+                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,tristate = <TEGRA_PIN_ENABLE>;
+                               nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+                       };
+
                        /* Apalis I2C3 */
                        cam_i2c_scl_pbb1 {
                                nvidia,pins = "cam_i2c_scl_pbb1",

Then secondly, you will need to use the proper GPIO number which as can be seen from the Apalis T30 datasheet, section 4.4, page 21, is GPIO Q0 which in turn according to the following table on our developer website is GPIO 128.

You are a legend @marcel.tx , That was a proper answer and this is the mean of support, thank you Marcel.

You are very welcome and sorry that I did not realise the full extent of the issue from the beginning.

For every one else information:
As of today 20th April, 2018 ,this answer also have tested on Mainline Kernel 4.16.3 and 1W is working just fine.

You are a legend @marcel.tx ,
That was a proper answer and this is the mean of support, thank you Marcel.

I have added the code snippet above and added the device tree for onewire similar to bellow and everything is working just great now:

        /* Apalis GPIO */
        kb_col0_pq0 {
                nvidia,pins = "kb_col0_pq0",
                              "kb_col1_pq1",
                              "kb_row10_ps2",
                              "kb_row11_ps3",
                              "kb_row12_ps4",
                              "kb_row13_ps5",
                              "kb_row14_ps6",
                              "kb_row15_ps7";
                nvidia,function = "kbc";
                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                nvidia,enable-input = <TEGRA_PIN_ENABLE>;
        };
        owr {
                nvidia,pins = "owr";
                nvidia,function = "owr";
                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                nvidia,tristate = <TEGRA_PIN_ENABLE>;
                nvidia,enable-input = <TEGRA_PIN_DISABLE>;
        };

        onewire@0 {
                label = "OneWire_Thermal";
                compatible = "w1-gpio";
                gpios = <&gpio 128 GPIO_ACTIVE_HIGH>;
        };

just for everyone else following this answer, the device tree file for ApalisT30 using the Ixora carrier board in mainline kernel is this file: /arch/arm/boot/dts/tegra30-apalis-eval.dts

The Dallas DS18b20 Temperature Sensor connection on Ixora carrier board are as bellow:

Pin(7) -> GRN
Pin(18) -> data
Pin(29) -> +3.3v

thanks for the update.