* [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W
@ 2013-03-22 7:13 Kuninori Morimoto
2013-03-22 7:14 ` [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() Kuninori Morimoto
` (4 more replies)
0 siblings, 5 replies; 26+ messages in thread
From: Kuninori Morimoto @ 2013-03-22 7:13 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd, Simon, Magnus
These patch set add extpin support on r8a7778,
and enable SMSC ether on Bock-W board
This patch set is based on simon/next + my previous Bock-W patch set
Kuninori Morimoto (3):
ARM: shmobile: define PLATFORM_xxx_INFO()
ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin()
ARM: shmobile: bockw: add SMSC ethernet support
arch/arm/boot/dts/r8a7778-bockw.dts | 2 +-
arch/arm/configs/bockw_defconfig | 34 ++++++++-
arch/arm/mach-shmobile/Kconfig | 1 +
arch/arm/mach-shmobile/board-bockw.c | 37 ++++++++++
arch/arm/mach-shmobile/include/mach/common.h | 20 ++++++
arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 +
arch/arm/mach-shmobile/setup-r8a7778.c | 92 +++++++++++++++++--------
7 files changed, 156 insertions(+), 31 deletions(-)
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 26+ messages in thread* [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() 2013-03-22 7:13 [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto @ 2013-03-22 7:14 ` Kuninori Morimoto 2013-03-29 8:37 ` Magnus Damm 2013-03-22 7:14 ` [RFC][PATCH 2/3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto ` (3 subsequent siblings) 4 siblings, 1 reply; 26+ messages in thread From: Kuninori Morimoto @ 2013-03-22 7:14 UTC (permalink / raw) To: linux-arm-kernel platform_device_register_xxx() are needed until DT supports of all drivers are completed. This PLATFORM_xxx_INFO() macro is useful for it and is possible to reduce code. This patch put it ot common.h Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- arch/arm/mach-shmobile/include/mach/common.h | 20 +++++++++++ arch/arm/mach-shmobile/setup-r8a7778.c | 48 +++++++++++--------------- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index 03f73de..6a066a3 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h @@ -94,4 +94,24 @@ static inline void __init shmobile_init_late(void) shmobile_cpuidle_init(); } +#define PLATFORM_FULL_INFO(n, i, m) \ +{ \ + .parent = &platform_bus, \ + .name = n, \ + .id = i, \ + .res = m ## _resources, \ + .num_res = ARRAY_SIZE(m ##_resources), \ + .data = &m ##_platform_data, \ + .size_data = sizeof(m ## _platform_data), \ +} + +#define PLATFORM_DATA_INFO(n, i, m) \ +{ \ + .parent = &platform_bus, \ + .name = n, \ + .id = i, \ + .data = &m ##_platform_data, \ + .size_data = sizeof(m ## _platform_data), \ +} + #endif /* __ARCH_MACH_COMMON_H */ diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 01c62be..45a1a53 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -44,14 +44,18 @@ .irqs = SCIx_IRQ_MUXED(irq), \ } -static struct plat_sci_port scif_platform_data[] = { - SCIF_INFO(0xffe40000, gic_iid(0x66)), - SCIF_INFO(0xffe41000, gic_iid(0x67)), - SCIF_INFO(0xffe42000, gic_iid(0x68)), - SCIF_INFO(0xffe43000, gic_iid(0x69)), - SCIF_INFO(0xffe44000, gic_iid(0x6a)), - SCIF_INFO(0xffe45000, gic_iid(0x6b)), -}; +static struct plat_sci_port scif0_platform_data + SCIF_INFO(0xffe40000, gic_iid(0x66)); +static struct plat_sci_port scif1_platform_data + SCIF_INFO(0xffe41000, gic_iid(0x67)); +static struct plat_sci_port scif2_platform_data + SCIF_INFO(0xffe42000, gic_iid(0x68)); +static struct plat_sci_port scif3_platform_data + SCIF_INFO(0xffe43000, gic_iid(0x69)); +static struct plat_sci_port scif4_platform_data + SCIF_INFO(0xffe44000, gic_iid(0x6a)); +static struct plat_sci_port scif5_platform_data + SCIF_INFO(0xffe45000, gic_iid(0x6b)); /* TMU */ static struct resource sh_tmu0_resources[] = { @@ -78,20 +82,15 @@ static struct sh_timer_config sh_tmu1_platform_data = { .clocksource_rating = 200, }; -#define PLATFORM_INFO(n, i) \ -{ \ - .parent = &platform_bus, \ - .name = #n, \ - .id = i, \ - .res = n ## i ## _resources, \ - .num_res = ARRAY_SIZE(n ## i ##_resources), \ - .data = &n ## i ##_platform_data, \ - .size_data = sizeof(n ## i ## _platform_data), \ -} - -struct platform_device_info platform_devinfo[] = { - PLATFORM_INFO(sh_tmu, 0), - PLATFORM_INFO(sh_tmu, 1), +static struct platform_device_info platform_devinfo[] = { + PLATFORM_DATA_INFO("sh-sci", 0, scif0), + PLATFORM_DATA_INFO("sh-sci", 1, scif1), + PLATFORM_DATA_INFO("sh-sci", 2, scif2), + PLATFORM_DATA_INFO("sh-sci", 3, scif3), + PLATFORM_DATA_INFO("sh-sci", 4, scif4), + PLATFORM_DATA_INFO("sh-sci", 5, scif5), + PLATFORM_FULL_INFO("sh_tmu", 0, sh_tmu0), + PLATFORM_FULL_INFO("sh_tmu", 1, sh_tmu1), }; void __init r8a7778_add_standard_devices(void) @@ -109,11 +108,6 @@ void __init r8a7778_add_standard_devices(void) } #endif - for (i = 0; i < ARRAY_SIZE(scif_platform_data); i++) - platform_device_register_data(&platform_bus, "sh-sci", i, - &scif_platform_data[i], - sizeof(struct plat_sci_port)); - for (i = 0; i < ARRAY_SIZE(platform_devinfo); i++) platform_device_register_full(&platform_devinfo[i]); } -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() 2013-03-22 7:14 ` [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() Kuninori Morimoto @ 2013-03-29 8:37 ` Magnus Damm 2013-04-01 0:41 ` Kuninori Morimoto 0 siblings, 1 reply; 26+ messages in thread From: Magnus Damm @ 2013-03-29 8:37 UTC (permalink / raw) To: linux-arm-kernel Hi Morimoto-san, Thanks for your patch. Good to see that you're adding support for external IRQs and the SMSC chip. I would like to merge the actual hardware support code right away, but it I have some comments on this patch and I believe you will have to rework patches and resend. Please see below for more information. On Fri, Mar 22, 2013 at 4:14 PM, Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote: > platform_device_register_xxx() are needed until > DT supports of all drivers are completed. > This PLATFORM_xxx_INFO() macro is useful for it > and is possible to reduce code. > This patch put it ot common.h > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > --- > arch/arm/mach-shmobile/include/mach/common.h | 20 +++++++++++ > arch/arm/mach-shmobile/setup-r8a7778.c | 48 +++++++++++--------------- > 2 files changed, 41 insertions(+), 27 deletions(-) Uhm, there is a certain contradiction between your change log message and the diffstat. =) This patch is actually adding lines of code instead of saving lines, no? > diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h > index 03f73de..6a066a3 100644 > --- a/arch/arm/mach-shmobile/include/mach/common.h > +++ b/arch/arm/mach-shmobile/include/mach/common.h > @@ -94,4 +94,24 @@ static inline void __init shmobile_init_late(void) > shmobile_cpuidle_init(); > } > > +#define PLATFORM_FULL_INFO(n, i, m) \ > +{ \ > + .parent = &platform_bus, \ > + .name = n, \ > + .id = i, \ > + .res = m ## _resources, \ > + .num_res = ARRAY_SIZE(m ##_resources), \ > + .data = &m ##_platform_data, \ > + .size_data = sizeof(m ## _platform_data), \ > +} > + > +#define PLATFORM_DATA_INFO(n, i, m) \ > +{ \ > + .parent = &platform_bus, \ > + .name = n, \ > + .id = i, \ > + .data = &m ##_platform_data, \ > + .size_data = sizeof(m ## _platform_data), \ > +} Thanks for trying to improve the situation, but I must confess that I don't like this. Basically, if you want to improve something related to platform device registration then this must to happen on a higher level like for instance modifying the generic platform device registration code base. So making this optimization in mach-shmobile/include/mach/common.h will just lead to mach-shmobile including special non-standard code that becomes difficult to read for people. There is no point in being special. > #endif /* __ARCH_MACH_COMMON_H */ > diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c > index 01c62be..45a1a53 100644 > --- a/arch/arm/mach-shmobile/setup-r8a7778.c > +++ b/arch/arm/mach-shmobile/setup-r8a7778.c > @@ -44,14 +44,18 @@ > .irqs = SCIx_IRQ_MUXED(irq), \ > } > > -static struct plat_sci_port scif_platform_data[] = { > - SCIF_INFO(0xffe40000, gic_iid(0x66)), > - SCIF_INFO(0xffe41000, gic_iid(0x67)), > - SCIF_INFO(0xffe42000, gic_iid(0x68)), > - SCIF_INFO(0xffe43000, gic_iid(0x69)), > - SCIF_INFO(0xffe44000, gic_iid(0x6a)), > - SCIF_INFO(0xffe45000, gic_iid(0x6b)), > -}; > +static struct plat_sci_port scif0_platform_data > + SCIF_INFO(0xffe40000, gic_iid(0x66)); > +static struct plat_sci_port scif1_platform_data > + SCIF_INFO(0xffe41000, gic_iid(0x67)); > +static struct plat_sci_port scif2_platform_data > + SCIF_INFO(0xffe42000, gic_iid(0x68)); > +static struct plat_sci_port scif3_platform_data > + SCIF_INFO(0xffe43000, gic_iid(0x69)); > +static struct plat_sci_port scif4_platform_data > + SCIF_INFO(0xffe44000, gic_iid(0x6a)); > +static struct plat_sci_port scif5_platform_data > + SCIF_INFO(0xffe45000, gic_iid(0x6b)); As you notice, these lines above increase the number of lines of code in this file. I prefer first of all being standard, and after that going the other direction to asmaller code base. =) > - for (i = 0; i < ARRAY_SIZE(scif_platform_data); i++) > - platform_device_register_data(&platform_bus, "sh-sci", i, > - &scif_platform_data[i], > - sizeof(struct plat_sci_port)); > - > for (i = 0; i < ARRAY_SIZE(platform_devinfo); i++) > platform_device_register_full(&platform_devinfo[i]); Why do you want to use platform_device_register_full() for all cases when you instead can use different functions case-by-case? For instance, you can use platform_device_register_simple() or platform_device_register_data() or platform_device_register_resndata() depending on what kind of device you are registering. So please drop the special macros introduced by this patch. Next time please consider submitting patches in a different order. I would prefer the following: [PATCH 01/03] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() [PATCH 02/03] ARM: shmobile: bockw: add SMSC ethernet support [PATCH 03/03] ARM: shmobile: define PLATFORM_xxx_INFO() If you put the cleanup patch as final portion it is easy to compare saved number of lines. Also, if we disagree about your macro then it is easy to only merge 1 and 2. So because of the existing patch order in this series I am afraid I will have to ask you to resend patch 2/3 and 3/3 without using special macros like PLATFORM_xxxx_INFO(). Thanks for your help! / magnus ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() 2013-03-29 8:37 ` Magnus Damm @ 2013-04-01 0:41 ` Kuninori Morimoto 0 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-01 0:41 UTC (permalink / raw) To: linux-arm-kernel Hi Magnus Thank you for your review > Thanks for your patch. Good to see that you're adding support for > external IRQs and the SMSC chip. I would like to merge the actual > hardware support code right away, but it I have some comments on this > patch and I believe you will have to rework patches and resend. Please > see below for more information. I see. I re-send v2 patches Best regards --- Kuninori Morimoto ^ permalink raw reply [flat|nested] 26+ messages in thread
* [RFC][PATCH 2/3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() 2013-03-22 7:13 [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto 2013-03-22 7:14 ` [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() Kuninori Morimoto @ 2013-03-22 7:14 ` Kuninori Morimoto 2013-03-22 7:15 ` [RFC][PATCH 3/3] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto ` (2 subsequent siblings) 4 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-03-22 7:14 UTC (permalink / raw) To: linux-arm-kernel This patch adds r8a7778_init_irq_extpin() for IRQ0 - IRQ3. But this patch doesn't enable DT settings on r8a7778.dts, because R8A7778 chip external IRQ depends on IRQ0 - IRQ3 pin encoding which came from platform board implementation. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 + arch/arm/mach-shmobile/setup-r8a7778.c | 44 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index a755dca..e0c6205 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h @@ -24,5 +24,6 @@ extern void r8a7778_init_delay(void); extern void r8a7778_init_irq(void); extern void r8a7778_init_irq_dt(void); extern void r8a7778_clock_init(void); +extern void r8a7778_init_irq_extpin(int irlm); #endif /* __ASM_R8A7778_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 45a1a53..7d8bcaf 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -23,6 +23,7 @@ #include <linux/irqchip/arm-gic.h> #include <linux/of.h> #include <linux/of_platform.h> +#include <linux/platform_data/irq-renesas-intc-irqpin.h> #include <linux/platform_device.h> #include <linux/irqchip.h> #include <linux/serial_sci.h> @@ -112,6 +113,49 @@ void __init r8a7778_add_standard_devices(void) platform_device_register_full(&platform_devinfo[i]); } +static struct renesas_intc_irqpin_config irqpin_platform_data = { + .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ + .sense_bitfield_width = 2, +}; + +static struct resource irqpin_resources[] = { + DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */ + DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */ + DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */ + DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */ + DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */ + DEFINE_RES_IRQ(gic_iid(0x3b)), /* IRQ0 */ + DEFINE_RES_IRQ(gic_iid(0x3c)), /* IRQ1 */ + DEFINE_RES_IRQ(gic_iid(0x3d)), /* IRQ2 */ + DEFINE_RES_IRQ(gic_iid(0x3e)), /* IRQ3 */ +}; + +static struct platform_device_info intc_devinfo + PLATFORM_FULL_INFO("renesas_intc_irqpin", -1, irqpin); + +void __init r8a7778_init_irq_extpin(int irlm) +{ + void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE); + unsigned long tmp; + + if (!icr0) { + pr_warn("r8a7778: unable to setup external irq pin mode\n"); + return; + } + + tmp = ioread32(icr0); + if (irlm) + tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */ + else + tmp &= ~(1 << 23); /* IRL mode - not supported */ + tmp |= (1 << 21); /* LVLMODE = 1 */ + iowrite32(tmp, icr0); + iounmap(icr0); + + if (irlm) + platform_device_register_full(&intc_devinfo); +} + #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ #define INT2SMSKCR1 0x8228c /* 0xfe78228c */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [RFC][PATCH 3/3] ARM: shmobile: bockw: add SMSC ethernet support 2013-03-22 7:13 [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto 2013-03-22 7:14 ` [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() Kuninori Morimoto 2013-03-22 7:14 ` [RFC][PATCH 2/3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto @ 2013-03-22 7:15 ` Kuninori Morimoto 2013-03-27 5:34 ` [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Simon Horman 2013-04-01 2:25 ` [PATCH 0/3 v2] " Kuninori Morimoto 4 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-03-22 7:15 UTC (permalink / raw) To: linux-arm-kernel This patch adds SMSC ethernet support on Bock-W Bock-W SMSC needs FPGA settings which enables interrupt. This patch does it on bockw_init() function. As notes for future, this FPGA settings should be updated in the future, since this FPGA is using cascaded interrupt. Current code is assuming that this FPGA interrupt user is only SMSC Becouse of these background, this patch doesn't have DT settings Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- arch/arm/boot/dts/r8a7778-bockw.dts | 2 +- arch/arm/configs/bockw_defconfig | 34 ++++++++++++++++++++++++++++--- arch/arm/mach-shmobile/Kconfig | 1 + arch/arm/mach-shmobile/board-bockw.c | 37 ++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/r8a7778-bockw.dts b/arch/arm/boot/dts/r8a7778-bockw.dts index 735c964..0076b1e 100644 --- a/arch/arm/boot/dts/r8a7778-bockw.dts +++ b/arch/arm/boot/dts/r8a7778-bockw.dts @@ -22,7 +22,7 @@ compatible = "renesas,bockw", "renesas,r8a7778"; chosen { - bootargs = "console=ttySC0,115200 ignore_loglevel"; + bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs"; }; memory { diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig index 6037705..6524cdf 100644 --- a/arch/arm/configs/bockw_defconfig +++ b/arch/arm/configs/bockw_defconfig @@ -27,16 +27,40 @@ CONFIG_HIGHMEM=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_ARM_APPENDED_DTB=y -CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel" +CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp" CONFIG_CMDLINE_FORCE=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_SUSPEND is not set +CONFIG_NET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_IPV6 is not set CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y # CONFIG_STANDALONE is not set # CONFIG_PREVENT_FIRMWARE_BUILD is not set # CONFIG_FW_LOADER is not set +CONFIG_NETDEVICES=y +# CONFIG_NET_CADENCE is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_SEEQ is not set +CONFIG_SMSC911X=y +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_WIZNET is not set # CONFIG_INPUT is not set # CONFIG_SERIO is not set # CONFIG_VT is not set @@ -55,12 +79,16 @@ CONFIG_UIO_PDRV_GENIRQ=y # CONFIG_INOTIFY_USER is not set CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_SWAP=y +CONFIG_NFS_V4_1=y +CONFIG_ROOT_NFS=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set # CONFIG_SCHED_DEBUG is not set # CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FTRACE is not set # CONFIG_ARM_UNWIND is not set -CONFIG_KEYS=y -CONFIG_CRYPTO=y CONFIG_AVERAGE=y diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index e5cd4d8..bbf23bc 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -108,6 +108,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/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index 56ab56e..67a89af 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c @@ -19,14 +19,51 @@ */ #include <linux/platform_device.h> +#include <linux/smsc911x.h> #include <mach/common.h> +#include <mach/irqs.h> #include <mach/r8a7778.h> #include <asm/mach/arch.h> +static struct smsc911x_platform_config smsc911x_platform_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 */ +}; + +static struct platform_device_info smsc911x_devinfo + PLATFORM_FULL_INFO("smsc911x", -1, smsc911x); + +#define IRQ0MR 0x30 static void __init bockw_init(void) { + void __iomem *fpga = ioremap_nocache(0x18200000, SZ_1M); + r8a7778_clock_init(); + r8a7778_init_irq_extpin(1); r8a7778_add_standard_devices(); + + 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); + + platform_device_register_full(&smsc911x_devinfo); + iounmap(fpga); + } } static const char *bockw_boards_compat_dt[] __initdata = { -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W 2013-03-22 7:13 [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto ` (2 preceding siblings ...) 2013-03-22 7:15 ` [RFC][PATCH 3/3] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto @ 2013-03-27 5:34 ` Simon Horman 2013-04-01 2:25 ` [PATCH 0/3 v2] " Kuninori Morimoto 4 siblings, 0 replies; 26+ messages in thread From: Simon Horman @ 2013-03-27 5:34 UTC (permalink / raw) To: linux-arm-kernel On Fri, Mar 22, 2013 at 12:13:31AM -0700, Kuninori Morimoto wrote: > > Hi Arnd, Simon, Magnus > > These patch set add extpin support on r8a7778, > and enable SMSC ether on Bock-W board > > This patch set is based on simon/next + my previous Bock-W patch set Which Magnus has Acked and I will queue up for v3.10. > Kuninori Morimoto (3): > ARM: shmobile: define PLATFORM_xxx_INFO() > ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() > ARM: shmobile: bockw: add SMSC ethernet support Magnus, I think these are the only outstanding Bock-W patches that are awaiting your review. I have looked over them and don't have any objections at this stage. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 0/3 v2] ARM: shmobile: Add SMSC support on Bock-W 2013-03-22 7:13 [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto ` (3 preceding siblings ...) 2013-03-27 5:34 ` [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Simon Horman @ 2013-04-01 2:25 ` Kuninori Morimoto 2013-04-01 2:26 ` [PATCH 1/3 v2] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto ` (3 more replies) 4 siblings, 4 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-01 2:25 UTC (permalink / raw) To: linux-arm-kernel Hi Arnd, Simon, Magnus These patches are v2 of extpin support on r8a7778, and enable SMSC ether support on Bock-W board This patch set is based latest simon/next Kuninori Morimoto (3): ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() ARM: shmobile: bockw: add SMSC ethernet support arch/arm/boot/dts/r8a7778-bockw.dts | 2 +- arch/arm/configs/bockw_defconfig | 34 ++++++++++-- arch/arm/mach-shmobile/Kconfig | 1 + arch/arm/mach-shmobile/board-bockw.c | 38 ++++++++++++++ arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 + arch/arm/mach-shmobile/setup-r8a7778.c | 70 +++++++++++++++++++------ 6 files changed, 125 insertions(+), 21 deletions(-) Best regards --- Kuninori Morimoto ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 1/3 v2] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() 2013-04-01 2:25 ` [PATCH 0/3 v2] " Kuninori Morimoto @ 2013-04-01 2:26 ` Kuninori Morimoto 2013-04-01 2:27 ` [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto ` (2 subsequent siblings) 3 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-01 2:26 UTC (permalink / raw) To: linux-arm-kernel remove pointless PLATFORM_INFO() macro from setup-r8a7778, and, used original platform_device_register_xxx() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v1 -> v2 - removed PLATFORM_INFO() arch/arm/mach-shmobile/setup-r8a7778.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 01c62be..57d6b0e 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -78,21 +78,13 @@ static struct sh_timer_config sh_tmu1_platform_data = { .clocksource_rating = 200, }; -#define PLATFORM_INFO(n, i) \ -{ \ - .parent = &platform_bus, \ - .name = #n, \ - .id = i, \ - .res = n ## i ## _resources, \ - .num_res = ARRAY_SIZE(n ## i ##_resources), \ - .data = &n ## i ##_platform_data, \ - .size_data = sizeof(n ## i ## _platform_data), \ -} - -struct platform_device_info platform_devinfo[] = { - PLATFORM_INFO(sh_tmu, 0), - PLATFORM_INFO(sh_tmu, 1), -}; +#define r8a7778_register_tmu(idx) \ + platform_device_register_resndata( \ + &platform_bus, "sh_tmu", idx, \ + sh_tmu##idx##_resources, \ + ARRAY_SIZE(sh_tmu##idx##_resources), \ + &sh_tmu##idx##_platform_data, \ + sizeof(sh_tmu##idx##_platform_data)) void __init r8a7778_add_standard_devices(void) { @@ -114,8 +106,8 @@ void __init r8a7778_add_standard_devices(void) &scif_platform_data[i], sizeof(struct plat_sci_port)); - for (i = 0; i < ARRAY_SIZE(platform_devinfo); i++) - platform_device_register_full(&platform_devinfo[i]); + r8a7778_register_tmu(0); + r8a7778_register_tmu(1); } #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() 2013-04-01 2:25 ` [PATCH 0/3 v2] " Kuninori Morimoto 2013-04-01 2:26 ` [PATCH 1/3 v2] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto @ 2013-04-01 2:27 ` Kuninori Morimoto 2013-04-01 12:44 ` Sergei Shtylyov 2013-04-01 2:27 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto 3 siblings, 1 reply; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-01 2:27 UTC (permalink / raw) To: linux-arm-kernel This patch adds r8a7778_init_irq_extpin() for IRQ0 - IRQ3. But this patch doesn't enable DT settings on r8a7778.dts, because R8A7778 chip external IRQ depends on IRQ0 - IRQ3 pin encoding which came from platform board implementation. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v1 -> v2 - not based on PLATFORM_INFO() arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 + arch/arm/mach-shmobile/setup-r8a7778.c | 44 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index a755dca..e0c6205 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h @@ -24,5 +24,6 @@ extern void r8a7778_init_delay(void); extern void r8a7778_init_irq(void); extern void r8a7778_init_irq_dt(void); extern void r8a7778_clock_init(void); +extern void r8a7778_init_irq_extpin(int irlm); #endif /* __ASM_R8A7778_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 57d6b0e..2882305 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -23,6 +23,7 @@ #include <linux/irqchip/arm-gic.h> #include <linux/of.h> #include <linux/of_platform.h> +#include <linux/platform_data/irq-renesas-intc-irqpin.h> #include <linux/platform_device.h> #include <linux/irqchip.h> #include <linux/serial_sci.h> @@ -110,6 +111,49 @@ void __init r8a7778_add_standard_devices(void) r8a7778_register_tmu(1); } +static struct renesas_intc_irqpin_config irqpin_platform_data = { + .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ + .sense_bitfield_width = 2, +}; + +static struct resource irqpin_resources[] = { + DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */ + DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */ + DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */ + DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */ + DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */ + DEFINE_RES_IRQ(gic_iid(0x3b)), /* IRQ0 */ + DEFINE_RES_IRQ(gic_iid(0x3c)), /* IRQ1 */ + DEFINE_RES_IRQ(gic_iid(0x3d)), /* IRQ2 */ + DEFINE_RES_IRQ(gic_iid(0x3e)), /* IRQ3 */ +}; + +void __init r8a7778_init_irq_extpin(int irlm) +{ + void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE); + unsigned long tmp; + + if (!icr0) { + pr_warn("r8a7778: unable to setup external irq pin mode\n"); + return; + } + + tmp = ioread32(icr0); + if (irlm) + tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */ + else + tmp &= ~(1 << 23); /* IRL mode - not supported */ + tmp |= (1 << 21); /* LVLMODE = 1 */ + iowrite32(tmp, icr0); + iounmap(icr0); + + if (irlm) + platform_device_register_resndata( + &platform_bus, "renesas_intc_irqpin", -1, + irqpin_resources, ARRAY_SIZE(irqpin_resources), + &irqpin_platform_data, sizeof(irqpin_platform_data)); +} + #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ #define INT2SMSKCR1 0x8228c /* 0xfe78228c */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() 2013-04-01 2:27 ` [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto @ 2013-04-01 12:44 ` Sergei Shtylyov 2013-04-02 0:11 ` Kuninori Morimoto 0 siblings, 1 reply; 26+ messages in thread From: Sergei Shtylyov @ 2013-04-01 12:44 UTC (permalink / raw) To: linux-arm-kernel Hello. On 01-04-2013 6:27, Kuninori Morimoto wrote: > This patch adds r8a7778_init_irq_extpin() for IRQ0 - IRQ3. > But this patch doesn't enable DT settings on r8a7778.dts, > because R8A7778 chip external IRQ depends on > IRQ0 - IRQ3 pin encoding which came from platform board > implementation. > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> [...] > diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c > index 57d6b0e..2882305 100644 > --- a/arch/arm/mach-shmobile/setup-r8a7778.c > +++ b/arch/arm/mach-shmobile/setup-r8a7778.c [...] > @@ -110,6 +111,49 @@ void __init r8a7778_add_standard_devices(void) > r8a7778_register_tmu(1); > } > > +static struct renesas_intc_irqpin_config irqpin_platform_data = { > + .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ > + .sense_bitfield_width = 2, > +}; > + > +static struct resource irqpin_resources[] = { > + DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */ > + DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */ > + DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */ > + DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */ > + DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */ Hm, why this can't be passed as a single large memory resource? > + DEFINE_RES_IRQ(gic_iid(0x3b)), /* IRQ0 */ > + DEFINE_RES_IRQ(gic_iid(0x3c)), /* IRQ1 */ > + DEFINE_RES_IRQ(gic_iid(0x3d)), /* IRQ2 */ > + DEFINE_RES_IRQ(gic_iid(0x3e)), /* IRQ3 */ > +}; > + > +void __init r8a7778_init_irq_extpin(int irlm) > +{ > + void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE); 4 bytes seems enough. > + unsigned long tmp; > + > + if (!icr0) { > + pr_warn("r8a7778: unable to setup external irq pin mode\n"); > + return; > + } > + > + tmp = ioread32(icr0); > + if (irlm) > + tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */ > + else > + tmp &= ~(1 << 23); /* IRL mode - not supported */ > + tmp |= (1 << 21); /* LVLMODE = 1 */ () not needed here. WBR, Sergei ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() 2013-04-01 12:44 ` Sergei Shtylyov @ 2013-04-02 0:11 ` Kuninori Morimoto 0 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 0:11 UTC (permalink / raw) To: linux-arm-kernel Hi Sergei > > +static struct resource irqpin_resources[] = { > > + DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */ > > + DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */ > > + DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */ > > + DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */ > > + DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */ > > Hm, why this can't be passed as a single large memory resource? see ${LINUX}/drivers/irqchip/irq-renesas-intc-irqpin.c :: intc_irqpin_probe() Best regards --- Kuninori Morimoto ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support 2013-04-01 2:25 ` [PATCH 0/3 v2] " Kuninori Morimoto 2013-04-01 2:26 ` [PATCH 1/3 v2] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto 2013-04-01 2:27 ` [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto @ 2013-04-01 2:27 ` Kuninori Morimoto 2013-04-01 12:50 ` Sergei Shtylyov 2013-04-10 9:33 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add pinctrl support Kuninori Morimoto 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto 3 siblings, 2 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-01 2:27 UTC (permalink / raw) To: linux-arm-kernel This patch adds SMSC ethernet support on Bock-W Bock-W SMSC needs FPGA settings which enables interrupt. This patch does it on bockw_init() function. As notes for future, this FPGA settings should be updated, since this FPGA is using cascaded interrupt. Current code is assuming that this FPGA interrupt user is only SMSC. Becouse of these background, this patch doesn't have DT settings Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v1 -> v2 - not based on PLATFORM_INFO() arch/arm/boot/dts/r8a7778-bockw.dts | 2 +- arch/arm/configs/bockw_defconfig | 34 +++++++++++++++++++++++++++--- arch/arm/mach-shmobile/Kconfig | 1 + arch/arm/mach-shmobile/board-bockw.c | 38 ++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/r8a7778-bockw.dts b/arch/arm/boot/dts/r8a7778-bockw.dts index 735c964..0076b1e 100644 --- a/arch/arm/boot/dts/r8a7778-bockw.dts +++ b/arch/arm/boot/dts/r8a7778-bockw.dts @@ -22,7 +22,7 @@ compatible = "renesas,bockw", "renesas,r8a7778"; chosen { - bootargs = "console=ttySC0,115200 ignore_loglevel"; + bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs"; }; memory { diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig index 6037705..6524cdf 100644 --- a/arch/arm/configs/bockw_defconfig +++ b/arch/arm/configs/bockw_defconfig @@ -27,16 +27,40 @@ CONFIG_HIGHMEM=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_ARM_APPENDED_DTB=y -CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel" +CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp" CONFIG_CMDLINE_FORCE=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_SUSPEND is not set +CONFIG_NET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_IPV6 is not set CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y # CONFIG_STANDALONE is not set # CONFIG_PREVENT_FIRMWARE_BUILD is not set # CONFIG_FW_LOADER is not set +CONFIG_NETDEVICES=y +# CONFIG_NET_CADENCE is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_SEEQ is not set +CONFIG_SMSC911X=y +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_WIZNET is not set # CONFIG_INPUT is not set # CONFIG_SERIO is not set # CONFIG_VT is not set @@ -55,12 +79,16 @@ CONFIG_UIO_PDRV_GENIRQ=y # CONFIG_INOTIFY_USER is not set CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_SWAP=y +CONFIG_NFS_V4_1=y +CONFIG_ROOT_NFS=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set # CONFIG_SCHED_DEBUG is not set # CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FTRACE is not set # CONFIG_ARM_UNWIND is not set -CONFIG_KEYS=y -CONFIG_CRYPTO=y CONFIG_AVERAGE=y diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 9125e14..b2219bd 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -119,6 +119,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/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index 56ab56e..38e5e50 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c @@ -19,14 +19,52 @@ */ #include <linux/platform_device.h> +#include <linux/smsc911x.h> #include <mach/common.h> +#include <mach/irqs.h> #include <mach/r8a7778.h> #include <asm/mach/arch.h> +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 = { -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support 2013-04-01 2:27 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto @ 2013-04-01 12:50 ` Sergei Shtylyov 2013-04-02 0:13 ` Kuninori Morimoto 2013-04-10 9:33 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add pinctrl support Kuninori Morimoto 1 sibling, 1 reply; 26+ messages in thread From: Sergei Shtylyov @ 2013-04-01 12:50 UTC (permalink / raw) To: linux-arm-kernel Hello. On 01-04-2013 6:27, Kuninori Morimoto wrote: > This patch adds SMSC ethernet support on Bock-W > Bock-W SMSC needs FPGA settings which enables interrupt. > This patch does it on bockw_init() function. > As notes for future, this FPGA settings should be updated, > since this FPGA is using cascaded interrupt. > Current code is assuming that this FPGA interrupt user is only SMSC. > Becouse of these background, this patch doesn't > have DT settings > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > --- > v1 -> v2 > - not based on PLATFORM_INFO() > arch/arm/boot/dts/r8a7778-bockw.dts | 2 +- > arch/arm/configs/bockw_defconfig | 34 +++++++++++++++++++++++++++--- > arch/arm/mach-shmobile/Kconfig | 1 + > arch/arm/mach-shmobile/board-bockw.c | 38 ++++++++++++++++++++++++++++++++++ > 4 files changed, 71 insertions(+), 4 deletions(-) > diff --git a/arch/arm/boot/dts/r8a7778-bockw.dts b/arch/arm/boot/dts/r8a7778-bockw.dts > index 735c964..0076b1e 100644 > --- a/arch/arm/boot/dts/r8a7778-bockw.dts > +++ b/arch/arm/boot/dts/r8a7778-bockw.dts > @@ -22,7 +22,7 @@ > compatible = "renesas,bockw", "renesas,r8a7778"; > > chosen { > - bootargs = "console=ttySC0,115200 ignore_loglevel"; > + bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs"; > }; > > memory { In my opinion, modifying .dts file should be done in a separate patch. > diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig > index 6037705..6524cdf 100644 > --- a/arch/arm/configs/bockw_defconfig > +++ b/arch/arm/configs/bockw_defconfig > @@ -27,16 +27,40 @@ CONFIG_HIGHMEM=y > CONFIG_ZBOOT_ROM_TEXT=0x0 > CONFIG_ZBOOT_ROM_BSS=0x0 > CONFIG_ARM_APPENDED_DTB=y > -CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel" > +CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp" > CONFIG_CMDLINE_FORCE=y > # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set > # CONFIG_SUSPEND is not set > +CONFIG_NET=y > +CONFIG_UNIX=y > +CONFIG_INET=y > +CONFIG_IP_PNP=y > +CONFIG_IP_PNP_DHCP=y > +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set > +# CONFIG_INET_XFRM_MODE_TUNNEL is not set > +# CONFIG_INET_XFRM_MODE_BEET is not set > +# CONFIG_INET_LRO is not set > +# CONFIG_INET_DIAG is not set > +# CONFIG_IPV6 is not set > CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" > CONFIG_DEVTMPFS=y > CONFIG_DEVTMPFS_MOUNT=y > # CONFIG_STANDALONE is not set > # CONFIG_PREVENT_FIRMWARE_BUILD is not set > # CONFIG_FW_LOADER is not set > +CONFIG_NETDEVICES=y > +# CONFIG_NET_CADENCE is not set > +# CONFIG_NET_VENDOR_BROADCOM is not set > +# CONFIG_NET_VENDOR_CIRRUS is not set > +# CONFIG_NET_VENDOR_FARADAY is not set > +# CONFIG_NET_VENDOR_INTEL is not set > +# CONFIG_NET_VENDOR_MARVELL is not set > +# CONFIG_NET_VENDOR_MICREL is not set > +# CONFIG_NET_VENDOR_NATSEMI is not set > +# CONFIG_NET_VENDOR_SEEQ is not set > +CONFIG_SMSC911X=y > +# CONFIG_NET_VENDOR_STMICRO is not set > +# CONFIG_NET_VENDOR_WIZNET is not set > # CONFIG_INPUT is not set > # CONFIG_SERIO is not set > # CONFIG_VT is not set > @@ -55,12 +79,16 @@ CONFIG_UIO_PDRV_GENIRQ=y > # CONFIG_INOTIFY_USER is not set > CONFIG_TMPFS=y > # CONFIG_MISC_FILESYSTEMS is not set > +CONFIG_NFS_FS=y > +CONFIG_NFS_V3_ACL=y > +CONFIG_NFS_V4=y > +CONFIG_NFS_SWAP=y > +CONFIG_NFS_V4_1=y > +CONFIG_ROOT_NFS=y > # CONFIG_ENABLE_WARN_DEPRECATED is not set > # CONFIG_ENABLE_MUST_CHECK is not set > # CONFIG_SCHED_DEBUG is not set > # CONFIG_DEBUG_BUGVERBOSE is not set > # CONFIG_FTRACE is not set > # CONFIG_ARM_UNWIND is not set > -CONFIG_KEYS=y > -CONFIG_CRYPTO=y > CONFIG_AVERAGE=y In my opinion, modifying bockw_defconfig should be done in a separate patch. Mixing everything up in a signle patch is a bad practice. WBR, Sergei ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support 2013-04-01 12:50 ` Sergei Shtylyov @ 2013-04-02 0:13 ` Kuninori Morimoto 2013-04-02 2:24 ` Simon Horman 0 siblings, 1 reply; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 0:13 UTC (permalink / raw) To: linux-arm-kernel Hi Sergei, Simon > > chosen { > > - bootargs = "console=ttySC0,115200 ignore_loglevel"; > > + bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs"; > > }; > > > > memory { > > In my opinion, modifying .dts file should be done in a separate patch. (snip) > > # CONFIG_SCHED_DEBUG is not set > > # CONFIG_DEBUG_BUGVERBOSE is not set > > # CONFIG_FTRACE is not set > > # CONFIG_ARM_UNWIND is not set > > -CONFIG_KEYS=y > > -CONFIG_CRYPTO=y > > CONFIG_AVERAGE=y > > In my opinion, modifying bockw_defconfig should be done in a separate > patch. Mixing everything up in a signle patch is a bad practice. It depends on LTSI backport / upstreaming I believe. I need Simon's opinion Best regards --- Kuninori Morimoto ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support 2013-04-02 0:13 ` Kuninori Morimoto @ 2013-04-02 2:24 ` Simon Horman 2013-04-02 3:25 ` Kuninori Morimoto 0 siblings, 1 reply; 26+ messages in thread From: Simon Horman @ 2013-04-02 2:24 UTC (permalink / raw) To: linux-arm-kernel On Mon, Apr 01, 2013 at 05:13:10PM -0700, Kuninori Morimoto wrote: > > Hi Sergei, Simon > > > > chosen { > > > - bootargs = "console=ttySC0,115200 ignore_loglevel"; > > > + bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs"; > > > }; > > > > > > memory { > > > > In my opinion, modifying .dts file should be done in a separate patch. > (snip) > > > # CONFIG_SCHED_DEBUG is not set > > > # CONFIG_DEBUG_BUGVERBOSE is not set > > > # CONFIG_FTRACE is not set > > > # CONFIG_ARM_UNWIND is not set > > > -CONFIG_KEYS=y > > > -CONFIG_CRYPTO=y > > > CONFIG_AVERAGE=y > > > > In my opinion, modifying bockw_defconfig should be done in a separate > > patch. Mixing everything up in a signle patch is a bad practice. > > It depends on LTSI backport / upstreaming I believe. > I need Simon's opinion I have no strong opinions on this, but in general breaking up patches makes my life easier. So long as the individual patches don't are useful and don't break anything :^) ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support 2013-04-02 2:24 ` Simon Horman @ 2013-04-02 3:25 ` Kuninori Morimoto 0 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 3:25 UTC (permalink / raw) To: linux-arm-kernel Hi Simon > > It depends on LTSI backport / upstreaming I believe. > > I need Simon's opinion > > I have no strong opinions on this, but in general breaking up patches > makes my life easier. So long as the individual patches don't are useful > and don't break anything :^) OK, I see I can send v3 patch which are separateed (= C code/DT/defconfig) Best regards --- Kuninori Morimoto ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 3/3 v2] ARM: shmobile: bockw: add pinctrl support 2013-04-01 2:27 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto 2013-04-01 12:50 ` Sergei Shtylyov @ 2013-04-10 9:33 ` Kuninori Morimoto 1 sibling, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-10 9:33 UTC (permalink / raw) To: linux-sh SCIF0 support as 1st step Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v1 -> v2 - no change arch/arm/mach-shmobile/board-bockw.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index 3e0b641..88fcdb3 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <linux/pinctrl/machine.h> #include <linux/platform_device.h> #include <linux/regulator/fixed.h> #include <linux/regulator/machine.h> @@ -53,6 +54,14 @@ static struct resource smsc911x_resources[] = { DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */ }; +static const struct pinctrl_map bockw_pinctrl_map[] = { + /* SCIF0 */ + PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", + "scif0_data_a", "scif0"), + PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", + "scif0_ctrl", "scif0"), +}; + #define IRQ0MR 0x30 static void __init bockw_init(void) { @@ -62,6 +71,10 @@ static void __init bockw_init(void) r8a7778_init_irq_extpin(1); r8a7778_add_standard_devices(); + pinctrl_register_mappings(bockw_pinctrl_map, + ARRAY_SIZE(bockw_pinctrl_map)); + r8a7778_pinmux_init(); + fpga = ioremap_nocache(0x18200000, SZ_1M); if (fpga) { /* -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W 2013-04-01 2:25 ` [PATCH 0/3 v2] " Kuninori Morimoto ` (2 preceding siblings ...) 2013-04-01 2:27 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto @ 2013-04-02 4:18 ` Kuninori Morimoto 2013-04-02 4:19 ` [PATCH 1/5 v3] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto ` (5 more replies) 3 siblings, 6 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 4:18 UTC (permalink / raw) To: linux-arm-kernel Hi Simon These patches are v3 of extpin support on r8a7778, and enable SMSC ether support on Bock-W board This patch set is based latest simon/next Kuninori Morimoto (5): ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() ARM: shmobile: bockw: add SMSC ethernet support ARM: shmobile: bockw: enable network settings on bootargs ARM: shmobile: bockw: enable SMSC ethernet on defconfig arch/arm/boot/dts/r8a7778-bockw.dts | 2 +- arch/arm/configs/bockw_defconfig | 34 ++++++++++-- arch/arm/mach-shmobile/Kconfig | 1 + arch/arm/mach-shmobile/board-bockw.c | 38 ++++++++++++++ arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 + arch/arm/mach-shmobile/setup-r8a7778.c | 70 +++++++++++++++++++------ 6 files changed, 125 insertions(+), 21 deletions(-) ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 1/5 v3] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto @ 2013-04-02 4:19 ` Kuninori Morimoto 2013-04-02 4:19 ` [PATCH 2/5 v3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto ` (4 subsequent siblings) 5 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 4:19 UTC (permalink / raw) To: linux-arm-kernel remove pointless PLATFORM_INFO() macro from setup-r8a7778, and, used original platform_device_register_xxx() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v2 -> v3 - no change arch/arm/mach-shmobile/setup-r8a7778.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 01c62be..57d6b0e 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -78,21 +78,13 @@ static struct sh_timer_config sh_tmu1_platform_data = { .clocksource_rating = 200, }; -#define PLATFORM_INFO(n, i) \ -{ \ - .parent = &platform_bus, \ - .name = #n, \ - .id = i, \ - .res = n ## i ## _resources, \ - .num_res = ARRAY_SIZE(n ## i ##_resources), \ - .data = &n ## i ##_platform_data, \ - .size_data = sizeof(n ## i ## _platform_data), \ -} - -struct platform_device_info platform_devinfo[] = { - PLATFORM_INFO(sh_tmu, 0), - PLATFORM_INFO(sh_tmu, 1), -}; +#define r8a7778_register_tmu(idx) \ + platform_device_register_resndata( \ + &platform_bus, "sh_tmu", idx, \ + sh_tmu##idx##_resources, \ + ARRAY_SIZE(sh_tmu##idx##_resources), \ + &sh_tmu##idx##_platform_data, \ + sizeof(sh_tmu##idx##_platform_data)) void __init r8a7778_add_standard_devices(void) { @@ -114,8 +106,8 @@ void __init r8a7778_add_standard_devices(void) &scif_platform_data[i], sizeof(struct plat_sci_port)); - for (i = 0; i < ARRAY_SIZE(platform_devinfo); i++) - platform_device_register_full(&platform_devinfo[i]); + r8a7778_register_tmu(0); + r8a7778_register_tmu(1); } #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 2/5 v3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto 2013-04-02 4:19 ` [PATCH 1/5 v3] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto @ 2013-04-02 4:19 ` Kuninori Morimoto 2013-04-02 4:20 ` [PATCH 3/5 v3] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto ` (3 subsequent siblings) 5 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 4:19 UTC (permalink / raw) To: linux-arm-kernel This patch adds r8a7778_init_irq_extpin() for IRQ0 - IRQ3. But this patch doesn't enable DT settings on r8a7778.dts, because R8A7778 chip external IRQ depends on IRQ0 - IRQ3 pin encoding which came from platform board implementation. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v2 -> v3 - no change arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 + arch/arm/mach-shmobile/setup-r8a7778.c | 44 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index a755dca..e0c6205 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h @@ -24,5 +24,6 @@ extern void r8a7778_init_delay(void); extern void r8a7778_init_irq(void); extern void r8a7778_init_irq_dt(void); extern void r8a7778_clock_init(void); +extern void r8a7778_init_irq_extpin(int irlm); #endif /* __ASM_R8A7778_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 57d6b0e..2882305 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -23,6 +23,7 @@ #include <linux/irqchip/arm-gic.h> #include <linux/of.h> #include <linux/of_platform.h> +#include <linux/platform_data/irq-renesas-intc-irqpin.h> #include <linux/platform_device.h> #include <linux/irqchip.h> #include <linux/serial_sci.h> @@ -110,6 +111,49 @@ void __init r8a7778_add_standard_devices(void) r8a7778_register_tmu(1); } +static struct renesas_intc_irqpin_config irqpin_platform_data = { + .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ + .sense_bitfield_width = 2, +}; + +static struct resource irqpin_resources[] = { + DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */ + DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */ + DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */ + DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */ + DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */ + DEFINE_RES_IRQ(gic_iid(0x3b)), /* IRQ0 */ + DEFINE_RES_IRQ(gic_iid(0x3c)), /* IRQ1 */ + DEFINE_RES_IRQ(gic_iid(0x3d)), /* IRQ2 */ + DEFINE_RES_IRQ(gic_iid(0x3e)), /* IRQ3 */ +}; + +void __init r8a7778_init_irq_extpin(int irlm) +{ + void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE); + unsigned long tmp; + + if (!icr0) { + pr_warn("r8a7778: unable to setup external irq pin mode\n"); + return; + } + + tmp = ioread32(icr0); + if (irlm) + tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */ + else + tmp &= ~(1 << 23); /* IRL mode - not supported */ + tmp |= (1 << 21); /* LVLMODE = 1 */ + iowrite32(tmp, icr0); + iounmap(icr0); + + if (irlm) + platform_device_register_resndata( + &platform_bus, "renesas_intc_irqpin", -1, + irqpin_resources, ARRAY_SIZE(irqpin_resources), + &irqpin_platform_data, sizeof(irqpin_platform_data)); +} + #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ #define INT2SMSKCR1 0x8228c /* 0xfe78228c */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 3/5 v3] ARM: shmobile: bockw: add SMSC ethernet support 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto 2013-04-02 4:19 ` [PATCH 1/5 v3] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto 2013-04-02 4:19 ` [PATCH 2/5 v3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto @ 2013-04-02 4:20 ` Kuninori Morimoto 2013-04-02 4:20 ` [PATCH 4/5 v3] ARM: shmobile: bockw: enable network settings on bootargs Kuninori Morimoto ` (2 subsequent siblings) 5 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 4:20 UTC (permalink / raw) To: linux-arm-kernel This patch adds SMSC ethernet support on Bock-W Bock-W SMSC needs FPGA settings which enables interrupt. This patch does it on bockw_init() function. As notes for future, this FPGA settings should be updated, since this FPGA is using cascaded interrupt. Current code is assuming that this FPGA interrupt user is only SMSC. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v2 -> v3 - C code only arch/arm/mach-shmobile/Kconfig | 1 + arch/arm/mach-shmobile/board-bockw.c | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 9125e14..b2219bd 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -119,6 +119,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/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index 56ab56e..38e5e50 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c @@ -19,14 +19,52 @@ */ #include <linux/platform_device.h> +#include <linux/smsc911x.h> #include <mach/common.h> +#include <mach/irqs.h> #include <mach/r8a7778.h> #include <asm/mach/arch.h> +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 = { -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 4/5 v3] ARM: shmobile: bockw: enable network settings on bootargs 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto ` (2 preceding siblings ...) 2013-04-02 4:20 ` [PATCH 3/5 v3] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto @ 2013-04-02 4:20 ` Kuninori Morimoto 2013-04-02 4:20 ` [PATCH 5/5 v3] ARM: shmobile: bockw: enable SMSC ethernet on defconfig Kuninori Morimoto 2013-04-03 8:19 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Magnus Damm 5 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 4:20 UTC (permalink / raw) To: linux-arm-kernel "ip" and "root" settings are useful for development Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v2 -> v3 - dts only arch/arm/boot/dts/r8a7778-bockw.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/r8a7778-bockw.dts b/arch/arm/boot/dts/r8a7778-bockw.dts index 735c964..0076b1e 100644 --- a/arch/arm/boot/dts/r8a7778-bockw.dts +++ b/arch/arm/boot/dts/r8a7778-bockw.dts @@ -22,7 +22,7 @@ compatible = "renesas,bockw", "renesas,r8a7778"; chosen { - bootargs = "console=ttySC0,115200 ignore_loglevel"; + bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs"; }; memory { -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 5/5 v3] ARM: shmobile: bockw: enable SMSC ethernet on defconfig 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto ` (3 preceding siblings ...) 2013-04-02 4:20 ` [PATCH 4/5 v3] ARM: shmobile: bockw: enable network settings on bootargs Kuninori Morimoto @ 2013-04-02 4:20 ` Kuninori Morimoto 2013-04-03 8:19 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Magnus Damm 5 siblings, 0 replies; 26+ messages in thread From: Kuninori Morimoto @ 2013-04-02 4:20 UTC (permalink / raw) To: linux-arm-kernel This patch adds SMSC ethernet support on Bock-W defconfig Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- v2 -> v3 - defconfig only arch/arm/configs/bockw_defconfig | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig index 6037705..6524cdf 100644 --- a/arch/arm/configs/bockw_defconfig +++ b/arch/arm/configs/bockw_defconfig @@ -27,16 +27,40 @@ CONFIG_HIGHMEM=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_ARM_APPENDED_DTB=y -CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel" +CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp" CONFIG_CMDLINE_FORCE=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_SUSPEND is not set +CONFIG_NET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_IPV6 is not set CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y # CONFIG_STANDALONE is not set # CONFIG_PREVENT_FIRMWARE_BUILD is not set # CONFIG_FW_LOADER is not set +CONFIG_NETDEVICES=y +# CONFIG_NET_CADENCE is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_SEEQ is not set +CONFIG_SMSC911X=y +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_WIZNET is not set # CONFIG_INPUT is not set # CONFIG_SERIO is not set # CONFIG_VT is not set @@ -55,12 +79,16 @@ CONFIG_UIO_PDRV_GENIRQ=y # CONFIG_INOTIFY_USER is not set CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_SWAP=y +CONFIG_NFS_V4_1=y +CONFIG_ROOT_NFS=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set # CONFIG_SCHED_DEBUG is not set # CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FTRACE is not set # CONFIG_ARM_UNWIND is not set -CONFIG_KEYS=y -CONFIG_CRYPTO=y CONFIG_AVERAGE=y -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto ` (4 preceding siblings ...) 2013-04-02 4:20 ` [PATCH 5/5 v3] ARM: shmobile: bockw: enable SMSC ethernet on defconfig Kuninori Morimoto @ 2013-04-03 8:19 ` Magnus Damm 2013-04-04 6:52 ` Simon Horman 5 siblings, 1 reply; 26+ messages in thread From: Magnus Damm @ 2013-04-03 8:19 UTC (permalink / raw) To: linux-arm-kernel Hi Morimoto-san, Simon, On Tue, Apr 2, 2013 at 1:18 PM, Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote: > > Hi Simon > > These patches are v3 of extpin support on r8a7778, > and enable SMSC ether support on Bock-W board > > This patch set is based latest simon/next > > Kuninori Morimoto (5): > ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() > ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() > ARM: shmobile: bockw: add SMSC ethernet support > ARM: shmobile: bockw: enable network settings on bootargs > ARM: shmobile: bockw: enable SMSC ethernet on defconfig Thanks, these are all fine with me. Acked-by: Magnus Damm <damm@opensource.se> ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W 2013-04-03 8:19 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Magnus Damm @ 2013-04-04 6:52 ` Simon Horman 0 siblings, 0 replies; 26+ messages in thread From: Simon Horman @ 2013-04-04 6:52 UTC (permalink / raw) To: linux-arm-kernel On Wed, Apr 03, 2013 at 05:19:10PM +0900, Magnus Damm wrote: > Hi Morimoto-san, Simon, > > On Tue, Apr 2, 2013 at 1:18 PM, Kuninori Morimoto > <kuninori.morimoto.gx@renesas.com> wrote: > > > > Hi Simon > > > > These patches are v3 of extpin support on r8a7778, > > and enable SMSC ether support on Bock-W board > > > > This patch set is based latest simon/next > > > > Kuninori Morimoto (5): > > ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() > > ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Queued up in the soc-r8a7778 branch. > > ARM: shmobile: bockw: add SMSC ethernet support > > ARM: shmobile: bockw: enable network settings on bootargs Queued up in the boards-bockw branch. > > ARM: shmobile: bockw: enable SMSC ethernet on defconfig Queued up in the defconfig-bockw branch. > Thanks, these are all fine with me. > > Acked-by: Magnus Damm <damm@opensource.se> I will endeavour to get this included in v3.10. ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2013-04-10 9:33 UTC | newest] Thread overview: 26+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-03-22 7:13 [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto 2013-03-22 7:14 ` [RFC][PATCH 1/3] ARM: shmobile: define PLATFORM_xxx_INFO() Kuninori Morimoto 2013-03-29 8:37 ` Magnus Damm 2013-04-01 0:41 ` Kuninori Morimoto 2013-03-22 7:14 ` [RFC][PATCH 2/3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto 2013-03-22 7:15 ` [RFC][PATCH 3/3] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto 2013-03-27 5:34 ` [PATCH 0/3] ARM: shmobile: Add SMSC support on Bock-W Simon Horman 2013-04-01 2:25 ` [PATCH 0/3 v2] " Kuninori Morimoto 2013-04-01 2:26 ` [PATCH 1/3 v2] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto 2013-04-01 2:27 ` [PATCH 2/3 v2] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto 2013-04-01 12:44 ` Sergei Shtylyov 2013-04-02 0:11 ` Kuninori Morimoto 2013-04-01 2:27 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto 2013-04-01 12:50 ` Sergei Shtylyov 2013-04-02 0:13 ` Kuninori Morimoto 2013-04-02 2:24 ` Simon Horman 2013-04-02 3:25 ` Kuninori Morimoto 2013-04-10 9:33 ` [PATCH 3/3 v2] ARM: shmobile: bockw: add pinctrl support Kuninori Morimoto 2013-04-02 4:18 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Kuninori Morimoto 2013-04-02 4:19 ` [PATCH 1/5 v3] ARM: shmobile: r8a7778: remove pointless PLATFORM_INFO() Kuninori Morimoto 2013-04-02 4:19 ` [PATCH 2/5 v3] ARM: shmobile: r8a7778: add r8a7778_init_irq_extpin() Kuninori Morimoto 2013-04-02 4:20 ` [PATCH 3/5 v3] ARM: shmobile: bockw: add SMSC ethernet support Kuninori Morimoto 2013-04-02 4:20 ` [PATCH 4/5 v3] ARM: shmobile: bockw: enable network settings on bootargs Kuninori Morimoto 2013-04-02 4:20 ` [PATCH 5/5 v3] ARM: shmobile: bockw: enable SMSC ethernet on defconfig Kuninori Morimoto 2013-04-03 8:19 ` [PATCH 0/5 v3] ARM: shmobile: Add SMSC support on Bock-W Magnus Damm 2013-04-04 6:52 ` Simon Horman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).