From patchwork Thu Jan 6 10:16:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 458381 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p06ACJ6X026771 for ; Thu, 6 Jan 2011 10:12:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752543Ab1AFKMa (ORCPT ); Thu, 6 Jan 2011 05:12:30 -0500 Received: from mail-pv0-f174.google.com ([74.125.83.174]:47589 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752423Ab1AFKM3 (ORCPT ); Thu, 6 Jan 2011 05:12:29 -0500 Received: by pva4 with SMTP id 4so2877824pva.19 for ; Thu, 06 Jan 2011 02:12:29 -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 :in-reply-to:references:subject; bh=Ogw/YconMEnK91VzQ/XAbtmiJg+9GUX23DXdKOwhEtA=; b=fus84gJ6ChuAFKpnQBi8MMhjdfmqRMWyN540LIGSsvKn+OblbJOxIjhzyWRcbtSBu8 uHMbMzkbxNj14gIhajm719RRwqPZhoCueqFWNgGow5LpguOPfWjWm1TVK7vQ6NHulxS9 9WSFTklMYji7pGbgoxlBpAT9ht2Z3/Rpkq3CU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=nIxKWC7U1tuwvTOEIHhNhEtu8YQp2EnW9zU/fBpW0st/biuIpd/BgP0U50EA00COpj r2WcRWTRjtDGVGNLlv94zRf1pKojTG+pQSqFug3HlOkiEX1RTH9Z6VOythQHiS4abGXx MsVPnW3F3T+MPOJJxp76HNA9xp6PaFgDjczR4= Received: by 10.142.204.8 with SMTP id b8mr632521wfg.171.1294308749076; Thu, 06 Jan 2011 02:12:29 -0800 (PST) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id q13sm895134wfc.17.2011.01.06.02.12.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Jan 2011 02:12:28 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 06 Jan 2011 19:16:41 +0900 Message-Id: <20110106101641.1617.59827.sendpatchset@t400s> In-Reply-To: <20110106101549.1617.28207.sendpatchset@t400s> References: <20110106101549.1617.28207.sendpatchset@t400s> Subject: [PATCH 06/08] sh: Convert sh7724, Ecovec, se7724 and kfr2r09 to mem_init 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.6 (demeter1.kernel.org [140.211.167.41]); Thu, 06 Jan 2011 10:12:30 +0000 (UTC) --- 0001/arch/sh/boards/mach-ecovec24/setup.c +++ work/arch/sh/boards/mach-ecovec24/setup.c 2011-01-06 16:54:22.000000000 +0900 @@ -1126,7 +1126,6 @@ static int __init arch_setup(void) gpio_request(GPIO_FN_VIO0_CLK, NULL); gpio_request(GPIO_FN_VIO0_FLD, NULL); gpio_request(GPIO_FN_VIO0_HD, NULL); - platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20); /* enable CEU1 */ gpio_request(GPIO_FN_VIO1_D7, NULL); @@ -1141,7 +1140,6 @@ static int __init arch_setup(void) gpio_request(GPIO_FN_VIO1_HD, NULL); gpio_request(GPIO_FN_VIO1_VD, NULL); gpio_request(GPIO_FN_VIO1_CLK, NULL); - platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20); /* enable KEYSC */ gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); @@ -1336,6 +1334,14 @@ static int __init devices_setup(void) } device_initcall(devices_setup); +static void __init ecovec_mem_init(void) +{ + sh7724_mem_init(); + shmobile_memchunk_setup(&ceu0_device, "ceu0", 4 << 20); + shmobile_memchunk_setup(&ceu1_device, "ceu1", 4 << 20); +} + static struct sh_machine_vector mv_ecovec __initmv = { .mv_name = "R0P7724 (EcoVec)", + .mv_mem_init = ecovec_mem_init, }; --- 0001/arch/sh/boards/mach-kfr2r09/setup.c +++ work/arch/sh/boards/mach-kfr2r09/setup.c 2011-01-06 16:54:52.000000000 +0900 @@ -611,8 +611,6 @@ static int __init kfr2r09_devices_setup( gpio_request(GPIO_FN_VIO0_D1, NULL); gpio_request(GPIO_FN_VIO0_D0, NULL); - platform_resource_setup_memory(&kfr2r09_ceu_device, "ceu", 4 << 20); - /* SDHI0 connected to yc304 */ gpio_request(GPIO_FN_SDHI0CD, NULL); gpio_request(GPIO_FN_SDHI0D3, NULL); @@ -638,10 +636,17 @@ static int kfr2r09_mode_pins(void) return MODE_PIN0 | MODE_PIN1 | MODE_PIN5 | MODE_PIN8; } +static void __init kfr2r09_mem_init(void) +{ + sh7724_mem_init(); + shmobile_memchunk_setup(&kfr2r09_ceu_device, "ceu", 4 << 20); +} + /* * The Machine Vector */ static struct sh_machine_vector mv_kfr2r09 __initmv = { .mv_name = "kfr2r09", .mv_mode_pins = kfr2r09_mode_pins, + .mv_mem_init = kfr2r09_mem_init, }; --- 0001/arch/sh/boards/mach-se/7724/setup.c +++ work/arch/sh/boards/mach-se/7724/setup.c 2011-01-06 16:54:41.000000000 +0900 @@ -796,7 +796,6 @@ static int __init devices_setup(void) gpio_request(GPIO_FN_VIO0_CLK, NULL); gpio_request(GPIO_FN_VIO0_FLD, NULL); gpio_request(GPIO_FN_VIO0_HD, NULL); - platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20); /* enable CEU1 */ gpio_request(GPIO_FN_VIO1_D7, NULL); @@ -811,7 +810,6 @@ static int __init devices_setup(void) gpio_request(GPIO_FN_VIO1_HD, NULL); gpio_request(GPIO_FN_VIO1_VD, NULL); gpio_request(GPIO_FN_VIO1_CLK, NULL); - platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20); /* KEYSC */ gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); @@ -938,8 +936,16 @@ static int __init devices_setup(void) } device_initcall(devices_setup); +static void __init ms7724se_mem_init(void) +{ + sh7724_mem_init(); + shmobile_memchunk_setup(&ceu0_device, "ceu0", 4 << 20); + shmobile_memchunk_setup(&ceu1_device, "ceu1", 4 << 20); +} + static struct sh_machine_vector mv_ms7724se __initmv = { .mv_name = "ms7724se", .mv_init_irq = init_se7724_IRQ, .mv_nr_irqs = SE7724_FPGA_IRQ_BASE + SE7724_FPGA_IRQ_NR, + .mv_mem_init = ms7724se_mem_init, }; --- 0001/arch/sh/include/cpu-sh4/cpu/sh7724.h +++ work/arch/sh/include/cpu-sh4/cpu/sh7724.h 2011-01-06 16:48:49.000000000 +0900 @@ -306,4 +306,6 @@ enum { extern struct clk sh7724_fsimcka_clk; extern struct clk sh7724_fsimckb_clk; +void sh7724_mem_init(void); + #endif /* __ASM_SH7724_H__ */ --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7724.c 2011-01-06 16:54:24.000000000 +0900 @@ -930,13 +930,6 @@ static struct platform_device *sh7724_de static int __init sh7724_devices_setup(void) { - platform_resource_setup_memory(&vpu_device, "vpu", 2 << 20); - platform_resource_setup_memory(&veu0_device, "veu0", 2 << 20); - platform_resource_setup_memory(&veu1_device, "veu1", 2 << 20); - platform_resource_setup_memory(&jpu_device, "jpu", 2 << 20); - platform_resource_setup_memory(&spu0_device, "spu0", 2 << 20); - platform_resource_setup_memory(&spu1_device, "spu1", 2 << 20); - return platform_add_devices(sh7724_devices, ARRAY_SIZE(sh7724_devices)); } @@ -964,6 +957,17 @@ void __init plat_early_device_setup(void ARRAY_SIZE(sh7724_early_devices)); } +void __init sh7724_mem_init(void) +{ + generic_mem_init(); + shmobile_memchunk_setup(&vpu_device, "vpu", 2 << 20); + shmobile_memchunk_setup(&veu0_device, "veu0", 2 << 20); + shmobile_memchunk_setup(&veu1_device, "veu1", 2 << 20); + shmobile_memchunk_setup(&jpu_device, "jpu", 2 << 20); + shmobile_memchunk_setup(&spu0_device, "spu0", 2 << 20); + shmobile_memchunk_setup(&spu1_device, "spu1", 2 << 20); +} + #define RAMCR_CACHE_L2FC 0x0002 #define RAMCR_CACHE_L2E 0x0001 #define L2_CACHE_ENABLE (RAMCR_CACHE_L2E|RAMCR_CACHE_L2FC)