public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 0/6] Introducing the Alpine platform.
Date: Wed, 04 Feb 2015 13:33:21 +0100	[thread overview]
Message-ID: <4902057.1c5MpYALGg@wuerfel> (raw)
In-Reply-To: <CABM=7kn-Q-poN-6xam419we-CFV-_GyLLFx4UZ-Q4RdKMbJ6dg@mail.gmail.com>

On Wednesday 04 February 2015 13:19:04 Tsahee Zidenberg wrote:
> Hi arnd!
> 
> On 3 February 2015 at 15:55, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 03 February 2015 15:29:05 Tsahee Zidenberg wrote:
> >> If possible to introduce this into 3.20 - I would really appreciate it. If any
> >> action by me can make it happen - please let me know.
> >>
> >
> > Hi Tsahee,
> >
> > This is not directly related to your patches, but since I got curious I
> > looked at the source code published by Synology. I don't know how far
> > you've come in modernizing this, but this is what I found:
> >
> > * The hardware looked really nice
> > * You only have a couple of custom drivers, but they all have the
> >   same mistake in using a private 'hardware abstraction layer'. Don't
> >   do this, and use the kernel's interfaces directly
> 
> The main motivations for adding a HAL:
> * re-using code between linux kernel and other systems.
> * re-using common code between different drivers (e.g. - different
> hardware units use the same DMA engine)
> * a basic approach that states our HAL is in-fact part of the chip's API
> I believe we will find a middle ground that will allow keeping these
> benefits without compromise of the kernel coding style. The HALs were
> written from day 1 with kernel coding-style in mind, and we do realize
> there may be some more changes required in the process.

I understand where you are coming from, as this is something that
everyone gets wrong at first. However, you will not be able to merge
the drivers with a HAL like this. The kernel abstracts all the
components of typical SoCs already and I suspect you just did not
use the right abstraction because you either didn't find it, or it
was not there at the time you started the work.

For example, a DMA subsystem that is used by multiple slave drivers
should use a driver in drivers/dma that registers to the slave-dma API,
and a clock driver should register in drivers/clk, and the smmu
belongs into drivers/iommu.

I expect that for each exported function of your HAL, we already have
a subsystem that lets you express the same functionality in a more
general way. I can help you find the right place if you are unsure about
some of them.

If there is some code that does not have a proper subsystem it can be
moved into, we should discuss about adding a subsystem with soc-independent
interfaces, but I don't think we need this for a chip like yours that
uses fairly standard components.

> > * The serdes driver should register as a generic PHY driver
> > * If possible, move the PCI initialization into the boot loader
> >   and use drivers/pci/pci_host_generic.c to avoid having your
> >   own driver.
> 
> PCI support will probably be the next topic for Alpine merging. I am
> working on the patchset, and it will use the generic pci driver and
> device-tree node.

Ok, sounds good.

	Arnd

  reply	other threads:[~2015-02-04 12:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 13:29 [PATCH v4 0/6] Introducing the Alpine platform Tsahee Zidenberg
2015-02-03 13:55 ` Arnd Bergmann
2015-02-04 11:19   ` Tsahee Zidenberg
2015-02-04 12:33     ` Arnd Bergmann [this message]
2015-02-05  8:28       ` Ronen Shitrit
2015-02-05 12:21         ` Arnd Bergmann
2015-02-05 12:33           ` Ronen Shitrit

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=4902057.1c5MpYALGg@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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