From patchwork Wed Feb 18 03:57:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 440795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B81B51401DD for ; Wed, 18 Feb 2015 14:58:28 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id A01251A0C79 for ; Wed, 18 Feb 2015 14:58:28 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id D938C1A0B49 for ; Wed, 18 Feb 2015 14:58:08 +1100 (AEDT) Received: from pasglop.au.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id t1I3vVi5028817; Tue, 17 Feb 2015 21:57:51 -0600 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Wed, 18 Feb 2015 14:57:27 +1100 Message-Id: <1424231849-17973-11-git-send-email-benh@kernel.crashing.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424231849-17973-1-git-send-email-benh@kernel.crashing.org> References: <1424231849-17973-1-git-send-email-benh@kernel.crashing.org> Subject: [Skiboot] [PATCH 11/13] chiptod: Remove fallback to master CPU X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" If the chiptod is not in the device-tree, we must fail, the old OPAL mode isn't supported anymore Signed-off-by: Benjamin Herrenschmidt --- hw/chiptod.c | 36 +++--------------------------------- include/chiptod.h | 3 +-- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/hw/chiptod.c b/hw/chiptod.c index 1e3448b..804e2c8 100644 --- a/hw/chiptod.c +++ b/hw/chiptod.c @@ -732,7 +732,7 @@ static void chiptod_print_tb(void *data __unused) this_cpu()->pir, mfspr(SPR_TBRL)); } -static bool chiptod_probe(u32 master_cpu) +static bool chiptod_probe(void) { struct dt_node *np; @@ -757,36 +757,6 @@ static bool chiptod_probe(u32 master_cpu) } - /* - * If ChipTOD isn't found in the device-tree, we fallback - * based on the master CPU passed by OPAL boot since the - * FSP strips off the ChipTOD info from the HDAT when booting - * in OPAL mode :-( - */ - if (chiptod_primary < 0) { - struct cpu_thread *t = find_cpu_by_pir(master_cpu); - prlog(PR_WARNING, - "CHIPTOD: Cannot find a primary TOD in device-tree\n"); - prlog(PR_WARNING, "CHIPTOD: Falling back to Master CPU: %d\n", - master_cpu); - if (!t) { - prerror("CHIPTOD: NOT FOUND !\n"); - return false; - } - chiptod_primary = t->chip_id; - switch(proc_gen) { - case proc_gen_p7: - chiptod_type = chiptod_p7; - return true; - case proc_gen_p8: - chiptod_type = chiptod_p8; - return true; - default: - break; - } - prerror("CHIPTOD: Unknown fallback CPU type !\n"); - return false; - } if (chiptod_type == chiptod_unknown) { prerror("CHIPTOD: Unknown TOD type !\n"); return false; @@ -795,7 +765,7 @@ static bool chiptod_probe(u32 master_cpu) return true; } -void chiptod_init(u32 master_cpu) +void chiptod_init(void) { struct cpu_thread *cpu0, *cpu; bool sres; @@ -806,7 +776,7 @@ void chiptod_init(u32 master_cpu) op_display(OP_LOG, OP_MOD_CHIPTOD, 0); - if (!chiptod_probe(master_cpu)) { + if (!chiptod_probe()) { prerror("CHIPTOD: Failed ChipTOD detection !\n"); op_display(OP_FATAL, OP_MOD_CHIPTOD, 0); abort(); diff --git a/include/chiptod.h b/include/chiptod.h index 2117fa8..e0490b6 100644 --- a/include/chiptod.h +++ b/include/chiptod.h @@ -21,8 +21,7 @@ * time base across the fabric. */ -extern void chiptod_init(u32 master_cpu); - +extern void chiptod_init(void); extern bool chiptod_wakeup_resync(void); extern int chiptod_recover_tb_errors(void);