> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: Sunday, January 10, 2021 7:05 PM
> To: Stefan Chulski <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; Nadav Haklai <[email protected]>; Yan Markman
> <[email protected]>; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]
> 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.

Reply via email to