From 7f4ba268b37f6fc8f357207b6b33bcb6ae348ea3 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 1 Apr 2013 21:20:02 -0700 Subject: [PATCH] --- yaml --- r: 373880 b: refs/heads/master c: 27d5f27e253431c98f00c34a02bb7a2ece0b3fe9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-shmobile/Kconfig | 1 + trunk/arch/arm/mach-shmobile/board-bockw.c | 38 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 7162ee6875bd..d8acf0f817f0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5e3780ba6dded2636c939549e3bea16d736859fb +refs/heads/master: 27d5f27e253431c98f00c34a02bb7a2ece0b3fe9 diff --git a/trunk/arch/arm/mach-shmobile/Kconfig b/trunk/arch/arm/mach-shmobile/Kconfig index 549e05985745..1a517e2fe449 100644 --- a/trunk/arch/arm/mach-shmobile/Kconfig +++ b/trunk/arch/arm/mach-shmobile/Kconfig @@ -133,6 +133,7 @@ config MACH_BOCKW bool "BOCK-W platform" depends on ARCH_R8A7778 select ARCH_REQUIRE_GPIOLIB + select RENESAS_INTC_IRQPIN select USE_OF config MACH_MARZEN diff --git a/trunk/arch/arm/mach-shmobile/board-bockw.c b/trunk/arch/arm/mach-shmobile/board-bockw.c index 56ab56ed5f59..38e5e50fb318 100644 --- a/trunk/arch/arm/mach-shmobile/board-bockw.c +++ b/trunk/arch/arm/mach-shmobile/board-bockw.c @@ -19,14 +19,52 @@ */ #include +#include #include +#include #include #include +static struct smsc911x_platform_config smsc911x_data = { + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, + .flags = SMSC911X_USE_32BIT, + .phy_interface = PHY_INTERFACE_MODE_MII, +}; + +static struct resource smsc911x_resources[] = { + DEFINE_RES_MEM(0x18300000, 0x1000), + DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */ +}; + +#define IRQ0MR 0x30 static void __init bockw_init(void) { + void __iomem *fpga; + r8a7778_clock_init(); + r8a7778_init_irq_extpin(1); r8a7778_add_standard_devices(); + + fpga = ioremap_nocache(0x18200000, SZ_1M); + if (fpga) { + /* + * CAUTION + * + * IRQ0/1 is cascaded interrupt from FPGA. + * it should be cared in the future + * Now, it is assuming IRQ0 was used only from SMSC. + */ + u16 val = ioread16(fpga + IRQ0MR); + val &= ~(1 << 4); /* enable SMSC911x */ + iowrite16(val, fpga + IRQ0MR); + iounmap(fpga); + + platform_device_register_resndata( + &platform_bus, "smsc911x", -1, + smsc911x_resources, ARRAY_SIZE(smsc911x_resources), + &smsc911x_data, sizeof(smsc911x_data)); + } } static const char *bockw_boards_compat_dt[] __initdata = {