From patchwork Tue May 19 13:08:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: srikanth krishnakar X-Patchwork-Id: 27396 X-Patchwork-Delegate: jwboyer@gmail.com Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id E2247B7067 for ; Tue, 19 May 2009 23:09:45 +1000 (EST) Received: by ozlabs.org (Postfix) id 732FADE475; Tue, 19 May 2009 23:09:17 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 719A0DE474 for ; Tue, 19 May 2009 23:09:17 +1000 (EST) X-Original-To: Linuxppc-dev@ozlabs.org Delivered-To: Linuxppc-dev@ozlabs.org Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.237]) by ozlabs.org (Postfix) with ESMTP id 44976DE10E for ; Tue, 19 May 2009 23:08:54 +1000 (EST) Received: by rv-out-0506.google.com with SMTP id f9so1125919rvb.1 for ; Tue, 19 May 2009 06:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=38xdryrUj37+mXsi1ampzu1JRiWyiIv97C/nsak30Qk=; b=eyV6el1bqTFpPwbDURbgsrB91/x41vcW3sFa6SAl+GM6FMiYLCTOZa32uw7xWewBHl hvLkcL7qn8/2L2CSTLDuGL5p4Gg5uo8OB9mUzKUpVl1D0RwKuXnmkSah8bR87rXctWyM mXdpsQSc8KJn2SenlKYPK+XKBdHq2pVmMA/wI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=mk4oVDT6Eykyd5dxECYY8yAIwhpvm4jODMZ42rKEaClc9pzaC54CrCMoc894NgBNFv C0SMXcA2pcr6v5o5QFnZmqbXvIzinCtYrdsOsGWHqt8T4VcEi01IPtQX6/J0lUrRGVxT m4WYTvW9RsBxdvD1wrh947DpsN03FG1kP8+pg= MIME-Version: 1.0 Received: by 10.142.213.5 with SMTP id l5mr17245wfg.147.1242738533396; Tue, 19 May 2009 06:08:53 -0700 (PDT) Date: Tue, 19 May 2009 18:38:53 +0530 Message-ID: <6213bc560905190608j73f4191fxbd94158a2b1740c0@mail.gmail.com> Subject: Initialize DBCR0 for PPC440 targets From: srikanth krishnakar To: Linuxppc-dev@ozlabs.org Cc: Linuxppc-embedded@ozlabs.org X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Hi, kernel- 2.6.29 Debug technique: KGDB The PowerPC kernel does not initialize the PPC440 DBCR0 register. This prevents the use of software breakpoints in case of internal debug mode. Looking into head_fsl_booke.S for initialization of DBCR0 is used by boot-loaders. It seems head_44x.S lacks this step of DBCR0 register initialization. So fixing this with initializing the DBCR0 register as shown below : Subject: [PATCH] powerpc: 44x: Initialize DBCR0 for targets not having bootloader The kernel does not initialize the PPC440 DBCR0 register. This prevents (among other things) the use of software breakpoints with GDB. The boot loaders probably do initialize this but few targets run without a boot loader --- arch/powerpc/kernel/head_44x.S | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) Any suggestions or comments on this ? Thanks, -Srikant diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S index a4a890a..b413bc4 100644 --- a/arch/powerpc/kernel/head_44x.S +++ b/arch/powerpc/kernel/head_44x.S @@ -240,6 +240,18 @@ skpinv: addi r4,r4,1 /* Increment */ lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ mtspr SPRN_IVPR,r4 +#if !defined(CONFIG_BDI_SWITCH) + /* + * The Abatron BDI JTAG debugger does not tolerate others + * mucking with the debug registers. + */ + lis r2,DBCR0_IDM@h + mtspr SPRN_DBCR0,r2 + isync + /* clear any residual debug events */ + li r2,-1 + mtspr SPRN_DBSR,r2 +#endif /* * This is where the main kernel code starts. */