From patchwork Sat May 12 08:07:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 158700 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BB656B700D for ; Sat, 12 May 2012 18:07:48 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577Ab2ELIHa (ORCPT ); Sat, 12 May 2012 04:07:30 -0400 Received: from shards.monkeyblade.net ([198.137.202.13]:40512 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556Ab2ELIHW (ORCPT ); Sat, 12 May 2012 04:07:22 -0400 Received: from localhost (cpe-66-108-118-54.nyc.res.rr.com [66.108.118.54]) (authenticated bits=0) by shards.monkeyblade.net (8.14.4/8.14.4) with ESMTP id q4C87IW9000586 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Sat, 12 May 2012 01:07:19 -0700 Date: Sat, 12 May 2012 04:07:18 -0400 (EDT) Message-Id: <20120512.040718.1043756785933730177.davem@davemloft.net> To: sparclinux@vger.kernel.org CC: sam@ravnborg.org Subject: [PATCH] sparc32: Add back early sun4/sun4c detection so we can warn properly. From: David Miller X-Mailer: Mew version 6.5 on Emacs 24.0.95 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (shards.monkeyblade.net [198.137.202.13]); Sat, 12 May 2012 01:07:19 -0700 (PDT) Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org We need to do the check before we try to remap the kernel using SRMMU operations. Signed-off-by: David S. Miller --- The sun4/sun4c warning should actually work now :-) This means we can almost certainly kill the checks we do later on, feel free to take care of that Sam as I'm heading to bed. arch/sparc/kernel/head_32.S | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S index ea45894..0d01798 100644 --- a/arch/sparc/kernel/head_32.S +++ b/arch/sparc/kernel/head_32.S @@ -532,6 +532,29 @@ copy_prom_done: be go_to_highmem ! this will be a nop then nop + /* Validate that we are in fact running on an + * SRMMU based cpu. + */ + set 0x4000, %g6 + cmp %g7, %g6 + bne not_a_sun4 + nop + +halt_sun4_or_sun4c: + ld [%g7 + 0x68], %o1 + set sun4c_notsup, %o0 + sub %o0, %l6, %o0 + call %o1 + nop + ba halt_me + nop + +not_a_sun4: + lda [%g0] ASI_M_MMUREGS, %g1 + andcc %g1, 1, %g0 + be halt_sun4_or_sun4c + nop + srmmu_remap: /* First, check for a viking (TI) module. */ set 0x40000000, %g2