From 3de673a8ca5a326fcef8ebf05e9ee973cf2adfde Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 20 Feb 2019 10:00:10 +0100 Subject: [PATCH] dde_linux/usb: remove deprecated APIs on ARM Issue #1987 --- repos/dde_linux/src/drivers/usb_host/main.cc | 2 +- .../dde_linux/src/drivers/usb_host/platform.h | 2 +- .../drivers/usb_host/spec/arndale/platform.cc | 2 +- .../usb_host/spec/imx6q_sabrelite/platform.cc | 2 +- .../usb_host/spec/odroid_x2/platform.cc | 2 +- .../drivers/usb_host/spec/panda/platform.cc | 2 +- .../src/drivers/usb_host/spec/rpi/platform.cc | 2 +- .../src/drivers/usb_host/spec/x86/platform.cc | 2 +- .../dde_linux/src/lib/usb/include/platform.h | 2 +- repos/dde_linux/src/lib/usb/main.cc | 2 +- .../src/lib/usb/spec/arm/platform_device.cc | 3 ++- .../src/lib/usb/spec/arndale/platform.cc | 16 +++++++------- .../src/lib/usb/spec/odroid_x2/platform.cc | 22 +++++++++---------- .../src/lib/usb/spec/panda/platform.cc | 6 ++--- .../src/lib/usb/spec/rpi/platform.cc | 4 ++-- .../src/lib/usb/spec/x86/platform.cc | 2 +- 16 files changed, 37 insertions(+), 36 deletions(-) diff --git a/repos/dde_linux/src/drivers/usb_host/main.cc b/repos/dde_linux/src/drivers/usb_host/main.cc index 81f1947f2e..dc9664d497 100644 --- a/repos/dde_linux/src/drivers/usb_host/main.cc +++ b/repos/dde_linux/src/drivers/usb_host/main.cc @@ -57,7 +57,7 @@ static void run_linux(void *s) subsys_usb_init(); /* host controller */ - platform_hcd_init(services); + platform_hcd_init(Lx_kit::env().env(), services); while (true) Lx::scheduler().current()->block_and_schedule(); diff --git a/repos/dde_linux/src/drivers/usb_host/platform.h b/repos/dde_linux/src/drivers/usb_host/platform.h index b1de5191a3..b62a3e7178 100644 --- a/repos/dde_linux/src/drivers/usb_host/platform.h +++ b/repos/dde_linux/src/drivers/usb_host/platform.h @@ -44,7 +44,7 @@ struct Services void backend_alloc_init(Genode::Env &env, Genode::Ram_allocator &ram, Genode::Allocator &alloc); -void platform_hcd_init(Services *services); +void platform_hcd_init(Genode::Env &env, Services *services); Genode::Irq_session_capability platform_irq_activate(int irq); #endif /* _PLATFORM_H_ */ diff --git a/repos/dde_linux/src/drivers/usb_host/spec/arndale/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/arndale/platform.cc index 89acfff92f..444b3d2565 100644 --- a/repos/dde_linux/src/drivers/usb_host/spec/arndale/platform.cc +++ b/repos/dde_linux/src/drivers/usb_host/spec/arndale/platform.cc @@ -333,7 +333,7 @@ void xhci_setup(Services *services) } -void platform_hcd_init(Services *services) +void platform_hcd_init(Genode::Env &, Services *services) { ehci_setup(services); xhci_setup(services); diff --git a/repos/dde_linux/src/drivers/usb_host/spec/imx6q_sabrelite/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/imx6q_sabrelite/platform.cc index 7c5a79565b..836520af64 100644 --- a/repos/dde_linux/src/drivers/usb_host/spec/imx6q_sabrelite/platform.cc +++ b/repos/dde_linux/src/drivers/usb_host/spec/imx6q_sabrelite/platform.cc @@ -22,7 +22,7 @@ extern "C" int postcore_mxs_phy_module_init(); extern "C" void module_ehci_hcd_init(); extern "C" void module_xhci_hcd_init(); -void platform_hcd_init(Services *services) +void platform_hcd_init(Genode::Env &, Services *services) { module_ehci_hcd_init(); module_ci_hdrc_platform_register(); diff --git a/repos/dde_linux/src/drivers/usb_host/spec/odroid_x2/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/odroid_x2/platform.cc index 21e1b6fde1..6e5db5e49b 100644 --- a/repos/dde_linux/src/drivers/usb_host/spec/odroid_x2/platform.cc +++ b/repos/dde_linux/src/drivers/usb_host/spec/odroid_x2/platform.cc @@ -183,7 +183,7 @@ extern "C" int module_usbnet_init(); extern "C" int module_smsc95xx_driver_init(); -void platform_hcd_init(Services *services) +void platform_hcd_init(Genode::Env &, Services *services) { /* register EHCI controller */ module_ehci_exynos_init(); diff --git a/repos/dde_linux/src/drivers/usb_host/spec/panda/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/panda/platform.cc index 291c9203d6..ff7ebbf27a 100644 --- a/repos/dde_linux/src/drivers/usb_host/spec/panda/platform.cc +++ b/repos/dde_linux/src/drivers/usb_host/spec/panda/platform.cc @@ -277,7 +277,7 @@ extern "C" void module_ehci_omap_init(); extern "C" int module_usbnet_init(); extern "C" int module_smsc95xx_driver_init(); -void platform_hcd_init(Services *services) +void platform_hcd_init(Genode::Env &, Services *services) { /* register EHCI controller */ module_ehci_omap_init(); diff --git a/repos/dde_linux/src/drivers/usb_host/spec/rpi/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/rpi/platform.cc index 4d76d02611..15f1926692 100644 --- a/repos/dde_linux/src/drivers/usb_host/spec/rpi/platform.cc +++ b/repos/dde_linux/src/drivers/usb_host/spec/rpi/platform.cc @@ -55,7 +55,7 @@ static resource _dwc_otg_resource[] = extern "C" void module_dwc_otg_driver_init(); extern bool fiq_enable, fiq_fsm_enable; -void platform_hcd_init(Services *services) +void platform_hcd_init(Genode::Env &, Services *services) { /* enable USB power */ Platform::Connection platform(services->env); diff --git a/repos/dde_linux/src/drivers/usb_host/spec/x86/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/x86/platform.cc index 9773e9ac15..9d9df2c9bf 100644 --- a/repos/dde_linux/src/drivers/usb_host/spec/x86/platform.cc +++ b/repos/dde_linux/src/drivers/usb_host/spec/x86/platform.cc @@ -221,7 +221,7 @@ extern "C" void module_uhci_hcd_init(); extern "C" void module_xhci_hcd_init(); extern "C" void module_xhci_pci_init(); -void platform_hcd_init(Services *s) +void platform_hcd_init(Genode::Env &, Services *s) { module_xhci_hcd_init(); module_xhci_pci_init(); diff --git a/repos/dde_linux/src/lib/usb/include/platform.h b/repos/dde_linux/src/lib/usb/include/platform.h index c6b4bfcd43..44da5412bf 100644 --- a/repos/dde_linux/src/lib/usb/include/platform.h +++ b/repos/dde_linux/src/lib/usb/include/platform.h @@ -129,7 +129,7 @@ struct Services void backend_alloc_init(Genode::Env &env, Genode::Ram_allocator &ram, Genode::Allocator &alloc); -void platform_hcd_init(Services *services); +void platform_hcd_init(Genode::Env &, Services *services); Genode::Irq_session_capability platform_irq_activate(int irq); #endif /* _PLATFORM_H_ */ diff --git a/repos/dde_linux/src/lib/usb/main.cc b/repos/dde_linux/src/lib/usb/main.cc index d165bfe716..584c9e29ab 100644 --- a/repos/dde_linux/src/lib/usb/main.cc +++ b/repos/dde_linux/src/lib/usb/main.cc @@ -97,7 +97,7 @@ static void run_linux(void *s) module_usb_storage_driver_init(); /* host controller */ - platform_hcd_init(services); + platform_hcd_init(Lx_kit::env().env(), services); while (true) Lx::scheduler().current()->block_and_schedule(); diff --git a/repos/dde_linux/src/lib/usb/spec/arm/platform_device.cc b/repos/dde_linux/src/lib/usb/spec/arm/platform_device.cc index a4f896577a..842d0ef253 100644 --- a/repos/dde_linux/src/lib/usb/spec/arm/platform_device.cc +++ b/repos/dde_linux/src/lib/usb/spec/arm/platform_device.cc @@ -15,6 +15,7 @@ #include #include +#include #define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ driver)) @@ -199,7 +200,7 @@ void *_ioremap(phys_addr_t phys_addr, unsigned long size, int wc) { try { Genode::Attached_io_mem_dataspace *ds = new(Lx::Malloc::mem()) - Genode::Attached_io_mem_dataspace(phys_addr, size, !!wc); + Genode::Attached_io_mem_dataspace(Lx_kit::env().env(), phys_addr, size, !!wc); return ds->local_addr(); } catch (...) { panic("Failed to request I/O memory: [%lx,%lx)", phys_addr, phys_addr + size); diff --git a/repos/dde_linux/src/lib/usb/spec/arndale/platform.cc b/repos/dde_linux/src/lib/usb/spec/arndale/platform.cc index 509054ddae..cc017f3b33 100644 --- a/repos/dde_linux/src/lib/usb/spec/arndale/platform.cc +++ b/repos/dde_linux/src/lib/usb/spec/arndale/platform.cc @@ -120,10 +120,10 @@ static void arndale_ehci_init(Genode::Env &env) enum Gpio_offset { D1 = 0x180, X3 = 0xc60 }; /* enable USB3 clock and power up */ - static Regulator::Connection reg_clk(Regulator::CLK_USB20); + static Regulator::Connection reg_clk(env, Regulator::CLK_USB20); reg_clk.state(true); - static Regulator::Connection reg_pwr(Regulator::PWR_USB20); + static Regulator::Connection reg_pwr(env, Regulator::PWR_USB20); reg_pwr.state(true); /* reset hub via GPIO */ @@ -200,9 +200,9 @@ struct Phy_usb3 : Genode::Mmio struct Phy_resume : Register<0x34, 32> { }; - Phy_usb3 (addr_t const base) : Mmio(base) + Phy_usb3 (Genode::Env &env, addr_t const base) : Mmio(base) { - Timer::Connection timer; + Timer::Connection timer(env); /* reset */ write(0); @@ -269,15 +269,15 @@ struct Phy_usb3 : Genode::Mmio static void arndale_xhci_init(Genode::Env &env) { /* enable USB3 clock and power up */ - static Regulator::Connection reg_clk(Regulator::CLK_USB30); + static Regulator::Connection reg_clk(env, Regulator::CLK_USB30); reg_clk.state(true); - static Regulator::Connection reg_pwr(Regulator::PWR_USB30); + static Regulator::Connection reg_pwr(env, Regulator::PWR_USB30); reg_pwr.state(true); /* setup PHY */ Attached_io_mem_dataspace io_phy(env, DWC3_PHY_BASE, 0x1000); - Phy_usb3 phy((addr_t)io_phy.local_addr()); + Phy_usb3 phy(env, (addr_t)io_phy.local_addr()); } @@ -343,7 +343,7 @@ void xhci_setup(Services *services) } -void platform_hcd_init(Services *services) +void platform_hcd_init(Genode::Env &, Services *services) { /* register network */ if (services->nic) diff --git a/repos/dde_linux/src/lib/usb/spec/odroid_x2/platform.cc b/repos/dde_linux/src/lib/usb/spec/odroid_x2/platform.cc index 85eaf85123..383a5f990c 100644 --- a/repos/dde_linux/src/lib/usb/spec/odroid_x2/platform.cc +++ b/repos/dde_linux/src/lib/usb/spec/odroid_x2/platform.cc @@ -74,9 +74,9 @@ struct Ehci : Genode::Mmio */ struct Usb_Otg : Genode::Mmio { - Usb_Otg(Genode::addr_t base):Genode::Mmio (base) + Usb_Otg(Genode::Env &env, Genode::addr_t base):Genode::Mmio (base) { - Timer::Connection timer; + Timer::Connection timer(env); unsigned int rstcon_mask = 0; unsigned int phyclk_mask = 5; unsigned int phypwr_mask = 0; @@ -119,13 +119,13 @@ struct Usb_Otg : Genode::Mmio struct Rstcon : Register <0x8,32>{}; }; -static void clock_pwr_init() +static void clock_pwr_init(Env &env) { /* enable USB2 clock and power up */ - static Regulator::Connection reg_clk(Regulator::CLK_USB20); + static Regulator::Connection reg_clk(env, Regulator::CLK_USB20); reg_clk.state(true); - static Regulator::Connection reg_pwr(Regulator::PWR_USB20); + static Regulator::Connection reg_pwr(env, Regulator::PWR_USB20); reg_pwr.state(true); } @@ -133,21 +133,21 @@ static void usb_phy_init(Genode::Env &env) { Io_mem_connection io_usbotg(env, USBOTG, 0x1000); addr_t usbotg_base = (addr_t)env.rm().attach(io_usbotg.dataspace()); - Usb_Otg usbotg(usbotg_base); + Usb_Otg usbotg(env, usbotg_base); env.rm().detach(usbotg_base); } static void odroidx2_ehci_init(Genode::Env &env) { - clock_pwr_init(); + clock_pwr_init(env); usb_phy_init(env); /* reset hub via GPIO */ enum { X30 = 294, X34 = 298, X35 = 299 }; - Gpio::Connection gpio_x30(X30); - Gpio::Connection gpio_x34(X34); - Gpio::Connection gpio_x35(X35); + Gpio::Connection gpio_x30(env, X30); + Gpio::Connection gpio_x34(env, X34); + Gpio::Connection gpio_x35(env, X35); /* Set Ref freq 0 => 24MHz, 1 => 26MHz*/ /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */ @@ -203,7 +203,7 @@ void ehci_setup(Services *services) platform_device_register(pdev); } -void platform_hcd_init(Services *services) +void platform_hcd_init(Genode::Env &, Services *services) { /* register network */ if (services->nic){ diff --git a/repos/dde_linux/src/lib/usb/spec/panda/platform.cc b/repos/dde_linux/src/lib/usb/spec/panda/platform.cc index de3e20b197..618f409fa6 100644 --- a/repos/dde_linux/src/lib/usb/spec/panda/platform.cc +++ b/repos/dde_linux/src/lib/usb/spec/panda/platform.cc @@ -236,8 +236,8 @@ static void omap_ehci_init(Genode::Env &env) Aux3 aux3(scrm_base); /* init GPIO */ - Gpio::Connection gpio_power(HUB_POWER); - Gpio::Connection gpio_reset(HUB_NRESET); + Gpio::Connection gpio_power(env, HUB_POWER); + Gpio::Connection gpio_reset(env, HUB_NRESET); /* disable the hub power and reset before init */ gpio_power.direction(Gpio::Session::OUT); @@ -277,7 +277,7 @@ extern "C" void module_ehci_omap_init(); extern "C" int module_usbnet_init(); extern "C" int module_smsc95xx_driver_init(); -void platform_hcd_init(Services *services) +void platform_hcd_init(Genode::Env &, Services *services) { if (!services->ehci) return; diff --git a/repos/dde_linux/src/lib/usb/spec/rpi/platform.cc b/repos/dde_linux/src/lib/usb/spec/rpi/platform.cc index b16e520879..771c016403 100644 --- a/repos/dde_linux/src/lib/usb/spec/rpi/platform.cc +++ b/repos/dde_linux/src/lib/usb/spec/rpi/platform.cc @@ -160,10 +160,10 @@ extern "C" void module_dwc_otg_driver_init(); extern "C" int module_usbnet_init(); extern "C" int module_smsc95xx_driver_init(); -void platform_hcd_init(Services *services) +void platform_hcd_init(Env &env, Services *services) { /* enable USB power */ - Platform::Connection platform; + Platform::Connection platform(env); platform.power_state(Platform::Session::POWER_USB_HCD, true); /* register network */ diff --git a/repos/dde_linux/src/lib/usb/spec/x86/platform.cc b/repos/dde_linux/src/lib/usb/spec/x86/platform.cc index 7d7fcd4cb7..4646c3da69 100644 --- a/repos/dde_linux/src/lib/usb/spec/x86/platform.cc +++ b/repos/dde_linux/src/lib/usb/spec/x86/platform.cc @@ -26,7 +26,7 @@ extern "C" void module_uhci_hcd_init(); extern "C" void module_xhci_hcd_init(); extern "C" void module_xhci_pci_init(); -void platform_hcd_init(Services *s) +void platform_hcd_init(Genode::Env &, Services *s) { if (s->nic) { module_usbnet_init();