Add support for 1wire protocol and 1wire eeproms
Subsystems (5)
cover Add support for 1wire protocol and 1wire eeproms
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 sama xplained boards.
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 and sama5d3_xplained. 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 01/20] 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 02/20] w1: Add 1-Wire gpio driver
Add the bindings documentation in:
[PATCH 03/20] dt-bindings: W1: w1-gpio: added bindings for w1-gpio
A uclass driver is added for one wire eeproms, in patch :
[PATCH 04/20] W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs
Specific driver for the DS24 Maxim EEPROMs is added in the patch:
[PATCH 05/20] W1-EEPROM: add support for Maxim DS24 eeprom families
A sandbox driver for a onewire EEPROM is added in patch:
[PATCH 06/20] W1-EEPROM: add sandbox driver
A command is added for the onewire protocol in patch:
[PATCH 07/20] w1: add command for onewire protocol
Pinctrl driver for sandbox was updated to add a new group and function for w1:
[PATCH 08/20] pinctrl: sandbox: add gpio onewire w1 group
Add a node in sandbox DT to have a test node for sandbox. [PATCH 09/20] sandbox: DTS: w1: add node for one wire interface on
GPIO
The defconfig for sandbox is updated to include the drivers:
[PATCH 10/20] configs: sandbox: add onewire w1 and sandbox
eeprom
Modify the w1 class driver to add a sandbox device if sandbox is configured:
[PATCH 11/20] w1: enumerate sandbox driver if configured
Configuration for sama5d2 xplained is updated in patch:
[PATCH 12/20] configs: sama5d2_xplained: add onewire and eeprom
Configuration for sama5d3 xplained is updated in patch:
[PATCH 13/20] configs: sama5d3_xplained: add onewire and eeprom
Pda detection is added in the common part for atmel boards:
[PATCH 14/20] board: atmel: add support for pda detection
Specifically add it for Sama5d2 xplained board in patch:
[PATCH 15/20] board: sama5d2_xplained: add pda detect call at init
time
Specifically add it for Sama5d3 xplained board in patch:
[PATCH 16/20] board: sama5d3_xplained: add pda detect call at init
time
Add support for overlays for sama5d2 xplained config in patch:
[PATCH 17/20] configs: sama5d2_xplained: add fdt overlay support
Add support for overlays for sama5d3 xplained config in patch:
[PATCH 18/20] configs: sama5d3_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 19/20] 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 20/20] ARM: dts: at91: sama5d3_xplained: add onewire connector
Eugen Hristev (16):
dt-bindings: W1: w1-gpio: added bindings for w1-gpio
W1-EEPROM: add sandbox driver
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
w1: enumerate sandbox driver if configured
configs: sama5d2_xplained: add onewire and eeprom drivers
configs: sama5d3_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
configs: sama5d2_xplained: add fdt overlay support
configs: sama5d3_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
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-sama5d2_xplained.dts | 12 ++ arch/arm/dts/at91-sama5d3_xplained.dts | 12 ++ arch/arm/dts/sama5d2.dtsi | 6 + arch/arm/dts/sama5d3.dtsi | 6 + arch/arm/mach-at91/Kconfig | 1 + arch/sandbox/dts/sandbox.dts | 15 ++ board/atmel/common/board.c | 55 +++++ board/atmel/sama5d2_xplained/sama5d2_xplained.c | 3 + board/atmel/sama5d3_xplained/sama5d3_xplained.c | 10 + cmd/Kconfig | 7 + cmd/Makefile | 1 + cmd/w1.c | 121 +++++++++++ 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/sandbox_defconfig | 4 + doc/device-tree-bindings/w1/w1-gpio.txt | 26 +++ 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 | 46 ++++ drivers/w1-eeprom/eep_sandbox.c | 57 +++++ drivers/w1-eeprom/w1-eeprom-uclass.c | 56 +++++ drivers/w1/Kconfig | 25 +++ drivers/w1/Makefile | 3 + drivers/w1/w1-gpio.c | 158 ++++++++++++++ drivers/w1/w1-uclass.c | 273 ++++++++++++++++++++++++ include/dm/uclass-id.h | 2 + include/w1-eeprom.h | 28 +++ include/w1.h | 49 +++++ 33 files changed, 1039 insertions(+) create mode 100644 cmd/w1.c create mode 040000 doc/device-tree-bindings/w1 create mode 100644 doc/device-tree-bindings/w1/w1-gpio.txt create mode 040000 drivers/w1-eeprom 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 040000 drivers/w1 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
PATCH 1/20 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.
--- drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/w1/Kconfig | 18 ++++ drivers/w1/Makefile | 1 + drivers/w1/w1-uclass.c | 268 +++++++++++++++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/w1.h | 48 +++++++++ 7 files changed, 339 insertions(+) create mode 040000 drivers/w1 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
@@ -102,6 +102,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
@@ -101,6 +101,7 @@ obj-y += input/ obj-y += soc/ obj-$(CONFIG_REMOTEPROC) += remoteproc/ obj-y += thermal/ +obj-$(CONFIG_W1) += w1/ obj-$(CONFIG_MACH_PIC32) += ddr/microchip/ endif
drivers/w1/Kconfig new file +18 -0
@@ -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
@@ -0,0 +1 @@ +obj-$(CONFIG_W1) += w1-uclass.o
drivers/w1/w1-uclass.c new file +268 -0
268 lines not on this page · raw message
include/dm/uclass-id.h +1 -0
@@ -89,6 +89,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 +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 2/20 w1: Add 1-Wire gpio driver
In reply to Eugen HristevFrom: Maxime Ripard <[email protected]>
Add a bus driver for bitbanging a 1-Wire bus over a GPIO.
--- drivers/w1/Kconfig | 7 +++ drivers/w1/Makefile | 2 + drivers/w1/w1-gpio.c | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 drivers/w1/w1-gpio.c
drivers/w1/Kconfig +7 -0
@@ -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
@@ -1 +1,3 @@ obj-$(CONFIG_W1) += w1-uclass.o + +obj-$(CONFIG_W1_GPIO) += w1-gpio.o
drivers/w1/w1-gpio.c new file +158 -0
158 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 3/20 dt-bindings: W1: w1-gpio: added bindings for w1-gpio
In reply to Eugen HristevAdded bindings specification for bitbanged gpio driver for Dallas one wire protocol
--- doc/device-tree-bindings/w1/w1-gpio.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 040000 doc/device-tree-bindings/w1 create mode 100644 doc/device-tree-bindings/w1/w1-gpio.txt
doc/device-tree-bindings/w1/w1-gpio.txt new file +26 -0
@@ -0,0 +1,26 @@ +W1 gpio device binding - one wire protocol over bitbanged gpio +======================= + + +No child nodes are required in device tree. The driver will autodetect +the devices and instantiate the driver for the child according to the detected +family. This is done according to the discovery protocol in 1wire standard. + +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>; +};
Signature · 1 line
2.7.4
PATCH 4/20 W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs
In reply to Eugen HristevFrom: Maxime Ripard <[email protected]>
We might want to access data stored onto one wire EEPROMs. Create a framework to provide a consistent API.
--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/w1-eeprom/Kconfig | 17 +++++++++++ drivers/w1-eeprom/Makefile | 2 ++ drivers/w1-eeprom/w1-eeprom-uclass.c | 56 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/w1-eeprom.h | 28 ++++++++++++++++++ 7 files changed, 107 insertions(+) create mode 040000 drivers/w1-eeprom 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
@@ -104,6 +104,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
@@ -102,6 +102,7 @@ obj-y += soc/ obj-$(CONFIG_REMOTEPROC) += remoteproc/ obj-y += thermal/ 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
@@ -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
@@ -0,0 +1,2 @@ +obj-$(CONFIG_W1_EEPROM) += w1-eeprom-uclass.o +
drivers/w1-eeprom/w1-eeprom-uclass.c new file +56 -0
56 lines not on this page · raw message
include/dm/uclass-id.h +1 -0
@@ -90,6 +90,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 +28 -0
@@ -0,0 +1,28 @@ +/* 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); + +#endif
Signature · 1 line
2.7.4
PATCH 4/20 W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs
Hi Eugen,
Thanks for giving those patches another shot.
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.
Signed-off-by Maxime Ripard <[email protected]>[eugen.hristev at microchip.com: reworked patch]Signed-off-by Eugen Hristev <[email protected]>
Quoted 14 lines
--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/w1-eeprom/Kconfig | 17 +++++++++++ drivers/w1-eeprom/Makefile | 2 ++ drivers/w1-eeprom/w1-eeprom-uclass.c | 56 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/w1-eeprom.h | 28 ++++++++++++++++++ 7 files changed, 107 insertions(+) create mode 040000 drivers/w1-eeprom 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
I believe that we shouldn't have a framework solely for 1-wire EEPROMs, but for EEPROMs, connected to any bus.
The 1-Wire EEPROMs all behave pretty much the same, so we'll probably only see a single driver within that framework. And at the same time, we'll want to have a consistent interface to access all the EEPROMs, no matter on which bus they sit on.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180720/eac6287a/attachment.sig>
PATCH 4/20 W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs
Quoted 28 lines · Maxime Ripard
Hi Eugen,
Thanks for giving those patches another shot.
Quoted 17 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.
Signed-off-by Maxime Ripard <[email protected]>[eugen.hristev at microchip.com: reworked patch]Signed-off-by Eugen Hristev <[email protected]>--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/w1-eeprom/Kconfig | 17 +++++++++++ drivers/w1-eeprom/Makefile | 2 ++ drivers/w1-eeprom/w1-eeprom-uclass.c | 56 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/w1-eeprom.h | 28 ++++++++++++++++++ 7 files changed, 107 insertions(+)Quoted 5 lines
create mode 040000
drivers/w1-eeprom
create mode 100644drivers/w1-eeprom/Kconfigcreate mode 100644drivers/w1-eeprom/Makefilecreate mode 100644drivers/w1-eeprom/w1-eeprom-uclass.ccreate mode 100644include/w1-eeprom.h
Quoted 7 lines
I believe that we shouldn't have a framework solely for 1-wire EEPROMs, but for EEPROMs, connected to any bus.
The 1-Wire EEPROMs all behave pretty much the same, so we'll probably only see a single driver within that framework. And at the same time, we'll want to have a consistent interface to access all the EEPROMs, no matter on which bus they sit on.
Hello,
I worked this series using the original implementation as a starting
point: having the eeproms on different subsystems (i2c and onewire).
The different types of eeproms have only the name in common as I see it, and the way to access them is totally different: two different type of buses, so uniting them is just for the namesake ?
One option is to have them separately, as we have spi, i2c memories , etc; Or, unite them under a single subsystem for eeproms, and have one driver for i2c eeproms and one for w1 eeproms, trying to make the same API to access them, and hide the bus specific differences.
Question for maintainers: which is the best direction to go, so I can rework the series accordingly ?
Thanks,
Eugen
Quoted 3 lines
Maxime
PATCH 4/20 W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs
Quoted 48 lines · Eugen Hristev
Quoted 28 lines · Maxime Ripard
Hi Eugen,
Thanks for giving those patches another shot.
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.
Signed-off-by Maxime Ripard <[email protected]>[eugen.hristev at microchip.com: reworked patch]Signed-off-by Eugen Hristev <[email protected]>Quoted 14 lines
--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/w1-eeprom/Kconfig | 17 +++++++++++ drivers/w1-eeprom/Makefile | 2 ++ drivers/w1-eeprom/w1-eeprom-uclass.c | 56 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/w1-eeprom.h | 28 ++++++++++++++++++ 7 files changed, 107 insertions(+) create mode 040000 drivers/w1-eeprom 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.hQuoted 7 lines
I believe that we shouldn't have a framework solely for 1-wire EEPROMs, but for EEPROMs, connected to any bus.
The 1-Wire EEPROMs all behave pretty much the same, so we'll probably only see a single driver within that framework. And at the same time, we'll want to have a consistent interface to access all the EEPROMs, no matter on which bus they sit on.
Hello,
I worked this series using the original implementation as a starting point:
having the eeproms on different subsystems (i2c and onewire).The different types of eeproms have only the name in common as I see it, and the way to access them is totally different: two different type of buses, so uniting them is just for the namesake ?
Quoted 7 lines
One option is to have them separately, as we have spi, i2c memories , etc; Or, unite them under a single subsystem for eeproms, and have one driver for i2c eeproms and one for w1 eeproms, trying to make the same API to access them, and hide the bus specific differences.
Question for maintainers: which is the best direction to go, so I can rework the series accordingly ?
It would be nice if we had a generic eeprom command that wasn't bus-centric. Unfortunately we have an eeprom command that IS bus centric and not easily extended to working on all appropriate buses. So to me, starting out by handing w1 eeproms under w1 seems OK. And we can put it on the TODO list to make cmd/eeprom.c parse <bus> as perhaps "BUSTYPE:number" so we could do eeprom w1:0 ... or eeprom i2c:0 ... and so forth.
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/20180730/07b96662/attachment.sig>
PATCH 4/20 W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs
Hi,
Quoted 57 lines · Tom Rini
Quoted 48 lines · Eugen Hristev
Quoted 28 lines · Maxime Ripard
Hi Eugen,
Thanks for giving those patches another shot.
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.
Signed-off-by Maxime Ripard <[email protected]>[eugen.hristev at microchip.com: reworked patch]Signed-off-by Eugen Hristev <[email protected]>Quoted 14 lines
--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/w1-eeprom/Kconfig | 17 +++++++++++ drivers/w1-eeprom/Makefile | 2 ++ drivers/w1-eeprom/w1-eeprom-uclass.c | 56 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/w1-eeprom.h | 28 ++++++++++++++++++ 7 files changed, 107 insertions(+) create mode 040000 drivers/w1-eeprom 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.hQuoted 7 lines
I believe that we shouldn't have a framework solely for 1-wire EEPROMs, but for EEPROMs, connected to any bus.
The 1-Wire EEPROMs all behave pretty much the same, so we'll probably only see a single driver within that framework. And at the same time, we'll want to have a consistent interface to access all the EEPROMs, no matter on which bus they sit on.
Hello,
I worked this series using the original implementation as a starting point:
having the eeproms on different subsystems (i2c and onewire).The different types of eeproms have only the name in common as I see it, and the way to access them is totally different: two different type of buses, so uniting them is just for the namesake ?
Quoted 7 lines
One option is to have them separately, as we have spi, i2c memories , etc; Or, unite them under a single subsystem for eeproms, and have one driver for i2c eeproms and one for w1 eeproms, trying to make the same API to access them, and hide the bus specific differences.
Question for maintainers: which is the best direction to go, so I can rework the series accordingly ?
Quoted 7 lines
It would be nice if we had a generic eeprom command that wasn't bus-centric. Unfortunately we have an eeprom command that IS bus centric and not easily extended to working on all appropriate buses. So to me, starting out by handing w1 eeproms under w1 seems OK. And we can put it on the TODO list to make
cmd/eeprom.cparse <bus> as perhaps "BUSTYPE:number" so we could do eeprom w1:0 ... or eeprom i2c:0 ... and so forth.
That makes sense to me.
We could provide some sort of read/write device supported by SPI, I2C, 1wire, etc. in principle. I don't think anyone has attempted it yet.
Regards,
Simon
PATCH 5/20 W1-EEPROM: add support for Maxim DS24 eeprom families
In reply to Eugen HristevFrom: 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.
--- drivers/w1-eeprom/Kconfig | 6 ++++++ drivers/w1-eeprom/Makefile | 2 ++ drivers/w1-eeprom/ds24xxx.c | 46 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 drivers/w1-eeprom/ds24xxx.c
drivers/w1-eeprom/Kconfig +6 -0
@@ -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
@@ -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 +46 -0
46 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 6/20 W1-EEPROM: add sandbox driver
In reply to Eugen HristevAdd 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 | 57 +++++++++++++++++++++++++++++++++++++++++ include/w1.h | 1 + 4 files changed, 65 insertions(+) create mode 100644 drivers/w1-eeprom/eep_sandbox.c
drivers/w1-eeprom/Kconfig +6 -0
@@ -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
@@ -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 +57 -0
57 lines not on this page · raw message
include/w1.h +1 -0
@@ -12,6 +12,7 @@#define W1_FAMILY_DS24B33 0x23#define W1_FAMILY_DS2431 0x2d +#define W1_FAMILY_EEP_SANDBOX 0xfe/** * struct w1_driver_entry - Matches a driver to its w1 family
Signature · 1 line
2.7.4
PATCH 7/20 w1: add command for onewire protocol
In reply to Eugen HristevAdd basic command for bus information and read for onewire bus using Dallas 1-Wire protocol.
--- cmd/Kconfig | 7 ++++ cmd/Makefile | 1 + cmd/w1.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 cmd/w1.c
cmd/Kconfig +7 -0
@@ -816,6 +816,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
@@ -143,6 +143,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 +121 -0
121 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 8/20 pinctrl: sandbox: add gpio onewire w1 group
In reply to Eugen HristevAdd 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
@@ -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
PATCH 9/20 sandbox: DTS: w1: add node for one wire interface on GPIO
In reply to Eugen HristevAdd a node for the one wire uclass and one wire gpio driver in sandbox.
--- arch/sandbox/dts/sandbox.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/sandbox/dts/sandbox.dts +15 -0
@@ -160,6 +160,7 @@ pinctrl { compatible = "sandbox,pinctrl"; + status = "okay"; pinctrl_i2c0: i2c0 { groups = "i2c";
@@ -171,6 +172,12 @@ groups = "serial_a"; function = "serial"; }; + + pinctrl_onewire0: onewire0 { + groups = "w1"; + function = "w1"; + bias-pull-up; + }; }; reset at 1 {
@@ -319,6 +326,14 @@ }; }; }; + + onewire0: onewire { + compatible = "w1-gpio"; + gpios = <&gpio_a 8>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_onewire0>; + status = "okay"; + }; }; #include "cros-ec-keyboard.dtsi"
Signature · 1 line
2.7.4
PATCH 10/20 configs: sandbox: add onewire w1 and sandbox eeprom
In reply to Eugen HristevTo 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
@@ -186,6 +186,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
PATCH 11/20 w1: enumerate sandbox driver if configured
In reply to Eugen HristevAdd a sandbox eeprom on the bus as a device, if sandbox driver is configured.
--- drivers/w1/w1-uclass.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/w1/w1-uclass.c +5 -0
@@ -142,6 +142,11 @@ static int w1_enumerate(struct udevice *bus) } } +#ifdef CONFIG_W1_EEPROM_SANDBOX +/* before we are finished, add a sandbox device if we can */ +w1_new_device (bus,W1_FAMILY_EEP_SANDBOX ); +#endif +return 0 ; }
Signature · 1 line
2.7.4
PATCH 11/20 w1: enumerate sandbox driver if configured
Hi Eugen,
Thanks for (re-)bringing the One wire support to u-boot.
Quoted 13 lines
Add a sandbox eeprom on the bus as a device, if sandbox driver is configured.
Signed-off-by Eugen Hristev <[email protected]>--- drivers/w1/w1-uclass.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/w1/w1-uclass.c +0
-0
drivers/w1/w1-uclass.c static int w1_enumerate(struct udevice *bus) · line 148
Quoted 7 lines
drivers/w1/w1-uclass.c +4
-0@@ -142,6 +142,11 @@ static int w1_enumerate(struct udevice *bus) } } +#ifdef CONFIG_W1_EEPROM_SANDBOX +/* before we are finished, add a sandbox device if we can */ +w1_new_device (bus,W1_FAMILY_EEP_SANDBOX ); +#endif
IMHO we shouldn't mix the sandbox code with production (on boards) code.
Maybe Simon (+CCed) could provide some more input here?
drivers/w1/w1-uclass.c static int w1_enumerate(struct udevice *bus) · line 152
Quoted 4 lines
drivers/w1/w1-uclass.c +1
-0+return 0 ; }
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180720/e2748551/attachment.sig>
PATCH 11/20 w1: enumerate sandbox driver if configured
Hi,
Quoted 20 lines · Lukasz Majewski
Hi Eugen,
Thanks for (re-)bringing the One wire support to u-boot.
Quoted 16 lines
Add a sandbox eeprom on the bus as a device, if sandbox driver is configured.
Signed-off-by Eugen Hristev <[email protected]>--- drivers/w1/w1-uclass.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/w1/w1-uclass.c +0
-0@@ -142,6 +142,11 @@ static int w1_enumerate(struct udevice *bus) } }
Quoted 8 lines
drivers/w1/w1-uclass.c static int w1_enumerate(struct udevice *bus) · line 148
Quoted 4 lines
drivers/w1/w1-uclass.c +4
-0+#ifdef CONFIG_W1_EEPROM_SANDBOX +/* before we are finished, add a sandbox device if we can */ +w1_new_device (bus,W1_FAMILY_EEP_SANDBOX ); +#endif IMHO we shouldn't mix the sandbox code with production (on boards) code.
Maybe Simon (+CCed) could provide some more input here?
I have not seen this series. But new devices should be created automatically based on them being in the device tree. So you should just be able to add them there.
I don't understand what w1_new_device() does. Also, it should return an error.
Regards,
Simon
PATCH 11/20 w1: enumerate sandbox driver if configured
Quoted 30 lines · Simon Glass
Hi,
Quoted 27 lines · Lukasz Majewski
Hi Eugen,
Thanks for (re-)bringing the One wire support to u-boot.
Quoted 13 lines
Add a sandbox eeprom on the bus as a device, if sandbox driver is configured.
Signed-off-by Eugen Hristev <[email protected]>--- drivers/w1/w1-uclass.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/w1/w1-uclass.c +0
-0drivers/w1/w1-uclass.c static int w1_enumerate(struct udevice *bus) · line 148
Quoted 7 lines
drivers/w1/w1-uclass.c +4
-0@@ -142,6 +142,11 @@ static int w1_enumerate(struct udevice *bus) } } +#ifdef CONFIG_W1_EEPROM_SANDBOX +/* before we are finished, add a sandbox device if we can */ +w1_new_device (bus,W1_FAMILY_EEP_SANDBOX ); +#endif IMHO we shouldn't mix the sandbox code with production (on boards) code.
Quoted 5 lines
Quoted 1 line
Maybe Simon (+CCed) could provide some more input here?
I have not seen this series. But new devices should be created automatically based on them being in the device tree. So you should just be able to add them there.
1-Wire is discoverable, so there's no device nodes in the DT.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180724/33f3bc6c/attachment.sig>
PATCH 11/20 w1: enumerate sandbox driver if configured
Hi Maxime,
Quoted 31 lines · Maxime Ripard
Quoted 30 lines · Simon Glass
Hi,
Quoted 27 lines · Lukasz Majewski
Hi Eugen,
Thanks for (re-)bringing the One wire support to u-boot.
Quoted 13 lines
Add a sandbox eeprom on the bus as a device, if sandbox driver is configured.
Signed-off-by Eugen Hristev <[email protected]>--- drivers/w1/w1-uclass.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/w1/w1-uclass.c +0
-0drivers/w1/w1-uclass.c static int w1_enumerate(struct udevice *bus) · line 148
Quoted 7 lines
drivers/w1/w1-uclass.c +4
-0@@ -142,6 +142,11 @@ static int w1_enumerate(struct udevice *bus) } } +#ifdef CONFIG_W1_EEPROM_SANDBOX +/* before we are finished, add a sandbox device if we can */ +w1_new_device (bus,W1_FAMILY_EEP_SANDBOX ); +#endif IMHO we shouldn't mix the sandbox code with production (on boards) code.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Maybe Simon (+CCed) could provide some more input here?
I have not seen this series. But new devices should be created automatically based on them being in the device tree. So you should just be able to add them there.
1-Wire is discoverable, so there's no device nodes in the DT.
Well there should be. See for example PCI, USB, I2C and SPI :-)
Regards,
Simon
PATCH 11/20 w1: enumerate sandbox driver if configured
Quoted 36 lines · Simon Glass
Hi Maxime,
Quoted 33 lines · Maxime Ripard
Quoted 32 lines · Simon Glass
Hi,
Quoted 28 lines · Lukasz Majewski
Hi Eugen,
Thanks for (re-)bringing the One wire support to u-boot.
Quoted 13 lines
Add a sandbox eeprom on the bus as a device, if sandbox driver is configured.
Signed-off-by Eugen Hristev <[email protected]>--- drivers/w1/w1-uclass.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/w1/w1-uclass.c +0
-0drivers/w1/w1-uclass.c static int w1_enumerate(struct udevice *bus) · line 148
Quoted 7 lines
drivers/w1/w1-uclass.c +4
-0@@ -142,6 +142,11 @@ static int w1_enumerate(struct udevice *bus) } } +#ifdef CONFIG_W1_EEPROM_SANDBOX +/* before we are finished, add a sandbox device if we can */ +w1_new_device (bus,W1_FAMILY_EEP_SANDBOX ); +#endif IMHO we shouldn't mix the sandbox code with production (on boards) code.
Maybe Simon (+CCed) could provide some more input here?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
I have not seen this series. But new devices should be created automatically based on them being in the device tree. So you should just be able to add them there.
1-Wire is discoverable, so there's no device nodes in the DT.
Well there should be. See for example PCI, USB, I2C and SPI :-)
I didn't know u-boot's sandbox had binding for USB and PCI devices. My bad :)
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180725/f6b288be/attachment.sig>
PATCH 12/20 configs: sama5d2_xplained: add onewire and eeprom drivers
In reply to Eugen HristevSAMA5D2 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
@@ -86,3 +86,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
@@ -83,3 +83,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
PATCH 13/20 configs: sama5d3_xplained: add onewire and eeprom drivers
In reply to Eugen HristevSAMA5D3 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
@@ -73,3 +73,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
@@ -70,4 +70,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
PATCH 14/20 board: atmel: add support for pda detection
In reply to Eugen HristevThis 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 | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
board/atmel/common/board.c +55 -0
@@ -5,7 +5,62 @@*/ #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 0void dummy (void ) { } + +#if definedCONFIG_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 { +w1_eeprom_read_buf (dev,AT91_PDA_EEPROM_ID_OFFSET , + (u8 *)buf,AT91_PDA_EEPROM_ID_LENGTH ); +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
PATCH 15/20 board: sama5d2_xplained: add pda detect call at init time
In reply to Eugen HristevCall 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
@@ -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
PATCH 16/20 board: sama5d3_xplained: add pda detect call at init time
In reply to Eugen HristevCall 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
@@ -175,6 +175,7 @@ config TARGET_SAMA5D3_XPLAINED select SAMA5D3 select SUPPORT_SPL select BOARD_EARLY_INIT_F + select BOARD_LATE_INIT config TARGET_SAMA5D3XEK bool "SAMA5D3X-EK board"
board/atmel/sama5d3_xplained/sama5d3_xplained.c +10 -0
@@ -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
PATCH 17/20 configs: sama5d2_xplained: add fdt overlay support
In reply to Eugen HristevAdd 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
@@ -90,3 +90,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
@@ -87,3 +87,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
PATCH 18/20 configs: sama5d3_xplained: add fdt overlay support
In reply to Eugen HristevAdd 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
@@ -77,3 +77,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
@@ -75,3 +75,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
PATCH 19/20 ARM: dts: at91: sama5d2_xplained: add onewire connector for LCD eeprom
In reply to Eugen HristevAdd onewire node in device tree for TM series LCDs
--- arch/arm/dts/at91-sama5d2_xplained.dts | 12 ++++++++++++ arch/arm/dts/sama5d2.dtsi | 6 ++++++ 2 files changed, 18 insertions(+)
arch/arm/dts/at91-sama5d2_xplained.dts +12 -0
@@ -11,6 +11,13 @@ stdout-path = &uart1; }; + onewire_tm: onewire { + gpios = <&pioA 32 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_onewire_tm_default>; + status = "okay"; + }; + ahb { usb1: ohci at 00400000 { num-ports = <3>;
@@ -270,6 +277,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 +6 -0
@@ -9,6 +9,7 @@ spi1 = &qspi0; i2c0 = &i2c0; i2c1 = &i2c1; + w1 = &onewire_tm; }; clocks {
@@ -769,4 +770,9 @@ }; }; }; + + onewire_tm: onewire { + compatible = "w1-gpio"; + status = "disabled"; + }; };
Signature · 1 line
2.7.4
PATCH 20/20 ARM: dts: at91: sama5d3_xplained: add onewire connector for LCD eeprom
In reply to Eugen HristevAdd onewire node in device tree for TM series LCDs
--- arch/arm/dts/at91-sama5d3_xplained.dts | 12 ++++++++++++ arch/arm/dts/sama5d3.dtsi | 6 ++++++ 2 files changed, 18 insertions(+)
arch/arm/dts/at91-sama5d3_xplained.dts +12 -0
@@ -36,6 +36,13 @@ }; }; + onewire_tm: onewire { + gpios = <&pioE 23 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_onewire_tm_default>; + status = "okay"; + }; + ahb { apb { mmc0: mmc at f0000000 {
@@ -243,6 +250,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 +6 -0
@@ -39,6 +39,7 @@ ssc0 = &ssc0; ssc1 = &ssc1; pwm0 = &pwm0; + w1 = &onewire_tm; }; cpus { #address-cells = <1>;
@@ -1538,4 +1539,9 @@ }; }; }; + + onewire_tm: onewire { + compatible = "w1-gpio"; + status = "disabled"; + }; };
Signature · 1 line
2.7.4