All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] board/BuR/common: move I2C initialization from common part to board-specific
@ 2015-03-19  9:43 Hannes Petermaier
  2015-03-19  9:43 ` [U-Boot] [PATCH 2/2] board/BuR/common: remove unused function 'blink' Hannes Petermaier
  2015-03-28 18:09 ` [U-Boot] [U-Boot, 1/2] board/BuR/common: move I2C initialization from common part to board-specific Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Hannes Petermaier @ 2015-03-19  9:43 UTC (permalink / raw)
  To: u-boot

From: Hannes Petermaier <hannes.petermaier@br-automation.com>

At this time I2C and responsible pin-mux is setup during PMIC initialziation
within common.c, this is possible because today PMIC is always connected on
I2C0.

In Future this will be changed, PMIC isn't anymore connected to bus0 in call
cases.

So we do following:
- rename enable_i2c_pin_mux0 to enable_i2c_pin_mux to be generic for enabling
  pin-mux on different or more busses.
- move the call to i2c_pin_mux and i2c_init from common.c to the specific
  board.c

Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com>
Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---

 board/BuR/common/bur_common.h |    2 +-
 board/BuR/common/common.c     |    4 ----
 board/BuR/kwb/board.c         |    3 ++-
 board/BuR/kwb/mux.c           |    2 +-
 board/BuR/tseries/board.c     |    4 ++++
 board/BuR/tseries/mux.c       |    2 +-
 6 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/bur_common.h
index 39afbba..3061e4c 100644
--- a/board/BuR/common/bur_common.h
+++ b/board/BuR/common/bur_common.h
@@ -19,7 +19,7 @@ void br_summaryscreen(void);
 void blink(u32 blinks, u32 intervall, u32 pin);
 void pmicsetup(u32 mpupll);
 void enable_uart0_pin_mux(void);
-void enable_i2c0_pin_mux(void);
+void enable_i2c_pin_mux(void);
 void enable_board_pin_mux(void);
 int board_eth_init(bd_t *bis);
 
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 5ff8a7e..91834eb 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -461,10 +461,6 @@ void pmicsetup(u32 mpupll)
 	int mpu_vdd;
 	int usb_cur_lim;
 
-	/* setup I2C */
-	enable_i2c0_pin_mux();
-	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-
 	if (i2c_probe(TPS65217_CHIP_PM)) {
 		puts("PMIC (0x24) not found! skip further initalization.\n");
 		return;
diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 892311e..6eed7e0 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -124,7 +124,8 @@ void am33xx_spl_board_init(void)
 	gpio_direction_output(LCD_PWR, 0);
 
 	/* setup I2C */
-	enable_i2c0_pin_mux();
+	enable_i2c_pin_mux();
+	i2c_set_bus_num(0);
 	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 
 	/* power-ON  3V3 via Resetcontroller */
diff --git a/board/BuR/kwb/mux.c b/board/BuR/kwb/mux.c
index 9f89b5e..2b1d8d3 100644
--- a/board/BuR/kwb/mux.c
+++ b/board/BuR/kwb/mux.c
@@ -180,7 +180,7 @@ void enable_uart0_pin_mux(void)
 	configure_module_pin_mux(uart0_pin_mux);
 }
 
-void enable_i2c0_pin_mux(void)
+void enable_i2c_pin_mux(void)
 {
 	configure_module_pin_mux(i2c0_pin_mux);
 }
diff --git a/board/BuR/tseries/board.c b/board/BuR/tseries/board.c
index 9402aa4..89e989f 100644
--- a/board/BuR/tseries/board.c
+++ b/board/BuR/tseries/board.c
@@ -123,6 +123,10 @@ void am33xx_spl_board_init(void)
 	/* setup LCD-Pixel Clock */
 	writel(0x2, &cmdpll->clklcdcpixelclk);	/* clock comes from perPLL M2 */
 
+	/* setup I2C */
+	enable_i2c_pin_mux();
+	i2c_set_bus_num(0);
+	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 	pmicsetup(0);
 }
 
diff --git a/board/BuR/tseries/mux.c b/board/BuR/tseries/mux.c
index 2c87a63..ac7e885 100644
--- a/board/BuR/tseries/mux.c
+++ b/board/BuR/tseries/mux.c
@@ -226,7 +226,7 @@ void enable_uart0_pin_mux(void)
 	configure_module_pin_mux(uart0_pin_mux);
 }
 
-void enable_i2c0_pin_mux(void)
+void enable_i2c_pin_mux(void)
 {
 	configure_module_pin_mux(i2c0_pin_mux);
 }
-- 
1.7.9.5

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

* [U-Boot] [PATCH 2/2] board/BuR/common: remove unused function 'blink'
  2015-03-19  9:43 [U-Boot] [PATCH 1/2] board/BuR/common: move I2C initialization from common part to board-specific Hannes Petermaier
@ 2015-03-19  9:43 ` Hannes Petermaier
  2015-03-28 18:09   ` [U-Boot] [U-Boot, " Tom Rini
  2015-03-28 18:09 ` [U-Boot] [U-Boot, 1/2] board/BuR/common: move I2C initialization from common part to board-specific Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Hannes Petermaier @ 2015-03-19  9:43 UTC (permalink / raw)
  To: u-boot

From: Hannes Petermaier <hannes.petermaier@br-automation.com>

since we have possibility to write out on lcd whats going on, we don't need
the gpio blink functionality anymore.

Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com>

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---

 board/BuR/common/bur_common.h |    1 -
 board/BuR/common/common.c     |   14 --------------
 2 files changed, 15 deletions(-)

diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/bur_common.h
index 3061e4c..e4896fb 100644
--- a/board/BuR/common/bur_common.h
+++ b/board/BuR/common/bur_common.h
@@ -16,7 +16,6 @@
 
 int load_lcdtiming(struct am335x_lcdpanel *panel);
 void br_summaryscreen(void);
-void blink(u32 blinks, u32 intervall, u32 pin);
 void pmicsetup(u32 mpupll);
 void enable_uart0_pin_mux(void);
 void enable_i2c_pin_mux(void);
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 91834eb..ccaa9c6 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -441,20 +441,6 @@ void lcd_enable(void)
 #error "LCD-support with a suitable FB-Driver is mandatory !"
 #endif /* CONFIG_LCD */
 
-void blink(u32 blinks, u32 intervall, u32 pin)
-{
-	gpio_direction_output(pin, 0);
-	int val = 0;
-
-	do {
-		val ^= 0x01;
-		gpio_set_value(pin, val);
-		mdelay(intervall);
-	} while (blinks--);
-
-	gpio_set_value(pin, 0);
-}
-
 #ifdef CONFIG_SPL_BUILD
 void pmicsetup(u32 mpupll)
 {
-- 
1.7.9.5

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

* [U-Boot] [U-Boot, 1/2] board/BuR/common: move I2C initialization from common part to board-specific
  2015-03-19  9:43 [U-Boot] [PATCH 1/2] board/BuR/common: move I2C initialization from common part to board-specific Hannes Petermaier
  2015-03-19  9:43 ` [U-Boot] [PATCH 2/2] board/BuR/common: remove unused function 'blink' Hannes Petermaier
@ 2015-03-28 18:09 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2015-03-28 18:09 UTC (permalink / raw)
  To: u-boot

On Thu, Mar 19, 2015 at 10:43:15AM +0100, Hannes Petermaier wrote:

> From: Hannes Petermaier <hannes.petermaier@br-automation.com>
> 
> At this time I2C and responsible pin-mux is setup during PMIC initialziation
> within common.c, this is possible because today PMIC is always connected on
> I2C0.
> 
> In Future this will be changed, PMIC isn't anymore connected to bus0 in call
> cases.
> 
> So we do following:
> - rename enable_i2c_pin_mux0 to enable_i2c_pin_mux to be generic for enabling
>   pin-mux on different or more busses.
> - move the call to i2c_pin_mux and i2c_init from common.c to the specific
>   board.c
> 
> Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com>
> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/0c9abf1a/attachment.sig>

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

* [U-Boot] [U-Boot, 2/2] board/BuR/common: remove unused function 'blink'
  2015-03-19  9:43 ` [U-Boot] [PATCH 2/2] board/BuR/common: remove unused function 'blink' Hannes Petermaier
@ 2015-03-28 18:09   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2015-03-28 18:09 UTC (permalink / raw)
  To: u-boot

On Thu, Mar 19, 2015 at 10:43:16AM +0100, Hannes Petermaier wrote:

> From: Hannes Petermaier <hannes.petermaier@br-automation.com>
> 
> since we have possibility to write out on lcd whats going on, we don't need
> the gpio blink functionality anymore.
> 
> Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com>
> 
> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/fddc9cb7/attachment.sig>

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

end of thread, other threads:[~2015-03-28 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19  9:43 [U-Boot] [PATCH 1/2] board/BuR/common: move I2C initialization from common part to board-specific Hannes Petermaier
2015-03-19  9:43 ` [U-Boot] [PATCH 2/2] board/BuR/common: remove unused function 'blink' Hannes Petermaier
2015-03-28 18:09   ` [U-Boot] [U-Boot, " Tom Rini
2015-03-28 18:09 ` [U-Boot] [U-Boot, 1/2] board/BuR/common: move I2C initialization from common part to board-specific Tom Rini

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.