All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
	Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] ARM: tegra: Add AHB driver
Date: Mon, 23 Apr 2012 12:33:09 +0000	[thread overview]
Message-ID: <201204231233.09423.arnd@arndb.de> (raw)
In-Reply-To: <1335181043-15348-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

On Monday 23 April 2012, Hiroshi DOYU wrote:
> The AHB Bus conforms to the AMBA Specification (Rev 2.0) Advanced
> High-performance Bus (AHB) architecture.
> 
> Both Tegra20/30 have this.
> 
> Signed-off-by: Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Please explain in the text above why it's a good idea to have this
driver.


> @@ -122,6 +123,7 @@ void __init tegra20_init_early(void)
>  	tegra_init_cache(0x331, 0x441);
>  	tegra_pmc_init();
>  	tegra_powergate_init();
> +	tegra_ahb_gizmo_init();
>  }
>  #endif
>  #ifdef CONFIG_ARCH_TEGRA_3x_SOC
> @@ -132,5 +134,6 @@ void __init tegra30_init_early(void)
>  	tegra_init_cache(0x441, 0x551);
>  	tegra_pmc_init();
>  	tegra_powergate_init();
> +	tegra_ahb_gizmo_init();
>  }
>  #endif

Does it really have to be "early", rather than an initcall? Why?

> +
> +static inline unsigned long gizmo_readl(unsigned long offset)
> +{
> +	return readl(IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
> +}
> +
> +static inline void gizmo_writel(unsigned long value, unsigned long offset)
> +{
> +	writel(value, IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
> +}

Please change this to no longer use hardcoded addresses. A good
implementation would scan the device tree for the physical address
and then ioremap the registers in the init function, in order to
save a local __iomem pointer.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: tegra: Add AHB driver
Date: Mon, 23 Apr 2012 12:33:09 +0000	[thread overview]
Message-ID: <201204231233.09423.arnd@arndb.de> (raw)
In-Reply-To: <1335181043-15348-1-git-send-email-hdoyu@nvidia.com>

On Monday 23 April 2012, Hiroshi DOYU wrote:
> The AHB Bus conforms to the AMBA Specification (Rev 2.0) Advanced
> High-performance Bus (AHB) architecture.
> 
> Both Tegra20/30 have this.
> 
> Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

Please explain in the text above why it's a good idea to have this
driver.


> @@ -122,6 +123,7 @@ void __init tegra20_init_early(void)
>  	tegra_init_cache(0x331, 0x441);
>  	tegra_pmc_init();
>  	tegra_powergate_init();
> +	tegra_ahb_gizmo_init();
>  }
>  #endif
>  #ifdef CONFIG_ARCH_TEGRA_3x_SOC
> @@ -132,5 +134,6 @@ void __init tegra30_init_early(void)
>  	tegra_init_cache(0x441, 0x551);
>  	tegra_pmc_init();
>  	tegra_powergate_init();
> +	tegra_ahb_gizmo_init();
>  }
>  #endif

Does it really have to be "early", rather than an initcall? Why?

> +
> +static inline unsigned long gizmo_readl(unsigned long offset)
> +{
> +	return readl(IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
> +}
> +
> +static inline void gizmo_writel(unsigned long value, unsigned long offset)
> +{
> +	writel(value, IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
> +}

Please change this to no longer use hardcoded addresses. A good
implementation would scan the device tree for the physical address
and then ioremap the registers in the init function, in order to
save a local __iomem pointer.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Hiroshi DOYU <hdoyu@nvidia.com>
Cc: linux-tegra@vger.kernel.org, Colin Cross <ccross@android.com>,
	Olof Johansson <olof@lixom.net>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Russell King <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] ARM: tegra: Add AHB driver
Date: Mon, 23 Apr 2012 12:33:09 +0000	[thread overview]
Message-ID: <201204231233.09423.arnd@arndb.de> (raw)
In-Reply-To: <1335181043-15348-1-git-send-email-hdoyu@nvidia.com>

On Monday 23 April 2012, Hiroshi DOYU wrote:
> The AHB Bus conforms to the AMBA Specification (Rev 2.0) Advanced
> High-performance Bus (AHB) architecture.
> 
> Both Tegra20/30 have this.
> 
> Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

Please explain in the text above why it's a good idea to have this
driver.


> @@ -122,6 +123,7 @@ void __init tegra20_init_early(void)
>  	tegra_init_cache(0x331, 0x441);
>  	tegra_pmc_init();
>  	tegra_powergate_init();
> +	tegra_ahb_gizmo_init();
>  }
>  #endif
>  #ifdef CONFIG_ARCH_TEGRA_3x_SOC
> @@ -132,5 +134,6 @@ void __init tegra30_init_early(void)
>  	tegra_init_cache(0x441, 0x551);
>  	tegra_pmc_init();
>  	tegra_powergate_init();
> +	tegra_ahb_gizmo_init();
>  }
>  #endif

Does it really have to be "early", rather than an initcall? Why?

> +
> +static inline unsigned long gizmo_readl(unsigned long offset)
> +{
> +	return readl(IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
> +}
> +
> +static inline void gizmo_writel(unsigned long value, unsigned long offset)
> +{
> +	writel(value, IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
> +}

Please change this to no longer use hardcoded addresses. A good
implementation would scan the device tree for the physical address
and then ioremap the registers in the init function, in order to
save a local __iomem pointer.

	Arnd

  parent reply	other threads:[~2012-04-23 12:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 11:37 [PATCH 1/3] ARM: tegra: Add AHB driver Hiroshi DOYU
2012-04-23 11:37 ` Hiroshi DOYU
2012-04-23 11:37 ` Hiroshi DOYU
     [not found] ` <1335181043-15348-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-04-23 11:37   ` [PATCH 2/3] ARM: tegra: Add SMMU enabler in AHB Hiroshi DOYU
2012-04-23 11:37     ` Hiroshi DOYU
2012-04-23 11:37     ` Hiroshi DOYU
     [not found]     ` <1335181043-15348-2-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-04-23 12:09       ` Felipe Balbi
2012-04-23 12:09         ` Felipe Balbi
2012-04-23 12:09         ` Felipe Balbi
2012-04-23 11:37   ` [PATCH 3/3] iommu/tegra: smmu: Refrain from accessing to AHB registers Hiroshi DOYU
2012-04-23 11:37     ` Hiroshi DOYU
2012-04-23 12:06   ` [PATCH 1/3] ARM: tegra: Add AHB driver Felipe Balbi
2012-04-23 12:06     ` Felipe Balbi
2012-04-23 12:06     ` Felipe Balbi
2012-04-23 12:33   ` Arnd Bergmann [this message]
2012-04-23 12:33     ` Arnd Bergmann
2012-04-23 12:33     ` Arnd Bergmann
     [not found]     ` <201204231233.09423.arnd-r2nGTMty4D4@public.gmane.org>
2012-04-23 18:00       ` Stephen Warren
2012-04-23 18:00         ` Stephen Warren
2012-04-23 18:00         ` Stephen Warren
     [not found]         ` <4F9598AD.2030308-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-23 18:32           ` Arnd Bergmann
2012-04-23 18:32             ` Arnd Bergmann
2012-04-23 18:32             ` Arnd Bergmann

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=201204231233.09423.arnd@arndb.de \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.