[U-Boot] [PATCH 6/8] net/ethoc: support private memory configurations

Simon Glass sjg at chromium.org
Fri Jul 15 02:20:59 CEST 2016


Hi Max,

On 14 July 2016 at 17:34, Max Filippov <jcmvbkbc at gmail.com> wrote:
> Hi Simon,
>
> On Tue, Jul 12, 2016 at 03:56:54PM -0600, Simon Glass wrote:
>> 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.
>
> 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.

OK.

Regards,
Simon


More information about the U-Boot mailing list