[U-Boot] [PATCH 6/8] net/ethoc: support private memory configurations
Simon Glass
sjg at chromium.org
Tue Jul 12 23:56:54 CEST 2016
Hi,
On 8 July 2016 at 09:42, Max Filippov <jcmvbkbc at gmail.com> wrote:
> From: Chris Zankel <chris at zankel.net>
>
> 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 <chris at zankel.net>
> Signed-off-by: Max Filippov <jcmvbkbc at gmail.com>
> ---
> 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. Also you might find bouncebuf.c useful,
although it allocates memory with malloc().
Regards,
Simon
More information about the U-Boot
mailing list