From patchwork Mon Feb 8 11:02:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 77712 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o18B8AEV019608 for ; Mon, 8 Feb 2010 11:09:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751700Ab0BHLJe (ORCPT ); Mon, 8 Feb 2010 06:09:34 -0500 Received: from mail-gx0-f224.google.com ([209.85.217.224]:41609 "EHLO mail-gx0-f224.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221Ab0BHLJd (ORCPT ); Mon, 8 Feb 2010 06:09:33 -0500 Received: by gxk24 with SMTP id 24so483170gxk.1 for ; Mon, 08 Feb 2010 03:09:32 -0800 (PST) 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=iGpp5uvGjj5sfiGWEnQwfY34wGqqoUmumpszYTTmwfc=; b=ouXXetKsFixy+2P3unxLzdvd8+TBV86PjxFRFDVtFT0IHOT9xDWdlxAVjoJoRfPCTg mURTUzTxGPf4ZX1t0wvBbDJFmR6CUGI/TbhB5BKCFM3ZIM9un2YpDjWJuCs7c4wWX5e9 BCCTq4Tg1bZakSDNl20EMfRGwxLSrQZq2lba0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=DfqtCgPIZlH5CpyCMBnzEaxqmlowelgfOcQ8bFPRXLIQKlkIYmkZnvMaOAwzmuHR47 E6mVCn+tsgnJ9UOZ8WdMWconPThsmddQOB6p4gG4B3Y9G3FLmZufhcApkO5M/t/dP4bL rE0aQ/t31ywQFw5SLpRd3X8xU2TiBl5Scn3iQ= Received: by 10.90.11.12 with SMTP id 12mr1220617agk.18.1265627372717; Mon, 08 Feb 2010 03:09:32 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 14sm2838518gxk.10.2010.02.08.03.09.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Feb 2010 03:09:32 -0800 (PST) From: Magnus Damm To: lethal@linux-sh.org Cc: Magnus Damm , linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org Date: Mon, 08 Feb 2010 20:02:54 +0900 Message-Id: <20100208110254.6001.31943.sendpatchset@rxone.opensource.se> Subject: [PATCH] ARM: mach-shmobile: early console support using earlyprintk Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 08 Feb 2010 11:09:35 +0000 (UTC) --- 0011/arch/arm/configs/ap4evb_defconfig +++ work/arch/arm/configs/ap4evb_defconfig 2010-02-08 12:46:02.000000000 +0900 @@ -322,7 +322,7 @@ CONFIG_ALIGNMENT_TRAP=y # CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_CMDLINE="console=ttySC0,115200" +CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=sh-sci.0,115200" # CONFIG_XIP_KERNEL is not set CONFIG_KEXEC=y CONFIG_ATAGS_PROC=y --- 0011/arch/arm/configs/g3evm_defconfig +++ work/arch/arm/configs/g3evm_defconfig 2010-02-08 12:45:34.000000000 +0900 @@ -317,7 +317,7 @@ CONFIG_ALIGNMENT_TRAP=y # CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_CMDLINE="console=ttySC1,115200" +CONFIG_CMDLINE="console=ttySC1,115200 earlyprintk=sh-sci.1,115200" # CONFIG_XIP_KERNEL is not set CONFIG_KEXEC=y CONFIG_ATAGS_PROC=y --- 0011/arch/arm/configs/g4evm_defconfig +++ work/arch/arm/configs/g4evm_defconfig 2010-02-08 12:45:50.000000000 +0900 @@ -322,7 +322,7 @@ CONFIG_ALIGNMENT_TRAP=y # CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_CMDLINE="console=ttySC4,115200" +CONFIG_CMDLINE="console=ttySC4,115200 earlyprintk=sh-sci.4,115200" # CONFIG_XIP_KERNEL is not set CONFIG_KEXEC=y CONFIG_ATAGS_PROC=y --- 0004/arch/arm/mach-shmobile/Makefile +++ work/arch/arm/mach-shmobile/Makefile 2010-02-08 12:43:21.000000000 +0900 @@ -3,7 +3,7 @@ # # Common objects -obj-y := timer.o +obj-y := timer.o console.o # CPU objects obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o --- 0004/arch/arm/mach-shmobile/board-ap4evb.c +++ work/arch/arm/mach-shmobile/board-ap4evb.c 2010-02-08 12:47:07.000000000 +0900 @@ -105,9 +105,10 @@ static void __init ap4evb_map_io(void) { iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc)); - /* setup early devices and clocks here as well */ + /* setup early devices, clocks and console here as well */ sh7372_add_early_devices(); sh7367_clock_init(); /* use g3 clocks for now */ + shmobile_setup_console(); } static void __init ap4evb_init(void) --- 0002/arch/arm/mach-shmobile/board-g3evm.c +++ work/arch/arm/mach-shmobile/board-g3evm.c 2010-02-08 12:46:31.000000000 +0900 @@ -105,9 +105,10 @@ static void __init g3evm_map_io(void) { iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc)); - /* setup early devices and clocks here as well */ + /* setup early devices, clocks and console here as well */ sh7367_add_early_devices(); sh7367_clock_init(); + shmobile_setup_console(); } static void __init g3evm_init(void) --- 0003/arch/arm/mach-shmobile/board-g4evm.c +++ work/arch/arm/mach-shmobile/board-g4evm.c 2010-02-08 12:46:50.000000000 +0900 @@ -105,9 +105,10 @@ static void __init g4evm_map_io(void) { iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc)); - /* setup early devices and clocks here as well */ + /* setup early devices, clocks and console here as well */ sh7377_add_early_devices(); sh7367_clock_init(); /* use g3 clocks for now */ + shmobile_setup_console(); } static void __init g4evm_init(void) --- /dev/null +++ work/arch/arm/mach-shmobile/console.c 2010-02-08 12:47:32.000000000 +0900 @@ -0,0 +1,32 @@ +/* + * SH-Mobile Console + * + * Copyright (C) 2010 Magnus Damm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include +#include +#include +#include + +void __init shmobile_setup_console(void) +{ + parse_early_param(); + + /* Let earlyprintk output early console messages */ + early_platform_driver_probe("earlyprintk", 1, 1); +} + --- 0004/arch/arm/mach-shmobile/include/mach/common.h +++ work/arch/arm/mach-shmobile/include/mach/common.h 2010-02-08 12:47:15.000000000 +0900 @@ -2,6 +2,7 @@ #define __ARCH_MACH_COMMON_H extern struct sys_timer shmobile_timer; +extern void shmobile_setup_console(void); extern void sh7367_init_irq(void); extern void sh7367_add_early_devices(void);