linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/10] arm: plat-orion: remove addr-map code
Date: Wed,  6 Mar 2013 14:43:46 +0100	[thread overview]
Message-ID: <1362577426-12804-11-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1362577426-12804-1-git-send-email-thomas.petazzoni@free-electrons.com>

Now that all Marvell EBU platforms have been converted to use the
mvebu-mbus driver, we can remove the common plat-orion/addr-map.c code
that isn't compiled anymore.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/plat-orion/addr-map.c |  178 ----------------------------------------
 1 file changed, 178 deletions(-)
 delete mode 100644 arch/arm/plat-orion/addr-map.c

diff --git a/arch/arm/plat-orion/addr-map.c b/arch/arm/plat-orion/addr-map.c
deleted file mode 100644
index 807ac8e..0000000
--- a/arch/arm/plat-orion/addr-map.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * arch/arm/plat-orion/addr-map.c
- *
- * Address map functions for Marvell Orion based SoCs
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/mbus.h>
-#include <linux/io.h>
-#include <plat/addr-map.h>
-
-struct mbus_dram_target_info orion_mbus_dram_info;
-
-const struct mbus_dram_target_info *mv_mbus_dram_info(void)
-{
-	return &orion_mbus_dram_info;
-}
-EXPORT_SYMBOL_GPL(mv_mbus_dram_info);
-
-/*
- * DDR target is the same on all Orion platforms.
- */
-#define TARGET_DDR		0
-
-/*
- * Helpers to get DDR bank info
- */
-#define DDR_BASE_CS_OFF(n)	(0x0000 + ((n) << 3))
-#define DDR_SIZE_CS_OFF(n)	(0x0004 + ((n) << 3))
-
-/*
- * CPU Address Decode Windows registers
- */
-#define WIN_CTRL_OFF		0x0000
-#define WIN_BASE_OFF		0x0004
-#define WIN_REMAP_LO_OFF	0x0008
-#define WIN_REMAP_HI_OFF	0x000c
-
-#define ATTR_HW_COHERENCY	(0x1 << 4)
-
-/*
- * Default implementation
- */
-static void __init __iomem *
-orion_win_cfg_base(const struct orion_addr_map_cfg *cfg, int win)
-{
-	return cfg->bridge_virt_base + (win << 4);
-}
-
-/*
- * Default implementation
- */
-static int __init orion_cpu_win_can_remap(const struct orion_addr_map_cfg *cfg,
-					  const int win)
-{
-	if (win < cfg->remappable_wins)
-		return 1;
-
-	return 0;
-}
-
-void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg,
-				const int win, const u32 base,
-				const u32 size, const u8 target,
-				const u8 attr, const int remap)
-{
-	void __iomem *addr = cfg->win_cfg_base(cfg, win);
-	u32 ctrl, base_high, remap_addr;
-
-	if (win >= cfg->num_wins) {
-		printk(KERN_ERR "setup_cpu_win: trying to allocate window "
-		       "%d when only %d allowed\n", win, cfg->num_wins);
-	}
-
-	base_high = base & 0xffff0000;
-	ctrl = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1;
-
-	writel(base_high, addr + WIN_BASE_OFF);
-	writel(ctrl, addr + WIN_CTRL_OFF);
-	if (cfg->cpu_win_can_remap(cfg, win)) {
-		if (remap < 0)
-			remap_addr = base;
-		else
-			remap_addr = remap;
-		writel(remap_addr & 0xffff0000, addr + WIN_REMAP_LO_OFF);
-		writel(0, addr + WIN_REMAP_HI_OFF);
-	}
-}
-
-/*
- * Configure a number of windows.
- */
-static void __init orion_setup_cpu_wins(const struct orion_addr_map_cfg * cfg,
-					const struct orion_addr_map_info *info)
-{
-	while (info->win != -1) {
-		orion_setup_cpu_win(cfg, info->win, info->base, info->size,
-				    info->target, info->attr, info->remap);
-		info++;
-	}
-}
-
-static void __init orion_disable_wins(const struct orion_addr_map_cfg * cfg)
-{
-	void __iomem *addr;
-	int i;
-
-	for (i = 0; i < cfg->num_wins; i++) {
-		addr = cfg->win_cfg_base(cfg, i);
-
-		writel(0, addr + WIN_BASE_OFF);
-		writel(0, addr + WIN_CTRL_OFF);
-		if (cfg->cpu_win_can_remap(cfg, i)) {
-			writel(0, addr + WIN_REMAP_LO_OFF);
-			writel(0, addr + WIN_REMAP_HI_OFF);
-		}
-	}
-}
-
-/*
- * Disable, clear and configure windows.
- */
-void __init orion_config_wins(struct orion_addr_map_cfg * cfg,
-			      const struct orion_addr_map_info *info)
-{
-	if (!cfg->cpu_win_can_remap)
-		cfg->cpu_win_can_remap = orion_cpu_win_can_remap;
-
-	if (!cfg->win_cfg_base)
-		cfg->win_cfg_base = orion_win_cfg_base;
-
-	orion_disable_wins(cfg);
-
-	if (info)
-		orion_setup_cpu_wins(cfg, info);
-}
-
-/*
- * Setup MBUS dram target info.
- */
-void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg,
-					const void __iomem *ddr_window_cpu_base)
-{
-	int i;
-	int cs;
-
-	orion_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
-
-	for (i = 0, cs = 0; i < 4; i++) {
-		u32 base = readl(ddr_window_cpu_base + DDR_BASE_CS_OFF(i));
-		u32 size = readl(ddr_window_cpu_base + DDR_SIZE_CS_OFF(i));
-
-		/*
-		 * We only take care of entries for which the chip
-		 * select is enabled, and that don't have high base
-		 * address bits set (devices can only access the first
-		 * 32 bits of the memory).
-		 */
-		if ((size & 1) && !(base & 0xF)) {
-			struct mbus_dram_window *w;
-
-			w = &orion_mbus_dram_info.cs[cs++];
-			w->cs_index = i;
-			w->mbus_attr = 0xf & ~(1 << i);
-			if (cfg->hw_io_coherency)
-				w->mbus_attr |= ATTR_HW_COHERENCY;
-			w->base = base & 0xffff0000;
-			w->size = (size | 0x0000ffff) + 1;
-		}
-	}
-	orion_mbus_dram_info.num_cs = cs;
-}
-- 
1.7.9.5

  parent reply	other threads:[~2013-03-06 13:43 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 13:43 [PATCH 3.10] Introduce a Marvell EBU MBus driver Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 01/10] arm: plat-orion: only build addr-map.c when needed Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 02/10] arm: plat-orion: use mv_mbus_dram_info() in PCIe code Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 03/10] arm: mach-orion5x: use mv_mbus_dram_info() in PCI code Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 04/10] bus: introduce an Marvell EBU MBus driver Thomas Petazzoni
2013-03-06 19:08   ` Jason Gunthorpe
2013-03-06 19:27     ` Thomas Petazzoni
2013-03-06 20:24       ` Jason Gunthorpe
2013-03-06 20:40         ` Thomas Petazzoni
2013-03-06 21:50           ` Jason Gunthorpe
2013-03-06 22:27             ` Jason Cooper
2013-03-06 23:04               ` Jason Gunthorpe
2013-03-07 10:39                 ` Thomas Petazzoni
2013-03-08 13:50                   ` Arnd Bergmann
2013-03-08 14:06                     ` Thomas Petazzoni
2013-03-08 15:41                       ` Arnd Bergmann
2013-03-08 17:50                         ` Jason Gunthorpe
2013-03-08 19:42                           ` Arnd Bergmann
2013-03-08 20:05                             ` Jason Gunthorpe
2013-03-08 22:46                               ` Arnd Bergmann
2013-03-08 17:43                       ` Jason Gunthorpe
2013-03-08 22:58                         ` Arnd Bergmann
2013-03-07 22:20                 ` Ezequiel Garcia
2013-03-07 23:05                   ` Jason Gunthorpe
2013-03-08  1:02                     ` Ezequiel Garcia
2013-03-08  8:10                     ` Thomas Petazzoni
2013-03-08 17:29                       ` Jason Gunthorpe
2013-03-08 17:59                         ` Ezequiel Garcia
2013-03-08 18:31                           ` Jason Gunthorpe
2013-03-08 18:53                             ` Ezequiel Garcia
2013-03-18 16:27                         ` Thomas Petazzoni
2013-03-18 17:18                           ` Jason Gunthorpe
2013-03-08 15:59                     ` Maxime Bizon
2013-03-08 16:48                       ` Jason Gunthorpe
2013-03-08 17:12                         ` Ezequiel Garcia
2013-03-08  8:14                 ` Thomas Petazzoni
2013-03-08 18:26                   ` Jason Gunthorpe
2013-03-07  3:50           ` Arnd Bergmann
2013-03-07  3:37         ` Arnd Bergmann
2013-03-07  6:35           ` Jason Gunthorpe
2013-03-08 16:48             ` Jason Cooper
2013-03-08 19:47               ` Jason Gunthorpe
2013-03-08 22:54                 ` Arnd Bergmann
2013-03-07 10:58           ` Thomas Petazzoni
2013-03-07 17:37             ` Jason Gunthorpe
2013-03-07 19:11               ` Thomas Petazzoni
2013-03-07 19:55                 ` Jason Gunthorpe
2013-03-07 20:28                   ` Thomas Petazzoni
2013-03-07 20:47                     ` Jason Gunthorpe
2013-03-06 13:43 ` [PATCH 05/10] arm: mach-mvebu: convert to use mvebu-mbus driver Thomas Petazzoni
2013-03-06 13:58   ` Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 06/10] arm: mach-kirkwood: " Thomas Petazzoni
2013-03-06 19:09   ` Jason Gunthorpe
2013-03-06 19:31     ` Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 07/10] arm: mach-dove: " Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 08/10] arm: mach-orion5x: " Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 09/10] arm: mach-mv78xx0: convert to use the " Thomas Petazzoni
2013-03-06 13:43 ` Thomas Petazzoni [this message]
2013-03-06 16:59 [PATCH v2 for 3.10] Introduce a Marvell EBU MBus driver Thomas Petazzoni
2013-03-06 17:00 ` [PATCH 10/10] arm: plat-orion: remove addr-map code 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=1362577426-12804-11-git-send-email-thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).