[PATCH 1/2] spi: bcm2835: add spi-bcm2835aux driver for the auxiliar spi1 and spi2

Noralf Trønnes noralf at tronnes.org
Wed Jul 1 13:57:44 PDT 2015

Den 01.07.2015 21:39, skrev Martin Sperl:
>> On 30.06.2015, at 19:42, Mark Brown <broonie at kernel.org> wrote:
>> This looks relevant:
>>>>> On 22.06.2015, at 16:55, Jakub Kiciński <moorray3 at wp.pl> wrote:
>>>>> As mentioned by Noralf UART1 is quite commonly used on Compute Modules.
>>>>> Proper driver - perhaps modelled as a bus - seems like a prerequisite
>>>>> for this work.  You are also not using IRQ mux in DT binding example
>>>>> which is very misleading.


> Finally asking for a recommendation with regards to using a bus
> to arbitrate access to the enable register there was no feedback
> how this could be get implemented...

Maybe you can use drivers/mfd/syscon.c to enable shared access to the
aux enable register. Then the spi driver could get the regmap with:
aux_regmap = syscon_regmap_lookup_by_phandle(np, "syscon");

aux_syscon: aux_syscon at 7e215000 {
   compatible = "syscon";
   reg = <0x7e215000 0x08>;

spi2 at 7e2150c0 {
   compatible = "brcm,bcm2835-aux-spi";
   reg = <0x7e2150c0 0x40>;
   syscon = <&aux_syscon>;

So if someone later will add a Pi extension to the 8250 serial driver or
enable the mini uart by some other means, they can use the syscon regmap.

About sharing the aux interrupt, could this be implemented in irq-bcm2835
as a Bank 3?

spi1 at 7e215080 {
  compatible = "brcm,bcm2835-aux-spi";
  reg = <0x7e215080 0x40>, <0x7e215000 0x08>;
  interrupts = <3 1>;

spi2 at 7e2150c0 {
  compatible = "brcm,bcm2835-aux-spi";
  reg = <0x7e2150c0 0x40>, <0x7e215000 0x08>;
  interrupts = <3 2>;

These are just a suggestions, I don't know if it is "the correct" way to 
do it.

More information about the linux-rpi-kernel mailing list