* [PATCH 4/4 v2] ARM: shmobile: bockw: add USB Function support
@ 2013-07-10 2:30 Kuninori Morimoto
2013-07-10 12:06 ` Sergei Shtylyov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2013-07-10 2:30 UTC (permalink / raw)
To: linux-sh
Bock-W USB1 (CN29) can be USB Host/Func by SW98/SW99 settings.
USB Func will be enabled if CONFIG_USB_RENESAS_USBHS_UDC[_MODULE]
was selected by this patch
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2
- exchange PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", xxx) position
- remove 1st white tab
arch/arm/mach-shmobile/board-bockw.c | 43 +++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index a57be8a..afc3fcf 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -58,6 +58,16 @@
* SW19 (MMC) 1 pin
*/
+/*
+ * USB
+ *
+ * USB1 (CN29) can be Host/Function
+ *
+ * Host Func
+ * SW98 0 2
+ * SW99 0 3
+ */
+
/* Dummy supplies, where voltage doesn't matter */
static struct regulator_consumer_supply dummy_supplies[] = {
REGULATOR_SUPPLY("vddvario", "smsc911x"),
@@ -140,7 +150,34 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
MMC_CAP_NEEDS_POLL,
};
-static struct rcar_phy_platform_data usb_phy_platform_data __initdata;
+#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC)
+/*
+ * When USB1 is Func
+ */
+static struct renesas_usbhs_platform_info usbhs_info = {
+ .platform_callback = {
+ /* .get_id will be set in register function */
+ /* .power_ctrl will be set in register function */
+ },
+ .driver_param = {
+ .buswait_bwait = 4,
+ },
+};
+
+#define USB_PHY_SETTING {.port1_func = 1, .ovc_pin[1].active_high = 1,}
+#define R8A7778_ADD_USB_FUNC_DEVICE_IF_POSSIBLE \
+ r8a7778_add_usb_func_device(&usbhs_info)
+#else
+/*
+ * When USB1 is Host
+ */
+#define USB_PHY_SETTING { }
+#define R8A7778_ADD_USB_FUNC_DEVICE_IF_POSSIBLE
+#endif
+
+static struct rcar_phy_platform_data usb_phy_platform_data __initdata + USB_PHY_SETTING;
+
static const struct pinctrl_map bockw_pinctrl_map[] = {
/* Ether */
@@ -162,10 +199,13 @@ static const struct pinctrl_map bockw_pinctrl_map[] = {
/* SDHI0 */
PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
"sdhi0", "sdhi0"),
+ /* USB */
PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform", "pfc-r8a7778",
"usb0", "usb0"),
PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform", "pfc-r8a7778",
"usb1", "usb1"),
+ PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7778",
+ "usb1", "usb1"),
};
#define FPGA 0x18200000
@@ -235,6 +275,7 @@ static void __init bockw_init(void)
static void __init bockw_init_late(void)
{
r8a7778_add_usb_host_device();
+ R8A7778_ADD_USB_FUNC_DEVICE_IF_POSSIBLE;
}
static const char *bockw_boards_compat_dt[] __initdata = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 4/4 v2] ARM: shmobile: bockw: add USB Function support
2013-07-10 2:30 [PATCH 4/4 v2] ARM: shmobile: bockw: add USB Function support Kuninori Morimoto
@ 2013-07-10 12:06 ` Sergei Shtylyov
2013-10-02 8:34 ` [PATCH 4/4 v2] ARM: shmobile: bockw: add SMSC support on DTS Kuninori Morimoto
2013-10-03 4:14 ` Simon Horman
2 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2013-07-10 12:06 UTC (permalink / raw)
To: linux-sh
Hello.
On 10-07-2013 6:30, Kuninori Morimoto wrote:
> Bock-W USB1 (CN29) can be USB Host/Func by SW98/SW99 settings.
> USB Func will be enabled if CONFIG_USB_RENESAS_USBHS_UDC[_MODULE]
> was selected by this patch
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[...]
> diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
> index a57be8a..afc3fcf 100644
> --- a/arch/arm/mach-shmobile/board-bockw.c
> +++ b/arch/arm/mach-shmobile/board-bockw.c
[...]
> @@ -162,10 +199,13 @@ static const struct pinctrl_map bockw_pinctrl_map[] = {
> /* SDHI0 */
> PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
> "sdhi0", "sdhi0"),
> + /* USB */
> PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform", "pfc-r8a7778",
> "usb0", "usb0"),
> PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform", "pfc-r8a7778",
> "usb1", "usb1"),
> + PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7778",
> + "usb1", "usb1"),
Won't it cause conflict with the previous group when both EHCI and
USB function drivers are enabled?
WBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 4/4 v2] ARM: shmobile: bockw: add SMSC support on DTS
2013-07-10 2:30 [PATCH 4/4 v2] ARM: shmobile: bockw: add USB Function support Kuninori Morimoto
2013-07-10 12:06 ` Sergei Shtylyov
@ 2013-10-02 8:34 ` Kuninori Morimoto
2013-10-03 4:14 ` Simon Horman
2 siblings, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2013-10-02 8:34 UTC (permalink / raw)
To: linux-sh
This patch enables INTC IRQ and SMSC on BockW board via DT.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2
- patch was splited, only dts
arch/arm/boot/dts/r8a7778-bockw-reference.dts | 27 ++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/r8a7778-bockw-reference.dts b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
index 9bb903a..4425fd2 100644
--- a/arch/arm/boot/dts/r8a7778-bockw-reference.dts
+++ b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
@@ -22,11 +22,36 @@
compatible = "renesas,bockw-reference", "renesas,r8a7778";
chosen {
- bootargs = "console=ttySC0,115200 ignore_loglevel rw";
+ bootargs = "console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp rw";
};
memory {
device_type = "memory";
reg = <0x60000000 0x10000000>;
};
+
+ fixedregulator3v3: fixedregulator@0 {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-3.3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ lan0@18300000 {
+ compatible = "smsc,lan9220", "smsc,lan9115";
+ reg = <0x18300000 0x1000>;
+
+ phy-mode = "mii";
+ interrupt-parent = <&irqpin>;
+ interrupts = <0 0>; /* IRQ0: hwirq 0 on irqpin */
+ reg-io-width = <4>;
+ vddvario-supply = <&fixedregulator3v3>;
+ vdd33a-supply = <&fixedregulator3v3>;
+ };
+};
+
+&irqpin {
+ status = "okay";
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 4/4 v2] ARM: shmobile: bockw: add SMSC support on DTS
2013-07-10 2:30 [PATCH 4/4 v2] ARM: shmobile: bockw: add USB Function support Kuninori Morimoto
2013-07-10 12:06 ` Sergei Shtylyov
2013-10-02 8:34 ` [PATCH 4/4 v2] ARM: shmobile: bockw: add SMSC support on DTS Kuninori Morimoto
@ 2013-10-03 4:14 ` Simon Horman
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2013-10-03 4:14 UTC (permalink / raw)
To: linux-sh
On Wed, Oct 02, 2013 at 01:34:07AM -0700, Kuninori Morimoto wrote:
> This patch enables INTC IRQ and SMSC on BockW board via DT.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v1 -> v2
>
> - patch was splited, only dts
>
> arch/arm/boot/dts/r8a7778-bockw-reference.dts | 27 ++++++++++++++++++++++++-
> 1 file changed, 26 insertions(+), 1 deletion(-)
Thanks, I have queued this up in the dt3 branch.
It should make it into v3.13 but if not I'll rename the branch
dt after rebasing it on v3.13-rcX which will then be targeted at v3.14.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-03 4:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10 2:30 [PATCH 4/4 v2] ARM: shmobile: bockw: add USB Function support Kuninori Morimoto
2013-07-10 12:06 ` Sergei Shtylyov
2013-10-02 8:34 ` [PATCH 4/4 v2] ARM: shmobile: bockw: add SMSC support on DTS Kuninori Morimoto
2013-10-03 4:14 ` 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).