From patchwork Mon Sep 3 17:36:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taehun Kim X-Patchwork-Id: 1400661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 54FC23FC71 for ; Mon, 3 Sep 2012 17:41:29 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T8aaJ-0007G2-Sf; Mon, 03 Sep 2012 17:37:15 +0000 Received: from mail-pz0-f49.google.com ([209.85.210.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T8aaD-0007Fo-OI for linux-arm-kernel@lists.infradead.org; Mon, 03 Sep 2012 17:37:13 +0000 Received: by dajq27 with SMTP id q27so3906973daj.36 for ; Mon, 03 Sep 2012 10:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:content-transfer-encoding:mime-version; bh=V3+yzRrgDtlAbrsrPvd1JuH99TyxY+b2FNMOzGPp1Dc=; b=CmZ5Onw1I9KZrejx+xjCZJr/b+TUKrLWF6SeeAsb3VAmDGxOZ/rJlHZukteCxHxr4G Gv4m+pRf+7b8fADzBeCH7dLx+pgQ/olVujpTrqbQ3223ZBRZS6az4V1otg8d36jP/W1b m+1xQq4NJLe5Ya7ELa+q/OmV3E7kXckDW3pZzRHhVsZw0UqAXC+OAQ5luSeUAPBSjXpF TP06BSe+im/Y/MGNNNMHO5hJ0j9xQDpyUuvYhB5DMX9OZ1vPkNXtnUPDCjlVfDy3Xk6k 4Ym1Fq9AnOObo9M4mVuhJfEmWGYuNREhKRzKXnHUa0VAd7gNCP9qj4yblnhtH0kmVQuy Cesw== Received: by 10.68.222.167 with SMTP id qn7mr39281482pbc.98.1346693805684; Mon, 03 Sep 2012 10:36:45 -0700 (PDT) Received: from [124.63.203.47] ([124.63.203.47]) by mx.google.com with ESMTPS id qn13sm10302500pbb.71.2012.09.03.10.36.42 (version=SSLv3 cipher=OTHER); Mon, 03 Sep 2012 10:36:44 -0700 (PDT) Message-ID: <1346693799.3485.2.camel@taehun-desktop> Subject: [PATCH v2] ARM: S3C24XX: Add WIZnet W5300E01-ARM board support From: Taehun Kim To: Ben Dooks Date: Tue, 04 Sep 2012 02:36:39 +0900 In-Reply-To: <1346653236-19728-1-git-send-email-kth3321@gmail.com> References: <1346653236-19728-1-git-send-email-kth3321@gmail.com> X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kth3321[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (kth3321[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: linux-samsung-soc@vger.kernel.org, Kukjin Kim , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch adds WIZnet W5300E01 board changed to the new gpio functions. Please review this patch and apply it if do not have any problems. Signed-off-by: Taehun Kim --- arch/arm/mach-s3c24xx/Kconfig | 5 + arch/arm/mach-s3c24xx/Makefile | 1 + arch/arm/mach-s3c24xx/mach-w5300e01.c | 186 +++++++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 arch/arm/mach-s3c24xx/mach-w5300e01.c +MACHINE_END diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig index d56b0f7..94b60ca 100644 --- a/arch/arm/mach-s3c24xx/Kconfig +++ b/arch/arm/mach-s3c24xx/Kconfig @@ -248,6 +248,11 @@ config MACH_VR1000 help Say Y here if you are using the Thorcom VR1000 board. +config MACH_W5300E01 + bool "WIZnet W5300E01-ARM Board" + help + Say Y here if you are using the Wiznet W5300E01-ARM board. + endif # CPU_S3C2410 config S3C2412_PM_SLEEP diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile index 0ab6ab1..fc1a89e 100644 --- a/arch/arm/mach-s3c24xx/Makefile +++ b/arch/arm/mach-s3c24xx/Makefile @@ -61,6 +61,7 @@ obj-$(CONFIG_MACH_QT2410) += mach-qt2410.o obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o obj-$(CONFIG_MACH_TCT_HAMMER) += mach-tct_hammer.o obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o +obj-$(CONFIG_MACH_W5300E01) += mach-w5300e01.o obj-$(CONFIG_MACH_JIVE) += mach-jive.o obj-$(CONFIG_MACH_SMDK2413) += mach-smdk2413.o diff --git a/arch/arm/mach-s3c24xx/mach-w5300e01.c b/arch/arm/mach-s3c24xx/mach-w5300e01.c new file mode 100644 index 0000000..7daf82e --- /dev/null +++ b/arch/arm/mach-s3c24xx/mach-w5300e01.c @@ -0,0 +1,186 @@ +/* linux/arch/arm/mach-s3c24xx/mach-w5300e01.c + * + * Copyright (c) 2012 Taehun Kim + * + * For product information, visit http://www.wiznet.co.kr/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * @History: + * derived from linux/arch/arm/mach-s3c24xx/mach-bast.c, written by + * Ben Dooks + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct map_desc w5300e01_iodesc[] __initdata = { + /* Character LCD register map. */ + { 0xf8000000, __phys_to_pfn(S3C2410_CS3), SZ_1M, MT_DEVICE } +}; + +#define UCON S3C2410_UCON_DEFAULT +#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) +#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) + +static struct s3c2410_uartcfg w5300e01_uartcfgs[] __initdata = { + [0] = { + .hwport = 0, + .flags = 0, + .ucon = UCON, + .ulcon = ULCON, + .ufcon = UFCON, + }, + [1] = { + .hwport = 1, + .flags = 0, + .ucon = UCON, + .ulcon = ULCON, + .ufcon = UFCON, + }, + [2] = { + .hwport = 2, + .flags = 0, + .ucon = UCON, + .ulcon = ULCON, + .ufcon = UFCON, + } +}; + +static struct mtd_partition w5300e01_mtd_partitions[] = { + [0] = { + .name = "Bootloader", + .size = 0x20000, + .offset = 0, + .mask_flags = MTD_WRITEABLE, + }, + [1] = { + .name = "Boot Param", + .size = 0x20000, + .offset = MTDPART_OFS_APPEND, + }, + [2] = { + .name = "Kernel", + .size = 0x3C0000, + .offset = MTDPART_OFS_APPEND, + }, + [3] = { + .name = "Ramdisk", + .size = 0x1000000, + .offset = MTDPART_OFS_APPEND, + }, + [4] = { + .name = "JFFS2 FileSystem", + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, + }, +}; + +static struct resource w5300_resources[] = { + [0] = { + .start = S3C2410_CS2, + .end = S3C2410_CS2 + SZ_1M, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_EINT0, + .end = IRQ_EINT0, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device w5300_device = { + .name = "w5300", + .num_resources = ARRAY_SIZE(w5300_resources), + .resource = w5300_resources, +}; + +static struct s3c2410_nand_set w5300e01_nand_sets[] = { + [0] = { + .name = "W5300E01", + .nr_chips = 1, + .nr_partitions = ARRAY_SIZE(w5300e01_mtd_partitions), + .partitions = w5300e01_mtd_partitions, + }, +}; + +static struct s3c2410_platform_nand w5300e01_nand_info = { + .tacls = 20, + .twrph0 = 60, + .twrph1 = 30, + .nr_sets = ARRAY_SIZE(w5300e01_nand_sets), + .sets = w5300e01_nand_sets, +}; + +static struct platform_device *w5300e01_devices[] __initdata = { + &s3c_device_nand, + &s3c_device_usbgadget, + &s3c_device_wdt, + &s3c_device_i2c0, + &s3c_device_iis, + &w5300_device, +}; + +static void __init w5300e01_map_io(void) +{ + s3c24xx_init_io(w5300e01_iodesc, ARRAY_SIZE(w5300e01_iodesc)); + s3c24xx_init_clocks(0); + s3c24xx_init_uarts(w5300e01_uartcfgs, ARRAY_SIZE(w5300e01_uartcfgs)); +} + +static void __init w5300e01_init(void) +{ + s3c_nand_set_platdata(&w5300e01_nand_info); + platform_add_devices(w5300e01_devices, ARRAY_SIZE(w5300e01_devices)); + + /* W5300 interrupt pin. */ + s3c_gpio_cfgpin(S3C2410_GPF(0), S3C2410_GPIO_IRQ); + + s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); + s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); + s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); + s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); + + gpio_set_value(S3C2410_GPF(0), 1); + gpio_set_value(S3C2410_GPF(4), 1); + gpio_set_value(S3C2410_GPF(5), 1); + gpio_set_value(S3C2410_GPF(6), 1); + gpio_set_value(S3C2410_GPF(7), 1); + + s3c_pm_init(); +} + +MACHINE_START(W5300E01, "WIZnet W5300E01-ARM") + .atag_offset = S3C2410_SDRAM_PA + 0x100, + .map_io = w5300e01_map_io, + .init_irq = s3c24xx_init_irq, + .init_machine = w5300e01_init, + .timer = &s3c24xx_timer,