lkml.org 
[lkml]   [2021]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [EXT] Re: [PATCH RFC net-next 03/19] net: mvpp2: add CM3 SRAM memory map
Date


> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Sunday, January 10, 2021 7:05 PM
> To: Stefan Chulski <stefanc@marvell.com>
> Cc: netdev@vger.kernel.org; thomas.petazzoni@bootlin.com;
> davem@davemloft.net; Nadav Haklai <nadavh@marvell.com>; Yan Markman
> <ymarkman@marvell.com>; linux-kernel@vger.kernel.org; kuba@kernel.org;
> linux@armlinux.org.uk; mw@semihalf.com; rmk+kernel@armlinux.org.uk;
> atenart@kernel.org
> Subject: [EXT] Re: [PATCH RFC net-next 03/19] net: mvpp2: add CM3 SRAM
> memory map
>
> External Email
>
> ----------------------------------------------------------------------
> > +static int mvpp2_get_sram(struct platform_device *pdev,
> > + struct mvpp2 *priv)
> > +{
> > + struct device_node *dn = pdev->dev.of_node;
> > + struct resource *res;
> > +
> > + if (has_acpi_companion(&pdev->dev)) {
> > + res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> > + if (!res) {
> > + dev_warn(&pdev->dev, "ACPI is too old, TX FC
> disabled\n");
> > + return 0;
> > + }
> > + priv->cm3_base = devm_ioremap_resource(&pdev->dev,
> res);
> > + if (IS_ERR(priv->cm3_base))
> > + return PTR_ERR(priv->cm3_base);
> > + } else {
> > + priv->sram_pool = of_gen_pool_get(dn, "cm3-mem", 0);
> > + if (!priv->sram_pool) {
> > + dev_warn(&pdev->dev, "DT is too old, TX FC
> disabled\n");
> > + return 0;
> > + }
> > + priv->cm3_base = (void __iomem *)gen_pool_alloc(priv-
> >sram_pool,
> > +
> MSS_SRAM_SIZE);
> > + if (!priv->cm3_base)
> > + return -ENOMEM;
>
> Should there be -EPROBE_DEFER handling in here somewhere? The SRAM is a
> device, so it might not of been probed yet?

No, firmware probed during bootloader boot and we can use SRAM. SRAM memory can be safely used.

Regards.

\
 
 \ /
  Last update: 2021-01-10 18:15    [W:0.084 / U:3.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site