From 63c0941726e44f31c42de744a57f528fee2df88f Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 26 Nov 2016 11:02:10 +0900 Subject: libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option") allows us to skip memory setup of DTB, but a problem for ARM is that spin_table_update_dt() and psci_update_dt() are skipped as well if CONFIG_ARCH_FIXUP_FDT is disabled. This commit allows us to skip only fdt_fixup_memory_banks() instead of the whole of arch_fixup_fdt(). It will be useful when we want to use a memory node from a kernel DTB as is, but need some fixups for Spin-Table/PSCI. Signed-off-by: Masahiro Yamada Acked-by: Alexey Brodkin Acked-by: Simon Glass Fixed build error for x86: Signed-off-by: Simon Glass --- arch/arm/lib/bootm-fdt.c | 2 -- arch/arm/lib/bootm.c | 2 -- 2 files changed, 4 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c index a51755070b..4481f9e2fa 100644 --- a/arch/arm/lib/bootm-fdt.c +++ b/arch/arm/lib/bootm-fdt.c @@ -25,7 +25,6 @@ DECLARE_GLOBAL_DATA_PTR; -#ifdef CONFIG_ARCH_FIXUP_FDT int arch_fixup_fdt(void *blob) { bd_t *bd = gd->bd; @@ -61,4 +60,3 @@ int arch_fixup_fdt(void *blob) return 0; } -#endif diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 35e6b06733..4eee13a59c 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -414,10 +414,8 @@ void boot_prep_vxworks(bootm_headers_t *images) if (images->ft_addr) { off = fdt_path_offset(images->ft_addr, "/memory"); if (off < 0) { -#ifdef CONFIG_ARCH_FIXUP_FDT if (arch_fixup_fdt(images->ft_addr)) puts("## WARNING: fixup memory failed!\n"); -#endif } } #endif -- cgit From 195702217d713a0731c9a79f5b3196b08ac400cb Mon Sep 17 00:00:00 2001 From: Mugunthan V N Date: Thu, 17 Nov 2016 14:38:07 +0530 Subject: am33xx: board: do not register usb devices when CONFIG_DM_USB is defined Do not register usb devices when CONFIG_DM_USB is define. Signed-off-by: Mugunthan V N Reviewed-by: Tom Rini --- arch/arm/mach-omap2/am33xx/board.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 5ebeac0ee1..80b729aa13 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -120,7 +120,8 @@ 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_AM335X_USB0) || defined(CONFIG_AM335X_USB1)) && \ + (!defined(CONFIG_DM_USB)) static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; /* USB 2.0 PHY Control */ @@ -187,6 +188,7 @@ static struct musb_hdrc_platform_data otg1_plat = { int arch_misc_init(void) { +#ifndef CONFIG_DM_USB #ifdef CONFIG_AM335X_USB0 musb_register(&otg0_plat, &otg0_board_data, (void *)USB0_OTG_BASE); @@ -194,6 +196,7 @@ int arch_misc_init(void) #ifdef CONFIG_AM335X_USB1 musb_register(&otg1_plat, &otg1_board_data, (void *)USB1_OTG_BASE); +#endif #endif return 0; } -- cgit From 3aec2648698d9be14ab8b3eeb7d4d7d3783379ac Mon Sep 17 00:00:00 2001 From: Mugunthan V N Date: Thu, 17 Nov 2016 14:38:09 +0530 Subject: am33xx: board: probe misc drivers to register musb devices MUSB wrapper driver is bound as MISC device and underlying usb devices are bind to usb drivers based on dr_mode, so probing the MISC wrapper driver to register musb devices. Signed-off-by: Mugunthan V N Reviewed-by: Tom Rini --- arch/arm/mach-omap2/am33xx/board.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 80b729aa13..2ce7790be6 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -197,6 +197,13 @@ int arch_misc_init(void) musb_register(&otg1_plat, &otg1_board_data, (void *)USB1_OTG_BASE); #endif +#else + struct udevice *dev; + int ret; + + ret = uclass_first_device(UCLASS_MISC, &dev); + if (ret || !dev) + return ret; #endif return 0; } -- cgit From 1cac34ce161ae010d3f9ffd3f664e70206638ebc Mon Sep 17 00:00:00 2001 From: Mugunthan V N Date: Thu, 17 Nov 2016 14:38:10 +0530 Subject: drivers: usb: musb: adopt musb backend driver to driver model Currently all backend driver ops uses hard coded physical address, so to adopt the driver to DM, add device pointer to ops call backs so that drivers can get physical addresses from the usb driver priv/plat data. Signed-off-by: Mugunthan V N Reviewed-by: Tom Rini --- arch/arm/include/asm/arch-omap3/musb.h | 6 +++--- arch/arm/include/asm/omap_musb.h | 7 ++++--- arch/arm/mach-omap2/am33xx/board.c | 4 ++-- arch/arm/mach-omap2/omap3/am35x_musb.c | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/include/asm/arch-omap3/musb.h b/arch/arm/include/asm/arch-omap3/musb.h index cee4ed311e..d06a758f1b 100644 --- a/arch/arm/include/asm/arch-omap3/musb.h +++ b/arch/arm/include/asm/arch-omap3/musb.h @@ -7,7 +7,7 @@ #ifndef __ASM_ARCH_OMAP3_MUSB_H #define __ASM_ARCH_OMAP3_MUSB_H -extern void am35x_musb_reset(void); -extern void am35x_musb_phy_power(u8 on); -extern void am35x_musb_clear_irq(void); +void am35x_musb_reset(struct udevice *dev); +void am35x_musb_phy_power(struct udevice *dev, u8 on); +void am35x_musb_clear_irq(struct udevice *dev); #endif diff --git a/arch/arm/include/asm/omap_musb.h b/arch/arm/include/asm/omap_musb.h index 8b9cb0eb8f..7c5fb40774 100644 --- a/arch/arm/include/asm/omap_musb.h +++ b/arch/arm/include/asm/omap_musb.h @@ -15,9 +15,10 @@ extern const struct musb_platform_ops omap2430_ops; struct omap_musb_board_data { u8 interface_type; - void (*set_phy_power)(u8 on); - void (*clear_irq)(void); - void (*reset)(void); + struct udevice *dev; + void (*set_phy_power)(struct udevice *dev, u8 on); + void (*clear_irq)(struct udevice *dev); + void (*reset)(struct udevice *dev); }; enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI}; diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 2ce7790be6..581c0ab518 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -148,7 +148,7 @@ static struct musb_hdrc_config musb_config = { }; #ifdef CONFIG_AM335X_USB0 -static void am33xx_otg0_set_phy_power(u8 on) +static void am33xx_otg0_set_phy_power(struct udevice *dev, u8 on) { am33xx_usb_set_phy_power(on, &cdev->usb_ctrl0); } @@ -167,7 +167,7 @@ static struct musb_hdrc_platform_data otg0_plat = { #endif #ifdef CONFIG_AM335X_USB1 -static void am33xx_otg1_set_phy_power(u8 on) +static void am33xx_otg1_set_phy_power(struct udevice *dev, u8 on) { am33xx_usb_set_phy_power(on, &cdev->usb_ctrl1); } diff --git a/arch/arm/mach-omap2/omap3/am35x_musb.c b/arch/arm/mach-omap2/omap3/am35x_musb.c index 74dd105eb6..d542699ab0 100644 --- a/arch/arm/mach-omap2/omap3/am35x_musb.c +++ b/arch/arm/mach-omap2/omap3/am35x_musb.c @@ -13,7 +13,7 @@ #include #include -void am35x_musb_reset(void) +void am35x_musb_reset(struct udevice *dev) { /* Reset the musb interface */ clrsetbits_le32(&am35x_scm_general_regs->ip_sw_reset, @@ -22,7 +22,7 @@ void am35x_musb_reset(void) USBOTGSS_SW_RST, 0); } -void am35x_musb_phy_power(u8 on) +void am35x_musb_phy_power(struct udevice *dev, u8 on) { unsigned long start = get_timer(0); @@ -53,7 +53,7 @@ void am35x_musb_phy_power(u8 on) } } -void am35x_musb_clear_irq(void) +void am35x_musb_clear_irq(struct udevice *dev) { clrsetbits_le32(&am35x_scm_general_regs->lvl_intr_clr, 0, USBOTGSS_INT_CLR); -- cgit