Message ID | 20230908133707.104592-1-ben.dooks@codethink.co.uk |
---|---|
State | Rejected |
Delegated to: | Andes |
Headers | show |
Series | [1/2] cache: sifive: clear out the error irqs on init | expand |
On 08/09/2023 14:37, Ben Dooks wrote: > We are getting a number of cache errors on starting an OS, > so to try and avoid this, clear the errors when we first > probe the cache. > > Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> > [ben.dooks@codethink.co.uk: changed from sifive.com address] As a follow-up, this hasn't been checked to see if it fixes the unmatched or other fuXXX cores. If someone could test it on others and see if it removes the issues, then it would be more than worth getting this merged.
diff --git a/drivers/cache/cache-sifive-ccache.c b/drivers/cache/cache-sifive-ccache.c index 540e7df138..178bdcc82d 100644 --- a/drivers/cache/cache-sifive-ccache.c +++ b/drivers/cache/cache-sifive-ccache.c @@ -51,11 +51,18 @@ static const struct cache_ops sifive_ccache_ops = { static int sifive_ccache_probe(struct udevice *dev) { struct sifive_ccache *priv = dev_get_priv(dev); + void __iomem *base; - priv->base = dev_read_addr_ptr(dev); + priv->base = base = dev_read_addr_ptr(dev); if (!priv->base) return -EINVAL; + /* read and clear any current errors, possilbly from reset */ + (void)readl(base + 0x108); + (void)readl(base + 0x128); + (void)readl(base + 0x148); + (void)readl(base + 0x168); + return 0; }
We are getting a number of cache errors on starting an OS, so to try and avoid this, clear the errors when we first probe the cache. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> [ben.dooks@codethink.co.uk: changed from sifive.com address] --- drivers/cache/cache-sifive-ccache.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)