From patchwork Thu Aug 11 19:31:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Heider X-Patchwork-Id: 109674 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 9B944100ED6 for ; Fri, 12 Aug 2011 05:33:27 +1000 (EST) Received: from mail-bw0-f51.google.com (mail-bw0-f51.google.com [209.85.214.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id AC8DFB73F9; Fri, 12 Aug 2011 05:31:36 +1000 (EST) Received: by mail-bw0-f51.google.com with SMTP id r19so1201090bka.38 for ; Thu, 11 Aug 2011 12:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=tH2JBr1fYzw+vt3xP+61VSGHMW5PoultRwwhoQuBHeg=; b=DXKsphFzeBg76aC2RmJxQWrdxcEnwxFaHHF1g/MK5gnX/mSqVxHSJdN/3Ope5yfGAR GRZPDHtoYXUfn/rot0GXVQkueHFf7ciVgYu3vAtExx8O42Kc8tfu39IBt/NNdMh7J8tF Ew8AG7xDAoufvIEqdCsuRvp7PNaCQP51sk+CM= Received: by 10.205.35.129 with SMTP id sw1mr3377971bkb.285.1313091096060; Thu, 11 Aug 2011 12:31:36 -0700 (PDT) Received: from localhost.localdomain (g227146205.adsl.alicedsl.de [92.227.146.205]) by mx.google.com with ESMTPS id r24sm604446bkr.59.2011.08.11.12.31.33 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Aug 2011 12:31:34 -0700 (PDT) From: Andre Heider To: Geoff Levand Subject: [PATCH part1 v2 8/9] ps3flash: Refuse to work in lpars other than OtherOS Date: Thu, 11 Aug 2011 21:31:12 +0200 Message-Id: <1313091073-4572-9-git-send-email-a.heider@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1313091073-4572-1-git-send-email-a.heider@gmail.com> References: <1312228986-32307-1-git-send-email-a.heider@gmail.com> <1313091073-4572-1-git-send-email-a.heider@gmail.com> Cc: cbe-oss-dev@lists.ozlabs.org, Hector Martin , linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org The driver implements a character and misc device, meant for the axed OtherOS to exchange various settings with GameOS. Since Firmware 3.21 there is no support anymore to write these settings, so test if we're running in OtherOS, and refuse to load if that is not the case. Signed-off-by: Andre Heider --- arch/powerpc/platforms/ps3/Kconfig | 2 +- drivers/char/ps3flash.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig index 84df5c8..72fdecd 100644 --- a/arch/powerpc/platforms/ps3/Kconfig +++ b/arch/powerpc/platforms/ps3/Kconfig @@ -121,7 +121,7 @@ config PS3_FLASH This support is required to access the PS3 FLASH ROM, which contains the boot loader and some boot options. - In general, all users will say Y or M. + In general, all PS3 OtherOS users will say Y or M. As this driver needs a fixed buffer of 256 KiB of memory, it can be disabled on the kernel command line using "ps3flash=off", to diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c index d0c57c2..fc6d867 100644 --- a/drivers/char/ps3flash.c +++ b/drivers/char/ps3flash.c @@ -25,6 +25,7 @@ #include #include +#include #define DEVICE_NAME "ps3flash" @@ -464,6 +465,12 @@ static struct ps3_system_bus_driver ps3flash = { static int __init ps3flash_init(void) { + if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) + return -ENODEV; + + if (ps3_get_ss_laid() != PS3_SS_LAID_OTHEROS) + return -ENODEV; + return ps3_system_bus_driver_register(&ps3flash); }