diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/dts/am4372-generic-u-boot.dtsi | 2 | ||||
-rw-r--r-- | arch/arm/dts/am4372-u-boot.dtsi | 40 | ||||
-rw-r--r-- | arch/arm/dts/am437x-gp-evm-u-boot.dtsi | 2 | ||||
-rw-r--r-- | arch/arm/dts/am437x-idk-evm-u-boot.dtsi | 2 | ||||
-rw-r--r-- | arch/arm/dts/am437x-sk-evm-u-boot.dtsi | 2 | ||||
-rw-r--r-- | arch/arm/dts/keystone-k2g-evm.dts | 28 | ||||
-rw-r--r-- | arch/arm/dts/keystone-k2g.dtsi | 56 | ||||
-rw-r--r-- | arch/arm/include/asm/omap_musb.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/am33xx/board.c | 58 |
9 files changed, 190 insertions, 8 deletions
diff --git a/arch/arm/dts/am4372-generic-u-boot.dtsi b/arch/arm/dts/am4372-generic-u-boot.dtsi index d485679de4..6ba5c16492 100644 --- a/arch/arm/dts/am4372-generic-u-boot.dtsi +++ b/arch/arm/dts/am4372-generic-u-boot.dtsi @@ -3,6 +3,8 @@ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ */ +#include "am4372-u-boot.dtsi" + /{ ocp { u-boot,dm-pre-reloc; diff --git a/arch/arm/dts/am4372-u-boot.dtsi b/arch/arm/dts/am4372-u-boot.dtsi new file mode 100644 index 0000000000..99922ca030 --- /dev/null +++ b/arch/arm/dts/am4372-u-boot.dtsi @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + */ + +&am43xx_control_usb2phy1 { + compatible = "ti,control-phy-usb2-am437", "syscon"; +}; + +&am43xx_control_usb2phy2 { + compatible = "ti,control-phy-usb2-am437", "syscon"; +}; + +&ocp2scp0 { + compatible = "ti,am437x-ocp2scp", "ti,omap-ocp2scp", "simple-bus"; +}; + +&ocp2scp1 { + compatible = "ti,am437x-ocp2scp", "ti,omap-ocp2scp", "simple-bus"; +}; + +&dwc3_1 { + u-boot,dm-spl; +}; + +&usb1 { + u-boot,dm-spl; +}; + +&usb2_phy1 { + u-boot,dm-spl; +}; + +&am43xx_control_usb2phy1 { + u-boot,dm-spl; +}; + +&ocp2scp0 { + u-boot,dm-spl; +}; diff --git a/arch/arm/dts/am437x-gp-evm-u-boot.dtsi b/arch/arm/dts/am437x-gp-evm-u-boot.dtsi index 03a1c1dd39..d950d32f17 100644 --- a/arch/arm/dts/am437x-gp-evm-u-boot.dtsi +++ b/arch/arm/dts/am437x-gp-evm-u-boot.dtsi @@ -7,6 +7,8 @@ * Based on "dra7.dtsi" */ +#include "am4372-u-boot.dtsi" + /{ ocp { u-boot,dm-spl; diff --git a/arch/arm/dts/am437x-idk-evm-u-boot.dtsi b/arch/arm/dts/am437x-idk-evm-u-boot.dtsi index 0a3d79a372..3aa9195e44 100644 --- a/arch/arm/dts/am437x-idk-evm-u-boot.dtsi +++ b/arch/arm/dts/am437x-idk-evm-u-boot.dtsi @@ -3,6 +3,8 @@ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ */ +#include "am4372-u-boot.dtsi" + /{ ocp { u-boot,dm-spl; diff --git a/arch/arm/dts/am437x-sk-evm-u-boot.dtsi b/arch/arm/dts/am437x-sk-evm-u-boot.dtsi index 0a3d79a372..3aa9195e44 100644 --- a/arch/arm/dts/am437x-sk-evm-u-boot.dtsi +++ b/arch/arm/dts/am437x-sk-evm-u-boot.dtsi @@ -3,6 +3,8 @@ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ */ +#include "am4372-u-boot.dtsi" + /{ ocp { u-boot,dm-spl; diff --git a/arch/arm/dts/keystone-k2g-evm.dts b/arch/arm/dts/keystone-k2g-evm.dts index ad746c7311..6c9de25b94 100644 --- a/arch/arm/dts/keystone-k2g-evm.dts +++ b/arch/arm/dts/keystone-k2g-evm.dts @@ -33,6 +33,34 @@ }; }; +&keystone_usb0 { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; + compatible = "nop-phy"; +}; + +&usb0 { + dr_mode = "host"; + status = "okay"; +}; + +&keystone_usb1 { + status = "okay"; +}; + +&usb1_phy { + compatible = "nop-phy"; + status = "okay"; +}; + +&usb1 { + dr_mode = "peripheral"; + status = "okay"; +}; + &gbe0 { phy-handle = <ðphy0>; }; diff --git a/arch/arm/dts/keystone-k2g.dtsi b/arch/arm/dts/keystone-k2g.dtsi index bbbb9874c8..ede7118120 100644 --- a/arch/arm/dts/keystone-k2g.dtsi +++ b/arch/arm/dts/keystone-k2g.dtsi @@ -201,5 +201,61 @@ status = "disabled"; clock-names = "fck"; }; + + usb0_phy: usb-phy@0 { + compatible = "usb-nop-xceiv"; + status = "disabled"; + }; + + keystone_usb0: keystone-dwc3@2680000 { + compatible = "ti,keystone-dwc3"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x2680000 0x10000>; + interrupts = <GIC_SPI 128 IRQ_TYPE_EDGE_RISING>; + ranges; + dma-coherent; + dma-ranges; + status = "disabled"; + /*power-domains = <&k2g_pds 0x0016>;*/ + + usb0: usb@2690000 { + compatible = "snps,dwc3"; + reg = <0x2690000 0x10000>; + interrupts = <GIC_SPI 128 IRQ_TYPE_EDGE_RISING>; + maximum-speed = "high-speed"; + dr_mode = "otg"; + /*usb-phy = <&usb0_phy>;*/ + status = "disabled"; + }; + }; + + usb1_phy: usb-phy@1 { + compatible = "usb-nop-xceiv"; + status = "disabled"; + }; + + keystone_usb1: keystone-dwc3@2580000 { + compatible = "ti,keystone-dwc3"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x2580000 0x10000>; + interrupts = <GIC_SPI 144 IRQ_TYPE_EDGE_RISING>; + ranges; + dma-coherent; + dma-ranges; + status = "disabled"; + /*power-domains = <&k2g_pds 0x0017>;*/ + + usb1: usb@2590000 { + compatible = "snps,dwc3"; + reg = <0x2590000 0x10000>; + interrupts = <GIC_SPI 144 IRQ_TYPE_EDGE_RISING>; + maximum-speed = "high-speed"; + dr_mode = "otg"; + /*usb-phy = <&usb1_phy>;*/ + status = "disabled"; + }; + }; }; }; diff --git a/arch/arm/include/asm/omap_musb.h b/arch/arm/include/asm/omap_musb.h index 875f1002af..b40ea005be 100644 --- a/arch/arm/include/asm/omap_musb.h +++ b/arch/arm/include/asm/omap_musb.h @@ -7,6 +7,7 @@ #ifndef __ASM_ARM_OMAP_MUSB_H #define __ASM_ARM_OMAP_MUSB_H +#include <linux/usb/musb.h> extern struct musb_platform_ops musb_dsps_ops; extern const struct musb_platform_ops am35x_ops; @@ -21,4 +22,11 @@ struct omap_musb_board_data { }; enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI}; + +struct ti_musb_platdata { + void *base; + void *ctrl_mod_base; + struct musb_hdrc_platform_data plat; +}; + #endif /* __ASM_ARM_OMAP_MUSB_H */ diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 2fc364d112..62158a9592 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -174,7 +174,55 @@ int cpu_mmc_init(bd_t *bis) /* AM33XX has two MUSB controllers which can be host or gadget */ #if (defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)) && \ (defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1)) && \ - (!defined(CONFIG_DM_USB)) + (!CONFIG_IS_ENABLED(DM_USB) || !CONFIG_IS_ENABLED(OF_CONTROL)) && \ + (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_MUSB_NEW_SUPPORT)) + +static struct musb_hdrc_config musb_config = { + .multipoint = 1, + .dyn_fifo = 1, + .num_eps = 16, + .ram_bits = 12, +}; + +#if CONFIG_IS_ENABLED(DM_USB) && !CONFIG_IS_ENABLED(OF_CONTROL) +static struct ti_musb_platdata usb0 = { + .base = (void *)USB0_OTG_BASE, + .ctrl_mod_base = &((struct ctrl_dev *)CTRL_DEVICE_BASE)->usb_ctrl0, + .plat = { + .config = &musb_config, + .power = 50, + .platform_ops = &musb_dsps_ops, + }, +}; + +static struct ti_musb_platdata usb1 = { + .base = (void *)USB1_OTG_BASE, + .ctrl_mod_base = &((struct ctrl_dev *)CTRL_DEVICE_BASE)->usb_ctrl1, + .plat = { + .config = &musb_config, + .power = 50, + .platform_ops = &musb_dsps_ops, + }, +}; + +U_BOOT_DEVICES(am33xx_usbs) = { +#if CONFIG_AM335X_USB0_MODE == MUSB_PERIPHERAL + { "ti-musb-peripheral", &usb0 }, +#elif CONFIG_AM335X_USB0_MODE == MUSB_HOST + { "ti-musb-host", &usb0 }, +#endif +#if CONFIG_AM335X_USB1_MODE == MUSB_PERIPHERAL + { "ti-musb-peripheral", &usb1 }, +#elif CONFIG_AM335X_USB1_MODE == MUSB_HOST + { "ti-musb-host", &usb1 }, +#endif +}; + +int arch_misc_init(void) +{ + return 0; +} +#else static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; /* USB 2.0 PHY Control */ @@ -193,13 +241,6 @@ static void am33xx_usb_set_phy_power(u8 on, u32 *reg_addr) } } -static struct musb_hdrc_config musb_config = { - .multipoint = 1, - .dyn_fifo = 1, - .num_eps = 16, - .ram_bits = 12, -}; - #ifdef CONFIG_AM335X_USB0 static void am33xx_otg0_set_phy_power(struct udevice *dev, u8 on) { @@ -250,6 +291,7 @@ int arch_misc_init(void) #endif return 0; } +#endif #else /* CONFIG_USB_MUSB_* && CONFIG_AM335X_USB* && !CONFIG_DM_USB */ |