All of lore.kernel.org
 help / color / mirror / Atom feed
From: cyrille.pitchen@atmel.com (Cyrille Pitchen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/2] mfd: flexcom: add a driver for Atmel Flexible Serial Communication Unit
Date: Mon, 20 Jul 2015 18:11:54 +0200	[thread overview]
Message-ID: <55AD1DCA.9080308@atmel.com> (raw)
In-Reply-To: <558BD3B8.10709@atmel.com>

Hi all,

based on my previous mail, do someone have any idea on how to add support to
the Flexcom in the kernel ? We would like to manage the Flexcom separately so
we avoid patching 3 existing drivers.

Indeed, their associated devices have no need to know whether they're wrapped
or not by a Flexcom: the Flexcom itself has no functional impact on the serial
controllers it contains.

Also, hiding the additional layer of the Flexcom from the USART, SPI and I2C
drivers would ease their maintenance: it keeps the design of each IP
independent from the others so it would be more easy to add support to future
features.


Best Regards,

Cyrille


Le 25/06/2015 12:11, Cyrille Pitchen a ?crit :
> Hi lee,
> 
> Le 24/06/2015 16:24, Lee Jones a ?crit :
>> On Mon, 22 Jun 2015, Cyrille Pitchen wrote:
>>
>>> This driver supports the new Atmel Flexcom. The Flexcom is a wrapper which
>>> integrates one SPI controller, one I2C controller and one USART. Only one
>>> function can be enabled at a time. This driver selects the function once
>>> for all, when the Flexcom is probed, according to the value of the new
>>> "atmel,flexcom-mode" device tree property.
>>>
>>> This driver has chosen to present the Flexcom to the system as a MFD so
>>> the implementation is seamless for the existing Atmel SPI, I2C and USART
>>> drivers.
>>
>> No need for this driver.
>>
>> Just create your 3 platform drivers and get them to read the mode at
>> probe time.  If the mode isn't the one pertaining to itself return
>> -ENODEV and the Device Driver API will attempt the probe the next
>> device.  Ensure all of the devices have the same compatible string
>> i.e. atmel,sama5d2-flexcom.
>>
> 
> The main idea of this patch was to hide the Flexcom overlay from the 3 serial
> drivers. The Flexcom is a kind of muxer which selects one of the 3 IPs: it 
> doesn't change the internal of the IPs. For instance, on sama5d2x SoCs,
> some SPI controlers are still standalone whereas others are wrapped by a
> Flexcom but all these SPI controllers share the same IP version.
> 
> Also, the Flexcom has its own I/O range. Especially, the Flexcom Mode Register
> which selects the active peripheral is outside the I/O ranges of the SPI, I2C
> or USART IPs.
> 
> The active peripheral must be selected first then its driver can access its I/O
> registers but registers of the other inactive peripherals are still unavailable
> and would be read as zero since their peripherals are still disabled.
> That's why the very first version of the driver presented the Flexcom as a
> clock because most peripherals can't be used before enabling their clock.
> However the Flexcom is not an actual clock so I was told that it would be
> better to introduce the Flexcom as an MFD.
> 
> The idea is to separate the serial controller drivers and the Flexcom driver
> the same way as a clock driver and a pin controller driver are separated from
> the driver of a peripheral which uses them.
> 
> 
> Best Regards,
> 
> Cyrille
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

WARNING: multiple messages have this Message-ID (diff)
From: Cyrille Pitchen <cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
To: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
	boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v4 2/2] mfd: flexcom: add a driver for Atmel Flexible Serial Communication Unit
Date: Mon, 20 Jul 2015 18:11:54 +0200	[thread overview]
Message-ID: <55AD1DCA.9080308@atmel.com> (raw)
In-Reply-To: <558BD3B8.10709-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>

Hi all,

based on my previous mail, do someone have any idea on how to add support to
the Flexcom in the kernel ? We would like to manage the Flexcom separately so
we avoid patching 3 existing drivers.

Indeed, their associated devices have no need to know whether they're wrapped
or not by a Flexcom: the Flexcom itself has no functional impact on the serial
controllers it contains.

Also, hiding the additional layer of the Flexcom from the USART, SPI and I2C
drivers would ease their maintenance: it keeps the design of each IP
independent from the others so it would be more easy to add support to future
features.


Best Regards,

Cyrille


Le 25/06/2015 12:11, Cyrille Pitchen a écrit :
> Hi lee,
> 
> Le 24/06/2015 16:24, Lee Jones a écrit :
>> On Mon, 22 Jun 2015, Cyrille Pitchen wrote:
>>
>>> This driver supports the new Atmel Flexcom. The Flexcom is a wrapper which
>>> integrates one SPI controller, one I2C controller and one USART. Only one
>>> function can be enabled at a time. This driver selects the function once
>>> for all, when the Flexcom is probed, according to the value of the new
>>> "atmel,flexcom-mode" device tree property.
>>>
>>> This driver has chosen to present the Flexcom to the system as a MFD so
>>> the implementation is seamless for the existing Atmel SPI, I2C and USART
>>> drivers.
>>
>> No need for this driver.
>>
>> Just create your 3 platform drivers and get them to read the mode at
>> probe time.  If the mode isn't the one pertaining to itself return
>> -ENODEV and the Device Driver API will attempt the probe the next
>> device.  Ensure all of the devices have the same compatible string
>> i.e. atmel,sama5d2-flexcom.
>>
> 
> The main idea of this patch was to hide the Flexcom overlay from the 3 serial
> drivers. The Flexcom is a kind of muxer which selects one of the 3 IPs: it 
> doesn't change the internal of the IPs. For instance, on sama5d2x SoCs,
> some SPI controlers are still standalone whereas others are wrapped by a
> Flexcom but all these SPI controllers share the same IP version.
> 
> Also, the Flexcom has its own I/O range. Especially, the Flexcom Mode Register
> which selects the active peripheral is outside the I/O ranges of the SPI, I2C
> or USART IPs.
> 
> The active peripheral must be selected first then its driver can access its I/O
> registers but registers of the other inactive peripherals are still unavailable
> and would be read as zero since their peripherals are still disabled.
> That's why the very first version of the driver presented the Flexcom as a
> clock because most peripherals can't be used before enabling their clock.
> However the Flexcom is not an actual clock so I was told that it would be
> better to introduce the Flexcom as an MFD.
> 
> The idea is to separate the serial controller drivers and the Flexcom driver
> the same way as a clock driver and a pin controller driver are separated from
> the driver of a peripheral which uses them.
> 
> 
> Best Regards,
> 
> Cyrille
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: <mark.rutland@arm.com>, <boris.brezillon@free-electrons.com>,
	<sameo@linux.intel.com>, <pawel.moll@arm.com>,
	<ijc+devicetree@hellion.org.uk>, <nicolas.ferre@atmel.com>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<robh+dt@kernel.org>, <alexandre.belloni@free-electrons.com>,
	<galak@codeaurora.org>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 2/2] mfd: flexcom: add a driver for Atmel Flexible Serial Communication Unit
Date: Mon, 20 Jul 2015 18:11:54 +0200	[thread overview]
Message-ID: <55AD1DCA.9080308@atmel.com> (raw)
In-Reply-To: <558BD3B8.10709@atmel.com>

Hi all,

based on my previous mail, do someone have any idea on how to add support to
the Flexcom in the kernel ? We would like to manage the Flexcom separately so
we avoid patching 3 existing drivers.

Indeed, their associated devices have no need to know whether they're wrapped
or not by a Flexcom: the Flexcom itself has no functional impact on the serial
controllers it contains.

Also, hiding the additional layer of the Flexcom from the USART, SPI and I2C
drivers would ease their maintenance: it keeps the design of each IP
independent from the others so it would be more easy to add support to future
features.


Best Regards,

Cyrille


Le 25/06/2015 12:11, Cyrille Pitchen a écrit :
> Hi lee,
> 
> Le 24/06/2015 16:24, Lee Jones a écrit :
>> On Mon, 22 Jun 2015, Cyrille Pitchen wrote:
>>
>>> This driver supports the new Atmel Flexcom. The Flexcom is a wrapper which
>>> integrates one SPI controller, one I2C controller and one USART. Only one
>>> function can be enabled at a time. This driver selects the function once
>>> for all, when the Flexcom is probed, according to the value of the new
>>> "atmel,flexcom-mode" device tree property.
>>>
>>> This driver has chosen to present the Flexcom to the system as a MFD so
>>> the implementation is seamless for the existing Atmel SPI, I2C and USART
>>> drivers.
>>
>> No need for this driver.
>>
>> Just create your 3 platform drivers and get them to read the mode at
>> probe time.  If the mode isn't the one pertaining to itself return
>> -ENODEV and the Device Driver API will attempt the probe the next
>> device.  Ensure all of the devices have the same compatible string
>> i.e. atmel,sama5d2-flexcom.
>>
> 
> The main idea of this patch was to hide the Flexcom overlay from the 3 serial
> drivers. The Flexcom is a kind of muxer which selects one of the 3 IPs: it 
> doesn't change the internal of the IPs. For instance, on sama5d2x SoCs,
> some SPI controlers are still standalone whereas others are wrapped by a
> Flexcom but all these SPI controllers share the same IP version.
> 
> Also, the Flexcom has its own I/O range. Especially, the Flexcom Mode Register
> which selects the active peripheral is outside the I/O ranges of the SPI, I2C
> or USART IPs.
> 
> The active peripheral must be selected first then its driver can access its I/O
> registers but registers of the other inactive peripherals are still unavailable
> and would be read as zero since their peripherals are still disabled.
> That's why the very first version of the driver presented the Flexcom as a
> clock because most peripherals can't be used before enabling their clock.
> However the Flexcom is not an actual clock so I was told that it would be
> better to introduce the Flexcom as an MFD.
> 
> The idea is to separate the serial controller drivers and the Flexcom driver
> the same way as a clock driver and a pin controller driver are separated from
> the driver of a peripheral which uses them.
> 
> 
> Best Regards,
> 
> Cyrille
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


  reply	other threads:[~2015-07-20 16:11 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22 10:12 [PATCH v4 0/2] mfd: flexcom: add a driver for Flexcom Cyrille Pitchen
2015-06-22 10:12 ` Cyrille Pitchen
2015-06-22 10:12 ` Cyrille Pitchen
2015-06-22 10:12 ` [PATCH v4 1/2] mfd: devicetree: add bindings for Atmel Flexcom Cyrille Pitchen
2015-06-22 10:12   ` Cyrille Pitchen
2015-06-22 10:12   ` Cyrille Pitchen
2015-07-21  9:09   ` Lee Jones
2015-07-21  9:09     ` Lee Jones
2015-07-21  9:09     ` Lee Jones
2015-07-21 14:15     ` Cyrille Pitchen
2015-07-21 14:15       ` Cyrille Pitchen
2015-07-21 14:15       ` Cyrille Pitchen
2015-07-21 15:10       ` Lee Jones
2015-07-21 15:10         ` Lee Jones
2015-07-22 10:23         ` Cyrille Pitchen
2015-07-22 10:23           ` Cyrille Pitchen
2015-07-22 10:23           ` Cyrille Pitchen
2015-06-22 10:12 ` [PATCH v4 2/2] mfd: flexcom: add a driver for Atmel Flexible Serial Communication Unit Cyrille Pitchen
2015-06-22 10:12   ` Cyrille Pitchen
2015-06-22 10:12   ` Cyrille Pitchen
2015-06-24 14:24   ` Lee Jones
2015-06-24 14:24     ` Lee Jones
2015-06-24 14:24     ` Lee Jones
2015-06-25 10:11     ` Cyrille Pitchen
2015-06-25 10:11       ` Cyrille Pitchen
2015-06-25 10:11       ` Cyrille Pitchen
2015-07-20 16:11       ` Cyrille Pitchen [this message]
2015-07-20 16:11         ` Cyrille Pitchen
2015-07-20 16:11         ` Cyrille Pitchen
2015-07-21  9:18   ` Lee Jones
2015-07-21  9:18     ` Lee Jones

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=55AD1DCA.9080308@atmel.com \
    --to=cyrille.pitchen@atmel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.