From mboxrd@z Thu Jan 1 00:00:00 1970 From: Max Filippov Date: Fri, 15 Jul 2016 02:34:17 +0300 Subject: [U-Boot] [PATCH 6/8] net/ethoc: support private memory configurations In-Reply-To: References: <1467992526-13417-1-git-send-email-jcmvbkbc@gmail.com> <1467992526-13417-7-git-send-email-jcmvbkbc@gmail.com> Message-ID: <20160714233417.GF31001@octofox.metropolis> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On Tue, Jul 12, 2016 at 03:56:54PM -0600, Simon Glass wrote: > On 8 July 2016 at 09:42, Max Filippov wrote: > > From: Chris Zankel > > > > The 'ethoc' device could also be configured to have a private memory > > region instead of having access to the main memory. In that case, > > the packets must be copied into (transmit) or out of (receive) that > > memory. > > > > This behavior is configured by defining CONFIG_SYS_ETHOC_BUFFER_ADDR. > > Make sure to have enough memory for the configured buffers > > (one for transmit, and 'PKTBUFSRX' for receive) > > > > Signed-off-by: Chris Zankel > > Signed-off-by: Max Filippov > > --- > > drivers/net/ethoc.c | 21 +++++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > > > diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c > > index edb3c80..ee7c01e 100644 > > --- a/drivers/net/ethoc.c > > +++ b/drivers/net/ethoc.c > > @@ -248,6 +248,9 @@ static int ethoc_init_ring(struct eth_device *dev) > > { > > struct ethoc *priv = (struct ethoc *)dev->priv; > > struct ethoc_bd bd; > > +#ifdef CONFIG_SYS_ETHOC_BUFFER_ADDR > > + unsigned long addr = CONFIG_SYS_ETHOC_BUFFER_ADDR; > > These should be in Kconfig. Ok. > Also you might find bouncebuf.c useful, although it allocates memory > with malloc(). The ethoc variant that we use in XTFPGA boards can only access packets in its dedicated packet memory and we don't have other DMA, so bouncebuf doesn't look useful for our case. -- Thanks. -- Max