Thanks guys.....although I'm clueless as to how someone would even begin 
trying to make the driver work with mainline/DTS

The linux-sunxi kernel has multiple "arch/platform files":
mach-sun4i
mach-sun5i
mach-sun7i
plat-sunxi


However only mach-sun7i has the "includes.h":
$ 
$ find . -name "*includes*"
./mach-sun7i/include/mach/includes.h
$ 


arch/arm/mach-sun7i/include/mach/includes.h:
#include "hardware.h"
#include "memory.h"
#include "platform.h"
#include "gpio.h"
#include "i2c.h"
#include "io.h"


arch/arm/mach-sun7i/include/mach/memory.h:
#include <plat/memory.h>


arch/arm/plat-sunxi/include/plat/platform.h:

/* Physical Address */
#define SW_PA_BROM_START                  0xffff0000
#define SW_PA_BROM_END                    0xffff7fff   /* 32KB */

#define SW_PA_SRAM_BASE                   0x00000000

/* sun7i sram addresses */
#define SW_PA_SRAM_A1_BASE                0x00000000
#define SW_PA_SRAM_A2_BASE                0x00004000
#define SW_PA_SRAM_A3_BASE                0x00008000
#define SW_PA_SRAM_A4_BASE                0x0000b400



So I'm guessing it's those sort of addresses that should now come from DTS 
variables? ...are their specific "structures" that pass "DTS variables" to 
a driver?

The most excellent:
http://free-electrons.com/pub/conferences/2013/elce/petazzoni-device-tree-dummies/petazzoni-device-tree-dummies.pdf

Mentions the following on page 15:

described by the clocks property
I s->clk = clk_get(&pdev->dev, NULL);

described by the interrupts property
I s->irq = platform_get_irq(pdev, 0);


Where are these functions defined? Assuming there are some magic includes 
that all DTS enabled drivers must use?
clk_get
platform_get_irq

Are there other functions to get spi or i2c addresses?

Sorry for the somewhat aimless reply ... I'm determined to understand this 
stuff but struggle with the instant head ache :)


Bruce








On Wednesday, 8 October 2014 13:00:07 UTC+1, Maxime Ripard wrote:
>
> Hi, 
>
> On Wed, Oct 08, 2014 at 11:14:00AM +0100, bruce bushby wrote: 
> > Hi 
> > 
> > I wanted to ask about the status of "arch/arm/mach-sunxxx" in 
> > reference to the mainline kernel. I see linux-sunxi (3.4) has the 
> > following AllWinner specific directories: 
> > 
> > mach-sun4isunxi: 
> > mach-sun5isunxi: 
> > mach-sun7isun7i: 
> > 
> > 
> > However the current mainline kernel (3.17) only has: 
> > mach-sunxi 
> > 
> > Which only contains: 
> > platsmp.c 
> > sunxi.c 
>
> Yep, because we don't need anything more at the moment. 
>
> > Should I be trying to patch my 3.17 kernel to include 
> > mach-sun7isun7i? 
> > 
> > I found this CAN driver: 
> > https://github.com/plaes/sunxi-can-driver 
> > 
> > However it includes: 
> > #include <mach/includes.h> 
> > 
> > Which doesn't exist in the mainline kernel. The file 
> > "mach/includes.h" appears to include most of "mach-sun7isun7i" 
>
> Yeah, this doesn't apply on mainline anymore, mostly because that 
> wouldn't work well with multi-platform support. When you have several 
> SoC-support enabled, which mach/includes.h would you choose? 
>
> I don't really know what's in this include file, but I guess it will 
> be either: 
>   - registers definitions, that should be moved in the driver itself 
>   - or "global" definitions, such as the interrupt number, or the base 
>     address, which should come from the DT 
>
> Maxime 
>
> -- 
> Maxime Ripard, Free Electrons 
> Embedded Linux, Kernel and Android engineering 
> http://free-electrons.com 
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to