From patchwork Wed Mar 23 10:04:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 752 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:25 -0000 Delivered-To: patches@linaro.org Received: by 10.220.28.198 with SMTP id n6cs3030vcc; Wed, 23 Mar 2011 03:05:34 -0700 (PDT) Received: by 10.14.125.201 with SMTP id z49mr2405173eeh.143.1300874733728; Wed, 23 Mar 2011 03:05:33 -0700 (PDT) Received: from eu1sys200aog108.obsmtp.com (eu1sys200aog108.obsmtp.com [207.126.144.125]) by mx.google.com with SMTP id s42si11197723eeh.69.2011.03.23.03.05.25 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Mar 2011 03:05:33 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.125 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.125; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.125 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob108.postini.com ([207.126.147.11]) with SMTP ID DSNKTYnF470SfPJZ5xzUbrzkNeVbGPQujuV+@postini.com; Wed, 23 Mar 2011 10:05:33 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9430E2C2; Wed, 23 Mar 2011 10:05:22 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D25452116; Wed, 23 Mar 2011 10:05:21 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id A9BE4A807D; Wed, 23 Mar 2011 11:04:47 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.2.254.0; Wed, 23 Mar 2011 11:04:51 +0100 From: Linus Walleij To: Cc: Lee Jones , Linus Walleij Subject: [PATCH 3/6] amba: make hardcoded periphid override hardware Date: Wed, 23 Mar 2011 11:04:34 +0100 Message-ID: <1300874674-14780-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Linus Walleij This makes a hardcoded periphid from the platform override any magic number found in the hardware. This shall henceforth be used when the information found in the hardware is either missing, i.e. not encoding the CID with the magic cookie 0xb105f00d, or incorrect such that the revision number should have been bumped in hardware, but the silicon designer has failed to do so. Signed-off-by: Linus Walleij --- drivers/amba/bus.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 6d2bb25..fcf355c 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -603,6 +603,10 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) if (ret) goto err_out; + /* Hard-coded primecell ID instead of plug-n-play */ + if (dev->periphid != 0) + goto skip_probe; + /* * Dynamically calculate the size of the resource * and use this for iomap @@ -643,6 +647,7 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) if (ret) goto err_release; + skip_probe: ret = device_add(&dev->dev); if (ret) goto err_release;