mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] arm: am33xx: add pinmux and clock config for UART2
@ 2013-05-23  9:45 Jan Luebbe
  2013-05-23  9:45 ` [PATCH 2/2] arm: am33xx: add pinmux config for RMII2 Jan Luebbe
  2013-05-23 13:38 ` [PATCH 1/2] arm: am33xx: add pinmux and clock config for UART2 Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Luebbe @ 2013-05-23  9:45 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 arch/arm/mach-omap/am33xx_clock.c              |    8 ++++++++
 arch/arm/mach-omap/am33xx_mux.c                |   11 +++++++++++
 arch/arm/mach-omap/include/mach/am33xx-clock.h |    3 +++
 arch/arm/mach-omap/include/mach/am33xx-mux.h   |    1 +
 4 files changed, 23 insertions(+)

diff --git a/arch/arm/mach-omap/am33xx_clock.c b/arch/arm/mach-omap/am33xx_clock.c
index a28540c..4451d62 100644
--- a/arch/arm/mach-omap/am33xx_clock.c
+++ b/arch/arm/mach-omap/am33xx_clock.c
@@ -89,6 +89,14 @@ static void per_clocks_enable(void)
 	__raw_writel(PRCM_MOD_EN, CM_WKUP_UART0_CLKCTRL);
 	while (__raw_readl(CM_WKUP_UART0_CLKCTRL) != PRCM_MOD_EN);
 
+	/* UART1 */
+	__raw_writel(PRCM_MOD_EN, CM_PER_UART1_CLKCTRL);
+	while (__raw_readl(CM_PER_UART1_CLKCTRL) != PRCM_MOD_EN);
+
+	/* UART2 */
+	__raw_writel(PRCM_MOD_EN, CM_PER_UART2_CLKCTRL);
+	while (__raw_readl(CM_PER_UART2_CLKCTRL) != PRCM_MOD_EN);
+
 	/* UART3 */
 	__raw_writel(PRCM_MOD_EN, CM_PER_UART3_CLKCTRL);
 	while (__raw_readl(CM_PER_UART3_CLKCTRL) != PRCM_MOD_EN);
diff --git a/arch/arm/mach-omap/am33xx_mux.c b/arch/arm/mach-omap/am33xx_mux.c
index 36fe379..61014d9 100644
--- a/arch/arm/mach-omap/am33xx_mux.c
+++ b/arch/arm/mach-omap/am33xx_mux.c
@@ -27,6 +27,12 @@ static const __maybe_unused struct module_pin_mux uart0_pin_mux[] = {
 	{-1},
 };
 
+static const __maybe_unused struct module_pin_mux uart2_pin_mux[] = {
+	{OFFSET(mii1_txclk), (MODE(1) | PULLUDEN | RXACTIVE)},	/* UART2_RXD */
+	{OFFSET(mii1_rxclk), (MODE(1) | PULLUDEN)},		/* UART2_TXD */
+	{-1},
+};
+
 static const __maybe_unused struct module_pin_mux uart3_pin_mux[] = {
 	{OFFSET(spi0_cs1), (MODE(1) | PULLUDEN | RXACTIVE)},	/* UART3_RXD */
 	{OFFSET(ecap0_in_pwm0_out), (MODE(1) | PULLUDEN)},	/* UART3_TXD */
@@ -275,6 +281,11 @@ void am33xx_enable_uart0_pin_mux(void)
 	configure_module_pin_mux(uart0_pin_mux);
 }
 
+void am33xx_enable_uart2_pin_mux(void)
+{
+	configure_module_pin_mux(uart2_pin_mux);
+}
+
 void am33xx_enable_mmc0_pin_mux(void)
 {
 	configure_module_pin_mux(mmc0_pin_mux);
diff --git a/arch/arm/mach-omap/include/mach/am33xx-clock.h b/arch/arm/mach-omap/include/mach/am33xx-clock.h
index 2ecfc5f..3d1f074 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-clock.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-clock.h
@@ -136,7 +136,10 @@
 #define CM_PER_GPIO1_CLKCTRL            (CM_PER + 0xAC) /* GPIO1 */
 #define CM_PER_GPIO2_CLKCTRL            (CM_PER + 0xB0) /* GPIO2 */
 #define CM_PER_GPIO3_CLKCTRL            (CM_PER + 0xB4) /* GPIO3 */
+#define CM_PER_UART1_CLKCTRL            (CM_PER + 0x6C) /* UART1 */
+#define CM_PER_UART2_CLKCTRL            (CM_PER + 0x70) /* UART2 */
 #define CM_PER_UART3_CLKCTRL            (CM_PER + 0x74) /* UART3 */
+#define CM_PER_UART4_CLKCTRL            (CM_PER + 0x78) /* UART4 */
 #define CM_PER_I2C1_CLKCTRL             (CM_PER + 0x48) /* I2C1 */
 #define CM_PER_I2C2_CLKCTRL             (CM_PER + 0x44) /* I2C2 */
 #define CM_WKUP_GPIO0_CLKCTRL           (CM_WKUP + 0x8) /* GPIO0 */
diff --git a/arch/arm/mach-omap/include/mach/am33xx-mux.h b/arch/arm/mach-omap/include/mach/am33xx-mux.h
index 896e958..e0f7077 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-mux.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-mux.h
@@ -252,6 +252,7 @@ extern void am33xx_enable_i2c0_pin_mux(void);
 extern void am33xx_enable_i2c1_pin_mux(void);
 extern void am33xx_enable_i2c2_pin_mux(void);
 extern void am33xx_enable_uart0_pin_mux(void);
+extern void am33xx_enable_uart2_pin_mux(void);
 extern void am33xx_enable_mmc0_pin_mux(void);
 
 #endif /*__AM33XX_MUX_H__ */
-- 
1.7.10.4


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

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

* [PATCH 2/2] arm: am33xx: add pinmux config for RMII2
  2013-05-23  9:45 [PATCH 1/2] arm: am33xx: add pinmux and clock config for UART2 Jan Luebbe
@ 2013-05-23  9:45 ` Jan Luebbe
  2013-05-23 13:38 ` [PATCH 1/2] arm: am33xx: add pinmux and clock config for UART2 Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Luebbe @ 2013-05-23  9:45 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 arch/arm/mach-omap/am33xx_mux.c              |   24 ++++++++++++++++++++++++
 arch/arm/mach-omap/include/mach/am33xx-mux.h |    2 ++
 2 files changed, 26 insertions(+)

diff --git a/arch/arm/mach-omap/am33xx_mux.c b/arch/arm/mach-omap/am33xx_mux.c
index 61014d9..424d120 100644
--- a/arch/arm/mach-omap/am33xx_mux.c
+++ b/arch/arm/mach-omap/am33xx_mux.c
@@ -148,6 +148,20 @@ static const __maybe_unused struct module_pin_mux rmii1_pin_mux[] = {
 	{-1},
 };
 
+static const __maybe_unused struct module_pin_mux rmii2_pin_mux[] = {
+	{OFFSET(gpmc_a0), MODE(3)},           /* RMII2_TXEN */
+	{OFFSET(gpmc_a4), MODE(3)},           /* RMII2_TXD1 */
+	{OFFSET(gpmc_a5), MODE(3)},           /* RMII2_TXD0 */
+	{OFFSET(gpmc_a10), MODE(3) | RXACTIVE},    /* RMII2_RXD1 */
+	{OFFSET(gpmc_a11), MODE(3) | RXACTIVE},    /* RMII2_RXD0 */
+	{OFFSET(gpmc_wait0), MODE(3) | RXACTIVE},     /* RMII2_CRS */
+	{OFFSET(gpmc_wpn), MODE(3) | RXACTIVE},   /* RMII2_RXERR */
+	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN}, /* MDIO_DATA */
+	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},    /* MDIO_CLK */
+	{OFFSET(mii1_col), MODE(1) | RXACTIVE}, /* RMII2_REFCLK */
+	{-1},
+};
+
 #ifdef CONFIG_NOR
 static const __maybe_unused struct module_pin_mux nor_pin_mux[] = {
 	{OFFSET(lcd_data0), MODE(1) | PULLUDEN},	/* NOR_A0 */
@@ -261,6 +275,16 @@ void am33xx_enable_mii1_pin_mux(void)
 	configure_module_pin_mux(mii1_pin_mux);
 }
 
+void am33xx_enable_rmii1_pin_mux(void)
+{
+	configure_module_pin_mux(rmii1_pin_mux);
+}
+
+void am33xx_enable_rmii2_pin_mux(void)
+{
+	configure_module_pin_mux(rmii2_pin_mux);
+}
+
 void am33xx_enable_i2c0_pin_mux(void)
 {
 	configure_module_pin_mux(i2c0_pin_mux);
diff --git a/arch/arm/mach-omap/include/mach/am33xx-mux.h b/arch/arm/mach-omap/include/mach/am33xx-mux.h
index e0f7077..44b93bd 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-mux.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-mux.h
@@ -248,6 +248,8 @@ extern void configure_module_pin_mux(const struct module_pin_mux *mod_pin_mux);
 
 /* Standard mux settings */
 extern void am33xx_enable_mii1_pin_mux(void);
+extern void am33xx_enable_rmii1_pin_mux(void);
+extern void am33xx_enable_rmii2_pin_mux(void);
 extern void am33xx_enable_i2c0_pin_mux(void);
 extern void am33xx_enable_i2c1_pin_mux(void);
 extern void am33xx_enable_i2c2_pin_mux(void);
-- 
1.7.10.4


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

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

* Re: [PATCH 1/2] arm: am33xx: add pinmux and clock config for UART2
  2013-05-23  9:45 [PATCH 1/2] arm: am33xx: add pinmux and clock config for UART2 Jan Luebbe
  2013-05-23  9:45 ` [PATCH 2/2] arm: am33xx: add pinmux config for RMII2 Jan Luebbe
@ 2013-05-23 13:38 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2013-05-23 13:38 UTC (permalink / raw)
  To: Jan Luebbe; +Cc: barebox

On Thu, May 23, 2013 at 11:45:57AM +0200, Jan Luebbe wrote:
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>

Applied, thanks

Sascha

> ---
>  arch/arm/mach-omap/am33xx_clock.c              |    8 ++++++++
>  arch/arm/mach-omap/am33xx_mux.c                |   11 +++++++++++
>  arch/arm/mach-omap/include/mach/am33xx-clock.h |    3 +++
>  arch/arm/mach-omap/include/mach/am33xx-mux.h   |    1 +
>  4 files changed, 23 insertions(+)
> 
> diff --git a/arch/arm/mach-omap/am33xx_clock.c b/arch/arm/mach-omap/am33xx_clock.c
> index a28540c..4451d62 100644
> --- a/arch/arm/mach-omap/am33xx_clock.c
> +++ b/arch/arm/mach-omap/am33xx_clock.c
> @@ -89,6 +89,14 @@ static void per_clocks_enable(void)
>  	__raw_writel(PRCM_MOD_EN, CM_WKUP_UART0_CLKCTRL);
>  	while (__raw_readl(CM_WKUP_UART0_CLKCTRL) != PRCM_MOD_EN);
>  
> +	/* UART1 */
> +	__raw_writel(PRCM_MOD_EN, CM_PER_UART1_CLKCTRL);
> +	while (__raw_readl(CM_PER_UART1_CLKCTRL) != PRCM_MOD_EN);
> +
> +	/* UART2 */
> +	__raw_writel(PRCM_MOD_EN, CM_PER_UART2_CLKCTRL);
> +	while (__raw_readl(CM_PER_UART2_CLKCTRL) != PRCM_MOD_EN);
> +
>  	/* UART3 */
>  	__raw_writel(PRCM_MOD_EN, CM_PER_UART3_CLKCTRL);
>  	while (__raw_readl(CM_PER_UART3_CLKCTRL) != PRCM_MOD_EN);
> diff --git a/arch/arm/mach-omap/am33xx_mux.c b/arch/arm/mach-omap/am33xx_mux.c
> index 36fe379..61014d9 100644
> --- a/arch/arm/mach-omap/am33xx_mux.c
> +++ b/arch/arm/mach-omap/am33xx_mux.c
> @@ -27,6 +27,12 @@ static const __maybe_unused struct module_pin_mux uart0_pin_mux[] = {
>  	{-1},
>  };
>  
> +static const __maybe_unused struct module_pin_mux uart2_pin_mux[] = {
> +	{OFFSET(mii1_txclk), (MODE(1) | PULLUDEN | RXACTIVE)},	/* UART2_RXD */
> +	{OFFSET(mii1_rxclk), (MODE(1) | PULLUDEN)},		/* UART2_TXD */
> +	{-1},
> +};
> +
>  static const __maybe_unused struct module_pin_mux uart3_pin_mux[] = {
>  	{OFFSET(spi0_cs1), (MODE(1) | PULLUDEN | RXACTIVE)},	/* UART3_RXD */
>  	{OFFSET(ecap0_in_pwm0_out), (MODE(1) | PULLUDEN)},	/* UART3_TXD */
> @@ -275,6 +281,11 @@ void am33xx_enable_uart0_pin_mux(void)
>  	configure_module_pin_mux(uart0_pin_mux);
>  }
>  
> +void am33xx_enable_uart2_pin_mux(void)
> +{
> +	configure_module_pin_mux(uart2_pin_mux);
> +}
> +
>  void am33xx_enable_mmc0_pin_mux(void)
>  {
>  	configure_module_pin_mux(mmc0_pin_mux);
> diff --git a/arch/arm/mach-omap/include/mach/am33xx-clock.h b/arch/arm/mach-omap/include/mach/am33xx-clock.h
> index 2ecfc5f..3d1f074 100644
> --- a/arch/arm/mach-omap/include/mach/am33xx-clock.h
> +++ b/arch/arm/mach-omap/include/mach/am33xx-clock.h
> @@ -136,7 +136,10 @@
>  #define CM_PER_GPIO1_CLKCTRL            (CM_PER + 0xAC) /* GPIO1 */
>  #define CM_PER_GPIO2_CLKCTRL            (CM_PER + 0xB0) /* GPIO2 */
>  #define CM_PER_GPIO3_CLKCTRL            (CM_PER + 0xB4) /* GPIO3 */
> +#define CM_PER_UART1_CLKCTRL            (CM_PER + 0x6C) /* UART1 */
> +#define CM_PER_UART2_CLKCTRL            (CM_PER + 0x70) /* UART2 */
>  #define CM_PER_UART3_CLKCTRL            (CM_PER + 0x74) /* UART3 */
> +#define CM_PER_UART4_CLKCTRL            (CM_PER + 0x78) /* UART4 */
>  #define CM_PER_I2C1_CLKCTRL             (CM_PER + 0x48) /* I2C1 */
>  #define CM_PER_I2C2_CLKCTRL             (CM_PER + 0x44) /* I2C2 */
>  #define CM_WKUP_GPIO0_CLKCTRL           (CM_WKUP + 0x8) /* GPIO0 */
> diff --git a/arch/arm/mach-omap/include/mach/am33xx-mux.h b/arch/arm/mach-omap/include/mach/am33xx-mux.h
> index 896e958..e0f7077 100644
> --- a/arch/arm/mach-omap/include/mach/am33xx-mux.h
> +++ b/arch/arm/mach-omap/include/mach/am33xx-mux.h
> @@ -252,6 +252,7 @@ extern void am33xx_enable_i2c0_pin_mux(void);
>  extern void am33xx_enable_i2c1_pin_mux(void);
>  extern void am33xx_enable_i2c2_pin_mux(void);
>  extern void am33xx_enable_uart0_pin_mux(void);
> +extern void am33xx_enable_uart2_pin_mux(void);
>  extern void am33xx_enable_mmc0_pin_mux(void);
>  
>  #endif /*__AM33XX_MUX_H__ */
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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] 3+ messages in thread

end of thread, other threads:[~2013-05-23 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-23  9:45 [PATCH 1/2] arm: am33xx: add pinmux and clock config for UART2 Jan Luebbe
2013-05-23  9:45 ` [PATCH 2/2] arm: am33xx: add pinmux config for RMII2 Jan Luebbe
2013-05-23 13:38 ` [PATCH 1/2] arm: am33xx: add pinmux and clock config for UART2 Sascha Hauer

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