All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming
@ 2017-08-14  7:04 David Wu
  2017-08-17  6:47 ` Kever Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: David Wu @ 2017-08-14  7:04 UTC (permalink / raw)
  To: u-boot

Unfortunately, the integrated macphy default is enabled, which will
increase power consuming, if we do not use this PHY. So let's disable
it at first, which will save power consuming. If we really use it, then
enable it in driver level.

Signed-off-by: David Wu <david.wu@rock-chips.com>
---
 arch/arm/include/asm/arch-rockchip/grf_rk322x.h | 32 +++++++++++++++++++++++++
 arch/arm/mach-rockchip/rk322x-board.c           |  8 +++++++
 2 files changed, 40 insertions(+)

diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk322x.h b/arch/arm/include/asm/arch-rockchip/grf_rk322x.h
index 26071c8..c0c0d84 100644
--- a/arch/arm/include/asm/arch-rockchip/grf_rk322x.h
+++ b/arch/arm/include/asm/arch-rockchip/grf_rk322x.h
@@ -54,6 +54,32 @@ struct rk322x_grf {
 	unsigned int os_reg[8];
 	unsigned int reserved9[(0x604 - 0x5e4) / 4 - 1];
 	unsigned int ddrc_stat;
+	unsigned int reserved10[(0x680 - 0x604) / 4 - 1];
+	unsigned int sig_detect_con[2];
+	unsigned int reserved11[(0x690 - 0x684) / 4 - 1];
+	unsigned int sig_detect_status[2];
+	unsigned int reserved12[(0x6a0 - 0x694) / 4 - 1];
+	unsigned int sig_detect_clr[2];
+	unsigned int reserved13[(0x6b0 - 0x6a4) / 4 - 1];
+	unsigned int emmc_det;
+	unsigned int reserved14[(0x700 - 0x6b0) / 4 - 1];
+	unsigned int host0_con[3];
+	unsigned int reserved15;
+	unsigned int host1_con[3];
+	unsigned int reserved16;
+	unsigned int host2_con[3];
+	unsigned int reserved17[(0x760 - 0x728) / 4 - 1];
+	unsigned int usbphy0_con[27];
+	unsigned int reserved18[(0x800 - 0x7c8) / 4 - 1];
+	unsigned int usbphy1_con[27];
+	unsigned int reserved19[(0x880 - 0x868) / 4 - 1];
+	unsigned int otg_con0;
+	unsigned int uoc_status0;
+	unsigned int reserved20[(0x900 - 0x884) / 4 - 1];
+	unsigned int mac_con[2];
+	unsigned int reserved21[(0xb00 - 0x904) / 4 - 1];
+	unsigned int macphy_con[4];
+	unsigned int macphy_status;
 };
 check_member(rk322x_grf, ddrc_stat, 0x604);
 
@@ -516,4 +542,10 @@ enum {
 	CON_IOMUX_PWM0SEL_SHIFT	= 0,
 	CON_IOMUX_PWM0SEL_MASK	= 1 << CON_IOMUX_PWM0SEL_SHIFT,
 };
+
+/* GRF_MACPHY_CON0 */
+enum {
+	MACPHY_CFG_ENABLE_SHIFT = 0,
+	MACPHY_CFG_ENABLE_MASK  = 1 << MACPHY_CFG_ENABLE_SHIFT,
+};
 #endif
diff --git a/arch/arm/mach-rockchip/rk322x-board.c b/arch/arm/mach-rockchip/rk322x-board.c
index b6543a5..c8e6c6c 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -67,6 +67,14 @@ int board_init(void)
 		     CON_IOMUX_UART2SEL_MASK,
 		     CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT);
 
+	/*
+	* The integrated macphy is enabled by default, disable it
+	* for saving power consuming.
+	*/
+	rk_clrsetreg(&grf->macphy_con[0],
+		     MACPHY_CFG_ENABLE_MASK,
+		     0 << MACPHY_CFG_ENABLE_SHIFT);
+
 	return 0;
 }
 
-- 
1.9.1

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

* [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming
  2017-08-14  7:04 [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming David Wu
@ 2017-08-17  6:47 ` Kever Yang
  2017-08-18 13:23 ` Philipp Tomsich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kever Yang @ 2017-08-17  6:47 UTC (permalink / raw)
  To: u-boot

Hi David,


On 08/14/2017 03:04 PM, David Wu wrote:
> Unfortunately, the integrated macphy default is enabled, which will
> increase power consuming, if we do not use this PHY. So let's disable
> it at first, which will save power consuming. If we really use it, then
> enable it in driver level.
>
> Signed-off-by: David Wu <david.wu@rock-chips.com>

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   arch/arm/include/asm/arch-rockchip/grf_rk322x.h | 32 +++++++++++++++++++++++++
>   arch/arm/mach-rockchip/rk322x-board.c           |  8 +++++++
>   2 files changed, 40 insertions(+)
>
> diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk322x.h b/arch/arm/include/asm/arch-rockchip/grf_rk322x.h
> index 26071c8..c0c0d84 100644
> --- a/arch/arm/include/asm/arch-rockchip/grf_rk322x.h
> +++ b/arch/arm/include/asm/arch-rockchip/grf_rk322x.h
> @@ -54,6 +54,32 @@ struct rk322x_grf {
>   	unsigned int os_reg[8];
>   	unsigned int reserved9[(0x604 - 0x5e4) / 4 - 1];
>   	unsigned int ddrc_stat;
> +	unsigned int reserved10[(0x680 - 0x604) / 4 - 1];
> +	unsigned int sig_detect_con[2];
> +	unsigned int reserved11[(0x690 - 0x684) / 4 - 1];
> +	unsigned int sig_detect_status[2];
> +	unsigned int reserved12[(0x6a0 - 0x694) / 4 - 1];
> +	unsigned int sig_detect_clr[2];
> +	unsigned int reserved13[(0x6b0 - 0x6a4) / 4 - 1];
> +	unsigned int emmc_det;
> +	unsigned int reserved14[(0x700 - 0x6b0) / 4 - 1];
> +	unsigned int host0_con[3];
> +	unsigned int reserved15;
> +	unsigned int host1_con[3];
> +	unsigned int reserved16;
> +	unsigned int host2_con[3];
> +	unsigned int reserved17[(0x760 - 0x728) / 4 - 1];
> +	unsigned int usbphy0_con[27];
> +	unsigned int reserved18[(0x800 - 0x7c8) / 4 - 1];
> +	unsigned int usbphy1_con[27];
> +	unsigned int reserved19[(0x880 - 0x868) / 4 - 1];
> +	unsigned int otg_con0;
> +	unsigned int uoc_status0;
> +	unsigned int reserved20[(0x900 - 0x884) / 4 - 1];
> +	unsigned int mac_con[2];
> +	unsigned int reserved21[(0xb00 - 0x904) / 4 - 1];
> +	unsigned int macphy_con[4];
> +	unsigned int macphy_status;
>   };
>   check_member(rk322x_grf, ddrc_stat, 0x604);
>   
> @@ -516,4 +542,10 @@ enum {
>   	CON_IOMUX_PWM0SEL_SHIFT	= 0,
>   	CON_IOMUX_PWM0SEL_MASK	= 1 << CON_IOMUX_PWM0SEL_SHIFT,
>   };
> +
> +/* GRF_MACPHY_CON0 */
> +enum {
> +	MACPHY_CFG_ENABLE_SHIFT = 0,
> +	MACPHY_CFG_ENABLE_MASK  = 1 << MACPHY_CFG_ENABLE_SHIFT,
> +};
>   #endif
> diff --git a/arch/arm/mach-rockchip/rk322x-board.c b/arch/arm/mach-rockchip/rk322x-board.c
> index b6543a5..c8e6c6c 100644
> --- a/arch/arm/mach-rockchip/rk322x-board.c
> +++ b/arch/arm/mach-rockchip/rk322x-board.c
> @@ -67,6 +67,14 @@ int board_init(void)
>   		     CON_IOMUX_UART2SEL_MASK,
>   		     CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT);
>   
> +	/*
> +	* The integrated macphy is enabled by default, disable it
> +	* for saving power consuming.
> +	*/
> +	rk_clrsetreg(&grf->macphy_con[0],
> +		     MACPHY_CFG_ENABLE_MASK,
> +		     0 << MACPHY_CFG_ENABLE_SHIFT);
> +
>   	return 0;
>   }
>   

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

* [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming
  2017-08-14  7:04 [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming David Wu
  2017-08-17  6:47 ` Kever Yang
@ 2017-08-18 13:23 ` Philipp Tomsich
  2017-08-18 16:08 ` Philipp Tomsich
  2017-09-05 12:22 ` Philipp Tomsich
  3 siblings, 0 replies; 5+ messages in thread
From: Philipp Tomsich @ 2017-08-18 13:23 UTC (permalink / raw)
  To: u-boot

> Unfortunately, the integrated macphy default is enabled, which will
> increase power consuming, if we do not use this PHY. So let's disable
> it at first, which will save power consuming. If we really use it, then
> enable it in driver level.
> 
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>  arch/arm/include/asm/arch-rockchip/grf_rk322x.h | 32 +++++++++++++++++++++++++
>  arch/arm/mach-rockchip/rk322x-board.c           |  8 +++++++
>  2 files changed, 40 insertions(+)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming
  2017-08-14  7:04 [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming David Wu
  2017-08-17  6:47 ` Kever Yang
  2017-08-18 13:23 ` Philipp Tomsich
@ 2017-08-18 16:08 ` Philipp Tomsich
  2017-09-05 12:22 ` Philipp Tomsich
  3 siblings, 0 replies; 5+ messages in thread
From: Philipp Tomsich @ 2017-08-18 16:08 UTC (permalink / raw)
  To: u-boot

> Unfortunately, the integrated macphy default is enabled, which will
> increase power consuming, if we do not use this PHY. So let's disable
> it at first, which will save power consuming. If we really use it, then
> enable it in driver level.
> 
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  arch/arm/include/asm/arch-rockchip/grf_rk322x.h | 32 +++++++++++++++++++++++++
>  arch/arm/mach-rockchip/rk322x-board.c           |  8 +++++++
>  2 files changed, 40 insertions(+)
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming
  2017-08-14  7:04 [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming David Wu
                   ` (2 preceding siblings ...)
  2017-08-18 16:08 ` Philipp Tomsich
@ 2017-09-05 12:22 ` Philipp Tomsich
  3 siblings, 0 replies; 5+ messages in thread
From: Philipp Tomsich @ 2017-09-05 12:22 UTC (permalink / raw)
  To: u-boot

> Unfortunately, the integrated macphy default is enabled, which will
> increase power consuming, if we do not use this PHY. So let's disable
> it at first, which will save power consuming. If we really use it, then
> enable it in driver level.
> 
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  arch/arm/include/asm/arch-rockchip/grf_rk322x.h | 32 +++++++++++++++++++++++++
>  arch/arm/mach-rockchip/rk322x-board.c           |  8 +++++++
>  2 files changed, 40 insertions(+)
> 

Applied to u-boot-rockchip/next, thanks!

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

end of thread, other threads:[~2017-09-05 12:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14  7:04 [U-Boot] rockchip: rk322x: Disable integrated macphy for saving power consuming David Wu
2017-08-17  6:47 ` Kever Yang
2017-08-18 13:23 ` Philipp Tomsich
2017-08-18 16:08 ` Philipp Tomsich
2017-09-05 12:22 ` Philipp Tomsich

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.