public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Angelo Dureghello <angelo@sysam.it>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] drivers: spi: migrate cf_spi to DM
Date: Sat, 11 Aug 2018 15:30:07 +0200	[thread overview]
Message-ID: <20180811133007.GA2227@jerusalem> (raw)
In-Reply-To: <CAMty3ZBteA30_6e5E425VbeWhrn9NFthPGW9e_SBK0W2_P+=+A@mail.gmail.com>

Hi Jagan,

On Tue, Aug 07, 2018 at 10:53:28AM +0530, Jagan Teki wrote:
> On Fri, Jun 29, 2018 at 1:18 AM, Angelo Dureghello <angelo@sysam.it> wrote:
> > Hi Jagan,
> >
> > On Wed, Jun 27, 2018 at 02:54:42PM +0530, Jagan Teki wrote:
> >> On Wed, Jun 27, 2018 at 2:27 PM, Angelo Dureghello <angelo@sysam.it> wrote:
> >> > Hi Jagan,
> >> >
> >> > On Wed, Jun 27, 2018 at 12:08:26PM +0530, Jagan Teki wrote:
> >> >> On Tue, Jun 26, 2018 at 10:28 PM, Angelo Dureghello <angelo@sysam.it> wrote:
> >> >> > This patch adds DM support to cf_spi.c.
> >> >> >
> >> >> > How to use/test it:
> >> >> >
> >> >> > 1) enable the following options,
> >> >> >
> >> >> > CONFIG_DM_SPI
> >> >> > CONFIG_DM_SPI_FLASH
> >> >> >
> >> >> > 2) add similar code into your board.c file
> >> >> >
> >> >> > U_BOOT_DEVICE(coldfire_spi) = {
> >> >> >         .name = "spi_coldfire",
> >> >> >         .platdata = &mcf_spi_plat,
> >> >> > };
> >> >> >
> >> >> > ---
> >> >> > Changes from v1:
> >> >> > - split into 2 patches
> >> >> >
> >> >> > Changes from v2:
> >> >> > - back in a single patch, no need to add fdt support or special
> >> >> >   config options
> >> >> > - doc/driver-model/spi-howto.txt has been re-checked and followed,
> >> >> >   the driver now builds as is.
> >> >>
> >> >> Nice, How about full dm conversion. I have seen few boards using this
> >> >> driver and its quite manageble for full switching. what do you think?
> >> >
> >> > Sorry, what do you mean exactly for full switching ?
> >> > My understanding is, to remove the non-dm part of the driver and add to
> >> > each board proper device struct and config options, correct ?
> >>
> >> yes.
> >>
> >> > In this case, i can only test it on my stmark2 board, but i think could
> >> > be enough.
> >>
> >> yes, for untested ones will ask other board maintainers.
> >
> > I verified right now, for a full switch i should enable CONFIG_DM for
> > the architecture, and then select CONFIG_DM_SPI, moving as his child
> > the CONFIG_CF_SPI.
> >
> > To enable CONFIG_DM for m68k means to add device tree, or there are
> > of_xxx functions unresolved externals errors then.
> 
> Can you list me these funcs.
> 
Sure, i enabled CONFIG_DM in my stmark2_defconfig, getting

drivers/spi/built-in.o: In function `dev_read_u32_default':
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:467: undefined reference to `ofnode_read_u32_default'
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:467: undefined reference to `ofnode_read_u32_default'
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:467: undefined reference to `ofnode_read_u32_default'
drivers/spi/built-in.o: In function `dev_read_bool':
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:478: undefined reference to `ofnode_read_bool'
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:478: undefined reference to `ofnode_read_bool'
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:478: undefined reference to `ofnode_read_bool'
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:478: undefined reference to `ofnode_read_bool'
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:478: undefined reference to `ofnode_read_bool'
drivers/spi/built-in.o: In function `dev_read_u32_default':
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:467: undefined reference to `ofnode_read_u32_default'
/home/angelo/sysam/u-boot-coldfire/include/dm/read.h:467: undefined reference to `ofnode_read_u32_default'
drivers/spi/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined reference to `dm_scan_fdt_dev'
make: *** [Makefile:1350: u-boot] Error 1

> >
> > For this small architecture, i am not that happy to add the devicetree
> > support. I should add a fixed 30 KB of binary size and several diffent
> > families/dtsi, with the benefit to configure mainly uart and spi.
> 
> I think we may rely some kind of platdata stuff for DT functions here,
> if size is really matter with DT.
> 
> btw, you're patch seems checkpatch errors, check it the same?
>
Sorry, not sure why, i generally alays check by checkpatch.pl.
Can fix them all in a v3 if you don't have other points.

Waiting for your feedbacks.
 
> total: 43 errors, 0 warnings, 0 checks, 607 lines checked

Regards,
Angelo Dureghello

  reply	other threads:[~2018-08-11 13:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26 16:58 [U-Boot] [PATCH v3] drivers: spi: migrate cf_spi to DM Angelo Dureghello
2018-06-27  6:38 ` Jagan Teki
2018-06-27  8:57   ` Angelo Dureghello
2018-06-27  9:24     ` Jagan Teki
2018-06-28 19:48       ` Angelo Dureghello
2018-08-07  5:23         ` Jagan Teki
2018-08-11 13:30           ` Angelo Dureghello [this message]
2018-09-14 10:17         ` Simon Glass
2018-09-15  9:13           ` Angelo Dureghello
2018-09-15 14:32             ` Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180811133007.GA2227@jerusalem \
    --to=angelo@sysam.it \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox