From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Tue, 10 Jul 2018 14:49:29 -0600 Subject: [U-Boot] [PATCH v2 1/2] rtc: pl031: convert the driver to driver model In-Reply-To: <20180709005032.GQ28220@linaro.org> References: <20180704073628.23596-1-takahiro.akashi@linaro.org> <20180704073628.23596-2-takahiro.akashi@linaro.org> <20180705071258.GI28220@linaro.org> <20180709005032.GQ28220@linaro.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 8 July 2018 at 18:50, AKASHI Takahiro wrote: > On Thu, Jul 05, 2018 at 04:12:59PM +0900, AKASHI Takahiro wrote: >> On Wed, Jul 04, 2018 at 02:35:19PM +0300, Tuomas Tynkkynen wrote: >> > Hi Akashi, >> > >> > Thank you for the DM conversion. >> > >> > On 07/04/2018 10:36 AM, AKASHI Takahiro wrote: >> > <..snip..> >> > >diff --git a/include/dm/platform_data/rtc_pl031.h b/include/dm/platform_data/rtc_pl031.h >> > >new file mode 100644 >> > >index 0000000000..8e4ba1ce69 >> > >--- /dev/null >> > >+++ b/include/dm/platform_data/rtc_pl031.h >> > >@@ -0,0 +1,12 @@ >> > >+/* SPDX-License-Identifier: GPL-2.0+ */ >> > >+ >> > >+#ifndef __rtc_pl031_h >> > >+#define __rtc_pl031_h >> > >+ >> > >+#include >> > >+ >> > >+struct pl031_rtc_platdata { >> > >+ phys_addr_t base; >> > >+}; >> > >+ >> > >+#endif >> > > >> > >> > I think this file won't be necessary, the structure can stay private to pl031.c. >> > PL031 is an ARM IP block and U-Boot on ARM uses the device tree to locate devices. >> >> I think that you are suggesting we would use udevice.priv instead of >> udevice.platdata, right? That will be fine with device-tree based devices. >> But don't we have to take care of no-device-tree (probably legacy) >> devices here? > > Does anybody have a comment on this? > I will be able to go either with priv or platdata once agreed. There is no need to support legacy (non-DM) options unless there is a board that doesn't build without it. Even then, the hour is late and DM conversions should be well underway, so just removing that driver from the board is probably acceptable until the maintainer gets around to it. You should really use platdata to hold info read from the device tree, so to me what you have looks correct, except that I think the struct can be private to your driver. Instead of devfdt_get_addr(), please use dev_read_addr() which is the livetree version. Regards, Simon