mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/7] ARM: at91: introduce basic SAMA5D4 support
Date: Thu, 11 Sep 2014 18:31:01 +0200	[thread overview]
Message-ID: <20140911183101.7a82d291@free-electrons.com> (raw)
In-Reply-To: <1410450852-1834-4-git-send-email-alexandre.belloni@free-electrons.com>

Dear Alexandre Belloni,

On Thu, 11 Sep 2014 17:54:08 +0200, Alexandre Belloni wrote:

> +#ifdef CONFIG_CACHE_L2X0
> +static void __init at91_init_l2cache(void)
> +{
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache");
> +	if (!np)
> +		return;
> +	of_node_put(np);
> +
> +	l2x0_of_init(0, ~0UL);
> +}
> +#else
> +static inline void at91_init_l2cache(void) {}
> +#endif
> +
>  static void __init sama5_dt_device_init(void)
>  {
> +	at91_init_l2cache();

Following Russell's cleanup of the L2 cache code, I don't think this is
necessary. The l2x0_of_init() function is automatically called for you
in init_IRQ(), as long as one of the l2c_aux_mask or l2c_aux_val fields
of your DT_MACHINE structure are non zero:

void __init init_IRQ(void)
{
        int ret;

        if (IS_ENABLED(CONFIG_OF) && !machine_desc->init_irq)
                irqchip_init();
        else
                machine_desc->init_irq();

        if (IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_CACHE_L2X0) &&
            (machine_desc->l2c_aux_mask || machine_desc->l2c_aux_val)) {
                outer_cache.write_sec = machine_desc->l2c_write_sec;
                ret = l2x0_of_init(machine_desc->l2c_aux_val,
                                   machine_desc->l2c_aux_mask);
                if (ret)
                        pr_err("L2C: failed to init: %d\n", ret);
        }
}

Also, l2x0_of_init() already has a stub definition when
CONFIG_CACHE_L2X0 is not enabled, so the compile time conditional is
not necessary.

> +/* Firmware */
> +extern void atmel_firmware_init(void);
> +extern bool atmel_firmware_is_registered(void);

What is this firmware?

> diff --git a/arch/arm/mach-at91/include/mach/sama5d4.h b/arch/arm/mach-at91/include/mach/sama5d4.h
> new file mode 100644
> index 000000000000..af835e89d4c5
> --- /dev/null
> +++ b/arch/arm/mach-at91/include/mach/sama5d4.h
> @@ -0,0 +1,35 @@
> +/*
> + * Chip-specific header file for the SAMA5D4 family
> + *
> + *  Copyright (C) 2013 Atmel Corporation,
> + *                     Nicolas Ferre <nicolas.ferre@atmel.com>
> + *
> + * Common definitions.
> + * Based on SAMA5D4 datasheet.
> + *
> + * Licensed under GPLv2 or later.
> + */
> +
> +#ifndef SAMA5D4_H
> +#define SAMA5D4_H
> +
> +/*
> + * User Peripheral physical base addresses.
> + */
> +#define SAMA5D4_BASE_AIC	0xfc06e000 /* (AIC non-secure) Base Address */
> +#define SAMA5D4_BASE_USART3	0xfc00c000 /* (USART3 non-secure) Base Address */
> +#define SAMA5D4_BASE_PMC	0xf0018000 /* (PMC) Base Address */
> +#define SAMA5D4_BASE_MPDDRC	0xf0010000 /* (MPDDRC) Base Address */
> +#define SAMA5D4_BASE_PIOD	0xfc068000 /* (PIOD) Base Address */
> +#define SAMA5D4_BASE_PIOE	0xfc06d000 /* (PIOE) Base Address */

Are these definitions still all necessary? With the migration of most
(all?) peripherals to the Device Tree, less and less of those
definitions should be useful. For example, isn't the AIC fully
described in the Device Tree now?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-09-11 16:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 15:54 [PATCH 0/7] Initial support for the Atmel SMART sama5d4 Alexandre Belloni
2014-09-11 15:54 ` [PATCH 1/7] irqchip: atmel-aic5: Add sama5d4 support Alexandre Belloni
2014-09-11 16:17   ` Nicolas Ferre
2014-09-11 16:28     ` Alexandre Belloni
2014-09-11 16:29       ` Nicolas Ferre
2014-09-11 16:34         ` Alexandre Belloni
2014-09-11 16:24   ` Thomas Petazzoni
2014-09-11 16:27     ` Alexandre Belloni
2014-09-11 16:46       ` Thomas Petazzoni
2014-09-11 15:54 ` [PATCH 2/7] clk: at91: add a driver for the h32mx clock Alexandre Belloni
2014-09-11 15:54 ` [PATCH 3/7] ARM: at91: introduce basic SAMA5D4 support Alexandre Belloni
2014-09-11 16:31   ` Thomas Petazzoni [this message]
2014-09-11 15:54 ` [PATCH 4/7] ARM: at91: SAMA5D4 SoC detection code and low level routines Alexandre Belloni
2014-09-11 15:54 ` [PATCH 5/7] ARM: at91: dt: add device tree file for SAMA5D4 SoC Alexandre Belloni
2014-09-11 15:54 ` [PATCH 6/7] ARM: at91: dt: add device tree file for SAMA5D4ek board Alexandre Belloni
2014-09-11 15:54 ` [PATCH 7/7] ARM: at91: add sama5d4 support to sama5_defconfig Alexandre Belloni
2014-09-11 16:19   ` Nicolas Ferre
2014-09-11 16:32   ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140911183101.7a82d291@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®