[OpenWrt-Devel] ath79: Force usb host mode for ar9331

Piotr Dymacz pepe2k at gmail.com
Fri Nov 8 05:01:28 EST 2019


Hi Micke,

On 08.11.2019 08:36, Micke Prag wrote:
> In commit 00ea16557d [1] the way usb is initiated was changed. Instead
> of initiate both ehci-platform and ci_hdrc the bootstrap status register
> is checked and used to determine which platform to initiate.

There were other changes later, see for example 57c641ba6e.

> Unfortunately this break my board since the gpio used to determine this
> is used for other purposes.

This means your board has a wrong bootstrap configuration and you should 
make sure GPIO for host/device mode has correct initialization value.

> dev-usb.h only exposes one function:
> void ath79_register_usb(void);
> so there is not much to alter the way usb is initiated.
> 
> I tried to write to the bootstrap register but unfortunately this did
> not seem to work:
> 
> u32 t;
> t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
> pr_warn("ath79: Register before %X", t);
> t |= AR933X_BOOTSTRAP_USB_MODE_HOST;
> ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);
> pr_warn("ath79: Register after %X",
> ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP));
> 
> Gives the following output:
> 
> ath79: Register before 42202
> ath79: Register after 42202
USB mode in AR9331 is selected at power on, based on GPIO13 value and 
I'm not aware of any other/software ways to change it. AFAIK, only 
QCA9563 allows to switch between host and device modes 'on the fly'.

> How can I solve this?

Only in hardware I suppose (setup correct initial value on GPIO13).

-- 
Cheers,
Piotr

> 
> 
> [1] https://github.com/openwrt/openwrt/commit/00ea16557d
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list