From patchwork Thu May 3 02:11:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Ramirez Luna X-Patchwork-Id: 8370 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8E44F23E13 for ; Thu, 3 May 2012 02:12:11 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5E554A18281 for ; Thu, 3 May 2012 02:12:11 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id l4so1720493yen.11 for ; Wed, 02 May 2012 19:12:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=LRIt4pW5ai1QHSF86fm4f27QyDx50F6ufpXh+pVfu1E=; b=oLARP7LtPb+ItYn+eXCWaIyO7cEV9eTIWYH7KA1w+WbvcYyetDiMYpvjW/+oUwImNK Yjf9SrLuGThdn5DzBGqqZZmMCYUfXqGM17kAwNzX2aB0/djUUupUCwmYKyK9hB4mMBj8 MZbg9MdE0NuzwIxI0wEh7sv+aPjLJJkD2d0j1iceM+B8hRjCdS0xtuwkTK3tVYZVlUts K2UA9L0I9iIJogr5Wuqb3bSmgxSRpbkMKKJh9wwCZtDwF2d8v6ko7wdRxHhNxfPNBGzH bGicXowQZTCQl60lv2oVHcmdegsdtNnWmTsjLXrn6noJyIOaZfXItlPZJMOTjdvd/vuX 1n8g== Received: by 10.50.160.225 with SMTP id xn1mr237835igb.3.1336011131066; Wed, 02 May 2012 19:12:11 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp294437ibt; Wed, 2 May 2012 19:12:10 -0700 (PDT) Received: by 10.182.172.100 with SMTP id bb4mr464301obc.22.1336011130476; Wed, 02 May 2012 19:12:10 -0700 (PDT) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id p9si2137314obv.4.2012.05.02.19.12.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 May 2012 19:12:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of omar.luna@linaro.org) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of omar.luna@linaro.org) smtp.mail=omar.luna@linaro.org Received: by mail-ob0-f178.google.com with SMTP id eq6so2407529obc.37 for ; Wed, 02 May 2012 19:12:10 -0700 (PDT) Received: by 10.60.9.102 with SMTP id y6mr476941oea.46.1336011130153; Wed, 02 May 2012 19:12:10 -0700 (PDT) Received: from localhost.localdomain (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id r8sm3389007oer.6.2012.05.02.19.12.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 May 2012 19:12:09 -0700 (PDT) From: Omar Ramirez Luna To: Tony Lindgren , Paul Walmsley , Kevin Hilman Cc: Russell King , Omar Ramirez Luna , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, linaro-dev@lists.linaro.org, Omar Ramirez Luna Subject: [PATCH 3/3] staging: tidspbridge: use scm functions to set boot address and mode Date: Wed, 2 May 2012 21:11:53 -0500 Message-Id: <1336011113-31502-4-git-send-email-omar.luna@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1336011113-31502-1-git-send-email-omar.luna@linaro.org> References: <1336011113-31502-1-git-send-email-omar.luna@linaro.org> X-Gm-Message-State: ALoCoQmR4Aln0588KckxXLWl/AiGltssrKeWvyBwUBRNYyEBuY7fD0Z7NC7dZiRll9oGnRPvqJnA Instead of ioremapping SCM registers, use the correspondent layer to write into them. This allows us to get rid of a layer violation, since the registers are no longer touched by driver code. Signed-off-by: Omar Ramirez Luna --- drivers/staging/tidspbridge/core/tiomap3430.c | 32 +++++------------------- 1 files changed, 7 insertions(+), 25 deletions(-) diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index 9cf29fc..40b35ca 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -70,14 +70,9 @@ #define PAGES_II_LVL_TABLE 512 #define PHYS_TO_PAGE(phys) pfn_to_page((phys) >> PAGE_SHIFT) -/* - * This is a totally ugly layer violation, but needed until - * omap_ctrl_set_dsp_boot*() are provided. - */ -#define OMAP3_IVA2_BOOTMOD_IDLE 1 -#define OMAP2_CONTROL_GENERAL 0x270 -#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) -#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) +/* IVA Boot modes */ +#define DIRECT 0 +#define IDLE 1 /* Forward Declarations: */ static int bridge_brd_monitor(struct bridge_dev_context *dev_ctxt); @@ -414,27 +409,14 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, /* Assert RST1 i.e only the RST only for DSP megacell */ if (!status) { - /* - * XXX: ioremapping MUST be removed once ctrl - * function is made available. - */ - void __iomem *ctrl = ioremap(OMAP343X_CTRL_BASE, SZ_4K); - if (!ctrl) - return -ENOMEM; - (*pdata->dsp_prm_rmw_bits)(OMAP3430_RST1_IVA2_MASK, OMAP3430_RST1_IVA2_MASK, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); - /* Mask address with 1K for compatibility */ - __raw_writel(dsp_addr & OMAP3_IVA2_BOOTADDR_MASK, - ctrl + OMAP343X_CONTROL_IVA2_BOOTADDR); - /* - * Set bootmode to self loop if dsp_debug flag is true - */ - __raw_writel((dsp_debug) ? OMAP3_IVA2_BOOTMOD_IDLE : 0, - ctrl + OMAP343X_CONTROL_IVA2_BOOTMOD); - iounmap(ctrl); + /* Mask address with 1K for compatibility */ + pdata->set_bootaddr(dsp_addr & + OMAP3_IVA2_BOOTADDR_MASK); + pdata->set_bootmode(dsp_debug ? IDLE : DIRECT); } } if (!status) {