All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] net: sh_eth: add cache handling
@ 2011-01-17  4:08 Yoshihiro Shimoda
  2011-01-17 13:05 ` Nobuhiro Iwamatsu
  2011-01-18  9:32 ` Wolfgang Denk
  0 siblings, 2 replies; 5+ messages in thread
From: Yoshihiro Shimoda @ 2011-01-17  4:08 UTC (permalink / raw)
  To: u-boot

Some CPU needs cache handling. So this patch add the config of
CONFIG_SH_ETHER_CACHE_WRITEBACK, and it calls wback function.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/net/sh_eth.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 86cc324..53d918d 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -36,6 +36,12 @@
 #ifndef CONFIG_SH_ETHER_PHY_ADDR
 # error "Please define CONFIG_SH_ETHER_PHY_ADDR"
 #endif
+#ifdef CONFIG_SH_ETHER_CACHE_WRITEBACK
+#define flush_cache_wback(addr, len)	\
+			dcache_wback_range((u32)addr, (u32)(addr + len - 1))
+#else
+#define flush_cache_wback(...)
+#endif

 #define SH_ETH_PHY_DELAY 50000

@@ -197,6 +203,7 @@ int sh_eth_send(struct eth_device *dev, volatile void *packet, int len)
 	}

 	/* Update tx descriptor */
+	flush_cache_wback(packet, len);
 	port_info->tx_desc_cur->td2 = ADDR_TO_PHY(packet);
 	port_info->tx_desc_cur->td1 = len << 16;
 	/* Must preserve the end of descriptor list indication */
@@ -312,6 +319,7 @@ static int sh_eth_tx_desc_init(struct sh_eth_dev *eth)

 	tmp_addr = (u32) (((int)port_info->tx_desc_malloc + TX_DESC_SIZE - 1) &
 			  ~(TX_DESC_SIZE - 1));
+	flush_cache_wback(tmp_addr, NUM_TX_DESC * sizeof(struct tx_desc_s));
 	/* Make sure we use a P2 address (non-cacheable) */
 	port_info->tx_desc_base = (struct tx_desc_s *)ADDR_TO_P2(tmp_addr);
 	port_info->tx_desc_cur = port_info->tx_desc_base;
@@ -361,6 +369,7 @@ static int sh_eth_rx_desc_init(struct sh_eth_dev *eth)

 	tmp_addr = (u32) (((int)port_info->rx_desc_malloc + RX_DESC_SIZE - 1) &
 			  ~(RX_DESC_SIZE - 1));
+	flush_cache_wback(tmp_addr, NUM_RX_DESC * sizeof(struct rx_desc_s));
 	/* Make sure we use a P2 address (non-cacheable) */
 	port_info->rx_desc_base = (struct rx_desc_s *)ADDR_TO_P2(tmp_addr);

-- 
1.7.1

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

* [U-Boot] [PATCH 1/2] net: sh_eth: add cache handling
  2011-01-17  4:08 [U-Boot] [PATCH 1/2] net: sh_eth: add cache handling Yoshihiro Shimoda
@ 2011-01-17 13:05 ` Nobuhiro Iwamatsu
  2011-01-18  9:31   ` Wolfgang Denk
  2011-01-18  9:32 ` Wolfgang Denk
  1 sibling, 1 reply; 5+ messages in thread
From: Nobuhiro Iwamatsu @ 2011-01-17 13:05 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 17, 2011 at 01:08:58PM +0900, Yoshihiro Shimoda wrote:
> Some CPU needs cache handling. So this patch add the config of
> CONFIG_SH_ETHER_CACHE_WRITEBACK, and it calls wback function.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  drivers/net/sh_eth.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
Applied, thank.
  Nobuhiro

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

* [U-Boot] [PATCH 1/2] net: sh_eth: add cache handling
  2011-01-17 13:05 ` Nobuhiro Iwamatsu
@ 2011-01-18  9:31   ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2011-01-18  9:31 UTC (permalink / raw)
  To: u-boot

Dear Nobuhiro Iwamatsu,

In message <20110117130531.GD13819@chimagu.nigauri.org> you wrote:
> On Mon, Jan 17, 2011 at 01:08:58PM +0900, Yoshihiro Shimoda wrote:
> > Some CPU needs cache handling. So this patch add the config of
> > CONFIG_SH_ETHER_CACHE_WRITEBACK, and it calls wback function.
> > 
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  drivers/net/sh_eth.c |    9 +++++++++
> >  1 files changed, 9 insertions(+), 0 deletions(-)
> > 
> Applied, thank.

You are a bit fast.  Network code should go throughthe network
custodian, or at least it requires his ACK.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
How does a project get to be a year late?      ... One day at a time.

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

* [U-Boot] [PATCH 1/2] net: sh_eth: add cache handling
  2011-01-17  4:08 [U-Boot] [PATCH 1/2] net: sh_eth: add cache handling Yoshihiro Shimoda
  2011-01-17 13:05 ` Nobuhiro Iwamatsu
@ 2011-01-18  9:32 ` Wolfgang Denk
  2011-01-19  8:01   ` Yoshihiro Shimoda
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2011-01-18  9:32 UTC (permalink / raw)
  To: u-boot

Dear Yoshihiro Shimoda,

In message <4D33C0DA.4000701@renesas.com> you wrote:
> Some CPU needs cache handling. So this patch add the config of
> CONFIG_SH_ETHER_CACHE_WRITEBACK, and it calls wback function.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  drivers/net/sh_eth.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
> index 86cc324..53d918d 100644
> --- a/drivers/net/sh_eth.c
> +++ b/drivers/net/sh_eth.c
> @@ -36,6 +36,12 @@
>  #ifndef CONFIG_SH_ETHER_PHY_ADDR
>  # error "Please define CONFIG_SH_ETHER_PHY_ADDR"
>  #endif
> +#ifdef CONFIG_SH_ETHER_CACHE_WRITEBACK
> +#define flush_cache_wback(addr, len)	\
> +			dcache_wback_range((u32)addr, (u32)(addr + len - 1))
> +#else
> +#define flush_cache_wback(...)
> +#endif

New config options must be documented in the README.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When all is said and done, more is said than done.

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

* [U-Boot] [PATCH 1/2] net: sh_eth: add cache handling
  2011-01-18  9:32 ` Wolfgang Denk
@ 2011-01-19  8:01   ` Yoshihiro Shimoda
  0 siblings, 0 replies; 5+ messages in thread
From: Yoshihiro Shimoda @ 2011-01-19  8:01 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang Denk,

2011/01/18 18:32, Wolfgang Denk wrote:
> Dear Yoshihiro Shimoda,
> 
> In message <4D33C0DA.4000701@renesas.com> you wrote:
>> --- a/drivers/net/sh_eth.c
>> +++ b/drivers/net/sh_eth.c
>> @@ -36,6 +36,12 @@
>>  #ifndef CONFIG_SH_ETHER_PHY_ADDR
>>  # error "Please define CONFIG_SH_ETHER_PHY_ADDR"
>>  #endif
>> +#ifdef CONFIG_SH_ETHER_CACHE_WRITEBACK
>> +#define flush_cache_wback(addr, len)	\
>> +			dcache_wback_range((u32)addr, (u32)(addr + len - 1))
>> +#else
>> +#define flush_cache_wback(...)
>> +#endif
> 
> New config options must be documented in the README.
> 
I will document about this option in the README.
The README isn't written about the driver now,
so I will document about this driver first.

Best regards,
Yoshihiro Shimoda

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

end of thread, other threads:[~2011-01-19  8:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17  4:08 [U-Boot] [PATCH 1/2] net: sh_eth: add cache handling Yoshihiro Shimoda
2011-01-17 13:05 ` Nobuhiro Iwamatsu
2011-01-18  9:31   ` Wolfgang Denk
2011-01-18  9:32 ` Wolfgang Denk
2011-01-19  8:01   ` Yoshihiro Shimoda

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.