From patchwork Thu May 28 11:51:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 26721 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4SBtMN8008055 for ; Thu, 28 May 2009 11:55:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754885AbZE1LzA (ORCPT ); Thu, 28 May 2009 07:55:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755441AbZE1LzA (ORCPT ); Thu, 28 May 2009 07:55:00 -0400 Received: from mail-pz0-f177.google.com ([209.85.222.177]:39074 "EHLO mail-pz0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754885AbZE1Ly7 (ORCPT ); Thu, 28 May 2009 07:54:59 -0400 Received: by pzk7 with SMTP id 7so4177033pzk.33 for ; Thu, 28 May 2009 04:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=mm93Q9dQy5pjQ/GvqaIkLmD4YzgxQcdvQYkEjxPK/bM=; b=jtaV1ekHyJ4MxW/Cw3xsH0Ft7gxW5oEXBLwDmvOCRhma/2//reRkX9ytQXVmE1LyYx v7JtcIyeFkjd/8rssP1/dXvI5OfiRker3hNb/2CKL96RVREwbnwRD+oTPQQLGAzqbcS3 nXjs1DORzXAOvfBTQ6FdlAFBgH8AWUZezTA4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=JUBbuQgZ+nwZix4VJUflOkfwnDld4qO6++UTYUUSwVgz6EAmgU+LEfmFv8LB7j43kh f9/dnvMq8hf7QTptDN8AadMUE+HRu04qDl3x6KAFLkVT4QGr774/wco0D6Boi/71HLz9 D99zdbwZOW/fRiAjqN5hfcLBQH1F3Cj6QaIiE= Received: by 10.142.237.19 with SMTP id k19mr366260wfh.31.1243511701202; Thu, 28 May 2009 04:55:01 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id 30sm2587337wfg.10.2009.05.28.04.54.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 May 2009 04:55:00 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 28 May 2009 20:51:51 +0900 Message-Id: <20090528115151.5727.58043.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: boot word / mode pin support V2 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Add mode pin support for the SuperH architecture V2. With this patch applied the board code can add their own function to export the cpu mode pin configuration. In most cases this will be a constant bitmap, but boards that allow reading this from a register can instead read out the pin state from hardware. The code warns if a pin is tested but no board specific mode pin function has been provided. Signed-off-by: Magnus Damm --- arch/sh/include/asm/machvec.h | 1 + arch/sh/include/asm/processor.h | 4 ++++ arch/sh/kernel/machvec.c | 1 + arch/sh/kernel/setup.c | 12 ++++++++++++ 4 files changed, 18 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/arch/sh/include/asm/machvec.h +++ work/arch/sh/include/asm/machvec.h 2009-05-28 15:55:02.000000000 +0900 @@ -48,6 +48,7 @@ struct sh_machine_vector { void (*mv_ioport_unmap)(void __iomem *); int (*mv_clk_init)(void); + int (*mv_mode_pins)(void); }; extern struct sh_machine_vector sh_mv; --- 0001/arch/sh/include/asm/processor.h +++ work/arch/sh/include/asm/processor.h 2009-05-28 16:00:33.000000000 +0900 @@ -94,6 +94,10 @@ extern struct pt_regs fake_swapper_regs; const char *get_cpu_subtype(struct sh_cpuinfo *c); extern const struct seq_operations cpuinfo_op; +/* processor boot mode configuration */ +int generic_mode_pins(void); +int test_mode_pin(int pin); + #ifdef CONFIG_VSYSCALL int vsyscall_init(void); #else --- 0001/arch/sh/kernel/machvec.c +++ work/arch/sh/kernel/machvec.c 2009-05-28 15:55:02.000000000 +0900 @@ -129,6 +129,7 @@ void __init sh_mv_setup(void) mv_set(ioport_map); mv_set(ioport_unmap); mv_set(irq_demux); + mv_set(mode_pins); if (!sh_mv.mv_nr_irqs) sh_mv.mv_nr_irqs = NR_IRQS; --- 0001/arch/sh/kernel/setup.c +++ work/arch/sh/kernel/setup.c 2009-05-28 16:00:35.000000000 +0900 @@ -420,6 +420,18 @@ void __init setup_arch(char **cmdline_p) #endif } +/* processor boot mode configuration */ +int generic_mode_pins(void) +{ + pr_warning("generic_mode_pins(): missing mode pin configuration\n"); + return 0; +} + +int test_mode_pin(int pin) +{ + return sh_mv.mv_mode_pins() & (1 << pin); +} + static const char *cpu_name[] = { [CPU_SH7201] = "SH7201", [CPU_SH7203] = "SH7203", [CPU_SH7263] = "SH7263",