Skip to contentSkip to conversation

Add support for 1wire protocol and 1wire eeproms

PATCH New Eugen Hristev 2 participants 69 messages Sep 18, 2018 – Sep 29, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v4 cover Add support for 1wire protocol and 1wire eeproms

Hello Tom,

I rebased this series on the latest u-boot/master, and updated to version4. Also a small fix in one of the patches.
I did not receive any feedback since v3 (August 20th).
Can you please let me know if there are any more requirements for the features to be accepted? So I can work on them.

Thanks !

Below is the original + updated cover letter:

This is a patch series originally written by Maxime Ripard,
https://lists.denx.de/pipermail/u-boot/2016-November/272138.html

titled:

[U-Boot] [PATCH RESEND 0/9] sunxi: chip: Enable the DIP auto-detection

and reworked to include support for the EEPROMs on the PDAs connected to the Microchip/Atmel SAMA Xplained boards.

This is the version 4 of the rework, version 1 was titled:
[PATCH 00/20] Add support for 1wire protocol and 1wire eeproms and version 2 was titled:
[PATCH v2 00/30] Add support for 1wire protocol and 1wire eeproms version 3 was titled:
[PATCH v3 00/34] Add support for 1wire protocol and 1wire eeproms

It addresses feedback received in the first version and fixes a few bugs found in the second version.

Version 4 is just a rebase on latest u-boot with a small fix in one patch.

The patch series adds first a driver for onewire uclass, and onewire over gpio bitbanging driver. Then it adds a uclass for onewire EEPROMS, and specific driver for Maxim EEPROMs. I have added some sandbox support, configuration and device tree for it and for boards sama5d2_xplained, sama5d3_xplained, sama5d4_xplained, sama5d2_ptc_ek and sama5d27_som1_ek. Also added common code for PDA detection, as the memory
on the PDAs is connected to the SoC on the onewire bus.

Thanks to everyone for the review and feedback.

Below is a short summary of the commits:

The series adds a w1-uclass driver for the onewire interface u-class. This is done in patch:
[PATCH v4 01/34] w1: Add 1-Wire uclass

Also, we add a driver for the w1-uclass specific to the onewire over bitbanged gpio, this is done in patch:
[PATCH v4 02/34] w1: Add 1-Wire gpio driver

Add the bindings documentation in:
[PATCH v4 03/34] dt-bindings: W1: w1-gpio: added bindings for w1-gpio

A uclass driver is added for one wire eeproms, in patch :
[PATCH v4 04/34] W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs

Connection between memories and the bus is done in the patch:
[PATCH v4 05/34] w1: identify devices with w1-eeprom uclas

Specific driver for the DS24 Maxim EEPROMs is added in the patch:
[PATCH v4 06/34] W1-EEPROM: add support for Maxim DS24 eeprom families

Bindings for the DS24xxx driver added in the patch:
[PATCH v4 07/34] dt-bindings: w1-eeprom: ds24xxx: create bindings

A sandbox driver for a onewire EEPROM is added in patch:
[PATCH v4 08/34] W1-EEPROM: add sandbox driver

Bindings for the sandbox eeprom driver added in patch:
[PATCH v4 09/34] dt-bindings: w1-eeprom: eep_sandbox: create bindings

A command is added for the onewire protocol in patch:
[PATCH v4 10/34] w1: add command for onewire protocol

Pinctrl driver for sandbox was updated to add a new group and function for w1:
[PATCH v4 11/34] pinctrl: sandbox: add gpio onewire w1 group

Add a node in sandbox DT to have a test node for sandbox. [PATCH v4 12/34] sandbox: DTS: w1: add node for one wire interface on
GPIO

The defconfig for sandbox is updated to include the drivers:
[PATCH v4 13/34] configs: sandbox: add onewire w1 and sandbox
eeprom

Configuration for sama5d2 xplained is updated in patch:
[PATCH v4 14/34] configs: sama5d2_xplained: add onewire and eeprom

Configuration for sama5d3 xplained is updated in patch:
[PATCH v4 15/34] configs: sama5d3_xplained: add onewire and eeprom

Configuration for sama5d27_som1_ek is updated in patch:
[PATCH v4 16/34] configs: sama5d27_som1_ek: add onewire and eeprom
drivers

Configuration for sama5d2 ptc is updated in patch:
[PATCH v4 17/34] configs: sama5d2_ptc_ek: add onewire and eeprom
drivers

Configuration for sama5d4 xplained is updated in patch:
[PATCH v4 18/34] configs: sama5d4_xplained: add onewire and eeprom
drivers

Pda detection is added in the common part for atmel boards:
[PATCH v4 19/34] board: atmel: add support for pda detection

Specifically add it for Sama5d2 xplained board in patch:
[PATCH v4 20/34] board: sama5d2_xplained: add pda detect call at init
time

Specifically add it for Sama5d3 xplained board in patch:
[PATCH v4 21/34] board: sama5d3_xplained: add pda detect call at init
time

Specifically add it for Sama5d27 som1 ek board in patch:
[PATCH v4 22/34] board: sama5d27_som1_ek: add pda detect call at init
time

Specifically add it for Sama5d27 ptc ek board in patch:
[PATCH v4 23/34] board: sama5d2_ptc_ek: add pda detect call at init
time

Specifically add it for Sama5d4 xplained board in patch:
[PATCH v4 24/34] board: sama5d4_xplained: add pda detect call at init
time

Add support for overlays for sama5d2 xplained config in patch:
[PATCH v4 25/34] configs: sama5d2_xplained: add fdt overlay support

Add support for overlays for sama5d3 xplained config in patch:
[PATCH v4 26/34] configs: sama5d3_xplained: add fdt overlay support

Add support for overlays for sama5d2 ptc ek config in patch:
[PATCH v4 27/34] configs: sama5d2_ptc_ek: add fdt overlay support

Add support for overlays for sama5d2 som1 ek config in patch:
[PATCH v4 28/34] configs: sama5d27_som1_ek: add fdt overlay support

Add support for overlays for sama5d4 xplained config in patch:
[PATCH v4 29/34] configs: sama5d4_xplained: add fdt overlay support

The DT for the SAMA5D2 Soc and xplained is updated to include a onewire node. This is done in patch:
[PATCH v4 30/34] ARM: dts: at91: sama5d2_xplained: add onewire connector

The DT for the SAMA5D3 Soc and xplained is updated to include a onewire node. This is done in patch:
[PATCH v4 31/34] ARM: dts: at91: sama5d3_xplained: add onewire connector

The DT for sama5d27 som1 ek is updated to include a onewire node. This is done in patch:
[PATCH v4 32/34] ARM: dts: at91: sama5d27_som1_ek: add onewire
connector for LCD eeprom

The DT for sama5d2 ptc ek is updated to include a onewire node. This is done in patch:
[PATCH v4 33/34] ARM: dts: at91: sama5d2_ptc: add onewire connector
for LCD eeprom

The DT for sama5d2 xplained is updated to include a onewire node. This is done in patch:
[PATCH v4 34/34] ARM: dts: at91: sama5d4_xplained: add onewire connector
for LCD eeprom

Changes in v4:
- Rebased on latest u-boot/master
- Checked ret value in read function in patch [PATCH v4 19/34] board: atmel: add support for pda detection

Changes in v3:
- add suport for sama5d4 xplained.
- modified the reset ops for the w1-gpio driver to also check for bus release by the memory after the presence pulse. This is done to avoid the case when the bus is being kept indefinitely at low, thus confusing the detection algorithm.
- fixed issue in w1-uclass when the id for the child node was improperly saved
- fixed issue when the gpio driver was returning only FFs but the read buf function error code was not checked.

Changes in v2:
- added support for two more boards: the PTC ek and the SOM1 ek.
- modified the enumerate mechanism, to search through devicetree nodes, the memories are now in device tree, as suggested by Simon Glass. When a serial number is read from the bus, the driver will match it with a corresponding node in device tree.
- modified the probe mechanism for the bus, when trying to get the bus use a different get function that will also probe the driver, regardless of present aliases in DT.
- added bindings for ds24xxx driver and eep_sandbox, because they are referenced from devicetree now.

Eugen Hristev (30):
dt-bindings: W1: w1-gpio: added bindings for w1-gpio
w1: identify devices with w1-eeprom uclass
dt-bindings: w1-eeprom: ds24xxx: create bindings
W1-EEPROM: add sandbox driver
dt-bindings: w1-eeprom: eep_sandbox: create bindings
w1: add command for onewire protocol
pinctrl: sandbox: add gpio onewire w1 group
sandbox: DTS: w1: add node for one wire interface on GPIO
configs: sandbox: add onewire w1 and sandbox eeprom
configs: sama5d2_xplained: add onewire and eeprom drivers
configs: sama5d3_xplained: add onewire and eeprom drivers
configs: sama5d27_som1_ek: add onewire and eeprom drivers
configs: sama5d2_ptc_ek: add onewire and eeprom drivers
configs: sama5d4_xplained: add onewire and eeprom drivers
board: atmel: add support for pda detection
board: sama5d2_xplained: add pda detect call at init time
board: sama5d3_xplained: add pda detect call at init time
board: sama5d27_som1_ek: add pda detect call at init time
board: sama5d2_ptc_ek: add pda detect call at init time
board: sama5d4_xplained: add pda detect call at init time
configs: sama5d2_xplained: add fdt overlay support
configs: sama5d3_xplained: add fdt overlay support
configs: sama5d2_ptc_ek: add fdt overlay support
configs: sama5d27_som1_ek: add fdt overlay support
configs: sama5d4_xplained: add fdt overlay support
ARM: dts: at91: sama5d2_xplained: add onewire connector for LCD eeprom
ARM: dts: at91: sama5d3_xplained: add onewire connector for LCD eeprom
ARM: dts: at91: sama5d27_som1_ek: add onewire connector for LCD eeprom
ARM: dts: at91: sama5d2_ptc: add onewire connector for LCD eeprom
ARM: dts: at91: sama5d4_xplained: add onewire connector for LCD eeprom

Maxime Ripard (4):
w1: Add 1-Wire uclass
w1: Add 1-Wire gpio driver
W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs
W1-EEPROM: add support for Maxim DS24 eeprom families

 arch/arm/dts/at91-sama5d27_som1_ek.dts             |  17 ++
 arch/arm/dts/at91-sama5d2_ptc_ek.dts               |  17 ++
 arch/arm/dts/at91-sama5d2_xplained.dts             |  17 ++
 arch/arm/dts/at91-sama5d3_xplained.dts             |  17 ++
 arch/arm/dts/at91-sama5d4_xplained.dts             |  16 ++
 arch/arm/dts/sama5d2.dtsi                          |   5 +
 arch/arm/dts/sama5d3.dtsi                          |   5 +
 arch/arm/dts/sama5d4.dtsi                          |   5 +
 arch/arm/mach-at91/Kconfig                         |   2 +
 arch/sandbox/dts/sandbox.dts                       |  20 ++
 board/atmel/common/board.c                         |  57 +++++
 board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c    |   3 +
 board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c        |  10 +
 board/atmel/sama5d2_xplained/sama5d2_xplained.c    |   3 +
 board/atmel/sama5d3_xplained/sama5d3_xplained.c    |  10 +
 board/atmel/sama5d4_xplained/sama5d4_xplained.c    |   3 +
 cmd/Kconfig                                        |   7 +
 cmd/Makefile                                       |   1 +
 cmd/w1.c                                           | 126 +++++++++++
 configs/sama5d27_som1_ek_mmc_defconfig             |   5 +
 configs/sama5d2_ptc_ek_mmc_defconfig               |   5 +
 configs/sama5d2_ptc_ek_nandflash_defconfig         |   5 +
 configs/sama5d2_xplained_mmc_defconfig             |   5 +
 configs/sama5d2_xplained_spiflash_defconfig        |   5 +
 configs/sama5d3_xplained_mmc_defconfig             |   5 +
 configs/sama5d3_xplained_nandflash_defconfig       |   5 +
 configs/sama5d4_xplained_mmc_defconfig             |   5 +
 configs/sama5d4_xplained_nandflash_defconfig       |   5 +
 configs/sama5d4_xplained_spiflash_defconfig        |   5 +
 configs/sandbox_defconfig                          |   4 +
 doc/device-tree-bindings/w1-eeprom/ds24xxx.txt     |  37 ++++
 doc/device-tree-bindings/w1-eeprom/eep_sandbox.txt |  34 +++
 doc/device-tree-bindings/w1/w1-gpio.txt            |  40 ++++
 drivers/Kconfig                                    |   4 +
 drivers/Makefile                                   |   2 +
 drivers/pinctrl/pinctrl-sandbox.c                  |   3 +
 drivers/w1-eeprom/Kconfig                          |  29 +++
 drivers/w1-eeprom/Makefile                         |   5 +
 drivers/w1-eeprom/ds24xxx.c                        |  55 +++++
 drivers/w1-eeprom/eep_sandbox.c                    |  61 ++++++
 drivers/w1-eeprom/w1-eeprom-uclass.c               | 116 ++++++++++
 drivers/w1/Kconfig                                 |  25 +++
 drivers/w1/Makefile                                |   3 +
 drivers/w1/w1-gpio.c                               | 176 +++++++++++++++
 drivers/w1/w1-uclass.c                             | 240 +++++++++++++++++++++
 include/dm/uclass-id.h                             |   2 +
 include/w1-eeprom.h                                |  33 +++
 include/w1.h                                       |  37 ++++
 48 files changed, 1297 insertions(+)
 create mode 100644 cmd/w1.c
 create mode 100644 doc/device-tree-bindings/w1-eeprom/ds24xxx.txt
 create mode 100644 doc/device-tree-bindings/w1-eeprom/eep_sandbox.txt
 create mode 100644 doc/device-tree-bindings/w1/w1-gpio.txt
 create mode 100644 drivers/w1-eeprom/Kconfig
 create mode 100644 drivers/w1-eeprom/Makefile
 create mode 100644 drivers/w1-eeprom/ds24xxx.c
 create mode 100644 drivers/w1-eeprom/eep_sandbox.c
 create mode 100644 drivers/w1-eeprom/w1-eeprom-uclass.c
 create mode 100644 drivers/w1/Kconfig
 create mode 100644 drivers/w1/Makefile
 create mode 100644 drivers/w1/w1-gpio.c
 create mode 100644 drivers/w1/w1-uclass.c
 create mode 100644 include/w1-eeprom.h
 create mode 100644 include/w1.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH v4 1/34 w1: Add 1-Wire uclass

From: Maxime Ripard <[email protected]>

We might want to use 1-Wire devices connected on boards such as EEPROMs in U-Boot.

Provide a framework to be able to do that.

[eugen.hristev at microchip.com: reworked]
---
 drivers/Kconfig        |   2 +
 drivers/Makefile       |   1 +
 drivers/w1/Kconfig     |  18 ++++
 drivers/w1/Makefile    |   1 +
 drivers/w1/w1-uclass.c | 236 +++++++++++++++++++++++++++++++++++++++++++++++++
 include/dm/uclass-id.h |   1 +
 include/w1.h           |  36 ++++++++
 7 files changed, 295 insertions(+)
 create mode 100644 drivers/w1/Kconfig
 create mode 100644 drivers/w1/Makefile
 create mode 100644 drivers/w1/w1-uclass.c
 create mode 100644 include/w1.h
drivers/Kconfig +2 -0
index 56536c4..6f91eac 100644
@@ -106,6 +106,8 @@ source "drivers/usb/Kconfig"
 
 source "drivers/video/Kconfig"
 
+source "drivers/w1/Kconfig"
+
 source "drivers/watchdog/Kconfig"
 
 config PHYS_TO_BUS
drivers/Makefile +1 -0
index 23ea609..4ca07c3 100644
@@ -105,6 +105,7 @@ obj-y += smem/
 obj-y += soc/
 obj-y += thermal/
 obj-y += axi/
+obj-$(CONFIG_W1) += w1/
 
 obj-$(CONFIG_MACH_PIC32) += ddr/microchip/
 endif
drivers/w1/Kconfig new file +18 -0
new file mode 100644
index 0000000..64b27c6
@@ -0,0 +1,18 @@
+#
+# W1 subsystem configuration
+#
+
+menu "1-Wire support"
+
+config W1
+	bool "Enable 1-wire controllers support"
+	default no
+	depends on DM
+	help
+	  Support for the Dallas 1-Wire bus.
+
+if W1
+
+endif
+
+endmenu
drivers/w1/Makefile new file +1 -0
new file mode 100644
index 0000000..f81693b
@@ -0,0 +1 @@
+obj-$(CONFIG_W1) += w1-uclass.o
drivers/w1/w1-uclass.c new file +236 -0

236 lines not on this page · raw message

include/dm/uclass-id.h +1 -0
index 7027ea0..fa72afb 100644
@@ -92,6 +92,7 @@ enum uclass_id {
 	UCLASS_VIDEO,		/* Video or LCD device */
 	UCLASS_VIDEO_BRIDGE,	/* Video bridge, e.g. DisplayPort to LVDS */
 	UCLASS_VIDEO_CONSOLE,	/* Text console driver for video device */
+	UCLASS_W1,		/* Dallas 1-Wire bus */
 	UCLASS_WDT,		/* Watchdot Timer driver */
 
 	UCLASS_COUNT,
include/w1.h new file +36 -0
new file mode 100644
index 0000000..b36e0f8
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier:	GPL-2.0+
+ *
+ * Copyright (c) 2015 Free Electrons
+ * Copyright (c) 2015 NextThing Co
+ *
+ */
+
+#ifndef __W1_H
+#define __W1_H
+
+#include <dm.h>
+
+#define W1_FAMILY_DS24B33	0x23
+#define W1_FAMILY_DS2431	0x2d
+
+struct w1_device {
+	u64	id;
+};
+
+struct w1_ops {
+	u8	(*read_byte)(struct udevice *dev);
+	bool	(*reset)(struct udevice *dev);
+	u8	(*triplet)(struct udevice *dev, bool bdir);
+	void	(*write_byte)(struct udevice *dev, u8 byte);
+};
+
+int w1_get_bus(int busnum, struct udevice **busp);
+u8 w1_get_device_family(struct udevice *dev);
+
+int w1_read_buf(struct udevice *dev, u8 *buf, unsigned int count);
+int w1_read_byte(struct udevice *dev);
+int w1_reset_select(struct udevice *dev);
+int w1_write_buf(struct udevice *dev, u8 *buf, unsigned int count);
+int w1_write_byte(struct udevice *dev, u8 byte);
+
+#endif
Signature · 1 line
2.7.4
#2 lore raw

PATCH v4 1/34 w1: Add 1-Wire uclass

Quoted 10 lines · Eugen Hristev

From: Maxime Ripard <[email protected]>

We might want to use 1-Wire devices connected on boards such as EEPROMs in U-Boot.

Provide a framework to be able to do that.

[eugen.hristev at microchip.com: reworked]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/4ce38342/attachment.sig>
#3 lore raw

PATCH v4 2/34 w1: Add 1-Wire gpio driver

In reply to Eugen Hristev

From: Maxime Ripard <[email protected]>

Add a bus driver for bitbanging a 1-Wire bus over a GPIO.

[eugen.hristev at microchip.com: fixed some issues]
---
 drivers/w1/Kconfig   |   7 ++
 drivers/w1/Makefile  |   2 +
 drivers/w1/w1-gpio.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 185 insertions(+)
 create mode 100644 drivers/w1/w1-gpio.c
drivers/w1/Kconfig +7 -0
index 64b27c6..d6e0457 100644
@@ -13,6 +13,13 @@ config W1
 
 if W1
 
+config W1_GPIO
+	bool "Enable 1-wire GPIO bitbanging"
+	default no
+	depends on DM_GPIO
+	help
+	  Emulate a 1-wire bus using a GPIO.
+
 endif
 
 endmenu
drivers/w1/Makefile +2 -0
index f81693b..7fd8697 100644
@@ -1 +1,3 @@
 obj-$(CONFIG_W1) += w1-uclass.o
+
+obj-$(CONFIG_W1_GPIO) += w1-gpio.o
drivers/w1/w1-gpio.c new file +176 -0

176 lines not on this page · raw message

Signature · 1 line
2.7.4
#4 lore raw

PATCH v4 2/34 w1: Add 1-Wire gpio driver

Quoted 7 lines · Eugen Hristev

From: Maxime Ripard <[email protected]>

Add a bus driver for bitbanging a 1-Wire bus over a GPIO.

[eugen.hristev at microchip.com: fixed some issues]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/ff2d18f7/attachment.sig>
#5 lore raw

PATCH v4 3/34 dt-bindings: W1: w1-gpio: added bindings for w1-gpio

In reply to Eugen Hristev

Added bindings specification for bitbanged gpio driver for Dallas one wire protocol

---
 doc/device-tree-bindings/w1/w1-gpio.txt | 40 +++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 doc/device-tree-bindings/w1/w1-gpio.txt
doc/device-tree-bindings/w1/w1-gpio.txt new file +40 -0
new file mode 100644
index 0000000..5a58244
@@ -0,0 +1,40 @@
+W1 gpio device binding - one wire protocol over bitbanged gpio
+=======================
+
+
+Child nodes are required in device tree. The driver will detect
+the devices serial number and then search in the child nodes in the device tree
+for the proper node and try to match it with the device.
+
+Also check doc/device-tree-bindings/w1-eeprom for possible child nodes drivers
+
+Driver:
+- drivers/w1/w1-gpio.c
+
+Software w1 device-tree node properties:
+Required:
+* compatible = "w1-gpio";
+* gpios = <...>;
+	This is the gpio used for one wire protocol, using bitbanging
+
+Optional:
+* none
+
+Example:
+
+onewire_tm: onewire {
+		compatible = "w1-gpio";
+		gpios = <&pioA 32 0>;
+};
+
+Example with child:
+
+onewire_tm: onewire {
+		compatible = "w1-gpio";
+		gpios = <&pioA 32 0>;
+
+		eeprom1: eeprom at 0 {
+			compatible = "maxim,ds24xxx";
+		}
+};
+
Signature · 1 line
2.7.4
#6 lore raw

PATCH v4 3/34 dt-bindings: W1: w1-gpio: added bindings for w1-gpio

Quoted 4 lines · Eugen Hristev

Added bindings specification for bitbanged gpio driver for Dallas one wire protocol

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/471d97fb/attachment.sig>
#7 lore raw

PATCH v4 4/34 W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs

In reply to Eugen Hristev

From: Maxime Ripard <[email protected]>

We might want to access data stored onto one wire EEPROMs. Create a framework to provide a consistent API.

[eugen.hristev at microchip.com: reworked patch]
---
 drivers/Kconfig                      |   2 +
 drivers/Makefile                     |   1 +
 drivers/w1-eeprom/Kconfig            |  17 +++++
 drivers/w1-eeprom/Makefile           |   2 +
 drivers/w1-eeprom/w1-eeprom-uclass.c | 116 +++++++++++++++++++++++++++++++++++
 include/dm/uclass-id.h               |   1 +
 include/w1-eeprom.h                  |  33 ++++++++++
 7 files changed, 172 insertions(+)
 create mode 100644 drivers/w1-eeprom/Kconfig
 create mode 100644 drivers/w1-eeprom/Makefile
 create mode 100644 drivers/w1-eeprom/w1-eeprom-uclass.c
 create mode 100644 include/w1-eeprom.h
drivers/Kconfig +2 -0
index 6f91eac..e4396b4 100644
@@ -108,6 +108,8 @@ source "drivers/video/Kconfig"
 
 source "drivers/w1/Kconfig"
 
+source "drivers/w1-eeprom/Kconfig"
+
 source "drivers/watchdog/Kconfig"
 
 config PHYS_TO_BUS
drivers/Makefile +1 -0
index 4ca07c3..1d5905f 100644
@@ -106,6 +106,7 @@ obj-y += soc/
 obj-y += thermal/
 obj-y += axi/
 obj-$(CONFIG_W1) += w1/
+obj-$(CONFIG_W1_EEPROM) += w1-eeprom/
 
 obj-$(CONFIG_MACH_PIC32) += ddr/microchip/
 endif
drivers/w1-eeprom/Kconfig new file +17 -0
new file mode 100644
index 0000000..d5ddc80
@@ -0,0 +1,17 @@
+#
+# EEPROM subsystem configuration
+#
+
+menu "1-wire EEPROM support"
+
+config W1_EEPROM
+	bool "Enable support for EEPROMs on 1wire interface"
+	depends on DM
+	help
+	  Support for the EEPROMs connected on 1-wire Dallas protocol interface
+
+if W1_EEPROM
+
+endif
+
+endmenu
drivers/w1-eeprom/Makefile new file +2 -0
new file mode 100644
index 0000000..b72950e
@@ -0,0 +1,2 @@
+obj-$(CONFIG_W1_EEPROM) += w1-eeprom-uclass.o
+
drivers/w1-eeprom/w1-eeprom-uclass.c new file +116 -0

116 lines not on this page · raw message

include/dm/uclass-id.h +1 -0
index fa72afb..71adf7e 100644
@@ -93,6 +93,7 @@ enum uclass_id {
 	UCLASS_VIDEO_BRIDGE,	/* Video bridge, e.g. DisplayPort to LVDS */
 	UCLASS_VIDEO_CONSOLE,	/* Text console driver for video device */
 	UCLASS_W1,		/* Dallas 1-Wire bus */
+	UCLASS_W1_EEPROM,	/* one-wire EEPROMs */
 	UCLASS_WDT,		/* Watchdot Timer driver */
 
 	UCLASS_COUNT,
include/w1-eeprom.h new file +33 -0
new file mode 100644
index 0000000..2233736
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier:	GPL-2.0+
+ *
+ * Copyright (c) 2015 Free Electrons
+ * Copyright (c) 2015 NextThing Co
+ * Copyright (c) 2018 Microchip Technology, Inc.
+ *
+ */
+
+#ifndef __W1_EEPROM_H
+#define __W1_EEPROM_H
+
+struct udevice;
+
+struct w1_eeprom_ops {
+	/*
+	 * Reads a buff from the given EEPROM memory, starting at
+	 * given offset and place the results into the given buffer.
+	 * Should read given count of bytes.
+	 * Should return 0 on success, and normal error.h on error
+	 */
+	int	(*read_buf)(struct udevice *dev, unsigned int offset,
+			    u8 *buf, unsigned int count);
+};
+
+int w1_eeprom_read_buf(struct udevice *dev, unsigned int offset,
+		       u8 *buf, unsigned int count);
+
+int w1_eeprom_dm_init(void);
+
+int w1_eeprom_register_new_device(u64 id);
+
+int w1_eeprom_get_id(struct udevice *dev, u64 *id);
+#endif
Signature · 1 line
2.7.4
#8 lore raw

PATCH v4 4/34 W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs

Quoted 8 lines · Eugen Hristev

From: Maxime Ripard <[email protected]>

We might want to access data stored onto one wire EEPROMs. Create a framework to provide a consistent API.

[eugen.hristev at microchip.com: reworked patch]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/54406d65/attachment.sig>
#9 lore raw

PATCH v4 5/34 w1: identify devices with w1-eeprom uclass

In reply to Eugen Hristev

When a new device is discovered, this may be a w1 eeprom device. Attempt to find the proper node and driver from the w1-eeprom subsystem.

---
 drivers/w1/w1-uclass.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/w1/w1-uclass.c +4 -0
index 44759fe..aecf7fe 100644
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <dm.h>
 #include <w1.h>
+#include <w1-eeprom.h>
 
 #include <dm/device-internal.h>
 
@@ -98,6 +99,9 @@ static int w1_enumerate(struct udevice *bus)
 
 			debug("%s: Detected new device 0x%llx (family 0x%x)\n",
 			      bus->name, rn, (u8)(rn & 0xff));
+
+			/* attempt to register as w1-eeprom device */
+			w1_eeprom_register_new_device(rn);
 		}
 	}
 
Signature · 1 line
2.7.4
#10 lore raw

PATCH v4 5/34 w1: identify devices with w1-eeprom uclass

Quoted 4 lines · Eugen Hristev

When a new device is discovered, this may be a w1 eeprom device. Attempt to find the proper node and driver from the w1-eeprom subsystem.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/73a66c03/attachment.sig>
#11 lore raw

PATCH v4 6/34 W1-EEPROM: add support for Maxim DS24 eeprom families

In reply to Eugen Hristev

From: Maxime Ripard <[email protected]>

Add a driver that supports Maxim 1 wire EEPROMs families DS24B33 and DS2431.
Can be extended for other families as well.

[eugen.hristev at microchip.com: reworked driver]
---
 drivers/w1-eeprom/Kconfig   |  6 +++++
 drivers/w1-eeprom/Makefile  |  2 ++
 drivers/w1-eeprom/ds24xxx.c | 55 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 63 insertions(+)
 create mode 100644 drivers/w1-eeprom/ds24xxx.c
drivers/w1-eeprom/Kconfig +6 -0
index d5ddc80..20ec549 100644
@@ -12,6 +12,12 @@ config W1_EEPROM
 
 if W1_EEPROM
 
+config W1_EEPROM_DS24XXX
+	bool "Enable Maxim DS24 families EEPROM support"
+	depends on W1
+	help
+	  Maxim DS24 EEPROMs 1-Wire EEPROM support
+
 endif
 
 endmenu
drivers/w1-eeprom/Makefile +2 -0
index b72950e..3f4aa13 100644
@@ -1,2 +1,4 @@
 obj-$(CONFIG_W1_EEPROM) += w1-eeprom-uclass.o
 
+obj-$(CONFIG_W1_EEPROM_DS24XXX) += ds24xxx.o
+
drivers/w1-eeprom/ds24xxx.c new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.7.4
#12 lore raw

PATCH v4 6/34 W1-EEPROM: add support for Maxim DS24 eeprom families

Quoted 9 lines · Eugen Hristev

From: Maxime Ripard <[email protected]>

Add a driver that supports Maxim 1 wire EEPROMs families DS24B33 and DS2431.
Can be extended for other families as well.

[eugen.hristev at microchip.com: reworked driver]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/c6f1fe4f/attachment.sig>
#13 lore raw

PATCH v4 7/34 dt-bindings: w1-eeprom: ds24xxx: create bindings

In reply to Eugen Hristev

Bindings for Maxim's ds24 onewire EEPROM families driver

---
 doc/device-tree-bindings/w1-eeprom/ds24xxx.txt | 37 ++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 doc/device-tree-bindings/w1-eeprom/ds24xxx.txt
doc/device-tree-bindings/w1-eeprom/ds24xxx.txt new file +37 -0
new file mode 100644
index 0000000..2e91be9
@@ -0,0 +1,37 @@
+Maxim DS24 families driver device binding - one wire protocol EEPROMS from Maxim
+=======================
+
+This memory needs to be connected to a onewire bus, as a child node.
+The bus will read the device serial number and match this node with a found
+device on the bus
+Also check doc/device-tree-bindings/w1 for onewire bus drivers
+
+Driver:
+- drivers/w1-eeprom/ds24xxx.c
+
+Software ds24xxx device-tree node properties:
+Required:
+* compatible = "maxim,ds24b33"
+or
+* compatible = "maxim,ds2431"
+Further memories can be added.
+
+Optional:
+* none
+
+Example:
+	eeprom1: eeprom at 0 {
+		compatible = "maxim,ds24xxx";
+	}
+
+Example with parent bus:
+
+onewire_tm: onewire {
+		compatible = "w1-gpio";
+		gpios = <&pioA 32 0>;
+
+		eeprom1: eeprom at 0 {
+			compatible = "maxim,ds24xxx";
+		}
+};
+
Signature · 1 line
2.7.4
#14 lore raw

PATCH v4 7/34 dt-bindings: w1-eeprom: ds24xxx: create bindings

Quoted 3 lines · Eugen Hristev

Bindings for Maxim's ds24 onewire EEPROM families driver

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/9f6fd83d/attachment.sig>
#15 lore raw

PATCH v4 8/34 W1-EEPROM: add sandbox driver

In reply to Eugen Hristev

Add a sandbox driver for a one wire EEPROM memory

---
 drivers/w1-eeprom/Kconfig       |  6 ++++
 drivers/w1-eeprom/Makefile      |  1 +
 drivers/w1-eeprom/eep_sandbox.c | 61 +++++++++++++++++++++++++++++++++++++++++
 include/w1.h                    |  1 +
 4 files changed, 69 insertions(+)
 create mode 100644 drivers/w1-eeprom/eep_sandbox.c
drivers/w1-eeprom/Kconfig +6 -0
index 20ec549..4b7f3c4 100644
@@ -18,6 +18,12 @@ config W1_EEPROM_DS24XXX
 	help
 	  Maxim DS24 EEPROMs 1-Wire EEPROM support
 
+config W1_EEPROM_SANDBOX
+	bool "Enable sandbox onewire EEPROM driver"
+	depends on W1
+	help
+	  Sandbox driver for a onewire EEPROM memory
+
 endif
 
 endmenu
drivers/w1-eeprom/Makefile +1 -0
index 3f4aa13..03cc4c8 100644
@@ -2,3 +2,4 @@ obj-$(CONFIG_W1_EEPROM) += w1-eeprom-uclass.o
 
 obj-$(CONFIG_W1_EEPROM_DS24XXX) += ds24xxx.o
 
+obj-$(CONFIG_W1_EEPROM_SANDBOX) += eep_sandbox.o
drivers/w1-eeprom/eep_sandbox.c new file +61 -0

61 lines not on this page · raw message

include/w1.h +1 -0
index b36e0f8..399177a 100644
@@ -12,6 +12,7 @@
 
 #define W1_FAMILY_DS24B33	0x23
 #define W1_FAMILY_DS2431	0x2d
+#define W1_FAMILY_EEP_SANDBOX	0xfe
 
 struct w1_device {
 	u64	id;
Signature · 1 line
2.7.4
#16 lore raw

PATCH v4 8/34 W1-EEPROM: add sandbox driver

Quoted 3 lines · Eugen Hristev

Add a sandbox driver for a one wire EEPROM memory

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/2220a598/attachment.sig>
#17 lore raw

PATCH v4 9/34 dt-bindings: w1-eeprom: eep_sandbox: create bindings

In reply to Eugen Hristev

Bindings for sandbox onewire eeprom driver

---
 doc/device-tree-bindings/w1-eeprom/eep_sandbox.txt | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 doc/device-tree-bindings/w1-eeprom/eep_sandbox.txt
doc/device-tree-bindings/w1-eeprom/eep_sandbox.txt new file +34 -0
new file mode 100644
index 0000000..82bb589
@@ -0,0 +1,34 @@
+Onewire EEPROM sandbox driver device binding - one wire protocol sandbox EEPROM
+=======================
+
+This memory needs to be connected to a onewire bus, as a child node.
+The bus will read the device serial number and match this node with a found
+device on the bus
+Also check doc/device-tree-bindings/w1 for onewire bus drivers
+
+Driver:
+- drivers/w1-eeprom/eep_sandbox.c
+
+Software ds24xxx device-tree node properties:
+Required:
+* compatible = "sandbox,w1-eeprom"
+
+Optional:
+* none
+
+Example:
+	eeprom1: eeprom at 0 {
+		compatible = "sandbox,w1-eeprom";
+	}
+
+Example with parent bus:
+
+onewire_tm: onewire {
+		compatible = "w1-gpio";
+		gpios = <&gpio_a 8>;
+
+		eeprom1: eeprom at 0 {
+			compatible = "sandbox,w1-eeprom";
+		}
+};
+
Signature · 1 line
2.7.4
#18 lore raw

PATCH v4 9/34 dt-bindings: w1-eeprom: eep_sandbox: create bindings

Quoted 3 lines · Eugen Hristev

Bindings for sandbox onewire eeprom driver

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/105a8f3e/attachment.sig>
#19 lore raw

PATCH v4 10/34 w1: add command for onewire protocol

In reply to Eugen Hristev

Add basic command for bus information and read for onewire bus using Dallas 1-Wire protocol.

---
 cmd/Kconfig  |   7 ++++
 cmd/Makefile |   1 +
 cmd/w1.c     | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 134 insertions(+)
 create mode 100644 cmd/w1.c
cmd/Kconfig +7 -0
index 13d4c99..b0d6e1b 100644
@@ -832,6 +832,13 @@ config CMD_I2C
 	help
 	  I2C support.
 
+config CMD_W1
+	depends on W1
+	default y if W1
+	bool "w1 - Support for Dallas 1-Wire protocol"
+	help
+	  Dallas 1-wire protocol support
+
 config CMD_LOADB
 	bool "loadb"
 	default y
cmd/Makefile +1 -0
index 3487c80..b5241b8 100644
@@ -145,6 +145,7 @@ obj-$(CONFIG_CMD_THOR_DOWNLOAD) += thordown.o
 obj-$(CONFIG_CMD_XIMG) += ximg.o
 obj-$(CONFIG_CMD_YAFFS2) += yaffs2.o
 obj-$(CONFIG_CMD_SPL) += spl.o
+obj-$(CONFIG_CMD_W1) += w1.o
 obj-$(CONFIG_CMD_ZIP) += zip.o
 obj-$(CONFIG_CMD_ZFS) += zfs.o
 
cmd/w1.c new file +126 -0

126 lines not on this page · raw message

Signature · 1 line
2.7.4
#20 lore raw

PATCH v4 10/34 w1: add command for onewire protocol

Quoted 4 lines · Eugen Hristev

Add basic command for bus information and read for onewire bus using Dallas 1-Wire protocol.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/6f0f474f/attachment.sig>
#21 lore raw

PATCH v4 11/34 pinctrl: sandbox: add gpio onewire w1 group

In reply to Eugen Hristev

Add onewire "w1" groups and pin function for onewire GPIOs in sandbox.

---
 drivers/pinctrl/pinctrl-sandbox.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/pinctrl/pinctrl-sandbox.c +3 -0
index 468fa2a..755ac08 100644
@@ -14,6 +14,7 @@ static const char * const sandbox_pins[] = {
 	"SDA",
 	"TX",
 	"RX",
+	"W1"
 };
 
 static const char * const sandbox_groups[] = {
@@ -21,12 +22,14 @@ static const char * const sandbox_groups[] = {
 	"serial_a",
 	"serial_b",
 	"spi",
+	"w1",
 };
 
 static const char * const sandbox_functions[] = {
 	"i2c",
 	"serial",
 	"spi",
+	"w1",
 };
 
 static const struct pinconf_param sandbox_conf_params[] = {
Signature · 1 line
2.7.4
#22 lore raw

PATCH v4 11/34 pinctrl: sandbox: add gpio onewire w1 group

Quoted 3 lines · Eugen Hristev

Add onewire "w1" groups and pin function for onewire GPIOs in sandbox.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/5d7756a2/attachment.sig>
#23 lore raw

PATCH v4 12/34 sandbox: DTS: w1: add node for one wire interface on GPIO

In reply to Eugen Hristev

Add a node for the one wire uclass and one wire gpio driver in sandbox.

---
 arch/sandbox/dts/sandbox.dts | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/sandbox/dts/sandbox.dts +20 -0
index 6ac37f1..1aa0f8e 100644
@@ -153,6 +153,7 @@
 
 	pinctrl {
 		compatible = "sandbox,pinctrl";
+		status = "okay";
 
 		pinctrl_i2c0: i2c0 {
 			groups = "i2c";
@@ -164,6 +165,12 @@
 			groups = "serial_a";
 			function = "serial";
 		};
+
+		pinctrl_onewire0: onewire0 {
+			groups = "w1";
+			function = "w1";
+			bias-pull-up;
+		};
 	};
 
 	reset at 1 {
@@ -322,6 +329,19 @@
 			reg = <0x0 0x400>;
 		};
 	};
+
+	onewire0: onewire {
+		compatible = "w1-gpio";
+		gpios = <&gpio_a 8>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_onewire0>;
+		status = "okay";
+
+		sandbox_eeprom0: sandbox_eeprom at 0 {
+			compatible = "sandbox,w1-eeprom";
+			status = "okay";
+		};
+	};
 };
 
 #include "cros-ec-keyboard.dtsi"
Signature · 1 line
2.7.4
#24 lore raw

PATCH v4 12/34 sandbox: DTS: w1: add node for one wire interface on GPIO

Quoted 4 lines · Eugen Hristev

Add a node for the one wire uclass and one wire gpio driver in sandbox.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/24c8a0ec/attachment.sig>
#25 lore raw

PATCH v4 13/34 configs: sandbox: add onewire w1 and sandbox eeprom

In reply to Eugen Hristev

To be able to test Dallas onewire protocol and one wire eeproms driver and subsystem, add in sandbox defconfig the drivers' config.

---
 configs/sandbox_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/sandbox_defconfig +4 -0
index ca12118..eff6e1e 100644
@@ -191,6 +191,10 @@ CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
 CONFIG_CONSOLE_TRUETYPE_CANTORAONE=y
 CONFIG_VIDEO_SANDBOX_SDL=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_SANDBOX=y
 CONFIG_WDT=y
 CONFIG_WDT_SANDBOX=y
 CONFIG_FS_CBFS=y
Signature · 1 line
2.7.4
#26 lore raw

PATCH v4 13/34 configs: sandbox: add onewire w1 and sandbox eeprom

Quoted 4 lines · Eugen Hristev

To be able to test Dallas onewire protocol and one wire eeproms driver and subsystem, add in sandbox defconfig the drivers' config.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/de891933/attachment.sig>
#27 lore raw

PATCH v4 14/34 configs: sama5d2_xplained: add onewire and eeprom drivers

In reply to Eugen Hristev

SAMA5D2 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

---
 configs/sama5d2_xplained_mmc_defconfig      | 4 ++++
 configs/sama5d2_xplained_spiflash_defconfig | 4 ++++
 2 files changed, 8 insertions(+)
configs/sama5d2_xplained_mmc_defconfig +4 -0
index 77dc82c..46b143b 100644
@@ -88,3 +88,7 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_DM_VIDEO=y
 CONFIG_ATMEL_HLCD=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
configs/sama5d2_xplained_spiflash_defconfig +4 -0
index fc9ec9c..9da026b 100644
@@ -85,3 +85,7 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_DM_VIDEO=y
 CONFIG_ATMEL_HLCD=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
Signature · 1 line
2.7.4
#28 lore raw

PATCH v4 14/34 configs: sama5d2_xplained: add onewire and eeprom drivers

Quoted 6 lines · Eugen Hristev

SAMA5D2 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/6769b446/attachment.sig>
#29 lore raw

PATCH v4 15/34 configs: sama5d3_xplained: add onewire and eeprom drivers

In reply to Eugen Hristev

SAMA5D3 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

---
 configs/sama5d3_xplained_mmc_defconfig       | 4 ++++
 configs/sama5d3_xplained_nandflash_defconfig | 4 ++++
 2 files changed, 8 insertions(+)
configs/sama5d3_xplained_mmc_defconfig +4 -0
index 7f2d276..7d8d1ad 100644
@@ -76,3 +76,7 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
configs/sama5d3_xplained_nandflash_defconfig +4 -0
index ac8435e..f536877 100644
@@ -72,4 +72,8 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
 CONFIG_FAT_WRITE=y
Signature · 1 line
2.7.4
#30 lore raw

PATCH v4 15/34 configs: sama5d3_xplained: add onewire and eeprom drivers

Quoted 6 lines · Eugen Hristev

SAMA5D3 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/9a6bdc5b/attachment.sig>
#31 lore raw

PATCH v4 16/34 configs: sama5d27_som1_ek: add onewire and eeprom drivers

In reply to Eugen Hristev

SAMA5D2 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

---
 configs/sama5d27_som1_ek_mmc_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/sama5d27_som1_ek_mmc_defconfig +4 -0
index 56c7252..c1fd5c3 100644
@@ -88,3 +88,7 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_DM_VIDEO=y
 CONFIG_ATMEL_HLCD=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
Signature · 1 line
2.7.4
#32 lore raw

PATCH v4 16/34 configs: sama5d27_som1_ek: add onewire and eeprom drivers

Quoted 6 lines · Eugen Hristev

SAMA5D2 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/4dc337aa/attachment.sig>
#33 lore raw

PATCH v4 17/34 configs: sama5d2_ptc_ek: add onewire and eeprom drivers

In reply to Eugen Hristev

SAMA5D2 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

---
 configs/sama5d2_ptc_ek_mmc_defconfig       | 4 ++++
 configs/sama5d2_ptc_ek_nandflash_defconfig | 4 ++++
 2 files changed, 8 insertions(+)
configs/sama5d2_ptc_ek_mmc_defconfig +4 -0
index 42f0c95..047a7ec 100644
@@ -63,3 +63,7 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
configs/sama5d2_ptc_ek_nandflash_defconfig +4 -0
index c4b3085..1b3d097 100644
@@ -62,3 +62,7 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
Signature · 1 line
2.7.4
#34 lore raw

PATCH v4 17/34 configs: sama5d2_ptc_ek: add onewire and eeprom drivers

Quoted 6 lines · Eugen Hristev

SAMA5D2 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/140e7491/attachment.sig>
#35 lore raw

PATCH v4 18/34 configs: sama5d4_xplained: add onewire and eeprom drivers

In reply to Eugen Hristev

SAMA5D4 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

---
 configs/sama5d4_xplained_mmc_defconfig       | 4 ++++
 configs/sama5d4_xplained_nandflash_defconfig | 4 ++++
 configs/sama5d4_xplained_spiflash_defconfig  | 4 ++++
 3 files changed, 12 insertions(+)
configs/sama5d4_xplained_mmc_defconfig +4 -0
index 89393a9..26960eb 100644
@@ -84,3 +84,7 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_DM_VIDEO=y
 CONFIG_ATMEL_HLCD=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
configs/sama5d4_xplained_nandflash_defconfig +4 -0
index 5387966..c463c74 100644
@@ -80,3 +80,7 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_DM_VIDEO=y
 CONFIG_ATMEL_HLCD=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
configs/sama5d4_xplained_spiflash_defconfig +4 -0
index 39c86ec..13869da 100644
@@ -84,3 +84,7 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_DM_VIDEO=y
 CONFIG_ATMEL_HLCD=y
+CONFIG_W1=y
+CONFIG_W1_GPIO=y
+CONFIG_W1_EEPROM=y
+CONFIG_W1_EEPROM_DS24XXX=y
Signature · 1 line
2.7.4
#36 lore raw

PATCH v4 18/34 configs: sama5d4_xplained: add onewire and eeprom drivers

Quoted 6 lines · Eugen Hristev

SAMA5D4 SoC can have extra clip boards (PDAs) connected, which have an EEPROM memory for identification. A special GPIO can be used to read this memory over 1wire protocol.
Enabling one wire and eeprom drivers for this memory.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/b12f518d/attachment.sig>
#37 lore raw

PATCH v4 19/34 board: atmel: add support for pda detection

In reply to Eugen Hristev

This adds the support for PDA detection as common code for Atmel boards.
Using the one wire interface over GPIO , an EEPROM memory is read and compared to preprogrammed values for PDA screens TM4300, TM7000 and TM7000B.
Once the PDA is detected, an environment variable is set accordingly.

---
 board/atmel/common/board.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
board/atmel/common/board.c +57 -0
index 650eb22..8f9b5e1 100644
@@ -5,7 +5,64 @@
  */
 
 #include <common.h>
+#include <w1.h>
+#include <w1-eeprom.h>
+#include <dm/device-internal.h>
+
+#define AT91_PDA_EEPROM_ID_OFFSET		15
+#define AT91_PDA_EEPROM_ID_LENGTH		5
+#define AT91_PDA_EEPROM_DEFAULT_BUS		0
 
 void dummy(void)
 {
 }
+
+#if defined CONFIG_W1
+void at91_pda_detect(void)
+{
+	struct udevice *bus, *dev;
+	u8 buf[AT91_PDA_EEPROM_ID_LENGTH + 1] = {0};
+	int ret;
+	int pda = 0;
+
+	ret = w1_get_bus(AT91_PDA_EEPROM_DEFAULT_BUS, &bus);
+	if (ret)
+		return;
+
+	for (device_find_first_child(bus, &dev);
+	     dev;
+	     device_find_next_child(&dev)) {
+		ret = device_probe(dev);
+		if (ret) {
+			continue;
+		} else {
+			ret = w1_eeprom_read_buf(dev, AT91_PDA_EEPROM_ID_OFFSET,
+						 (u8 *)buf, AT91_PDA_EEPROM_ID_LENGTH);
+			if (ret)
+				return;
+			break;
+		}
+	}
+	pda = simple_strtoul((const char *)buf, NULL, 10);
+
+	switch (pda) {
+	case 7000:
+		if (buf[4] == 'B')
+			printf("PDA TM7000B detected\n");
+		else
+			printf("PDA TM7000 detected\n");
+		break;
+	case 4300:
+		printf("PDA TM4300 detected\n");
+		break;
+	case 5000:
+		printf("PDA TM5000 detected\n");
+		break;
+	}
+	env_set("pda", (const char *)buf);
+}
+#else
+void at91_pda_detect(void)
+{
+}
+#endif
Signature · 1 line
2.7.4
#38 lore raw

PATCH v4 19/34 board: atmel: add support for pda detection

Quoted 8 lines · Eugen Hristev

This adds the support for PDA detection as common code for Atmel boards.
Using the one wire interface over GPIO , an EEPROM memory is read and compared to preprogrammed values for PDA screens TM4300, TM7000 and TM7000B.
Once the PDA is detected, an environment variable is set accordingly.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/f0ddb34a/attachment.sig>
#39 lore raw

PATCH v4 20/34 board: sama5d2_xplained: add pda detect call at init time

In reply to Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

---
 board/atmel/sama5d2_xplained/sama5d2_xplained.c | 3 +++
 1 file changed, 3 insertions(+)
board/atmel/sama5d2_xplained/sama5d2_xplained.c +3 -0
index 592b4d8..fccd80e 100644
@@ -15,6 +15,8 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/sama5d2.h>
 
+extern void at91_pda_detect(void);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static void board_usb_hw_init(void)
@@ -28,6 +30,7 @@ int board_late_init(void)
 #ifdef CONFIG_DM_VIDEO
 	at91_video_show_board_info();
 #endif
+	at91_pda_detect();
 	return 0;
 }
 #endif
Signature · 1 line
2.7.4
#40 lore raw

PATCH v4 20/34 board: sama5d2_xplained: add pda detect call at init time

Quoted 4 lines · Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/8daacff7/attachment.sig>
#41 lore raw

PATCH v4 21/34 board: sama5d3_xplained: add pda detect call at init time

In reply to Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

---
 arch/arm/mach-at91/Kconfig                      |  1 +
 board/atmel/sama5d3_xplained/sama5d3_xplained.c | 10 ++++++++++
 2 files changed, 11 insertions(+)
arch/arm/mach-at91/Kconfig +1 -0
index 69856c8..3784cbb 100644
@@ -177,6 +177,7 @@ config TARGET_SAMA5D3_XPLAINED
 	select BOARD_EARLY_INIT_F
 	select SAMA5D3
 	select SUPPORT_SPL
+	select BOARD_LATE_INIT
 
 config TARGET_SAMA5D3XEK
 	bool "SAMA5D3X-EK board"
board/atmel/sama5d3_xplained/sama5d3_xplained.c +10 -0
index c47f638..289f8d8 100644
@@ -18,6 +18,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+extern void at91_pda_detect(void);
+
 #ifdef CONFIG_NAND_ATMEL
 void sama5d3_xplained_nand_hw_init(void)
 {
@@ -72,6 +74,14 @@ void board_debug_uart_init(void)
 }
 #endif
 
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+	at91_pda_detect();
+	return 0;
+}
+#endif
+
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
Signature · 1 line
2.7.4
#42 lore raw

PATCH v4 21/34 board: sama5d3_xplained: add pda detect call at init time

Quoted 4 lines · Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/3c60c172/attachment.sig>
#43 lore raw

PATCH v4 22/34 board: sama5d27_som1_ek: add pda detect call at init time

In reply to Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

---
 board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c | 3 +++
 1 file changed, 3 insertions(+)
board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c +3 -0
index d5ddf8d..8363434 100644
@@ -15,6 +15,8 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/sama5d2.h>
 
+extern void at91_pda_detect(void);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static void board_usb_hw_init(void)
@@ -28,6 +30,7 @@ int board_late_init(void)
 #ifdef CONFIG_DM_VIDEO
 	at91_video_show_board_info();
 #endif
+	at91_pda_detect();
 	return 0;
 }
 #endif
Signature · 1 line
2.7.4
#44 lore raw

PATCH v4 22/34 board: sama5d27_som1_ek: add pda detect call at init time

Quoted 4 lines · Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/dc0867a2/attachment.sig>
#45 lore raw

PATCH v4 23/34 board: sama5d2_ptc_ek: add pda detect call at init time

In reply to Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

---
 arch/arm/mach-at91/Kconfig                  |  1 +
 board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c | 10 ++++++++++
 2 files changed, 11 insertions(+)
arch/arm/mach-at91/Kconfig +1 -0
index 3784cbb..a6329dc 100644
@@ -151,6 +151,7 @@ config TARGET_SAMA5D2_PTC_EK
 	bool "SAMA5D2 PTC EK board"
 	select BOARD_EARLY_INIT_F
 	select SAMA5D2
+	select BOARD_LATE_INIT
 
 config TARGET_SAMA5D2_XPLAINED
 	bool "SAMA5D2 Xplained board"
board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c +10 -0
index 789841e..17e08fa 100644
@@ -20,6 +20,8 @@
 #include <asm/arch/sama5d2.h>
 #include <asm/arch/sama5d2_smc.h>
 
+extern void at91_pda_detect(void);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_NAND_ATMEL
@@ -65,6 +67,14 @@ static void board_nand_hw_init(void)
 }
 #endif
 
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+	at91_pda_detect();
+	return 0;
+}
+#endif
+
 static void board_usb_hw_init(void)
 {
 	atmel_pio4_set_pio_output(AT91_PIO_PORTB, 12, ATMEL_PIO_PUEN_MASK);
Signature · 1 line
2.7.4
#46 lore raw

PATCH v4 23/34 board: sama5d2_ptc_ek: add pda detect call at init time

Quoted 4 lines · Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/dc8779cd/attachment.sig>
#47 lore raw

PATCH v4 24/34 board: sama5d4_xplained: add pda detect call at init time

In reply to Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

---
 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 3 +++
 1 file changed, 3 insertions(+)
board/atmel/sama5d4_xplained/sama5d4_xplained.c +3 -0
index 526c6c7..4da6489 100644
@@ -17,6 +17,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+extern void at91_pda_detect(void);
+
 #ifdef CONFIG_NAND_ATMEL
 static void sama5d4_xplained_nand_hw_init(void)
 {
@@ -71,6 +73,7 @@ static void sama5d4_xplained_usb_hw_init(void)
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {
+	at91_pda_detect();
 #ifdef CONFIG_DM_VIDEO
 	at91_video_show_board_info();
 #endif
Signature · 1 line
2.7.4
#48 lore raw

PATCH v4 24/34 board: sama5d4_xplained: add pda detect call at init time

Quoted 4 lines · Eugen Hristev

Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/b48f9397/attachment.sig>
#49 lore raw

PATCH v4 25/34 configs: sama5d2_xplained: add fdt overlay support

In reply to Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

---
 configs/sama5d2_xplained_mmc_defconfig      | 1 +
 configs/sama5d2_xplained_spiflash_defconfig | 1 +
 2 files changed, 2 insertions(+)
configs/sama5d2_xplained_mmc_defconfig +1 -0
index 46b143b..f8748f8 100644
@@ -92,3 +92,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
configs/sama5d2_xplained_spiflash_defconfig +1 -0
index 9da026b..efe7176 100644
@@ -89,3 +89,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.7.4
#50 lore raw

PATCH v4 25/34 configs: sama5d2_xplained: add fdt overlay support

Quoted 4 lines · Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/693158b0/attachment.sig>
#51 lore raw

PATCH v4 26/34 configs: sama5d3_xplained: add fdt overlay support

In reply to Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

---
 configs/sama5d3_xplained_mmc_defconfig       | 1 +
 configs/sama5d3_xplained_nandflash_defconfig | 1 +
 2 files changed, 2 insertions(+)
configs/sama5d3_xplained_mmc_defconfig +1 -0
index 7d8d1ad..154cdc2 100644
@@ -80,3 +80,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
configs/sama5d3_xplained_nandflash_defconfig +1 -0
index f536877..3bf93de 100644
@@ -77,3 +77,4 @@ CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
 CONFIG_FAT_WRITE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.7.4
#52 lore raw

PATCH v4 26/34 configs: sama5d3_xplained: add fdt overlay support

Quoted 4 lines · Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/d90a96e0/attachment.sig>
#53 lore raw

PATCH v4 27/34 configs: sama5d2_ptc_ek: add fdt overlay support

In reply to Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

---
 configs/sama5d2_ptc_ek_mmc_defconfig       | 1 +
 configs/sama5d2_ptc_ek_nandflash_defconfig | 1 +
 2 files changed, 2 insertions(+)
configs/sama5d2_ptc_ek_mmc_defconfig +1 -0
index 047a7ec..60df0f0 100644
@@ -67,3 +67,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
configs/sama5d2_ptc_ek_nandflash_defconfig +1 -0
index 1b3d097..4e39406 100644
@@ -66,3 +66,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.7.4
#54 lore raw

PATCH v4 27/34 configs: sama5d2_ptc_ek: add fdt overlay support

Quoted 4 lines · Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/4ab37f3d/attachment.sig>
#55 lore raw

PATCH v4 28/34 configs: sama5d27_som1_ek: add fdt overlay support

In reply to Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

---
 configs/sama5d27_som1_ek_mmc_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/sama5d27_som1_ek_mmc_defconfig +1 -0
index c1fd5c3..270ac37 100644
@@ -92,3 +92,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.7.4
#56 lore raw

PATCH v4 28/34 configs: sama5d27_som1_ek: add fdt overlay support

Quoted 4 lines · Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/6aee4de8/attachment.sig>
#57 lore raw

PATCH v4 29/34 configs: sama5d4_xplained: add fdt overlay support

In reply to Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

---
 configs/sama5d4_xplained_mmc_defconfig       | 1 +
 configs/sama5d4_xplained_nandflash_defconfig | 1 +
 configs/sama5d4_xplained_spiflash_defconfig  | 1 +
 3 files changed, 3 insertions(+)
configs/sama5d4_xplained_mmc_defconfig +1 -0
index 26960eb..f60b6b5 100644
@@ -88,3 +88,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
configs/sama5d4_xplained_nandflash_defconfig +1 -0
index c463c74..3524dbf 100644
@@ -84,3 +84,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
configs/sama5d4_xplained_spiflash_defconfig +1 -0
index 13869da..3f519cd 100644
@@ -88,3 +88,4 @@ CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
 CONFIG_W1_EEPROM_DS24XXX=y
+CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.7.4
#58 lore raw

PATCH v4 29/34 configs: sama5d4_xplained: add fdt overlay support

Quoted 4 lines · Eugen Hristev

Add commands for fdt overlay merging. This is required for the boot scripts that detect PDAs and apply specific overlays to the DTB passed on to kernel.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/f03c958b/attachment.sig>
#59 lore raw

PATCH v4 30/34 ARM: dts: at91: sama5d2_xplained: add onewire connector for LCD eeprom

In reply to Eugen Hristev

Add onewire node in device tree for TM series LCDs

---
 arch/arm/dts/at91-sama5d2_xplained.dts | 17 +++++++++++++++++
 arch/arm/dts/sama5d2.dtsi              |  5 +++++
 2 files changed, 22 insertions(+)
arch/arm/dts/at91-sama5d2_xplained.dts +17 -0
index 01326a1..33064b3 100644
@@ -11,6 +11,18 @@
 		stdout-path = &uart1;
 	};
 
+	onewire_tm: onewire {
+		gpios = <&pioA PIN_PB0 0>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_onewire_tm_default>;
+		status = "okay";
+
+		w1_eeprom: w1_eeprom at 0 {
+			compatible = "maxim,ds24b33";
+			status = "okay";
+		};
+	};
+
 	ahb {
 		usb1: ohci at 00400000 {
 			num-ports = <3>;
@@ -270,6 +282,11 @@
 						pinmux = <PIN_PA31__GPIO>;
 						bias-disable;
 					};
+
+					pinctrl_onewire_tm_default: onewire_tm_default {
+						pinmux = <PIN_PB0__GPIO>;
+						bias-pull-up;
+					};
 				};
 			};
 		};
arch/arm/dts/sama5d2.dtsi +5 -0
index 6645a55..830251a 100644
@@ -769,4 +769,9 @@
 			};
 		};
 	};
+
+	onewire_tm: onewire {
+		compatible = "w1-gpio";
+		status = "disabled";
+	};
 };
Signature · 1 line
2.7.4
#60 lore raw

PATCH v4 30/34 ARM: dts: at91: sama5d2_xplained: add onewire connector for LCD eeprom

Quoted 3 lines · Eugen Hristev

Add onewire node in device tree for TM series LCDs

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/5544c31c/attachment.sig>
#61 lore raw

PATCH v4 31/34 ARM: dts: at91: sama5d3_xplained: add onewire connector for LCD eeprom

In reply to Eugen Hristev

Add onewire node in device tree for TM series LCDs

---
 arch/arm/dts/at91-sama5d3_xplained.dts | 17 +++++++++++++++++
 arch/arm/dts/sama5d3.dtsi              |  5 +++++
 2 files changed, 22 insertions(+)
arch/arm/dts/at91-sama5d3_xplained.dts +17 -0
index 6959710..20fba5f 100644
@@ -36,6 +36,18 @@
 		};
 	};
 
+	onewire_tm: onewire {
+		gpios = <&pioE 23 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_onewire_tm_default>;
+		status = "okay";
+
+		w1_eeprom: w1_eeprom at 0 {
+			compatible = "maxim,ds24b33";
+			status = "okay";
+		};
+	};
+
 	ahb {
 		apb {
 			mmc0: mmc at f0000000 {
@@ -243,6 +255,11 @@
 						atmel,pins =
 							<AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;	/* PE9, conflicts with A9 */
 					};
+
+					pinctrl_onewire_tm_default: onewire_tm_default {
+						atmel,pins =
+							<AT91_PIOE 23 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+					};
 				};
 			};
 		};
arch/arm/dts/sama5d3.dtsi +5 -0
index ba707b0..7db66c5 100644
@@ -1534,4 +1534,9 @@
 			};
 		};
 	};
+
+	onewire_tm: onewire {
+		compatible = "w1-gpio";
+		status = "disabled";
+	};
 };
Signature · 1 line
2.7.4
#62 lore raw

PATCH v4 31/34 ARM: dts: at91: sama5d3_xplained: add onewire connector for LCD eeprom

Quoted 3 lines · Eugen Hristev

Add onewire node in device tree for TM series LCDs

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/65026a59/attachment.sig>
#63 lore raw

PATCH v4 32/34 ARM: dts: at91: sama5d27_som1_ek: add onewire connector for LCD eeprom

In reply to Eugen Hristev

Add onewire node in device tree for TM series LCDs

---
 arch/arm/dts/at91-sama5d27_som1_ek.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/dts/at91-sama5d27_som1_ek.dts +17 -0
index 5e62d4a..4cd6db6 100644
@@ -54,6 +54,18 @@
 		stdout-path = &uart1;
 	};
 
+	onewire_tm: onewire {
+		gpios = <&pioA 17 0>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_onewire_tm_default>;
+		status = "okay";
+
+		w1_eeprom: w1_eeprom at 0 {
+			compatible = "maxim,ds24b33";
+			status = "okay";
+		};
+	};
+
 	ahb {
 		usb1: ohci at 00400000 {
 			num-ports = <3>;
@@ -208,6 +220,11 @@
 						pinmux = <PIN_PA31__GPIO>;
 						bias-disable;
 					};
+
+					pinctrl_onewire_tm_default: onewire_tm_default {
+						pinmux = <PIN_PA17__GPIO>;
+						bias-pull-up;
+					};
 				};
 			};
 		};
Signature · 1 line
2.7.4
#64 lore raw

PATCH v4 32/34 ARM: dts: at91: sama5d27_som1_ek: add onewire connector for LCD eeprom

Quoted 3 lines · Eugen Hristev

Add onewire node in device tree for TM series LCDs

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/45e24d85/attachment.sig>
#65 lore raw

PATCH v4 33/34 ARM: dts: at91: sama5d2_ptc: add onewire connector for LCD eeprom

In reply to Eugen Hristev

Add onewire node in device tree for TM series LCDs

---
 arch/arm/dts/at91-sama5d2_ptc_ek.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/dts/at91-sama5d2_ptc_ek.dts +17 -0
index ab5ab21..068a117 100644
@@ -56,6 +56,18 @@
 		stdout-path = &uart0;
 	};
 
+	onewire_tm: onewire {
+		gpios = <&pioA PIN_PB31 0>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_onewire_tm_default>;
+		status = "okay";
+
+		w1_eeprom: w1_eeprom at 0 {
+			compatible = "maxim,ds24b33";
+			status = "okay";
+		};
+	};
+
 	ahb {
 		usb0: gadget at 00300000 {
 			atmel,vbus-gpio = <&pioA PIN_PA27 GPIO_ACTIVE_HIGH>;
@@ -208,6 +220,11 @@
 						pinmux = <PIN_PB11__GPIO>;
 						bias-disable;
 					};
+
+					pinctrl_onewire_tm_default: onewire_tm_default {
+						pinmux = <PIN_PB31__GPIO>;
+						bias-pull-up;
+					};
 				};
 			};
 		};
Signature · 1 line
2.7.4
#66 lore raw

PATCH v4 33/34 ARM: dts: at91: sama5d2_ptc: add onewire connector for LCD eeprom

Quoted 3 lines · Eugen Hristev

Add onewire node in device tree for TM series LCDs

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/14755199/attachment.sig>
#67 lore raw

PATCH v4 34/34 ARM: dts: at91: sama5d4_xplained: add onewire connector for LCD eeprom

In reply to Eugen Hristev

Add onewire node in device tree for TM series LCDs

---
 arch/arm/dts/at91-sama5d4_xplained.dts | 16 ++++++++++++++++
 arch/arm/dts/sama5d4.dtsi              |  5 +++++
 2 files changed, 21 insertions(+)
arch/arm/dts/at91-sama5d4_xplained.dts +16 -0
index ea35dc2..58a0e60 100644
@@ -58,6 +58,18 @@
 		stdout-path = &usart3;
 	};
 
+	onewire_tm: onewire {
+		gpios = <&pioE 15 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_onewire_tm_default>;
+		status = "okay";
+
+		w1_eeprom: w1_eeprom at 0 {
+			compatible = "maxim,ds24b33";
+			status = "okay";
+		};
+	};
+
 	memory {
 		reg = <0x20000000 0x20000000>;
 	};
@@ -199,6 +211,10 @@
 						atmel,pins =
 							<AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
 					};
+					pinctrl_onewire_tm_default: onewire_tm_default {
+						atmel,pins =
+							<AT91_PIOE 15 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;
+					};
 				};
 			};
 		};
arch/arm/dts/sama5d4.dtsi +5 -0
index 8072b8a..8875d7b 100644
@@ -1913,4 +1913,9 @@
 			};
 		};
 	};
+
+	onewire_tm: onewire {
+		compatible = "w1-gpio";
+		status = "disabled";
+	};
 };
Signature · 1 line
2.7.4
#68 lore raw

PATCH v4 34/34 ARM: dts: at91: sama5d4_xplained: add onewire connector for LCD eeprom

Quoted 3 lines · Eugen Hristev

Add onewire node in device tree for TM series LCDs

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/09735a73/attachment.sig>