mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] arm: omap: am33xx: set up SPI devices
@ 2013-06-10 19:31 Jan Luebbe
  2013-06-14  9:12 ` Teresa Gamez
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Luebbe @ 2013-06-10 19:31 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 arch/arm/mach-omap/include/mach/am33xx-devices.h | 17 +++++++++++++++++
 arch/arm/mach-omap/include/mach/am33xx-silicon.h |  4 ++++
 drivers/spi/Kconfig                              |  2 +-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap/include/mach/am33xx-devices.h b/arch/arm/mach-omap/include/mach/am33xx-devices.h
index fe9fba9..cea4504 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-devices.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-devices.h
@@ -7,6 +7,7 @@
 #include <mach/devices.h>
 #include <mach/omap_hsmmc.h>
 #include <mach/cpsw.h>
+#include <mach/omap_hsmmc.h>
 
 /* the device numbering is the same as in the TRM memory map (SPRUH73G) */
 
@@ -37,4 +38,20 @@ static inline struct device_d *am33xx_add_cpsw(struct cpsw_platform_data *cpsw_d
 			AM335X_CPSW_BASE, SZ_32K, IORESOURCE_MEM, cpsw_data);
 }
 
+static inline struct device_d *am33xx_add_spi(int id, resource_size_t start)
+{
+	return add_generic_device("omap3_spi", id, NULL, start + 0x100, SZ_4K - 0x100,
+				   IORESOURCE_MEM, NULL);
+}
+
+static inline struct device_d *am33xx_add_spi0(void)
+{
+	return am33xx_add_spi(0, AM33XX_MCSPI0_BASE);
+}
+
+static inline struct device_d *am33xx_add_spi1(void)
+{
+	return am33xx_add_spi(1, AM33XX_MCSPI1_BASE);
+}
+
 #endif /* __MACH_OMAP3_DEVICES_H */
diff --git a/arch/arm/mach-omap/include/mach/am33xx-silicon.h b/arch/arm/mach-omap/include/mach/am33xx-silicon.h
index 9edf4ca..59284af 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-silicon.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-silicon.h
@@ -49,6 +49,10 @@
 #define AM33XX_MMC1_BASE		(AM33XX_L4_PER_BASE + 0x1D8000)
 #define AM33XX_MMCHS2_BASE		0x47810000
 
+/* SPI */
+#define AM33XX_MCSPI0_BASE		(AM33XX_L4_PER_BASE + 0x30000)
+#define AM33XX_MCSPI1_BASE		(AM33XX_L4_PER_BASE + 0x1A0000)
+
 /* DTMTimer0 */
 #define AM33XX_DMTIMER0_BASE		(AM33XX_L4_WKUP_BASE + 0x205000)
 
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index f14e28f..c279c21 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -40,7 +40,7 @@ config DRIVER_SPI_MXS
 
 config DRIVER_SPI_OMAP3
 	bool "OMAP3 McSPI Master driver"
-	depends on ARCH_OMAP3
+	depends on ARCH_OMAP3 || ARCH_AM33XX
 
 endif
 
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: omap: am33xx: set up SPI devices
  2013-06-10 19:31 [PATCH] arm: omap: am33xx: set up SPI devices Jan Luebbe
@ 2013-06-14  9:12 ` Teresa Gamez
  2013-06-17  7:12   ` Jan Lübbe
  0 siblings, 1 reply; 4+ messages in thread
From: Teresa Gamez @ 2013-06-14  9:12 UTC (permalink / raw)
  To: Jan Luebbe; +Cc: barebox

Hello Jan,

Am 10.06.2013 21:31, schrieb Jan Luebbe:
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> ---
>   arch/arm/mach-omap/include/mach/am33xx-devices.h | 17 +++++++++++++++++
>   arch/arm/mach-omap/include/mach/am33xx-silicon.h |  4 ++++
>   drivers/spi/Kconfig                              |  2 +-
>   3 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap/include/mach/am33xx-devices.h b/arch/arm/mach-omap/include/mach/am33xx-devices.h
> index fe9fba9..cea4504 100644
> --- a/arch/arm/mach-omap/include/mach/am33xx-devices.h
> +++ b/arch/arm/mach-omap/include/mach/am33xx-devices.h
> @@ -7,6 +7,7 @@
>   #include <mach/devices.h>
>   #include <mach/omap_hsmmc.h>
>   #include <mach/cpsw.h>
> +#include <mach/omap_hsmmc.h>

this header has been already included just two lines before.

Regards,
Teresa


>   
>   /* the device numbering is the same as in the TRM memory map (SPRUH73G) */
>   
> @@ -37,4 +38,20 @@ static inline struct device_d *am33xx_add_cpsw(struct cpsw_platform_data *cpsw_d
>   			AM335X_CPSW_BASE, SZ_32K, IORESOURCE_MEM, cpsw_data);
>   }
>   
> +static inline struct device_d *am33xx_add_spi(int id, resource_size_t start)
> +{
> +	return add_generic_device("omap3_spi", id, NULL, start + 0x100, SZ_4K - 0x100,
> +				   IORESOURCE_MEM, NULL);
> +}
> +
> +static inline struct device_d *am33xx_add_spi0(void)
> +{
> +	return am33xx_add_spi(0, AM33XX_MCSPI0_BASE);
> +}
> +
> +static inline struct device_d *am33xx_add_spi1(void)
> +{
> +	return am33xx_add_spi(1, AM33XX_MCSPI1_BASE);
> +}
> +
>   #endif /* __MACH_OMAP3_DEVICES_H */
> diff --git a/arch/arm/mach-omap/include/mach/am33xx-silicon.h b/arch/arm/mach-omap/include/mach/am33xx-silicon.h
> index 9edf4ca..59284af 100644
> --- a/arch/arm/mach-omap/include/mach/am33xx-silicon.h
> +++ b/arch/arm/mach-omap/include/mach/am33xx-silicon.h
> @@ -49,6 +49,10 @@
>   #define AM33XX_MMC1_BASE		(AM33XX_L4_PER_BASE + 0x1D8000)
>   #define AM33XX_MMCHS2_BASE		0x47810000
>   
> +/* SPI */
> +#define AM33XX_MCSPI0_BASE		(AM33XX_L4_PER_BASE + 0x30000)
> +#define AM33XX_MCSPI1_BASE		(AM33XX_L4_PER_BASE + 0x1A0000)
> +
>   /* DTMTimer0 */
>   #define AM33XX_DMTIMER0_BASE		(AM33XX_L4_WKUP_BASE + 0x205000)
>   
> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> index f14e28f..c279c21 100644
> --- a/drivers/spi/Kconfig
> +++ b/drivers/spi/Kconfig
> @@ -40,7 +40,7 @@ config DRIVER_SPI_MXS
>   
>   config DRIVER_SPI_OMAP3
>   	bool "OMAP3 McSPI Master driver"
> -	depends on ARCH_OMAP3
> +	depends on ARCH_OMAP3 || ARCH_AM33XX
>   
>   endif
>   


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: omap: am33xx: set up SPI devices
  2013-06-14  9:12 ` Teresa Gamez
@ 2013-06-17  7:12   ` Jan Lübbe
  2013-06-17  7:50     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Lübbe @ 2013-06-17  7:12 UTC (permalink / raw)
  To: Teresa Gamez; +Cc: barebox

On Fri, 2013-06-14 at 11:12 +0200, Teresa Gamez wrote:
> Am 10.06.2013 21:31, schrieb Jan Luebbe:
> > Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> > ---
> >   arch/arm/mach-omap/include/mach/am33xx-devices.h | 17 +++++++++++++++++
> >   arch/arm/mach-omap/include/mach/am33xx-silicon.h |  4 ++++
> >   drivers/spi/Kconfig                              |  2 +-
> >   3 files changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/mach-omap/include/mach/am33xx-devices.h b/arch/arm/mach-omap/include/mach/am33xx-devices.h
> > index fe9fba9..cea4504 100644
> > --- a/arch/arm/mach-omap/include/mach/am33xx-devices.h
> > +++ b/arch/arm/mach-omap/include/mach/am33xx-devices.h
> > @@ -7,6 +7,7 @@
> >   #include <mach/devices.h>
> >   #include <mach/omap_hsmmc.h>
> >   #include <mach/cpsw.h>
> > +#include <mach/omap_hsmmc.h>
> 
> this header has been already included just two lines before.

Oh, this must have slipped in while rebasing. Sascha, could you drop
this if the rest is acceptable?

Regards,
Jan
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: omap: am33xx: set up SPI devices
  2013-06-17  7:12   ` Jan Lübbe
@ 2013-06-17  7:50     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2013-06-17  7:50 UTC (permalink / raw)
  To: Jan Lübbe; +Cc: barebox

On Mon, Jun 17, 2013 at 09:12:25AM +0200, Jan Lübbe wrote:
> On Fri, 2013-06-14 at 11:12 +0200, Teresa Gamez wrote:
> > Am 10.06.2013 21:31, schrieb Jan Luebbe:
> > > Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> > > ---
> > >   arch/arm/mach-omap/include/mach/am33xx-devices.h | 17 +++++++++++++++++
> > >   arch/arm/mach-omap/include/mach/am33xx-silicon.h |  4 ++++
> > >   drivers/spi/Kconfig                              |  2 +-
> > >   3 files changed, 22 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm/mach-omap/include/mach/am33xx-devices.h b/arch/arm/mach-omap/include/mach/am33xx-devices.h
> > > index fe9fba9..cea4504 100644
> > > --- a/arch/arm/mach-omap/include/mach/am33xx-devices.h
> > > +++ b/arch/arm/mach-omap/include/mach/am33xx-devices.h
> > > @@ -7,6 +7,7 @@
> > >   #include <mach/devices.h>
> > >   #include <mach/omap_hsmmc.h>
> > >   #include <mach/cpsw.h>
> > > +#include <mach/omap_hsmmc.h>
> > 
> > this header has been already included just two lines before.
> 
> Oh, this must have slipped in while rebasing. Sascha, could you drop
> this if the rest is acceptable?

Applied and dropped the duplicate include.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-17  7:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 19:31 [PATCH] arm: omap: am33xx: set up SPI devices Jan Luebbe
2013-06-14  9:12 ` Teresa Gamez
2013-06-17  7:12   ` Jan Lübbe
2013-06-17  7:50     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox